🔧 fix(directory_reader.py): change component name from snake_case to CamelCase for better UI display
📝 chore(directory_reader.py): add comments to explain the purpose of changing the component name
This commit is contained in:
parent
8db39dbb30
commit
c11204d3c5
1 changed files with 7 additions and 1 deletions
|
|
@ -224,9 +224,15 @@ class DirectoryReader:
|
||||||
"path": os.path.dirname(file_path),
|
"path": os.path.dirname(file_path),
|
||||||
"components": [],
|
"components": [],
|
||||||
}
|
}
|
||||||
|
component_name = filename.split(".")[0]
|
||||||
|
# This is the name of the file which will be displayed in the UI
|
||||||
|
# We need to change it from snake_case to CamelCase
|
||||||
|
camel_case_name = " ".join(
|
||||||
|
word.title() for word in component_name.split("_")
|
||||||
|
)
|
||||||
|
|
||||||
component_info = {
|
component_info = {
|
||||||
"name": filename.split(".")[0],
|
"name": camel_case_name,
|
||||||
"file": filename,
|
"file": filename,
|
||||||
"code": result_content if validation_result else "",
|
"code": result_content if validation_result else "",
|
||||||
"error": "" if validation_result else result_content,
|
"error": "" if validation_result else result_content,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue