diff --git a/CHANGELOG.md b/CHANGELOG.md index 7aeaf7f5b..64106eac5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Change history for ui-agreements +## 8.2.1 2022-07-29 +* ERM-2300 On loading entitlements for Agreement edit screen incorrect parameters are supplied +* ERM-2299 Error on trying to save an agreement with a linked license +* ERM-2297 Number of tags doesn't update on adding tags to agreement or agreement line +* ERM-2284 Attempt to delete Agreement Line fails +* ERM-2282 Toast message fails to display to user +* ERM-2280 Incorrect labels in move identifiers UI + ## 8.2.0 2022-07-04 * ERM-2229 On creating Agreement, agreement creation view does not close after save * ERM-2225 Amendment/License link status values do not update immediately after Agreement edit diff --git a/package.json b/package.json index 6b2da60d4..db0dd78f8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@folio/agreements", - "version": "8.2.0", + "version": "8.2.1", "description": "ERM agreement functionality for Stripes", "main": "src/index.js", "publishConfig": { @@ -80,8 +80,8 @@ }, "dependencies": { "@folio/stripes-acq-components": "^3.1.0", - "@folio/stripes-erm-components": "^6.2.0", - "@k-int/stripes-kint-components": "^2.6.5", + "@folio/stripes-erm-components": "^6.2.1", + "@k-int/stripes-kint-components": "^2.8.2", "@rehooks/local-storage": "2.4.4", "@testing-library/react-hooks": "^8.0.0", "compose-function": "^3.0.3", diff --git a/src/routes/AgreementEditRoute/AgreementEditRoute.js b/src/routes/AgreementEditRoute/AgreementEditRoute.js index d4c5d0793..3d16e850b 100644 --- a/src/routes/AgreementEditRoute/AgreementEditRoute.js +++ b/src/routes/AgreementEditRoute/AgreementEditRoute.js @@ -101,6 +101,7 @@ const AgreementEditRoute = ({ { path: 'id' } ], }, + nsArray: ['ERM', 'Agreement', agreementId, 'AgreementLines', AGREEMENT_LINES_ENDPOINT, 'AgreementEditRoute'], path: AGREEMENT_LINES_ENDPOINT }); diff --git a/src/routes/AgreementLineCreateRoute/AgreementLineCreateRoute.js b/src/routes/AgreementLineCreateRoute/AgreementLineCreateRoute.js index 915d5db4c..9927f8613 100644 --- a/src/routes/AgreementLineCreateRoute/AgreementLineCreateRoute.js +++ b/src/routes/AgreementLineCreateRoute/AgreementLineCreateRoute.js @@ -33,7 +33,7 @@ const AgreementLineCreateRoute = ({ }; const { mutateAsync: postAgreementLine } = useMutation( - [AGREEMENT_LINES_ENDPOINT, 'ui-agreements', 'AgreementLineCreateRoute', 'createAgreementLine'], + ['ERM', 'Agreement', agreementId, 'AgreementLines', 'POST', AGREEMENT_LINES_ENDPOINT], (payload) => ky.post(AGREEMENT_LINES_ENDPOINT, { json: { ...payload, owner: agreementId } }).json() .then(({ id }) => { /* Invalidate cached queries */ diff --git a/src/routes/AgreementLineEditRoute/AgreementLineEditRoute.js b/src/routes/AgreementLineEditRoute/AgreementLineEditRoute.js index 5e516fc52..ed2faca9c 100644 --- a/src/routes/AgreementLineEditRoute/AgreementLineEditRoute.js +++ b/src/routes/AgreementLineEditRoute/AgreementLineEditRoute.js @@ -27,21 +27,22 @@ const AgreementLineEditRoute = ({ const queryClient = useQueryClient(); const isSuppressFromDiscoveryEnabled = useSuppressFromDiscovery(); + const agreementLinePath = AGREEMENT_LINE_ENDPOINT(lineId); + const { data: agreementLine = {}, isLoading: isLineLoading } = useQuery( - [AGREEMENT_LINE_ENDPOINT(lineId), 'getLine'], - () => ky.get(AGREEMENT_LINE_ENDPOINT(lineId)).json() + ['ERM', 'AgreementLine', lineId, agreementLinePath], + () => ky.get(agreementLinePath).json() ); const poLineIdsArray = (agreementLine.poLines ?? []).map(poLine => poLine.poLineId).flat(); const { orderLines, isLoading: areOrderLinesLoading } = useChunkedOrderLines(poLineIdsArray); const { mutateAsync: putAgreementLine } = useMutation( - [AGREEMENT_LINE_ENDPOINT(lineId), 'ui-agreements', 'AgreementLineEditRoute', 'editAgreementLine'], - (payload) => ky.put(AGREEMENT_LINE_ENDPOINT(lineId), { json: payload }).json() + ['ERM', 'AgreementLine', lineId, 'PUT', agreementLinePath], + (payload) => ky.put(agreementLinePath, { json: payload }).json() .then(({ id }) => { /* Invalidate cached queries */ queryClient.invalidateQueries(['ERM', 'Agreement', agreementId]); - queryClient.invalidateQueries(AGREEMENT_LINE_ENDPOINT(lineId)); callout.sendCallout({ message: }); history.push(`${urls.agreementLineView(agreementId, id)}${location.search}`); diff --git a/src/routes/AgreementLineViewRoute/AgreementLineViewRoute.js b/src/routes/AgreementLineViewRoute/AgreementLineViewRoute.js index 8398f51a6..9e1fe56a6 100644 --- a/src/routes/AgreementLineViewRoute/AgreementLineViewRoute.js +++ b/src/routes/AgreementLineViewRoute/AgreementLineViewRoute.js @@ -10,7 +10,7 @@ import View from '../../components/views/AgreementLine'; import { urls } from '../../components/utilities'; import { useAgreementsHelperApp, useChunkedOrderLines, useSuppressFromDiscovery } from '../../hooks'; -import { AGREEMENT_LINES_ENDPOINT, AGREEMENT_LINE_ENDPOINT } from '../../constants/endpoints'; +import { AGREEMENT_ENDPOINT, AGREEMENT_LINE_ENDPOINT } from '../../constants/endpoints'; const AgreementLineViewRoute = ({ handlers, @@ -25,19 +25,21 @@ const AgreementLineViewRoute = ({ const ky = useOkapiKy(); const agreementLinePath = AGREEMENT_LINE_ENDPOINT(lineId); + const agreementPath = AGREEMENT_ENDPOINT(agreementId); const { data: agreementLine = {}, isLoading: isLineQueryLoading } = useQuery( - [AGREEMENT_LINE_ENDPOINT(lineId), 'getLine'], + ['ERM', 'AgreementLine', lineId, agreementLinePath], () => ky.get(agreementLinePath).json() ); const { mutateAsync: deleteAgreementLine } = useMutation( - [agreementLinePath, 'ui-agreements', 'AgreementLineViewRoute', 'deleteAgreementLine'], - () => ky.put(agreementLinePath, { + // As opposed to ['ERM', 'AgreementLine', lineId, 'DELETE', agreementLinePath] if we did this via a DELETE call to entitlements endpoint + ['ERM', 'AgreementLine', lineId, 'DELETE', agreementPath], + () => ky.put(agreementPath, { json: { id: agreementId, items: [{ id: lineId, _delete: true }] - }).then(() => { - queryClient.invalidateQueries(AGREEMENT_LINES_ENDPOINT); + } }).then(() => { + queryClient.invalidateQueries('ERM', 'Agreement', agreementId); // Invalidate relevant Agreement history.push(`${urls.agreementView(agreementId)}${location.search}`); callout.sendCallout({ message: }); }).catch(error => { diff --git a/src/routes/AgreementViewRoute/AgreementViewRoute.js b/src/routes/AgreementViewRoute/AgreementViewRoute.js index 3fdd02277..9207f4289 100644 --- a/src/routes/AgreementViewRoute/AgreementViewRoute.js +++ b/src/routes/AgreementViewRoute/AgreementViewRoute.js @@ -101,7 +101,7 @@ const AgreementViewRoute = ({ results: agreementLines = [], total: agreementLineCount = 0 } = useInfiniteFetch( - [AGREEMENT_LINES_ENDPOINT, agreementLineQueryParams, 'ui-agreements', 'AgreementViewRoute', 'getLines'], + ['ERM', 'Agreement', agreementId, 'AgreementLines', AGREEMENT_LINES_ENDPOINT, agreementLineQueryParams], ({ pageParam = 0 }) => { const params = [...agreementLineQueryParams, `offset=${pageParam}`]; return ky.get(`${AGREEMENT_LINES_ENDPOINT}?${params?.join('&')}`).json(); diff --git a/translations/ui-agreements/en.json b/translations/ui-agreements/en.json index 687e4700f..563d17592 100644 --- a/translations/ui-agreements/en.json +++ b/translations/ui-agreements/en.json @@ -166,10 +166,10 @@ "identifiers.identifiersToMove": "Identifiers(s) to be moved", "identifiers.identifierDestination": "Identifier destination", "moveIdentifiers.noPlugin": "No \"find-eresource\" plugin is installed", - "updatetitlesAndMoveMore": "Update title & move more identifiers", + "updatetitlesAndMoveMore": "Update titles & move more identifiers", "updateMoreIdentifierWarning": "An IdentifierReassignmentJob ({name}) has been created, and identifiers as displayed on this screen are liable to change. If you attempt to move an identifier in a subsequent IdentifierReassignmentJob that was already moved away in an earlier one, the second move will not occur. You can track the status of this job in the local-kb-admin app.", - "updatetitlesAndClose": "Update title & close", - "preview.updateAndContinue" : "Select \"Update titles & more identifiers\" or \"Update titles & close\" to continue", + "updatetitlesAndClose": "Update titles & close", + "preview.updateAndContinue" : "Select \"Update titles & move more identifiers\" or \"Update titles & close\" to continue", "warn.clearReasonForClosure": "This reason will be cleared as status is not closed", "basketButton": "View {count, number} {count, plural, one {item} other {items}}", "basket.name": "ERM basket", diff --git a/translations/ui-agreements/en_US.json b/translations/ui-agreements/en_US.json index 5aa28776f..bf760b7bd 100644 --- a/translations/ui-agreements/en_US.json +++ b/translations/ui-agreements/en_US.json @@ -590,5 +590,52 @@ "supplementaryProperties.filterBuilder": "Supplementary property filter builder", "supplementaryProperties.filterIndex": "Supplementary property filter {index}", "supplementaryProperties.removeFilter": "Remove supplementary property filter {index}", - "supplementaryProperties.deprecated": "DEPRECATED: {name}" + "supplementaryProperties.deprecated": "DEPRECATED: {name}", + "new": "New", + "preview": "Preview", + "back": "Back", + "titleUpdated-callout": "title updated: {eresourceName}", + "eresource.moveIdentifier": "Move identifier(s)", + "eresource.moveIdentifier.noSourceTitle": "No source title selected", + "eresource.moveIdentifier.noDestinationTitle": "No destination title selected", + "eresource.sourceTitle": "Source title", + "eresource.destinationTitle": "Destination title", + "eresource.sourceTitleSelectionText": "Select the source title for the identifier(s)", + "eresource.destinationTitleSelectionText": "Select the destination title for the identifier(s)", + "eresource.moveIdentifier.selectTitle": "Select title", + "eresource.moveIdetifiers.title": "Title", + "moveIdentifiers.selectTitle": "Select title", + "moveIdentifiers.replaceTitle": "Replace Title", + "moveIdentifiers.replaceTitleSpecific": "Replace eresource {eresourceName}", + "identifier.type": "{label} ", + "identifiers.identifiersToMove": "Identifiers(s) to be moved", + "identifiers.identifierDestination": "Identifier destination", + "moveIdentifiers.noPlugin": "No \"find-eresource\" plugin is installed", + "updatetitlesAndMoveMore": "Update titles & move more identifiers", + "updateMoreIdentifierWarning": "An IdentifierReassignmentJob ({name}) has been created, and identifiers as displayed on this screen are liable to change. If you attempt to move an identifier in a subsequent IdentifierReassignmentJob that was already moved away in an earlier one, the second move will not occur. You can track the status of this job in the local-kb-admin app.", + "updatetitlesAndClose": "Update titles & close", + "preview.updateAndContinue" : "Select \"Update titles & move more identifiers\" or \"Update titles & close\" to continue", + "settings.noOfValues": "# of values", + "settings.pickList.deletePickList": "Delete pick list", + "settings.pickList.deletePickListError": "There was an error deleting pick list: {label}. {error}", + "settings.pickListValues.deletePickListValue": "Delete pick list value", + "settings.pickListValues.deletePickListValueError": "There was an error deleting pick list value: {label}. {error}", + "settings.supplementaryProperties.category": "Category", + "settings.supplementaryProperties.pickList": "Pick list", + "settings.supplementaryProperties.multiPickList": "Pick list (multi-select)", + "settings.supplementaryProperties.deleteError": "There was an error deleting supplementary property: {label}. {error}", + "supplementaryProperty.help.category": "Supplementary properties can be categorised. Each category will appear as a separate accordion when viewing or editing the agreement.", + "supplementaryProperty.editModal": "Edit supplementary property", + "supplementaryProperty.newModal": "New supplementary property", + "job.created.success.org.olf.general.jobs.IdentifierReassignmentJob": "Title updated: {sourceTitleName} ", + "job.created.success.org.olf.general.jobs.destination": "Title updated: {destinationTitleName} ", + "eresources.filters.titleFilters": "Title filters", + "eresources.filters.packageFilters": "Package filters", + "eresources.scope": "Scope", + "packageIdentifiers.isil": "ISIL", + "packageIdentifiers.zdb": "ZDB", + "packageIdentifiers.ezb": "EZB", + "packageIdentifiers.eBookPool": "E-Book Pool", + "packageIdentifiers.gokbId": "GOKb ID", + "packageIdentifiers.gokbUUID": "GOKb UUID" } \ No newline at end of file