fix(ui): navigate to listing for deleting a service (#18428)

(cherry picked from commit 5c550e7bc315ba785c8687a5b939d38f3107a447)
This commit is contained in:
Chirag Madlani 2024-10-29 10:56:17 +05:30 committed by karanh37
parent f2c4aaced9
commit b709c39cff

View File

@ -48,6 +48,7 @@ import {
pagingObject, pagingObject,
ROUTES, ROUTES,
} from '../../constants/constants'; } from '../../constants/constants';
import { GlobalSettingsMenuCategory } from '../../constants/GlobalSettings.constants';
import { import {
OPEN_METADATA, OPEN_METADATA,
SERVICE_INGESTION_PIPELINE_TYPES, SERVICE_INGESTION_PIPELINE_TYPES,
@ -113,11 +114,13 @@ import { DEFAULT_ENTITY_PERMISSION } from '../../utils/PermissionsUtils';
import { import {
getEditConnectionPath, getEditConnectionPath,
getServiceVersionPath, getServiceVersionPath,
getSettingPath,
} from '../../utils/RouterUtils'; } from '../../utils/RouterUtils';
import { import {
getCountLabel, getCountLabel,
getEntityTypeFromServiceCategory, getEntityTypeFromServiceCategory,
getResourceEntityFromServiceCategory, getResourceEntityFromServiceCategory,
getServiceRouteFromServiceType,
shouldTestConnection, shouldTestConnection,
} from '../../utils/ServiceUtils'; } from '../../utils/ServiceUtils';
import { import {
@ -791,8 +794,15 @@ const ServiceDetailsPage: FunctionComponent = () => {
const afterDeleteAction = useCallback( const afterDeleteAction = useCallback(
(isSoftDelete?: boolean, version?: number) => (isSoftDelete?: boolean, version?: number) =>
isSoftDelete ? handleToggleDelete(version) : history.goBack(), isSoftDelete
[handleToggleDelete] ? handleToggleDelete(version)
: history.push(
getSettingPath(
GlobalSettingsMenuCategory.SERVICES,
getServiceRouteFromServiceType(serviceCategory)
)
),
[handleToggleDelete, serviceCategory]
); );
const handleRestoreService = useCallback(async () => { const handleRestoreService = useCallback(async () => {