Skip to content

Commit d68e7cc

Browse files
authored
Merge pull request #2696 from devtron-labs/chore/cleanup-v2
chore: remove dead and unreachable code
2 parents 7925515 + eb2fe0c commit d68e7cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+247
-546
lines changed

.eslintignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,6 @@ src/components/v2/appDetails/ReleaseStatusEmptyState.tsx
329329
src/components/v2/appDetails/SyncError.component.tsx
330330
src/components/v2/appDetails/__tests__/index.store.test.ts
331331
src/components/v2/appDetails/appDetails.api.ts
332-
src/components/v2/appDetails/appDetails.type.ts
333332
src/components/v2/appDetails/ea/EAAppDetail.component.tsx
334333
src/components/v2/appDetails/k8Resource/FilterResource.tsx
335334
src/components/v2/appDetails/k8Resource/nodeDetail/EphemeralContainerDrawer.tsx
@@ -366,7 +365,6 @@ src/components/v2/devtronStackManager/DevtronStackManager.service.tsx
366365
src/components/v2/devtronStackManager/DevtronStackManager.tsx
367366
src/components/v2/devtronStackManager/DevtronStackManager.utils.ts
368367
src/components/v2/devtronStackManager/SuccessModalComponent.tsx
369-
src/components/v2/headers/AppHeader.component.tsx
370368
src/components/v2/headers/ChartHeader.component.tsx
371369
src/components/v2/headers/EAHeader.component.tsx
372370
src/components/v2/index.tsx

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"homepage": "/dashboard",
66
"dependencies": {
7-
"@devtron-labs/devtron-fe-common-lib": "1.13.0-pre-2",
7+
"@devtron-labs/devtron-fe-common-lib": "1.13.0-pre-3",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ export interface EnvConfigurationsNavProps extends Required<Pick<AppConfigProps,
218218
isCMSecretLocked?: boolean
219219
hideEnvSelector?: boolean
220220
appOrEnvIdToResourceApprovalConfigurationMap: AppConfigState['envIdToEnvApprovalConfigurationMap']
221+
shouldSetEnvInContext?: boolean
221222
}
222223

