Skip to content

Commit

Permalink
Fix [Alerts] The alert details pane doesn't close when navigating thr…
Browse files Browse the repository at this point in the history
…ough pagination (#3011)
  • Loading branch information
pinis-gini-apps authored Jan 13, 2025
1 parent 5b6330d commit 3f9f7bf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
7 changes: 4 additions & 3 deletions src/components/Alerts/AlertsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import NoData from '../../common/NoData/NoData'
import Pagination from '../../common/Pagination/Pagination'
import Table from '../Table/Table'

import { ALERTS_FILTERS, ALERTS_PAGE } from '../../constants'
import { ALERTS_FILTERS, ALERTS_PAGE, ALERTS_PAGE_PATH } from '../../constants'
import { getNoDataMessage } from '../../utils/getNoDataMessage'
import { getCloseDetailsAlertLink } from '../../utils/link-helper.util'
import { getCloseDetailsLink } from '../../utils/link-helper.util'

import './alerts.scss'

Expand Down Expand Up @@ -98,7 +98,7 @@ const AlertsView = ({
<>
<Table
actionsMenu={[]}
getCloseDetailsLink={() => getCloseDetailsAlertLink()}
getCloseDetailsLink={() => getCloseDetailsLink(ALERTS_PAGE_PATH)}
pageData={pageData}
retryRequest={handleRefreshWithFilters}
selectedItem={isAlertsPage ? selectedAlert : {}}
Expand Down Expand Up @@ -130,6 +130,7 @@ const AlertsView = ({
})}
</Table>
<Pagination
closeParamName={ALERTS_PAGE_PATH}
page={pageData.page}
paginationConfig={paginationConfigAlertsRef.current}
/>
Expand Down
1 change: 1 addition & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export const JOBS_MONITORING_WORKFLOWS_TAB = 'workflows'
export const JOBS_MONITORING_SCHEDULED_TAB = 'scheduled'

export const ALERTS_PAGE = 'ALERTS'
export const ALERTS_PAGE_PATH = 'alerts'
export const ALERTS_TAB = 'alerts'
export const ALERTS_FILTERS = 'alerts'
export const MODEL_ENDPOINT_RESULT = 'model-endpoint-result'
Expand Down
5 changes: 0 additions & 5 deletions src/utils/link-helper.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ export const getCloseDetailsLink = (paramName, ignoreOrigin) => {
return ignoreOrigin ? link : generateUrlFromRouterPath(link)
}

//TODO: the getCloseDetailsAlertLink will be updated with ML-8368
export const getCloseDetailsAlertLink = () => {
return `/projects/*/alerts/${window.location.search}`
}

export const getDefaultCloseDetailsLink = (params, page, tab) => {
return `/projects/${params.projectName}/${page.toLowerCase()}${
params.pageTab ? `/${params.pageTab}` : tab ? `/${tab}` : ''
Expand Down

0 comments on commit 3f9f7bf

Please sign in to comment.