From aeb98c1a3aaad2a8846ea14cdcd4efea5d65d12d Mon Sep 17 00:00:00 2001 From: Kuba <78603704+jakub-tldr@users.noreply.github.com> Date: Thu, 12 Mar 2026 13:56:11 +0100 Subject: [PATCH 1/4] add delete confirmation --- web/messages/en/modal.json | 2 + web/messages/en/profile.json | 2 + .../UsersOverviewPage/UsersOverviewPage.tsx | 2 + .../pages/UsersOverviewPage/UsersTable.tsx | 14 ++- .../ProfileDevicesTab/ProfileDevicesTab.tsx | 2 + .../ProfileDevicesTable.tsx | 15 ++-- .../DeleteUserDeviceModal.tsx | 88 +++++++++++++++++++ .../shared/hooks/modalControls/modalTypes.ts | 6 ++ web/src/shared/hooks/modalControls/types.ts | 5 ++ 9 files changed, 117 insertions(+), 19 deletions(-) create mode 100644 web/src/shared/components/modals/DeleteUserDeviceModal/DeleteUserDeviceModal.tsx diff --git a/web/messages/en/modal.json b/web/messages/en/modal.json index f29705c956..b2592755da 100644 --- a/web/messages/en/modal.json +++ b/web/messages/en/modal.json @@ -12,6 +12,8 @@ "modal_delete_location_body": "Deleting location {name} will also delete related gateways. This action cannot be undone.", "modal_delete_network_device_title": "Delete device", "modal_delete_network_device_body": "Are you sure you want to delete this device? This action cannot be undone.", + "modal_delete_user_device_title": "Delete device", + "modal_delete_user_device_body": "Are you sure you want to delete the {name} device? This action cannot be undone.", "modal_delete_openid_client_title": "Delete application", "modal_delete_openid_client_body": "Are you sure you want to delete this application? This action cannot be undone.", "modal_delete_acl_alias_title": "Delete alias", diff --git a/web/messages/en/profile.json b/web/messages/en/profile.json index a77bddf060..3aba70509c 100644 --- a/web/messages/en/profile.json +++ b/web/messages/en/profile.json @@ -39,6 +39,8 @@ "profile_devices_menu_show_config": "Show configuration", "profile_devices_menu_ip_settings": "Device IP settings", "profile_devices_tooltip_biometric": "Biometric is enabled for this device", + "user_device_delete_success": "Device deleted", + "user_device_delete_failed": "Failed to delete device", "profile_auth_keys_no_data_title": "You don't have any added keys.", "profile_auth_keys_no_data_subtitle": "To add one, click the button below", "profile_auth_keys_no_data_cta": "Add new key", diff --git a/web/src/pages/UsersOverviewPage/UsersOverviewPage.tsx b/web/src/pages/UsersOverviewPage/UsersOverviewPage.tsx index 328ad1aade..21e93f3e75 100644 --- a/web/src/pages/UsersOverviewPage/UsersOverviewPage.tsx +++ b/web/src/pages/UsersOverviewPage/UsersOverviewPage.tsx @@ -5,6 +5,7 @@ import { m } from '../../paraglide/messages'; import { AddAuthKeyModal } from '../../shared/components/modals/AddAuthKeyModal/AddAuthKeyModal'; import { AssignUserDeviceIPModal } from '../../shared/components/modals/AssignUserDeviceIPModal/AssignUserDeviceIPModal'; import { ChangePasswordModal } from '../../shared/components/modals/ChangePasswordModal/ChangePasswordModal'; +import { DeleteUserDeviceModal } from '../../shared/components/modals/DeleteUserDeviceModal/DeleteUserDeviceModal'; import { EditUserDeviceModal } from '../../shared/components/modals/EditUserDeviceModal/EditUserDeviceModal'; import { UserDeviceConfigModal } from '../../shared/components/modals/UserDeviceConfigModal/UserDeviceConfigModal'; import { TableSkeleton } from '../../shared/components/skeleton/TableSkeleton/TableSkeleton'; @@ -31,6 +32,7 @@ export const UsersOverviewPage = () => { + diff --git a/web/src/pages/UsersOverviewPage/UsersTable.tsx b/web/src/pages/UsersOverviewPage/UsersTable.tsx index cfbba7c76b..d481bcfb7c 100644 --- a/web/src/pages/UsersOverviewPage/UsersTable.tsx +++ b/web/src/pages/UsersOverviewPage/UsersTable.tsx @@ -434,13 +434,6 @@ export const UsersTable = () => { [], ); - const { mutate: deleteDevice } = useMutation({ - mutationFn: api.device.deleteDevice, - meta: { - invalidate: [['user-overview'], ['user'], ['network']], - }, - }); - const makeDeviceRowMenu = useCallback( ( device: Device, @@ -492,7 +485,10 @@ export const UsersTable = () => { { text: m.controls_delete(), onClick: () => { - deleteDevice(device.id); + openModal(ModalName.DeleteUserDevice, { + id: device.id, + name: device.name, + }); }, variant: 'danger', icon: 'delete', @@ -500,7 +496,7 @@ export const UsersTable = () => { ], }, ], - [deleteDevice], + [], ); const renderExpanded = useCallback( diff --git a/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/ProfileDevicesTab.tsx b/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/ProfileDevicesTab.tsx index 34d64c0040..cf45623064 100644 --- a/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/ProfileDevicesTab.tsx +++ b/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/ProfileDevicesTab.tsx @@ -2,6 +2,7 @@ import { LayoutGrid } from '../../../../../shared/components/LayoutGrid/LayoutGr import './style.scss'; import { AddUserDeviceModal } from '../../../../../shared/components/modals/AddUserDeviceModal/AddUserDeviceModal'; import { AssignUserDeviceIPModal } from '../../../../../shared/components/modals/AssignUserDeviceIPModal/AssignUserDeviceIPModal'; +import { DeleteUserDeviceModal } from '../../../../../shared/components/modals/DeleteUserDeviceModal/DeleteUserDeviceModal'; import { EditUserDeviceModal } from '../../../../../shared/components/modals/EditUserDeviceModal/EditUserDeviceModal'; import { UserDeviceConfigModal } from '../../../../../shared/components/modals/UserDeviceConfigModal/UserDeviceConfigModal'; import { ProfileDevicesTable } from './components/ProfileDevicesTable/ProfileDevicesTable'; @@ -16,6 +17,7 @@ export const ProfileDevicesTab = () => { + > ); }; diff --git a/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/components/ProfileDevicesTable/ProfileDevicesTable.tsx b/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/components/ProfileDevicesTable/ProfileDevicesTable.tsx index 94e85ebcd7..b9e45ec820 100644 --- a/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/components/ProfileDevicesTable/ProfileDevicesTable.tsx +++ b/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/components/ProfileDevicesTable/ProfileDevicesTable.tsx @@ -1,5 +1,4 @@ import './style.scss'; -import { useMutation } from '@tanstack/react-query'; import { createColumnHelper, getCoreRowModel, @@ -112,13 +111,6 @@ const DevicesTable = ({ rowData }: { rowData: RowData[] }) => { [devices, user, info.network_present], ); - const { mutate: deleteDevice } = useMutation({ - mutationFn: api.device.deleteDevice, - meta: { - invalidate: [['user-overview'], ['user', username], ['network']], - }, - }); - const makeRowMenu = useCallback( (row: RowData): MenuItemsGroup[] => { const items: MenuItemProps[] = [ @@ -169,7 +161,10 @@ const DevicesTable = ({ rowData }: { rowData: RowData[] }) => { { text: m.controls_delete(), onClick: () => { - deleteDevice(row.id); + openModal(ModalName.DeleteUserDevice, { + id: row.id, + name: row.name, + }); }, variant: 'danger', icon: 'delete', @@ -177,7 +172,7 @@ const DevicesTable = ({ rowData }: { rowData: RowData[] }) => { ); return [{ items }]; }, - [reservedNames, username, deleteDevice, isAdmin], + [reservedNames, username, isAdmin], ); const tableColumns = useMemo( diff --git a/web/src/shared/components/modals/DeleteUserDeviceModal/DeleteUserDeviceModal.tsx b/web/src/shared/components/modals/DeleteUserDeviceModal/DeleteUserDeviceModal.tsx new file mode 100644 index 0000000000..254ae4bcfd --- /dev/null +++ b/web/src/shared/components/modals/DeleteUserDeviceModal/DeleteUserDeviceModal.tsx @@ -0,0 +1,88 @@ +import { useMutation } from '@tanstack/react-query'; +import { useEffect, useState } from 'react'; +import { m } from '../../../../paraglide/messages'; +import api from '../../../api/api'; +import { AppText } from '../../../defguard-ui/components/AppText/AppText'; +import { Button } from '../../../defguard-ui/components/Button/Button'; +import { Modal } from '../../../defguard-ui/components/Modal/Modal'; +import { Snackbar } from '../../../defguard-ui/providers/snackbar/snackbar'; +import { TextStyle } from '../../../defguard-ui/types'; +import { + subscribeCloseModal, + subscribeOpenModal, +} from '../../../hooks/modalControls/modalsSubjects'; +import { ModalName } from '../../../hooks/modalControls/modalTypes'; +import type { OpenDeleteUserDeviceModal } from '../../../hooks/modalControls/types'; +import { Controls } from '../../Controls/Controls'; + +const modalNameValue = ModalName.DeleteUserDevice; + +type ModalData = OpenDeleteUserDeviceModal; + +export const DeleteUserDeviceModal = () => { + const [isOpen, setOpen] = useState(false); + const [modalData, setModalData] = useState(null); + + const { mutateAsync: deleteDevice, isPending } = useMutation({ + mutationFn: api.device.deleteDevice, + meta: { + invalidate: [['user-overview'], ['user'], ['network']], + }, + }); + + useEffect(() => { + const openSub = subscribeOpenModal(modalNameValue, (data) => { + setModalData(data); + setOpen(true); + }); + const closeSub = subscribeCloseModal(modalNameValue, () => setOpen(false)); + return () => { + openSub.unsubscribe(); + closeSub.unsubscribe(); + }; + }, []); + + const handleDelete = async () => { + if (!modalData) return; + try { + await deleteDevice(modalData.id); + Snackbar.success(m.user_device_delete_success()); + setOpen(false); + } catch { + Snackbar.error(m.user_device_delete_failed()); + } + }; + + return ( + setOpen(false)} + afterClose={() => setModalData(null)} + > + + {m.modal_delete_user_device_body({ name: modalData?.name ?? '' })} + + + + setOpen(false)} + disabled={isPending} + /> + + + + + ); +}; diff --git a/web/src/shared/hooks/modalControls/modalTypes.ts b/web/src/shared/hooks/modalControls/modalTypes.ts index 9d9122314d..b3354ae1da 100644 --- a/web/src/shared/hooks/modalControls/modalTypes.ts +++ b/web/src/shared/hooks/modalControls/modalTypes.ts @@ -17,6 +17,7 @@ import type { OpenDeleteLocationModal, OpenDeleteNetworkDeviceModal, OpenDeleteOpenIdClientModal, + OpenDeleteUserDeviceModal, OpenDisplayListModal, OpenEditDeviceModal, OpenEditNetworkDeviceModal, @@ -63,6 +64,7 @@ export const ModalName = { NetworkDeviceConfig: 'networkDeviceConfig', NetworkDeviceToken: 'networkDeviceToken', DeleteNetworkDevice: 'deleteNetworkDevice', + DeleteUserDevice: 'deleteUserDevice', DeleteOpenIdClient: 'deleteOpenIdClient', AddLocation: 'addLocation', AddLogStreaming: 'addLogStreaming', @@ -199,6 +201,10 @@ const modalOpenArgsSchema = z.discriminatedUnion('name', [ name: z.literal(ModalName.DeleteNetworkDevice), data: z.custom(), }), + z.object({ + name: z.literal(ModalName.DeleteUserDevice), + data: z.custom(), + }), z.object({ name: z.literal(ModalName.DeleteOpenIdClient), data: z.custom(), diff --git a/web/src/shared/hooks/modalControls/types.ts b/web/src/shared/hooks/modalControls/types.ts index a08d495163..58c13e1776 100644 --- a/web/src/shared/hooks/modalControls/types.ts +++ b/web/src/shared/hooks/modalControls/types.ts @@ -165,6 +165,11 @@ export interface OpenDeleteNetworkDeviceModal { name: string; } +export interface OpenDeleteUserDeviceModal { + id: number; + name: string; +} + export interface OpenDeleteOpenIdClientModal { client_id: string; name: string; From 0ffe1927721d36799db81636bf1a18456a78a6e9 Mon Sep 17 00:00:00 2001 From: Kuba <78603704+jakub-tldr@users.noreply.github.com> Date: Thu, 12 Mar 2026 15:15:51 +0100 Subject: [PATCH 2/4] add generic modal instead of new one --- web/src/pages/UsersOverviewPage/UsersTable.tsx | 11 ++++++++--- .../ProfileDevicesTable/ProfileDevicesTable.tsx | 12 +++++++++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/web/src/pages/UsersOverviewPage/UsersTable.tsx b/web/src/pages/UsersOverviewPage/UsersTable.tsx index d481bcfb7c..d78cb1e7b1 100644 --- a/web/src/pages/UsersOverviewPage/UsersTable.tsx +++ b/web/src/pages/UsersOverviewPage/UsersTable.tsx @@ -485,9 +485,14 @@ export const UsersTable = () => { { text: m.controls_delete(), onClick: () => { - openModal(ModalName.DeleteUserDevice, { - id: device.id, - name: device.name, + openModal(ModalName.ConfirmAction, { + title: m.modal_delete_user_device_title(), + contentMd: m.modal_delete_user_device_body({ name: device.name }), + actionPromise: () => api.device.deleteDevice(device.id), + invalidateKeys: [['user-overview'], ['user'], ['network']], + submitProps: { text: m.controls_delete(), variant: 'critical' }, + onSuccess: () => Snackbar.success(m.user_device_delete_success()), + onError: () => Snackbar.error(m.user_device_delete_failed()), }); }, variant: 'danger', diff --git a/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/components/ProfileDevicesTable/ProfileDevicesTable.tsx b/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/components/ProfileDevicesTable/ProfileDevicesTable.tsx index b9e45ec820..acfed82941 100644 --- a/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/components/ProfileDevicesTable/ProfileDevicesTable.tsx +++ b/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/components/ProfileDevicesTable/ProfileDevicesTable.tsx @@ -161,9 +161,14 @@ const DevicesTable = ({ rowData }: { rowData: RowData[] }) => { { text: m.controls_delete(), onClick: () => { - openModal(ModalName.DeleteUserDevice, { - id: row.id, - name: row.name, + openModal(ModalName.ConfirmAction, { + title: m.modal_delete_user_device_title(), + contentMd: m.modal_delete_user_device_body({ name: row.name }), + actionPromise: () => api.device.deleteDevice(row.id), + invalidateKeys: [['user-overview'], ['user', username], ['network']], + submitProps: { text: m.controls_delete(), variant: 'critical' }, + onSuccess: () => Snackbar.success(m.user_device_delete_success()), + onError: () => Snackbar.error(m.user_device_delete_failed()), }); }, variant: 'danger', @@ -291,6 +296,7 @@ const DevicesTable = ({ rowData }: { rowData: RowData[] }) => { }, columns: tableColumns, data: rowData, + getRowId: (row) => String(row.id), getCoreRowModel: getCoreRowModel(), getSortedRowModel: getSortedRowModel(), getExpandedRowModel: getExpandedRowModel(), From cbcb234704759a8786da5757a5e556ec360454d7 Mon Sep 17 00:00:00 2001 From: Kuba <78603704+jakub-tldr@users.noreply.github.com> Date: Thu, 12 Mar 2026 15:18:05 +0100 Subject: [PATCH 3/4] delete old modal artifcats --- .../UsersOverviewPage/UsersOverviewPage.tsx | 2 - .../ProfileDevicesTab/ProfileDevicesTab.tsx | 2 - .../DeleteUserDeviceModal.tsx | 88 ------------------- .../shared/hooks/modalControls/modalTypes.ts | 6 -- web/src/shared/hooks/modalControls/types.ts | 5 -- 5 files changed, 103 deletions(-) delete mode 100644 web/src/shared/components/modals/DeleteUserDeviceModal/DeleteUserDeviceModal.tsx diff --git a/web/src/pages/UsersOverviewPage/UsersOverviewPage.tsx b/web/src/pages/UsersOverviewPage/UsersOverviewPage.tsx index 21e93f3e75..328ad1aade 100644 --- a/web/src/pages/UsersOverviewPage/UsersOverviewPage.tsx +++ b/web/src/pages/UsersOverviewPage/UsersOverviewPage.tsx @@ -5,7 +5,6 @@ import { m } from '../../paraglide/messages'; import { AddAuthKeyModal } from '../../shared/components/modals/AddAuthKeyModal/AddAuthKeyModal'; import { AssignUserDeviceIPModal } from '../../shared/components/modals/AssignUserDeviceIPModal/AssignUserDeviceIPModal'; import { ChangePasswordModal } from '../../shared/components/modals/ChangePasswordModal/ChangePasswordModal'; -import { DeleteUserDeviceModal } from '../../shared/components/modals/DeleteUserDeviceModal/DeleteUserDeviceModal'; import { EditUserDeviceModal } from '../../shared/components/modals/EditUserDeviceModal/EditUserDeviceModal'; import { UserDeviceConfigModal } from '../../shared/components/modals/UserDeviceConfigModal/UserDeviceConfigModal'; import { TableSkeleton } from '../../shared/components/skeleton/TableSkeleton/TableSkeleton'; @@ -32,7 +31,6 @@ export const UsersOverviewPage = () => { - diff --git a/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/ProfileDevicesTab.tsx b/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/ProfileDevicesTab.tsx index cf45623064..34d64c0040 100644 --- a/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/ProfileDevicesTab.tsx +++ b/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/ProfileDevicesTab.tsx @@ -2,7 +2,6 @@ import { LayoutGrid } from '../../../../../shared/components/LayoutGrid/LayoutGr import './style.scss'; import { AddUserDeviceModal } from '../../../../../shared/components/modals/AddUserDeviceModal/AddUserDeviceModal'; import { AssignUserDeviceIPModal } from '../../../../../shared/components/modals/AssignUserDeviceIPModal/AssignUserDeviceIPModal'; -import { DeleteUserDeviceModal } from '../../../../../shared/components/modals/DeleteUserDeviceModal/DeleteUserDeviceModal'; import { EditUserDeviceModal } from '../../../../../shared/components/modals/EditUserDeviceModal/EditUserDeviceModal'; import { UserDeviceConfigModal } from '../../../../../shared/components/modals/UserDeviceConfigModal/UserDeviceConfigModal'; import { ProfileDevicesTable } from './components/ProfileDevicesTable/ProfileDevicesTable'; @@ -17,7 +16,6 @@ export const ProfileDevicesTab = () => { - > ); }; diff --git a/web/src/shared/components/modals/DeleteUserDeviceModal/DeleteUserDeviceModal.tsx b/web/src/shared/components/modals/DeleteUserDeviceModal/DeleteUserDeviceModal.tsx deleted file mode 100644 index 254ae4bcfd..0000000000 --- a/web/src/shared/components/modals/DeleteUserDeviceModal/DeleteUserDeviceModal.tsx +++ /dev/null @@ -1,88 +0,0 @@ -import { useMutation } from '@tanstack/react-query'; -import { useEffect, useState } from 'react'; -import { m } from '../../../../paraglide/messages'; -import api from '../../../api/api'; -import { AppText } from '../../../defguard-ui/components/AppText/AppText'; -import { Button } from '../../../defguard-ui/components/Button/Button'; -import { Modal } from '../../../defguard-ui/components/Modal/Modal'; -import { Snackbar } from '../../../defguard-ui/providers/snackbar/snackbar'; -import { TextStyle } from '../../../defguard-ui/types'; -import { - subscribeCloseModal, - subscribeOpenModal, -} from '../../../hooks/modalControls/modalsSubjects'; -import { ModalName } from '../../../hooks/modalControls/modalTypes'; -import type { OpenDeleteUserDeviceModal } from '../../../hooks/modalControls/types'; -import { Controls } from '../../Controls/Controls'; - -const modalNameValue = ModalName.DeleteUserDevice; - -type ModalData = OpenDeleteUserDeviceModal; - -export const DeleteUserDeviceModal = () => { - const [isOpen, setOpen] = useState(false); - const [modalData, setModalData] = useState(null); - - const { mutateAsync: deleteDevice, isPending } = useMutation({ - mutationFn: api.device.deleteDevice, - meta: { - invalidate: [['user-overview'], ['user'], ['network']], - }, - }); - - useEffect(() => { - const openSub = subscribeOpenModal(modalNameValue, (data) => { - setModalData(data); - setOpen(true); - }); - const closeSub = subscribeCloseModal(modalNameValue, () => setOpen(false)); - return () => { - openSub.unsubscribe(); - closeSub.unsubscribe(); - }; - }, []); - - const handleDelete = async () => { - if (!modalData) return; - try { - await deleteDevice(modalData.id); - Snackbar.success(m.user_device_delete_success()); - setOpen(false); - } catch { - Snackbar.error(m.user_device_delete_failed()); - } - }; - - return ( - setOpen(false)} - afterClose={() => setModalData(null)} - > - - {m.modal_delete_user_device_body({ name: modalData?.name ?? '' })} - - - - setOpen(false)} - disabled={isPending} - /> - - - - - ); -}; diff --git a/web/src/shared/hooks/modalControls/modalTypes.ts b/web/src/shared/hooks/modalControls/modalTypes.ts index 6427dba64a..b52673c342 100644 --- a/web/src/shared/hooks/modalControls/modalTypes.ts +++ b/web/src/shared/hooks/modalControls/modalTypes.ts @@ -18,7 +18,6 @@ import type { OpenDeleteLocationModal, OpenDeleteNetworkDeviceModal, OpenDeleteOpenIdClientModal, - OpenDeleteUserDeviceModal, OpenDisplayListModal, OpenEditDeviceModal, OpenEditNetworkDeviceModal, @@ -65,7 +64,6 @@ export const ModalName = { NetworkDeviceConfig: 'networkDeviceConfig', NetworkDeviceToken: 'networkDeviceToken', DeleteNetworkDevice: 'deleteNetworkDevice', - DeleteUserDevice: 'deleteUserDevice', DeleteOpenIdClient: 'deleteOpenIdClient', AddLocation: 'addLocation', AddLogStreaming: 'addLogStreaming', @@ -203,10 +201,6 @@ const modalOpenArgsSchema = z.discriminatedUnion('name', [ name: z.literal(ModalName.DeleteNetworkDevice), data: z.custom(), }), - z.object({ - name: z.literal(ModalName.DeleteUserDevice), - data: z.custom(), - }), z.object({ name: z.literal(ModalName.DeleteOpenIdClient), data: z.custom(), diff --git a/web/src/shared/hooks/modalControls/types.ts b/web/src/shared/hooks/modalControls/types.ts index 2d2196b79a..beadff12f5 100644 --- a/web/src/shared/hooks/modalControls/types.ts +++ b/web/src/shared/hooks/modalControls/types.ts @@ -180,11 +180,6 @@ export interface OpenDeleteNetworkDeviceModal { name: string; } -export interface OpenDeleteUserDeviceModal { - id: number; - name: string; -} - export interface OpenDeleteOpenIdClientModal { client_id: string; name: string; From 262e31c388e2333b9124b875689d7b43d24505c6 Mon Sep 17 00:00:00 2001 From: Kuba <78603704+jakub-tldr@users.noreply.github.com> Date: Thu, 12 Mar 2026 15:21:33 +0100 Subject: [PATCH 4/4] use default snackbar --- web/src/pages/UsersOverviewPage/UsersTable.tsx | 2 +- .../components/ProfileDevicesTable/ProfileDevicesTable.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/pages/UsersOverviewPage/UsersTable.tsx b/web/src/pages/UsersOverviewPage/UsersTable.tsx index d78cb1e7b1..1e0114c116 100644 --- a/web/src/pages/UsersOverviewPage/UsersTable.tsx +++ b/web/src/pages/UsersOverviewPage/UsersTable.tsx @@ -491,7 +491,7 @@ export const UsersTable = () => { actionPromise: () => api.device.deleteDevice(device.id), invalidateKeys: [['user-overview'], ['user'], ['network']], submitProps: { text: m.controls_delete(), variant: 'critical' }, - onSuccess: () => Snackbar.success(m.user_device_delete_success()), + onSuccess: () => Snackbar.default(m.user_device_delete_success()), onError: () => Snackbar.error(m.user_device_delete_failed()), }); }, diff --git a/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/components/ProfileDevicesTable/ProfileDevicesTable.tsx b/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/components/ProfileDevicesTable/ProfileDevicesTable.tsx index acfed82941..a8047c69e0 100644 --- a/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/components/ProfileDevicesTable/ProfileDevicesTable.tsx +++ b/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/components/ProfileDevicesTable/ProfileDevicesTable.tsx @@ -167,7 +167,7 @@ const DevicesTable = ({ rowData }: { rowData: RowData[] }) => { actionPromise: () => api.device.deleteDevice(row.id), invalidateKeys: [['user-overview'], ['user', username], ['network']], submitProps: { text: m.controls_delete(), variant: 'critical' }, - onSuccess: () => Snackbar.success(m.user_device_delete_success()), + onSuccess: () => Snackbar.default(m.user_device_delete_success()), onError: () => Snackbar.error(m.user_device_delete_failed()), }); },