From df8b6300c82ede2bde1203f4cce894008fdcb46b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20W=C3=B3jcik?= Date: Mon, 9 Mar 2026 12:12:46 +0100 Subject: [PATCH 01/21] fix alias/destination created toast --- web/src/pages/CEAliasPage/CEAliasPage.tsx | 8 +++++++- .../pages/CEDestinationPage/CEDestinationPage.tsx | 14 ++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/web/src/pages/CEAliasPage/CEAliasPage.tsx b/web/src/pages/CEAliasPage/CEAliasPage.tsx index 7202bcd0ff..8d2e0ca263 100644 --- a/web/src/pages/CEAliasPage/CEAliasPage.tsx +++ b/web/src/pages/CEAliasPage/CEAliasPage.tsx @@ -81,6 +81,9 @@ const formSchema = z.object({ type FormFields = z.infer; +const aliasCreatedMessage = 'Alias created.'; +const aliasEditedMessage = 'Aliase added to Pending tab and awaiting deployment.'; + const anyComponentDefined = (fields: FormFields): boolean => { return ( fields.ports.trim().length > 0 || @@ -137,12 +140,15 @@ const FormContent = ({ alias }: { alias?: AclAlias }) => { ...cloneDeep(value), protocols: Array.from(value.protocols), }; + if (isPresent(alias)) { await editAlias({ ...toSend, id: alias.id }); + Snackbar.default(aliasEditedMessage); } else { await addAlias(toSend); + Snackbar.default(aliasCreatedMessage); } - Snackbar.default('Aliases added to Pending tab and awaiting deployment.'); + router.history.back(); }, }); diff --git a/web/src/pages/CEDestinationPage/CEDestinationPage.tsx b/web/src/pages/CEDestinationPage/CEDestinationPage.tsx index 8579c95b0a..85f409a1ff 100644 --- a/web/src/pages/CEDestinationPage/CEDestinationPage.tsx +++ b/web/src/pages/CEDestinationPage/CEDestinationPage.tsx @@ -73,15 +73,16 @@ type FormFields = z.infer; const getProtocolName = (value: AclProtocolValue): string => AclProtocolName[value]; +const destinationCreatedMessage = 'Destination created.'; +const destinationEditedMessage = + 'Destination added to Pending tab and awaiting deployment.'; + export const CEDestinationPage = ({ destination }: Props) => { const router = useRouter(); const isEdit = isPresent(destination); const { mutateAsync: addDestination } = useMutation({ mutationFn: api.acl.destination.addDestination, - onSuccess: () => { - Snackbar.default('Destinations added to Pending tab and awaiting deployment.'); - }, onError: (e) => { Snackbar.error('Error occurred'); console.error(e); @@ -93,9 +94,6 @@ export const CEDestinationPage = ({ destination }: Props) => { const { mutateAsync: editDestination } = useMutation({ mutationFn: api.acl.destination.editDestination, - onSuccess: () => { - Snackbar.default('Destinations added to Pending tab and awaiting deployment.'); - }, onError: (e) => { Snackbar.error('Error occurred'); console.error(e); @@ -133,15 +131,19 @@ export const CEDestinationPage = ({ destination }: Props) => { }, onSubmit: async ({ value }) => { const toSend = { ...value, protocols: Array.from(value.protocols) }; + try { if (isPresent(destination)) { await editDestination({ ...toSend, id: destination.id, }); + Snackbar.default(destinationEditedMessage); } else { await addDestination(toSend); + Snackbar.default(destinationCreatedMessage); } + router.history.back(); } catch (e) { console.error(e); From 9d9ec1b4e4b30345a11a4f7a7282fa2fa109313e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20W=C3=B3jcik?= Date: Mon, 9 Mar 2026 12:27:01 +0100 Subject: [PATCH 02/21] fix alias page filtering --- web/src/pages/AliasesPage/tabs/AliasesDeployedTab.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/pages/AliasesPage/tabs/AliasesDeployedTab.tsx b/web/src/pages/AliasesPage/tabs/AliasesDeployedTab.tsx index d0f52c6184..b38b13b9a5 100644 --- a/web/src/pages/AliasesPage/tabs/AliasesDeployedTab.tsx +++ b/web/src/pages/AliasesPage/tabs/AliasesDeployedTab.tsx @@ -47,7 +47,7 @@ export const AliasesDeployedTab = () => { [navigate, licenseFetching, licenseInfo], ); - const distilledAliases = useMemo(() => { + const filteredAliases = useMemo(() => { let res = aliases; if (search?.length) { res = res.filter((alias) => @@ -57,7 +57,7 @@ export const AliasesDeployedTab = () => { return res; }, [aliases, search]); - const visibleEmpty = distilledAliases.length === 0; + const visibleEmpty = filteredAliases.length === 0; return ( <> @@ -81,7 +81,7 @@ export const AliasesDeployedTab = () => { />