Skip to content

Commit

Permalink
chore: update the argument name
Browse files Browse the repository at this point in the history
  • Loading branch information
hetangmodi-crest committed Dec 24, 2024
1 parent e45124c commit 4b43a44
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 39 deletions.
2 changes: 1 addition & 1 deletion docs/inputs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +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. |
| disableNewInput | boolean | Specifies whether a service's new input should be disabled on creation or not. If set to `True`, any new input created from the service will remain disabled until manually enabled by the user. Default: false |

### Usage

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def _set_attributes(self, **kwargs: Any) -> None:
if self._global_config:
for service in self._global_config.inputs:
properties = []
if service.get("disabled") is True:
if service.get("disableNewInput"):
self.disable = True
self.service_name = service["name"]
if service.get("conf") is not None:
Expand Down
14 changes: 7 additions & 7 deletions splunk_add_on_ucc_framework/schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@
"encrypted": {
"$ref": "#/definitions/encrypted"
},
"validators":{
"validators": {
"$ref": "#/definitions/AnyValidator"
},
"options": {
Expand Down Expand Up @@ -2299,7 +2299,7 @@
"modifyFieldsOnValue": {
"$ref": "#/definitions/modifyFieldsOnValue"
},
"validators":{
"validators": {
"$ref": "#/definitions/AnyValidator"
}
},
Expand Down Expand Up @@ -2544,7 +2544,7 @@
],
"additionalProperties": false
},
"AnyValidator":{
"AnyValidator": {
"type": "array",
"description": "It is used to validate the values of fields using various validators.",
"items": {
Expand Down Expand Up @@ -3094,9 +3094,9 @@
"warning": {
"$ref": "#/definitions/WarningMessage"
},
"disabled": {
"disableNewInput": {
"type": "boolean",
"description": "Declares if service should be disabled by default",
"description": "Defines whether a newly created input of a service should be disabled by default.",
"default": false
},
"hideForPlatform": {
Expand Down Expand Up @@ -3221,7 +3221,7 @@
"table",
"entity"
]
},
},
"hideForPlatform": {
"$ref": "#/definitions/HideForPlatform"
}
Expand Down Expand Up @@ -3340,7 +3340,7 @@
],
"additionalProperties": false
},
"HideForPlatform":{
"HideForPlatform": {
"description": "Defines for which platform element should be hidden from UI perspective.",
"anyOf": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1607,7 +1607,7 @@
}
],
"title": "Example Input Four",
"disabled": true
"disableNewInput": true
},
{
"name": "service_hidden_for_cloud",
Expand Down Expand Up @@ -1907,7 +1907,7 @@
"meta": {
"name": "Splunk_TA_UCCExample",
"restRoot": "splunk_ta_uccexample",
"version": "5.55.0+cdd3f31ed",
"version": "5.55.0+e45124ce1",
"displayName": "Splunk UCC test Add-on",
"schemaVersion": "0.0.9",
"_uccVersion": "5.55.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def test_set_attributes_without_conf_key_and_name_field(
)
inputs_conf._global_config = MagicMock()
inputs_conf._global_config.inputs = [
{"name": "service1", "entity": [{"field": "name"}], "disabled": True}
{"name": "service1", "entity": [{"field": "name"}], "disableNewInput": True}
]

inputs_conf._set_attributes()
Expand Down
67 changes: 41 additions & 26 deletions tests/unit/testdata/valid_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,9 @@
"options": {
"isExpandable": true
},
"fields": ["collectFolderMetadata"]
"fields": [
"collectFolderMetadata"
]
}
],
"rows": [
Expand All @@ -902,7 +904,10 @@
"validators": [
{
"type": "number",
"range": [1, 1200]
"range": [
1,
1200
]
}
]
}
Expand Down Expand Up @@ -968,7 +973,10 @@
"validators": [
{
"type": "number",
"range": [1, 1200]
"range": [
1,
1200
]
}
]
}
Expand Down Expand Up @@ -1009,15 +1017,19 @@
"isExpandable": true,
"expand": true
},
"fields": ["collectFolderCollaboration"]
"fields": [
"collectFolderCollaboration"
]
},
{
"label": "Group 3",
"options": {
"isExpandable": true,
"expand": true
},
"fields": ["collectFolderMetadata"]
"fields": [
"collectFolderMetadata"
]
}
],
"rows": [
Expand Down Expand Up @@ -1090,7 +1102,10 @@
"validators": [
{
"type": "number",
"range": [1, 60]
"range": [
1,
60
]
}
]
}
Expand All @@ -1100,7 +1115,7 @@
}
],
"title": "Example Input Two",
"disabled": true
"disableNewInput": true
}
],
"title": "Inputs",
Expand Down Expand Up @@ -1316,29 +1331,29 @@
"schemaVersion": "0.0.3",
"os-dependentLibraries": [
{
"name": "cryptography",
"version": "41.0.5",
"platform": "win_amd64",
"python_version": "37",
"os": "windows",
"target": "3rdparty/windows"
"name": "cryptography",
"version": "41.0.5",
"platform": "win_amd64",
"python_version": "37",
"os": "windows",
"target": "3rdparty/windows"
},
{
"name": "cryptography",
"version": "41.0.5",
"platform": "macosx_10_12_universal2",
"python_version": "37",
"os": "darwin",
"target": "3rdparty/darwin"
"name": "cryptography",
"version": "41.0.5",
"platform": "macosx_10_12_universal2",
"python_version": "37",
"os": "darwin",
"target": "3rdparty/darwin"
},
{
"name": "cryptography",
"version": "41.0.5",
"dependencies": true,
"platform": "manylinux2014_x86_64",
"python_version": "37",
"os": "linux",
"target": "3rdparty/linux"
"name": "cryptography",
"version": "41.0.5",
"dependencies": true,
"platform": "manylinux2014_x86_64",
"python_version": "37",
"os": "linux",
"target": "3rdparty/linux"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion ui/src/types/globalConfig/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const TableLessServiceSchema = z.object({
restHandlerClass: z.string().optional(),
warning: WarningSchema,
inputHelperModule: z.string().optional(),
disabled: z.boolean().optional(),
disableNewInput: z.boolean().optional(),
hideForPlatform: z.enum(['cloud', 'enterprise']).optional(),
});

Expand Down

0 comments on commit 4b43a44

Please sign in to comment.