Skip to content

Commit

Permalink
feat: release v5.20.0 (#634)
Browse files Browse the repository at this point in the history
* chore(code): update file, dir checks condition (#624)

* chore(code): update file, dir checks condition

* test(unit): updating test case as per source code

* chore: update deps (#626)

* docs: ADDON-59601 documentation for Custom Tab feature (#615)

* docs: ADDON-59601 Added a custom tab feature doc

* docs: ADDON-59601 Content updated

* docs: ADDON-59601 Content updated

* docs: ADDON-59459 Content updated (#618)

* docs: ADDON-58705 Doc changes for the table action field (#612)

Co-authored-by: Artem Rys <rysartem@gmail.com>

* feat: move validators from ucc-ui to ucc-gen (#629)

* feat: move validators from ucc-ui to ucc-gen

Moved global config json duplicates validators from the ucc-ui repo to ucc-gen repo in python

* added handling for children in autoCompleteFields

* renamed temp variable to options

* added tests for check duplicates in autoCompleteFields

* added tests for all validators under tabs tag

* fixed pre-commit

* added tests for inputs

* added comments to document the code

* pre-commit for test file

* changed the semantic release version

* added typing into validator parameters
added single quotes to validator exceptions

* the code now compares the values in lowercase

* adjusted the test to test capitalized duplicates

* docs: include steps to download UCC UI [ci skip] (#632)

* feat: update UCC UI to v1.21.0 (#633)

---------

Co-authored-by: Hetang Modi <62056057+hetangmodi-crest@users.noreply.github.com>
Co-authored-by: Tushar Balar <62089106+tbalar-splunk@users.noreply.github.com>
Co-authored-by: Marcin Bruzda <94437843+mbruzda-splunk@users.noreply.github.com>
  • Loading branch information
4 people authored Feb 10, 2023
1 parent c47584c commit e2a389d
Show file tree
Hide file tree
Showing 19 changed files with 2,025 additions and 155 deletions.
7 changes: 7 additions & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Build and Test

Download UCC UI and unpack it using the following commands:

```
./get-ucc-ui.sh
tar -zxf splunk-ucc-ui.tgz -C splunk_add_on_ucc_framework/
```

This project uses [`poetry`](https://python-poetry.org/).

To build a new local version of `ucc-gen`:
Expand Down
80 changes: 80 additions & 0 deletions docs/custom_ui_extensions/custom_tab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
Custom Tab feature can be used to render any customized UI component in the TA. With this feature, the developer can design and render any complex input with ease. This is an advanced feature and can be leveraged with limitless functionalities. Modern TAs are receiving complex use cases and this feature will allow them to design the UI perfectly for their case without having to depend on the newer releases of UCC supporting their component.

### Usage

Use Custom Tab in the Configuration page:
```
"configuration": {
"title": "Configuration",
"descriptions": "Set up your add-on",
"tabs": [
{
"name": "account",
"title": "Account",
"entity": [],
"table": {}
},
{
"name": "logging",
"title": "Logging",
"entity": []
},
{
"name": "proxy",
"title": "Proxy",
"entity": []
},
{
"name": "custom_tab",
"title": "Customized Tab",
"customTab": {
"src": "custom_tab",
"type": "external"
}
}
]
}
```

### Properties

| Property | Description |
| -------- | -------------------------------------------------------------------------------------------------- |
| tab | It is an object with the properties and values of a custom tab object from the global config file. |
| el | The html element of the custom tab. |

### Methods

| Property | Description |
| -------- | ------------------------------------------------------------------------ |
| Render | This method should contain the rendering logic for the custom component. |

### Example

```
class CustomTab {
/**
* Custom Tab
* @constructor
* @param {Object} tab - tab details.
* @param {element} el - The element of the custom menu.
*/
constructor(tab, el) {
this.tab = tab;
this.el = el;
}
render() {
this.el.innerHTML = `<h1 style="margin-top: 20px">${this.tab.title} - This is a custom component rendered from the TA</h1>`
}
}
export default CustomTab;
```

> Note: The Javascript file for the custom tab should be saved in the custom folder at `appserver/static/js/build/custom/`.
### Output

This is how Custom Tab looks:
![image](../images/Custom_Tab_Output.png)
Binary file added docs/images/Custom_Tab_Output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 11 additions & 2 deletions docs/tabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,21 @@ This is how globalConfig looks like without tabs on the inputs page:
},
```

> Note: It is no longer recommended to use the `enable` field in table actions. It will be removed in the next major release of ucc-gen.
### List of built-in table fields

| Field Name | description |
| ----------------- | ----------- |
| serviceName | It indicates the name of Input service to be displayed in the table. <br>Eg: example_input_one |
| serviceTitle | It indicates the title of Input service to be displayed in the table. <br>Eg: Example Input One |

### Tabs
If there are multiple types of input services and want to use the Tabs feature, each input service is represented by a separate tab. As a result, each input service will have its own tab.

To enable the tabs feature, `table` property must be provided under the services.

Title and Description would change when changing the tab (If provided in the globalConfig file).
`Title` and `Description` would change when changing the tab (If provided in the globalConfig file).

```
"pages": {
Expand Down Expand Up @@ -146,7 +155,7 @@ Using the [Custom Hook](https://splunk.github.io/addonfactory-ucc-generator/cust
"groupTitle": "Group Two",
"groupServices": ["example_input_two", "example_input_four"]
}
]
],
"services": [
{
"name": "example_input_one",
Expand Down
2 changes: 1 addition & 1 deletion get-ucc-ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
wget https://github.com/splunk/addonfactory-ucc-base-ui/releases/download/v1.19.0/splunk-ucc-ui.tgz
wget https://github.com/splunk/addonfactory-ucc-base-ui/releases/download/v1.21.0/splunk-ucc-ui.tgz
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ nav:
- Custom Row: "custom_ui_extensions/custom_row.md"
- Custom Cell: "custom_ui_extensions/custom_cell.md"
- Custom Menu: "custom_ui_extensions/custom_menu.md"
- Custom Tab: "custom_ui_extensions/custom_tab.md"
- Advanced:
- Custom Mapping: "advanced/custom_mapping.md"
- Dependent Dropdown: "advanced/dependent_dropdown.md"
Expand Down
Loading

0 comments on commit e2a389d

Please sign in to comment.