From 179cc8643e8b8c715ef27b9480978d7e1f7d577b Mon Sep 17 00:00:00 2001 From: Chris Topaloudis Date: Fri, 11 Oct 2019 13:29:52 +0200 Subject: [PATCH] backoffice: tables * removed resultsList from PatronsSearch, DocumentRequestsSearch, EItemsSearch, ItemSearch, SeriesSearch, LoansSearch * cleaned extra width for ID column * fixed titles for documents * adjustable header according to headerActions * overview tables * table content adjustment * closes #219, #337 --- .../components/ResultsTable/ResultsTable.js | 13 +- .../ResultsTable/ResultsTableBody.js | 8 +- .../ResultsTable/ResultsTableHeader.js | 21 +- .../__snapshots__/ResultsTable.js.snap | 91 +- .../components/ResultsTable/formatters.js | 25 +- .../DocumentItems/__tests__/DocumentItems.js | 113 +-- .../__snapshots__/DocumentItems.js.snap | 323 ++++---- .../DocumentMetadata/DocumentMetadata.js | 4 +- .../__snapshots__/DocumentMetadata.js.snap | 3 +- .../DocumentPendingLoans.js | 2 +- .../__tests__/DocumentPendingLoans.js | 113 +-- .../DocumentPendingLoans.js.snap | 233 +++--- .../DocumentRequestsSearch.js | 44 +- ...sultsList.js => DocumentRequestsSearch.js} | 64 +- .../DocumentRequestsSearch.js.snap | 779 ++++++++++++++++++ .../__snapshots__/ResultsList.js.snap | 730 ---------------- .../components/ResultsList/ResultsList.js | 62 -- .../components/ResultsList/index.js | 1 - .../components/index.js | 1 - .../DocumentsSearch/DocumentsSearch.js | 42 +- .../{ResultsList.js => DocumentsSearch.js} | 63 +- .../__snapshots__/DocumentsSearch.js.snap | 438 ++++++++++ .../__snapshots__/ResultsList.js.snap | 646 --------------- .../components/ResultsList/ResultsList.js | 57 -- .../components/ResultsList/index.js | 1 - .../DocumentsSearch/components/index.js | 1 - .../EItem/EItemSearch/EItemSearch.js | 45 +- .../{ResultsList.js => EItemSearch.js} | 62 +- .../__snapshots__/EItemSearch.js.snap | 724 ++++++++++++++++ .../__snapshots__/ResultsList.js.snap | 638 -------------- .../components/ResultsList/ResultsList.js | 56 -- .../components/ResultsList/index.js | 1 - .../EItem/EItemSearch/components/index.js | 1 - .../pages/backoffice/Home/Home.js | 6 +- .../lists/IdleLoansList/IdleLoansList.js | 6 +- .../IdleLoansList/__tests__/IdleLoansList.js | 83 +- .../__snapshots__/IdleLoansList.js.snap | 173 ++-- .../OverbookedDocumentsList.js | 3 +- .../__tests__/OverbookedDocumentsList.js | 68 +- .../OverbookedDocumentsList.js.snap | 205 ++--- .../OverdueLoansList/OverdueLoansList.js | 4 +- .../__tests__/OverdueLoansList.js | 79 +- .../__snapshots__/OverdueLoansList.js.snap | 283 ++++--- .../PendingOverdueDocumentsList.js | 3 +- .../PendingOverdueDocumentsList.js.snap | 83 +- .../__tests__/RenewedLoansList.js | 68 +- .../__snapshots__/RenewedLoansList.js.snap | 133 +-- .../__snapshots__/DocumentsCard.js.snap | 8 +- .../__tests__/__snapshots__/LoansCard.js.snap | 8 +- .../ItemPastLoans/__tests__/ItemPastLoans.js | 50 +- .../__snapshots__/ItemPastLoans.js.snap | 157 ++-- .../backoffice/ItemsSearch/ItemsSearch.js | 49 +- .../{ResultsList.js => ItemsSearch.js} | 26 +- .../__snapshots__/ItemsSearch.js.snap | 655 +++++++++++++++ .../__snapshots__/ResultsList.js.snap | 766 ----------------- .../components/ResultsList/ResultsList.js | 56 -- .../components/ResultsList/index.js | 1 - .../ItemsSearch/components/index.js | 1 - .../backoffice/LoansSearch/LoansSearch.js | 49 +- .../{ResultsList.js => LoansSearch.js} | 62 +- .../__snapshots__/LoansSearch.js.snap | 717 ++++++++++++++++ .../__snapshots__/ResultsList.js.snap | 672 --------------- .../components/ResultsList/ResultsList.js | 45 - .../components/ResultsList/index.js | 1 - .../LoansSearch/components/index.js | 1 - .../InternalLocationList.js | 10 +- .../components/ItemsSearch/ItemsSearch.js | 2 +- .../ItemsSearch/__tests__/ItemsSearch.js | 3 + .../__snapshots__/ItemsSearch.js.snap | 27 +- .../ItemsResultsList.js} | 4 +- .../components/ItemsResultsList/index.js | 1 + .../components/ResultsList/index.js | 1 - .../ItemsSearch/components/index.js | 2 +- .../__tests__/PatronCurrentLoans.js | 102 +-- .../__snapshots__/PatronCurrentLoans.js.snap | 225 ++--- .../PatronDocumentRequests.js.snap | 101 +-- .../__tests__/PatronPendingLoans.js | 102 +-- .../__snapshots__/PatronPendingLoans.js.snap | 205 ++--- .../backoffice/PatronsSearch/PatronsSearch.js | 28 +- .../{ResultsList.js => PatronsSearch.js} | 25 +- .../__snapshots__/PatronsSearch.js.snap | 376 +++++++++ .../__snapshots__/ResultsList.js.snap | 421 ---------- .../components/ResultsList/ResultsList.js | 41 - .../components/ResultsList/index.js | 1 - .../PatronsSearch/components/index.js | 1 - .../Series/SeriesSearch/SeriesSearch.js | 42 +- .../{ResultsList.js => SeriesSearch.js} | 64 +- .../__snapshots__/ResultsList.js.snap | 678 --------------- .../__snapshots__/SeriesSearch.js.snap | 473 +++++++++++ .../components/ResultsList/ResultsList.js | 60 -- .../components/ResultsList/index.js | 1 - .../Series/SeriesSearch/components/index.js | 1 - .../backoffice/components/Sidebar/Sidebar.js | 2 +- .../buttons/SeeAllButton/SeeAllButton.js | 2 +- .../DocumentMetadata/DocumentMetadata.js | 4 +- .../components/DocumentConference.js | 2 +- .../components/DocumentItem/DocumentItem.js | 10 +- .../__snapshots__/DocumentItem.js.snap | 4 +- .../__tests__/PatronPendingLoans.js | 52 +- .../__snapshots__/PatronPendingLoans.js.snap | 75 +- .../frontsite/components/Header/Header.js | 2 +- tests/data/eitems.json | 10 +- tests/data/loans.json | 10 +- 103 files changed, 6041 insertions(+), 7055 deletions(-) rename invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/DocumentRequestsSearch/__tests__/{ResultsList.js => DocumentRequestsSearch.js} (61%) create mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/DocumentRequestsSearch/__tests__/__snapshots__/DocumentRequestsSearch.js.snap delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/DocumentRequestsSearch/__tests__/__snapshots__/ResultsList.js.snap delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/DocumentRequestsSearch/components/ResultsList/ResultsList.js delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/DocumentRequestsSearch/components/ResultsList/index.js delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/DocumentRequestsSearch/components/index.js rename invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/DocumentsSearch/__tests__/{ResultsList.js => DocumentsSearch.js} (58%) create mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/DocumentsSearch/__tests__/__snapshots__/DocumentsSearch.js.snap delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/DocumentsSearch/__tests__/__snapshots__/ResultsList.js.snap delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/DocumentsSearch/components/ResultsList/ResultsList.js delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/DocumentsSearch/components/ResultsList/index.js delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/DocumentsSearch/components/index.js rename invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/EItem/EItemSearch/__tests__/{ResultsList.js => EItemSearch.js} (54%) create mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/EItem/EItemSearch/__tests__/__snapshots__/EItemSearch.js.snap delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/EItem/EItemSearch/__tests__/__snapshots__/ResultsList.js.snap delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/EItem/EItemSearch/components/ResultsList/ResultsList.js delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/EItem/EItemSearch/components/ResultsList/index.js delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/EItem/EItemSearch/components/index.js rename invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/ItemsSearch/__tests__/{ResultsList.js => ItemsSearch.js} (79%) create mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/ItemsSearch/__tests__/__snapshots__/ItemsSearch.js.snap delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/ItemsSearch/__tests__/__snapshots__/ResultsList.js.snap delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/ItemsSearch/components/ResultsList/ResultsList.js delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/ItemsSearch/components/ResultsList/index.js delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/ItemsSearch/components/index.js rename invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/LoansSearch/__tests__/{ResultsList.js => LoansSearch.js} (58%) create mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/LoansSearch/__tests__/__snapshots__/LoansSearch.js.snap delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/LoansSearch/__tests__/__snapshots__/ResultsList.js.snap delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/LoansSearch/components/ResultsList/ResultsList.js delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/LoansSearch/components/ResultsList/index.js delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/LoansSearch/components/index.js rename invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/PatronDetails/components/ItemsSearch/components/{ResultsList/ResultsList.js => ItemsResultsList/ItemsResultsList.js} (97%) create mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/PatronDetails/components/ItemsSearch/components/ItemsResultsList/index.js delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/PatronDetails/components/ItemsSearch/components/ResultsList/index.js rename invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/PatronsSearch/__tests__/{ResultsList.js => PatronsSearch.js} (77%) create mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/PatronsSearch/__tests__/__snapshots__/PatronsSearch.js.snap delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/PatronsSearch/__tests__/__snapshots__/ResultsList.js.snap delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/PatronsSearch/components/ResultsList/ResultsList.js delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/PatronsSearch/components/ResultsList/index.js delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/PatronsSearch/components/index.js rename invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/Series/SeriesSearch/__tests__/{ResultsList.js => SeriesSearch.js} (60%) delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/Series/SeriesSearch/__tests__/__snapshots__/ResultsList.js.snap create mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/Series/SeriesSearch/__tests__/__snapshots__/SeriesSearch.js.snap delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/Series/SeriesSearch/components/ResultsList/ResultsList.js delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/Series/SeriesSearch/components/ResultsList/index.js delete mode 100644 invenio_app_ils/ui/src/invenio_app_ils/pages/backoffice/Series/SeriesSearch/components/index.js diff --git a/invenio_app_ils/ui/src/invenio_app_ils/common/components/ResultsTable/ResultsTable.js b/invenio_app_ils/ui/src/invenio_app_ils/common/components/ResultsTable/ResultsTable.js index df8a7c6df..323813d14 100644 --- a/invenio_app_ils/ui/src/invenio_app_ils/common/components/ResultsTable/ResultsTable.js +++ b/invenio_app_ils/ui/src/invenio_app_ils/common/components/ResultsTable/ResultsTable.js @@ -23,14 +23,12 @@ export class ResultsTable extends Component { return ( - + - + {header} diff --git a/invenio_app_ils/ui/src/invenio_app_ils/common/components/ResultsTable/ResultsTableBody.js b/invenio_app_ils/ui/src/invenio_app_ils/common/components/ResultsTable/ResultsTableBody.js index 818ee4541..dee9de003 100644 --- a/invenio_app_ils/ui/src/invenio_app_ils/common/components/ResultsTable/ResultsTableBody.js +++ b/invenio_app_ils/ui/src/invenio_app_ils/common/components/ResultsTable/ResultsTableBody.js @@ -15,9 +15,8 @@ export default class ResultsTableBody extends Component { return rows.map(row => { const withRowAction = this.props.rowActionClickHandler ? (
@@ -277,22 +272,21 @@ exports[`ResultsTable tests should not render the see all button when showing on >
ID
@@ -699,15 +689,13 @@ exports[`ResultsTable tests should render the see all button when showing only a ID
ID
ID
- 1 + item1 - 44444 + 123456789-1 - - + MISSING - - + NOT_SPECIFIED Somewhere - P + Shelf 1
ID - patron_1 + patron1@test.ch - patron_2 + patron2@test.ch
ID - patron_1 + patron1@test.ch
+ + + + + + ID + + Created + + Updated + + Document ID + + Patron ID + + State + + Title + + Authors + + ISSN + + ISBN + + Issue + + Note + + Page + + Publication Year + + Volume + + Library Book +
+ + 3 + + 2018-01-01 + + 2018-01-01 + + - + + 1 + + PENDING + + This is a title + + Author1 + + - + + - + + - + + - + + - + + - + + - + + Pending +