Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ export const CreateSharedListFlyout = memo(
navigateToApp(APP_UI_ID, {
deepLinkId: SecurityPageName.exceptions,
path: `/details/${createSharedExceptionListState.result.list_id}`,
state: { justCreated: newListDetails.name },
});
}
}, [createSharedExceptionListState, navigateToApp]);
}, [createSharedExceptionListState, navigateToApp, newListDetails.name]);

const handleCreateSharedExceptionList = useCallback(() => {
if (!createSharedExceptionListState.loading && newListDetails.name !== '') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
ExceptionListHeader,
ViewerStatus,
} from '@kbn/securitysolution-exception-list-components';
import { EuiSkeletonText } from '@elastic/eui';
import { useParams } from 'react-router-dom';
import { EuiScreenReaderLive, EuiSkeletonText } from '@elastic/eui';
import { useLocation, useParams } from 'react-router-dom';
import { ExceptionListTypeEnum } from '@kbn/securitysolution-io-ts-list-types';
import { SecurityPageName } from '../../../../common/constants';
import { SpyRoute } from '../../../common/utils/route/spy_routes';
Expand Down Expand Up @@ -64,6 +64,11 @@ export const ListsDetailViewComponent: FC = () => {
handleReferenceDelete,
} = useListDetailsView(exceptionListId);

const location = useLocation<{ justCreated?: string }>();
const screenReaderMessage = location.state?.justCreated
? i18n.SHARED_EXCEPTION_LIST_CREATED_SUCCESSFULLY(location.state.justCreated)
: '';

const [showIncludeExpiredExceptionItemsModal, setShowIncludeExpiredExceptionItemsModal] =
useState<CheckExceptionTtlActionTypes | null>(null);

Expand Down Expand Up @@ -190,6 +195,9 @@ export const ListsDetailViewComponent: FC = () => {
]);
return (
<>
{screenReaderMessage && (
<EuiScreenReaderLive focusRegionOnTextChange>{screenReaderMessage}</EuiScreenReaderLive>
)}
<SpyRoute pageName={SecurityPageName.exceptions} state={{ listName }} />
{detailsViewContent}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,9 @@ export const EXCEPTION_DUPLICATE_ERROR_DESCRIPTION = i18n.translate(
defaultMessage: 'An error occurred duplicating a list',
}
);

export const SHARED_EXCEPTION_LIST_CREATED_SUCCESSFULLY = (listName: string) =>
i18n.translate('xpack.securitySolution.exceptions.list.createdSuccessfully', {
values: { listName },
defaultMessage: 'Exception list "{listName}" was created successfully.',
});
Loading