Skip to content

Commit

Permalink
feat: option for configuring is_visible in globalConfig.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Benni0 committed Sep 12, 2024
1 parent 17d29d0 commit 6ed6815
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ Metadata contains general information about add-on build.
| defaultView | string | Define which view should be loaded on TA load. One of `"inputs"`, `"configuration"`, `"dashboard"` or `"search"`. Default `configuration`. |
| [os-dependentLibraries](./advanced/os-dependent_libraries.md) | array | This feature allows you to download and unpack libraries with appropriate binaries for the indicated operating system during the build process. |
| supported_themes | array | This feature is allows you provide the themes supported by your add-on. Supported values: `light`, `dark`. No default. |
| isVisible | boolean | This option allows you to create apps which are not visible by default by setting isVisible=false. |

4 changes: 2 additions & 2 deletions splunk_add_on_ucc_framework/commands/build.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#
s#
# Copyright 2024 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -641,7 +641,7 @@ def generate(
check_for_updates = "true"
supported_themes = ""
if global_config:
should_be_visible = True
should_be_visible = global_config.meta.get("isVisible", True)
if global_config.meta.get("checkForUpdates") is False:
check_for_updates = "false"
if global_config.meta.get("supportedThemes") is not None:
Expand Down
5 changes: 5 additions & 0 deletions splunk_add_on_ucc_framework/schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1740,6 +1740,11 @@
"default": true,
"description": "Ability to configure app.conf->package.check_for_updates from globalConfig file."
},
"isVisible": {
"type": "boolean",
"default": true,
"description": "Ability to configure app.conf->ui.is_visible from globalConfig file."
},
"defaultView": {
"type": "string",
"description": "Define which view should be loaded on TA load.",
Expand Down
1 change: 1 addition & 0 deletions ui/src/types/globalConfig/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const meta = z.object({
hideUCCVersion: z.boolean().optional(),
checkForUpdates: z.boolean().default(true).optional(),
searchViewDefault: z.boolean().default(false).optional(),
isVisible: z.boolean().default(true).optional(),
});

export type meta = z.infer<typeof meta>;

0 comments on commit 6ed6815

Please sign in to comment.