Skip to content

Commit

Permalink
Merge branch 'master' into UIREQMED-27
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-blazhko committed Jul 8, 2024
2 parents 84a26bb + 66980c6 commit 262dcae
Show file tree
Hide file tree
Showing 36 changed files with 403 additions and 104 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Add caret to `react` peer dependency. Refs UIREQMED-23.
* Add Search field for Mediated requests activity page. Refs UIREQMED-3.
* Add Filters for Mediated requests actions page. Refs UIREQMED-4.
* Update permission for Mediated requests. Refs UIREQMED-29.
* Implement `Create mediated request` form with basic functionality. Refs UIREQMED-27.

## 1.0.0
Expand Down
21 changes: 15 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,26 +96,35 @@
"visible": true
},
{
"permissionName": "ui-requests-mediated.view-create",
"displayName": "Mediated requests: View, create",
"permissionName": "ui-requests-mediated.view-create-edit",
"displayName": "Mediated requests: View, create, edit",
"subPermissions": [
"ui-requests-mediated.view"
],
"visible": true
},
{
"permissionName": "ui-requests-mediated.view-edit-cancel",
"displayName": "Mediated requests: View, edit, cancel",
"permissionName": "ui-requests-mediated.view-decline",
"displayName": "Mediated requests: View, decline",
"subPermissions": [
"ui-requests-mediated.view-create"
"ui-requests-mediated.view"
],
"visible": true
},
{
"permissionName": "ui-requests-mediated.view-edit-decline",
"displayName": "Mediated requests: View, edit, decline",
"subPermissions": [
"ui-requests-mediated.view-decline"
],
"visible": true
},
{
"permissionName": "ui-requests-mediated.all",
"displayName": "Mediated requests: All permissions",
"subPermissions": [
"ui-requests-mediated.view-edit-cancel"
"ui-requests-mediated.view-create-edit",
"ui-requests-mediated.view-decline"
],
"visible": true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,33 +88,6 @@ class RequestForm extends React.Component {
}

componentDidMount() {
const { location } = this.props;
const {
userId,
userBarcode,
itemBarcode,
itemId,
instanceId,
} = parse(location?.search);

if (userBarcode) {
this.findUser(RESOURCE_KEYS.BARCODE, userBarcode);
} else if (userId) {
this.findUser(RESOURCE_KEYS.ID, userId);
}

if (itemBarcode) {
this.findItem(RESOURCE_KEYS.BARCODE, itemBarcode);
}

if (itemId) {
this.findItem(RESOURCE_KEYS.ID, itemId);
}

if (instanceId && !itemBarcode && !itemId) {
this.findInstance(instanceId);
}

this.setTlrCheckboxInitialState();
}

Expand All @@ -124,29 +97,13 @@ class RequestForm extends React.Component {
request,
onSetSelectedItem,
onSetSelectedUser,
location,
settings,

Check failure on line 100 in src/components/MediatedRequestsActivities/components/RequestForm/RequestForm.js

View workflow job for this annotation

GitHub Actions / build-npm

'settings' is missing in props validation

Check failure on line 100 in src/components/MediatedRequestsActivities/components/RequestForm/RequestForm.js

View workflow job for this annotation

GitHub Actions / build-npm

'settings' is missing in props validation
} = this.props;
const {
initialValues: prevInitialValues,
request: prevRequest,
location: prevLocation,
settings: prevSettings,

Check failure on line 105 in src/components/MediatedRequestsActivities/components/RequestForm/RequestForm.js

View workflow job for this annotation

GitHub Actions / build-npm

'settings' is missing in props validation

Check failure on line 105 in src/components/MediatedRequestsActivities/components/RequestForm/RequestForm.js

View workflow job for this annotation

GitHub Actions / build-npm

'settings' is missing in props validation
} = prevProps;
const {
userId,
userBarcode,
itemBarcode,
itemId,
instanceId,
} = parse(location?.search);
const {
userId: prevUserId,
userBarcode: prevUserBarcode,
itemBarcode: prevItemBarcode,
itemId: prevItemId,
instanceId: prevInstanceId,
} = parse(prevLocation?.search);
const newSettings = settings?.items[0]?.value;

Check failure on line 107 in src/components/MediatedRequestsActivities/components/RequestForm/RequestForm.js

View workflow job for this annotation

GitHub Actions / build-npm

'settings.items' is missing in props validation

Check failure on line 107 in src/components/MediatedRequestsActivities/components/RequestForm/RequestForm.js

View workflow job for this annotation

GitHub Actions / build-npm

'settings.items[].value' is missing in props validation

Check failure on line 107 in src/components/MediatedRequestsActivities/components/RequestForm/RequestForm.js

View workflow job for this annotation

GitHub Actions / build-npm

'settings.items' is missing in props validation

Check failure on line 107 in src/components/MediatedRequestsActivities/components/RequestForm/RequestForm.js

View workflow job for this annotation

GitHub Actions / build-npm

'settings.items[].value' is missing in props validation

if (
Expand All @@ -160,27 +117,6 @@ class RequestForm extends React.Component {
this.setState({ selectedLoan: request.loan });
}

if (prevUserBarcode !== userBarcode) {
this.findUser(RESOURCE_KEYS.BARCODE, userBarcode);
}

if (prevUserId !== userId) {
this.findUser(RESOURCE_KEYS.ID, userId);
}

if (prevItemBarcode !== itemBarcode) {
this.findItem(RESOURCE_KEYS.BARCODE, itemBarcode);
}

if (prevItemId !== itemId) {
this.findItem(RESOURCE_KEYS.ID, itemId);
}

if (prevInstanceId !== instanceId) {
this.findInstance(instanceId);
this.setTlrCheckboxInitialState();
}

if (prevSettings?.items[0]?.value !== newSettings) {
const { titleLevelRequestsFeatureEnabled } = getTlrSettings(newSettings);

Expand Down
13 changes: 12 additions & 1 deletion translations/ui-requests-mediated/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,16 @@
"app.sendItemInTransit.navigation": "Send item in transit",
"app.confirmItemArrival.paneTitle": "Confirm item arrival",
"app.mediatedRequestsActivities.paneTitle": "Mediated requests",
"app.sendItemInTransit.paneTitle": "Send item in transit"
"app.sendItemInTransit.paneTitle": "Send item in transit",
"filters.mediatedRequestStatus.accordionTitle": "Mediated request status",
"filters.mediatedRequestStatus.closedDeclined": "Closed - Declined",
"filters.mediatedRequestStatus.closedFilled": "Closed - Filled",
"filters.mediatedRequestStatus.newAwaitingConfirmation": "New - Awaiting confirmation",
"filters.mediatedRequestStatus.openAwaitingPickup": "Open - Awaiting pickup",
"filters.mediatedRequestStatus.openInProgress": "Open - In progress",
"filters.mediatedRequestStatus.openInTransit": "Open - In transits",
"filters.mediatedRequestStatus.openItemArrived": "Open - Item arrived",
"filters.mediatedRequestLevel.accordionTitle": "Mediated request level",
"filters.mediatedRequestLevel.item": "Item",
"filters.mediatedRequestLevel.title": "Title"
}
13 changes: 12 additions & 1 deletion translations/ui-requests-mediated/ber.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,16 @@
"app.sendItemInTransit.navigation": "Send item in transit",
"app.confirmItemArrival.paneTitle": "Confirm item arrival",
"app.mediatedRequestsActivities.paneTitle": "Mediated requests",
"app.sendItemInTransit.paneTitle": "Send item in transit"
"app.sendItemInTransit.paneTitle": "Send item in transit",
"filters.mediatedRequestStatus.accordionTitle": "Mediated request status",
"filters.mediatedRequestStatus.closedDeclined": "Closed - Declined",
"filters.mediatedRequestStatus.closedFilled": "Closed - Filled",
"filters.mediatedRequestStatus.newAwaitingConfirmation": "New - Awaiting confirmation",
"filters.mediatedRequestStatus.openAwaitingPickup": "Open - Awaiting pickup",
"filters.mediatedRequestStatus.openInProgress": "Open - In progress",
"filters.mediatedRequestStatus.openInTransit": "Open - In transits",
"filters.mediatedRequestStatus.openItemArrived": "Open - Item arrived",
"filters.mediatedRequestLevel.accordionTitle": "Mediated request level",
"filters.mediatedRequestLevel.item": "Item",
"filters.mediatedRequestLevel.title": "Title"
}
13 changes: 12 additions & 1 deletion translations/ui-requests-mediated/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,16 @@
"app.sendItemInTransit.navigation": "Send item in transit",
"app.confirmItemArrival.paneTitle": "Confirm item arrival",
"app.mediatedRequestsActivities.paneTitle": "Mediated requests",
"app.sendItemInTransit.paneTitle": "Send item in transit"
"app.sendItemInTransit.paneTitle": "Send item in transit",
"filters.mediatedRequestStatus.accordionTitle": "Mediated request status",
"filters.mediatedRequestStatus.closedDeclined": "Closed - Declined",
"filters.mediatedRequestStatus.closedFilled": "Closed - Filled",
"filters.mediatedRequestStatus.newAwaitingConfirmation": "New - Awaiting confirmation",
"filters.mediatedRequestStatus.openAwaitingPickup": "Open - Awaiting pickup",
"filters.mediatedRequestStatus.openInProgress": "Open - In progress",
"filters.mediatedRequestStatus.openInTransit": "Open - In transits",
"filters.mediatedRequestStatus.openItemArrived": "Open - Item arrived",
"filters.mediatedRequestLevel.accordionTitle": "Mediated request level",
"filters.mediatedRequestLevel.item": "Item",
"filters.mediatedRequestLevel.title": "Title"
}
13 changes: 12 additions & 1 deletion translations/ui-requests-mediated/cs_CZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,16 @@
"app.sendItemInTransit.navigation": "Odeslat jednotku v přepravě",
"app.confirmItemArrival.paneTitle": "Potvrdit příchod jednotky",
"app.mediatedRequestsActivities.paneTitle": "Zprostředkované žádanky",
"app.sendItemInTransit.paneTitle": "Odeslat jednotku v přepravě"
"app.sendItemInTransit.paneTitle": "Odeslat jednotku v přepravě",
"filters.mediatedRequestStatus.accordionTitle": "Mediated request status",
"filters.mediatedRequestStatus.closedDeclined": "Closed - Declined",
"filters.mediatedRequestStatus.closedFilled": "Uzavřená - Vyřízená",
"filters.mediatedRequestStatus.newAwaitingConfirmation": "New - Awaiting confirmation",
"filters.mediatedRequestStatus.openAwaitingPickup": "Open - Awaiting pickup",
"filters.mediatedRequestStatus.openInProgress": "Open - In progress",
"filters.mediatedRequestStatus.openInTransit": "Open - In transits",
"filters.mediatedRequestStatus.openItemArrived": "Open - Item arrived",
"filters.mediatedRequestLevel.accordionTitle": "Mediated request level",
"filters.mediatedRequestLevel.item": "Jednotka",
"filters.mediatedRequestLevel.title": "Název"
}
13 changes: 12 additions & 1 deletion translations/ui-requests-mediated/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,16 @@
"app.sendItemInTransit.navigation": "Send item in transit",
"app.confirmItemArrival.paneTitle": "Confirm item arrival",
"app.mediatedRequestsActivities.paneTitle": "Mediated requests",
"app.sendItemInTransit.paneTitle": "Send item in transit"
"app.sendItemInTransit.paneTitle": "Send item in transit",
"filters.mediatedRequestStatus.accordionTitle": "Mediated request status",
"filters.mediatedRequestStatus.closedDeclined": "Closed - Declined",
"filters.mediatedRequestStatus.closedFilled": "Closed - Filled",
"filters.mediatedRequestStatus.newAwaitingConfirmation": "New - Awaiting confirmation",
"filters.mediatedRequestStatus.openAwaitingPickup": "Open - Awaiting pickup",
"filters.mediatedRequestStatus.openInProgress": "Open - In progress",
"filters.mediatedRequestStatus.openInTransit": "Open - In transits",
"filters.mediatedRequestStatus.openItemArrived": "Open - Item arrived",
"filters.mediatedRequestLevel.accordionTitle": "Mediated request level",
"filters.mediatedRequestLevel.item": "Item",
"filters.mediatedRequestLevel.title": "Title"
}
13 changes: 12 additions & 1 deletion translations/ui-requests-mediated/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,16 @@
"app.sendItemInTransit.navigation": "Send item in transit",
"app.confirmItemArrival.paneTitle": "Confirm item arrival",
"app.mediatedRequestsActivities.paneTitle": "Mediated requests",
"app.sendItemInTransit.paneTitle": "Send item in transit"
"app.sendItemInTransit.paneTitle": "Send item in transit",
"filters.mediatedRequestStatus.accordionTitle": "Mediated request status",
"filters.mediatedRequestStatus.closedDeclined": "Closed - Declined",
"filters.mediatedRequestStatus.closedFilled": "Closed - Filled",
"filters.mediatedRequestStatus.newAwaitingConfirmation": "New - Awaiting confirmation",
"filters.mediatedRequestStatus.openAwaitingPickup": "Open - Awaiting pickup",
"filters.mediatedRequestStatus.openInProgress": "Open - In progress",
"filters.mediatedRequestStatus.openInTransit": "Open - In transits",
"filters.mediatedRequestStatus.openItemArrived": "Open - Item arrived",
"filters.mediatedRequestLevel.accordionTitle": "Mediated request level",
"filters.mediatedRequestLevel.item": "Item",
"filters.mediatedRequestLevel.title": "Title"
}
5 changes: 3 additions & 2 deletions translations/ui-requests-mediated/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"meta.title": "Mediated requests",

