Skip to content

Commit 7274a08

Browse files
UIREQMED-2: Add pages: Confirm item arrival, Mediated requests actions and Send item in transit
1 parent ee3f8ba commit 7274a08

File tree

22 files changed

+456
-89
lines changed

22 files changed

+456
-89
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Change history for ui-requests-mediated
22

33
## 1.1.0 (IN PROGRESS)
4-
4+
* Add landing page actions: Confirm item arrival, Mediated requests actions and Send item in transit. Refs UIREQMED-2.
55

66
## 1.0.0
77

README.md

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@ Copyright (C) 2023 The Open Library Foundation
44

55
This software is distributed under the terms of the Apache License, Version 2.0. See the file "[LICENSE](LICENSE)" for more information.
66

7-
## Introduction
8-
9-
Congratulations on creating a new Stripes UI app module! Follow the instructions below to run ui-requests-mediated and start your development.
10-
11-
TODO: Modify this README to replace these sections about getting started.
12-
13-
## Prerequisites
14-
15-
In order to view and log into the platform being served up, a suitable Okapi backend will need to be running. The [testing-backend](https://app.vagrantup.com/folio/boxes/testing-backend) Vagrant box should work if your app does not yet have its own backend module.
16-
177
## Run your new app
188

199
Run the following from the ui-requests-mediated directory to serve your new app using a development server:
@@ -35,18 +25,19 @@ stripes serve --okapi http://my-okapi.example.com:9130 --tenant my-tenant-id
3525

3626
Run the included UI tests with the following command:
3727
```
38-
stripes test karma
28+
yarn run test:jest"
3929
```
4030

41-
## What to do next?
42-
43-
Now that your new app is running, search the code for "`new-app`" to find comments and subbed placeholders that may need your attention.
31+
## Introduction
4432

45-
Please remove or customize the sample strings in `en.json` (lines 3-10) before merging this file to master; the translators do not need to be providing translations for these sample strings.
33+
This is a [Stripes](https://github.com/folio-org/stripes-core/) UI module
34+
for making requests on items.
4635

47-
Read the [Stripes Module Developer's Guide](https://github.com/folio-org/stripes/blob/master/doc/dev-guide.md).
36+
## Additional information
4837

49-
When your new UI app is ready and being built by CI, then adjust its Jenkinsfile to remove the `npmDeploy = 'no'` parameter (which is then superfluous).
38+
Other [modules](https://dev.folio.org/source-code/#client-side).
5039

51-
TODO: Modify this README to replace these sections about getting started, link to your issue tracker, etc.
40+
See project [UIREQMED](https://issues.folio.org/browse/UIREQMED)
41+
at the [FOLIO issue tracker](https://dev.folio.org/guidelines/issue-tracker).
5242

43+
Other FOLIO Developer documentation is at [dev.folio.org](https://dev.folio.org/)

package.json

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
"regenerator-runtime": "^0.13.3"
4343
},
4444
"dependencies": {
45-
"prop-types": "^15.6.0"
45+
"prop-types": "^15.6.0",
46+
"react-router-prop-types": "^1.0.4"
4647
},
4748
"peerDependencies": {
4849
"@folio/stripes": "^9.0.0",
@@ -79,6 +80,39 @@
7980
"settings.enabled"
8081
],
8182
"visible": true
83+
},
84+
{
85+
"permissionName": "ui-requests-mediated.view",
86+
"displayName": "Mediated requests: View",
87+
"subPermissions": [
88+
"module.requests-mediated.enabled",
89+
"settings.requests-mediated.enabled"
90+
],
91+
"visible": true
92+
},
93+
{
94+
"permissionName": "ui-requests-mediated.view-create",
95+
"displayName": "Mediated requests: View, create",
96+
"subPermissions": [
97+
"ui-requests-mediated.view"
98+
],
99+
"visible": true
100+
},
101+
{
102+
"permissionName": "ui-requests-mediated.view-create-edit",
103+
"displayName": "Mediated requests: View, create, edit",
104+
"subPermissions": [
105+
"ui-requests-mediated.view-create"
106+
],
107+
"visible": true
108+
},
109+
{
110+
"permissionName": "ui-requests-mediated.all",
111+
"displayName": "Mediated requests: All permissions",
112+
"subPermissions": [
113+
"ui-requests-mediated.view-create-edit"
114+
],
115+
"visible": true
82116
}
83117
]
84118
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import React from 'react';
2+
import ReactRouterPropTypes from 'react-router-prop-types';
3+
import { FormattedMessage } from 'react-intl';
4+
5+
import {
6+
Pane,
7+
Paneset,
8+
} from '@folio/stripes/components';
9+
10+
import NavigationMenu from '../NavigationMenu';
11+
12+
import {
13+
FILTER_PANE_WIDTH,
14+
getConfirmItemArrivalUrl,
15+
} from '../../constants';
16+
17+
export default class ConfirmItemArrival extends React.Component {
18+
static propTypes = {
19+
history: ReactRouterPropTypes.history.isRequired,
20+
location: ReactRouterPropTypes.location.isRequired,
21+
};
22+
23+
render() {
24+
const {
25+
history,
26+
location,
27+
} = this.props;
28+
29+
return (
30+
<Paneset data-testid="confirmItemArrivalPaneSet">
31+
<Pane
32+
data-testid="confirmItemArrivalPane"
33+
defaultWidth={FILTER_PANE_WIDTH}
34+
paneTitle={<FormattedMessage id="ui-requests-mediated.app.filterPane.selectActivity" />}
35+
>
36+
<NavigationMenu
37+
history={history}
38+
location={location}
39+
value={getConfirmItemArrivalUrl()}
40+
/>
41+
</Pane>
42+
<Pane
43+
defaultWidth="fill"
44+
paneTitle={<FormattedMessage id="ui-requests-mediated.app.confirmItemArrival.paneTitle" />}
45+
/>
46+
</Paneset>
47+
);
48+
}
49+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import {
2+
render,
3+
screen,
4+
cleanup,
5+
} from '@folio/jest-config-stripes/testing-library/react';
6+
7+
import ConfirmItemArrival from './ConfirmItemArrival';
8+
9+
const testIds = {
10+
confirmItemArrivalPaneSet: 'confirmItemArrivalPaneSet',
11+
confirmItemArrivalPane: 'confirmItemArrivalPane',
12+
};
13+
const labelIds = {
14+
paneTitle: 'ui-requests-mediated.app.confirmItemArrival.paneTitle',
15+
};
16+
17+
describe('ConfirmItemArrival', () => {
18+
beforeEach(() => {
19+
render(<ConfirmItemArrival />);
20+
});
21+
22+
afterEach(cleanup);
23+
24+
it('should render pane set', () => {
25+
expect(screen.getByTestId(testIds.confirmItemArrivalPaneSet)).toBeInTheDocument();
26+
});
27+
28+
it('should render pane', () => {
29+
expect(screen.getByTestId(testIds.confirmItemArrivalPane)).toBeInTheDocument();
30+
});
31+
32+
it('should render pane title', () => {
33+
expect(screen.getByText(labelIds.paneTitle)).toBeVisible();
34+
});
35+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from './ConfirmItemArrival';
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import React from 'react';
2+
import ReactRouterPropTypes from 'react-router-prop-types';
3+
import { FormattedMessage } from 'react-intl';
4+
5+
import {
6+
AppIcon,
7+
} from '@folio/stripes/core';
8+
9+
import {
10+
Pane,
11+
Paneset,
12+
} from '@folio/stripes/components';
13+
14+
import NavigationMenu from '../NavigationMenu';
15+
16+
import {
17+
APP_ICON_NAME,
18+
FILTER_PANE_WIDTH,
19+
getMediatedRequestsActionsUrl,
20+
} from '../../constants';
21+
22+
export default class MediatedRequestsActions extends React.Component {
23+
static propTypes = {
24+
history: ReactRouterPropTypes.history.isRequired,
25+
location: ReactRouterPropTypes.location.isRequired,
26+
};
27+
28+
render() {
29+
const {
30+
history,
31+
location,
32+
} = this.props;
33+
34+
return (
35+
<Paneset data-testid="mediatedRequestsActionsPaneSet">
36+
<Pane
37+
data-testid="mediatedRequestsActionPane"
38+
defaultWidth={FILTER_PANE_WIDTH}
39+
paneTitle={<FormattedMessage id="ui-requests-mediated.app.filterPane.selectActivity" />}
40+
>
41+
<NavigationMenu
42+
history={history}
43+
location={location}
44+
value={getMediatedRequestsActionsUrl()}
45+
/>
46+
</Pane>
47+
<Pane
48+
defaultWidth="fill"
49+
appIcon={<AppIcon app={APP_ICON_NAME} />}
50+
paneTitle={<FormattedMessage id="ui-requests-mediated.app.mediatedRequestsActions.paneTitle" />}
51+
/>
52+
</Paneset>
53+
);
54+
}
55+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import {
2+
render,
3+
screen,
4+
cleanup,
5+
} from '@folio/jest-config-stripes/testing-library/react';
6+
7+
import MediatedRequestsActions from './MediatedRequestsActions';
8+
9+
const testIds = {
10+
mediatedRequestsActionsPaneSet: 'mediatedRequestsActionsPaneSet',
11+
mediatedRequestsActionPane: 'mediatedRequestsActionPane',
12+
};
13+
const labelIds = {
14+
paneTitle: 'ui-requests-mediated.app.mediatedRequestsActions.paneTitle',
15+
};
16+
17+
describe('MediatedRequests', () => {
18+
beforeEach(() => {
19+
render(<MediatedRequestsActions />);
20+
});
21+
22+
afterEach(cleanup);
23+
24+
it('should render pane set', () => {
25+
expect(screen.getByTestId(testIds.mediatedRequestsActionsPaneSet)).toBeInTheDocument();
26+
});
27+
28+
it('should render pane', () => {
29+
expect(screen.getByTestId(testIds.mediatedRequestsActionPane)).toBeInTheDocument();
30+
});
31+
32+
it('should render pane title', () => {
33+
expect(screen.getByText(labelIds.paneTitle)).toBeVisible();
34+
});
35+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from './MediatedRequestsActions';
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.separator {
2+
border-bottom: 1px solid var(--color-border-p2);
3+
margin-bottom: 1rem;
4+
}

0 commit comments

Comments
 (0)