Skip to content

Commit 06b8b3a

Browse files
authored
Revert "feat: add support for redirection from protect config"
1 parent 430ee9e commit 06b8b3a

File tree

7 files changed

+17
-111
lines changed

7 files changed

+17
-111
lines changed

src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ import { ENV_CONFIG_PATH_REG } from './AppConfig.constants'
5353

5454
const getApprovalPolicyConfigForApp: (appId: number) => Promise<ResourceIdToResourceApprovalPolicyConfigMapType> =
5555
importComponentFromFELibrary('getApprovalPolicyConfigForApp', null, 'function')
56-
const isFELibAvailable: (appId: number) => Promise<ResourceIdToResourceApprovalPolicyConfigMapType> =
57-
importComponentFromFELibrary('isFELibAvailable', null, 'function')
5856

5957
export const AppConfig = ({ appName, resourceKind, filteredEnvIds }: AppConfigProps) => {
6058
// HOOKS
@@ -465,9 +463,7 @@ export const AppConfig = ({ appName, resourceKind, filteredEnvIds }: AppConfigPr
465463
: 'app-compose-with-no-gitops-config__nav'
466464
} ${isJob ? 'job-compose__side-nav' : ''} ${
467465
!showCannotDeleteTooltip ? 'dc__position-rel' : ''
468-
} ${hideConfigHelp ? 'hide-app-config-help' : ''} ${!canShowExternalLinks ? 'hide-external-links' : ''} ${
469-
state.isUnlocked.workflowEditor && isFELibAvailable && !isJob ? 'config-protection__side-nav' : ''
470-
}`
466+
} ${hideConfigHelp ? 'hide-app-config-help' : ''} ${!canShowExternalLinks ? 'hide-external-links' : ''}`
471467
}
472468

473469
const toggleRepoSelectionTippy = () => {

src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export enum STAGE_NAME {
4444
SECRETS = 'SECRETS',
4545
ENV_OVERRIDE = 'ENV_OVERRIDE',
4646
EXTERNAL_LINKS = 'EXTERNAL_LINKS',
47-
PROTECT_CONFIGURATION = 'PROTECT_CONFIGURATION',
4847
REDIRECT_ITEM = 'REDIRECT_ITEM',
4948
}
5049

src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.utils.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
BASE_CONFIGURATION_ENV_ID,
2222
} from '@devtron-labs/devtron-fe-common-lib'
2323

24-
import { URLS, DOCUMENTATION } from '@Config/index'
24+
import { DOCUMENTATION } from '@Config/index'
2525

