Skip to content

Commit 18721a4

Browse files
committed
Revert "refactor: remove code for plugin policy v1"
This reverts commit 19ce1e1.
1 parent 24b64d1 commit 18721a4

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ FEATURE_SCOPED_VARIABLE_ENVIRONMENT_LIST_ENABLE=false
5151
HIDE_NETWORK_STATUS_INTERFACE=true
5252
SYSTEM_CONTROLLER_LISTING_TIMEOUT=300000
5353
FEATURE_IMAGE_PROMOTION_ENABLE=false
54+
FEATURE_CD_MANDATORY_PLUGINS_ENABLE=true
5455
FEATURE_HIDE_USER_DIRECT_PERMISSIONS_FOR_NON_SUPER_ADMINS=false
5556
FEATURE_CONFIG_DRIFT_ENABLE=false
5657
FEATURE_PROMO_EMBEDDED_BUTTON_TEXT=

src/components/common/helpers/Helpers.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,11 @@ export const getParsedBranchValuesForPlugin = (branchName: string): string => {
11611161
return ''
11621162
}
11631163

1164-
return `[${branchName}]`
1164+
if (window._env_.FEATURE_CD_MANDATORY_PLUGINS_ENABLE) {
1165+
return `[${branchName}]`
1166+
}
1167+
1168+
return branchName
11651169
}
11661170

11671171
export const getAppFilterLocalStorageKey = (filterParentType: FilterParentType): AppEnvLocalStorageKeyType =>

src/components/globalConfigurations/GlobalConfiguration.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const ScopedVariables = lazy(() => import('../scopedVariables/ScopedVariables'))
6464
// NOTE: Might import from index itself
6565
const BuildInfra = lazy(() => import('../../Pages/GlobalConfigurations/BuildInfra/BuildInfra'))
6666
const TagListContainer = importComponentFromFELibrary('TagListContainer')
67+
const PluginsPolicyV1 = importComponentFromFELibrary('PluginsPolicyV1')
6768
const PluginsPolicy = importComponentFromFELibrary('PluginsPolicy', null, 'function')
6869
const FilterConditions = importComponentFromFELibrary('FilterConditions')
6970
const LockDeploymentConfiguration = importComponentFromFELibrary('LockDeploymentConfiguration', null, 'function')
@@ -763,11 +764,17 @@ const Body = ({ getHostURLConfig, checkList, serverMode, handleChecklistUpdate,
763764
<ImagePromotion isSuperAdmin={isSuperAdmin} />
764765
</Route>
765766
),
766-
PluginsPolicy && (
767-
<Route path={URLS.GLOBAL_CONFIG_PLUGIN_POLICY}>
768-
<PluginsPolicy OfflinePipelineModalAppView={OffendingPipelineModalAppView} />
769-
</Route>
770-
),
767+
window._env_.FEATURE_CD_MANDATORY_PLUGINS_ENABLE
768+
? PluginsPolicy && (
769+
<Route path={URLS.GLOBAL_CONFIG_PLUGIN_POLICY}>
770+
<PluginsPolicy OfflinePipelineModalAppView={OffendingPipelineModalAppView} />
771+
</Route>
772+
)
773+
: PluginsPolicyV1 && (
774+
<Route path={URLS.GLOBAL_CONFIG_PLUGIN_POLICY}>
775+
<PluginsPolicyV1 />
776+
</Route>
777+
),
771778
PullImageDigest && (
772779
<Route path={URLS.GLOBAL_CONFIG_PULL_IMAGE_DIGEST}>
773780
<PullImageDigest isSuperAdmin={isSuperAdmin} />
@@ -792,7 +799,7 @@ const Body = ({ getHostURLConfig, checkList, serverMode, handleChecklistUpdate,
792799
<Route path={CommonURLS.GLOBAL_CONFIG_TEMPLATES_DEVTRON_APP}>
793800
<DevtronAppTemplates AppConfig={AppConfig} />
794801
</Route>
795-
),
802+
)
796803
]}
797804
<Redirect to={defaultRoute()} />
798805
</Switch>

src/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ if (!window || !window._env_) {
155155
HIDE_NETWORK_STATUS_INTERFACE: true,
156156
SYSTEM_CONTROLLER_LISTING_TIMEOUT: 60000 * 5,
157157
FEATURE_IMAGE_PROMOTION_ENABLE: false,
158+
FEATURE_CD_MANDATORY_PLUGINS_ENABLE: true,
158159
FEATURE_HIDE_USER_DIRECT_PERMISSIONS_FOR_NON_SUPER_ADMINS: false,
159160
FEATURE_CONFIG_DRIFT_ENABLE: false,
160161
FEATURE_PROMO_EMBEDDED_BUTTON_TEXT: '',

0 commit comments

Comments
 (0)