223224
export interface EnvConfigRouteParams {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ export const AppNavigation = () => {
172172
isCMSecretLocked={!isUnlocked.workflowEditor}
173173
appOrEnvIdToResourceApprovalConfigurationMap={envIdToEnvApprovalConfigurationMap}
174174
isTemplateView={isTemplateView}
175+
shouldSetEnvInContext={!isTemplateView && !isJobView}
175176
/>
176177
)}
177178
</Route>

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import { ReactComponent as ICArrowsLeftRight } from '@Icons/ic-arrows-left-right
4242
import { ReactComponent as ICBack } from '@Icons/ic-caret-left-small.svg'
4343
import { ReactComponent as ICFileCode } from '@Icons/ic-file-code.svg'
4444
import { ReactComponent as ICLocked } from '@Icons/ic-locked.svg'
45+
import { useAppContext } from '@Components/common'
4546
import { DEPLOYMENT_CONFIGURATION_RESOURCE_TYPE_ROUTE } from '@Config/constants'
4647
import { URLS } from '@Config/routes'
4748
import { ResourceConfigState } from '@Pages/Applications/DevtronApps/service.types'
@@ -306,15 +307,23 @@ export const EnvConfigurationsNav = ({
306307
compareWithURL,
307308
appOrEnvIdToResourceApprovalConfigurationMap,
308309
isTemplateView,
310+
shouldSetEnvInContext = false,
309311
}: EnvConfigurationsNavProps) => {
310312
const history = useHistory()
311313
const { isSuperAdmin } = useMainContext()
314+
const { setEnvironmentId } = useAppContext()
312315
const { pathname } = useLocation()
313316
const { path, params } = useRouteMatch<EnvConfigRouteParams>()
314317

315318
const { envId, resourceType } = params
316319
const parsedResourceId = +params[paramToCheck]
317320

321+
useEffect(() => {
322+
if (shouldSetEnvInContext && envId && !Number.isNaN(+envId)) {
323+
setEnvironmentId(+envId)
324+
}
325+
}, [envId, shouldSetEnvInContext])
326+
318327
const { isLoading } = envConfig
319328
const resourceData =
320329
resourceList.find((resource) => resource.id === parsedResourceId) ||

src/components/ApplicationGroup/AppGroup.types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ import {
2929
CommonNodeAttr,
3030
ApprovalConfigDataType,
3131
RuntimePluginVariables,
32+
OptionType,
3233
} from '@devtron-labs/devtron-fe-common-lib'
3334
import { CDMaterialProps, RuntimeParamsErrorState } from '../app/details/triggerView/types'
34-
import { EditDescRequest, NodeType, Nodes, OptionType } from '../app/types'
35+
import { EditDescRequest, NodeType, Nodes } from '../app/types'
3536
import { MultiValue } from 'react-select'
3637
import { AppFilterTabs, BulkResponseStatus } from './Constants'
3738
import { WorkloadCheckType } from '../v2/appDetails/sourceInfo/scaleWorkloads/scaleWorkloadsModal.type'

src/components/ApplicationGroup/AppGroupDetailsRoute.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import {
4141
URLS as CommonURLS,
4242
DeleteConfirmationModal,
4343
useMainContext,
44+
OptionType,
4445
} from '@devtron-labs/devtron-fe-common-lib'
4546
import ReactGA from 'react-ga4'
4647
import { MultiValue } from 'react-select'
@@ -78,7 +79,7 @@ import {
7879
FilterParentType,
7980
GroupOptionType,
8081
} from './AppGroup.types'
81-
import { EditDescRequest, OptionType } from '../app/types'
82+
import { EditDescRequest } from '../app/types'
8283
import AppGroupAppFilter from './AppGroupAppFilter'
8384
import EnvCIDetails from './Details/EnvCIDetails/EnvCIDetails'
8485
import EnvCDDetails from './Details/EnvCDDetails/EnvCDDetails'

src/components/ApplicationGroup/Details/EnvironmentOverview/__mock__/EnvironmentOverview.mock.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616

1717
import { MultiValue } from 'react-select'
1818

19-
import { OptionType } from '../../../../app/types'
19+
import { OptionType } from '@devtron-labs/devtron-fe-common-lib'
20+
2021
import { AppGroupListType, EnvDeploymentStatus, EnvDeploymentStatusType } from '../../../AppGroup.types'
2122

2223
const result = (): EnvDeploymentStatus[] => [

src/components/CIPipelineN/AdvancedConfigOptions.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@
1515
*/
1616

1717
import { useContext, useEffect, useState } from 'react'
18-
import { CIBuildConfigType, CIBuildType, KeyValueTableProps, noop } from '@devtron-labs/devtron-fe-common-lib'
18+
import { CIBuildConfigType, CIBuildType, KeyValueTableProps, noop, OptionType } from '@devtron-labs/devtron-fe-common-lib'
1919
import CIConfig from '../ciConfig/CIConfig'
2020
import DockerArgs from './DockerArgs'
2121
import CustomImageTags from './CustomImageTags'
2222
import TargetPlatformSelector from '../ciConfig/TargetPlatformSelector'
2323
import { ComponentStates } from '../../Pages/Shared/EnvironmentOverride/EnvironmentOverrides.types'
2424
import { AdvancedConfigOptionsProps, CIConfigParentState } from '../ciConfig/types'
2525
import { DockerConfigOverrideKeys } from '../ciPipeline/types'
26-
import { OptionType } from '../app/types'
2726
import { getTargetPlatformMap } from '../ciConfig/CIConfig.utils'
2827
import { pipelineContext } from '../workflowEditor/workflowEditor'
2928
import '../ciConfig/CIConfig.scss'

src/components/CIPipelineN/TaskTypeDetailComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
CustomInput,
2727
ClipboardButton,
2828
SelectPicker,
29+
OptionType,
2930
} from '@devtron-labs/devtron-fe-common-lib'
3031
import { components } from 'react-select'
3132
import { TaskFieldDescription, TaskFieldLabel } from '../ciPipeline/types'
@@ -36,7 +37,6 @@ import MountFromHost from './MountFromHost'
3637
import CustomScript from './CustomScript'
3738
import { ReactComponent as AlertTriangle } from '../../assets/icons/ic-alert-triangle.svg'
3839
import { getCustomOptionSelectionStyle } from '../v2/common/ReactSelect.utils'
39-
import { OptionType } from '../app/types'
4040
import { ValidationRules } from '../ciPipeline/validationRules'
4141
import { ReactComponent as Info } from '../../assets/icons/ic-info-filled.svg'
4242
import { pipelineContext } from '../workflowEditor/workflowEditor'

0 commit comments

Comments
 (0)