Skip to content

Commit

Permalink
docs: add the print page (#1433)
Browse files Browse the repository at this point in the history
**Issue number:** ADDON-75611

## Summary

### Changes

> Please provide a summary of what's being changed

Documentation changes: added print button that shows the whole
documentation on one page.

<img width="1148" alt="Zrzut ekranu 2024-11-6 o 15 16 30"
src="https://github.com/user-attachments/assets/7128ab15-2f12-410d-ba6e-897ee7f4b0e1">

In order to enable this feature, first level headings needed to be added
to files.

### User experience

> Please describe what the user experience looks like before and after
this change

None

## 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: srv-rr-github-token <[email protected]>
  • Loading branch information
kkedziak-splunk and srv-rr-github-token authored Nov 8, 2024
1 parent ac851df commit 0513fbf
Show file tree
Hide file tree
Showing 48 changed files with 218 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .markdownlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ MD034: false
MD040: false

# MD041/first-line-heading/first-line-h1
MD041: false
MD041: true

# MD046/code-block-style
MD046: false
1 change: 1 addition & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.github/PULL_REQUEST_TEMPLATE.md
2 changes: 2 additions & 0 deletions docs/advanced/custom_mapping.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Custom Mapping

We can use this feature to map each field with meaningful value to display in the table. For example, the category field contains 1, 2, and 4 values, but when those values are displayed, the user might get confused as those values do not signify the meaning of their mapping. To avoid this confusion, the user can map each field with meaningful value as shown in the following example:

If you have fields that are not mandatory but you would like to display them inside table, you can use default value option by providing ```"[[default]]"``` as one of parameters (check example bellow). It is a way to provide some meaningful information for form fields that have not been filled (fill empty cells in table).
Expand Down
2 changes: 2 additions & 0 deletions docs/advanced/custom_warning.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Custom Warning

This feature allows us to pass broarder description on Input and Configuration page displayed under main description.

### Warning Properties
Expand Down
2 changes: 2 additions & 0 deletions docs/advanced/dependent_dropdown.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Dependent Dropdown

This feature allows dynamic loading options for the `singleSelect` and the `multipleSelect` fields when the options for that field depend on other fields' values. It loads options via an API call to the endpoint mentioned in `endpointUrl` under options when any dependencies field is updated and all required dependencies fields are non-null.

All non-required dependencies fields can be of any type, but all required dependencies fields should only be of single-select type.
Expand Down
2 changes: 2 additions & 0 deletions docs/advanced/groups_feature.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Groups Feature

Using this functionality, the Inputs page form can be divided into distinct sections, each comprising relevant fields. If the `isExpandable` property is set to true in the global configuration file, the group will be in the [collapsible panel](https://splunkui.splunk.com/Packages/react-ui/CollapsiblePanel) type.

The groups will be displayed at the bottom of the form.
Expand Down
2 changes: 2 additions & 0 deletions docs/advanced/oauth_support.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# OAuth Support

UCC allows you to add Auth support in the configuration page. In UCC, OAuth2.0 of the Authorization Code Flow `grant` type is used. It only supports the standard parameters specified in [RFCP749](https://www.rfc-editor.org/rfc/rfc6749) for obtaining an authorization code.

Auth can be used inside the entity tag. Use `type: "oauth"` in the entity list and specify the `options` next to the `type: "oauth"`.
Expand Down
2 changes: 2 additions & 0 deletions docs/advanced/os-dependent_libraries.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# OS-dependent libraries

This feature allows you to download and unpack libraries with appropriate binaries for the indicated operating system during the build process.
To do this, you need to expand the **meta** section in the global configuration with the **os-dependentLibraries** field. This field takes the following attributes:

Expand Down
2 changes: 2 additions & 0 deletions docs/advanced/save_validator.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Save Validator

This feature allows you to pass a Javascript function as a string to apply customized validation to form data.

By using this approach, you can write custom JavaScript code where you can write your business logic, and validating can return error messages which will be displayed at the top of the form.
Expand Down
2 changes: 2 additions & 0 deletions docs/advanced/sub_description.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Sub Description

This feature allows us to pass a broader description on the Input and Configuration pages displayed under main description.

### Sub Descritpion Properties
Expand Down
2 changes: 2 additions & 0 deletions docs/alert_actions/adaptive_response.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Adaptive Response

The Adaptive Response framework provides a mechanism for running preconfigured actions
within the Splunk platform or by integrating with external applications.
These actions can be automatically triggered by correlation search results or manually
Expand Down
2 changes: 2 additions & 0 deletions docs/alert_actions/alert_scripts.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Alert Action Scripts

The following files would be created/ updated in the output folder once you executed the `ucc-gen` command:

| File Location | Content Description | Action |
Expand Down
2 changes: 2 additions & 0 deletions docs/alert_actions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: Alert Actions
---

# Alert Actions

The alert action can help a user to take action on the alerts that have been triggered. The knowledge from Splunk can be sent to an outside service or to pull additional or detailed information related to the trigger details.
An add-on can have multiple alert actions based on the use cases the add-on provides. You can know more about alert actions from [this documentation](https://docs.splunk.com/Documentation/Splunk/latest/Alert/Aboutalerts).

Expand Down
2 changes: 2 additions & 0 deletions docs/configurations/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Configuration

The `Configuration` tab can have multiple subtabs, for example, a tab for
account configuration (to configure the account by adding account credentials),
proxy configuration, and logging level configuration.
Expand Down
2 changes: 2 additions & 0 deletions docs/configurations/logging.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Logging

The logging tab is a predefined component that allows to create the page for changing
the log level. It is added in the `pages.configuration.tabs` array

Expand Down
2 changes: 2 additions & 0 deletions docs/configurations/proxy.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Proxy

There are fields that need to be specified in order to enable proxy.

### Fields
Expand Down
2 changes: 2 additions & 0 deletions docs/custom_ui_extensions/custom_cell.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Custom Cell

A Custom Cell is used to update the content of a table cell.

`customCell` attribute will be used in the table header on the inputs and configuration page.
Expand Down
2 changes: 2 additions & 0 deletions docs/custom_ui_extensions/custom_control.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Custom Control

The Custom Control feature allows you to display any customised input component in a form. The developer can easily design and render any complex input component with this feature. Modern add-ons frequently require the use of complex input components, and this feature will allow you to use the custom component in the form that is best suited to your needs, without relying on newer releases of UCC for support.

### Properties
Expand Down
2 changes: 2 additions & 0 deletions docs/custom_ui_extensions/custom_hook.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Custom Hook

Custom Hook is a JavaScript function that allows us to reuse some code throughout the app. It is used to validate form/dialog inputs.

Hook is nothing more than a Javascript event handling on the events `onCreate`, `onChange`, `onRender`, `onSave`, `onSaveSuccess`, `onSaveFail`, and `onEditLoad`.
Expand Down
2 changes: 2 additions & 0 deletions docs/custom_ui_extensions/custom_menu.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Custom Menu

Custom Menu can be created when there is more than one input present on the inputs page.

> This feature is deprecated (will be removed in the next major version) as [`Multilevel Menu`](../inputs/multilevel_menu.md) is now ready to use if more than one input is available.
Expand Down
2 changes: 2 additions & 0 deletions docs/custom_ui_extensions/custom_row.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Custom Row

When a row is expanded on the Inputs table or Configuration Table, Custom Row is utilized to incorporate a customized element. By clicking on the icon provided on the left side of each row, the input-specific details are displayed.

### Properties
Expand Down
2 changes: 2 additions & 0 deletions docs/custom_ui_extensions/custom_tab.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Custom Tab

Custom Tab feature can be used to render any customized UI component in the Configuration tabs. With this feature, you can design and render any complex input with ease. This is an advanced feature and can be leveraged with limitless functionalities. Modern add-ons are receiving complex use cases and this feature will allow you to design the UI perfectly for your case without having to depend on newer releases of UCC for support.

### Properties
Expand Down
2 changes: 2 additions & 0 deletions docs/custom_ui_extensions/overview.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Overview

The UCC package simplifies the deployment of React applications featuring the Splunk UI by eliminating the need for NodeJS, Yarn, or front-end dependencies installation. The core requirement for deployment is a `globalConfig.json` file. While UCC is designed to support a broad spectrum of use cases, there may be scenarios where the provided API options do not fully meet your needs.

For such instances, UCC has a runtime custom JavaScript loading mechanism. This feature allows for the invocation of specific functionalities at pivotal moments within the application lifecycle, including `onChange` and `onRender` events.
Expand Down
2 changes: 2 additions & 0 deletions docs/entity/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: Entity
---

# Entity

## Entity Properties

| Property | Type | Description | Default Value |
Expand Down
2 changes: 2 additions & 0 deletions docs/entity/modifyFieldsOnValue.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Modify Fields On Change

This feature allows to specify conditions to modify other fields based on current field value change.

### Modification Object Properties
Expand Down
2 changes: 2 additions & 0 deletions docs/entity/validators.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Validators

Validators define acceptable values for fields.

!!! warning ""
Expand Down
2 changes: 2 additions & 0 deletions docs/generated_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: UCC framework generated files
---

# Generated files

Below table describes the files generated by UCC framework

## File Description
Expand Down
2 changes: 2 additions & 0 deletions docs/inputs/helper.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: Input Helper Module
---

# Input Helper Module

Input scripts are regenerated during every build step, in order to keep the arguments
and options up to date with the global config. To not discard changes made by developers,
additional helper modules were introduced. Those modules must contain
Expand Down
4 changes: 3 additions & 1 deletion docs/inputs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: Inputs
---

# Inputs

The input page stores configuration information for data collection. Multiple inputs can be created on the Inputs page.

Developers are required to add services in the global config file to create a new Input. If multiple services are
Expand Down Expand Up @@ -53,4 +55,4 @@ This is how the global configuration looks like without tabs

### Output

<iframe src="/addonfactory-ucc-generator/storybook/?path=/story/pages-inputpage--input-page-view&full=1&shortcuts=false&singleStory=true"></ifame>
<iframe src="/addonfactory-ucc-generator/storybook/?path=/story/pages-inputpage--input-page-view&full=1&shortcuts=false&singleStory=true"></iframe>
2 changes: 2 additions & 0 deletions docs/inputs/multilevel_menu.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Multi-level Menu

This feature allows us to organize the input services into different categories. As a result, each group/category will have a separate sub-menu that can include numerous types of input services. Inputs services can also belong to multiple groups/categories.

Using the [Custom Hook](../custom_ui_extensions/custom_hook.md), `groupName` can be saved in any form field for a specific inputs service stanza.
Expand Down
2 changes: 2 additions & 0 deletions docs/inputs/tabs.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Tabs

This feature allows you to separate inputs based on their service name. Use the tabs feature when multiple inputs services are provided in the global configuration file, and you want to display each input service in a separate tab (and table).

The `table` property must be present in the services to use the tabs feature.
Expand Down
2 changes: 2 additions & 0 deletions docs/metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: globalConfig Meta Data
---

# Metadata

Metadata contains general information about add-on build.

## Metadata Properties
Expand Down
10 changes: 6 additions & 4 deletions docs/table.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Table

This is a common feature that is used to display the account and input stanzas on the [Inputs](inputs/index.md) and [Configuration](configurations/index.md) pages, respectively.

Tables include many built-in features such as sorting, filtering, and pagination.

### Properties
## Properties

- `header`<span class="required-asterisk">*</span> (Array Objects) specifies the list of columns in the table.
+ `field`<span class="required-asterisk">*</span> is he name of the field where the column data will be displayed.
Expand All @@ -16,7 +18,7 @@ Tables include many built-in features such as sorting, filtering, and pagination
+ [mapping](advanced/custom_mapping.md) is used to map field values to more meaningful values.
- [customRow](custom_ui_extensions/custom_row.md) can be used to customise the moreInfo Component.

### List of built-in table fields for Modular Input
## List of built-in table fields for Modular Input

If your add-on has multiple modular inputs and you want to show the input type of each one, use the following in-built field:

Expand All @@ -25,7 +27,7 @@ If your add-on has multiple modular inputs and you want to show the input type o
| serviceName | It indicates the name of the Input service to be displayed in the table, for example, "example_input_one". |
| serviceTitle | It indicates the title of the Input service to be displayed in the table, for example, "Example Input One". |

### Usage
## Usage

```json
"table": {
Expand Down Expand Up @@ -77,7 +79,7 @@ If your add-on has multiple modular inputs and you want to show the input type o
}
```

### Output
## Output

This is how it looks in the UI:

Expand Down
104 changes: 104 additions & 0 deletions docs/theme_overrides/partials/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<!-- Source:
https://github.com/squidfunk/mkdocs-material/blob/master/src/templates/partials/header.html
-->

{% set class = "md-header" %}
{% if "navigation.tabs.sticky" in features %}
{% set class = class ~ " md-header--shadow md-header--lifted" %}
{% elif "navigation.tabs" not in features %}
{% set class = class ~ " md-header--shadow" %}
{% endif %}

<!-- Header -->
<header class="{{ class }}" data-md-component="header">
<nav
class="md-header__inner md-grid"
aria-label="{{ lang.t('header') }}"
>

<!-- Link to home -->
<a
href="{{ config.extra.homepage | d(nav.homepage.url, true) | url }}"
title="{{ config.site_name | e }}"
class="md-header__button md-logo"
aria-label="{{ config.site_name }}"
data-md-component="logo"
>
{% include "partials/logo.html" %}
</a>

<!-- Button to open drawer -->
<label class="md-header__button md-icon" for="__drawer">
{% set icon = config.theme.icon.menu or "material/menu" %}
{% include ".icons/" ~ icon ~ ".svg" %}
</label>

<!-- Header title -->
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
{{ config.site_name }}
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
{% if page.meta and page.meta.title %}
{{ page.meta.title }}
{% else %}
{{ page.title }}
{% endif %}
</span>
</div>
</div>
</div>

{% if page.url_to_print_page %}
<a href="{{ page.url_to_print_page }}" title="Print Site" class="md-header__button md-icon">
{% include ".icons/material/printer.svg" %}
</a>
{% endif %}

<!-- Color palette toggle -->
{% if config.theme.palette %}
{% if not config.theme.palette is mapping %}
{% include "partials/palette.html" %}
{% endif %}
{% endif %}

<!-- User preference: color palette -->
{% if not config.theme.palette is mapping %}
{% include "partials/javascripts/palette.html" %}
{% endif %}

<!-- Site language selector -->
{% if config.extra.alternate %}
{% include "partials/alternate.html" %}
{% endif %}

<!-- Button to open search modal -->
{% if "material/search" in config.plugins %}
<label class="md-header__button md-icon" for="__search">
{% set icon = config.theme.icon.search or "material/magnify" %}
{% include ".icons/" ~ icon ~ ".svg" %}
</label>

<!-- Search interface -->
{% include "partials/search.html" %}
{% endif %}

<!-- Repository information -->
{% if config.repo_url %}
<div class="md-header__source">
{% include "partials/source.html" %}
</div>
{% endif %}
</nav>

<!-- Navigation tabs (sticky) -->
{% if "navigation.tabs.sticky" in features %}
{% if "navigation.tabs" in features %}
{% include "partials/tabs.html" %}
{% endif %}
{% endif %}
</header>
2 changes: 2 additions & 0 deletions docs/ui_tests_alert_actions_page.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Alert Action Page

::: tests.ui.test_alert_actions_page
2 changes: 2 additions & 0 deletions docs/ui_tests_config_page_account.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Account

::: tests.ui.test_configuration_page_account_tab
2 changes: 2 additions & 0 deletions docs/ui_tests_config_page_custom.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Custom

::: tests.ui.test_configuration_page_custom_tab
2 changes: 2 additions & 0 deletions docs/ui_tests_config_page_general.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# General

::: tests.ui.test_configuration_page
2 changes: 2 additions & 0 deletions docs/ui_tests_config_page_logging.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Logging

::: tests.ui.test_configuration_page_logging_tab
2 changes: 2 additions & 0 deletions docs/ui_tests_config_page_proxy.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Proxy

::: tests.ui.test_configuration_page_proxy_tab
2 changes: 2 additions & 0 deletions docs/ui_tests_inputs_page.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Input Page

::: tests.ui.test_input_page
Loading

0 comments on commit 0513fbf

Please sign in to comment.