Skip to content

Commit 70cdc09

Browse files
committed
feat: enhance CommandBarBackdrop with refetch capability and update AppDetails button to use link component
1 parent b6c471d commit 70cdc09

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

src/Pages/Shared/CommandBar/CommandBarBackdrop.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ const CommandBarBackdrop = ({ handleClose, isLoadingResourceList, resourceList }
7272
[resourceList],
7373
)
7474

75-
const { data: recentActionsGroup, isLoading } = useQuery({
75+
const {
76+
data: recentActionsGroup,
77+
isLoading,
78+
refetch: refetchActionsGroup,
79+
} = useQuery({
7680
queryFn: ({ signal }) =>
7781
getUserPreferences(signal).then((response) => {
7882
const responseData: ResponseType<typeof response> = {
@@ -176,6 +180,8 @@ const CommandBarBackdrop = ({ handleClose, isLoadingResourceList, resourceList }
176180
return
177181
}
178182

183+
await refetchActionsGroup()
184+
179185
const currentItemId = sanitizeItemId(item)
180186

181187
// In this now we will put the id as first item in the list and keep first 5 items then

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

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
AppStatusModalTabType,
2525
ArtifactInfoModal,
2626
Button,
27+
ButtonComponentType,
2728
DocLink,
2829
ErrorScreenManager,
2930
GenericEmptyState,
@@ -52,7 +53,7 @@ import { URL_PARAM_MODE_TYPE } from '@Components/common/helpers/types'
5253

5354
import { DEPLOYMENT_STATUS_QUERY_PARAM, RESOURCES_NOT_FOUND } from '../../../../config'
5455
import { APP_DETAILS, ERROR_EMPTY_SCREEN } from '../../../../config/constantMessaging'
55-
import { getAppConfigStatus, getAppOtherEnvironmentMin, stopStartApp } from '../../../../services/service'
56+
import { getAppOtherEnvironmentMin, stopStartApp } from '../../../../services/service'
5657
import { useAppContext } from '../../../common'
5758
import { ClusterMetaDataBar } from '../../../common/ClusterMetaDataBar/ClusterMetaDataBar'
5859
import { importComponentFromFELibrary } from '../../../common/helpers/Helpers'
@@ -103,24 +104,17 @@ export const AppNotConfigured = ({
103104
renderCustomButton?: () => JSX.Element
104105
}) => {
105106
const { appId } = useParams<{ appId: string }>()
106-
const { push } = useHistory()
107-
108-
const handleEditApp = () => {
109-
getAppConfigStatus(+appId, isJobView, false)
110-
.then(() => {
111-
const url = `${isJobView ? URLS.AUTOMATION_AND_ENABLEMENT_JOB : URLS.APPLICATION_MANAGEMENT_APP}/${appId}/edit`
112-
push(url)
113-
})
114-
.catch(noop)
115-
}
116107

117108
const renderButton = () =>
118109
appId && (
119110
<Button
120111
dataTestId="app-details-empty"
121112
text={buttonTitle || 'Go to app configurations'}
122-
onClick={handleEditApp}
123113
endIcon={<ForwardArrow />}
114+
component={ButtonComponentType.link}
115+
linkProps={{
116+
to: `${isJobView ? URLS.AUTOMATION_AND_ENABLEMENT_JOB : URLS.APPLICATION_MANAGEMENT_APP}/${appId}/edit`,
117+
}}
124118
/>
125119
)
126120

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const JobNotConfiguredSubtitle = () => (
4747
dataTestId="job-not-configured-learn-more"
4848
fontWeight="normal"
4949
text={APP_DETAILS.NEED_HELP}
50+
fullWidth
5051
/>
5152
</>
5253
)

0 commit comments

Comments
 (0)