From 7a83da7f3949444dab9f628c0103e5ddf6a20842 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 30 May 2026 21:25:30 +1000 Subject: [PATCH] [UI] Part lock notification (#12040) * [UI] Part lock notification - Add a notification when part lock status is updated * update playwright Ref: https://github.com/microsoft/playwright/issues/40998 --- src/frontend/src/pages/part/PartDetail.tsx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/pages/part/PartDetail.tsx b/src/frontend/src/pages/part/PartDetail.tsx index 79c6765ac3..c53588a4a1 100644 --- a/src/frontend/src/pages/part/PartDetail.tsx +++ b/src/frontend/src/pages/part/PartDetail.tsx @@ -11,6 +11,7 @@ import { Stack, Text } from '@mantine/core'; +import { notifications } from '@mantine/notifications'; import { IconBookmarks, IconBuilding, @@ -1165,11 +1166,25 @@ export default function PartDetail() { variant='transparent' disabled={!user.hasChangeRole(UserRoles.part)} onClick={() => { + const locking = !part.locked; api .patch(apiUrl(ApiEndpoints.part_list, part.pk), { - locked: !part.locked + locked: locking }) - .then(refreshInstance); + .then(() => { + notifications.hide('part-lock'); + notifications.show({ + id: 'part-lock', + message: locking ? t`Part locked` : t`Part unlocked`, + color: 'green', + icon: locking ? ( + + ) : ( + + ) + }); + refreshInstance(); + }); }} > {part?.locked ? : }