Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: option for configuring is_visible in globalConfig.json #1334

Closed
wants to merge 1 commit into from

Conversation

Benni0
Copy link
Contributor

@Benni0 Benni0 commented Sep 9, 2024

Summary

Option for configuring is_visible in globalConfig.json

Changes

Added the option isVisible for for configuring is_visible in globalConfig.json

Checklist

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

@Benni0 Benni0 requested review from a team as code owners September 9, 2024 14:38
@hetangmodi-crest
Copy link
Contributor

Can you mention the use case for the suggested feature? The current implementation is, if the globalConfig file is present, the UI for the add-on should be visible by default, making it redundant to include a separate is_visible attribute in globalConfig.

@Benni0
Copy link
Contributor Author

Benni0 commented Sep 10, 2024

Sure, we use the UCC framework as main build pipeline for our Splunk apps. The specific use-case is an app which only contains some alert actions which doesn't require additional setup or configuration.

@soleksy-splunk
Copy link
Contributor

Please also add that change in this file (front-end global config validation) to keep it consistent .
https://github.com/splunk/addonfactory-ucc-generator/blob/develop/ui/src/types/globalConfig/meta.ts
simple

    isVisible: z.boolean().default(true).optional(),

should work

@Benni0 Benni0 requested a review from a team as a code owner September 10, 2024 13:29
@Benni0
Copy link
Contributor Author

Benni0 commented Sep 10, 2024

I've added it to meta.ts as suggested.

@Benni0
Copy link
Contributor Author

Benni0 commented Sep 12, 2024

Hi,
the scan found a type incompatibility which should not happen, as it is checked if isVisible is set before. To solve this issue I changed the assignment to:

    if global_config:
        should_be_visible = global_config.meta.get("isVisible", True)

This implementation is shorter and should avoid this problem.

@artemrys
Copy link
Member

@hetangmodi-crest can you please resolve the conflicts in the PR? I'll merge it tomorrow.

@hetangmodi-crest
Copy link
Contributor

@Benni0 Closing this PR as the pipeline is failing due to missing gpg_private_key required for a couple of steps. Created a PR #1345 having the same changes.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants