From 76fa6270efd071b9d5e619cdaf341dd59816277c Mon Sep 17 00:00:00 2001 From: Yury Saukou Date: Thu, 19 Dec 2024 17:28:59 +0400 Subject: [PATCH] Move reusable claiming code from ui-receiving to the shared library (#841) * Move reusable claiming code from ui-receiving to the shared library * move send and delay claims modals to shared lib * add gutter for modal message * ignore empty records for all selected display * fix broken test * add unit tests * add tests * move GH related files to .github folder * update useRecordsSelect hook to add more functionality * reset forms on cancel * sonar warnings --- .github/CODEOWNERS | 1 + .../PULL_REQUEST_TEMPLATE.md | 13 ++ CHANGELOG.md | 1 + .../useRecordsSelect/useRecordsSelect.js | 56 +++++++- lib/FindRecords/index.js | 1 + .../FieldClaimingDate/FieldClaimingDate.js | 42 ++++++ .../FieldClaimingDate.test.js | 38 +++++ .../components/FieldClaimingDate/index.js | 1 + .../components/FieldClaimingDate/utils.js | 19 +++ lib/claiming/components/index.js | 2 + .../DelayClaimActionMenuItem.js | 30 ++++ .../DelayClaimActionMenuItem.test.js | 48 +++++++ .../DelayClaimActionMenuItem/index.js | 1 + .../MarkUnreceivableActionMenuItem.js | 30 ++++ .../MarkUnreceivableActionMenuItem.test.js | 53 +++++++ .../MarkUnreceivableActionMenuItem/index.js | 1 + .../SendClaimActionMenuItem.js | 30 ++++ .../SendClaimActionMenuItem.test.js | 48 +++++++ .../SendClaimActionMenuItem/index.js | 1 + lib/claiming/components/menu-items/index.js | 3 + .../DelayClaimsModal/DelayClaimsModal.js | 108 ++++++++++++++ .../DelayClaimsModal/DelayClaimsModal.test.js | 65 +++++++++ .../modals/DelayClaimsModal/index.js | 1 + .../modals/SendClaimsModal/SendClaimsModal.js | 133 ++++++++++++++++++ .../SendClaimsModal/SendClaimsModal.test.js | 86 +++++++++++ .../modals/SendClaimsModal/index.js | 1 + lib/claiming/components/modals/index.js | 2 + lib/claiming/hooks/index.js | 2 + lib/claiming/hooks/useClaimsDelay/index.js | 1 + .../hooks/useClaimsDelay/useClaimsDelay.js | 26 ++++ .../useClaimsDelay/useClaimsDelay.test.js | 40 ++++++ lib/claiming/hooks/useClaimsSend/index.js | 1 + .../hooks/useClaimsSend/useClaimsSend.js | 24 ++++ .../hooks/useClaimsSend/useClaimsSend.test.js | 59 ++++++++ lib/claiming/index.js | 3 + .../utils/getClaimingIntervalFromDate.js | 7 + .../utils/getClaimingIntervalFromDate.test.js | 12 ++ lib/claiming/utils/index.js | 1 + lib/constants/api.js | 2 + lib/hooks/index.js | 1 + lib/hooks/usePiecesStatusBatchUpdate/index.js | 1 + .../usePiecesStatusBatchUpdate.js | 24 ++++ .../usePiecesStatusBatchUpdate.test.js | 44 ++++++ lib/index.js | 1 + translations/stripes-acq-components/en.json | 11 ++ 45 files changed, 1069 insertions(+), 6 deletions(-) create mode 100644 .github/CODEOWNERS rename PULL_REQUEST_TEMPLATE.md => .github/PULL_REQUEST_TEMPLATE.md (89%) create mode 100644 lib/claiming/components/FieldClaimingDate/FieldClaimingDate.js create mode 100644 lib/claiming/components/FieldClaimingDate/FieldClaimingDate.test.js create mode 100644 lib/claiming/components/FieldClaimingDate/index.js create mode 100644 lib/claiming/components/FieldClaimingDate/utils.js create mode 100644 lib/claiming/components/index.js create mode 100644 lib/claiming/components/menu-items/DelayClaimActionMenuItem/DelayClaimActionMenuItem.js create mode 100644 lib/claiming/components/menu-items/DelayClaimActionMenuItem/DelayClaimActionMenuItem.test.js create mode 100644 lib/claiming/components/menu-items/DelayClaimActionMenuItem/index.js create mode 100644 lib/claiming/components/menu-items/MarkUnreceivableActionMenuItem/MarkUnreceivableActionMenuItem.js create mode 100644 lib/claiming/components/menu-items/MarkUnreceivableActionMenuItem/MarkUnreceivableActionMenuItem.test.js create mode 100644 lib/claiming/components/menu-items/MarkUnreceivableActionMenuItem/index.js create mode 100644 lib/claiming/components/menu-items/SendClaimActionMenuItem/SendClaimActionMenuItem.js create mode 100644 lib/claiming/components/menu-items/SendClaimActionMenuItem/SendClaimActionMenuItem.test.js create mode 100644 lib/claiming/components/menu-items/SendClaimActionMenuItem/index.js create mode 100644 lib/claiming/components/menu-items/index.js create mode 100644 lib/claiming/components/modals/DelayClaimsModal/DelayClaimsModal.js create mode 100644 lib/claiming/components/modals/DelayClaimsModal/DelayClaimsModal.test.js create mode 100644 lib/claiming/components/modals/DelayClaimsModal/index.js create mode 100644 lib/claiming/components/modals/SendClaimsModal/SendClaimsModal.js create mode 100644 lib/claiming/components/modals/SendClaimsModal/SendClaimsModal.test.js create mode 100644 lib/claiming/components/modals/SendClaimsModal/index.js create mode 100644 lib/claiming/components/modals/index.js create mode 100644 lib/claiming/hooks/index.js create mode 100644 lib/claiming/hooks/useClaimsDelay/index.js create mode 100644 lib/claiming/hooks/useClaimsDelay/useClaimsDelay.js create mode 100644 lib/claiming/hooks/useClaimsDelay/useClaimsDelay.test.js create mode 100644 lib/claiming/hooks/useClaimsSend/index.js create mode 100644 lib/claiming/hooks/useClaimsSend/useClaimsSend.js create mode 100644 lib/claiming/hooks/useClaimsSend/useClaimsSend.test.js create mode 100644 lib/claiming/index.js create mode 100644 lib/claiming/utils/getClaimingIntervalFromDate.js create mode 100644 lib/claiming/utils/getClaimingIntervalFromDate.test.js create mode 100644 lib/claiming/utils/index.js create mode 100644 lib/hooks/usePiecesStatusBatchUpdate/index.js create mode 100644 lib/hooks/usePiecesStatusBatchUpdate/usePiecesStatusBatchUpdate.js create mode 100644 lib/hooks/usePiecesStatusBatchUpdate/usePiecesStatusBatchUpdate.test.js diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..e029a897 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @folio-org/acquisitions-ui diff --git a/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md similarity index 89% rename from PULL_REQUEST_TEMPLATE.md rename to .github/PULL_REQUEST_TEMPLATE.md index 03c9a5d8..5ccfea1e 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -35,6 +35,19 @@ [ ] Use GitHub checklists. When solved, check the box and explain the answer. --> +## Screenshots + +