Skip to content

Commit b77baba

Browse files
shivani170Elessar1802
authored andcommitted
fix for deploy dropdown
1 parent e69abeb commit b77baba

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

src/components/app/details/triggerView/cdMaterial.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export default function CDMaterial({
179179
const [showAppliedFilters, setShowAppliedFilters] = useState<boolean>(false)
180180
const [deploymentLoading, setDeploymentLoading] = useState<boolean>(false)
181181
const [appliedFilterList, setAppliedFilterList] = useState<FilterConditionsListType[]>([])
182-
182+
183183
const resourceFilters = materialsResult?.resourceFilters ?? []
184184
const hideImageTaggingHardDelete = materialsResult?.hideImageTaggingHardDelete ?? false
185185
const requestedUserId = materialsResult?.requestedUserId ?? ''
@@ -779,15 +779,10 @@ export default function CDMaterial({
779779
: state.specificDeploymentConfig
780780
}
781781

782-
const redirectURLToInitial = (urlTo: string = '') => {
783-
const urlPrefix = match.url
784-
history.push(`${urlPrefix}/${urlTo}`)
785-
}
786782

787783
const handleConfigSelection = (selected) => {
788-
if (selected.value !== state.selectedConfigToDeploy.value) {
784+
if (selected?.value !== state.selectedConfigToDeploy.value) {
789785
const _diffOptions = checkForDiff(state.recentDeploymentConfig, getBaseTemplateConfiguration(selected))
790-
redirectURLToInitial(selected.value)
791786
setState((prevState) => ({
792787
...prevState,
793788
selectedConfigToDeploy: selected,
@@ -2084,7 +2079,7 @@ export default function CDMaterial({
20842079
height: getTriggerBodyHeight(isApprovalConfigured),
20852080
}}
20862081
>
2087-
{showConfigDiffView && canReviewConfig() ? (
2082+
{state.checkingDiff ? <Progressing pageLoader /> : showConfigDiffView && canReviewConfig() ? (
20882083
<TriggerViewConfigDiff
20892084
currentConfiguration={state.recentDeploymentConfig}
20902085
baseTemplateConfiguration={getBaseTemplateConfiguration()}

src/components/app/details/triggerView/triggerViewConfigDiff/TriggerViewConfigDiff.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ export default function TriggerViewConfigDiff({
5757

5858
useEffect(() => {
5959
if(canReviewConfig() && baseTemplateConfiguration && currentConfiguration){
60-
const dataValue = searchParams.config?.replace('-', '/')
61-
setParamsValue(dataValue.replace('/', '-'))
62-
handleNavOptionSelection(null, dataValue)
60+
const configParamValue = searchParams.config?.replace('-', '/')
61+
setParamsValue(configParamValue.replace('/', '-'))
62+
//handling the case when the user directly lands on the deployment history page
63+
handleNavOptionSelection(null, configParamValue)
64+
handleConfigSelection({value: searchParams.deploy.toLocaleUpperCase()})
6365
}
64-
65-
6666
}, [canReviewConfig(), baseTemplateConfiguration , currentConfiguration])
6767

6868
useEffect(() => {

0 commit comments

Comments
 (0)