Skip to content

Commit e0ea887

Browse files
committed
chore: remove dead and unreachable code from app details and related areas
1 parent 42ffe3a commit e0ea887

36 files changed

+83
-440
lines changed

.eslintignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ src/components/v2/appDetails/ReleaseStatusEmptyState.tsx
330330
src/components/v2/appDetails/SyncError.component.tsx
331331
src/components/v2/appDetails/__tests__/index.store.test.ts
332332
src/components/v2/appDetails/appDetails.api.ts
333-
src/components/v2/appDetails/appDetails.type.ts
334333
src/components/v2/appDetails/ea/EAAppDetail.component.tsx
335334
src/components/v2/appDetails/k8Resource/FilterResource.tsx
336335
src/components/v2/appDetails/k8Resource/nodeDetail/EphemeralContainerDrawer.tsx
@@ -367,7 +366,6 @@ src/components/v2/devtronStackManager/DevtronStackManager.service.tsx
367366
src/components/v2/devtronStackManager/DevtronStackManager.tsx
368367
src/components/v2/devtronStackManager/DevtronStackManager.utils.ts
369368
src/components/v2/devtronStackManager/SuccessModalComponent.tsx
370-
src/components/v2/headers/AppHeader.component.tsx
371369
src/components/v2/headers/ChartHeader.component.tsx
372370
src/components/v2/headers/EAHeader.component.tsx
373371
src/components/v2/index.tsx

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'

src/components/ClusterNodes/NodeActions/EditTaintsModal.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
TippyCustomized,
2323
TippyTheme,
2424
stopPropagation,
25-
InfoColourBar,
2625
SelectPicker,
2726
ToastVariantType,
2827
ToastManager,
@@ -32,15 +31,14 @@ import {
3231
ButtonVariantType,
3332
ButtonStyleType,
3433
InfoBlock,
34+
OptionType,
3535
} from '@devtron-labs/devtron-fe-common-lib'
3636
import { useParams } from 'react-router-dom'
37-
import { ReactComponent as InfoIcon } from '../../../assets/icons/info-filled.svg'
3837
import { ReactComponent as Add } from '../../../assets/icons/ic-add.svg'
3938
import { ReactComponent as DeleteIcon } from '../../../assets/icons/ic-delete-interactive.svg'
4039
import { ReactComponent as HelpIcon } from '../../../assets/icons/ic-help.svg'
4140
import { ReactComponent as Close } from '../../../assets/icons/ic-close.svg'
4241
import { updateTaints } from '../clusterNodes.service'
43-
import { OptionType } from '../../app/types'
4442
import { EditTaintsModalType, EditTaintsRequest, EFFECT_TYPE, TaintErrorObj, TaintType } from '../types'
4543
import { ValidationRules } from './validationRules'
4644
import { EDIT_TAINTS_MODAL_MESSAGING, TAINT_OPTIONS } from '../constants'

src/components/ClusterNodes/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ import {
2020
K8sResourceDetailDataType,
2121
NodeActionRequest,
2222
NodeTaintType,
23+
OptionType,
2324
ResourceDetail,
2425
ResponseType,
2526
} from '@devtron-labs/devtron-fe-common-lib'
2627

2728
import { UpdateTabUrlParamsType, UseTabsReturnType } from '@Components/common/DynamicTabs/types'
2829

29-
import { LabelTag, OptionType } from '../app/types'
30+
import { LabelTag } from '../app/types'
3031
import { ClusterOptionType, K8SResourceListType, ResourceBrowserActionMenuType } from '../ResourceBrowser/Types'
3132
import { EditModeType } from '../v2/appDetails/k8Resource/nodeDetail/NodeDetailTabs/terminal/constants'
3233
import { CLUSTER_PAGE_TAB } from './constants'

