Skip to content

Commit 49b5b41

Browse files
committed
refactor: update AppStatusModal condition to check appDetails presence and enhance filter handling in K8ResourceComponent
1 parent 030587f commit 49b5b41

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ const Details: React.FC<DetailsType> = ({
751751
) : (
752752
renderAppDetails()
753753
)}
754-
{(detailedStatus || location.search.includes(DEPLOYMENT_STATUS_QUERY_PARAM)) && (
754+
{(detailedStatus || (appDetails && location.search.includes(DEPLOYMENT_STATUS_QUERY_PARAM))) && (
755755
<AppStatusModal
756756
titleSegments={[appDetailsFromIndexStore.appName, appDetailsFromIndexStore.environmentName]}
757757
handleClose={handleCloseAppStatusModal}

src/components/v2/appDetails/AppDetails.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ const AppDetailsComponent = ({
225225
renderHelmAppDetails()
226226
)}
227227

228-
{location.search.includes(DEPLOYMENT_STATUS_QUERY_PARAM) && (
228+
{appDetails && location.search.includes(DEPLOYMENT_STATUS_QUERY_PARAM) && (
229229
<AppStatusModal
230230
type="other-apps"
231231
titleSegments={[appDetails?.appName, appDetails?.environmentName || appDetails?.namespace]}

src/components/v2/appDetails/k8Resource/K8Resource.component.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,13 @@ export const K8ResourceComponent = ({
104104
}
105105

106106
const handleFilterClick = (selectedFilter: string) => {
107-
const searchParams = new URLSearchParams([['filterType', selectedFilter]])
107+
const searchParams = new URLSearchParams(location.search)
108+
searchParams.set('filterType', selectedFilter)
109+
108110
IndexStore.updateFilterType(selectedFilter.toUpperCase())
109111
if (selectedFilter === ALL_RESOURCE_KIND_FILTER) {
110-
history.push({ search: '' })
112+
searchParams.delete('filterType')
113+
history.push({ search: `${searchParams}` })
111114
return
112115
}
113116
// current selected node exist in new selected filter or not

0 commit comments

Comments
 (0)