Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIQM-580: Move QuickMarcView, PrintPopup, useAuthorityLinkingRules and getHeaders to stripes-marc-components. #613

Merged
merged 4 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* [UIQM-571](https://issues.folio.org/browse/UIQM-571) Added `marc-records-editor.item.put` to Derive and Create Bib permissions to fix issue with broken links after deriving or creating a record.
* [UIQM-543](https://issues.folio.org/browse/UIQM-543) Remove eslint deps that are already listed in eslint-config-stripes.
* [UIQM-580](https://issues.folio.org/browse/UIQM-580) Move QuickMarcView, PrintPopup and getHeaders to stripes-marc-components.

## [7.0.1](https://github.com/folio-org/ui-quick-marc/tree/v7.0.1) (2023-10-13)

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@folio/quick-marc",
"version": "7.0.1",
"version": "7.1.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please bump up major version and add a Breaking change note in changelog

"description": "Quick MARC editor",
"main": "index.js",
"repository": "",
Expand Down Expand Up @@ -155,6 +155,7 @@
"@folio/stripes": "^9.0.0",
"@folio/stripes-cli": "^3.0.0",
"@folio/stripes-core": "^10.0.0",
"@folio/stripes-marc-components": "^1.0.0",
"@folio/stripes-testing": "^4.2.0",
"@formatjs/cli": "^6.1.3",
"core-js": "^3.6.1",
Expand All @@ -181,11 +182,11 @@
"react-final-form-listeners": "^1.0.2",
"react-query": "^3.39.2",
"react-router-prop-types": "^1.0.4",
"react-to-print": "^2.14.11",
"uuid": "^8.3.2"
},
"peerDependencies": {
"@folio/stripes": "^9.0.0",
"@folio/stripes-marc-components": "^1.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-intl": "^6.4.4",
Expand Down
6 changes: 5 additions & 1 deletion src/QuickMarcEditor/QuickMarcEditor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ jest.mock('react-router', () => ({

jest.mock('../queries', () => ({
...jest.requireActual('../queries'),
useAuthorityLinkingRules: jest.fn().mockReturnValue({ linkingRules: [] }),
useLinkSuggestions: jest.fn().mockReturnValue({ isLoading: false, fetchLinkSuggestions: jest.fn() }),
}));

jest.mock('@folio/stripes-marc-components', () => ({
...jest.requireActual('@folio/stripes-marc-components'),
useAuthorityLinkingRules: jest.fn().mockReturnValue({ linkingRules: [] }),
}));

jest.mock('@folio/stripes-acq-components', () => ({
...jest.requireActual('@folio/stripes-acq-components'),
useShowCallout: jest.fn(),
Expand Down
8 changes: 6 additions & 2 deletions src/QuickMarcEditor/QuickMarcEditorContainer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,16 @@ jest.mock('react-router', () => ({
withRouter: Component => props => <Component match={match} location={location} history={mockHistory} {...props} />,
}));

jest.mock('../queries', () => ({
...jest.requireActual('../queries'),
jest.mock('@folio/stripes-marc-components', () => ({
...jest.requireActual('@folio/stripes-marc-components'),
useAuthorityLinkingRules: jest.fn().mockReturnValue({
linkingRules: [],
isLoading: false,
}),
}));

jest.mock('../queries', () => ({
...jest.requireActual('../queries'),
useAuthoritySourceFiles: jest.fn().mockReturnValue({
sourceFiles: [],
isLoading: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,16 @@ jest.mock('../../hooks', () => ({
}),
}));

jest.mock('../../queries', () => ({
...jest.requireActual('../../queries'),
jest.mock('@folio/stripes-marc-components', () => ({
...jest.requireActual('@folio/stripes-marc-components'),
useAuthorityLinkingRules: jest.fn().mockReturnValue({
linkingRules: [],
isLoading: false,
}),
}));

jest.mock('../../queries', () => ({
...jest.requireActual('../../queries'),
useAuthoritySourceFiles: jest.fn().mockResolvedValue({
sourceFiles: [],
isLoading: false,
Expand Down
26 changes: 0 additions & 26 deletions src/QuickMarcEditor/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1529,32 +1529,6 @@ export const hydrateForLinkSuggestions = (marcRecord, fields) => ({
_actionType: 'view',
});

export const getHeaders = (tenant, token, locale, method = 'GET') => {
// This is taken from stripes-connect/OkapiResource.js
const headers = {
POST: {
Accept: 'application/json',
},
DELETE: {
Accept: 'text/plain',
},
GET: {
Accept: 'application/json',
},
PUT: {
Accept: 'text/plain',
},
};

return {
...headers[method],
'Accept-Language': locale,
'Content-Type': 'application/json',
'X-Okapi-Tenant': tenant,
...(token && { 'X-Okapi-Token': token }),
};
};

export const changeTenantHeader = (ky, tenantId) => {
return ky.extend({
hooks: {
Expand Down
14 changes: 0 additions & 14 deletions src/QuickMarcView/MarcContent/MarcContent.css

This file was deleted.

69 changes: 0 additions & 69 deletions src/QuickMarcView/MarcContent/MarcContent.js

This file was deleted.

67 changes: 0 additions & 67 deletions src/QuickMarcView/MarcContent/MarcContent.test.js

This file was deleted.

1 change: 0 additions & 1 deletion src/QuickMarcView/MarcContent/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions src/QuickMarcView/MarcField.css

This file was deleted.

Loading