src/components/app/details/appDetails/AppDetails.tsx

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
aggregateNodes,
2323
ArtifactInfoModal,
2424
Button,
25-
ButtonComponentType,
2625
DeploymentAppTypes,
2726
GenericEmptyState,
2827
getAppsInfoForEnv,
@@ -43,7 +42,6 @@ import {
4342
import { ReactComponent as ForwardArrow } from '@Icons/ic-arrow-forward.svg'
4443
import { ReactComponent as Trash } from '@Icons/ic-delete-dots.svg'
4544
import AppNotConfiguredIcon from '@Images/app-not-configured.png'
46-
import AppNotDeployedIcon from '@Images/app-not-deployed.svg'
4745
import noGroups from '@Images/[email protected]'
4846

4947
import {
@@ -53,7 +51,6 @@ import {
5351
DEPLOYMENT_STATUS_QUERY_PARAM,
5452
DOCUMENTATION,
5553
getAppDetailsURL,
56-
getAppTriggerURL,
5754
HELM_DEPLOYMENT_STATUS_TEXT,
5855
RESOURCES_NOT_FOUND,
5956
} from '../../../../config'
@@ -172,41 +169,6 @@ export const AppNotConfigured = ({
172169
)
173170
}
174171

175-
const EnvironmentNotConfigured = ({ environments }: Record<string, any>) => {
176-
const environmentsMap = Array.isArray(environments)
177-
? environments.reduce((agg, curr) => {
178-
// eslint-disable-next-line no-param-reassign
179-
agg[curr.environmentId] = curr.environmentName
180-
return agg
181-
}, {})
182-
: {}
183-
const { envId, appId } = useParams<{ appId; envId }>()
184-
185-
const renderButton = () => (
186-
<Button
187-
dataTestId="go-to-trigger"
188-
component={ButtonComponentType.link}
189-
text="Go to Trigger"
190-
linkProps={{
191-
to: getAppTriggerURL(appId),
192-
}}
193-
/>
194-
)
195-
196-
return (
197-
<GenericEmptyState
198-
image={environmentsMap[+envId] ? AppNotDeployedIcon : AppNotConfiguredIcon}
199-
title={
200-
environmentsMap[+envId]
201-
? `This app is not deployed on ${environmentsMap[+envId]}`
202-
: `Please select an environment to view app details`
203-
}
204-
isButtonAvailable={environmentsMap[+envId]}
205-
renderButton={renderButton}
206-
/>
207-
)
208-
}
209-
210172
const DeletedAppComponent: React.FC<DeletedAppComponentType> = ({
211173
resourceTreeFetchTimeOut,
212174
showApplicationDetailedModal,
@@ -915,7 +877,12 @@ const AppDetail = ({ detailsType, filteredResourceIds }: AppDetailProps) => {
915877
const renderAppNotConfigured = () => (
916878
<>
917879
{envList.length === 0 && !isAppDeleted && <AppNotConfigured />}
918-
{!params.envId && envList.length > 0 && <EnvironmentNotConfigured environments={envList} />}
880+
{!params.envId && envList.length > 0 && (
881+
<GenericEmptyState
882+
image={AppNotConfiguredIcon}
883+
title="Please select an environment to view app details"
884+
/>
885+
)}
919886
</>
920887
)
921888

src/components/app/details/appDetails/appDetails.type.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
ACTION_STATE,
1919
AppEnvironment,
2020
EnvAppsMetaDTO,
21+
OptionType,
2122
ResponseType,
2223
ScanResultDTO,
2324
SelectPickerProps,
@@ -27,7 +28,7 @@ import {
2728
import { fetchAppDetailsInTime } from '@Components/app/service'
2829

2930
import { AppDetails, SyncErrorType } from '../../../v2/appDetails/appDetails.type'
30-
import { AggregatedNodes, OptionType } from '../../types'
31+
import { AggregatedNodes } from '../../types'
3132

3233
export enum AppMetricsTab {
3334
Aggregate = 'aggregate',

0 commit comments

Comments
 (0)