diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fc645df1..530b54ab7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ * Add job profile details pane on choose job profile page (UIDATIMP-258) * Fix file extension validation by making it case insensitive (UIDATIMP-252) * Add associated job profiles search on action profile details pane (UIDATIMP-217) +* Integrate updated MultiColumnList component (UIDATIMP-276) ## [1.4.0](https://github.com/folio-org/ui-data-import/tree/v1.4.0) (2019-08-02) * Create data import settings page's 3rd pane for action profiles (UIDATIMP-8) diff --git a/src/components/ListView/ListView.js b/src/components/ListView/ListView.js index d7fbf405a..a002352d5 100644 --- a/src/components/ListView/ListView.js +++ b/src/components/ListView/ListView.js @@ -66,6 +66,7 @@ export class ListView extends Component { record: null, hasLoaded: false, }, + checkboxList: {}, }; state = { @@ -165,6 +166,12 @@ export class ListView extends Component { /> ); + rowUpdater = ({ id }) => { + const { checkboxList: { selectedRecords } } = this.props; + + return selectedRecords.has(id); + }; + render() { const { resources, @@ -200,6 +207,7 @@ export class ListView extends Component { const urlQuery = queryString.parse(search); const searchTerm = trimSearchTerm(urlQuery.query); const actionMenu = isEmpty(actionMenuItems) ? null : this.renderActionMenu; + const rowUpdater = selectedRecords ? this.rowUpdater : undefined; return ( @@ -246,6 +254,7 @@ export class ListView extends Component { editRecordInitialValuesAreLoaded={selectedRecord.hasLoaded} showSingleResult={showSingleResult} onSubmitSearch={deselectAll} + rowUpdater={rowUpdater} {...props} /> selectedRecords.has(id); + return (
{ + const { checkboxList: { selectedRecords } } = this.props; + + return selectedRecords.has(id); + }; + render() { const { onClose, @@ -408,6 +414,7 @@ export class ViewMatchProfile extends Component { selectRecord, selectedRecords, })} + rowUpdater={this.rowUpdater} /> )} diff --git a/test/bigtest/tests/action-profiles/action-profile-details-test.js b/test/bigtest/tests/action-profiles/action-profile-details-test.js index 68936f429..cd05a4e73 100644 --- a/test/bigtest/tests/action-profiles/action-profile-details-test.js +++ b/test/bigtest/tests/action-profiles/action-profile-details-test.js @@ -112,9 +112,7 @@ describe('Action Profile View', () => { expect(actionProfileDetails.associatedJobProfiles.list.rowCount).to.be.equal(3); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('has select all checkbox', () => { + describe('has select all checkbox', () => { beforeEach(async () => { await actionProfileDetails.associatedJobProfiles.selectAllCheckBox.clickAndBlur(); }); @@ -152,9 +150,7 @@ describe('Action Profile View', () => { }); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('has select individual item checkbox', () => { + describe('has select individual item checkbox', () => { beforeEach(async () => { await actionProfileDetails.associatedJobProfiles.checkBoxes(0).clickAndBlur(); }); diff --git a/test/bigtest/tests/action-profiles/action-profiles-test.js b/test/bigtest/tests/action-profiles/action-profiles-test.js index e845be2d7..d1cc19a62 100644 --- a/test/bigtest/tests/action-profiles/action-profiles-test.js +++ b/test/bigtest/tests/action-profiles/action-profiles-test.js @@ -53,9 +53,7 @@ describe('Action profiles', () => { expect(actionProfiles.list.headers(6).text).to.equal(translation.updatedBy); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('has select all checkbox', () => { + describe('has select all checkbox', () => { beforeEach(async () => { await actionProfiles.selectAllCheckBox.clickAndBlur(); }); @@ -65,9 +63,7 @@ describe('Action profiles', () => { }); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('has select individual item checkbox', () => { + describe('has select individual item checkbox', () => { beforeEach(async () => { await actionProfiles.checkBoxes(0).clickAndBlur(); }); @@ -87,9 +83,7 @@ describe('Action profiles', () => { }); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('select all button', () => { + describe('select all button', () => { beforeEach(async () => { await actionProfiles.actionMenu.click(); await actionProfiles.actionMenu.selectAllButton.click(); @@ -102,9 +96,7 @@ describe('Action profiles', () => { }); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('deselect all button', () => { + describe('deselect all button', () => { beforeEach(async () => { await actionProfiles.checkBoxes(0).clickAndBlur(); await actionProfiles.checkBoxes(1).clickAndBlur(); diff --git a/test/bigtest/tests/job-profiles/job-profiles-test.js b/test/bigtest/tests/job-profiles/job-profiles-test.js index a4fadf7eb..46ce832ab 100644 --- a/test/bigtest/tests/job-profiles/job-profiles-test.js +++ b/test/bigtest/tests/job-profiles/job-profiles-test.js @@ -63,9 +63,7 @@ describe('Job profiles', () => { }); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('has select all checkbox', () => { + describe('has select all checkbox', () => { beforeEach(async () => { await jobProfiles.selectAllCheckBox.clickAndBlur(); }); @@ -75,9 +73,7 @@ describe('Job profiles', () => { }); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('has select individual item checkbox', () => { + describe('has select individual item checkbox', () => { beforeEach(async () => { await jobProfiles.checkBoxes(0).clickAndBlur(); }); @@ -87,9 +83,7 @@ describe('Job profiles', () => { }); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('select all checkbox', () => { + describe('select all checkbox', () => { beforeEach(async () => { await jobProfiles.selectAllCheckBox.clickAndBlur(); }); @@ -123,9 +117,7 @@ describe('Job profiles', () => { }); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('select all button', () => { + describe('select all button', () => { beforeEach(async () => { await jobProfiles.actionMenu.click(); await jobProfiles.actionMenu.selectAllButton.click(); @@ -138,9 +130,7 @@ describe('Job profiles', () => { }); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('deselect all button', () => { + describe('deselect all button', () => { beforeEach(async () => { await jobProfiles.checkBoxes(0).clickAndBlur(); await jobProfiles.checkBoxes(1).clickAndBlur(); @@ -166,9 +156,7 @@ describe('Job profiles', () => { }); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('when using search', () => { + describe('when using search', () => { beforeEach(async () => { await jobProfiles.checkBoxes(0).clickAndBlur(); await jobProfiles.checkBoxes(1).clickAndBlur(); @@ -183,9 +171,7 @@ describe('Job profiles', () => { }); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('when clearing search', () => { + describe('when clearing search', () => { beforeEach(async () => { await jobProfiles.searchFiled.fill('acq'); await jobProfiles.searchSubmitButton.click(); diff --git a/test/bigtest/tests/mapping-profiles/mapping-profiles-test.js b/test/bigtest/tests/mapping-profiles/mapping-profiles-test.js index 2e542fce5..00519edbe 100644 --- a/test/bigtest/tests/mapping-profiles/mapping-profiles-test.js +++ b/test/bigtest/tests/mapping-profiles/mapping-profiles-test.js @@ -52,9 +52,7 @@ describe('Mapping profiles', () => { expect(mappingProfiles.list.headers(5).text).to.equal(translation.updatedBy); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('has select all checkbox', () => { + describe('has select all checkbox', () => { beforeEach(async () => { await mappingProfiles.selectAllCheckBox.clickAndBlur(); }); @@ -64,9 +62,7 @@ describe('Mapping profiles', () => { }); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('has select individual item checkbox', () => { + describe('has select individual item checkbox', () => { beforeEach(async () => { await mappingProfiles.checkBoxes(0).clickAndBlur(); }); diff --git a/test/bigtest/tests/match-profiles/match-profile-details-test.js b/test/bigtest/tests/match-profiles/match-profile-details-test.js index e65bc11ef..73ab2ff45 100644 --- a/test/bigtest/tests/match-profiles/match-profile-details-test.js +++ b/test/bigtest/tests/match-profiles/match-profile-details-test.js @@ -59,9 +59,7 @@ describe('Match Profile View', () => { expect(matchProfileDetails.associatedJobProfiles.list.rowCount).to.be.equal(3); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('has select all checkbox', () => { + describe('has select all checkbox', () => { beforeEach(async () => { await matchProfileDetails.associatedJobProfiles.selectAllCheckBox.clickAndBlur(); }); @@ -99,9 +97,7 @@ describe('Match Profile View', () => { }); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('has select individual item checkbox', () => { + describe('has select individual item checkbox', () => { beforeEach(async () => { await matchProfileDetails.associatedJobProfiles.checkBoxes(0).clickAndBlur(); }); diff --git a/test/bigtest/tests/match-profiles/match-profiles-test.js b/test/bigtest/tests/match-profiles/match-profiles-test.js index ba28ffe30..e943746f7 100644 --- a/test/bigtest/tests/match-profiles/match-profiles-test.js +++ b/test/bigtest/tests/match-profiles/match-profiles-test.js @@ -81,9 +81,7 @@ describe('Match profiles', () => { }); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('has select all checkbox', () => { + describe('has select all checkbox', () => { beforeEach(async () => { await matchProfiles.selectAllCheckBox.clickAndBlur(); }); @@ -93,9 +91,7 @@ describe('Match profiles', () => { }); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('has select individual item checkbox', () => { + describe('has select individual item checkbox', () => { beforeEach(async () => { await matchProfiles.checkBoxes(0).clickAndBlur(); }); @@ -105,9 +101,7 @@ describe('Match profiles', () => { }); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('has select individual item checkbox', () => { + describe('has select individual item checkbox', () => { beforeEach(async () => { await matchProfiles.checkBoxes(0).clickAndBlur(); }); @@ -117,9 +111,7 @@ describe('Match profiles', () => { }); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('select all checkbox', () => { + describe('select all checkbox', () => { beforeEach(async () => { await matchProfiles.selectAllCheckBox.clickAndBlur(); }); @@ -153,9 +145,7 @@ describe('Match profiles', () => { }); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('select all button', () => { + describe('select all button', () => { beforeEach(async () => { await matchProfiles.actionMenu.click(); await matchProfiles.actionMenu.selectAllButton.click(); @@ -168,9 +158,7 @@ describe('Match profiles', () => { }); }); - // TODO: remove `.skip` from checkbox tests when MCL component is fixed - // eslint-disable-next-line no-only-tests/no-only-tests - describe.skip('deselect all button', () => { + describe('deselect all button', () => { beforeEach(async () => { await matchProfiles.checkBoxes(0).clickAndBlur(); await matchProfiles.checkBoxes(1).clickAndBlur();