|
6 | 6 | AnimatedDeployButton,
|
7 | 7 | API_STATUS_CODES,
|
8 | 8 | ArtifactInfo,
|
9 |
| - CDMaterialSidebarType, |
10 | 9 | ConditionalWrap,
|
11 | 10 | DEFAULT_ROUTE_PROMPT_MESSAGE,
|
12 | 11 | DEPLOYMENT_CONFIG_DIFF_SORT_KEY,
|
@@ -51,7 +50,8 @@ import { CDButtonLabelMap } from '../config'
|
51 | 50 | import { TRIGGER_VIEW_GA_EVENTS } from '../Constants'
|
52 | 51 | import { PipelineConfigDiff, usePipelineDeploymentConfig } from '../PipelineConfigDiff'
|
53 | 52 | import { PipelineConfigDiffStatusTile } from '../PipelineConfigDiff/PipelineConfigDiffStatusTile'
|
54 |
| -import { FilterConditionViews, MATERIAL_TYPE } from '../types' |
| 53 | +import { MATERIAL_TYPE } from '../types' |
| 54 | +import { INITIAL_DEPLOY_VIEW_STATE } from './constants' |
55 | 55 | import DeployImageContent from './DeployImageContent'
|
56 | 56 | import DeployImageHeader from './DeployImageHeader'
|
57 | 57 | import MaterialListSkeleton from './MaterialListSkeleton'
|
@@ -148,21 +148,9 @@ const DeployImageModal = ({
|
148 | 148 | const [deploymentStrategy, setDeploymentStrategy] = useState<DeploymentStrategyType | null>(null)
|
149 | 149 | const [showPluginWarningOverlay, setShowPluginWarningOverlay] = useState<boolean>(false)
|
150 | 150 | const [showDeploymentWindowConfirmation, setShowDeploymentWindowConfirmation] = useState(false)
|
151 |
| - const [deployViewState, setDeployViewState] = useState<Omit<DeployViewStateType, 'appliedSearchText'>>({ |
152 |
| - searchText: searchImageTag, |
153 |
| - filterView: FilterConditionViews.ALL, |
154 |
| - showConfiguredFilters: false, |
155 |
| - currentSidebarTab: CDMaterialSidebarType.IMAGE, |
156 |
| - runtimeParamsErrorState: { |
157 |
| - isValid: true, |
158 |
| - cellError: {}, |
159 |
| - }, |
160 |
| - materialInEditModeMap: new Map(), |
161 |
| - showAppliedFilters: false, |
162 |
| - appliedFilterList: [], |
163 |
| - isLoadingOlderImages: false, |
164 |
| - showSearchBar: false, |
165 |
| - }) |
| 151 | + const [deployViewState, setDeployViewState] = useState<Omit<DeployViewStateType, 'appliedSearchText'>>( |
| 152 | + structuredClone(INITIAL_DEPLOY_VIEW_STATE), |
| 153 | + ) |
166 | 154 |
|
167 | 155 | const isPreOrPostCD = stageType === DeploymentNodeType.PRECD || stageType === DeploymentNodeType.POSTCD
|
168 | 156 | const materialResponse = initialDataResponse?.[0] || null
|
|
0 commit comments