Skip to content

Commit

Permalink
feat: confirmation modal when activate/deactivate single input (#1421)
Browse files Browse the repository at this point in the history
**Issue number:**
https://splunk.atlassian.net/browse/ADDON-76193 
## Summary

### Changes

Property useInputToggleConfirmation added to inputs page schema for both
single table services and separated tab services. It enables additional
confirmation pop-up when changing input status.

### User experience

When useInputToggleConfirmation set to true additional confirmation menu
is displayed when toggling input status.


Inactive into  Active
<img width="1486" alt="Screenshot 2024-10-31 at 03 34 29"
src="https://github.com/user-attachments/assets/cad39920-6453-4ea9-b2b3-dbdba44e0ea8">


Active into Inactive
<img width="1488" alt="Screenshot 2024-10-31 at 03 34 19"
src="https://github.com/user-attachments/assets/5dfeea4f-5807-4c65-b681-74298ac42e46">


## Checklist

If your change doesn't seem to apply, please leave them unchecked.

* [x] I have performed a self-review of this change
* [x] Changes have been tested
* [x] Changes are documented
* [x] PR title follows [conventional commit
semantics](https://www.conventionalcommits.org/en/v1.0.0/)

---------

Co-authored-by: Viktor Tsvetkov <[email protected]>
  • Loading branch information
soleksy-splunk and vtsvetkov-splunk authored Nov 26, 2024
1 parent b3877c7 commit 34c8ec2
Show file tree
Hide file tree
Showing 11 changed files with 608 additions and 46 deletions.
23 changes: 12 additions & 11 deletions docs/inputs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ provided, a dropdown field will appear on the Inputs page. In contrast, a button

### Properties

| Property | Type | Description |
| ------------------------------------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| title<span class="required-asterisk">\*</span> | string | - |
| description | string | It provides a brief summary of an inputs page. |
| [subDescription](../advanced/sub_description.md) | object | It provides broader description of an inputs page. |
| menu | object | This property allows you to enable the [custom menu](../custom_ui_extensions/custom_menu.md) feature. |
| [table](../table.md) | object | It displays input stanzas in a tabular format. |
| groupsMenu | array | This property allows you to enable the [multi-level menu](./multilevel_menu.md) feature. |
| [services](#services-properties)<span class="required-asterisk">\*</span> | array | It specifies a list of modular inputs. |
| readonlyFieldId | string | A field of the boolean entity that UCC checks for each input. If the field's value is [truthful](https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/ListOfDataTypes), the corresponding input cannot be edited from the UI. There is no way to change this from the UI; it is supposed to be changed via REST. |
| hideFieldId | string | A field of the boolean entity that UCC checks for each input. If the field's value is [truthful](https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/ListOfDataTypes), the corresponding input is hidden from the UI. There is no way to change this from the UI; it is supposed to be changed via REST. Check out an example below. |
| Property | Type | Description |
| ------------------------------------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| title<span class="required-asterisk">\*</span> | string | - |
| description | string | It provides a brief summary of an inputs page. |
| [subDescription](../advanced/sub_description.md) | object | It provides broader description of an inputs page. |
| menu | object | This property allows you to enable the [custom menu](../custom_ui_extensions/custom_menu.md) feature. |
| [table](../table.md) | object | It displays input stanzas in a tabular format. |
| groupsMenu | array | This property allows you to enable the [multi-level menu](./multilevel_menu.md) feature. |
| [services](#services-properties)<span class="required-asterisk">\*</span> | array | It specifies a list of modular inputs. |
| readonlyFieldId | string | A field of the boolean entity that UCC checks for each input. If the field's value is [truthful](https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/ListOfDataTypes), the corresponding input cannot be edited from the UI. There is no way to change this from the UI; it is supposed to be changed via REST. |
| hideFieldId | string | A field of the boolean entity that UCC checks for each input. If the field's value is [truthful](https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/ListOfDataTypes), the corresponding input is hidden from the UI. There is no way to change this from the UI; it is supposed to be changed via REST. Check out an example below. |
| useInputToggleConfirmation | boolean | When true, displays a confirmation modal before toggling an input's status between active and inactive. |

### Services Properties

Expand Down
11 changes: 11 additions & 0 deletions splunk_add_on_ucc_framework/schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3115,6 +3115,9 @@
},
"readonlyFieldId": {
"type": "string"
},
"useInputToggleConfirmation": {
"$ref": "#/definitions/useInputToggleConfirmation"
}
},
"required": [
Expand Down Expand Up @@ -3162,6 +3165,9 @@
"table": {
"$ref": "#/definitions/InputsTable"
},
"useInputToggleConfirmation": {
"$ref": "#/definitions/useInputToggleConfirmation"
},
"entity": {
"$ref": "#/definitions/AnyOfEntity"
},
Expand Down Expand Up @@ -3279,6 +3285,11 @@
"type": "string",
"description": "Text displayed next to entity field"
},
"useInputToggleConfirmation": {
"type": "boolean",
"description": "When true displays additional confirmation modal when toggling single input status.",
"default": false
},
"IntervalEntity": {
"type": "object",
"properties": {
Expand Down
Loading

0 comments on commit 34c8ec2

Please sign in to comment.