-
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: add option to disable inputs on creation #1510
base: develop
Are you sure you want to change the base?
Conversation
docs/inputs/index.md
Outdated
@@ -43,6 +43,7 @@ provided, a dropdown field will appear on the Inputs page. In contrast, a button | |||
| [restHandlerModule](../advanced/custom_rest_handler.md) | string | It specify name of the REST handler script that implements the custom actions to be performed on CRUD operations for the given input. (Use with restHandlerClass) | | |||
| [restHandlerClass](../advanced/custom_rest_handler.md) | string | It specify name of the class present in the restHandlerModule, which implements methods like handleCreate, handleEdit, handleList, handleDelete and is child class of splunktaucclib.rest_handler.admin_external.AdminExternalHandler. (Use with restHandlerModule) | | |||
| hideForPlatform | string | Defines for which platform element should be hidden from UI perspective. Currently only two platforms are supported `cloud` or `enterprise`. | | |||
| disabled | boolean | Specifies whether a service should be disabled by default or not. If set to `True`, any new input created from the service will remain disabled until manually enabled by the user. | |
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 is the default?
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.
Default is set to false
. I'll add it in the docs.
@@ -1,4 +1,7 @@ | |||
{% for input_name in input_names %} | |||
{{ "[" ~ input_name ~ "]"}} | |||
python.version = python3 | |||
{% if disabled and service_name == input_name%} |
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 see there is this comparison. Wouldn't it be easier to edit input's rest handler and use default
in the RestField
?
field.RestField(
'disabled',
required=False,
validator=None,
default={{ disabled }}
)
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.
Adding it in the RH file would require the disabled property to be explicitly sent in the payload. Moreover, to enable or disable inputs, they have a dedicated endpoint which triggers the enabling and disabling of the input, hence we'd require to set it in inputs.conf
as to define the nature of newly created inputs.
Issue number: ADDON-75879
PR Type
What kind of change does this PR introduce?
Summary
Added a new argument so that users can disable their newly created input of a service.
Changes
Introduced a new argument (
disableNewInput
) in services, so that users can specify whether a service's new input should be disabled on creation or not.User experience
Users can now have disabled inputs on creation, If they mention
disableNewInput = True
in their globalConfig.Checklist
If an item doesn't apply to your changes, leave it unchecked.