From a877258a425d961e9f48134f5cc0bccbfb0b0279 Mon Sep 17 00:00:00 2001 From: Denys Bohdan Date: Wed, 10 Jan 2024 12:03:30 +0100 Subject: [PATCH 01/26] STSMACOM-796 Show successful toast notifications for Create and Edit actions in `` (#1426) * STSMACOM-796 Show successful toast notifications for Create and Edit actions in `` * STSMACOM-796 Fix failing ControlledVocabErrors tests --- CHANGELOG.md | 1 + lib/ControlledVocab/ControlledVocab.js | 85 ++++++++---- .../tests/ControlledVocab-test.js | 40 +++++- .../tests/ControlledVocabErrors-test.js | 22 +++- lib/ControlledVocab/tests/mountComponent.js | 124 +++++++++++------- tests/network/config.js | 19 --- translations/stripes-smart-components/en.json | 2 + 7 files changed, 198 insertions(+), 95 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d45609310..48e137247 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * `` now passes the `entityType` when making PUT requests to `/custom-fields`. Refs FCFIELDS-44. * Added `tenant` prop to ``. Refs STSMACOM-794. * Use the default match and search option in Advanced search when they are not entered. Refs STSMACOM-793. +* Show successful toast notifications for Create and Edit actions in ``. Refs STSMACOM-796. ## [9.0.0](https://github.com/folio-org/stripes-smart-components/tree/v9.0.0) (2023-10-11) [Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v8.0.0...v9.0.0) diff --git a/lib/ControlledVocab/ControlledVocab.js b/lib/ControlledVocab/ControlledVocab.js index 9369e3776..7662b058e 100644 --- a/lib/ControlledVocab/ControlledVocab.js +++ b/lib/ControlledVocab/ControlledVocab.js @@ -21,6 +21,12 @@ import EditableList from '../EditableList'; import css from './ControlledVocab.css'; import makeRefdataActuatorsBoundTo from './actuators-refdata'; +const ACTIONS = { + CREATE: 'termCreated', + EDIT: 'termUpdated', + DELETE: 'termDeleted', +}; + const getTenantFromRESTResource = (queryParams, pathComponents, resourceValues, logger, props) => { const { tenant, @@ -114,9 +120,6 @@ class ControlledVocab extends React.Component { GET: PropTypes.func, reset: PropTypes.func, }), - tenant: PropTypes.shape({ - replace: PropTypes.func, - }), values: PropTypes.shape({ DELETE: PropTypes.func, GET: PropTypes.func, @@ -159,7 +162,9 @@ class ControlledVocab extends React.Component { cannotDeleteTermHeader: "Cannot delete patron group", cannotDeleteTermMessage: "This patron group cannot be deleted, as it is in use by one or more records.", deleteEntry: "Delete patron group", + termCreated: "The patron group {term} was successfully created", termDeleted: "The patron group {term} was successfully deleted", + termUpdated: "The patron group {term} was successfully updated", termWillBeDeleted: "The patron group {term} will be deleted." } */ @@ -169,6 +174,8 @@ class ControlledVocab extends React.Component { cannotDeleteTermMessage: PropTypes.string, deleteEntry: PropTypes.string, termDeleted: PropTypes.string, + termCreated: PropTypes.string, + termUpdated: PropTypes.string, termWillBeDeleted: PropTypes.string, }), /* @@ -211,7 +218,8 @@ class ControlledVocab extends React.Component { // !{limitParam:-limit} // in the manifest above. actuatorType: 'rest', - canCreate: true + canCreate: true, + translations: {}, }; constructor(props) { @@ -274,7 +282,10 @@ class ControlledVocab extends React.Component { } onCreateItem(item) { - return this.props.mutator.values.POST(this.props.preCreateHook(item)); + return this.props.mutator.values.POST(this.props.preCreateHook(item)) + .then(() => { + this.showSuccessCallout(item, ACTIONS.CREATE); + }); } onDeleteItem() { @@ -284,7 +295,7 @@ class ControlledVocab extends React.Component { return this.props.mutator.values.DELETE({ id: selectedItem.id }) .then(() => { - this.showDeletionSuccessCallout(selectedItem); + this.showSuccessCallout(selectedItem, ACTIONS.DELETE); this.deleteItemResolve(); }) .catch(() => { @@ -296,7 +307,10 @@ class ControlledVocab extends React.Component { onUpdateItem(item) { this.props.mutator.activeRecord.update({ id: item.id }); - return this.props.mutator.values.PUT(this.props.preUpdateHook(item)); + return this.props.mutator.values.PUT(this.props.preUpdateHook(item)) + .then(() => { + this.showSuccessCallout(item, ACTIONS.EDIT); + }); } filteredRows(rows) { @@ -343,28 +357,43 @@ class ControlledVocab extends React.Component { }); } - showDeletionSuccessCallout(item) { - if (this.callout) { - const { termDeleted } = this.props.translations || {}; - const message = ( - termDeleted ? - : - - ); - - this.callout.sendCallout({ message }); + showSuccessCallout(item, action) { + if (!this.callout) { + return; } + + const { + termCreated, + termDeleted, + termUpdated, + } = this.props.translations; + + const translationByAction = { + [ACTIONS.CREATE]: termCreated, + [ACTIONS.DELETE]: termDeleted, + [ACTIONS.EDIT]: termUpdated, + }; + + const translation = translationByAction[action]; + + const message = ( + translation ? + : + + ); + + this.callout.sendCallout({ message }); } handlePaneFocus({ paneTitleRef }) { diff --git a/lib/ControlledVocab/tests/ControlledVocab-test.js b/lib/ControlledVocab/tests/ControlledVocab-test.js index 9b3c5a734..5027a9368 100644 --- a/lib/ControlledVocab/tests/ControlledVocab-test.js +++ b/lib/ControlledVocab/tests/ControlledVocab-test.js @@ -15,6 +15,7 @@ import { including, MultiColumnList, MultiColumnListCell, + Callout, } from '@folio/stripes-testing'; import mountComponent from './mountComponent'; @@ -59,7 +60,9 @@ describe('ControlledVocab', () => { it('should display Delete button', () => cm.find(Button('Delete')).exists()); describe('click delete on confirmation modal', () => { - beforeEach(async () => { + beforeEach(async function () { + this.server.delete('location-units/institutions/:id', {}, 500); + await Button('Delete').click(); }); @@ -79,7 +82,9 @@ describe('ControlledVocab', () => { it('should have row count 5', () => cv.has({ rowCount: 5 })); describe('clicking Delete icon on first row', () => { - beforeEach(async () => { + beforeEach(async function () { + this.server.delete('location-units/institutions/:id', {}, 500); + await firstRow.delete(); }); @@ -99,6 +104,15 @@ describe('ControlledVocab', () => { it('cannot delete modal title', () => mo.has({ title: 'Cannot delete Institution' })); }); }); + + describe('when deleting is successful', () => { + beforeEach(async () => { + await firstRow.delete(); + await Button('Delete').click(); + }); + + it('should display successful callout message', () => Callout('The Institution Bowdoin College was successfully deleted').exists()); + }); }); describe('User can edit EditableListForm', () => { @@ -167,6 +181,14 @@ describe('ControlledVocab', () => { it('should not display the error message', () => firstRow.find(TextField(including('name'))).is({ valid: true })); it('should enable Save button', () => firstRow.has({ saveDisabled: false })); + + describe('when creating is successful', () => { + beforeEach(async () => { + await firstRow.save(); + }); + + it('should display successful callout message', () => Callout('The Institution test was successfully created').exists()); + }); }); }); @@ -200,6 +222,20 @@ describe('ControlledVocab', () => { it('should enable Delete button', () => cv.has({ deleteDisabled: false })); }); + + describe('when editing an item', () => { + beforeEach(async () => { + await firstRow.find(TextField(including('name'))).fillIn('Bowdoin College edit'); + }); + + describe('when creating is successful', () => { + beforeEach(async () => { + await firstRow.save(); + }); + + it('should display successful callout message', () => Callout('The Institution Bowdoin College edit was successfully updated').exists()); + }); + }); }); }); diff --git a/lib/ControlledVocab/tests/ControlledVocabErrors-test.js b/lib/ControlledVocab/tests/ControlledVocabErrors-test.js index 19850888d..4a027fbb6 100644 --- a/lib/ControlledVocab/tests/ControlledVocabErrors-test.js +++ b/lib/ControlledVocab/tests/ControlledVocabErrors-test.js @@ -18,7 +18,27 @@ describe('ControlledVocabErrors', () => { function mount() { // eslint-disable-next-line no-undef - beforeEach(() => mountComponent(true, server)); + beforeEach(function () { + mountComponent(true, this.server); + this.server.post('location-units/institutions', { + 'errors': [{ + 'message': 'Cannot create entity; name is not unique', + 'code': 'name.duplicate', + 'parameters': [{ + 'key': 'fieldLabel', + 'value': 'name' + }] + }, + { + 'message': 'test', + 'code': '-1', + 'parameters': [{ + 'key': 'test', + 'value': 'test' + }] + }] + }, 422); + }); beforeEach(async () => { await cv.newButton().click(); await cv.fillInputField('test'); diff --git a/lib/ControlledVocab/tests/mountComponent.js b/lib/ControlledVocab/tests/mountComponent.js index 3f34661d4..26e50f507 100644 --- a/lib/ControlledVocab/tests/mountComponent.js +++ b/lib/ControlledVocab/tests/mountComponent.js @@ -15,56 +15,88 @@ export default async function (editable, server, props) { let valuesLoaded = false; let usersLoaded = false; + const institutions = [{ + 'id' : '40ee00ca-a518-4b49-be01-0638d0a4ac57', + 'name' : 'Bowdoin College', + 'code' : 'BC' + }, { + 'id' : '786bccb0-1795-4896-9452-a6e5bd5f28ac', + 'name' : 'Harvard University', + 'code' : 'hu', + 'metadata' : { + 'createdDate' : '2019-04-18T16:09:26.816+0000', + 'createdByUserId' : 'user-1', + 'updatedDate' : '2019-04-18T16:09:26.816+0000', + 'updatedByUserId' : 'user-1' + } + }, { + 'id' : '16e4d83d-a076-4175-a810-90190eb2954c', + 'name' : 'Dartmouth College', + 'code' : 'dc', + 'metadata' : { + 'createdDate' : '2019-04-18T16:41:36.806+0000', + 'createdByUserId' : 'user-1', + 'updatedDate' : '2019-04-18T16:41:36.806+0000', + 'updatedByUserId' : 'user-1', + } + }, { + 'id' : '16e4d83d-a076-4175-a810-90190eb2954c', + 'name' : 'University of Maryland, Baltimore', + 'code' : 'umb', + 'metadata' : { + 'createdDate' : '2019-04-18T16:41:36.806+0000', + 'createdByUserId' : 'user-2', + 'updatedDate' : '2019-04-18T16:41:36.806+0000', + 'updatedByUserId' : 'user-2', + } + }, { + 'id' : '16e4d83d-a076-4175-a810-90190eb2954c', + 'name' : 'Cornell University', + 'code' : 'cu', + 'metadata' : { + 'createdDate' : '2019-04-18T16:41:36.806+0000', + 'createdByUserId' : 'user-2', + 'updatedDate' : '2019-04-18T16:41:36.806+0000', + 'updatedByUserId' : 'user-2' + } + }]; + server.get('location-units/institutions', (schema, request) => { valuesLoaded = true; // stripes-connect requires `X-Request-URL` header for `response.url` return new Response(200, { 'X-Request-URL': request.url }, { - 'locinsts' : [{ - 'id' : '40ee00ca-a518-4b49-be01-0638d0a4ac57', - 'name' : 'Bowdoin College', - 'code' : 'BC' - }, { - 'id' : '786bccb0-1795-4896-9452-a6e5bd5f28ac', - 'name' : 'Harvard University', - 'code' : 'hu', - 'metadata' : { - 'createdDate' : '2019-04-18T16:09:26.816+0000', - 'createdByUserId' : 'user-1', - 'updatedDate' : '2019-04-18T16:09:26.816+0000', - 'updatedByUserId' : 'user-1' - } - }, { - 'id' : '16e4d83d-a076-4175-a810-90190eb2954c', - 'name' : 'Dartmouth College', - 'code' : 'dc', - 'metadata' : { - 'createdDate' : '2019-04-18T16:41:36.806+0000', - 'createdByUserId' : 'user-1', - 'updatedDate' : '2019-04-18T16:41:36.806+0000', - 'updatedByUserId' : 'user-1', - } - }, { - 'id' : '16e4d83d-a076-4175-a810-90190eb2954c', - 'name' : 'University of Maryland, Baltimore', - 'code' : 'umb', - 'metadata' : { - 'createdDate' : '2019-04-18T16:41:36.806+0000', - 'createdByUserId' : 'user-2', - 'updatedDate' : '2019-04-18T16:41:36.806+0000', - 'updatedByUserId' : 'user-2', - } - }, { - 'id' : '16e4d83d-a076-4175-a810-90190eb2954c', - 'name' : 'Cornell University', - 'code' : 'cu', - 'metadata' : { - 'createdDate' : '2019-04-18T16:41:36.806+0000', - 'createdByUserId' : 'user-2', - 'updatedDate' : '2019-04-18T16:41:36.806+0000', - 'updatedByUserId' : 'user-2' - } - }], + 'locinsts': institutions, + 'totalRecords' : 5 + }); + }); + + server.delete('location-units/institutions/:id', (schema, request) => { + valuesLoaded = true; + + // stripes-connect requires `X-Request-URL` header for `response.url` + return new Response(201, { 'X-Request-URL': request.url }, { + 'locinsts': institutions, + 'totalRecords' : 5 + }); + }); + + server.post('location-units/institutions/', (schema, request) => { + valuesLoaded = true; + + // stripes-connect requires `X-Request-URL` header for `response.url` + return new Response(201, { 'X-Request-URL': request.url }, { + 'locinsts': institutions, + 'totalRecords' : 5 + }); + }); + + server.put('location-units/institutions/:id', (schema, request) => { + valuesLoaded = true; + + // stripes-connect requires `X-Request-URL` header for `response.url` + return new Response(201, { 'X-Request-URL': request.url }, { + 'locinsts': institutions, 'totalRecords' : 5 }); }); @@ -96,6 +128,8 @@ export default async function (editable, server, props) { }); }); + + const onEditHandler = sinon.spy(); const onDeleteHandler = sinon.spy(); diff --git a/tests/network/config.js b/tests/network/config.js index fb5e69a75..b966fe09a 100644 --- a/tests/network/config.js +++ b/tests/network/config.js @@ -17,25 +17,6 @@ export default function config() { this.get('/note-types'); - this.post('location-units/institutions', { - 'errors': [{ - 'message': 'Cannot create entity; name is not unique', - 'code': 'name.duplicate', - 'parameters': [{ - 'key': 'fieldLabel', - 'value': 'name' - }] - }, - { - 'message': 'test', - 'code': '-1', - 'parameters': [{ - 'key': 'test', - 'value': 'test' - }] - }] - }, 422); - this.get('/note-links/domain/dummy/type/:type/id/:id', ({ notes }, { params, queryParams }) => { return notes.where((note) => { const conditions = []; diff --git a/translations/stripes-smart-components/en.json b/translations/stripes-smart-components/en.json index f3df97104..b90272857 100644 --- a/translations/stripes-smart-components/en.json +++ b/translations/stripes-smart-components/en.json @@ -47,6 +47,8 @@ "cv.numberOfObjects": "# of {objects}", "cv.termWillBeDeleted": "The {type} {term} will be deleted.", "cv.termDeleted": "The {type} {term} was successfully deleted", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated", "ll.locationLookup": "Location look-up", "ll.selectLocationHeader": "Select {type} location", "ll.institution": "Institution", From d3fa7526c0e9dbd8c873dab8eb935e8af281ed26 Mon Sep 17 00:00:00 2001 From: Denys Bohdan Date: Mon, 15 Jan 2024 15:30:07 +0100 Subject: [PATCH 02/26] STSMACOM-797 `` - last updated by column - show "System" when items are created by system user (#1429) --- CHANGELOG.md | 1 + lib/ControlledVocab/ControlledVocab.js | 3 +++ .../tests/ControlledVocab-test.js | 10 +++++++--- lib/ControlledVocab/tests/mountComponent.js | 18 ++++++++++++++---- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48e137247..6ea9cfa8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ * Added `tenant` prop to ``. Refs STSMACOM-794. * Use the default match and search option in Advanced search when they are not entered. Refs STSMACOM-793. * Show successful toast notifications for Create and Edit actions in ``. Refs STSMACOM-796. +* `` - last updated by column - show "System" when items are created by system user. Refs STSMACOM-797. ## [9.0.0](https://github.com/folio-org/stripes-smart-components/tree/v9.0.0) (2023-10-11) [Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v8.0.0...v9.0.0) diff --git a/lib/ControlledVocab/ControlledVocab.js b/lib/ControlledVocab/ControlledVocab.js index 7662b058e..b19782e14 100644 --- a/lib/ControlledVocab/ControlledVocab.js +++ b/lib/ControlledVocab/ControlledVocab.js @@ -21,6 +21,7 @@ import EditableList from '../EditableList'; import css from './ControlledVocab.css'; import makeRefdataActuatorsBoundTo from './actuators-refdata'; +const SYSTEM_USER_ID = '00000000-0000-0000-0000-000000000000'; const ACTIONS = { CREATE: 'termCreated', EDIT: 'termUpdated', @@ -473,6 +474,8 @@ class ControlledVocab extends React.Component { const { firstName, lastName = '' } = record.personal; const name = firstName ? `${lastName}, ${firstName}` : lastName; user = {name}; + } else if (metadata.updatedByUserId === SYSTEM_USER_ID) { + user = ; } return ( diff --git a/lib/ControlledVocab/tests/ControlledVocab-test.js b/lib/ControlledVocab/tests/ControlledVocab-test.js index 5027a9368..bc3eeed16 100644 --- a/lib/ControlledVocab/tests/ControlledVocab-test.js +++ b/lib/ControlledVocab/tests/ControlledVocab-test.js @@ -46,7 +46,7 @@ describe('ControlledVocab', () => { // eslint-disable-next-line no-undef beforeEach(() => mountComponent(true, server, { translations })); - it('should have row count 5', () => cv.has({ rowCount: 5 })); + it('should have row count 6', () => cv.has({ rowCount: 6 })); describe('clicking Delete icon on first row', () => { beforeEach(async () => { @@ -79,7 +79,7 @@ describe('ControlledVocab', () => { // eslint-disable-next-line no-undef beforeEach(() => mountComponent(true, server, { labelSingular })); - it('should have row count 5', () => cv.has({ rowCount: 5 })); + it('should have row count 6', () => cv.has({ rowCount: 6 })); describe('clicking Delete icon on first row', () => { beforeEach(async function () { @@ -268,10 +268,14 @@ describe('ControlledVocab', () => { await mountComponent(false, server, { listSuppressor }); }); - it('should have row count 5', () => cv.has({ rowCount: 5 })); + it('should have row count 6', () => cv.has({ rowCount: 6 })); it('should render the row with last updated by user-1 without user firstname or lastname', async () => { await mcl.find(MultiColumnListCell({ row: 4, columnIndex: 3, content: '4/18/2019 by ' })).exists(); }); + + it('should render the row with last updated by system with "System" text', async () => { + await mcl.find(MultiColumnListCell({ row: 6, columnIndex: 3, content: '1/9/2024 by System' })).exists(); + }); }); }); diff --git a/lib/ControlledVocab/tests/mountComponent.js b/lib/ControlledVocab/tests/mountComponent.js index 26e50f507..3283ab567 100644 --- a/lib/ControlledVocab/tests/mountComponent.js +++ b/lib/ControlledVocab/tests/mountComponent.js @@ -59,6 +59,16 @@ export default async function (editable, server, props) { 'updatedDate' : '2019-04-18T16:41:36.806+0000', 'updatedByUserId' : 'user-2' } + }, { + 'id' : '40ee00ca-a518-4b49-be01-0638d0a4ac57', + 'name' : 'Københavns Universitet', + 'code' : 'KU', + 'metadata' : { + 'createdDate' : '2024-01-09T01:49:57.008+00:00', + 'createdByUserId' : '00000000-0000-0000-0000-000000000000', + 'updatedDate' : '2024-01-09T01:49:57.008+00:00', + 'updatedByUserId' : '00000000-0000-0000-0000-000000000000' + } }]; server.get('location-units/institutions', (schema, request) => { @@ -67,7 +77,7 @@ export default async function (editable, server, props) { // stripes-connect requires `X-Request-URL` header for `response.url` return new Response(200, { 'X-Request-URL': request.url }, { 'locinsts': institutions, - 'totalRecords' : 5 + 'totalRecords': 6 }); }); @@ -77,7 +87,7 @@ export default async function (editable, server, props) { // stripes-connect requires `X-Request-URL` header for `response.url` return new Response(201, { 'X-Request-URL': request.url }, { 'locinsts': institutions, - 'totalRecords' : 5 + 'totalRecords': 6 }); }); @@ -87,7 +97,7 @@ export default async function (editable, server, props) { // stripes-connect requires `X-Request-URL` header for `response.url` return new Response(201, { 'X-Request-URL': request.url }, { 'locinsts': institutions, - 'totalRecords' : 5 + 'totalRecords': 6 }); }); @@ -97,7 +107,7 @@ export default async function (editable, server, props) { // stripes-connect requires `X-Request-URL` header for `response.url` return new Response(201, { 'X-Request-URL': request.url }, { 'locinsts': institutions, - 'totalRecords' : 5 + 'totalRecords': 6 }); }); From 9f5630496bc8b87e659e3bcd6faa0bc6d8d34c00 Mon Sep 17 00:00:00 2001 From: FOLIO Translations Bot <38661258+folio-translations@users.noreply.github.com> Date: Tue, 16 Jan 2024 17:39:37 -0500 Subject: [PATCH 03/26] Lokalise: updates --- translations/stripes-smart-components/ar.json | 4 +++- translations/stripes-smart-components/ber.json | 4 +++- translations/stripes-smart-components/ca.json | 4 +++- translations/stripes-smart-components/cs_CZ.json | 4 +++- translations/stripes-smart-components/da.json | 4 +++- translations/stripes-smart-components/de.json | 4 +++- translations/stripes-smart-components/en_GB.json | 4 +++- translations/stripes-smart-components/en_SE.json | 4 +++- translations/stripes-smart-components/en_US.json | 4 +++- translations/stripes-smart-components/es.json | 4 +++- translations/stripes-smart-components/es_419.json | 4 +++- translations/stripes-smart-components/es_ES.json | 4 +++- translations/stripes-smart-components/fr.json | 4 +++- translations/stripes-smart-components/fr_FR.json | 4 +++- translations/stripes-smart-components/he.json | 4 +++- translations/stripes-smart-components/hi_IN.json | 4 +++- translations/stripes-smart-components/hu.json | 4 +++- translations/stripes-smart-components/it_IT.json | 4 +++- translations/stripes-smart-components/ja.json | 4 +++- translations/stripes-smart-components/ko.json | 4 +++- translations/stripes-smart-components/nb.json | 4 +++- translations/stripes-smart-components/nn.json | 4 +++- translations/stripes-smart-components/pl.json | 4 +++- translations/stripes-smart-components/pt_BR.json | 4 +++- translations/stripes-smart-components/pt_PT.json | 4 +++- translations/stripes-smart-components/ru.json | 4 +++- translations/stripes-smart-components/sk.json | 4 +++- translations/stripes-smart-components/sv.json | 4 +++- translations/stripes-smart-components/ur.json | 4 +++- translations/stripes-smart-components/zh_CN.json | 4 +++- translations/stripes-smart-components/zh_TW.json | 4 +++- 31 files changed, 93 insertions(+), 31 deletions(-) diff --git a/translations/stripes-smart-components/ar.json b/translations/stripes-smart-components/ar.json index ced0f3256..41d177de5 100644 --- a/translations/stripes-smart-components/ar.json +++ b/translations/stripes-smart-components/ar.json @@ -275,5 +275,7 @@ "error.conflict": "أنت تقوم بتحرير نسخة قديمة من هذه البيانات. لتحميل أحدث إصدار، قم بالنقر على إلغاء، تحديث الصفحة وحاول مرة أخرى.", "editableList.actionsColumnHeader": "الإجراءات", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/ber.json b/translations/stripes-smart-components/ber.json index 09bffd9ac..5bba99256 100644 --- a/translations/stripes-smart-components/ber.json +++ b/translations/stripes-smart-components/ber.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Actions", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/ca.json b/translations/stripes-smart-components/ca.json index 09bffd9ac..5bba99256 100644 --- a/translations/stripes-smart-components/ca.json +++ b/translations/stripes-smart-components/ca.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Actions", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/cs_CZ.json b/translations/stripes-smart-components/cs_CZ.json index 290c72bdf..bc4d77c43 100644 --- a/translations/stripes-smart-components/cs_CZ.json +++ b/translations/stripes-smart-components/cs_CZ.json @@ -275,5 +275,7 @@ "error.conflict": "Upravujete starou verzi těchto dat. Chcete-li načíst nejnovější verzi, klikněte na tlačítko zrušit, obnovte stránku a zkuste to znovu.", "editableList.actionsColumnHeader": "Akce", "customFields.option.deleteLabel": "Smazat", - "advancedSearch": "Rozšířené vyhledávání" + "advancedSearch": "Rozšířené vyhledávání", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/da.json b/translations/stripes-smart-components/da.json index 7ed86b520..cd7e32448 100644 --- a/translations/stripes-smart-components/da.json +++ b/translations/stripes-smart-components/da.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Actions", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/de.json b/translations/stripes-smart-components/de.json index d8afe860b..db6bfaf4d 100644 --- a/translations/stripes-smart-components/de.json +++ b/translations/stripes-smart-components/de.json @@ -275,5 +275,7 @@ "error.conflict": "Sie bearbeiten gerade eine alte Version dieser Daten. Um die neueste Version zu laden, klicken Sie auf Abbrechen, aktualisieren Sie die Seite und versuchen Sie es erneut.", "editableList.actionsColumnHeader": "Aktionen", "customFields.option.deleteLabel": "Löschen", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/en_GB.json b/translations/stripes-smart-components/en_GB.json index 09bffd9ac..5bba99256 100644 --- a/translations/stripes-smart-components/en_GB.json +++ b/translations/stripes-smart-components/en_GB.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Actions", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/en_SE.json b/translations/stripes-smart-components/en_SE.json index 09bffd9ac..5bba99256 100644 --- a/translations/stripes-smart-components/en_SE.json +++ b/translations/stripes-smart-components/en_SE.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Actions", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/en_US.json b/translations/stripes-smart-components/en_US.json index 09bffd9ac..5bba99256 100644 --- a/translations/stripes-smart-components/en_US.json +++ b/translations/stripes-smart-components/en_US.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Actions", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/es.json b/translations/stripes-smart-components/es.json index b48724067..15147fb65 100644 --- a/translations/stripes-smart-components/es.json +++ b/translations/stripes-smart-components/es.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Actions", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/es_419.json b/translations/stripes-smart-components/es_419.json index 50a71f1ce..56f99290f 100644 --- a/translations/stripes-smart-components/es_419.json +++ b/translations/stripes-smart-components/es_419.json @@ -275,5 +275,7 @@ "error.conflict": "Está editando una versión antigua de estos datos. Para cargar la versión más reciente, haga clic en cancelar, actualice la página e inténtelo de nuevo.", "editableList.actionsColumnHeader": "Acciones", "customFields.option.deleteLabel": "Borrar", - "advancedSearch": "Búsqueda Avanzada" + "advancedSearch": "Búsqueda Avanzada", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/es_ES.json b/translations/stripes-smart-components/es_ES.json index cb0a5e68a..ac2e0523b 100644 --- a/translations/stripes-smart-components/es_ES.json +++ b/translations/stripes-smart-components/es_ES.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Acciones", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Búsqueda avanzada" + "advancedSearch": "Búsqueda avanzada", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/fr.json b/translations/stripes-smart-components/fr.json index 09bffd9ac..5bba99256 100644 --- a/translations/stripes-smart-components/fr.json +++ b/translations/stripes-smart-components/fr.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Actions", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/fr_FR.json b/translations/stripes-smart-components/fr_FR.json index 0afc1064e..3afaf1239 100644 --- a/translations/stripes-smart-components/fr_FR.json +++ b/translations/stripes-smart-components/fr_FR.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Actions", "customFields.option.deleteLabel": "Supprimer", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/he.json b/translations/stripes-smart-components/he.json index c1f993603..c762d2a22 100644 --- a/translations/stripes-smart-components/he.json +++ b/translations/stripes-smart-components/he.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Actions", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/hi_IN.json b/translations/stripes-smart-components/hi_IN.json index 09bffd9ac..5bba99256 100644 --- a/translations/stripes-smart-components/hi_IN.json +++ b/translations/stripes-smart-components/hi_IN.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Actions", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/hu.json b/translations/stripes-smart-components/hu.json index 332733a46..e14997c7a 100644 --- a/translations/stripes-smart-components/hu.json +++ b/translations/stripes-smart-components/hu.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Actions", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/it_IT.json b/translations/stripes-smart-components/it_IT.json index 0324630bc..e2aaf7e77 100644 --- a/translations/stripes-smart-components/it_IT.json +++ b/translations/stripes-smart-components/it_IT.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Azioni", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/ja.json b/translations/stripes-smart-components/ja.json index 405f8520b..7f3906807 100644 --- a/translations/stripes-smart-components/ja.json +++ b/translations/stripes-smart-components/ja.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Actions", "customFields.option.deleteLabel": "削除", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "{type} {term} は正常に更新されました" } \ No newline at end of file diff --git a/translations/stripes-smart-components/ko.json b/translations/stripes-smart-components/ko.json index 40760f400..7ad67f4f0 100644 --- a/translations/stripes-smart-components/ko.json +++ b/translations/stripes-smart-components/ko.json @@ -275,5 +275,7 @@ "error.conflict": "이 데이터의 이전 버전을 편집하고 있습니다. 최신 버전을 로드하려면 취소를 클릭하고 페이지를 새로고침 한 다음 다시 시도하십시오.", "editableList.actionsColumnHeader": "작업", "customFields.option.deleteLabel": "삭제", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/nb.json b/translations/stripes-smart-components/nb.json index 09bffd9ac..5bba99256 100644 --- a/translations/stripes-smart-components/nb.json +++ b/translations/stripes-smart-components/nb.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Actions", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/nn.json b/translations/stripes-smart-components/nn.json index 09bffd9ac..5bba99256 100644 --- a/translations/stripes-smart-components/nn.json +++ b/translations/stripes-smart-components/nn.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Actions", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/pl.json b/translations/stripes-smart-components/pl.json index 131bfa168..61f1a151a 100644 --- a/translations/stripes-smart-components/pl.json +++ b/translations/stripes-smart-components/pl.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Akcje", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Wyszukiwanie zaawansowane" + "advancedSearch": "Wyszukiwanie zaawansowane", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/pt_BR.json b/translations/stripes-smart-components/pt_BR.json index c6b8b05a3..14d30094e 100644 --- a/translations/stripes-smart-components/pt_BR.json +++ b/translations/stripes-smart-components/pt_BR.json @@ -275,5 +275,7 @@ "error.conflict": "Você está editando uma versão antiga desses dados. Para carregar a versão mais recente, clique em Cancelar, atualize a página e tente novamente.", "editableList.actionsColumnHeader": "Ações", "customFields.option.deleteLabel": "Excluir", - "advancedSearch": "Busca avançada" + "advancedSearch": "Busca avançada", + "cv.termCreated": "O {type} {term} foi criado com sucesso", + "cv.termUpdated": "O {type} {term} foi atualizado com sucesso" } \ No newline at end of file diff --git a/translations/stripes-smart-components/pt_PT.json b/translations/stripes-smart-components/pt_PT.json index 2a7b07cd4..f4424c142 100644 --- a/translations/stripes-smart-components/pt_PT.json +++ b/translations/stripes-smart-components/pt_PT.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Actions", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/ru.json b/translations/stripes-smart-components/ru.json index f6bed1717..ffd866127 100644 --- a/translations/stripes-smart-components/ru.json +++ b/translations/stripes-smart-components/ru.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Actions", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/sk.json b/translations/stripes-smart-components/sk.json index 09bffd9ac..5bba99256 100644 --- a/translations/stripes-smart-components/sk.json +++ b/translations/stripes-smart-components/sk.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Actions", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/sv.json b/translations/stripes-smart-components/sv.json index 09bffd9ac..5bba99256 100644 --- a/translations/stripes-smart-components/sv.json +++ b/translations/stripes-smart-components/sv.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Actions", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/ur.json b/translations/stripes-smart-components/ur.json index a12111bf0..81a62e4ce 100644 --- a/translations/stripes-smart-components/ur.json +++ b/translations/stripes-smart-components/ur.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Actions", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/zh_CN.json b/translations/stripes-smart-components/zh_CN.json index 116cea3d5..6cd343f9f 100644 --- a/translations/stripes-smart-components/zh_CN.json +++ b/translations/stripes-smart-components/zh_CN.json @@ -275,5 +275,7 @@ "error.conflict": "正在编辑此数据的旧版本。要加载最新版本,请单击取消, 刷新页面并重试。", "editableList.actionsColumnHeader": "操作", "customFields.option.deleteLabel": "删除", - "advancedSearch": "高级搜索" + "advancedSearch": "高级搜索", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file diff --git a/translations/stripes-smart-components/zh_TW.json b/translations/stripes-smart-components/zh_TW.json index 7d5b3ba60..1411ca3eb 100644 --- a/translations/stripes-smart-components/zh_TW.json +++ b/translations/stripes-smart-components/zh_TW.json @@ -275,5 +275,7 @@ "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", "editableList.actionsColumnHeader": "Actions", "customFields.option.deleteLabel": "Delete", - "advancedSearch": "Advanced search" + "advancedSearch": "Advanced search", + "cv.termCreated": "The {type} {term} was successfully created", + "cv.termUpdated": "The {type} {term} was successfully updated" } \ No newline at end of file From e46b4d6f040413ae726f7e1692295de0e909c043 Mon Sep 17 00:00:00 2001 From: alb3rtino Date: Fri, 19 Jan 2024 08:39:43 +0100 Subject: [PATCH 04/26] STSMACOM-800 Add field type `DATE_PICKER` to custom fields components (#1430) * Add `DATE_PICKER` field type * Update test data * Update CHANGELOG * Update CHANGELOG --- CHANGELOG.md | 1 + .../CustomFieldsForm/tests/CustomFieldsForm-test.js | 10 +++++++++- .../components/FieldAccordion/FieldAccordion.js | 2 ++ lib/CustomFields/constants.js | 12 ++++++++++++ .../EditCustomFieldsRecord/EditCustomFieldsRecord.js | 2 ++ .../tests/EditCustomFieldsRecord-test.js | 2 +- .../tests/EditCustomFieldsSettings-test.js | 10 +++++----- .../ViewCustomFieldsRecord/ViewCustomFieldsRecord.js | 9 +++++++-- .../tests/ViewCustomFieldsRecord-test.js | 7 ++++++- tests/network/config.js | 10 ++++++++++ translations/stripes-smart-components/en.json | 1 + 11 files changed, 56 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ea9cfa8a..1ae0ed452 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ * Use the default match and search option in Advanced search when they are not entered. Refs STSMACOM-793. * Show successful toast notifications for Create and Edit actions in ``. Refs STSMACOM-796. * `` - last updated by column - show "System" when items are created by system user. Refs STSMACOM-797. +* Add field type `DATE_PICKER` to custom fields components. Refs STSMACOM-800. ## [9.0.0](https://github.com/folio-org/stripes-smart-components/tree/v9.0.0) (2023-10-11) [Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v8.0.0...v9.0.0) diff --git a/lib/CustomFields/components/CustomFieldsForm/tests/CustomFieldsForm-test.js b/lib/CustomFields/components/CustomFieldsForm/tests/CustomFieldsForm-test.js index 64db92f9a..08ff64828 100644 --- a/lib/CustomFields/components/CustomFieldsForm/tests/CustomFieldsForm-test.js +++ b/lib/CustomFields/components/CustomFieldsForm/tests/CustomFieldsForm-test.js @@ -96,7 +96,15 @@ describe('CustomFieldsForm', () => { }); it('should display custom field labels in "Add custom field" alphabetically', () => { - const sortedLabels = ['Checkbox', 'Multi-select', 'Radio button set', 'Single select', 'Text area', 'Text field']; + const sortedLabels = [ + 'Checkbox', + 'Date picker', + 'Multi-select', + 'Radio button set', + 'Single select', + 'Text area', + 'Text field', + ]; const visibleLabels = customFieldsForm.customFieldSelectButtons().map(button => button.label); expect(visibleLabels).to.deep.equal(sortedLabels); diff --git a/lib/CustomFields/components/FieldAccordion/FieldAccordion.js b/lib/CustomFields/components/FieldAccordion/FieldAccordion.js index 2157a325f..e9aa67c79 100644 --- a/lib/CustomFields/components/FieldAccordion/FieldAccordion.js +++ b/lib/CustomFields/components/FieldAccordion/FieldAccordion.js @@ -24,6 +24,7 @@ const editFieldsByType = { [fieldTypes.RADIO_BUTTON_GROUP]: editFields.RadioButtonSetFields, [fieldTypes.SELECT]: editFields.SelectDropdownFields, [fieldTypes.MULTISELECT]: editFields.SelectDropdownFields, + [fieldTypes.DATE_PICKER]: editFields.TextboxFields, }; const viewSectionsByType = { @@ -33,6 +34,7 @@ const viewSectionsByType = { [fieldTypes.RADIO_BUTTON_GROUP]: viewSections.RadioButtonSetSection, [fieldTypes.SELECT]: viewSections.SelectDropdownSection, [fieldTypes.MULTISELECT]: viewSections.SelectDropdownSection, + [fieldTypes.DATE_PICKER]: viewSections.TextboxViewSection, }; const propTypes = { diff --git a/lib/CustomFields/constants.js b/lib/CustomFields/constants.js index ee07dca9d..37f3fad47 100644 --- a/lib/CustomFields/constants.js +++ b/lib/CustomFields/constants.js @@ -2,6 +2,7 @@ import React from 'react'; import { FormattedMessage } from 'react-intl'; import { Checkbox, + Datepicker, TextField, TextArea, Select, @@ -16,6 +17,7 @@ export const fieldTypes = { SELECT: 'SINGLE_SELECT_DROPDOWN', MULTISELECT: 'MULTI_SELECT_DROPDOWN', RADIO_BUTTON_GROUP: 'RADIO_BUTTON', + DATE_PICKER: 'DATE_PICKER', }; export const fieldTypesLabelIds = { @@ -25,6 +27,7 @@ export const fieldTypesLabelIds = { [fieldTypes.SELECT]: 'stripes-smart-components.customFields.fieldTypes.SELECT', [fieldTypes.MULTISELECT]: 'stripes-smart-components.customFields.fieldTypes.MULTISELECT', [fieldTypes.RADIO_BUTTON_GROUP]: 'stripes-smart-components.customFields.fieldTypes.RADIO_BUTTON', + [fieldTypes.DATE_PICKER]: 'stripes-smart-components.customFields.fieldTypes.DATE_PICKER', }; export const fieldTypesLabels = { @@ -34,6 +37,7 @@ export const fieldTypesLabels = { [fieldTypes.SELECT]: , [fieldTypes.MULTISELECT]: , [fieldTypes.RADIO_BUTTON_GROUP]: , + [fieldTypes.DATE_PICKER]: , }; export const NO_DEFAULT_OPTIONS_VALUE = 'no-default'; @@ -124,6 +128,13 @@ export const defaultFieldConfigs = { }], } } + }, + [fieldTypes.DATE_PICKER]: { + name: '', + visible: true, + required: false, + helpText: '', + type: fieldTypes.DATE_PICKER, } }; @@ -134,6 +145,7 @@ export const fieldComponents = { [fieldTypes.SELECT]: Select, [fieldTypes.RADIO_BUTTON_GROUP]: RadioButtonGroup, [fieldTypes.MULTISELECT]: MultiSelection, + [fieldTypes.DATE_PICKER]: Datepicker, }; export const rowShapes = 12; diff --git a/lib/CustomFields/pages/EditCustomFieldsRecord/EditCustomFieldsRecord.js b/lib/CustomFields/pages/EditCustomFieldsRecord/EditCustomFieldsRecord.js index 89f076d57..4bc925417 100644 --- a/lib/CustomFields/pages/EditCustomFieldsRecord/EditCustomFieldsRecord.js +++ b/lib/CustomFields/pages/EditCustomFieldsRecord/EditCustomFieldsRecord.js @@ -294,6 +294,8 @@ const EditCustomFieldsRecord = ({ }); } else if (customField.type === fieldTypes.CHECKBOX) { return createCustomFieldRenderFunction(customField)({ type: 'checkbox' }); + } else if (customField.type === fieldTypes.DATE_PICKER) { + return createCustomFieldRenderFunction(customField)({ backendDateStandard: 'YYYY-MM-DD' }); } else { return createCustomFieldRenderFunction(customField)(); } diff --git a/lib/CustomFields/pages/EditCustomFieldsRecord/tests/EditCustomFieldsRecord-test.js b/lib/CustomFields/pages/EditCustomFieldsRecord/tests/EditCustomFieldsRecord-test.js index b6489ceaa..266d67dde 100644 --- a/lib/CustomFields/pages/EditCustomFieldsRecord/tests/EditCustomFieldsRecord-test.js +++ b/lib/CustomFields/pages/EditCustomFieldsRecord/tests/EditCustomFieldsRecord-test.js @@ -97,7 +97,7 @@ describe('EditCustomFieldsRecord', () => { }); it('should show all visible custom fields', () => { - expect(editCustomFields.customFields().length).to.equal(5); + expect(editCustomFields.customFields().length).to.equal(6); }); describe('when Single Select field has a default option', () => { diff --git a/lib/CustomFields/pages/EditCustomFieldsSettings/tests/EditCustomFieldsSettings-test.js b/lib/CustomFields/pages/EditCustomFieldsSettings/tests/EditCustomFieldsSettings-test.js index f9513d222..be2058cd6 100644 --- a/lib/CustomFields/pages/EditCustomFieldsSettings/tests/EditCustomFieldsSettings-test.js +++ b/lib/CustomFields/pages/EditCustomFieldsSettings/tests/EditCustomFieldsSettings-test.js @@ -224,10 +224,10 @@ describe('EditCustomFieldsSettings', () => { describe('when creating a custom field with options', () => { beforeEach(async () => { - await editCustomFields.addFieldButton.selectCustomFieldType(1); - await editCustomFields.customFields(5).fillName('Test field'); - await editCustomFields.customFields(5).options(0).fillOptionName('beta'); - await editCustomFields.customFields(5).options(1).fillOptionName('alpha'); + await editCustomFields.addFieldButton.selectCustomFieldType(2); + await editCustomFields.customFields(6).fillName('Test field'); + await editCustomFields.customFields(6).options(0).fillOptionName('beta'); + await editCustomFields.customFields(6).options(1).fillOptionName('alpha'); await editCustomFields.save(); }); @@ -237,7 +237,7 @@ describe('EditCustomFieldsSettings', () => { const { name, selectField, - } = body.customFields[5]; + } = body.customFields[6]; expect({ name, selectField }).to.deep.equal({ name: 'Test field', diff --git a/lib/CustomFields/pages/ViewCustomFieldsRecord/ViewCustomFieldsRecord.js b/lib/CustomFields/pages/ViewCustomFieldsRecord/ViewCustomFieldsRecord.js index cfd03d7c4..ede519244 100644 --- a/lib/CustomFields/pages/ViewCustomFieldsRecord/ViewCustomFieldsRecord.js +++ b/lib/CustomFields/pages/ViewCustomFieldsRecord/ViewCustomFieldsRecord.js @@ -2,7 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { chunk } from 'lodash'; -import { FormattedMessage } from 'react-intl'; +import { FormattedMessage, useIntl } from 'react-intl'; import { Accordion, @@ -39,6 +39,7 @@ const { SELECT, MULTISELECT, CHECKBOX, + DATE_PICKER } = fieldTypes; const propTypes = { @@ -89,6 +90,8 @@ const ViewCustomFieldsRecord = ({ sectionTitleFetchFailed, } = useSectionTitleFetch(okapi, backendModuleName.toUpperCase()); + const { formatDate } = useIntl(); + const { calloutRef } = useLoadingErrorCallout(customFieldsFetchFailed || sectionTitleFetchFailed); const columnWidth = rowShapes / columnCount; @@ -143,7 +146,9 @@ const ViewCustomFieldsRecord = ({ if (type === SELECT || type === RADIO_BUTTON_GROUP) { return getSelectedOptionLabel(customField); } - + if (type === DATE_PICKER) { + return formatDate(new Date(customFieldValue)); + } if (type === TEXTAREA || type === TEXTFIELD) { return customFieldValue; } diff --git a/lib/CustomFields/pages/ViewCustomFieldsRecord/tests/ViewCustomFieldsRecord-test.js b/lib/CustomFields/pages/ViewCustomFieldsRecord/tests/ViewCustomFieldsRecord-test.js index 72a2bfd36..274a4e85e 100644 --- a/lib/CustomFields/pages/ViewCustomFieldsRecord/tests/ViewCustomFieldsRecord-test.js +++ b/lib/CustomFields/pages/ViewCustomFieldsRecord/tests/ViewCustomFieldsRecord-test.js @@ -32,6 +32,7 @@ describe('ViewCustomFieldsRecord', () => { 'single_select-1': 'opt_0', 'multi_select-2': ['opt_1', 'opt_2'], 'radio_1': 'opt_1', + 'date1': '2023-04-01' }} entityType="user" expanded @@ -63,13 +64,17 @@ describe('ViewCustomFieldsRecord', () => { }); it('should display current number of fields', () => { - expect(viewCustomFields.fields().length).to.equal(5); + expect(viewCustomFields.fields().length).to.equal(6); }); it('should display value for fields with a value', () => { expect(viewCustomFields.fields(0).value).to.equal('Some text value'); }); + it('should display formated date value for DATE_PICKER type', () => { + expect(viewCustomFields.fields(5).value).to.equal('4/1/2023'); + }); + it('should display dash for fields without a value', () => { expect(viewCustomFields.fields(1).hasNoValue).to.be.true; }); diff --git a/tests/network/config.js b/tests/network/config.js index b966fe09a..e7f98b539 100644 --- a/tests/network/config.js +++ b/tests/network/config.js @@ -225,6 +225,16 @@ export default function config() { }], } } + }, { + 'id': '6', + 'name': 'Date', + 'refId': 'date1', + 'type': 'DATE_PICKER', + 'entityType': 'user', + 'visible': true, + 'required': false, + 'order': 6, + 'helpText': 'Enter a date here', }], }); diff --git a/translations/stripes-smart-components/en.json b/translations/stripes-smart-components/en.json index b90272857..1a5122704 100644 --- a/translations/stripes-smart-components/en.json +++ b/translations/stripes-smart-components/en.json @@ -219,6 +219,7 @@ "customFields.fieldTypes.RADIO_BUTTON": "Radio button set", "customFields.fieldTypes.SELECT": "Single select", "customFields.fieldTypes.MULTISELECT": "Multi-select", + "customFields.fieldTypes.DATE_PICKER": "Date picker", "customFields.fieldLabel": "Field label", "customFields.fieldFormat": "Field format", "customFields.fieldValue.required": "{field} is required", From fb4a2dcc4496a7365521cfeaddf10e9bb7ed4b7e Mon Sep 17 00:00:00 2001 From: Priyanka Terala <104053200+Terala-Priyanka@users.noreply.github.com> Date: Fri, 19 Jan 2024 19:29:30 +0530 Subject: [PATCH 05/26] STSMACOM-799 - Make helpText prop as optional for all types of custom field components (#1432) * STSMACOM-799 - Make helpText prop as optional for all types of custom field components * STSMACOM-799 - add test for checkbox type custom field * STSMACOM-799 - update unit test * STSMACOM-799 - cleanup * STSMACOM-799 - update tests * STSMACOM-799 - updates tests * STSMACOM-799 - add unit test * STSMACOM-799 - update unit test --- CHANGELOG.md | 3 ++- .../view-sections/CheckboxSection.js | 4 ++-- .../view-sections/RadioButtonSetSections.js | 4 ++-- .../view-sections/SelectDropdownSection.js | 4 ++-- .../view-sections/TextboxSection.js | 4 ++-- .../view-sections/shared-values/HelpTextValue.js | 2 +- .../tests/EditCustomFieldsRecord-test.js | 2 +- .../tests/EditCustomFieldsSettings-test.js | 8 ++++---- .../tests/ViewCustomFieldsRecord-test.js | 2 +- .../tests/ViewCustomFieldsSettings-test.js | 10 ++++++++++ .../ViewCustomFieldsSettings/tests/interactor.js | 2 +- tests/network/config.js | 16 +++++++++++++++- 12 files changed, 43 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ae0ed452..fdaf0f62b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ * Export new `advancedSearchQueryToRows` helper to be used in Inventory app to reduce code duplication. Refs STSMACOM-787. * Show the username in the "last updated" accordion in the Note editing pane. Fixes STSMACOM-748. * Added `indexRef` and `inputRef` props to ``. Refs STSMACOM-788. -* Extend NotesAccordion and NotesSmartAccodion components to accept a prop hideNewButton. Refs STSMACOM-789. +* Extend NotesAccordion and NotesSmartAccordion components to accept a prop hideNewButton. Refs STSMACOM-789. * Extend `Tags` component to accept `mutateEntity` prop. Refs STSMACOM-792. * Refactor CSS away from postcss-color-function. Refs STSMACOM-791. * `` now passes the `entityType` when making PUT requests to `/custom-fields`. Refs FCFIELDS-44. @@ -15,6 +15,7 @@ * Show successful toast notifications for Create and Edit actions in ``. Refs STSMACOM-796. * `` - last updated by column - show "System" when items are created by system user. Refs STSMACOM-797. * Add field type `DATE_PICKER` to custom fields components. Refs STSMACOM-800. +* Make `helpText` prop as optional for all types of custom field components. Refs STSMACOM-799. ## [9.0.0](https://github.com/folio-org/stripes-smart-components/tree/v9.0.0) (2023-10-11) [Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v8.0.0...v9.0.0) diff --git a/lib/CustomFields/components/FieldAccordion/view-sections/CheckboxSection.js b/lib/CustomFields/components/FieldAccordion/view-sections/CheckboxSection.js index da9ec7781..8c183eb0b 100644 --- a/lib/CustomFields/components/FieldAccordion/view-sections/CheckboxSection.js +++ b/lib/CustomFields/components/FieldAccordion/view-sections/CheckboxSection.js @@ -9,14 +9,14 @@ import { } from './shared-values'; const propTypes = { - helpText: PropTypes.string.isRequired, + helpText: PropTypes.string, name: PropTypes.string.isRequired, }; const CheckboxSection = props => ( - + { props.helpText && } ); diff --git a/lib/CustomFields/components/FieldAccordion/view-sections/RadioButtonSetSections.js b/lib/CustomFields/components/FieldAccordion/view-sections/RadioButtonSetSections.js index 760e6b4bf..b578a4385 100644 --- a/lib/CustomFields/components/FieldAccordion/view-sections/RadioButtonSetSections.js +++ b/lib/CustomFields/components/FieldAccordion/view-sections/RadioButtonSetSections.js @@ -10,7 +10,7 @@ import { } from './shared-values'; const propTypes = { - helpText: PropTypes.string.isRequired, + helpText: PropTypes.string, name: PropTypes.string.isRequired, selectField: PropTypes.shape({ defaults: PropTypes.arrayOf(PropTypes.string), @@ -29,7 +29,7 @@ const RadioButtonSetSections = ({ <> - + { helpText && } diff --git a/lib/CustomFields/components/FieldAccordion/view-sections/SelectDropdownSection.js b/lib/CustomFields/components/FieldAccordion/view-sections/SelectDropdownSection.js index 5fa884c79..7f82cf8bf 100644 --- a/lib/CustomFields/components/FieldAccordion/view-sections/SelectDropdownSection.js +++ b/lib/CustomFields/components/FieldAccordion/view-sections/SelectDropdownSection.js @@ -12,7 +12,7 @@ import { import { fieldTypes } from '../../../constants'; const propTypes = { - helpText: PropTypes.string.isRequired, + helpText: PropTypes.string, name: PropTypes.string.isRequired, required: PropTypes.bool.isRequired, selectField: PropTypes.shape({ @@ -32,7 +32,7 @@ const SelectDropdownSection = props => { <> - + { props.helpText && } diff --git a/lib/CustomFields/components/FieldAccordion/view-sections/TextboxSection.js b/lib/CustomFields/components/FieldAccordion/view-sections/TextboxSection.js index 4deec1f80..d6b3222be 100644 --- a/lib/CustomFields/components/FieldAccordion/view-sections/TextboxSection.js +++ b/lib/CustomFields/components/FieldAccordion/view-sections/TextboxSection.js @@ -10,7 +10,7 @@ import { } from './shared-values'; const propTypes = { - helpText: PropTypes.string.isRequired, + helpText: PropTypes.string, name: PropTypes.string.isRequired, required: PropTypes.bool.isRequired, }; @@ -18,7 +18,7 @@ const propTypes = { const TextboxSection = props => ( - + { props.helpText && } ); diff --git a/lib/CustomFields/components/FieldAccordion/view-sections/shared-values/HelpTextValue.js b/lib/CustomFields/components/FieldAccordion/view-sections/shared-values/HelpTextValue.js index 54d273c33..4569102d1 100644 --- a/lib/CustomFields/components/FieldAccordion/view-sections/shared-values/HelpTextValue.js +++ b/lib/CustomFields/components/FieldAccordion/view-sections/shared-values/HelpTextValue.js @@ -10,7 +10,7 @@ import { const propTypes = { value: PropTypes.string.isRequired }; const HelpTextValue = ({ value }) => ( - value.length + value?.length ? ( { }); it('should show all visible custom fields', () => { - expect(editCustomFields.customFields().length).to.equal(6); + expect(editCustomFields.customFields().length).to.equal(7); }); describe('when Single Select field has a default option', () => { diff --git a/lib/CustomFields/pages/EditCustomFieldsSettings/tests/EditCustomFieldsSettings-test.js b/lib/CustomFields/pages/EditCustomFieldsSettings/tests/EditCustomFieldsSettings-test.js index be2058cd6..9cedbafb0 100644 --- a/lib/CustomFields/pages/EditCustomFieldsSettings/tests/EditCustomFieldsSettings-test.js +++ b/lib/CustomFields/pages/EditCustomFieldsSettings/tests/EditCustomFieldsSettings-test.js @@ -225,9 +225,9 @@ describe('EditCustomFieldsSettings', () => { describe('when creating a custom field with options', () => { beforeEach(async () => { await editCustomFields.addFieldButton.selectCustomFieldType(2); - await editCustomFields.customFields(6).fillName('Test field'); - await editCustomFields.customFields(6).options(0).fillOptionName('beta'); - await editCustomFields.customFields(6).options(1).fillOptionName('alpha'); + await editCustomFields.customFields(7).fillName('Test field'); + await editCustomFields.customFields(7).options(0).fillOptionName('beta'); + await editCustomFields.customFields(7).options(1).fillOptionName('alpha'); await editCustomFields.save(); }); @@ -237,7 +237,7 @@ describe('EditCustomFieldsSettings', () => { const { name, selectField, - } = body.customFields[6]; + } = body.customFields[7]; expect({ name, selectField }).to.deep.equal({ name: 'Test field', diff --git a/lib/CustomFields/pages/ViewCustomFieldsRecord/tests/ViewCustomFieldsRecord-test.js b/lib/CustomFields/pages/ViewCustomFieldsRecord/tests/ViewCustomFieldsRecord-test.js index 274a4e85e..665a4d7fb 100644 --- a/lib/CustomFields/pages/ViewCustomFieldsRecord/tests/ViewCustomFieldsRecord-test.js +++ b/lib/CustomFields/pages/ViewCustomFieldsRecord/tests/ViewCustomFieldsRecord-test.js @@ -64,7 +64,7 @@ describe('ViewCustomFieldsRecord', () => { }); it('should display current number of fields', () => { - expect(viewCustomFields.fields().length).to.equal(6); + expect(viewCustomFields.fields().length).to.equal(7); }); it('should display value for fields with a value', () => { diff --git a/lib/CustomFields/pages/ViewCustomFieldsSettings/tests/ViewCustomFieldsSettings-test.js b/lib/CustomFields/pages/ViewCustomFieldsSettings/tests/ViewCustomFieldsSettings-test.js index 81db0aa91..84b54dbf8 100644 --- a/lib/CustomFields/pages/ViewCustomFieldsSettings/tests/ViewCustomFieldsSettings-test.js +++ b/lib/CustomFields/pages/ViewCustomFieldsSettings/tests/ViewCustomFieldsSettings-test.js @@ -141,4 +141,14 @@ describe('ViewCustomFieldsSettings', () => { expect(disabledStates).to.deep.equal([true, true]); }); }); + + describe('when custom field is checkbox', () => { + it('should display checkbox name', () => { + expect(viewCustomFields.customFields(6).fields(0).value).to.equal('Checkbox'); + }); + + it('should not show help text section', () => { + expect(viewCustomFields.customFields(6).fields(1).value).to.equal('checkbox help text'); + }); + }); }); diff --git a/lib/CustomFields/pages/ViewCustomFieldsSettings/tests/interactor.js b/lib/CustomFields/pages/ViewCustomFieldsSettings/tests/interactor.js index 86cd997b2..586362d05 100644 --- a/lib/CustomFields/pages/ViewCustomFieldsSettings/tests/interactor.js +++ b/lib/CustomFields/pages/ViewCustomFieldsSettings/tests/interactor.js @@ -10,7 +10,7 @@ import { import MultiColumnListInteractor from '@folio/stripes-components/lib/MultiColumnList/tests/interactor'; export default interactor(class ViewCustomFieldsSettings { - customFields = collection('[data-test-accordion-section', { + customFields = collection('[data-test-accordion-section]', { openAccordion: triggerable('[class^="defaultCollapseButton"]'), fields: collection('[class^="col-"]', { label: text('[class^="kvLabel--"]'), diff --git a/tests/network/config.js b/tests/network/config.js index e7f98b539..cafec5473 100644 --- a/tests/network/config.js +++ b/tests/network/config.js @@ -226,7 +226,7 @@ export default function config() { } } }, { - 'id': '6', + 'id':'6', 'name': 'Date', 'refId': 'date1', 'type': 'DATE_PICKER', @@ -235,6 +235,20 @@ export default function config() { 'required': false, 'order': 6, 'helpText': 'Enter a date here', + }, { + 'id': '7', + 'name': 'Checkbox', + 'refId': 'cb_1', + 'type': 'SINGLE_CHECKBOX', + 'entityType': 'user', + 'visible': true, + 'required': false, + 'isRepeatable': false, + 'order': 7, + 'helpText': 'checkbox help text', + 'checkboxField': { + 'default': false + }, }], }); From 9fa57740f9cf46e85ac097be6bcd5f036adb6d56 Mon Sep 17 00:00:00 2001 From: FOLIO Translations Bot <38661258+folio-translations@users.noreply.github.com> Date: Tue, 23 Jan 2024 21:37:41 -0500 Subject: [PATCH 06/26] Lokalise: updates --- translations/stripes-smart-components/ar.json | 3 ++- translations/stripes-smart-components/ber.json | 3 ++- translations/stripes-smart-components/ca.json | 3 ++- translations/stripes-smart-components/cs_CZ.json | 7 ++++--- translations/stripes-smart-components/da.json | 3 ++- translations/stripes-smart-components/de.json | 3 ++- translations/stripes-smart-components/en_GB.json | 3 ++- translations/stripes-smart-components/en_SE.json | 3 ++- translations/stripes-smart-components/en_US.json | 3 ++- translations/stripes-smart-components/es.json | 3 ++- translations/stripes-smart-components/es_419.json | 3 ++- translations/stripes-smart-components/es_ES.json | 3 ++- translations/stripes-smart-components/fr.json | 3 ++- translations/stripes-smart-components/fr_FR.json | 3 ++- translations/stripes-smart-components/he.json | 3 ++- translations/stripes-smart-components/hi_IN.json | 3 ++- translations/stripes-smart-components/hu.json | 3 ++- translations/stripes-smart-components/it_IT.json | 3 ++- translations/stripes-smart-components/ja.json | 3 ++- translations/stripes-smart-components/ko.json | 3 ++- translations/stripes-smart-components/nb.json | 3 ++- translations/stripes-smart-components/nn.json | 3 ++- translations/stripes-smart-components/pl.json | 13 +++++++------ translations/stripes-smart-components/pt_BR.json | 3 ++- translations/stripes-smart-components/pt_PT.json | 3 ++- translations/stripes-smart-components/ru.json | 3 ++- translations/stripes-smart-components/sk.json | 3 ++- translations/stripes-smart-components/sv.json | 3 ++- translations/stripes-smart-components/ur.json | 3 ++- translations/stripes-smart-components/zh_CN.json | 3 ++- translations/stripes-smart-components/zh_TW.json | 3 ++- 31 files changed, 69 insertions(+), 38 deletions(-) diff --git a/translations/stripes-smart-components/ar.json b/translations/stripes-smart-components/ar.json index 41d177de5..f14d50589 100644 --- a/translations/stripes-smart-components/ar.json +++ b/translations/stripes-smart-components/ar.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/ber.json b/translations/stripes-smart-components/ber.json index 5bba99256..68e1a00eb 100644 --- a/translations/stripes-smart-components/ber.json +++ b/translations/stripes-smart-components/ber.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/ca.json b/translations/stripes-smart-components/ca.json index 5bba99256..68e1a00eb 100644 --- a/translations/stripes-smart-components/ca.json +++ b/translations/stripes-smart-components/ca.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/cs_CZ.json b/translations/stripes-smart-components/cs_CZ.json index bc4d77c43..ab1c41099 100644 --- a/translations/stripes-smart-components/cs_CZ.json +++ b/translations/stripes-smart-components/cs_CZ.json @@ -148,7 +148,7 @@ "addressEdit.label.addressType": "Typ adresy", "addressEdit.label.addressLine1": "Řádek adresy 1", "addressEdit.label.addressLine2": "Řádek adresy 2", - "addressEdit.label.stateRegion": "Stát/Prov/Region", + "addressEdit.label.stateRegion": "Stát/Prov/Oblast", "addressEdit.label.zipCode": "PSČ", "addressEdit.label.country": "Země", "addressEdit.label.city": "Město", @@ -276,6 +276,7 @@ "editableList.actionsColumnHeader": "Akce", "customFields.option.deleteLabel": "Smazat", "advancedSearch": "Rozšířené vyhledávání", - "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termCreated": "{type} {term} byl úspěšně vytvořen", + "cv.termUpdated": "{type} {term} byl úspěšně aktualizován", + "customFields.fieldTypes.DATE_PICKER": "Výběr data" } \ No newline at end of file diff --git a/translations/stripes-smart-components/da.json b/translations/stripes-smart-components/da.json index cd7e32448..0e576b923 100644 --- a/translations/stripes-smart-components/da.json +++ b/translations/stripes-smart-components/da.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/de.json b/translations/stripes-smart-components/de.json index db6bfaf4d..2d019245a 100644 --- a/translations/stripes-smart-components/de.json +++ b/translations/stripes-smart-components/de.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Löschen", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/en_GB.json b/translations/stripes-smart-components/en_GB.json index 5bba99256..68e1a00eb 100644 --- a/translations/stripes-smart-components/en_GB.json +++ b/translations/stripes-smart-components/en_GB.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/en_SE.json b/translations/stripes-smart-components/en_SE.json index 5bba99256..68e1a00eb 100644 --- a/translations/stripes-smart-components/en_SE.json +++ b/translations/stripes-smart-components/en_SE.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/en_US.json b/translations/stripes-smart-components/en_US.json index 5bba99256..68e1a00eb 100644 --- a/translations/stripes-smart-components/en_US.json +++ b/translations/stripes-smart-components/en_US.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/es.json b/translations/stripes-smart-components/es.json index 15147fb65..f81964702 100644 --- a/translations/stripes-smart-components/es.json +++ b/translations/stripes-smart-components/es.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/es_419.json b/translations/stripes-smart-components/es_419.json index 56f99290f..f17cb8f5a 100644 --- a/translations/stripes-smart-components/es_419.json +++ b/translations/stripes-smart-components/es_419.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Borrar", "advancedSearch": "Búsqueda Avanzada", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/es_ES.json b/translations/stripes-smart-components/es_ES.json index ac2e0523b..226c96ee8 100644 --- a/translations/stripes-smart-components/es_ES.json +++ b/translations/stripes-smart-components/es_ES.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Búsqueda avanzada", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/fr.json b/translations/stripes-smart-components/fr.json index 5bba99256..68e1a00eb 100644 --- a/translations/stripes-smart-components/fr.json +++ b/translations/stripes-smart-components/fr.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/fr_FR.json b/translations/stripes-smart-components/fr_FR.json index 3afaf1239..4d9c9354c 100644 --- a/translations/stripes-smart-components/fr_FR.json +++ b/translations/stripes-smart-components/fr_FR.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Supprimer", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/he.json b/translations/stripes-smart-components/he.json index c762d2a22..e3bff7bfa 100644 --- a/translations/stripes-smart-components/he.json +++ b/translations/stripes-smart-components/he.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/hi_IN.json b/translations/stripes-smart-components/hi_IN.json index 5bba99256..68e1a00eb 100644 --- a/translations/stripes-smart-components/hi_IN.json +++ b/translations/stripes-smart-components/hi_IN.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/hu.json b/translations/stripes-smart-components/hu.json index e14997c7a..59306d6f4 100644 --- a/translations/stripes-smart-components/hu.json +++ b/translations/stripes-smart-components/hu.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/it_IT.json b/translations/stripes-smart-components/it_IT.json index e2aaf7e77..309aead60 100644 --- a/translations/stripes-smart-components/it_IT.json +++ b/translations/stripes-smart-components/it_IT.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/ja.json b/translations/stripes-smart-components/ja.json index 7f3906807..374fb7ee3 100644 --- a/translations/stripes-smart-components/ja.json +++ b/translations/stripes-smart-components/ja.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "削除", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "{type} {term} は正常に更新されました" + "cv.termUpdated": "{type} {term} は正常に更新されました", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/ko.json b/translations/stripes-smart-components/ko.json index 7ad67f4f0..c3df9387c 100644 --- a/translations/stripes-smart-components/ko.json +++ b/translations/stripes-smart-components/ko.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "삭제", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/nb.json b/translations/stripes-smart-components/nb.json index 5bba99256..68e1a00eb 100644 --- a/translations/stripes-smart-components/nb.json +++ b/translations/stripes-smart-components/nb.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/nn.json b/translations/stripes-smart-components/nn.json index 5bba99256..68e1a00eb 100644 --- a/translations/stripes-smart-components/nn.json +++ b/translations/stripes-smart-components/nn.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/pl.json b/translations/stripes-smart-components/pl.json index 61f1a151a..64629d48f 100644 --- a/translations/stripes-smart-components/pl.json +++ b/translations/stripes-smart-components/pl.json @@ -12,7 +12,7 @@ "cddd.header.itemStatus": "Status egzemplarza", "cddd.header.currentDueDate": "Aktualny termin zwrotu", "cddd.header.barcode": "Kod kreskowy", - "cddd.header.loanPolicy": "Polityka wypożyczania", + "cddd.header.loanPolicy": "Reguła wypożyczania", "cddd.warning.dueDateAfterPatronExpiration": "Nowy termin zwrotu jest po dacie ważności konta czytelnika.", "cddd.warning.dueDateWhenLibraryClosed": "Nowy termin zwrotu wypada w czasie, gdy biblioteka jest zamknięta.", "cddd.warning.dueDateInPast": "Nowy termin zwrotu jest w przeszłości.", @@ -60,7 +60,7 @@ "permissionsDoNotAllowAccess": "Przepraszamy - Twoje uprawnienia nie pozwalają na dostęp do tej strony.", "searchResults": "{objectName} wynik wyszukiwania", "searchReturnedResults": "Wyszukiwanie zwróciło {count, number} {count, plural, one { wynik } other { wyników }}", - "resetAll": "Zresetuj wszystkie", + "resetAll": "Resetuj wszystko", "whoAreYouActingAs": "Jako kto działasz?", "self": "Własny", "isActingAs": "{name} działa jako:", @@ -201,7 +201,7 @@ "customFields.settings.accordion.hidden": "(Ukryty)", "customFields.recordAccordion.defaultName": "Pola niestandardowe", "customFields.errorOccurred": "Nie można zaktualizować z powodu błędu modułu. Proszę, spróbuj ponownie. Jeśli problem będzie się powtarzał, skontaktuj się z administratorem systemu.", - "cddd.header.effectiveCallNumber": "Ciąg znaków efektywnej sygnatury", + "cddd.header.effectiveCallNumber": "Sygnatura", "cddd.itemDeclaredLost": "Nie udało się zmienić terminu zwrotu: Zgłoszono zagubienie egzemplarza", "cddd.itemDeclaredLostWarning": "Zgłoszono zagubienie egzemplarza", "customFields.required.checked": "Tak", @@ -266,7 +266,7 @@ "notes.displayAsPopup.users": "Users app", "notes.popupModal.label": "Note for patron", "notes.popupModal.delete": "Delete note", - "notes.close": "Close", + "notes.close": "Zamknij", "customFields.noCustomFieldsFound": "No custom fields found", "customFields.fieldValue.whitespace": "Whitespace only character(s) is not allowed.", "cddd.selectAllLoans": "Select all loans", @@ -276,6 +276,7 @@ "editableList.actionsColumnHeader": "Akcje", "customFields.option.deleteLabel": "Delete", "advancedSearch": "Wyszukiwanie zaawansowane", - "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termCreated": "{type} {term} został pomyślnie utworzony", + "cv.termUpdated": "{type} {term} został pomyślnie zaktualizowany ", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/pt_BR.json b/translations/stripes-smart-components/pt_BR.json index 14d30094e..a51c628c7 100644 --- a/translations/stripes-smart-components/pt_BR.json +++ b/translations/stripes-smart-components/pt_BR.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Excluir", "advancedSearch": "Busca avançada", "cv.termCreated": "O {type} {term} foi criado com sucesso", - "cv.termUpdated": "O {type} {term} foi atualizado com sucesso" + "cv.termUpdated": "O {type} {term} foi atualizado com sucesso", + "customFields.fieldTypes.DATE_PICKER": "Seletor de data" } \ No newline at end of file diff --git a/translations/stripes-smart-components/pt_PT.json b/translations/stripes-smart-components/pt_PT.json index f4424c142..19c15c11f 100644 --- a/translations/stripes-smart-components/pt_PT.json +++ b/translations/stripes-smart-components/pt_PT.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/ru.json b/translations/stripes-smart-components/ru.json index ffd866127..5aa43f37c 100644 --- a/translations/stripes-smart-components/ru.json +++ b/translations/stripes-smart-components/ru.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/sk.json b/translations/stripes-smart-components/sk.json index 5bba99256..68e1a00eb 100644 --- a/translations/stripes-smart-components/sk.json +++ b/translations/stripes-smart-components/sk.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/sv.json b/translations/stripes-smart-components/sv.json index 5bba99256..68e1a00eb 100644 --- a/translations/stripes-smart-components/sv.json +++ b/translations/stripes-smart-components/sv.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/ur.json b/translations/stripes-smart-components/ur.json index 81a62e4ce..4dd026a65 100644 --- a/translations/stripes-smart-components/ur.json +++ b/translations/stripes-smart-components/ur.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/zh_CN.json b/translations/stripes-smart-components/zh_CN.json index 6cd343f9f..21c9a4e01 100644 --- a/translations/stripes-smart-components/zh_CN.json +++ b/translations/stripes-smart-components/zh_CN.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "删除", "advancedSearch": "高级搜索", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file diff --git a/translations/stripes-smart-components/zh_TW.json b/translations/stripes-smart-components/zh_TW.json index 1411ca3eb..4bc41c37e 100644 --- a/translations/stripes-smart-components/zh_TW.json +++ b/translations/stripes-smart-components/zh_TW.json @@ -277,5 +277,6 @@ "customFields.option.deleteLabel": "Delete", "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated" + "cv.termUpdated": "The {type} {term} was successfully updated", + "customFields.fieldTypes.DATE_PICKER": "Date picker" } \ No newline at end of file From b42d83a61f102978cb270420e8c9c132100754ce Mon Sep 17 00:00:00 2001 From: Zak Burke Date: Thu, 25 Jan 2024 11:39:52 -0500 Subject: [PATCH 07/26] STSMACOM-802 UserName must handle sparse data (#1433) Previously, `` threw an NPE if the retrieved object did not contain a `personal` attribute. Now it is robust to sparse data, returning `lastname, firstname`, or `lastname`, or `username` or an empty string, depending on what values are present and non-empty. Refs STSMACOM-802 --- CHANGELOG.md | 1 + lib/UserName/README.md | 20 ++++++++++++ lib/UserName/UserName.js | 17 ++++++++-- lib/UserName/tests/UserName-test.js | 49 +++++++++++++++++++++++++++++ 4 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 lib/UserName/README.md diff --git a/CHANGELOG.md b/CHANGELOG.md index fdaf0f62b..f26d5bb88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ * `` - last updated by column - show "System" when items are created by system user. Refs STSMACOM-797. * Add field type `DATE_PICKER` to custom fields components. Refs STSMACOM-800. * Make `helpText` prop as optional for all types of custom field components. Refs STSMACOM-799. +* `` must handle sparse data. Refs STSMACOM-802. ## [9.0.0](https://github.com/folio-org/stripes-smart-components/tree/v9.0.0) (2023-10-11) [Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v8.0.0...v9.0.0) diff --git a/lib/UserName/README.md b/lib/UserName/README.md new file mode 100644 index 000000000..6c4af7aea --- /dev/null +++ b/lib/UserName/README.md @@ -0,0 +1,20 @@ +# UserName + +Retrieve a user record, then return its displayable name wrapped in ``. Return "lastname, firstname", or "lastname", or "username" based on which values are provided and non-empty. + +## Usage + +```js + import { useStripes } from '@folio/stripes/core'; + import { UserName } from '@folio/stripes/smart-components'; + +const Foo = ({ userId }) => { + const { connect } = useStripes(); + const ConnectedUserName = connect(UserName); + + return +} + +export default Foo; +``` + diff --git a/lib/UserName/UserName.js b/lib/UserName/UserName.js index 520f62b9a..240177e61 100644 --- a/lib/UserName/UserName.js +++ b/lib/UserName/UserName.js @@ -10,6 +10,7 @@ class UserName extends React.Component { }); static propTypes = { + // id is present in the manifest id: PropTypes.string.isRequired, // eslint-disable-line resources: PropTypes.shape({ user: PropTypes.object, @@ -20,8 +21,20 @@ class UserName extends React.Component { const { user } = this.props.resources; if (!user || !user.hasLoaded || user.records.length !== 1) return null; - const { firstName, lastName } = user.records[0].personal; - const displayName = firstName ? `${lastName}, ${firstName}` : lastName; + let firstName = ''; + let lastName = ''; + if (user.records[0].personal) { + ({ firstName, lastName } = user.records[0].personal); + } + + let displayName; + if (lastName && firstName) { + displayName = `${lastName}, ${firstName}`; + } else if (lastName) { + displayName = lastName; + } else if (user.records[0].username) { + displayName = user.records[0].username; + } return {displayName}; } diff --git a/lib/UserName/tests/UserName-test.js b/lib/UserName/tests/UserName-test.js index f3e49e6fc..ea292133a 100644 --- a/lib/UserName/tests/UserName-test.js +++ b/lib/UserName/tests/UserName-test.js @@ -26,6 +26,7 @@ describe('UserName', () => { describe('when and are present', () => { beforeEach(async () => { renderComponent({ + id: '1', resources: { user: { hasLoaded: true, @@ -48,6 +49,7 @@ describe('UserName', () => { describe('when only is present', () => { beforeEach(() => { renderComponent({ + id: '1', resources: { user: { hasLoaded: true, @@ -66,9 +68,56 @@ describe('UserName', () => { }); }); + describe('when only is present', () => { + const firstName = 'First'; + const username = 'barbenheimer'; + beforeEach(() => { + renderComponent({ + id: '1', + resources: { + user: { + hasLoaded: true, + records: [{ + username, + personal: { + firstName, + } + }] + } + } + }); + }); + + it('should only display ', () => { + expect(userName.label.has({ text: username })); + }); + }); + + describe('when is absent', () => { + const username = 'John Jacob Jingle Heimer Schmidt'; + beforeEach(() => { + renderComponent({ + id: '1', + resources: { + user: { + hasLoaded: true, + records: [{ + username, + }] + } + } + }); + }); + + it('should display ', () => { + expect(userName.label.has({ text: username })); + }); + }); + describe('when no user is present', () => { beforeEach(() => { renderComponent({ + id: '1', resources: { user: { hasLoaded: true From 4f95fcdd7e049fc8d8fbabebc8fe6673bbbac666 Mon Sep 17 00:00:00 2001 From: John Coburn Date: Fri, 26 Jan 2024 14:34:16 -0600 Subject: [PATCH 08/26] STSMACOM-803 Upgrade stylelint package, assocated dependencies (#1434) * upgrade stylelint package, assocated dependencies * log changes --- .stylelintrc | 3 + CHANGELOG.md | 1 + package.json | 4 +- yarn.lock | 433 ++++++++++++++++++++------------------------------- 4 files changed, 177 insertions(+), 264 deletions(-) diff --git a/.stylelintrc b/.stylelintrc index ea7a0de65..6632d4b25 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -2,6 +2,9 @@ "extends": "stylelint-config-standard", "rules": { "import-notation": "string", + "value-keyword-case": ["lower", { + "ignoreProperties": ["composes"] + }], "selector-pseudo-class-no-unknown": [true, { "ignorePseudoClasses": [ "export", diff --git a/CHANGELOG.md b/CHANGELOG.md index f26d5bb88..378f4d9da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ * `` - last updated by column - show "System" when items are created by system user. Refs STSMACOM-797. * Add field type `DATE_PICKER` to custom fields components. Refs STSMACOM-800. * Make `helpText` prop as optional for all types of custom field components. Refs STSMACOM-799. +* Upgrade `stylelint` and associated dependencies. Refs STSMACOM-803. * `` must handle sparse data. Refs STSMACOM-802. ## [9.0.0](https://github.com/folio-org/stripes-smart-components/tree/v9.0.0) (2023-10-11) diff --git a/package.json b/package.json index 3f2dac0e8..6913422e7 100644 --- a/package.json +++ b/package.json @@ -73,8 +73,8 @@ "regenerator-runtime": "^0.13.5", "rxjs": "^6.6.3", "sinon": "^6.3.4", - "stylelint": "^15.6.2", - "stylelint-config-standard": "^33.0.0", + "stylelint": "^16.2.0", + "stylelint-config-standard": "^36.0.0", "stylelint-junit-formatter": "^0.2.2" }, "dependencies": { diff --git a/yarn.lock b/yarn.lock index 05af2411e..56acca33f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1283,17 +1283,17 @@ "@csstools/color-helpers" "^4.0.0" "@csstools/css-calc" "^1.1.6" -"@csstools/css-parser-algorithms@^2.2.0", "@csstools/css-parser-algorithms@^2.3.1", "@csstools/css-parser-algorithms@^2.5.0": +"@csstools/css-parser-algorithms@^2.2.0", "@csstools/css-parser-algorithms@^2.5.0": version "2.5.0" resolved "https://registry.yarnpkg.com/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.5.0.tgz#0c03cd5418a9f404a05ff2ffcb1b69d04e8ec532" integrity sha512-abypo6m9re3clXA00eu5syw+oaPHbJTPapu9C4pzNsJ4hdZDzushT50Zhu+iIYXgEe1CxnRMn7ngsbV+MLrlpQ== -"@csstools/css-tokenizer@^2.1.1", "@csstools/css-tokenizer@^2.2.0", "@csstools/css-tokenizer@^2.2.3": +"@csstools/css-tokenizer@^2.1.1", "@csstools/css-tokenizer@^2.2.3": version "2.2.3" resolved "https://registry.yarnpkg.com/@csstools/css-tokenizer/-/css-tokenizer-2.2.3.tgz#b099d543ea57b64f495915a095ead583866c50c6" integrity sha512-pp//EvZ9dUmGuGtG1p+n17gTHEOqu9jO+FiCUjNN3BDmyhdA2Jq9QsVeR7K8/2QCK17HSsioPlTW9ZkzoWb3Lg== -"@csstools/media-query-list-parser@^2.1.1", "@csstools/media-query-list-parser@^2.1.4": +"@csstools/media-query-list-parser@^2.1.1", "@csstools/media-query-list-parser@^2.1.7": version "2.1.7" resolved "https://registry.yarnpkg.com/@csstools/media-query-list-parser/-/media-query-list-parser-2.1.7.tgz#a4836e3dbd693081a30b32ce9c2a781e1be16788" integrity sha512-lHPKJDkPUECsyAvD60joYfDmp8UERYxHGkFfyLJFTVK/ERJe0sVlIFLXU5XFxdjNDTerp5L4KeaKG+Z5S94qxQ== @@ -1320,7 +1320,7 @@ resolved "https://registry.yarnpkg.com/@csstools/selector-specificity/-/selector-specificity-2.2.0.tgz#2cbcf822bf3764c9658c4d2e568bd0c0cb748016" integrity sha512-+OJ9konv95ClSTOJCmMZqpd5+YGsB2S+x6w3E1oaM8UuR5j8nTNHYSz8c9BEPGDOCMQYIEEGlVPj/VY64iTbGw== -"@csstools/selector-specificity@^3.0.0": +"@csstools/selector-specificity@^3.0.1": version "3.0.1" resolved "https://registry.yarnpkg.com/@csstools/selector-specificity/-/selector-specificity-3.0.1.tgz#d84597fbc0f897240c12fc0a31e492b036c70e40" integrity sha512-NPljRHkq4a14YzZ3YD406uaxh7s0g6eAq3L9aLOWywoqe8PkYamAvtsh7KNX6c++ihDrJ0RiU+/z7rGnhlZ5ww== @@ -1995,6 +1995,18 @@ "@interactors/core" "1.0.0-rc1.5" "@interactors/globals" "1.0.0-rc1.2" +"@isaacs/cliui@^8.0.2": + version "8.0.2" + resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" + integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== + dependencies: + string-width "^5.1.2" + string-width-cjs "npm:string-width@^4.2.0" + strip-ansi "^7.0.1" + strip-ansi-cjs "npm:strip-ansi@^6.0.1" + wrap-ansi "^8.1.0" + wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -2215,6 +2227,11 @@ dependencies: "@octokit/openapi-types" "^18.0.0" +"@pkgjs/parseargs@^0.11.0": + version "0.11.0" + resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" + integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== + "@pmmmwh/react-refresh-webpack-plugin@^0.5.4": version "0.5.11" resolved "https://registry.yarnpkg.com/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.11.tgz#7c2268cedaa0644d677e8c4f377bc8fb304f714a" @@ -2588,11 +2605,6 @@ dependencies: "@types/node" "*" -"@types/minimist@^1.2.2": - version "1.2.5" - resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.5.tgz#ec10755e871497bcd83efe927e43ec46e8c0747e" - integrity sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag== - "@types/node@*", "@types/node@>=10.0.0": version "20.10.6" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.6.tgz#a3ec84c22965802bf763da55b2394424f22bfbb5" @@ -2610,11 +2622,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.63.tgz#1788fa8da838dbb5f9ea994b834278205db6ca2b" integrity sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ== -"@types/normalize-package-data@^2.4.0": - version "2.4.4" - resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz#56e2cc26c397c038fab0e3a917a12d5c5909e901" - integrity sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA== - "@types/prop-types@*", "@types/prop-types@^15.7.3": version "15.7.11" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.11.tgz#2596fb352ee96a1379c657734d4b913a613ad563" @@ -3276,11 +3283,6 @@ arraybuffer.prototype.slice@^1.0.2: is-array-buffer "^3.0.2" is-shared-array-buffer "^1.0.2" -arrify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - integrity sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA== - asn1.js@^5.2.0: version "5.4.1" resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-5.4.1.tgz#11a980b84ebb91781ce35b0fdc2ee294e3783f07" @@ -3845,22 +3847,12 @@ camel-case@^4.1.2: pascal-case "^3.1.2" tslib "^2.0.3" -camelcase-keys@^7.0.0: - version "7.0.2" - resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-7.0.2.tgz#d048d8c69448745bb0de6fc4c1c52a30dfbe7252" - integrity sha512-Rjs1H+A9R+Ig+4E/9oyB66UC5Mj9Xq3N//vcLf2WzgdTi/3gUu3Z9KoqmlrEG4VuuLK8wJHofxzdQXz/knhiYg== - dependencies: - camelcase "^6.3.0" - map-obj "^4.1.0" - quick-lru "^5.1.1" - type-fest "^1.2.1" - camelcase@^5.0.0, camelcase@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -camelcase@^6.0.0, camelcase@^6.2.0, camelcase@^6.3.0: +camelcase@^6.0.0, camelcase@^6.2.0: version "6.3.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== @@ -4370,7 +4362,7 @@ cors@~2.8.5: object-assign "^4" vary "^1" -cosmiconfig@^8.1.3, cosmiconfig@^8.2.0, cosmiconfig@^8.3.5: +cosmiconfig@^8.1.3, cosmiconfig@^8.3.5: version "8.3.6" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-8.3.6.tgz#060a2b871d66dba6c8538ea1118ba1ac16f5fae3" integrity sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA== @@ -4380,6 +4372,16 @@ cosmiconfig@^8.1.3, cosmiconfig@^8.2.0, cosmiconfig@^8.3.5: parse-json "^5.2.0" path-type "^4.0.0" +cosmiconfig@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-9.0.0.tgz#34c3fc58287b915f3ae905ab6dc3de258b55ad9d" + integrity sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg== + dependencies: + env-paths "^2.2.1" + import-fresh "^3.3.0" + js-yaml "^4.1.0" + parse-json "^5.2.0" + create-ecdh@^4.0.0: version "4.0.4" resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e" @@ -4775,15 +4777,7 @@ debug@^3.1.0, debug@^3.2.7: dependencies: ms "^2.1.1" -decamelize-keys@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.1.tgz#04a2d523b2f18d80d0158a43b895d56dff8d19d8" - integrity sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg== - dependencies: - decamelize "^1.1.0" - map-obj "^1.0.0" - -decamelize@^1.1.0, decamelize@^1.2.0: +decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== @@ -4793,11 +4787,6 @@ decamelize@^4.0.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== -decamelize@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-5.0.1.tgz#db11a92e58c741ef339fb0a2868d8a06a9a7b1e9" - integrity sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA== - decode-uri-component@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" @@ -5356,6 +5345,11 @@ entities@^4.2.0, entities@^4.4.0: resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== +env-paths@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" + integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== + error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -6063,7 +6057,7 @@ fast-fifo@^1.1.0, fast-fifo@^1.2.0: resolved "https://registry.yarnpkg.com/fast-fifo/-/fast-fifo-1.3.2.tgz#286e31de96eb96d38a97899815740ba2a4f3640c" integrity sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ== -fast-glob@^3.2.7, fast-glob@^3.2.9, fast-glob@^3.3.1: +fast-glob@^3.2.7, fast-glob@^3.2.9, fast-glob@^3.3.1, fast-glob@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== @@ -6149,12 +6143,12 @@ file-entry-cache@^6.0.1: dependencies: flat-cache "^3.0.4" -file-entry-cache@^7.0.0: - version "7.0.2" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-7.0.2.tgz#2d61bb70ba89b9548e3035b7c9173fe91deafff0" - integrity sha512-TfW7/1iI4Cy7Y8L6iqNdZQVvdXn0f8B4QcIXmkIbtTIe/Okm/nSlHb4IwGzRVOd3WfSieCgvf5cMzEfySAIl0g== +file-entry-cache@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz#7787bddcf1131bffb92636c69457bbc0edd6d81f" + integrity sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ== dependencies: - flat-cache "^3.2.0" + flat-cache "^4.0.0" filing-cabinet@^4.1.6: version "4.1.6" @@ -6338,7 +6332,7 @@ first-match@~0.0.1: resolved "https://registry.yarnpkg.com/first-match/-/first-match-0.0.1.tgz#a60ec642700f0f437234ebb7ec3f382476e542fd" integrity sha512-VvKbnaxrC0polTFDC+teKPTdl2mn6B/KUW+WB3C9RzKDeNwbzfLdnUz3FxC+tnjvus6bI0jWrWicQyVIPdS37A== -flat-cache@^3.0.4, flat-cache@^3.2.0: +flat-cache@^3.0.4: version "3.2.0" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee" integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== @@ -6347,6 +6341,15 @@ flat-cache@^3.0.4, flat-cache@^3.2.0: keyv "^4.5.3" rimraf "^3.0.2" +flat-cache@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-4.0.0.tgz#d12437636f83bb8a12b8f300c36fd1614e1c7224" + integrity sha512-EryKbCE/wxpxKniQlyas6PY1I9vwtF3uCBweX+N8KYTCn3Y12RTGtQAJ/bd5pl7kxUAc8v/R3Ake/N17OZiFqA== + dependencies: + flatted "^3.2.9" + keyv "^4.5.4" + rimraf "^5.0.5" + flat@^5.0.2: version "5.0.2" resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" @@ -6384,6 +6387,14 @@ foreground-child@^2.0.0: cross-spawn "^7.0.0" signal-exit "^3.0.2" +foreground-child@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.1.1.tgz#1d173e776d75d2772fed08efe4a0de1ea1b12d0d" + integrity sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^4.0.1" + forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" @@ -6651,6 +6662,17 @@ glob@7.2.0: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^10.3.7: + version "10.3.10" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.3.10.tgz#0351ebb809fd187fe421ab96af83d3a70715df4b" + integrity sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g== + dependencies: + foreground-child "^3.1.0" + jackspeak "^2.3.5" + minimatch "^9.0.1" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-scurry "^1.10.1" + glob@^7.0.0, glob@^7.0.5, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.1.7, glob@^7.2.3: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" @@ -6833,11 +6855,6 @@ handlebars@^4.7.7: optionalDependencies: uglify-js "^3.1.4" -hard-rejection@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" - integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== - has-bigints@^1.0.1, has-bigints@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" @@ -6970,13 +6987,6 @@ hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.1.0, hoist-non-react- dependencies: react-is "^16.7.0" -hosted-git-info@^4.0.1: - version "4.1.0" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.1.0.tgz#827b82867e9ff1c8d0c4d9d53880397d2c86d224" - integrity sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA== - dependencies: - lru-cache "^6.0.0" - html-entities@^2.1.0: version "2.4.0" resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-2.4.0.tgz#edd0cee70402584c8c76cc2c0556db09d1f45061" @@ -7131,7 +7141,7 @@ ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.2.0, ignore@^5.2.4: +ignore@^5.2.0, ignore@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.0.tgz#67418ae40d34d6999c95ff56016759c718c82f78" integrity sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg== @@ -7169,11 +7179,6 @@ indent-string@^4.0.0: resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== -indent-string@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-5.0.0.tgz#4fd2980fccaf8622d14c64d694f4cf33c81951a5" - integrity sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg== - inflected@^2.0.2, inflected@^2.0.4: version "2.1.0" resolved "https://registry.yarnpkg.com/inflected/-/inflected-2.1.0.tgz#2816ac17a570bbbc8303ca05bca8bf9b3f959687" @@ -7338,7 +7343,7 @@ is-ci@^3.0.0, is-ci@^3.0.1: dependencies: ci-info "^3.2.0" -is-core-module@^2.13.0, is-core-module@^2.13.1, is-core-module@^2.5.0, is-core-module@^2.8.1: +is-core-module@^2.13.0, is-core-module@^2.13.1, is-core-module@^2.8.1: version "2.13.1" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.1.tgz#ad0d7532c6fea9da1ebdc82742d74525c6273384" integrity sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw== @@ -7436,11 +7441,6 @@ is-path-inside@^3.0.2: resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== -is-plain-obj@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - integrity sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg== - is-plain-obj@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" @@ -7722,6 +7722,15 @@ istanbul-reports@^3.0.2, istanbul-reports@^3.1.4: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" +jackspeak@^2.3.5: + version "2.3.6" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.3.6.tgz#647ecc472238aee4b06ac0e461acc21a8c505ca8" + integrity sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + jest-worker@^27.4.5: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" @@ -8011,14 +8020,14 @@ keyboardjs@~2.5.1: resolved "https://registry.yarnpkg.com/keyboardjs/-/keyboardjs-2.5.1.tgz#2eb5d96bd1028e07136cd71919f607579edca716" integrity sha512-mRf7MQMiFcudADEpPn3vTtl/rtFELo5MAiKA6yH4ShsFsnwwjMrVfaNt6bpYhBDeODs/T5NXwltz4+ktRQyP7A== -keyv@^4.0.0, keyv@^4.5.3: +keyv@^4.0.0, keyv@^4.5.3, keyv@^4.5.4: version "4.5.4" resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== dependencies: json-buffer "3.0.1" -kind-of@^6.0.2, kind-of@^6.0.3: +kind-of@^6.0.2: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== @@ -8319,6 +8328,11 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +"lru-cache@^9.1.1 || ^10.0.0": + version "10.1.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.1.0.tgz#2098d41c2dc56500e6c88584aa656c84de7d0484" + integrity sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag== + lz-string@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.5.0.tgz#c1ab50f77887b712621201ba9fd4e3a6ed099941" @@ -8358,16 +8372,6 @@ make-error@^1.1.1: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== -map-obj@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" - integrity sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg== - -map-obj@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" - integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== - map-stream@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" @@ -8437,23 +8441,10 @@ memory-fs@^0.2.0: resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.2.0.tgz#f2bb25368bc121e391c2520de92969caee0a0290" integrity sha512-+y4mDxU4rvXXu5UDSGCGNiesFmwCHuefGMoPCO1WYucNYj7DsLqrFaa2fXVI0H+NNiPTwwzKwspn9yTZqUGqng== -meow@^10.1.5: - version "10.1.5" - resolved "https://registry.yarnpkg.com/meow/-/meow-10.1.5.tgz#be52a1d87b5f5698602b0f32875ee5940904aa7f" - integrity sha512-/d+PQ4GKmGvM9Bee/DPa8z3mXs/pkvJE2KEThngVNOqtmljC6K7NMPxtc2JeZYTmpWb9k/TmxjeL18ez3h7vCw== - dependencies: - "@types/minimist" "^1.2.2" - camelcase-keys "^7.0.0" - decamelize "^5.0.0" - decamelize-keys "^1.1.0" - hard-rejection "^2.1.0" - minimist-options "4.1.0" - normalize-package-data "^3.0.2" - read-pkg-up "^8.0.0" - redent "^4.0.0" - trim-newlines "^4.0.2" - type-fest "^1.2.2" - yargs-parser "^20.2.9" +meow@^13.1.0: + version "13.1.0" + resolved "https://registry.yarnpkg.com/meow/-/meow-13.1.0.tgz#62995b0e8c3951739fe6e0a4becdd4d0df23eb37" + integrity sha512-o5R/R3Tzxq0PJ3v3qcQJtSvSE9nKOLSAaDuuoMzDVuGTwHdccMWcYomh9Xolng2tjT6O/Y83d+0coVGof6tqmA== merge-descriptors@1.0.1: version "1.0.1" @@ -8543,11 +8534,6 @@ mimic-response@^4.0.0: resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-4.0.0.tgz#35468b19e7c75d10f5165ea25e75a5ceea7cf70f" integrity sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg== -min-indent@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" - integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== - mini-css-extract-plugin@^2.7.6: version "2.7.6" resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-2.7.6.tgz#282a3d38863fddcd2e0c220aaed5b90bc156564d" @@ -8579,6 +8565,13 @@ minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" +minimatch@^9.0.1: + version "9.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" + integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== + dependencies: + brace-expansion "^2.0.1" + minimatch@~3.0.4: version "3.0.8" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.8.tgz#5e6a59bd11e2ab0de1cfb843eb2d82e546c321c1" @@ -8586,15 +8579,6 @@ minimatch@~3.0.4: dependencies: brace-expansion "^1.1.7" -minimist-options@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" - integrity sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A== - dependencies: - arrify "^1.0.1" - is-plain-obj "^1.1.0" - kind-of "^6.0.3" - minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5, minimist@^1.2.6: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" @@ -8625,7 +8609,7 @@ minipass@^3.0.0: dependencies: yallist "^4.0.0" -minipass@^7.0.3: +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.0.3: version "7.0.4" resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.0.4.tgz#dbce03740f50a4786ba994c1fb908844d27b038c" integrity sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ== @@ -8888,16 +8872,6 @@ node-source-walk@^6.0.0, node-source-walk@^6.0.1, node-source-walk@^6.0.2: dependencies: "@babel/parser" "^7.21.8" -normalize-package-data@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-3.0.3.tgz#dbcc3e2da59509a0983422884cd172eefdfa525e" - integrity sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA== - dependencies: - hosted-git-info "^4.0.1" - is-core-module "^2.5.0" - semver "^7.3.4" - validate-npm-package-license "^3.0.1" - normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" @@ -9414,6 +9388,14 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== +path-scurry@^1.10.1: + version "1.10.1" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.10.1.tgz#9ba6bf5aa8500fe9fd67df4f0d9483b2b0bfc698" + integrity sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ== + dependencies: + lru-cache "^9.1.1 || ^10.0.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" @@ -9545,7 +9527,7 @@ postcss-calc@^9.0.1: postcss-selector-parser "^6.0.11" postcss-value-parser "^4.2.0" -"postcss-color-function@github:folio-org/postcss-color-function": +postcss-color-function@folio-org/postcss-color-function: version "4.1.0" resolved "https://codeload.github.com/folio-org/postcss-color-function/tar.gz/c128aad740ae740fb571c4b6493f467dd51efe85" dependencies: @@ -9639,12 +9621,12 @@ postcss-resolve-nested-selector@^0.1.1: resolved "https://registry.yarnpkg.com/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz#29ccbc7c37dedfac304e9fff0bf1596b3f6a0e4e" integrity sha512-HvExULSwLqHLgUy1rl3ANIqCsvMS0WHss2UOsXhXnQaZ9VCc2oBvIpXrl00IUFT5ZDITME0o6oiXeiHr2SAIfw== -postcss-safe-parser@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-safe-parser/-/postcss-safe-parser-6.0.0.tgz#bb4c29894171a94bc5c996b9a30317ef402adaa1" - integrity sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ== +postcss-safe-parser@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/postcss-safe-parser/-/postcss-safe-parser-7.0.0.tgz#6273d4e5149e286db5a45bc6cf6eafcad464014a" + integrity sha512-ovehqRNVCpuFzbXoTb4qLtyzK3xn3t/CUBxOs8LsnQjQrShaB4lKiHoVqY8ANaC0hBMHq5QVWk77rwGklFUDrg== -postcss-selector-parser@^6.0.10, postcss-selector-parser@^6.0.11, postcss-selector-parser@^6.0.13, postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4: +postcss-selector-parser@^6.0.10, postcss-selector-parser@^6.0.11, postcss-selector-parser@^6.0.15, postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4: version "6.0.15" resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.15.tgz#11cc2b21eebc0b99ea374ffb9887174855a01535" integrity sha512-rEYkQOMUCEMhsKbK66tbEU9QVIxbhN18YiniAwA7XQYTVBqrBy+P2p5JcdqsHgKM2zWylp8d7J6eszocfds5Sw== @@ -9676,7 +9658,7 @@ postcss-values-parser@^6.0.2: is-url-superb "^4.0.0" quote-unquote "^1.0.0" -postcss@^8.4.2, postcss@^8.4.21, postcss@^8.4.23, postcss@^8.4.28: +postcss@^8.4.2, postcss@^8.4.21, postcss@^8.4.23, postcss@^8.4.33: version "8.4.33" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.33.tgz#1378e859c9f69bf6f638b990a0212f43e2aaa742" integrity sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg== @@ -10279,25 +10261,6 @@ read-cache@^1.0.0: dependencies: pify "^2.3.0" -read-pkg-up@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-8.0.0.tgz#72f595b65e66110f43b052dd9af4de6b10534670" - integrity sha512-snVCqPczksT0HS2EC+SxUndvSzn6LRCwpfSvLrIfR5BKDQQZMaI6jPRC9dYvYFDRAuFEAnkwww8kBBNE/3VvzQ== - dependencies: - find-up "^5.0.0" - read-pkg "^6.0.0" - type-fest "^1.0.1" - -read-pkg@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-6.0.0.tgz#a67a7d6a1c2b0c3cd6aa2ea521f40c458a4a504c" - integrity sha512-X1Fu3dPuk/8ZLsMhEj5f4wFAF0DWoK7qhGJvgaijocXxBmSToKfbFtqbxMO7bVjNA1dmE5huAzjXj/ey86iw9Q== - dependencies: - "@types/normalize-package-data" "^2.4.0" - normalize-package-data "^3.0.2" - parse-json "^5.2.0" - type-fest "^1.0.1" - readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.5.0, readable-stream@^3.6.0, readable-stream@^3.6.2: version "3.6.2" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" @@ -10321,14 +10284,6 @@ rechoir@^0.6.2: dependencies: resolve "^1.1.6" -redent@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/redent/-/redent-4.0.0.tgz#0c0ba7caabb24257ab3bb7a4fd95dd1d5c5681f9" - integrity sha512-tYkDkVVtYkSVhuQ4zBgfvciymHaeuel+zFKXShfDnFP5SyVEP7qo70Rf1jTOTCx3vGNAbnEi/xFkcfQVMIBWag== - dependencies: - indent-string "^5.0.0" - strip-indent "^4.0.0" - redux-form@^8.3.0: version "8.3.10" resolved "https://registry.yarnpkg.com/redux-form/-/redux-form-8.3.10.tgz#335657fafd4b26b91b4ce65371cd9dabe3648158" @@ -10639,6 +10594,13 @@ rimraf@^2.6.2, rimraf@^2.6.3: dependencies: glob "^7.1.3" +rimraf@^5.0.5: + version "5.0.5" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-5.0.5.tgz#9be65d2d6e683447d2e9013da2bf451139a61ccf" + integrity sha512-CqDakW+hMe/Bz202FPEymy68P+G50RfMQK+Qo5YUqc9SPipvbGjCGKd0RSKEelbsfQuw3g5NZDSrlZZAJurH1A== + dependencies: + glob "^10.3.7" + rimraf@~2.5.2: version "2.5.4" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04" @@ -11121,32 +11083,6 @@ spawn-wrap@^2.0.0: signal-exit "^3.0.2" which "^2.0.1" -spdx-correct@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.2.0.tgz#4f5ab0668f0059e34f9c00dce331784a12de4e9c" - integrity sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" - integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== - -spdx-expression-parse@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" - integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.16" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.16.tgz#a14f64e0954f6e25cc6587bd4f392522db0d998f" - integrity sha512-eWN+LnM3GR6gPu35WxNgbGl8rmY1AEmoMDvL/QD6zYmPWgywxWqJWNdLGT+ke8dKNWrcYgYjPpG5gbTfghP8rw== - spec-change@^1.7.1: version "1.7.1" resolved "https://registry.yarnpkg.com/spec-change/-/spec-change-1.7.1.tgz#3c56185c887a15482f1fbb3362916fc97c8fdb9f" @@ -11261,7 +11197,7 @@ strict-uri-encode@^2.0.0: resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" integrity sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ== -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -11337,6 +11273,13 @@ stringify-object@^3.2.1: is-obj "^1.0.1" is-regexp "^1.0.0" +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" @@ -11344,14 +11287,7 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@^7.0.1: +strip-ansi@^7.0.1, strip-ansi@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== @@ -11378,13 +11314,6 @@ strip-final-newline@^2.0.0: resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== -strip-indent@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-4.0.0.tgz#b41379433dd06f5eae805e21d631e07ee670d853" - integrity sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA== - dependencies: - min-indent "^1.0.1" - strip-json-comments@3.1.1, strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" @@ -11405,22 +11334,17 @@ style-loader@^3.3.0: resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-3.3.3.tgz#bba8daac19930169c0c9c96706749a597ae3acff" integrity sha512-53BiGLXAcll9maCYtZi2RCQZKa8NQQai5C4horqKyRmHj9H7QmcUyucrH+4KW/gBQbXM2AsB0axoEcFZPlfPcw== -style-search@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/style-search/-/style-search-0.1.0.tgz#7958c793e47e32e07d2b5cafe5c0bf8e12e77902" - integrity sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg== - -stylelint-config-recommended@^12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/stylelint-config-recommended/-/stylelint-config-recommended-12.0.0.tgz#d0993232fca017065fd5acfcb52dd8a188784ef4" - integrity sha512-x6x8QNARrGO2sG6iURkzqL+Dp+4bJorPMMRNPScdvaUK8PsynriOcMW7AFDKqkWAS5wbue/u8fUT/4ynzcmqdQ== +stylelint-config-recommended@^14.0.0: + version "14.0.0" + resolved "https://registry.yarnpkg.com/stylelint-config-recommended/-/stylelint-config-recommended-14.0.0.tgz#b395c7014838d2aaca1755eebd914d0bb5274994" + integrity sha512-jSkx290CglS8StmrLp2TxAppIajzIBZKYm3IxT89Kg6fGlxbPiTiyH9PS5YUuVAFwaJLl1ikiXX0QWjI0jmgZQ== -stylelint-config-standard@^33.0.0: - version "33.0.0" - resolved "https://registry.yarnpkg.com/stylelint-config-standard/-/stylelint-config-standard-33.0.0.tgz#1f7bb299153a53874073e93829e37a475842f0f9" - integrity sha512-eyxnLWoXImUn77+ODIuW9qXBDNM+ALN68L3wT1lN2oNspZ7D9NVGlNHb2QCUn4xDug6VZLsh0tF8NyoYzkgTzg== +stylelint-config-standard@^36.0.0: + version "36.0.0" + resolved "https://registry.yarnpkg.com/stylelint-config-standard/-/stylelint-config-standard-36.0.0.tgz#6704c044d611edc12692d4a5e37b039a441604d4" + integrity sha512-3Kjyq4d62bYFp/Aq8PMKDwlgUyPU4nacXsjDLWJdNPRUgpuxALu1KnlAHIj36cdtxViVhXexZij65yM0uNIHug== dependencies: - stylelint-config-recommended "^12.0.0" + stylelint-config-recommended "^14.0.0" stylelint-junit-formatter@^0.2.2: version "0.2.2" @@ -11429,47 +11353,45 @@ stylelint-junit-formatter@^0.2.2: dependencies: xmlbuilder "^13.0.2" -stylelint@^15.6.2: - version "15.11.0" - resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-15.11.0.tgz#3ff8466f5f5c47362bc7c8c9d382741c58bc3292" - integrity sha512-78O4c6IswZ9TzpcIiQJIN49K3qNoXTM8zEJzhaTE/xRTCZswaovSEVIa/uwbOltZrk16X4jAxjaOhzz/hTm1Kw== +stylelint@^16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-16.2.0.tgz#60678f64d7660350fdd06415fd449f332b4fcbf6" + integrity sha512-gwqU5AkIb52wrAzzn+359S3NIJDMl02TXLUaV2tzA/L6jUdpTwNt+MCxHlc8+Hb2bUHlYVo92YeSIryF2gJthA== dependencies: - "@csstools/css-parser-algorithms" "^2.3.1" - "@csstools/css-tokenizer" "^2.2.0" - "@csstools/media-query-list-parser" "^2.1.4" - "@csstools/selector-specificity" "^3.0.0" + "@csstools/css-parser-algorithms" "^2.5.0" + "@csstools/css-tokenizer" "^2.2.3" + "@csstools/media-query-list-parser" "^2.1.7" + "@csstools/selector-specificity" "^3.0.1" balanced-match "^2.0.0" colord "^2.9.3" - cosmiconfig "^8.2.0" + cosmiconfig "^9.0.0" css-functions-list "^3.2.1" css-tree "^2.3.1" debug "^4.3.4" - fast-glob "^3.3.1" + fast-glob "^3.3.2" fastest-levenshtein "^1.0.16" - file-entry-cache "^7.0.0" + file-entry-cache "^8.0.0" global-modules "^2.0.0" globby "^11.1.0" globjoin "^0.1.4" html-tags "^3.3.1" - ignore "^5.2.4" - import-lazy "^4.0.0" + ignore "^5.3.0" imurmurhash "^0.1.4" is-plain-object "^5.0.0" known-css-properties "^0.29.0" mathml-tag-names "^2.1.3" - meow "^10.1.5" + meow "^13.1.0" micromatch "^4.0.5" normalize-path "^3.0.0" picocolors "^1.0.0" - postcss "^8.4.28" + postcss "^8.4.33" postcss-resolve-nested-selector "^0.1.1" - postcss-safe-parser "^6.0.0" - postcss-selector-parser "^6.0.13" + postcss-safe-parser "^7.0.0" + postcss-selector-parser "^6.0.15" postcss-value-parser "^4.2.0" resolve-from "^5.0.0" string-width "^4.2.3" - strip-ansi "^6.0.1" - style-search "^0.1.0" + strip-ansi "^7.1.0" supports-hyperlinks "^3.0.0" svg-tags "^1.0.0" table "^6.8.1" @@ -11746,11 +11668,6 @@ tr46@~0.0.3: resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== -trim-newlines@^4.0.2: - version "4.1.1" - resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-4.1.1.tgz#28c88deb50ed10c7ba6dc2474421904a00139125" - integrity sha512-jRKj0n0jXWo6kh62nA5TEh3+4igKDXLvzBJcPpiizP7oOolUrYIxmVBG9TOtHYFHoddUk6YvAkGeGoSVTXfQXQ== - ts-invariant@^0.10.3: version "0.10.3" resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.10.3.tgz#3e048ff96e91459ffca01304dbc7f61c1f642f6c" @@ -11873,7 +11790,7 @@ type-fest@^0.8.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== -type-fest@^1.0.1, type-fest@^1.2.1, type-fest@^1.2.2: +type-fest@^1.0.1: version "1.4.0" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-1.4.0.tgz#e9fb813fe3bf1744ec359d55d1affefa76f14be1" integrity sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA== @@ -12199,14 +12116,6 @@ v8-compile-cache@^2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz#cdada8bec61e15865f05d097c5f4fd30e94dc128" integrity sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw== -validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - value-equal@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-1.0.1.tgz#1e0b794c734c5c0cade179c437d356d931a34d6c" @@ -12435,19 +12344,19 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" - integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== dependencies: ansi-styles "^4.0.0" string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== +wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== dependencies: ansi-styles "^4.0.0" string-width "^4.1.0" @@ -12592,7 +12501,7 @@ yargs-parser@^18.1.2: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^20.2.2, yargs-parser@^20.2.9: +yargs-parser@^20.2.2: version "20.2.9" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== From eaa5e303fdd6462ee403da8978f68736ed61aafd Mon Sep 17 00:00:00 2001 From: Denys Bohdan Date: Thu, 1 Feb 2024 12:21:31 +0100 Subject: [PATCH 09/26] STSMACOM-801 `` - added new `getReadOnlyFieldsForItem` prop to control read only fields for different items (#1435) --- CHANGELOG.md | 1 + lib/EditableList/EditableList.js | 4 ++ lib/EditableList/EditableListForm.js | 7 +++ lib/EditableList/ItemEdit.js | 9 +++- lib/EditableList/readme.md | 1 + lib/EditableList/tests/EditableList-test.js | 49 ++++++++++++++++++++- 6 files changed, 69 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 378f4d9da..53038052d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ * Make `helpText` prop as optional for all types of custom field components. Refs STSMACOM-799. * Upgrade `stylelint` and associated dependencies. Refs STSMACOM-803. * `` must handle sparse data. Refs STSMACOM-802. +* `` - added new `getReadOnlyFieldsForItem` prop to control read only fields for different items. Refs STSMACOM-801. ## [9.0.0](https://github.com/folio-org/stripes-smart-components/tree/v9.0.0) (2023-10-11) [Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v8.0.0...v9.0.0) diff --git a/lib/EditableList/EditableList.js b/lib/EditableList/EditableList.js index bafc43de0..e24a1b97e 100644 --- a/lib/EditableList/EditableList.js +++ b/lib/EditableList/EditableList.js @@ -30,6 +30,10 @@ const propTypes = { * Form type implementation */ formType: PropTypes.oneOf(['redux-form', 'final-form']), + /** + * Function that returns a list of read-only fields for a specific item + */ + getReadOnlyFieldsForItem: PropTypes.func, /** * id for add button */ diff --git a/lib/EditableList/EditableListForm.js b/lib/EditableList/EditableListForm.js index e2a08b268..ade0c2a0f 100644 --- a/lib/EditableList/EditableListForm.js +++ b/lib/EditableList/EditableListForm.js @@ -93,6 +93,11 @@ const propTypes = { */ formatter: PropTypes.object, + /** + * Function that returns a list of read-only fields for a specific item + */ + getReadOnlyFieldsForItem: PropTypes.func, + handleSubmit: PropTypes.func.isRequired, /** * id for Add action. @@ -468,6 +473,7 @@ class EditableListForm extends React.Component { actionProps, additionalFields, fieldComponents, + getReadOnlyFieldsForItem, } = this.props; let isEditing; let hasError; @@ -495,6 +501,7 @@ class EditableListForm extends React.Component { visibleFields={this.getVisibleColumns()} additionalFields={additionalFields} readOnlyFields={this.getReadOnlyColumns()} + getReadOnlyFieldsForItem={getReadOnlyFieldsForItem} fieldComponents={fieldComponents} widths={columnWidths} cells={cells} diff --git a/lib/EditableList/ItemEdit.js b/lib/EditableList/ItemEdit.js index ee21be4e7..d3bf79bf0 100644 --- a/lib/EditableList/ItemEdit.js +++ b/lib/EditableList/ItemEdit.js @@ -1,7 +1,9 @@ import React from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; + import { TextField } from '@folio/stripes-components'; + import css from './EditableList.css'; // Prevents input field validation on cancel. Issue https://github.com/erikras/redux-form/issues/860 @@ -21,14 +23,16 @@ const ItemEdit = ({ columnMapping, fieldComponents, readOnlyFields, + getReadOnlyFieldsForItem, widths, cells, autoFocus, FieldComponent, rowClass, + item, }) => { const fields = visibleFields.map((name, fieldIndex) => { - if (readOnlyFields.indexOf(name) === -1) { + if ([...readOnlyFields, ...getReadOnlyFieldsForItem(item)].indexOf(name) === -1) { let mappedName = name; if (Object.hasOwnProperty.call(columnMapping, name)) { mappedName = columnMapping[name]; @@ -103,6 +107,8 @@ ItemEdit.propTypes = { field: PropTypes.string, FieldComponent: PropTypes.object, fieldComponents: PropTypes.object, + getReadOnlyFieldsForItem: PropTypes.func, + item: PropTypes.object.isRequired, readOnlyFields: PropTypes.arrayOf(PropTypes.string), rowClass: PropTypes.string, rowIndex: PropTypes.number.isRequired, @@ -112,6 +118,7 @@ ItemEdit.propTypes = { ItemEdit.defaultProps = { error: null, + getReadOnlyFieldsForItem: () => [], }; export default ItemEdit; diff --git a/lib/EditableList/readme.md b/lib/EditableList/readme.md index 1e8f721a9..a4877b8cd 100644 --- a/lib/EditableList/readme.md +++ b/lib/EditableList/readme.md @@ -46,6 +46,7 @@ actionSuppression | object | Object containing properties of list action names: actionProps | object | Object containing properties of list action names: 'delete', 'edit' and values of sentinel functions that return objects to destructure onto the action button props. | `{ delete: (item) => {return { disabled: item.item.inUse } } }` isEmptyMessage | string | Message to display for an empty list. | | no readOnlyFields | array of strings | Array of non-editable columns - good for displaying meta information within the row. | | no +getReadOnlyFieldsForItem | function | Function that takes a row item as an argument and returns an array of non-editable columns. Can be used when different fields need to be editale based on item data. Values returned from this prop will be used together with values from `readOnlyFields`. | | no formatter | object | Allows custom content/components to be displayed in the grid. see example below. | | no columnMapping | object | Allows custom column names to be applied in case they differ from the properties of `contentData`'s objects| | no fieldComponents | object | Allows custom components for edit mode to be used. Fields not supplied will use a `` by default| | no diff --git a/lib/EditableList/tests/EditableList-test.js b/lib/EditableList/tests/EditableList-test.js index 421f732bd..36326d010 100644 --- a/lib/EditableList/tests/EditableList-test.js +++ b/lib/EditableList/tests/EditableList-test.js @@ -3,7 +3,7 @@ import { expect } from 'chai'; import { describe, beforeEach, it } from 'mocha'; import { spy } from 'sinon'; -import { EditableList as ELInteractor, EditableListRow, converge, TextField } from '@folio/stripes-testing'; +import { EditableList as ELInteractor, EditableListRow, converge, TextField, Button } from '@folio/stripes-testing'; import TestForm from '../../../tests/TestForm'; import { setupApplication, mount } from '../../../tests/helpers'; @@ -19,6 +19,10 @@ describe('Editable List', () => { let updateHandled = false; let deleteHandled = false; + const getReadOnlyFieldsForItem = (item) => { + return item.isNameEditable ? [] : ['name']; + }; + beforeEach(async () => { onStatusChange.resetHistory(); @@ -26,10 +30,12 @@ describe('Editable List', () => { { id: '1', name: 'Item 1', + isNameEditable: true, }, { id: '2', name: 'Item 2', + isNameEditable: false, } ]; createHandled = false; @@ -43,6 +49,7 @@ describe('Editable List', () => { columnMapping={{}} visibleFields={['name']} nameKey="id" + getReadOnlyFieldsForItem={getReadOnlyFieldsForItem} onUpdate={() => { updateHandled = true; }} onDelete={() => { deleteHandled = true; }} onCreate={() => { createHandled = true; }} @@ -65,6 +72,7 @@ describe('Editable List', () => { expect(onStatusChange.called).to.be.false; }); }); + describe('clicking the add button', () => { beforeEach(async () => { await list.add(); @@ -98,4 +106,43 @@ describe('Editable List', () => { it('calls the create handler', () => converge(() => createHandled)); }); }); + + describe('clicking the edit button', () => { + const rowWithEditableName = EditableListRow({ index: 0 }); + + beforeEach(async () => { + await rowWithEditableName.edit(); + }); + + describe('when editing a field', () => { + beforeEach(async () => { + await TextField({ name: 'items[0].name' }).fillIn('Item 1 edit'); + }); + + it('should enable Save button', () => Button({ text: 'Save', disabled: false }).exists()); + + describe('saving', () => { + beforeEach(async () => { + await rowWithEditableName.save(); + }); + + it('calls the create handler', () => converge(() => updateHandled)); + }); + }); + }); + + describe('when using getReadOnlyFieldsForItem', () => { + const rowWithEditableName = EditableListRow({ index: 0 }); + const rowWithReadOnlyName = EditableListRow({ index: 1 }); + + it('should mark correct field as editable based on item data', async () => { + await rowWithEditableName.edit(); + return TextField({ name: 'items[0].name', disabled: false }).exists(); + }); + + it('should mark correct field as read only based on item data', async () => { + await rowWithReadOnlyName.edit(); + return TextField({ name: 'items[1].name' }).absent(); + }); + }); }); From de871c38ffde7ef5d6f427ca7703e756f6ebefdc Mon Sep 17 00:00:00 2001 From: John Coburn Date: Mon, 5 Feb 2024 09:39:28 -0600 Subject: [PATCH 10/26] STSMACOM-798 Remove required validation from 2 ViewCustomFieldRecord propTypes (#1437) * remove required validation from 2 ViewCustomFieldRecord propTypes * Update CHANGELOG.md --- CHANGELOG.md | 1 + .../pages/ViewCustomFieldsRecord/ViewCustomFieldsRecord.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53038052d..e975fed72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ * Make `helpText` prop as optional for all types of custom field components. Refs STSMACOM-799. * Upgrade `stylelint` and associated dependencies. Refs STSMACOM-803. * `` must handle sparse data. Refs STSMACOM-802. +* `ViewCustomFieldRecord` - remove required validation from `expanded`, `onToggle` props. Refs STSMACOM-798. * `` - added new `getReadOnlyFieldsForItem` prop to control read only fields for different items. Refs STSMACOM-801. ## [9.0.0](https://github.com/folio-org/stripes-smart-components/tree/v9.0.0) (2023-10-11) diff --git a/lib/CustomFields/pages/ViewCustomFieldsRecord/ViewCustomFieldsRecord.js b/lib/CustomFields/pages/ViewCustomFieldsRecord/ViewCustomFieldsRecord.js index ede519244..f9a5a5a7c 100644 --- a/lib/CustomFields/pages/ViewCustomFieldsRecord/ViewCustomFieldsRecord.js +++ b/lib/CustomFields/pages/ViewCustomFieldsRecord/ViewCustomFieldsRecord.js @@ -50,13 +50,13 @@ const propTypes = { customFieldsLabel: PropTypes.node, customFieldsValues: PropTypes.object.isRequired, entityType: PropTypes.string.isRequired, - expanded: PropTypes.bool.isRequired, + expanded: PropTypes.bool, noCustomFieldsFoundLabel: PropTypes.node, okapi: PropTypes.shape({ tenant: PropTypes.string.isRequired, url: PropTypes.string.isRequired, }).isRequired, - onToggle: PropTypes.func.isRequired, + onToggle: PropTypes.func, }; const defaultProps = { From 98b115744f2274ab403726b0781b2c3c07360a52 Mon Sep 17 00:00:00 2001 From: Denys Bohdan Date: Tue, 6 Feb 2024 17:29:28 +0100 Subject: [PATCH 11/26] STSMACOM-807 Added confirmation modal to editable list (#1440) --- CHANGELOG.md | 1 + lib/EditableList/EditableListForm.js | 94 ++++++++++++++++++- lib/EditableList/readme.md | 5 + lib/EditableList/tests/EditableList-test.js | 93 +++++++++++++++++- translations/stripes-smart-components/en.json | 4 +- 5 files changed, 194 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e975fed72..348f1f2d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ * `` must handle sparse data. Refs STSMACOM-802. * `ViewCustomFieldRecord` - remove required validation from `expanded`, `onToggle` props. Refs STSMACOM-798. * `` - added new `getReadOnlyFieldsForItem` prop to control read only fields for different items. Refs STSMACOM-801. +* `` - added confirmation modal when deleting items. Refs STSMACOM-807. ## [9.0.0](https://github.com/folio-org/stripes-smart-components/tree/v9.0.0) (2023-10-11) [Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v8.0.0...v9.0.0) diff --git a/lib/EditableList/EditableListForm.js b/lib/EditableList/EditableListForm.js index ade0c2a0f..959364a91 100644 --- a/lib/EditableList/EditableListForm.js +++ b/lib/EditableList/EditableListForm.js @@ -18,6 +18,7 @@ import { MultiColumnList, Row, Layout, + ConfirmationModal, } from '@folio/stripes-components'; import EditableItem from './EditableItem'; import processBadResponse from './processBadResponse'; @@ -54,6 +55,10 @@ const propTypes = { * manually set column widths, if necessary. */ columnWidths: PropTypes.object, + confirmationHeading: PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.node]).isRequired, + confirmationMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired, + confirmationCancelLabel: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), + confirmationConfirmLabel: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), /** * Collection of items to render. */ @@ -178,6 +183,10 @@ const propTypes = { * Array of fields to render. These will also be editable. */ visibleFields: PropTypes.arrayOf(PropTypes.string).isRequired, + /** + * Should user be asked to confirm delete action + */ + withDeleteConfirmation: PropTypes.bool, }; const defaultProps = { @@ -191,6 +200,9 @@ const defaultProps = { uniqueField: 'id', validate: noop, shouldReinitialize: false, + confirmationCancelLabel: , + confirmationConfirmLabel: , + withDeleteConfirmation: false, }; const buildStatusArray = (items = []) => items.map(() => ({ editing: false, error: false })); @@ -208,6 +220,8 @@ class EditableListForm extends React.Component { status, creating: false, lastAction: {}, + isConfirmationModalOpen: false, + itemIdToDelete: null, }; this.RenderItems = this.RenderItems.bind(this); @@ -347,6 +361,49 @@ class EditableListForm extends React.Component { this.toggleEdit(index); } + handleDeleteClick = (fields, index) => { + const { + withDeleteConfirmation, + uniqueField, + } = this.props; + + if (!withDeleteConfirmation) { + this.onDelete(fields, index); + return; + } + + const item = this.getValue(fields, index); + + this.setState({ + isConfirmationModalOpen: true, + itemIdToDelete: item[uniqueField], + }); + } + + closeConfirmationModal = () => { + this.setState({ + isConfirmationModalOpen: false, + itemIdToDelete: null, + }); + } + + handleDeleteCancel = () => { + this.closeConfirmationModal(); + } + + handleDeleteConfirm = (fields) => { + const { + uniqueField, + form, + } = this.props; + + const { values } = form.getState(); + const itemIndex = values.items.findIndex(item => item[uniqueField] === this.state.itemIdToDelete); + + this.closeConfirmationModal(); + this.onDelete(fields, itemIndex); + } + onDelete(fields, index) { const { uniqueField } = this.props; const item = this.getValue(fields, index); @@ -580,7 +637,7 @@ class EditableListForm extends React.Component { size="small" id={`clickable-delete-${this.testingId}-${item.rowIndex}`} aria-label={ariaLabel} - onClick={() => this.onDelete(fields, item.rowIndex)} + onClick={() => this.handleDeleteClick(fields, item.rowIndex)} {...(typeof actionProps.delete === 'function' ? actionProps.delete(item) : {})} /> )} @@ -590,6 +647,40 @@ class EditableListForm extends React.Component { ); }; + renderConfirmationModal = (fields) => { + const { + isConfirmationModalOpen, + itemIdToDelete, + } = this.state; + + const { + withDeleteConfirmation, + confirmationHeading, + confirmationMessage, + confirmationCancelLabel, + confirmationConfirmLabel, + } = this.props; + + if (!withDeleteConfirmation) { + return null; + } + + const heading = typeof confirmationHeading === 'function' ? confirmationHeading(itemIdToDelete) : confirmationHeading; + + return ( + this.handleDeleteConfirm(fields)} + /> + ); + } + RenderItems({ fields }) { const { pristine, @@ -688,6 +779,7 @@ class EditableListForm extends React.Component { /> + {this.renderConfirmationModal(fields)} ); } diff --git a/lib/EditableList/readme.md b/lib/EditableList/readme.md index a4877b8cd..1f40610bd 100644 --- a/lib/EditableList/readme.md +++ b/lib/EditableList/readme.md @@ -53,6 +53,11 @@ fieldComponents | object | Allows custom components for edit mode to be used. Fi columnWidths | object | Allows custom column widths to be set. If you use this, be sure to set a width for an 'actions' column as part of this object. | | no id | string | Used as a basic suffix for `id` attributes throughout the component. | | editable | boolean | Used as a flag for the component to be editable or not editable (without '+ New' button and column 'actions'). | `true` | no +withDeleteConfirmation | boolean | Should user be asked to confirm delete action | `false` | no +confirmationHeading | function/string/node | Confirmation modal heading. If it's a function - it will be called with id of the deleted item. | | yes +confirmationMessage | string/node | Confirmation modal message | | yes +confirmationCancelLabel | string/node | Confirmation modal cancel button label | default label | no +confirmationConfirmLabel | string/node | Confirmation modal confirm button label | default label | no ### Custom Field Components Many times a `` won't be adequate for the value that needs to be edited, so to provide your own ``, using the `fieldComponents` prop is the way to accomplish this. It accepts an object with keys corresponding to visibleFields that contain render functions. The functions will be provided an object with a `fieldProps` key that can be spread on the `` for convenience (it applies `name` and `aria-label` props). Other provided props are listed after the example. diff --git a/lib/EditableList/tests/EditableList-test.js b/lib/EditableList/tests/EditableList-test.js index 36326d010..c311dfe23 100644 --- a/lib/EditableList/tests/EditableList-test.js +++ b/lib/EditableList/tests/EditableList-test.js @@ -3,7 +3,14 @@ import { expect } from 'chai'; import { describe, beforeEach, it } from 'mocha'; import { spy } from 'sinon'; -import { EditableList as ELInteractor, EditableListRow, converge, TextField, Button } from '@folio/stripes-testing'; +import { + EditableList as ELInteractor, + EditableListRow, + converge, + TextField, + Button, + ConfirmationModal, +} from '@folio/stripes-testing'; import TestForm from '../../../tests/TestForm'; import { setupApplication, mount } from '../../../tests/helpers'; @@ -131,6 +138,16 @@ describe('Editable List', () => { }); }); + describe('clicking the delete button', () => { + const rowWithEditableName = EditableListRow({ index: 0 }); + + beforeEach(async () => { + await rowWithEditableName.delete(); + }); + + it('should call the create handler', () => converge(() => deleteHandled)); + }); + describe('when using getReadOnlyFieldsForItem', () => { const rowWithEditableName = EditableListRow({ index: 0 }); const rowWithReadOnlyName = EditableListRow({ index: 1 }); @@ -146,3 +163,77 @@ describe('Editable List', () => { }); }); }); + +describe('Editable List - with confirmation modal', () => { + setupApplication(); + + let deleteHandled = false; + + beforeEach(async () => { + onStatusChange.resetHistory(); + + const contentData = [ + { + id: '1', + name: 'Item 1', + }, + { + id: '2', + name: 'Item 2', + } + ]; + deleteHandled = false; + await mount(( + { deleteHandled = true; }} + onStatusChange={onStatusChange} + withDeleteConfirmation + confirmationHeading={itemId => `Item with id: ${itemId}`} + confirmationMessage="Want to delete this item?" + formType="final-form" + onSubmit={() => {}} + /> + )); + }); + + describe('clicking the delete button', () => { + const rowWithEditableName = EditableListRow({ index: 0 }); + + beforeEach(async () => { + await rowWithEditableName.delete(); + }); + + it('should not call the create handler', () => converge(() => !deleteHandled)); + + it('should show the confirmation modal', () => ConfirmationModal({ title: 'Item with id: 1', visible: true }).exists()); + + describe('when clicking Cancel', () => { + const modal = ConfirmationModal({ title: 'Item with id: 1', visible: true }); + + beforeEach(() => { + modal.cancel(); + }); + + it('should close the modal', () => modal.absent()); + + it('should not call the create handler', () => converge(() => !deleteHandled)); + }); + + describe('when clicking Confirm', () => { + const modal = ConfirmationModal({ title: 'Item with id: 1', visible: true }); + + beforeEach(() => { + modal.confirm(); + }); + + it('should close the modal', () => modal.absent()); + + it('should call the create handler', () => converge(() => deleteHandled)); + }); + }); +}); diff --git a/translations/stripes-smart-components/en.json b/translations/stripes-smart-components/en.json index 1a5122704..a6fcb5a62 100644 --- a/translations/stripes-smart-components/en.json +++ b/translations/stripes-smart-components/en.json @@ -280,5 +280,7 @@ "clipCopy.success": "Successfully copied \"{text}\" to clipboard.", "columnManager.showColumns": "Show columns", - "editableList.actionsColumnHeader": "Actions" + "editableList.actionsColumnHeader": "Actions", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } From daf8fe82e718fcd38b02d448497922cfd05b84a0 Mon Sep 17 00:00:00 2001 From: alb3rtino Date: Wed, 7 Feb 2024 16:12:43 +0100 Subject: [PATCH 12/26] STSMACOM-806 Add `onComponentLoad` prop to `` (#1438) --- CHANGELOG.md | 1 + .../pages/EditCustomFieldsRecord/EditCustomFieldsRecord.js | 4 ++++ .../tests/EditCustomFieldsRecord-test.js | 6 ++++++ lib/CustomFields/readme.md | 1 + 4 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 348f1f2d2..80dcf0564 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ * `ViewCustomFieldRecord` - remove required validation from `expanded`, `onToggle` props. Refs STSMACOM-798. * `` - added new `getReadOnlyFieldsForItem` prop to control read only fields for different items. Refs STSMACOM-801. * `` - added confirmation modal when deleting items. Refs STSMACOM-807. +* Add `onComponentLoad` prop to ``. Refs STSMACOM-806. ## [9.0.0](https://github.com/folio-org/stripes-smart-components/tree/v9.0.0) (2023-10-11) [Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v8.0.0...v9.0.0) diff --git a/lib/CustomFields/pages/EditCustomFieldsRecord/EditCustomFieldsRecord.js b/lib/CustomFields/pages/EditCustomFieldsRecord/EditCustomFieldsRecord.js index 4bc925417..52d3c752a 100644 --- a/lib/CustomFields/pages/EditCustomFieldsRecord/EditCustomFieldsRecord.js +++ b/lib/CustomFields/pages/EditCustomFieldsRecord/EditCustomFieldsRecord.js @@ -76,6 +76,7 @@ const propTypes = { tenant: PropTypes.string.isRequired, url: PropTypes.string.isRequired, }).isRequired, + onComponentLoad: PropTypes.func, onToggle: PropTypes.func, reduxFormCustomFieldsValues: PropTypes.objectOf(PropTypes.string), }; @@ -87,6 +88,7 @@ const defaultProps = { const EditCustomFieldsRecord = ({ accordionId, + onComponentLoad, onToggle, expanded, okapi, @@ -176,6 +178,7 @@ const EditCustomFieldsRecord = ({ if (customFieldsLoaded && sectionTitleLoaded) { initializeFields(); + onComponentLoad?.(); } }, [ customFieldsLoaded, @@ -187,6 +190,7 @@ const EditCustomFieldsRecord = ({ isReduxForm, reduxFormCustomFieldsValues, finalFormCustomFieldsValues, + onComponentLoad ]); const renderCustomFieldLabel = customField => ( diff --git a/lib/CustomFields/pages/EditCustomFieldsRecord/tests/EditCustomFieldsRecord-test.js b/lib/CustomFields/pages/EditCustomFieldsRecord/tests/EditCustomFieldsRecord-test.js index 666f8c249..0cde35595 100644 --- a/lib/CustomFields/pages/EditCustomFieldsRecord/tests/EditCustomFieldsRecord-test.js +++ b/lib/CustomFields/pages/EditCustomFieldsRecord/tests/EditCustomFieldsRecord-test.js @@ -17,6 +17,7 @@ describe('EditCustomFieldsRecord', () => { const changeFinalFormField = sinon.spy(); const changeReduxFormField = sinon.spy(); + const onComponentLoad = sinon.spy(); const onToggle = sinon.spy(); const renderComponent = (props = {}) => { @@ -32,6 +33,7 @@ describe('EditCustomFieldsRecord', () => { expanded formName="custom-fields-test" isReduxForm={false} + onComponentLoad={onComponentLoad} onToggle={onToggle} fieldComponent={Field} {...props} @@ -100,6 +102,10 @@ describe('EditCustomFieldsRecord', () => { expect(editCustomFields.customFields().length).to.equal(7); }); + it('should call onComponentLoad', () => { + expect(onComponentLoad.called).to.be.true; + }); + describe('when Single Select field has a default option', () => { it('should update form with this value', () => { expect(changeFinalFormField.calledWith('customFields.single_select-1', 'opt_0')).to.be.true; diff --git a/lib/CustomFields/readme.md b/lib/CustomFields/readme.md index 26790a7aa..d16fca73c 100644 --- a/lib/CustomFields/readme.md +++ b/lib/CustomFields/readme.md @@ -182,6 +182,7 @@ Name | type | description | required | default `entityType` | string | used to filter custom files by particular entity type |true `expanded` | boolean | indicates if the accordion is open | true | `fieldComponent` | func | Field component | true | +`onComponentLoad` | func | callback function invoked when all form fields have been rendered | false | `onToggle` | func | callback for toggling the accordion open/closed | true | From fd4116474e81cb9e11d9b751a60d8611870830fd Mon Sep 17 00:00:00 2001 From: Denys Bohdan Date: Thu, 8 Feb 2024 17:30:16 +0100 Subject: [PATCH 13/26] STSMACOM-809 Fix issue with resetting unsaved changes after failed update (#1442) --- CHANGELOG.md | 1 + lib/EditableList/EditableListFinalForm.js | 1 + lib/EditableList/EditableListForm.js | 2 +- lib/EditableList/ItemEdit.js | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80dcf0564..e1d997661 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ * `` - added new `getReadOnlyFieldsForItem` prop to control read only fields for different items. Refs STSMACOM-801. * `` - added confirmation modal when deleting items. Refs STSMACOM-807. * Add `onComponentLoad` prop to ``. Refs STSMACOM-806. +* Keep final form state when update request fails in ``. Refs STSMACOM-809. ## [9.0.0](https://github.com/folio-org/stripes-smart-components/tree/v9.0.0) (2023-10-11) [Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v8.0.0...v9.0.0) diff --git a/lib/EditableList/EditableListFinalForm.js b/lib/EditableList/EditableListFinalForm.js index 731bf8444..9694b8eea 100644 --- a/lib/EditableList/EditableListFinalForm.js +++ b/lib/EditableList/EditableListFinalForm.js @@ -10,6 +10,7 @@ export default stripesFinalForm({ navigationCheck: true, enableReinitialize: true, destroyOnUnmount: false, + keepDirtyOnReinitialize: true, // when update request fails with an error - keep unsaved changes in form })(props => { const { initialize, form } = this.props; - (initialize || form.initialize)(); + (initialize || form.initialize)(form.getState().values); } onSave(fields, index) { diff --git a/lib/EditableList/ItemEdit.js b/lib/EditableList/ItemEdit.js index d3bf79bf0..3e09fb8e5 100644 --- a/lib/EditableList/ItemEdit.js +++ b/lib/EditableList/ItemEdit.js @@ -45,6 +45,7 @@ const ItemEdit = ({ const fieldProps = { 'name': fieldName, 'aria-label': ariaLabel, + error: error?.fieldErrors?.[name], // pass error to custom field components }; if (Object.hasOwnProperty.call(fieldComponents, name)) { From f751bed0bef9c9d2f76327257ffdb2df3a655c7e Mon Sep 17 00:00:00 2001 From: FOLIO Translations Bot <38661258+folio-translations@users.noreply.github.com> Date: Thu, 8 Feb 2024 18:43:26 -0500 Subject: [PATCH 14/26] Lokalise: updates --- translations/stripes-smart-components/ar.json | 4 +++- translations/stripes-smart-components/ber.json | 4 +++- translations/stripes-smart-components/ca.json | 4 +++- translations/stripes-smart-components/cs_CZ.json | 4 +++- translations/stripes-smart-components/da.json | 4 +++- translations/stripes-smart-components/de.json | 6 ++++-- translations/stripes-smart-components/en_GB.json | 4 +++- translations/stripes-smart-components/en_SE.json | 4 +++- translations/stripes-smart-components/en_US.json | 4 +++- translations/stripes-smart-components/es.json | 4 +++- translations/stripes-smart-components/es_419.json | 4 +++- translations/stripes-smart-components/es_ES.json | 4 +++- translations/stripes-smart-components/fr.json | 4 +++- translations/stripes-smart-components/fr_FR.json | 4 +++- translations/stripes-smart-components/he.json | 4 +++- translations/stripes-smart-components/hi_IN.json | 4 +++- translations/stripes-smart-components/hu.json | 4 +++- translations/stripes-smart-components/it_IT.json | 4 +++- translations/stripes-smart-components/ja.json | 4 +++- translations/stripes-smart-components/ko.json | 4 +++- translations/stripes-smart-components/nb.json | 4 +++- translations/stripes-smart-components/nn.json | 4 +++- translations/stripes-smart-components/pl.json | 10 ++++++---- translations/stripes-smart-components/pt_BR.json | 4 +++- translations/stripes-smart-components/pt_PT.json | 4 +++- translations/stripes-smart-components/ru.json | 4 +++- translations/stripes-smart-components/sk.json | 4 +++- translations/stripes-smart-components/sv.json | 4 +++- translations/stripes-smart-components/ur.json | 4 +++- translations/stripes-smart-components/zh_CN.json | 8 +++++--- translations/stripes-smart-components/zh_TW.json | 4 +++- 31 files changed, 99 insertions(+), 37 deletions(-) diff --git a/translations/stripes-smart-components/ar.json b/translations/stripes-smart-components/ar.json index f14d50589..519f59c79 100644 --- a/translations/stripes-smart-components/ar.json +++ b/translations/stripes-smart-components/ar.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/ber.json b/translations/stripes-smart-components/ber.json index 68e1a00eb..386c8664c 100644 --- a/translations/stripes-smart-components/ber.json +++ b/translations/stripes-smart-components/ber.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/ca.json b/translations/stripes-smart-components/ca.json index 68e1a00eb..386c8664c 100644 --- a/translations/stripes-smart-components/ca.json +++ b/translations/stripes-smart-components/ca.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/cs_CZ.json b/translations/stripes-smart-components/cs_CZ.json index ab1c41099..1db154a30 100644 --- a/translations/stripes-smart-components/cs_CZ.json +++ b/translations/stripes-smart-components/cs_CZ.json @@ -278,5 +278,7 @@ "advancedSearch": "Rozšířené vyhledávání", "cv.termCreated": "{type} {term} byl úspěšně vytvořen", "cv.termUpdated": "{type} {term} byl úspěšně aktualizován", - "customFields.fieldTypes.DATE_PICKER": "Výběr data" + "customFields.fieldTypes.DATE_PICKER": "Výběr data", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/da.json b/translations/stripes-smart-components/da.json index 0e576b923..6f5bfbf39 100644 --- a/translations/stripes-smart-components/da.json +++ b/translations/stripes-smart-components/da.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/de.json b/translations/stripes-smart-components/de.json index 2d019245a..3f26cfa32 100644 --- a/translations/stripes-smart-components/de.json +++ b/translations/stripes-smart-components/de.json @@ -275,8 +275,10 @@ "error.conflict": "Sie bearbeiten gerade eine alte Version dieser Daten. Um die neueste Version zu laden, klicken Sie auf Abbrechen, aktualisieren Sie die Seite und versuchen Sie es erneut.", "editableList.actionsColumnHeader": "Aktionen", "customFields.option.deleteLabel": "Löschen", - "advancedSearch": "Advanced search", + "advancedSearch": "Erweiterte Suche", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/en_GB.json b/translations/stripes-smart-components/en_GB.json index 68e1a00eb..386c8664c 100644 --- a/translations/stripes-smart-components/en_GB.json +++ b/translations/stripes-smart-components/en_GB.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/en_SE.json b/translations/stripes-smart-components/en_SE.json index 68e1a00eb..386c8664c 100644 --- a/translations/stripes-smart-components/en_SE.json +++ b/translations/stripes-smart-components/en_SE.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/en_US.json b/translations/stripes-smart-components/en_US.json index 68e1a00eb..386c8664c 100644 --- a/translations/stripes-smart-components/en_US.json +++ b/translations/stripes-smart-components/en_US.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/es.json b/translations/stripes-smart-components/es.json index f81964702..f5ac62e07 100644 --- a/translations/stripes-smart-components/es.json +++ b/translations/stripes-smart-components/es.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/es_419.json b/translations/stripes-smart-components/es_419.json index f17cb8f5a..9f61bed2d 100644 --- a/translations/stripes-smart-components/es_419.json +++ b/translations/stripes-smart-components/es_419.json @@ -278,5 +278,7 @@ "advancedSearch": "Búsqueda Avanzada", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/es_ES.json b/translations/stripes-smart-components/es_ES.json index 226c96ee8..0d1d1f669 100644 --- a/translations/stripes-smart-components/es_ES.json +++ b/translations/stripes-smart-components/es_ES.json @@ -278,5 +278,7 @@ "advancedSearch": "Búsqueda avanzada", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/fr.json b/translations/stripes-smart-components/fr.json index 68e1a00eb..386c8664c 100644 --- a/translations/stripes-smart-components/fr.json +++ b/translations/stripes-smart-components/fr.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/fr_FR.json b/translations/stripes-smart-components/fr_FR.json index 4d9c9354c..fb2b1c156 100644 --- a/translations/stripes-smart-components/fr_FR.json +++ b/translations/stripes-smart-components/fr_FR.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/he.json b/translations/stripes-smart-components/he.json index e3bff7bfa..cc03cfe66 100644 --- a/translations/stripes-smart-components/he.json +++ b/translations/stripes-smart-components/he.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/hi_IN.json b/translations/stripes-smart-components/hi_IN.json index 68e1a00eb..386c8664c 100644 --- a/translations/stripes-smart-components/hi_IN.json +++ b/translations/stripes-smart-components/hi_IN.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/hu.json b/translations/stripes-smart-components/hu.json index 59306d6f4..cce7bf34f 100644 --- a/translations/stripes-smart-components/hu.json +++ b/translations/stripes-smart-components/hu.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/it_IT.json b/translations/stripes-smart-components/it_IT.json index 309aead60..19fd05e95 100644 --- a/translations/stripes-smart-components/it_IT.json +++ b/translations/stripes-smart-components/it_IT.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/ja.json b/translations/stripes-smart-components/ja.json index 374fb7ee3..09d44356a 100644 --- a/translations/stripes-smart-components/ja.json +++ b/translations/stripes-smart-components/ja.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "{type} {term} は正常に更新されました", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/ko.json b/translations/stripes-smart-components/ko.json index c3df9387c..17be65caf 100644 --- a/translations/stripes-smart-components/ko.json +++ b/translations/stripes-smart-components/ko.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/nb.json b/translations/stripes-smart-components/nb.json index 68e1a00eb..386c8664c 100644 --- a/translations/stripes-smart-components/nb.json +++ b/translations/stripes-smart-components/nb.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/nn.json b/translations/stripes-smart-components/nn.json index 68e1a00eb..386c8664c 100644 --- a/translations/stripes-smart-components/nn.json +++ b/translations/stripes-smart-components/nn.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/pl.json b/translations/stripes-smart-components/pl.json index 64629d48f..33c7127c9 100644 --- a/translations/stripes-smart-components/pl.json +++ b/translations/stripes-smart-components/pl.json @@ -264,12 +264,12 @@ "notes.displayAsPopup.label": "Display note as a pop-up", "notes.displayAsPopup.checkout": "Check out app", "notes.displayAsPopup.users": "Users app", - "notes.popupModal.label": "Note for patron", - "notes.popupModal.delete": "Delete note", + "notes.popupModal.label": "Uwaga dla czytelnika", + "notes.popupModal.delete": "Uwaga do usunięcia", "notes.close": "Zamknij", "customFields.noCustomFieldsFound": "No custom fields found", "customFields.fieldValue.whitespace": "Whitespace only character(s) is not allowed.", - "cddd.selectAllLoans": "Select all loans", + "cddd.selectAllLoans": "Wybierz wszystkie wypożyczenia", "cddd.selectLoan": "Select \"{loanName}\" loan", "actions": "Akcje", "error.conflict": "You are editing an old version of this data. To load the latest version click cancel, refresh the page and try again.", @@ -278,5 +278,7 @@ "advancedSearch": "Wyszukiwanie zaawansowane", "cv.termCreated": "{type} {term} został pomyślnie utworzony", "cv.termUpdated": "{type} {term} został pomyślnie zaktualizowany ", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/pt_BR.json b/translations/stripes-smart-components/pt_BR.json index a51c628c7..9f033c959 100644 --- a/translations/stripes-smart-components/pt_BR.json +++ b/translations/stripes-smart-components/pt_BR.json @@ -278,5 +278,7 @@ "advancedSearch": "Busca avançada", "cv.termCreated": "O {type} {term} foi criado com sucesso", "cv.termUpdated": "O {type} {term} foi atualizado com sucesso", - "customFields.fieldTypes.DATE_PICKER": "Seletor de data" + "customFields.fieldTypes.DATE_PICKER": "Seletor de data", + "editableList.confirmationModal.cancelLabel": "Não, não excluir", + "editableList.confirmationModal.confirmLabel": "Sim, excluir" } \ No newline at end of file diff --git a/translations/stripes-smart-components/pt_PT.json b/translations/stripes-smart-components/pt_PT.json index 19c15c11f..393cae384 100644 --- a/translations/stripes-smart-components/pt_PT.json +++ b/translations/stripes-smart-components/pt_PT.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/ru.json b/translations/stripes-smart-components/ru.json index 5aa43f37c..2f1569cdc 100644 --- a/translations/stripes-smart-components/ru.json +++ b/translations/stripes-smart-components/ru.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/sk.json b/translations/stripes-smart-components/sk.json index 68e1a00eb..386c8664c 100644 --- a/translations/stripes-smart-components/sk.json +++ b/translations/stripes-smart-components/sk.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/sv.json b/translations/stripes-smart-components/sv.json index 68e1a00eb..386c8664c 100644 --- a/translations/stripes-smart-components/sv.json +++ b/translations/stripes-smart-components/sv.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/ur.json b/translations/stripes-smart-components/ur.json index 4dd026a65..ffaa6af06 100644 --- a/translations/stripes-smart-components/ur.json +++ b/translations/stripes-smart-components/ur.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/zh_CN.json b/translations/stripes-smart-components/zh_CN.json index 21c9a4e01..795235365 100644 --- a/translations/stripes-smart-components/zh_CN.json +++ b/translations/stripes-smart-components/zh_CN.json @@ -276,7 +276,9 @@ "editableList.actionsColumnHeader": "操作", "customFields.option.deleteLabel": "删除", "advancedSearch": "高级搜索", - "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "cv.termCreated": "{type} {term} 已成功创建", + "cv.termUpdated": "{type} {term} 已成功更新", + "customFields.fieldTypes.DATE_PICKER": "日期选择器", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file diff --git a/translations/stripes-smart-components/zh_TW.json b/translations/stripes-smart-components/zh_TW.json index 4bc41c37e..303b8e02e 100644 --- a/translations/stripes-smart-components/zh_TW.json +++ b/translations/stripes-smart-components/zh_TW.json @@ -278,5 +278,7 @@ "advancedSearch": "Advanced search", "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker" + "customFields.fieldTypes.DATE_PICKER": "Date picker", + "editableList.confirmationModal.cancelLabel": "No, do not delete", + "editableList.confirmationModal.confirmLabel": "Yes, delete" } \ No newline at end of file From 55f649b7f621dbd36ab11c9948acfd2dda8a32c5 Mon Sep 17 00:00:00 2001 From: alb3rtino Date: Tue, 13 Feb 2024 12:43:46 +0100 Subject: [PATCH 15/26] STSMACOM-805 Set default title for Accordion in `` (#1439) --- CHANGELOG.md | 1 + .../EditCustomFieldsRecord/EditCustomFieldsRecord.js | 7 ++++++- .../tests/EditCustomFieldsRecord-test.js | 12 ++++++++++++ lib/CustomFields/readme.md | 2 ++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1d997661..02775221e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ * `` - added confirmation modal when deleting items. Refs STSMACOM-807. * Add `onComponentLoad` prop to ``. Refs STSMACOM-806. * Keep final form state when update request fails in ``. Refs STSMACOM-809. +* Set default title for Accordion in ``. Refs STSMACOM-805. ## [9.0.0](https://github.com/folio-org/stripes-smart-components/tree/v9.0.0) (2023-10-11) [Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v8.0.0...v9.0.0) diff --git a/lib/CustomFields/pages/EditCustomFieldsRecord/EditCustomFieldsRecord.js b/lib/CustomFields/pages/EditCustomFieldsRecord/EditCustomFieldsRecord.js index 52d3c752a..9d6f1ada8 100644 --- a/lib/CustomFields/pages/EditCustomFieldsRecord/EditCustomFieldsRecord.js +++ b/lib/CustomFields/pages/EditCustomFieldsRecord/EditCustomFieldsRecord.js @@ -56,6 +56,7 @@ const propTypes = { changeFinalFormField: PropTypes.func, changeReduxFormField: PropTypes.func, columnCount: PropTypes.number, + customFieldsLabel: PropTypes.node, entityType: PropTypes.string.isRequired, expanded: PropTypes.bool, fieldComponent: PropTypes.oneOfType([ @@ -83,11 +84,13 @@ const propTypes = { const defaultProps = { columnCount: 4, + customFieldsLabel: , isReduxForm: false, }; const EditCustomFieldsRecord = ({ accordionId, + customFieldsLabel, onComponentLoad, onToggle, expanded, @@ -123,6 +126,8 @@ const EditCustomFieldsRecord = ({ const visibleCustomFields = customFields?.filter(customField => customField.visible); const formattedCustomFields = chunk(visibleCustomFields, columnCount); const columnWidth = rowShapes / columnCount; + const customFieldsAccordionTitle = sectionTitle.value || customFieldsLabel; + const [isValid, setIsValid] = useState(true); const collectDataOptionsForSelect = (customField) => { @@ -313,7 +318,7 @@ const EditCustomFieldsRecord = ({ id={accordionId} onToggle={onToggle} label={sectionTitleLoaded - ? sectionTitle.value + ? customFieldsAccordionTitle : } > diff --git a/lib/CustomFields/pages/EditCustomFieldsRecord/tests/EditCustomFieldsRecord-test.js b/lib/CustomFields/pages/EditCustomFieldsRecord/tests/EditCustomFieldsRecord-test.js index 0cde35595..8490247ad 100644 --- a/lib/CustomFields/pages/EditCustomFieldsRecord/tests/EditCustomFieldsRecord-test.js +++ b/lib/CustomFields/pages/EditCustomFieldsRecord/tests/EditCustomFieldsRecord-test.js @@ -117,5 +117,17 @@ describe('EditCustomFieldsRecord', () => { expect(changeFinalFormField.calledWith('customFields.multi_select-2', ['opt_0', 'opt_1'])).to.be.true; }); }); + + describe('when there is no custom field label', () => { + beforeEach(function () { + this.server.get('/configurations/entries', () => ({ + configs: [], + })); + }); + + it('should show default accordion label', () => { + expect(editCustomFields.accordion.label).to.equal('Custom fields'); + }); + }); }); }); diff --git a/lib/CustomFields/readme.md b/lib/CustomFields/readme.md index d16fca73c..dc0eb0673 100644 --- a/lib/CustomFields/readme.md +++ b/lib/CustomFields/readme.md @@ -110,6 +110,7 @@ Name | type | description | required | default `accordionId` | string | used to set accordion id | true | `backendModuleName` | string | used to set correct `x-okapi-module-id` header when making requests to `mod-custom-fields`| true | `columnCount` | number | grid display in the same menner as other accordions in current page | false | 4 +`customFieldsLabel` | node | default accordion label | false | `` `customFieldsValues` | object | values for the custom fields | true | `entityType` | string | used to filter custom files by particular entity type | true | `expanded` | boolean | accordion open or closed | true | @@ -179,6 +180,7 @@ Name | type | description | required | default `accordionId` | string | used to set accordion id | true | `backendModuleName` | string | used to set correct `x-okapi-module-id` header when making requests to `mod-custom-fields`| true `columnCount` | number | grid display in the same manner as other accordions in current page | false | 4 +`customFieldsLabel` | node | default accordion label | false | `` `entityType` | string | used to filter custom files by particular entity type |true `expanded` | boolean | indicates if the accordion is open | true | `fieldComponent` | func | Field component | true | From dbfa8929075791cdd5fbf5722bb2eb69723be610 Mon Sep 17 00:00:00 2001 From: Denys Bohdan Date: Tue, 13 Feb 2024 17:16:28 +0100 Subject: [PATCH 16/26] STSMACOM-809 EditableList - keep changed values when request fails, but clear them when clicking cancel (#1445) --- lib/EditableList/EditableList.js | 11 ++++++++--- lib/EditableList/EditableListFinalForm.js | 1 - 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/EditableList/EditableList.js b/lib/EditableList/EditableList.js index e24a1b97e..8939a70c5 100644 --- a/lib/EditableList/EditableList.js +++ b/lib/EditableList/EditableList.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useMemo } from 'react'; import PropTypes from 'prop-types'; import sortBy from 'lodash/sortBy'; import EditableListFinalForm from './EditableListFinalForm'; @@ -55,11 +55,16 @@ const defaultProps = { const EditableList = (props) => { const { contentData, nameKey, formType } = props; - const items = sortBy(contentData, [t => t[nameKey] && t[nameKey].toLowerCase()]); const EditableListForm = (formType === 'redux-form') ? EditableListReduxForm : EditableListFinalForm; - return (); + + const initialValues = useMemo(() => { + const items = sortBy(contentData, [t => t[nameKey] && t[nameKey].toLowerCase()]); + + return { items }; + }, [contentData, nameKey]); + return (); }; EditableList.propTypes = propTypes; diff --git a/lib/EditableList/EditableListFinalForm.js b/lib/EditableList/EditableListFinalForm.js index 9694b8eea..731bf8444 100644 --- a/lib/EditableList/EditableListFinalForm.js +++ b/lib/EditableList/EditableListFinalForm.js @@ -10,7 +10,6 @@ export default stripesFinalForm({ navigationCheck: true, enableReinitialize: true, destroyOnUnmount: false, - keepDirtyOnReinitialize: true, // when update request fails with an error - keep unsaved changes in form })(props => Date: Tue, 13 Feb 2024 17:41:06 -0500 Subject: [PATCH 17/26] Lokalise: updates --- translations/stripes-smart-components/cs_CZ.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translations/stripes-smart-components/cs_CZ.json b/translations/stripes-smart-components/cs_CZ.json index 1db154a30..7a87070e7 100644 --- a/translations/stripes-smart-components/cs_CZ.json +++ b/translations/stripes-smart-components/cs_CZ.json @@ -279,6 +279,6 @@ "cv.termCreated": "{type} {term} byl úspěšně vytvořen", "cv.termUpdated": "{type} {term} byl úspěšně aktualizován", "customFields.fieldTypes.DATE_PICKER": "Výběr data", - "editableList.confirmationModal.cancelLabel": "No, do not delete", - "editableList.confirmationModal.confirmLabel": "Yes, delete" + "editableList.confirmationModal.cancelLabel": "Ne, nemazat", + "editableList.confirmationModal.confirmLabel": "Ano, smazat" } \ No newline at end of file From 909443f6c0624757b5633b162b740cb34a556c99 Mon Sep 17 00:00:00 2001 From: Denys Bohdan Date: Wed, 14 Feb 2024 14:58:54 +0100 Subject: [PATCH 18/26] STSMACOM-809 Dont add error property to EditableList fields when there is no validation error (#1447) --- lib/EditableList/ItemEdit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/EditableList/ItemEdit.js b/lib/EditableList/ItemEdit.js index 3e09fb8e5..6096f8d9b 100644 --- a/lib/EditableList/ItemEdit.js +++ b/lib/EditableList/ItemEdit.js @@ -45,7 +45,7 @@ const ItemEdit = ({ const fieldProps = { 'name': fieldName, 'aria-label': ariaLabel, - error: error?.fieldErrors?.[name], // pass error to custom field components + ...(error && { error: error.fieldErrors[name] }), // pass error to custom field components }; if (Object.hasOwnProperty.call(fieldComponents, name)) { From 36b3ffad4a329b3e0b82f5c59ffe1682a4b0820a Mon Sep 17 00:00:00 2001 From: Denys Bohdan Date: Thu, 15 Feb 2024 12:07:04 +0100 Subject: [PATCH 19/26] STSMACOM-810 `` - make `confirmationMessage` prop accept a function (#1444) --- CHANGELOG.md | 1 + lib/EditableList/EditableListForm.js | 5 +++-- lib/EditableList/readme.md | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02775221e..7e04819e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ * Add `onComponentLoad` prop to ``. Refs STSMACOM-806. * Keep final form state when update request fails in ``. Refs STSMACOM-809. * Set default title for Accordion in ``. Refs STSMACOM-805. +* `` - make `confirmationMessage` prop accept a function. Refs STSMACOM-810. ## [9.0.0](https://github.com/folio-org/stripes-smart-components/tree/v9.0.0) (2023-10-11) [Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v8.0.0...v9.0.0) diff --git a/lib/EditableList/EditableListForm.js b/lib/EditableList/EditableListForm.js index 8ec9d674c..9a03240e0 100644 --- a/lib/EditableList/EditableListForm.js +++ b/lib/EditableList/EditableListForm.js @@ -56,7 +56,7 @@ const propTypes = { */ columnWidths: PropTypes.object, confirmationHeading: PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.node]).isRequired, - confirmationMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired, + confirmationMessage: PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.node]).isRequired, confirmationCancelLabel: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), confirmationConfirmLabel: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), /** @@ -666,13 +666,14 @@ class EditableListForm extends React.Component { } const heading = typeof confirmationHeading === 'function' ? confirmationHeading(itemIdToDelete) : confirmationHeading; + const message = typeof confirmationMessage === 'function' ? confirmationMessage(itemIdToDelete) : confirmationMessage; return ( Date: Fri, 16 Feb 2024 12:50:17 +0100 Subject: [PATCH 20/26] STSMACOM-813 Don't use `form.getState` in `` because redux-form doesn't have this API. Initialization will happen automatically when fresh data has been loaded after edit. (#1448) --- CHANGELOG.md | 1 + lib/EditableList/EditableListForm.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e04819e0..ccfae1f3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ * Keep final form state when update request fails in ``. Refs STSMACOM-809. * Set default title for Accordion in ``. Refs STSMACOM-805. * `` - make `confirmationMessage` prop accept a function. Refs STSMACOM-810. +* Don't use `form.getState` in `` because redux-form doesn't have this API. Initialization will happen automatically when fresh data has been loaded after edit. Fixes STSMACOM-813. ## [9.0.0](https://github.com/folio-org/stripes-smart-components/tree/v9.0.0) (2023-10-11) [Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v8.0.0...v9.0.0) diff --git a/lib/EditableList/EditableListForm.js b/lib/EditableList/EditableListForm.js index 9a03240e0..0c7db3c79 100644 --- a/lib/EditableList/EditableListForm.js +++ b/lib/EditableList/EditableListForm.js @@ -325,7 +325,7 @@ class EditableListForm extends React.Component { // Set props.initialValues to the currently-saved field values. initializeValues = () => { const { initialize, form } = this.props; - (initialize || form.initialize)(form.getState().values); + (initialize || form.initialize)(); } onSave(fields, index) { From bc682bc7952508b6c476af093ab9056ede28788c Mon Sep 17 00:00:00 2001 From: Dmytro-Melnyshyn <77053927+Dmytro-Melnyshyn@users.noreply.github.com> Date: Fri, 23 Feb 2024 14:27:10 +0200 Subject: [PATCH 21/26] STSMACOM-812: - don't show an error after the user clicks on the edit icon. (#1449) --- CHANGELOG.md | 1 + lib/EditableList/EditableListForm.js | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ccfae1f3d..e4e8b7be4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ * Set default title for Accordion in ``. Refs STSMACOM-805. * `` - make `confirmationMessage` prop accept a function. Refs STSMACOM-810. * Don't use `form.getState` in `` because redux-form doesn't have this API. Initialization will happen automatically when fresh data has been loaded after edit. Fixes STSMACOM-813. +* `` - don't show an error after the user clicks on the edit icon. Fixes STSMACOM-812. ## [9.0.0](https://github.com/folio-org/stripes-smart-components/tree/v9.0.0) (2023-10-11) [Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v8.0.0...v9.0.0) diff --git a/lib/EditableList/EditableListForm.js b/lib/EditableList/EditableListForm.js index 0c7db3c79..f41e5c3a6 100644 --- a/lib/EditableList/EditableListForm.js +++ b/lib/EditableList/EditableListForm.js @@ -502,6 +502,7 @@ class EditableListForm extends React.Component { newState.status = buildStatusArray(this.props.contentData); } newState.status[index].editing = !newState.status[index].editing; + newState.status[index].error = false; newState.lastAction = new Date().getTime(); return newState; }); From 530b7f383c003e3096ee9214c3857d8de663941a Mon Sep 17 00:00:00 2001 From: FOLIO Translations Bot <38661258+folio-translations@users.noreply.github.com> Date: Fri, 1 Mar 2024 16:43:44 -0500 Subject: [PATCH 22/26] Lokalise: updates --- translations/stripes-smart-components/ja.json | 4 ++-- translations/stripes-smart-components/pl.json | 16 ++++++++-------- translations/stripes-smart-components/pt_BR.json | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/translations/stripes-smart-components/ja.json b/translations/stripes-smart-components/ja.json index 09d44356a..abaf0b110 100644 --- a/translations/stripes-smart-components/ja.json +++ b/translations/stripes-smart-components/ja.json @@ -279,6 +279,6 @@ "cv.termCreated": "The {type} {term} was successfully created", "cv.termUpdated": "{type} {term} は正常に更新されました", "customFields.fieldTypes.DATE_PICKER": "Date picker", - "editableList.confirmationModal.cancelLabel": "No, do not delete", - "editableList.confirmationModal.confirmLabel": "Yes, delete" + "editableList.confirmationModal.cancelLabel": "いいえ、削除しません", + "editableList.confirmationModal.confirmLabel": "はい、削除します" } \ No newline at end of file diff --git a/translations/stripes-smart-components/pl.json b/translations/stripes-smart-components/pl.json index 33c7127c9..634fb5d89 100644 --- a/translations/stripes-smart-components/pl.json +++ b/translations/stripes-smart-components/pl.json @@ -69,7 +69,7 @@ "cddd.date": "Data", "cddd.time": "Czas", "searchResultsCountHeader": "{count, number} {count, plural, one {znaleziony rekord} other {znalezione rekordy}}", - "tags": "Etykiety", + "tags": "Tagi", "numberOfTags": "{count, number} {count, plural, one {Etykieta} other {Etykiety}}", "deleteTag": "Usuń znacznik", "enterATag": "Wprowadź etykietę.", @@ -156,7 +156,7 @@ "address.noAddressesStored": "- Brak zapisanych adresów -", "notes.assigned.count": "# przypisania", "notes.cautionMessage": "Uwagi z jednym przypisaniem nie mogą zostać anulowane.", - "cddd.header.requests": "Zamówienia", + "cddd.header.requests": "Rezerwacje", "cddd.itemHasBeenRecalled": "Egzemplarz został wycofany", "notes.type": "Typ uwagi", "notes.type.general": "Uwaga ogólna", @@ -177,7 +177,7 @@ "feesfines.policy.lost.duplicate": "Nazwa polityki opłat za zagubienie egzemplarza już istnieje. Wprowadź inną nazwę.", "reset": "Resetowanie", "notes.assignUnassignAll": "Przypisz / Usuń przypisanie wszystkich uwag", - "customFields": "Pola niestandardowe", + "customFields": "Pola własne", "customFields.edit": "Edytuj", "customFields.editCustomFields": "Edytuj pola niestandardowe", "customFields.metadata.createdBy": "Utworzone przez: {userName} {date}", @@ -199,9 +199,9 @@ "customFields.fieldName.noSet": "Brak etykiety", "customFields.settings.sectionTitle": "Tytuł sekcji", "customFields.settings.accordion.hidden": "(Ukryty)", - "customFields.recordAccordion.defaultName": "Pola niestandardowe", + "customFields.recordAccordion.defaultName": "Pola własne", "customFields.errorOccurred": "Nie można zaktualizować z powodu błędu modułu. Proszę, spróbuj ponownie. Jeśli problem będzie się powtarzał, skontaktuj się z administratorem systemu.", - "cddd.header.effectiveCallNumber": "Sygnatura", + "cddd.header.effectiveCallNumber": "Sygnatura całkowita", "cddd.itemDeclaredLost": "Nie udało się zmienić terminu zwrotu: Zgłoszono zagubienie egzemplarza", "cddd.itemDeclaredLostWarning": "Zgłoszono zagubienie egzemplarza", "customFields.required.checked": "Tak", @@ -215,7 +215,7 @@ "cddd.changeSucceededWithFailures": "{failed} terminy zwrotu nie uległy zmianie. {succeeded} terminy zwrotu pomyślnie zmienione.", "customFields.fieldTypes.TEXTFIELD": "Pole tekstowe", "customFields.fieldTypes.TEXTAREA": "Obszar tekstowy", - "customFields.fieldTypes.CHECKBOX": "Pole wyboru", + "customFields.fieldTypes.CHECKBOX": "Checkbox", "customFields.fieldTypes.SELECT": "Pojedynczy wybór", "customFields.dropdown.label": "Etykieta", "customFields.dropdown.code": "Kod", @@ -239,7 +239,7 @@ "customFields.dragDrop.notOverDroppable": "Obecnie nie znajdujesz się nad obszarem, na którym można upuścić", "customFields.dragDrop.moved": "Przeniosłeś pole {name} z pozycji {start} na pozycję {end}", "customFields.dragDrop.returned": "Pole {name} zostało przywrócone do pozycji wyjściowej {position}", - "customFields.fieldTypes.RADIO_BUTTON": "Ustawienie przycisku radiowego", + "customFields.fieldTypes.RADIO_BUTTON": "Jednokrotny wybór", "cddd.itemClaimedReturned": "Zmiana terminu zwrotu nie powiodła się: egzemplarz został zwrócony", "cddd.itemClaimedReturnedWarning": "Egzemplarz jest w statusie Żądania zwrotu", "customFields.settings.accordionTitle": "Tytuł harmonijki", @@ -260,7 +260,7 @@ "address.primary": "Główny", "ll.remoteLabel": "Zdalny", "columnManager.showColumns": "Pokaż kolumny", - "address.alternate": "Alternate", + "address.alternate": "Alternatywny", "notes.displayAsPopup.label": "Display note as a pop-up", "notes.displayAsPopup.checkout": "Check out app", "notes.displayAsPopup.users": "Users app", diff --git a/translations/stripes-smart-components/pt_BR.json b/translations/stripes-smart-components/pt_BR.json index 9f033c959..ae54c781a 100644 --- a/translations/stripes-smart-components/pt_BR.json +++ b/translations/stripes-smart-components/pt_BR.json @@ -240,8 +240,8 @@ "customFields.dragDrop.moved": "Você moveu o campo {name} da posição {start} para a posição {end}", "customFields.dragDrop.returned": "O campo {name} foi retornado à sua posição inicial de {position}", "customFields.fieldTypes.RADIO_BUTTON": "Conjunto de botões de opção", - "cddd.itemClaimedReturned": "Falha na alteração da data de vencimento: o item está alegado como devolvido", - "cddd.itemClaimedReturnedWarning": "O item foi alegado como devolvido", + "cddd.itemClaimedReturned": "Falha na alteração da data de vencimento: o item está supostamente devolvido", + "cddd.itemClaimedReturnedWarning": "O item foi supostamente devolvido", "customFields.settings.accordionTitle": "Título do acordeão", "customFields.select.placeholder": "Selecione um {fieldLabel}", "customFields.new": "Novo", @@ -253,9 +253,9 @@ "clipCopy.success": "Copiado \"{text}\" com sucesso para a área de transferência.", "cannotSaveNewTag": "Não é possível criar uma nova tag: você pode não ter as permissões necessárias.", "cannotSaveTagToRecord": "Não é possível salvar os dados da tag para gravar. Verifique se você possui as permissões necessárias.", - "cddd.itemAgedToLostWarning": "Item tem tempo para ser considerado perdido", + "cddd.itemAgedToLostWarning": "Item com tempo para ser considerado perdido", "customFields.dropdown.default": "Valor padrão", - "cddd.itemAgedToLost": "Falha na alteração da data de vencimento: o item está envelhecido para perdido", + "cddd.itemAgedToLost": "Falha na alteração da data de vencimento: o item está com tempo para ser considerado perdido", "success.message": "A {entry} {name} foi {action} com sucesso.", "address.primary": "Primário", "ll.remoteLabel": "Remoto", From f5ef602971225888230034a609bdb5c5da2f8aca Mon Sep 17 00:00:00 2001 From: FOLIO Translations Bot <38661258+folio-translations@users.noreply.github.com> Date: Tue, 12 Mar 2024 21:06:05 -0400 Subject: [PATCH 23/26] Lokalise: updates --- translations/stripes-smart-components/cs_CZ.json | 2 +- translations/stripes-smart-components/de.json | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/translations/stripes-smart-components/cs_CZ.json b/translations/stripes-smart-components/cs_CZ.json index 7a87070e7..7eb4a40a9 100644 --- a/translations/stripes-smart-components/cs_CZ.json +++ b/translations/stripes-smart-components/cs_CZ.json @@ -73,7 +73,7 @@ "numberOfTags": "{count, number} {count, plural, one {Štítek} other {Štítků}}", "deleteTag": "Odstranit štítek", "enterATag": "Zadat štítek.", - "tagsTextArea": "Textová oblast štítku", + "tagsTextArea": "Textová oblast tagu", "addTag": "Přidat", "addNew": "Přidat nový", "newTagCreated": "Byl vytvořen nový štítek", diff --git a/translations/stripes-smart-components/de.json b/translations/stripes-smart-components/de.json index 3f26cfa32..5b3c372f7 100644 --- a/translations/stripes-smart-components/de.json +++ b/translations/stripes-smart-components/de.json @@ -276,9 +276,9 @@ "editableList.actionsColumnHeader": "Aktionen", "customFields.option.deleteLabel": "Löschen", "advancedSearch": "Erweiterte Suche", - "cv.termCreated": "The {type} {term} was successfully created", - "cv.termUpdated": "The {type} {term} was successfully updated", - "customFields.fieldTypes.DATE_PICKER": "Date picker", - "editableList.confirmationModal.cancelLabel": "No, do not delete", - "editableList.confirmationModal.confirmLabel": "Yes, delete" + "cv.termCreated": "Der {type} {term} wurde erfolgreich erstellt ", + "cv.termUpdated": "Der {type} {term} wurde erfolgreich aktualisiert ", + "customFields.fieldTypes.DATE_PICKER": "Datumsauswahl", + "editableList.confirmationModal.cancelLabel": "Nein, nicht löschen", + "editableList.confirmationModal.confirmLabel": "Ja, löschen" } \ No newline at end of file From df32f0db3a1ae2cd4238f9c36c0e66c9c12cf626 Mon Sep 17 00:00:00 2001 From: Zak Burke Date: Wed, 13 Mar 2024 12:35:13 -0400 Subject: [PATCH 24/26] bump minor to 9.2.0 for new development (#1456) --- CHANGELOG.md | 10 +++++++++- package.json | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4e8b7be4..616610b95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Change history for stripes-smart-components -## 9.1.0 IN PROGRESS +## 9.2.0 IN PROGRESS + +## [9.1.0](https://github.com/folio-org/stripes-smart-components/tree/v9.1.0) (2024-03-13) +[Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v9.0.1...v9.1.0) * Added `inputType` prop to `` component to support both input and textarea search boxes. Refs STSMACOM-786. * Export new `advancedSearchQueryToRows` helper to be used in Inventory app to reduce code duplication. Refs STSMACOM-787. @@ -28,6 +31,11 @@ * Don't use `form.getState` in `` because redux-form doesn't have this API. Initialization will happen automatically when fresh data has been loaded after edit. Fixes STSMACOM-813. * `` - don't show an error after the user clicks on the edit icon. Fixes STSMACOM-812. +## [9.0.1](https://github.com/folio-org/stripes-smart-components/tree/v9.0.1) (2023-10-25) +[Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v9.0.0...v9.0.1) + +* add default parameters to `onSubmit`, `submitAll` internal SASQ handlers. Refs STSMACOM-785, STSMACOM-775. + ## [9.0.0](https://github.com/folio-org/stripes-smart-components/tree/v9.0.0) (2023-10-11) [Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v8.0.0...v9.0.0) diff --git a/package.json b/package.json index 6913422e7..0fcf57912 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@folio/stripes-smart-components", - "version": "9.1.0", + "version": "9.2.0", "description": "Connected Stripes components", "repository": "folio-org/stripes-smart-components", "sideEffects": [ From 12cb7ef8690c5869741a050ee7339719a9ea20ff Mon Sep 17 00:00:00 2001 From: John Coburn Date: Thu, 14 Mar 2024 13:36:49 -0500 Subject: [PATCH 25/26] STSMACOM-816 Safely render HTML in Note template (#1453) * clean markup with dompurify.sanitize() * log changes * update lockfile * filter html in noteslist --- CHANGELOG.md | 1 + .../components/NoteView/NoteView.js | 4 +- .../components/NoteView/tests/interactor.js | 10 +++- .../NoteView/tests/note-view-test.js | 52 +++++++++++++++++++ .../components/NotesList/NotesList.js | 5 +- package.json | 1 + yarn.lock | 5 ++ 7 files changed, 74 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 616610b95..7140758bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ * `` - make `confirmationMessage` prop accept a function. Refs STSMACOM-810. * Don't use `form.getState` in `` because redux-form doesn't have this API. Initialization will happen automatically when fresh data has been loaded after edit. Fixes STSMACOM-813. * `` - don't show an error after the user clicks on the edit icon. Fixes STSMACOM-812. +* Safely render user-provided markup in `` component. Fixes STSMACOM-816. ## [9.0.1](https://github.com/folio-org/stripes-smart-components/tree/v9.0.1) (2023-10-25) [Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v9.0.0...v9.0.1) diff --git a/lib/Notes/NoteViewPage/components/NoteView/NoteView.js b/lib/Notes/NoteViewPage/components/NoteView/NoteView.js index 041291857..5b7ede8d6 100644 --- a/lib/Notes/NoteViewPage/components/NoteView/NoteView.js +++ b/lib/Notes/NoteViewPage/components/NoteView/NoteView.js @@ -3,6 +3,8 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import get from 'lodash/get'; +import dompurify from 'dompurify'; + import { IfPermission, AppIcon, @@ -225,7 +227,7 @@ export default class NoteView extends Component { assigned, } = this.state.sections; - const noteContentMarkup = { __html: noteData.content }; + const noteContentMarkup = { __html: dompurify.sanitize(noteData.content) }; const paneTitle = noteData.title; diff --git a/lib/Notes/NoteViewPage/components/NoteView/tests/interactor.js b/lib/Notes/NoteViewPage/components/NoteView/tests/interactor.js index 333343a32..a737557ad 100644 --- a/lib/Notes/NoteViewPage/components/NoteView/tests/interactor.js +++ b/lib/Notes/NoteViewPage/components/NoteView/tests/interactor.js @@ -3,7 +3,8 @@ import { scoped, clickable, text, - isPresent + isPresent, + computed, } from '@bigtest/interactor'; import { AccordionInteractor } from '@folio/stripes-components/lib/Accordion/tests/interactor'; @@ -12,6 +13,12 @@ import NoValueInteractor from '@folio/stripes-components/lib/NoValue/tests/inter import ReferredRecordInteractor from '../../../../components/ReferredRecord/tests/interactor'; +function markup(selector) { + return computed(function () { + return this.$(selector).innerHTML; + }); +} + export default interactor(class NoteViewInteractor { static defaultScope = '[data-test-note-view]'; @@ -26,4 +33,5 @@ export default interactor(class NoteViewInteractor { metaSection = MetaSectionInteractor(); hasEmptyNoteType = isPresent(`[data-test-note-view-note-type] ${NoValueInteractor.defaultScope}`); hasEmptyNoteTitle = isPresent(`[data-test-note-view-note-title] ${NoValueInteractor.defaultScope}`); + noteContentText = markup('[data-test-note-view-note-details]'); }); diff --git a/lib/Notes/NoteViewPage/components/NoteView/tests/note-view-test.js b/lib/Notes/NoteViewPage/components/NoteView/tests/note-view-test.js index 53ab53f7a..90f623327 100644 --- a/lib/Notes/NoteViewPage/components/NoteView/tests/note-view-test.js +++ b/lib/Notes/NoteViewPage/components/NoteView/tests/note-view-test.js @@ -31,6 +31,18 @@ const noteData = { type: 'General note', }; +const noteWithContentData = { + ...noteData, + content: 'Message is rendered', +}; + +const noteWithSusContentData = { + ...noteData, + content: 'Message is renderedlink', +}; + +const cleanContent = 'Message is renderedlink'; + describe('NoteView', () => { const noteView = new NoteViewInteractor(); @@ -112,4 +124,44 @@ describe('NoteView', () => { expect(noteView.insertedReferredRecord.isPresent).to.be.true; }); }); + + describe('rendering NoteView component with content', () => { + setupApplication(); + + beforeEach(async () => { + await mount( +
Test
} + /> + ); + }); + + it('should display note content', () => { + expect(noteView.noteContentText).to.equal(noteWithContentData.content); + }); + }); + + describe('rendering NoteView component with suspicious content', () => { + setupApplication(); + + beforeEach(async () => { + await mount( +
Test
} + /> + ); + }); + + it('should screen suspicious content for display', () => { + expect(noteView.noteContentText).to.equal(cleanContent); + }); + }); }); diff --git a/lib/Notes/components/NotesAccordion/components/NotesList/NotesList.js b/lib/Notes/components/NotesAccordion/components/NotesList/NotesList.js index a818b35bb..670b677a0 100644 --- a/lib/Notes/components/NotesAccordion/components/NotesList/NotesList.js +++ b/lib/Notes/components/NotesAccordion/components/NotesList/NotesList.js @@ -1,5 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; +import dompurify from 'dompurify'; import { FormattedMessage, FormattedDate, @@ -126,9 +127,9 @@ class NotesList extends React.Component { ); - const htmlString = isDetailsExpanded[id] + const htmlString = dompurify.sanitize(isDetailsExpanded[id] ? content - : getHTMLSubstring(content, DETAILS_CUTOFF_LENGTH); + : getHTMLSubstring(content, DETAILS_CUTOFF_LENGTH)); const detailsContent = content && (
diff --git a/package.json b/package.json index 0fcf57912..6ca2d6697 100644 --- a/package.json +++ b/package.json @@ -80,6 +80,7 @@ "dependencies": { "@rehooks/local-storage": "2.4.4", "classnames": "^2.2.6", + "dompurify": "^3.0.9", "final-form": "^4.18.2", "final-form-arrays": "^3.0.2", "lodash": "^4.17.4", diff --git a/yarn.lock b/yarn.lock index 56acca33f..5d7f9a5f0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5144,6 +5144,11 @@ domhandler@^5.0.2, domhandler@^5.0.3: dependencies: domelementtype "^2.3.0" +dompurify@^3.0.9: + version "3.0.9" + resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.0.9.tgz#b3f362f24b99f53498c75d43ecbd784b0b3ad65e" + integrity sha512-uyb4NDIvQ3hRn6NiC+SIFaP4mJ/MdXlvtunaqK9Bn6dD3RuB/1S/gasEjDHD8eiaqdSael2vBv+hOs7Y+jhYOQ== + domutils@^2.5.2, domutils@^2.8.0: version "2.8.0" resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135" From d3acab34f111adca1467f58ef8451b5ec7381835 Mon Sep 17 00:00:00 2001 From: Denys Bohdan Date: Fri, 15 Mar 2024 17:02:50 +0100 Subject: [PATCH 26/26] STSMACOM-820 Fix incorrect state calculation in (#1458) * STSMACOM-820 Fix incorrect state calculation in * STSMACOM-820 added tests for SearchAndSortQuery initial value set case --- CHANGELOG.md | 4 ++++ lib/SearchAndSort/SearchAndSortQuery.js | 19 ++++++++++++++++--- .../SASQTestHarness.js | 13 +++++++++++++ .../SearchAndSortQuery-test.js | 12 +++++++++++- 4 files changed, 44 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7140758bf..e98f1aa20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## 9.2.0 IN PROGRESS +## [9.1.1] (IN PROGRESS) + +* Fix incorrect state calculation in ``. Fixes STSMACOM-820. + ## [9.1.0](https://github.com/folio-org/stripes-smart-components/tree/v9.1.0) (2024-03-13) [Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v9.0.1...v9.1.0) diff --git a/lib/SearchAndSort/SearchAndSortQuery.js b/lib/SearchAndSort/SearchAndSortQuery.js index 9c795534e..57abcc3de 100644 --- a/lib/SearchAndSort/SearchAndSortQuery.js +++ b/lib/SearchAndSort/SearchAndSortQuery.js @@ -326,15 +326,28 @@ class SearchAndSortQuery extends React.Component { this.setState(curState => { const nextState = Object.assign({}, curState, stateToSet); nextState.changeType = changeType; + + // calculate full next state, leave calculation of `searchChanged`, `filterChanged` etc flags until we actually have the full next state + return queryStateReducer(curState, nextState); + }); + /* React will batch these two setState calls and only one re-render will happen. + this second call will have the result of first one as curState so now we can actually compare current state and initial values to determine + if current values match initial values + */ + this.setState(curState => { + const nextState = {}; nextState.searchChanged = !isEqual( - nextState.searchFields, + curState.searchFields, curState.default.searchFields ); nextState.filterChanged = !isEqual( - nextState.filterFields, + curState.filterFields, curState.default.filterFields ); - nextState.sortChanged = !isEqual(nextState.sortFields, curState.default.sortFields); + nextState.sortChanged = !isEqual( + curState.sortFields, + curState.default.sortFields, + ); return queryStateReducer(curState, nextState); }, () => { diff --git a/lib/SearchAndSort/tests/SearchAndSortQueryTests/SASQTestHarness.js b/lib/SearchAndSort/tests/SearchAndSortQueryTests/SASQTestHarness.js index 92fc35cfd..9b1e1d954 100644 --- a/lib/SearchAndSort/tests/SearchAndSortQueryTests/SASQTestHarness.js +++ b/lib/SearchAndSort/tests/SearchAndSortQueryTests/SASQTestHarness.js @@ -50,6 +50,19 @@ const SASQTestHarness = ({ displayName: 'inactive', } ], + }, + { + label: 'Patron group', + name:'patronGroup', + values:[{ + name: 'faculty', + displayName: 'faculty', + }, + { + name: 'staff', + displayName: 'staff', + } + ], } ]; diff --git a/lib/SearchAndSort/tests/SearchAndSortQueryTests/SearchAndSortQuery-test.js b/lib/SearchAndSort/tests/SearchAndSortQueryTests/SearchAndSortQuery-test.js index b4d0ad90a..20fa40e5c 100644 --- a/lib/SearchAndSort/tests/SearchAndSortQueryTests/SearchAndSortQuery-test.js +++ b/lib/SearchAndSort/tests/SearchAndSortQueryTests/SearchAndSortQuery-test.js @@ -57,7 +57,6 @@ describe('SearchAndSortQuery Navigation', () => { }); }); - describe('navigating to a qindex parameter', () => { beforeEach(async () => { await Button('test-qindex-nav').click(); @@ -108,5 +107,16 @@ describe('SearchAndSortQuery Navigation', () => { return HTML(including('?qindex=title&query=testSearch')).exists(); }); }); + + describe('when unselecting default filter, selecting another one and selecting default filter again', () => { + beforeEach(async () => { + await Checkbox('active').click(); + await Checkbox('staff').click(); + await Checkbox('active').click(); + }); + it('should have both filters selected', () => { + return HTML(including('?filters=patronGroup.staff%2Cstatus.active&qindex=title&query=testSearch')).exists(); + }); + }); }); });