"permission.view": "Mediated requests: View",
"permission.view-create": "Mediated requests: View, create",
"permission.view-create-edit": "Mediated requests: View, edit, cancel",
"permission.view-create-edit": "Mediated requests: View, create, edit",
"permission.view-decline": "Mediated requests: View, decline",
"permission.view-edit-decline": "Mediated requests: View, edit, decline",
"permission.all": "Mediated requests: All permissions",

"app.filterPane.selectActivity": "Select activity",
Expand Down
13 changes: 12 additions & 1 deletion translations/ui-requests-mediated/en_GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,16 @@
"app.sendItemInTransit.navigation": "Send item in transit",
"app.confirmItemArrival.paneTitle": "Confirm item arrival",
"app.mediatedRequestsActivities.paneTitle": "Mediated requests",
"app.sendItemInTransit.paneTitle": "Send item in transit"
"app.sendItemInTransit.paneTitle": "Send item in transit",
"filters.mediatedRequestStatus.accordionTitle": "Mediated request status",
"filters.mediatedRequestStatus.closedDeclined": "Closed - Declined",
"filters.mediatedRequestStatus.closedFilled": "Closed - Filled",
"filters.mediatedRequestStatus.newAwaitingConfirmation": "New - Awaiting confirmation",
"filters.mediatedRequestStatus.openAwaitingPickup": "Open - Awaiting pickup",
"filters.mediatedRequestStatus.openInProgress": "Open - In progress",
"filters.mediatedRequestStatus.openInTransit": "Open - In transits",
"filters.mediatedRequestStatus.openItemArrived": "Open - Item arrived",
"filters.mediatedRequestLevel.accordionTitle": "Mediated request level",
"filters.mediatedRequestLevel.item": "Item",
"filters.mediatedRequestLevel.title": "Title"
}
13 changes: 12 additions & 1 deletion translations/ui-requests-mediated/en_SE.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,16 @@
"app.sendItemInTransit.navigation": "Send item in transit",
"app.confirmItemArrival.paneTitle": "Confirm item arrival",
"app.mediatedRequestsActivities.paneTitle": "Mediated requests",
"app.sendItemInTransit.paneTitle": "Send item in transit"
"app.sendItemInTransit.paneTitle": "Send item in transit",
"filters.mediatedRequestStatus.accordionTitle": "Mediated request status",
"filters.mediatedRequestStatus.closedDeclined": "Closed - Declined",
"filters.mediatedRequestStatus.closedFilled": "Closed - Filled",
"filters.mediatedRequestStatus.newAwaitingConfirmation": "New - Awaiting confirmation",
"filters.mediatedRequestStatus.openAwaitingPickup": "Open - Awaiting pickup",
"filters.mediatedRequestStatus.openInProgress": "Open - In progress",
"filters.mediatedRequestStatus.openInTransit": "Open - In transits",
"filters.mediatedRequestStatus.openItemArrived": "Open - Item arrived",
"filters.mediatedRequestLevel.accordionTitle": "Mediated request level",
"filters.mediatedRequestLevel.item": "Item",
"filters.mediatedRequestLevel.title": "Title"
}
13 changes: 12 additions & 1 deletion translations/ui-requests-mediated/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,16 @@
"app.sendItemInTransit.navigation": "Send item in transit",
"app.confirmItemArrival.paneTitle": "Confirm item arrival",
"app.mediatedRequestsActivities.paneTitle": "Mediated requests",
"app.sendItemInTransit.paneTitle": "Send item in transit"
"app.sendItemInTransit.paneTitle": "Send item in transit",
"filters.mediatedRequestStatus.accordionTitle": "Mediated request status",
"filters.mediatedRequestStatus.closedDeclined": "Closed - Declined",
"filters.mediatedRequestStatus.closedFilled": "Closed - Filled",
"filters.mediatedRequestStatus.newAwaitingConfirmation": "New - Awaiting confirmation",
"filters.mediatedRequestStatus.openAwaitingPickup": "Open - Awaiting pickup",
"filters.mediatedRequestStatus.openInProgress": "Open - In progress",
"filters.mediatedRequestStatus.openInTransit": "Open - In transits",
"filters.mediatedRequestStatus.openItemArrived": "Open - Item arrived",
"filters.mediatedRequestLevel.accordionTitle": "Mediated request level",
"filters.mediatedRequestLevel.item": "Item",
"filters.mediatedRequestLevel.title": "Title"
}
13 changes: 12 additions & 1 deletion translations/ui-requests-mediated/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,16 @@
"app.sendItemInTransit.navigation": "Send item in transit",
"app.confirmItemArrival.paneTitle": "Confirm item arrival",
"app.mediatedRequestsActivities.paneTitle": "Mediated requests",
"app.sendItemInTransit.paneTitle": "Send item in transit"
"app.sendItemInTransit.paneTitle": "Send item in transit",
"filters.mediatedRequestStatus.accordionTitle": "Mediated request status",
"filters.mediatedRequestStatus.closedDeclined": "Closed - Declined",
"filters.mediatedRequestStatus.closedFilled": "Closed - Filled",
"filters.mediatedRequestStatus.newAwaitingConfirmation": "New - Awaiting confirmation",
"filters.mediatedRequestStatus.openAwaitingPickup": "Open - Awaiting pickup",
"filters.mediatedRequestStatus.openInProgress": "Open - In progress",
"filters.mediatedRequestStatus.openInTransit": "Open - In transits",
"filters.mediatedRequestStatus.openItemArrived": "Open - Item arrived",
"filters.mediatedRequestLevel.accordionTitle": "Mediated request level",
"filters.mediatedRequestLevel.item": "Item",
"filters.mediatedRequestLevel.title": "Title"
}
13 changes: 12 additions & 1 deletion translations/ui-requests-mediated/es_419.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,16 @@
"app.sendItemInTransit.navigation": "Enviar item a transito",
"app.confirmItemArrival.paneTitle": "Confirm item arrival",
"app.mediatedRequestsActivities.paneTitle": "Mediated requests",
"app.sendItemInTransit.paneTitle": "Enviar item a transito\n"
"app.sendItemInTransit.paneTitle": "Enviar item a transito\n",
"filters.mediatedRequestStatus.accordionTitle": "Mediated request status",
"filters.mediatedRequestStatus.closedDeclined": "Closed - Declined",
"filters.mediatedRequestStatus.closedFilled": "Closed - Filled",
"filters.mediatedRequestStatus.newAwaitingConfirmation": "New - Awaiting confirmation",
"filters.mediatedRequestStatus.openAwaitingPickup": "Open - Awaiting pickup",
"filters.mediatedRequestStatus.openInProgress": "Open - In progress",
"filters.mediatedRequestStatus.openInTransit": "Open - In transits",
"filters.mediatedRequestStatus.openItemArrived": "Open - Item arrived",
"filters.mediatedRequestLevel.accordionTitle": "Mediated request level",
"filters.mediatedRequestLevel.item": "Item",
"filters.mediatedRequestLevel.title": "Title"
}
13 changes: 12 additions & 1 deletion translations/ui-requests-mediated/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,16 @@
"app.sendItemInTransit.navigation": "Send item in transit",
"app.confirmItemArrival.paneTitle": "Confirm item arrival",
"app.mediatedRequestsActivities.paneTitle": "Mediated requests",
"app.sendItemInTransit.paneTitle": "Send item in transit"
"app.sendItemInTransit.paneTitle": "Send item in transit",
"filters.mediatedRequestStatus.accordionTitle": "Mediated request status",
"filters.mediatedRequestStatus.closedDeclined": "Closed - Declined",
"filters.mediatedRequestStatus.closedFilled": "Closed - Filled",
"filters.mediatedRequestStatus.newAwaitingConfirmation": "New - Awaiting confirmation",
"filters.mediatedRequestStatus.openAwaitingPickup": "Open - Awaiting pickup",
"filters.mediatedRequestStatus.openInProgress": "Open - In progress",
"filters.mediatedRequestStatus.openInTransit": "Open - In transits",
"filters.mediatedRequestStatus.openItemArrived": "Open - Item arrived",
"filters.mediatedRequestLevel.accordionTitle": "Mediated request level",
"filters.mediatedRequestLevel.item": "Item",
"filters.mediatedRequestLevel.title": "Title"
}
Loading

0 comments on commit 262dcae

Please sign in to comment.