Skip to content

Commit

Permalink
Merge pull request openshift-pipelines#47 from vikram-raj/odc-7482
Browse files Browse the repository at this point in the history
ODC-7482: Add flags to hide static plugin List and details pages
  • Loading branch information
openshift-merge-bot[bot] authored Jan 16, 2024
2 parents bc5879d + db59809 commit a0a2e9f
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 1 deletion.
64 changes: 63 additions & 1 deletion src/components/hooks/flagHookProvider.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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 = (
Expand Down
50 changes: 50 additions & 0 deletions src/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

0 comments on commit a0a2e9f

Please sign in to comment.