-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat: make configuration page as optional #1521
base: develop
Are you sure you want to change the base?
Conversation
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.
seems good just one minor thing that configuration page is technically handled, so there isn't any entry point but if you directly type url it displays empty page. We can handle it in separate PR
Signed-off-by: Viktor Tsvetkov <142901247+vtsvetkov-splunk@users.noreply.github.com>
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.
what's weird we keep generated file in git
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.
Yes, I agree. It is present in other expected add-ons as well. I think we can clean up all the files altogether in a separate PR.
I had checked it in my VM, when we add |
Ok, then it has to be caching on my side, i will double check but thats a minor problem as there shouldn't be any access point to this page anyway. |
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.
🚀
If configuration, inputs and dashboard pages are optional - should we make pages optional as well? So that we can support
EDIT: if we decide so - it deserves a separate small PR. |
Yes, we will be covering that in |
@@ -40,14 +43,20 @@ def generate_nav_default_xml( | |||
""" | |||
nav = ET.Element("nav") | |||
if include_inputs: | |||
if default_view == "inputs": | |||
if ( | |||
not (include_configuration) and default_view == "configuration" |
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.
not (include_configuration) and default_view == "configuration"
This is a strange condition. It would be good to change _validate_meta_default_view
method in global_config_validator.py
to not allow this value when there is no configuration page and change this condition.
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 agree with Kamil. _validate_meta_default_view
already checks, for input
and dashboard
, if default view is present in the global config and raises an error if not, so in my opinion it would be the best to expand it to configuration
as well.
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.
Have updated the logic and added validation in _validate_meta_default_view
function
@@ -40,14 +43,20 @@ def generate_nav_default_xml( | |||
""" | |||
nav = ET.Element("nav") | |||
if include_inputs: | |||
if default_view == "inputs": | |||
if ( | |||
not (include_configuration) and default_view == "configuration" |
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 agree with Kamil. _validate_meta_default_view
already checks, for input
and dashboard
, if default view is present in the global config and raises an error if not, so in my opinion it would be the best to expand it to configuration
as well.
Issue number:
ADDON-76819
PR Type
What kind of change does this PR introduce?
Summary
Set configuration as an optional key in
globalConfig.json
.Changes
Made configuration page optional in
schema.json
, So that users can have an add-on UI without Configuration page.Also added a smoke testcase which captures this behaviour.
User experience
Now, user can build their add-on without specifying
configuration
in theirglobalConfig.json
. Users now can have a UI without Configuration page for their add-on.Checklist
If an item doesn't apply to your changes, leave it unchecked.