From d8e95b64e9a0df8aa9ee2b1062d8fcda135c4f01 Mon Sep 17 00:00:00 2001 From: Mariia_Aloshyna Date: Wed, 12 Feb 2025 12:24:33 +0200 Subject: [PATCH 1/6] =?UTF-8?q?UIIN-3191:=20Add=20new=20=E2=80=98Set=20for?= =?UTF-8?q?=20deletion=E2=80=99=20flag=20to=20display=20on=203rd=20pane=20?= =?UTF-8?q?Instance=20view?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + src/Instance/InstanceDetails/InstanceDetails.js | 3 +++ translations/ui-inventory/en.json | 1 + 3 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 897c2cd05..64b990699 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ * Sort holdings by location name and call number. Refs UIIN-3207. * Remove hover-over text next to "Shelving order" on the Item record detail view. Refs UIIN-3210. * CI: Switch to centralized/shared workflow from https://github.com/folio-org/.github. Fixes UIIN-3218. +* Add new ‘Set for deletion’ flag to display on 3rd pane Instance view. Refs UIIN-3191. ## [12.0.12](https://github.com/folio-org/ui-inventory/tree/v12.0.12) (2025-01-27) [Full Changelog](https://github.com/folio-org/ui-inventory/compare/v12.0.11...v12.0.12) diff --git a/src/Instance/InstanceDetails/InstanceDetails.js b/src/Instance/InstanceDetails/InstanceDetails.js index cb800f56f..7e31583a9 100644 --- a/src/Instance/InstanceDetails/InstanceDetails.js +++ b/src/Instance/InstanceDetails/InstanceDetails.js @@ -188,6 +188,9 @@ const InstanceDetails = forwardRef(({ + + + diff --git a/translations/ui-inventory/en.json b/translations/ui-inventory/en.json index e23ec3fe8..cb9ddad7e 100644 --- a/translations/ui-inventory/en.json +++ b/translations/ui-inventory/en.json @@ -819,6 +819,7 @@ "warning.instance.suppressedFromDiscovery": "Warning: Instance is marked suppressed from discovery", "warning.instance.staffSuppressed": "Warning: Instance is marked staff suppressed", "warning.instance.suppressedFromDiscoveryAndStaffSuppressed": "Warning: Instance is marked suppressed from discovery and staff suppressed", + "warning.instance.setForDeletionAndSuppressedFromDiscoveryAndStaffSuppressed": "Warning: Instance is set for deletion, suppressed from discovery, and staff suppressed", "warning.instance.sharingLocalInstance": "Sharing this local instance will take a few moments. A success message and updated details will be displayed upon completion.", "warning.instance.accessSharedInstance": "You do not currently have permission to access details of shared instances. Contact your FOLIO administrator for more information.", "warning.holdingsRecord.suppressedFromDiscovery": "Warning: Holdings is marked suppressed from discovery", From 9cc22494128d571385187c04850e43fbc0864d16 Mon Sep 17 00:00:00 2001 From: Mariia_Aloshyna Date: Wed, 12 Feb 2025 12:24:33 +0200 Subject: [PATCH 2/6] =?UTF-8?q?UIIN-3191:=20Add=20new=20=E2=80=98Set=20for?= =?UTF-8?q?=20deletion=E2=80=99=20flag=20to=20display=20on=203rd=20pane=20?= =?UTF-8?q?Instance=20view?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + .../InstanceDetails/InstanceDetails.js | 33 ++++++++++++++----- .../InstanceDetails/InstanceDetails.test.js | 14 ++++++++ translations/ui-inventory/en.json | 1 + 4 files changed, 40 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 897c2cd05..64b990699 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ * Sort holdings by location name and call number. Refs UIIN-3207. * Remove hover-over text next to "Shelving order" on the Item record detail view. Refs UIIN-3210. * CI: Switch to centralized/shared workflow from https://github.com/folio-org/.github. Fixes UIIN-3218. +* Add new ‘Set for deletion’ flag to display on 3rd pane Instance view. Refs UIIN-3191. ## [12.0.12](https://github.com/folio-org/ui-inventory/tree/v12.0.12) (2025-01-27) [Full Changelog](https://github.com/folio-org/ui-inventory/compare/v12.0.11...v12.0.12) diff --git a/src/Instance/InstanceDetails/InstanceDetails.js b/src/Instance/InstanceDetails/InstanceDetails.js index cb800f56f..a92ed912a 100644 --- a/src/Instance/InstanceDetails/InstanceDetails.js +++ b/src/Instance/InstanceDetails/InstanceDetails.js @@ -155,6 +155,25 @@ const InstanceDetails = forwardRef(({ setIsAllExpanded(isExpanded); }; + const warningBanners = [ + { + condition: !instance.deleted && instance.staffSuppress && !instance.discoverySuppress, + messageId: 'ui-inventory.warning.instance.staffSuppressed', + }, + { + condition: !instance.deleted && instance.discoverySuppress && !instance.staffSuppress, + messageId: 'ui-inventory.warning.instance.suppressedFromDiscovery', + }, + { + condition: !instance.deleted && instance.discoverySuppress && instance.staffSuppress, + messageId: 'ui-inventory.warning.instance.suppressedFromDiscoveryAndStaffSuppressed', + }, + { + condition: instance.deleted && instance.discoverySuppress && instance.staffSuppress, + messageId: 'ui-inventory.warning.instance.setForDeletionAndSuppressedFromDiscoveryAndStaffSuppressed', + }, + ]; + return ( <> - - - - - - - - - + {warningBanners.map(({ condition, messageId }) => ( + + + + ))} diff --git a/src/Instance/InstanceDetails/InstanceDetails.test.js b/src/Instance/InstanceDetails/InstanceDetails.test.js index f6b198366..f2d62e11d 100644 --- a/src/Instance/InstanceDetails/InstanceDetails.test.js +++ b/src/Instance/InstanceDetails/InstanceDetails.test.js @@ -35,6 +35,7 @@ const instance = { notes: [], staffSuppress: false, discoverySuppress: false, + deleted: false, shared: false, }; @@ -143,6 +144,19 @@ describe('InstanceDetails', () => { expect(screen.getByText('Warning: Instance is marked suppressed from discovery and staff suppressed')).toBeInTheDocument(); }); + it('should show a correct Warning message banner when set for deletion, staff and discovery suppressed', () => { + const deletedAndBothSuppressedInstance = { + ...instance, + staffSuppress: true, + discoverySuppress: true, + deleted: true, + }; + renderInstanceDetails({ instance: deletedAndBothSuppressedInstance }); + + const warningBanner = screen.getByText('Warning:', { exact: false }); + + expect(warningBanner.textContent).toEqual('Warning: Instance is set for deletion, suppressed from discovery, and staff suppressed'); + }); it('expands and collapses the accordion sections', () => { renderInstanceDetails(); diff --git a/translations/ui-inventory/en.json b/translations/ui-inventory/en.json index e23ec3fe8..cb9ddad7e 100644 --- a/translations/ui-inventory/en.json +++ b/translations/ui-inventory/en.json @@ -819,6 +819,7 @@ "warning.instance.suppressedFromDiscovery": "Warning: Instance is marked suppressed from discovery", "warning.instance.staffSuppressed": "Warning: Instance is marked staff suppressed", "warning.instance.suppressedFromDiscoveryAndStaffSuppressed": "Warning: Instance is marked suppressed from discovery and staff suppressed", + "warning.instance.setForDeletionAndSuppressedFromDiscoveryAndStaffSuppressed": "Warning: Instance is set for deletion, suppressed from discovery, and staff suppressed", "warning.instance.sharingLocalInstance": "Sharing this local instance will take a few moments. A success message and updated details will be displayed upon completion.", "warning.instance.accessSharedInstance": "You do not currently have permission to access details of shared instances. Contact your FOLIO administrator for more information.", "warning.holdingsRecord.suppressedFromDiscovery": "Warning: Holdings is marked suppressed from discovery", From 0514cf1d74a1273b81f9c3dbdbd76d3141662712 Mon Sep 17 00:00:00 2001 From: Mariia_Aloshyna Date: Wed, 12 Feb 2025 13:16:32 +0200 Subject: [PATCH 3/6] =?UTF-8?q?UIIN-3191:=20Add=20new=20=E2=80=98Set=20for?= =?UTF-8?q?=20deletion=E2=80=99=20flag=20to=20display=20on=203rd=20pane=20?= =?UTF-8?q?Instance=20view?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InstanceAdministrativeView.js | 12 +++++++++--- translations/ui-inventory/en.json | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Instance/InstanceDetails/InstanceAdministrativeView/InstanceAdministrativeView.js b/src/Instance/InstanceDetails/InstanceAdministrativeView/InstanceAdministrativeView.js index 3a884ec83..c761e0b10 100644 --- a/src/Instance/InstanceDetails/InstanceAdministrativeView/InstanceAdministrativeView.js +++ b/src/Instance/InstanceDetails/InstanceAdministrativeView/InstanceAdministrativeView.js @@ -91,15 +91,21 @@ const InstanceAdministrativeView = ({ > {instance.metadata && } + { + instance.deleted && + + + + } { instance.discoverySuppress && - + } { instance.staffSuppress && - + } @@ -111,7 +117,7 @@ const InstanceAdministrativeView = ({ } - {(instance.discoverySuppress || instance.staffSuppress || instance.previouslyHeld) &&
} + {(instance.deleted || instance.discoverySuppress || instance.staffSuppress || instance.previouslyHeld) &&
} diff --git a/translations/ui-inventory/en.json b/translations/ui-inventory/en.json index cb9ddad7e..24014515f 100644 --- a/translations/ui-inventory/en.json +++ b/translations/ui-inventory/en.json @@ -824,6 +824,7 @@ "warning.instance.accessSharedInstance": "You do not currently have permission to access details of shared instances. Contact your FOLIO administrator for more information.", "warning.holdingsRecord.suppressedFromDiscovery": "Warning: Holdings is marked suppressed from discovery", "warning.item.suppressedFromDiscovery": "Warning: Item is marked suppressed from discovery", + "setForDeletion": "Set for deletion", "discoverySuppressed": "Suppressed from discovery", "staffSuppressed": "Staff suppressed", "hridCopied": "The instance HRID {hrid} was successfully copied to the clipboard", From b55f079cd184d1888aa070100fdcf412d6b0b77b Mon Sep 17 00:00:00 2001 From: Mariia_Aloshyna Date: Wed, 12 Feb 2025 13:22:07 +0200 Subject: [PATCH 4/6] Add unit tests --- src/Instance/InstanceDetails/InstanceDetails.test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Instance/InstanceDetails/InstanceDetails.test.js b/src/Instance/InstanceDetails/InstanceDetails.test.js index 72c92a7f7..7b4b8dbac 100644 --- a/src/Instance/InstanceDetails/InstanceDetails.test.js +++ b/src/Instance/InstanceDetails/InstanceDetails.test.js @@ -161,6 +161,7 @@ describe('InstanceDetails', () => { const warningBanner = screen.getByText('Warning:', { exact: false }); expect(warningBanner.textContent).toEqual('Warning: Instance is set for deletion, suppressed from discovery, and staff suppressed'); + expect(screen.getByText('Set for deletion')).toBeInTheDocument(); }); it('expands and collapses the accordion sections', () => { From ca74e9fefb609c0c8d8541de7c9acf517fffdd4a Mon Sep 17 00:00:00 2001 From: Mariia_Aloshyna Date: Wed, 12 Feb 2025 14:02:03 +0200 Subject: [PATCH 5/6] Adjust styles --- .../InstanceDetails/InstanceDetails.js | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/Instance/InstanceDetails/InstanceDetails.js b/src/Instance/InstanceDetails/InstanceDetails.js index 0ac543092..183d34342 100644 --- a/src/Instance/InstanceDetails/InstanceDetails.js +++ b/src/Instance/InstanceDetails/InstanceDetails.js @@ -26,7 +26,7 @@ import { Row, MessageBanner, PaneCloseLink, - Paneset, + Layout, } from '@folio/stripes/components'; import { VersionHistoryButton } from '@folio/stripes-acq-components'; @@ -206,16 +206,18 @@ const InstanceDetails = forwardRef(({ - - {warningBanners.map(({ condition, messageId }) => ( - - - - ))} - - - - + + + {warningBanners.map(({ condition, messageId }) => ( + + + + ))} + + + + + Date: Fri, 14 Feb 2025 14:26:16 +0200 Subject: [PATCH 6/6] UIIN-3191: Add marginTop0 class to MessageBanner component --- src/Instance/InstanceDetails/InstanceDetails.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Instance/InstanceDetails/InstanceDetails.js b/src/Instance/InstanceDetails/InstanceDetails.js index 183d34342..9926d5871 100644 --- a/src/Instance/InstanceDetails/InstanceDetails.js +++ b/src/Instance/InstanceDetails/InstanceDetails.js @@ -209,7 +209,7 @@ const InstanceDetails = forwardRef(({ {warningBanners.map(({ condition, messageId }) => ( - + ))}