Skip to content

Commit

Permalink
feat: add optional label for helpLink component (#939)
Browse files Browse the repository at this point in the history
* feat: add optional label for helpLink component

* fix: align new lines

* test: update smoke test

---------

Co-authored-by: Artem Rys <rysartem@gmail.com>
  • Loading branch information
soleksy-splunk and artemrys authored Nov 6, 2023
1 parent 78433fe commit e3a9b40
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 3 deletions.
3 changes: 2 additions & 1 deletion splunk_add_on_ucc_framework/global_config_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ def _validate_entity_duplicates(self, entity: List[Dict[str, Any]]) -> None:
fields, labels = [], []
for _entity in entity:
fields.append(_entity["field"].lower())
labels.append(_entity["label"].lower())
if "label" in _entity:
labels.append(_entity["label"].lower())
options = _entity.get("options")
if options and options.get("autoCompleteFields"):
self._validate_autoCompleteFields_duplicates(
Expand Down
10 changes: 9 additions & 1 deletion splunk_add_on_ucc_framework/schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,15 @@
}
}
},
"required": ["field", "label", "type"],
"anyOf": [
{
"properties": {
"type": { "const": "helpLink" }
},
"required": ["field", "type"]
},
{ "required": ["field", "label", "type"] }
],
"additionalProperties": false
},
"ConfigurationPage": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ account_checkbox =
account_radio =
account_multiple_select =
example_help_link =
config1_help_link =
config2_help_link =
username =
password =
token =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@
default=None,
validator=None
),
field.RestField(
'config1_help_link',
required=False,
encrypted=False,
default=None,
validator=None
),
field.RestField(
'config2_help_link',
required=False,
encrypted=False,
default=None,
validator=None
),
field.RestField(
'username',
required=False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,22 @@
"text": "Help Link",
"link": "https://docs.splunk.com/Documentation"
}
},
{
"field": "config1_help_link",
"type": "helpLink",
"options": {
"text": "Add-on configuration documentation",
"link": "https://docs.splunk.com/Documentation"
}
},
{
"field": "config2_help_link",
"type": "helpLink",
"options": {
"text": "SSL configuration documentation",
"link": "https://docs.splunk.com/Documentation"
}
}
],
"title": "Account"
Expand Down Expand Up @@ -1302,7 +1318,7 @@
"meta": {
"name": "Splunk_TA_UCCExample",
"restRoot": "splunk_ta_uccexample",
"version": "5.31.1Rdd3a1ca0",
"version": "5.32.0Rf6551a7f",
"displayName": "Splunk UCC test Add-on",
"schemaVersion": "0.0.3"
}
Expand Down

0 comments on commit e3a9b40

Please sign in to comment.