From db59809113d08fb638d54c1ed0310b4a04c5f6ec Mon Sep 17 00:00:00 2001 From: Vikram Raj Date: Tue, 16 Jan 2024 17:39:06 +0530 Subject: [PATCH] Add flags to hide static plugin List and details pages --- src/components/hooks/flagHookProvider.ts | 64 +++++++++++++++++++++++- src/consts.ts | 50 ++++++++++++++++++ 2 files changed, 113 insertions(+), 1 deletion(-) diff --git a/src/components/hooks/flagHookProvider.ts b/src/components/hooks/flagHookProvider.ts index 70b8e903..ce149ed5 100644 --- a/src/components/hooks/flagHookProvider.ts +++ b/src/components/hooks/flagHookProvider.ts @@ -1,11 +1,36 @@ -import * as React from 'react'; import { K8sResourceCommon, SetFeatureFlag, k8sGet, } from '@openshift-console/dynamic-plugin-sdk'; +import * as React from 'react'; import { + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTASKS_LIST, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTASK_DETAILS, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTRIGGERSBINDINGS_LIST, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTRIGGERSBINDING_DETAILS, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_CONDITIONS_DETAILS, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_CONDITIONS_LIST, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_EVENTLISTENERS_LIST, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_EVENTLISTENER_DETAILS, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_PIPELINERUNS_LIST, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_PIPELINERUN_DETAILS, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_PIPELINES_LIST, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_PIPELINES_NAV_OPTION, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_PIPELINE_DETAILS, FLAG_HIDE_STATIC_PIPELINE_PLUGIN_PIPELINE_DETAIL_METRICS_TAB, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_REPOSITORIES_LIST, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_REPOSITORY_DETAILS, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TASKRUNS_LIST, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TASKRUN_DETAILS, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TASKS_LIST, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TASKS_NAV_OPTION, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TASK_DETAILS, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TRIGGERBINDINGS_LIST, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TRIGGERBINDING_DETAILS, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TRIGGERS_NAV_OPTION, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TRIGGERTEMPLATES_LIST, + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TRIGGERTEMPLATE_DETAILS, FLAG_PIPELINE_TEKTON_RESULT_INSTALLED, } from '../../consts'; import { TektonResultModel } from '../../models'; @@ -15,6 +40,43 @@ export const useFlagHookProvider = (setFeatureFlag: SetFeatureFlag) => { FLAG_HIDE_STATIC_PIPELINE_PLUGIN_PIPELINE_DETAIL_METRICS_TAB, true, ); + setFeatureFlag(FLAG_HIDE_STATIC_PIPELINE_PLUGIN_PIPELINES_NAV_OPTION, false); + setFeatureFlag(FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TASKS_NAV_OPTION, false); + setFeatureFlag(FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TRIGGERS_NAV_OPTION, false); + setFeatureFlag(FLAG_HIDE_STATIC_PIPELINE_PLUGIN_PIPELINES_LIST, false); + setFeatureFlag(FLAG_HIDE_STATIC_PIPELINE_PLUGIN_PIPELINERUNS_LIST, false); + setFeatureFlag(FLAG_HIDE_STATIC_PIPELINE_PLUGIN_REPOSITORIES_LIST, false); + setFeatureFlag(FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TASKS_LIST, false); + setFeatureFlag(FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TASKRUNS_LIST, false); + setFeatureFlag(FLAG_HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTASKS_LIST, false); + setFeatureFlag(FLAG_HIDE_STATIC_PIPELINE_PLUGIN_EVENTLISTENERS_LIST, false); + setFeatureFlag(FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TRIGGERTEMPLATES_LIST, false); + setFeatureFlag(FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TRIGGERBINDINGS_LIST, false); + setFeatureFlag( + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTRIGGERSBINDINGS_LIST, + false, + ); + setFeatureFlag(FLAG_HIDE_STATIC_PIPELINE_PLUGIN_CONDITIONS_LIST, false); + setFeatureFlag(FLAG_HIDE_STATIC_PIPELINE_PLUGIN_PIPELINE_DETAILS, false); + setFeatureFlag(FLAG_HIDE_STATIC_PIPELINE_PLUGIN_PIPELINERUN_DETAILS, false); + setFeatureFlag(FLAG_HIDE_STATIC_PIPELINE_PLUGIN_REPOSITORY_DETAILS, false); + setFeatureFlag(FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TASK_DETAILS, false); + setFeatureFlag(FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TASKRUN_DETAILS, false); + setFeatureFlag(FLAG_HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTASK_DETAILS, false); + setFeatureFlag(FLAG_HIDE_STATIC_PIPELINE_PLUGIN_EVENTLISTENER_DETAILS, false); + setFeatureFlag( + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TRIGGERTEMPLATE_DETAILS, + false, + ); + setFeatureFlag( + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TRIGGERBINDING_DETAILS, + false, + ); + setFeatureFlag( + FLAG_HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTRIGGERSBINDING_DETAILS, + false, + ); + setFeatureFlag(FLAG_HIDE_STATIC_PIPELINE_PLUGIN_CONDITIONS_DETAILS, false); }; export const useTektonResultInstallProvider = ( diff --git a/src/consts.ts b/src/consts.ts index b3d12cfb..44b177a5 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -3,3 +3,53 @@ export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_PIPELINE_DETAIL_METRICS_TAB = export const FLAG_PIPELINE_TEKTON_RESULT_INSTALLED = 'PIPELINE_TEKTON_RESULT_INSTALLED'; export const ALL_NAMESPACES_KEY = '#ALL_NS#'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_PIPELINES_NAV_OPTION = + 'HIDE_STATIC_PIPELINE_PLUGIN_PIPELINE_NAV_OPTION'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TASKS_NAV_OPTION = + 'HIDE_STATIC_PIPELINE_PLUGIN_TASKS_NAV_OPTION'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TRIGGERS_NAV_OPTION = + 'HIDE_STATIC_PIPELINE_PLUGIN_TRIGGERS_NAV_OPTION'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_PIPELINES_LIST = + 'HIDE_STATIC_PIPELINE_PLUGIN_PIPELINES_LIST'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_PIPELINERUNS_LIST = + 'HIDE_STATIC_PIPELINE_PLUGIN_PIPELINERUNS_LIST'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_REPOSITORIES_LIST = + 'HIDE_STATIC_PIPELINE_PLUGIN_REPOSITORIES_LIST'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TASKS_LIST = + 'HIDE_STATIC_PIPELINE_PLUGIN_TASKS_LIST'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TASKRUNS_LIST = + 'HIDE_STATIC_PIPELINE_PLUGIN_TASKRUNS_LIST'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTASKS_LIST = + 'HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTASKS_LIST'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_EVENTLISTENERS_LIST = + 'HIDE_STATIC_PIPELINE_PLUGIN_EVENTLISTENERSS_LIST'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TRIGGERTEMPLATES_LIST = + 'HIDE_STATIC_PIPELINE_PLUGIN_TRIGGERTEMPLATES_LIST'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TRIGGERBINDINGS_LIST = + 'HIDE_STATIC_PIPELINE_PLUGIN_TRIGGERBINDINGS_LIST'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTRIGGERSBINDINGS_LIST = + 'HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTRIGGERSBINDINGS_LIST'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_CONDITIONS_LIST = + 'HIDE_STATIC_PIPELINE_PLUGIN_CONDITIONS_LIST'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_PIPELINE_DETAILS = + 'HIDE_STATIC_PIPELINE_PLUGIN_PIPELINE_DETAILS'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_PIPELINERUN_DETAILS = + 'HIDE_STATIC_PIPELINE_PLUGIN_PIPELINERUN_DETAILS'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_REPOSITORY_DETAILS = + 'HIDE_STATIC_PIPELINE_PLUGIN_REPOSITORY_DETAILS'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TASK_DETAILS = + 'HIDE_STATIC_PIPELINE_PLUGIN_TASK_DETAILS'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TASKRUN_DETAILS = + 'HIDE_STATIC_PIPELINE_PLUGIN_TASKRUN_DETAILS'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTASK_DETAILS = + 'HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTASK_DETAILS'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_EVENTLISTENER_DETAILS = + 'HIDE_STATIC_PIPELINE_PLUGIN_EVENTLISTENERS_DETAILS'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TRIGGERTEMPLATE_DETAILS = + 'HIDE_STATIC_PIPELINE_PLUGIN_TRIGGERTEMPLATE_DETAILS'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_TRIGGERBINDING_DETAILS = + 'HIDE_STATIC_PIPELINE_PLUGIN_TRIGGERBINDING_DETAILS'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTRIGGERSBINDING_DETAILS = + 'HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTRIGGERSBINDING_DETAILS'; +export const FLAG_HIDE_STATIC_PIPELINE_PLUGIN_CONDITIONS_DETAILS = + 'HIDE_STATIC_PIPELINE_PLUGIN_CONDITIONS_DETAILS';