Skip to content

Commit

Permalink
Merge pull request #1782 from SanjalKatiyar/bucket_redirect
Browse files Browse the repository at this point in the history
Navigate to buckets' list page on deletion
  • Loading branch information
openshift-merge-bot[bot] authored Dec 17, 2024
2 parents 41b7a53 + 0642bb2 commit 87dcda6
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { S3Commands } from '@odf/shared/s3';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { LaunchModal } from '@openshift-console/dynamic-plugin-sdk/lib/app/modal-support/ModalProvider';
import { Trans } from 'react-i18next';
import { useNavigate } from 'react-router-dom-v5-compat';
import useSWR from 'swr';
import {
Modal,
Expand All @@ -27,6 +28,7 @@ import {
AlertActionLink,
ButtonVariant,
} from '@patternfly/react-core';
import { BUCKETS_BASE_ROUTE } from '../../../constants';
import { EmptyBucketResponse, getTextInputLabel } from './EmptyBucketModal';
import { LazyEmptyBucketModal } from './lazy-delete-and-empty-bucket';

Expand Down Expand Up @@ -56,6 +58,8 @@ const DeleteBucketModal: React.FC<CommonModalProps<DeleteBucketModalProps>> = ({
const [inProgress, setInProgress] = React.useState(false);
const [deleteError, setDeleteError] = React.useState<Error>(null);

const navigate = useNavigate();

const {
data,
error,
Expand Down Expand Up @@ -87,6 +91,7 @@ const DeleteBucketModal: React.FC<CommonModalProps<DeleteBucketModalProps>> = ({
oldFavorites.filter((bucket) => bucket !== bucketName)
);
refreshTokens?.();
navigate(BUCKETS_BASE_ROUTE);
} catch (err) {
setDeleteError(err);
setInProgress(false);
Expand Down

0 comments on commit 87dcda6

Please sign in to comment.