2626
import { AppConfigStatusItemType, EnvConfigDTO } from '../../service.types'
2727
import { AppConfigState, AppStageUnlockedType, CustomNavItemsType, EnvConfigType, STAGE_NAME } from './AppConfig.types'
@@ -282,12 +282,6 @@ export const getNavItems = ({
282282
flowCompletionPercent: completedPercent,
283283
currentStep: completedSteps,
284284
},
285-
{
286-
title: 'Protect Configuration',
287-
href: URLS.GLOBAL_CONFIG_APPROVAL_POLICY,
288-
stage: STAGE_NAME.PROTECT_CONFIGURATION,
289-
isLocked: false,
290-
},
291285
{
292286
title: 'Environment Override',
293287
href: `/app/${appId}/edit/env-override`,

src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/AppNavigation.tsx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ import {
2727
TippyCustomized,
2828
TippyTheme,
2929
} from '@devtron-labs/devtron-fe-common-lib'
30-
import { importComponentFromFELibrary } from '@Components/common'
31-
import { ReactComponent as ICArrowSquareOut } from '@Icons/ic-arrow-square-out.svg'
3230
import { DEVTRON_APPS_STEPS, STAGE_NAME } from '../AppConfig.types'
3331
import { URLS } from '../../../../../../config'
3432
import AppConfigurationCheckBox from './AppConfigurationCheckBox'
@@ -40,8 +38,6 @@ import { useAppConfigurationContext } from '../AppConfiguration.provider'
4038
import { renderNavItem } from './Navigation.helper'
4139
import { EnvConfigurationsNav } from './EnvConfigurationsNav'
4240

43-
const isFELibAvailable = importComponentFromFELibrary('isFELibAvailable', null, 'function')
44-
4541
export const AppNavigation = () => {
4642
// HOOKS
4743
const { path } = useRouteMatch()
@@ -53,7 +49,6 @@ export const AppNavigation = () => {
5349
deleteApp,
5450
canShowExternalLinks,
5551
showCannotDeleteTooltip,
56-
isWorkflowEditorUnlocked,
5752
toggleRepoSelectionTippy,
5853
getRepo,
5954
isJobView,
@@ -177,23 +172,6 @@ export const AppNavigation = () => {
177172
)
178173
}
179174

180-
if (item.stage === STAGE_NAME.PROTECT_CONFIGURATION) {
181-
return (
182-
isWorkflowEditorUnlocked &&
183-
isFELibAvailable && (
184-
<div key={item.stage}>
185-
{!canShowExternalLinks && <div className="dc__border-bottom-n1 mt-8 mb-8" />}
186-
{renderNavItem(item, null, {
187-
target: '_blank',
188-
icon: <ICArrowSquareOut className="icon-dim-16 dc__no-shrink scn-8" />,
189-
tooltipContent:
190-
'Configuration change approval has been moved to Global Configuration',
191-
})}
192-
</div>
193-
)
194-
)
195-
}
196-
197175
if (
198176
item.stage !== STAGE_NAME.ENV_OVERRIDE ||
199177
(item.stage === STAGE_NAME.ENV_OVERRIDE && item.isLocked)

src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/Navigation.helper.tsx

Lines changed: 15 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@ import {
44
ApprovalConfigDataKindType,
55
ApprovalConfigDataType,
66
CollapsibleListItem,
7-
ConditionalWrap,
87
EnvResourceType,
98
getIsApprovalPolicyConfigured,
109
ResourceIdToResourceApprovalPolicyConfigMapType,
11-
Tooltip,
1210
} from '@devtron-labs/devtron-fe-common-lib'
1311

1412
import { ReactComponent as Lock } from '@Icons/ic-locked.svg'
1513
import { ReactComponent as ICStamp } from '@Icons/ic-stamp.svg'
1614
import { ResourceConfigStage, ResourceConfigState } from '@Pages/Applications/DevtronApps/service.types'
1715

18-
import { AnchorHTMLAttributes, ReactElement } from 'react'
1916
import {
2017
CustomNavItemsType,
2118
EnvConfigRouteParams,
@@ -35,51 +32,29 @@ const renderNavItemIcon = (isLocked: boolean, isApprovalPolicyConfigured: boolea
3532
return null
3633
}
3734

38-
const wrapWithTooltip = (content: string) => (children: ReactElement) => (
39-
<Tooltip content={content} alwaysShowTippyOnHover placement="right">
40-
{children}
41-
</Tooltip>
42-
)
43-
4435
/**
4536
*
4637
* @param item
4738
* @param hideApprovalPolicyIcon Used to hide the policy icon (applicable for jobs atm)
4839
*/
49-
export const renderNavItem = (
50-
item: CustomNavItemsType,
51-
hideApprovalPolicyIcon?: boolean,
52-
options?: {
53-
target?: AnchorHTMLAttributes<HTMLAnchorElement>['target']
54-
icon?: ReactElement
55-
tooltipContent?: string
56-
},
57-
) => {
40+
export const renderNavItem = (item: CustomNavItemsType, hideApprovalPolicyIcon?: boolean) => {
5841
const linkDataTestName = item.title.toLowerCase().split(' ').join('-')
5942

6043
return (
61-
<ConditionalWrap condition={!!options?.tooltipContent} wrap={wrapWithTooltip(options?.tooltipContent)}>
62-
<NavLink
63-
data-testid={`${linkDataTestName}-link`}
64-
key={item.title}
65-
onClick={(event) => {
66-
if (item.isLocked) {
67-
event.preventDefault()
68-
}
69-
}}
70-
className="dc__nav-item cursor fs-13 lh-32 cn-9 w-100 br-4 px-8 flexbox dc__align-items-center dc__content-space dc__no-decor"
71-
to={item.href}
72-
target={options?.target}
73-
>
74-
<span className="dc__truncate nav-text">{item.title}</span>
75-
{options?.icon ??
76-
renderNavItemIcon(
77-
item.isLocked,
78-
!hideApprovalPolicyIcon && item.isProtectionAllowed,
79-
linkDataTestName,
80-
)}
81-
</NavLink>
82-
</ConditionalWrap>
44+
<NavLink
45+
data-testid={`${linkDataTestName}-link`}
46+
key={item.title}
47+
onClick={(event) => {
48+
if (item.isLocked) {
49+
event.preventDefault()
50+
}
51+
}}
52+
className="dc__nav-item cursor fs-13 lh-32 cn-7 w-100 br-4 px-8 flexbox dc__align-items-center dc__content-space dc__no-decor"
53+
to={item.href}
54+
>
55+
<span className="dc__truncate nav-text">{item.title}</span>
56+
{renderNavItemIcon(item.isLocked, !hideApprovalPolicyIcon && item.isProtectionAllowed, linkDataTestName)}
57+
</NavLink>
8358
)
8459
}
8560

src/Pages/Applications/DevtronApps/Details/AppConfigurations/appConfig.scss

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -61,22 +61,6 @@
6161
grid-template-rows: repeat(3, 32px) 1fr;
6262
}
6363
}
64-
65-
&.config-protection__side-nav {
66-
grid-template-rows: 110px repeat(4, 32px) 54px 32px 1fr auto;
67-
68-
&.hide-external-links {
69-
grid-template-rows: 110px repeat(4, 32px) 54px 1fr auto;
70-
}
71-
72-
&.hide-app-config-help {
73-
grid-template-rows: repeat(4, 32px) 54px 32px 1fr auto;
74-
75-
&.hide-external-links {
76-
grid-template-rows: repeat(4, 32px) 54px 1fr auto;
77-
}
78-
}
79-
}
8064
}
8165

8266
&.app-compose-with-gitops-config__nav {
@@ -89,22 +73,6 @@
8973
grid-template-rows: repeat(5, 32px) 1fr auto;
9074
}
9175
}
92-
93-
&.config-protection__side-nav {
94-
grid-template-rows: 110px repeat(5, 32px) 54px 32px 1fr auto;
95-
96-
&.hide-external-links {
97-
grid-template-rows: 110px repeat(5, 32px) 54px 1fr auto;
98-
}
99-
100-
&.hide-app-config-help {
101-
grid-template-rows: repeat(5, 32px) 54px 32px 1fr auto;
102-
103-
&.hide-external-links {
104-
grid-template-rows: repeat(5, 32px) 54px 1fr auto;
105-
}
106-
}
107-
}
10876
}
10977

11078
.help-container {

src/components/cdPipeline/BuildCD.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ import { BuildCDProps } from './types'
6464
const VirtualEnvSelectionInfoText = importComponentFromFELibrary('VirtualEnvSelectionInfoText')
6565
const HelmManifestPush = importComponentFromFELibrary('HelmManifestPush')
6666
const MigrateHelmReleaseBody = importComponentFromFELibrary('MigrateHelmReleaseBody', null, 'function')
67-
const ApprovalPolicyRedirectCard = importComponentFromFELibrary('ApprovalPolicyRedirectCard', null, 'function')
6867

6968
export default function BuildCD({
7069
isAdvanced,
@@ -776,9 +775,6 @@ export default function BuildCD({
776775
!noGitOpsModuleInstalledAndConfigured &&
777776
renderDeploymentAppType()}
778777
{isAdvanced ? renderAdvancedDeploymentStrategy() : renderBasicDeploymentStrategy()}
779-
{isAdvanced &&
780-
ApprovalPolicyRedirectCard &&
781-
<ApprovalPolicyRedirectCard />}
782778
{isAdvanced && (
783779
<>
784780
<CustomImageTags

0 commit comments

Comments
 (0)