Skip to content

Commit

Permalink
Merge pull request #1077 from folio-org/release_8.2.1
Browse files Browse the repository at this point in the history
Release 8.2.1
  • Loading branch information
EthanFreestone authored Jul 29, 2022
2 parents 7c8efd0 + e3be3ad commit 912590d
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 20 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/routes/AgreementEditRoute/AgreementEditRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const AgreementEditRoute = ({
{ path: 'id' }
],
},
nsArray: ['ERM', 'Agreement', agreementId, 'AgreementLines', AGREEMENT_LINES_ENDPOINT, 'AgreementEditRoute'],
path: AGREEMENT_LINES_ENDPOINT
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
11 changes: 6 additions & 5 deletions src/routes/AgreementLineEditRoute/AgreementLineEditRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: <FormattedMessage id="ui-agreements.line.update.callout" /> });
history.push(`${urls.agreementLineView(agreementId, id)}${location.search}`);
Expand Down
14 changes: 8 additions & 6 deletions src/routes/AgreementLineViewRoute/AgreementLineViewRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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: <FormattedMessage id="ui-agreements.line.delete.callout" /> });
}).catch(error => {
Expand Down
2 changes: 1 addition & 1 deletion src/routes/AgreementViewRoute/AgreementViewRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions translations/ui-agreements/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
49 changes: 48 additions & 1 deletion translations/ui-agreements/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "<strong>title updated:</strong> {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: <strong>{label}</strong>. {error}",
"settings.pickListValues.deletePickListValue": "Delete pick list value",
"settings.pickListValues.deletePickListValueError": "There was an error deleting pick list value: <strong>{label}</strong>. {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: <strong>{label}</strong>. {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": "<strong>Title updated: {sourceTitleName} </strong>",
"job.created.success.org.olf.general.jobs.destination": "<strong>Title updated: {destinationTitleName} </strong>",
"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"
}

0 comments on commit 912590d

Please sign in to comment.