-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add enum extension #366
Add enum extension #366
Conversation
@@ -172,7 +172,7 @@ def parse_arg_help(help): | |||
if not help.lines and not help.ref_commands: | |||
if not help.short: | |||
raise exceptions.InvalidAPIUsage("Invalid argument help, short summary is miss.") | |||
return help.short | |||
return help.short.replace("\r", "").replace("\n", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For short summary, I think it's better keep only the first line. And append the rests into long summary when generate the arg help. Please do not add these logic in the cli generators. It should be fixed when generate the commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can revoke the change and arise another PR.
please update the doc as well |
src/web/src/views/workspace/WSEditorCommandArgumentsContent.tsx
Outdated
Show resolved
Hide resolved
@@ -36,6 +36,7 @@ class CMDArgEnum(Model): | |||
|
|||
# properties as nodes | |||
items = ListType(ModelType(CMDArgEnumItem), min_size=1) | |||
supportExtension = CMDBooleanField() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please reference this way using serialized_name
and deserialize_from
aaz-dev-tools/src/aaz_dev/command/model/editor/_workspace.py
Lines 29 to 33 in 0276135
command_groups = DictType( | |
field=ModelType("CMDCommandTreeNode"), | |
serialized_name='commandGroups', | |
deserialize_from='commandGroups' | |
) |
@@ -50,6 +54,7 @@ def build_enum(cls, schema_enum, ref_enum): | |||
break | |||
item = CMDArgEnumItem.build_enum_item(schema_item, ref_enum_item) | |||
enum.items.append(item) | |||
enum.support_extension = schema_enum.support_extension |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line could cause problem. Did you try reload button after set the True value in editor? After reload, the value may be false. BTW, please also verify the inherent function.
support_extension = CMDBooleanField( | ||
serialized_name="supportExtension", | ||
deserialize_from="supportExtension", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems in current design, this property may not be needed in Schema
Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com>
No description provided.