From 74692837d5ce171b2a0c29cc0266ef36d71e3485 Mon Sep 17 00:00:00 2001 From: Blesilda Ramirez Date: Fri, 6 Sep 2024 00:28:11 +0800 Subject: [PATCH 1/7] pkp/pkp-lib#9744 Delete old Table component --- src/components/Table/Table.vue | 443 --------- src/components/Table/TableCell.vue | 86 -- src/components/Table/mocks/articleStats.js | 893 ------------------ .../Table/mocks/articleStatsColumns.js | 54 -- 4 files changed, 1476 deletions(-) delete mode 100644 src/components/Table/Table.vue delete mode 100644 src/components/Table/TableCell.vue delete mode 100644 src/components/Table/mocks/articleStats.js delete mode 100644 src/components/Table/mocks/articleStatsColumns.js diff --git a/src/components/Table/Table.vue b/src/components/Table/Table.vue deleted file mode 100644 index 795b12415..000000000 --- a/src/components/Table/Table.vue +++ /dev/null @@ -1,443 +0,0 @@ - - - - - diff --git a/src/components/Table/TableCell.vue b/src/components/Table/TableCell.vue deleted file mode 100644 index 4beeaf158..000000000 --- a/src/components/Table/TableCell.vue +++ /dev/null @@ -1,86 +0,0 @@ - - - - - diff --git a/src/components/Table/mocks/articleStats.js b/src/components/Table/mocks/articleStats.js deleted file mode 100644 index 1815c5e19..000000000 --- a/src/components/Table/mocks/articleStats.js +++ /dev/null @@ -1,893 +0,0 @@ -function getRandomTitle(str) { - let title = str - .split(' ') - .sort((a, b) => (Math.random() > 0.5 ? -1 : 1)) - .join(' '); - const trimLength = Math.floor(Math.random() * 20); - title = title.charAt(0).toUpperCase() + title.slice(1); - return title.substr(0, title.length - trimLength); -} - -const baseTitle = - 'tortor ultrices dolor diam dignissim ante nulla et morbi imperdiet'; -const sectionIds = [1, 2, 3]; -const baseStat = { - total: 0, - views: 0, - downloads: 0, - object: { - id: 1, - fullTitle: { - en: getRandomTitle(baseTitle), - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, -}; - -let stats = []; -for (let i = 1; i < 61; i++) { - let stat = { - ...baseStat, - object: { - ...baseStat.object, - id: i, - fullTitle: { - en: getRandomTitle(baseTitle), - }, - sectionId: sectionIds[Math.floor(Math.random() * sectionIds.length)], - }, - views: Math.floor(Math.random() * 10000) + 1, - downloads: Math.floor(Math.random() * 1000) + 1, - }; - - stat.total = stat.views + stat.downloads; - - stats.push(stat); -} - -// use fixed stats to stabilize visual comparisons -stats = [ - { - total: 8564, - views: 7945, - downloads: 619, - object: { - id: 1, - fullTitle: { - en: 'Nulla et ultrices tortor imperdiet ante diam dignissim', - }, - sectionId: 3, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 1170, - views: 560, - downloads: 610, - object: { - id: 2, - fullTitle: { - en: 'Ante dignissim imperdiet diam dolor ultrices et null', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 9607, - views: 9392, - downloads: 215, - object: { - id: 3, - fullTitle: { - en: 'Nulla imperdiet ultrices et dignissim tortor morbi d', - }, - sectionId: 3, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 3453, - views: 2732, - downloads: 721, - object: { - id: 4, - fullTitle: { - en: 'Et morbi nulla dignissim tortor ante diam dolor u', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 2541, - views: 1782, - downloads: 759, - object: { - id: 5, - fullTitle: { - en: 'Nulla dignissim tortor ante et ultrices morbi dolor diam ', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 5116, - views: 4512, - downloads: 604, - object: { - id: 6, - fullTitle: { - en: 'Ultrices nulla tortor morbi ante dignissim dolo', - }, - sectionId: 2, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 7468, - views: 6697, - downloads: 771, - object: { - id: 7, - fullTitle: { - en: 'Nulla ante dignissim diam imperdiet morbi dolor ultrices tortor e', - }, - sectionId: 2, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 3678, - views: 3450, - downloads: 228, - object: { - id: 8, - fullTitle: { - en: 'Morbi ante tortor imperdiet ultrices nulla dignissim dolor et dia', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 1421, - views: 937, - downloads: 484, - object: { - id: 9, - fullTitle: { - en: 'Nulla tortor ultrices diam imperdiet et dignissim morbi dolor ', - }, - sectionId: 2, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 7490, - views: 6772, - downloads: 718, - object: { - id: 10, - fullTitle: { - en: 'Diam dolor imperdiet dignissim morbi et tortor ultrices nulla ante', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 2440, - views: 1904, - downloads: 536, - object: { - id: 11, - fullTitle: { - en: 'Tortor nulla diam imperdiet dolor ante et ultrices mor', - }, - sectionId: 3, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 3924, - views: 3714, - downloads: 210, - object: { - id: 12, - fullTitle: { - en: 'Dignissim diam ante morbi dolor ultrices nulla imperdiet et ', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 2425, - views: 2329, - downloads: 96, - object: { - id: 13, - fullTitle: { - en: 'Nulla imperdiet et dolor ultrices diam dignissim tortor ant', - }, - sectionId: 2, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 10104, - views: 9617, - downloads: 487, - object: { - id: 14, - fullTitle: { - en: 'Dignissim ante diam tortor imperdiet ultrices nulla', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 1205, - views: 1053, - downloads: 152, - object: { - id: 15, - fullTitle: { - en: 'Diam dolor et nulla ultrices ante morbi imperdiet digni', - }, - sectionId: 3, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 1389, - views: 1345, - downloads: 44, - object: { - id: 16, - fullTitle: { - en: 'Ante dolor et imperdiet diam dignissim tortor ultr', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 5861, - views: 5300, - downloads: 561, - object: { - id: 17, - fullTitle: { - en: 'Nulla tortor dolor et dignissim diam ultrices ante morbi i', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 2914, - views: 2125, - downloads: 789, - object: { - id: 18, - fullTitle: { - en: 'Diam nulla tortor ante dolor et ultrices morbi imperdiet dig', - }, - sectionId: 2, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 5439, - views: 4950, - downloads: 489, - object: { - id: 19, - fullTitle: { - en: 'Tortor nulla ultrices dolor ante dignissim morbi diam imperdiet', - }, - sectionId: 3, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 6822, - views: 6723, - downloads: 99, - object: { - id: 20, - fullTitle: { - en: 'Ultrices nulla et dolor ante dignissim morbi tortor imp', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 2535, - views: 2262, - downloads: 273, - object: { - id: 21, - fullTitle: { - en: 'Tortor morbi nulla ante ultrices diam dolor et imperdiet', - }, - sectionId: 2, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 3319, - views: 2988, - downloads: 331, - object: { - id: 22, - fullTitle: { - en: 'Diam ante dolor dignissim nulla morbi et imperdiet ultrices tort', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 891, - views: 475, - downloads: 416, - object: { - id: 23, - fullTitle: { - en: 'Tortor et morbi ante diam ultrices dolor dignissim imperdiet ', - }, - sectionId: 2, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 5976, - views: 5882, - downloads: 94, - object: { - id: 24, - fullTitle: { - en: 'Et nulla imperdiet ante tortor morbi diam ultrices digniss', - }, - sectionId: 2, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 9086, - views: 9076, - downloads: 10, - object: { - id: 25, - fullTitle: { - en: 'Diam imperdiet ante nulla morbi tortor dignissim et ultrices d', - }, - sectionId: 3, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 5547, - views: 4979, - downloads: 568, - object: { - id: 26, - fullTitle: { - en: 'Morbi ultrices dolor tortor dignissim ante et imperdiet d', - }, - sectionId: 3, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 3019, - views: 2223, - downloads: 796, - object: { - id: 27, - fullTitle: { - en: 'Diam dolor ultrices tortor dignissim ante et nulla morbi imperdi', - }, - sectionId: 2, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 3078, - views: 2595, - downloads: 483, - object: { - id: 28, - fullTitle: { - en: 'Ante nulla diam dolor morbi ultrices dignissim tortor et i', - }, - sectionId: 3, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 7242, - views: 6650, - downloads: 592, - object: { - id: 29, - fullTitle: { - en: 'Nulla dignissim tortor ultrices et ante diam do', - }, - sectionId: 3, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 10052, - views: 9717, - downloads: 335, - object: { - id: 30, - fullTitle: { - en: 'Tortor ultrices nulla ante dolor dignissim et morbi imperdiet d', - }, - sectionId: 3, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 6362, - views: 5870, - downloads: 492, - object: { - id: 31, - fullTitle: { - en: 'Tortor ultrices morbi ante imperdiet et dolor n', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 6481, - views: 5833, - downloads: 648, - object: { - id: 32, - fullTitle: { - en: 'Tortor ante morbi ultrices dolor diam et imperdiet nulla digni', - }, - sectionId: 3, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 1250, - views: 537, - downloads: 713, - object: { - id: 33, - fullTitle: { - en: 'Ante imperdiet diam dignissim dolor et ultrices tortor nulla mo', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 2149, - views: 1463, - downloads: 686, - object: { - id: 34, - fullTitle: { - en: 'Ante diam dolor nulla ultrices dignissim et tortor imperdiet morbi', - }, - sectionId: 2, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 2067, - views: 1855, - downloads: 212, - object: { - id: 35, - fullTitle: { - en: 'Tortor imperdiet morbi ultrices dignissim diam ', - }, - sectionId: 3, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 9446, - views: 8582, - downloads: 864, - object: { - id: 36, - fullTitle: { - en: 'Tortor ultrices dolor dignissim morbi diam nulla et', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 4692, - views: 4453, - downloads: 239, - object: { - id: 37, - fullTitle: { - en: 'Diam tortor imperdiet ante et ultrices dignissim morbi ', - }, - sectionId: 3, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 4901, - views: 4775, - downloads: 126, - object: { - id: 38, - fullTitle: { - en: 'Dolor ante nulla ultrices et diam tortor morbi dignissim imp', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 4945, - views: 4803, - downloads: 142, - object: { - id: 39, - fullTitle: { - en: 'Nulla ultrices morbi et dignissim tortor imperdiet dolor ante ', - }, - sectionId: 3, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 5948, - views: 5088, - downloads: 860, - object: { - id: 40, - fullTitle: { - en: 'Ultrices dolor morbi diam ante tortor imperdiet nulla et dignis', - }, - sectionId: 2, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 5239, - views: 4731, - downloads: 508, - object: { - id: 41, - fullTitle: { - en: 'Dignissim nulla imperdiet dolor morbi ante diam ultr', - }, - sectionId: 3, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 6611, - views: 6304, - downloads: 307, - object: { - id: 42, - fullTitle: { - en: 'Diam nulla dolor imperdiet tortor ante ultrices et morbi dignissi', - }, - sectionId: 2, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 6626, - views: 5827, - downloads: 799, - object: { - id: 43, - fullTitle: { - en: 'Ante et dignissim imperdiet tortor morbi ultrices diam ', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 8275, - views: 7685, - downloads: 590, - object: { - id: 44, - fullTitle: { - en: 'Dignissim et diam nulla dolor morbi ultrices imperdiet ante t', - }, - sectionId: 3, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 6467, - views: 5609, - downloads: 858, - object: { - id: 45, - fullTitle: { - en: 'Tortor ultrices et nulla dignissim morbi imperdiet diam a', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 680, - views: 349, - downloads: 331, - object: { - id: 46, - fullTitle: { - en: 'Dolor ante nulla dignissim morbi et diam imperdiet ', - }, - sectionId: 3, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 10596, - views: 9906, - downloads: 690, - object: { - id: 47, - fullTitle: { - en: 'Nulla diam dolor ultrices tortor imperdiet et digniss', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 4319, - views: 4233, - downloads: 86, - object: { - id: 48, - fullTitle: { - en: 'Et ultrices ante diam morbi tortor nulla digniss', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 5177, - views: 4344, - downloads: 833, - object: { - id: 49, - fullTitle: { - en: 'Imperdiet dignissim morbi nulla diam dolor ultrices ante et', - }, - sectionId: 3, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 3156, - views: 2966, - downloads: 190, - object: { - id: 50, - fullTitle: { - en: 'Ultrices ante morbi nulla dolor tortor diam imperdiet', - }, - sectionId: 3, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 2808, - views: 2117, - downloads: 691, - object: { - id: 51, - fullTitle: { - en: 'Nulla tortor ante et ultrices imperdiet diam dolor dignis', - }, - sectionId: 2, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 2327, - views: 1581, - downloads: 746, - object: { - id: 52, - fullTitle: { - en: 'Dolor et ultrices diam dignissim tortor nulla ante imperdiet morb', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 711, - views: 310, - downloads: 401, - object: { - id: 53, - fullTitle: { - en: 'Nulla morbi ante tortor imperdiet et ultrices dignissim dolor ', - }, - sectionId: 2, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 5100, - views: 5015, - downloads: 85, - object: { - id: 54, - fullTitle: { - en: 'Diam et ultrices ante morbi dignissim tortor dolor imperdiet ', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 6647, - views: 6104, - downloads: 543, - object: { - id: 55, - fullTitle: { - en: 'Et diam tortor imperdiet morbi dolor dignissim ante nulla ultr', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 9420, - views: 9240, - downloads: 180, - object: { - id: 56, - fullTitle: { - en: 'Tortor ultrices imperdiet dolor nulla dignissim morbi d', - }, - sectionId: 3, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 3323, - views: 2562, - downloads: 761, - object: { - id: 57, - fullTitle: { - en: 'Et tortor nulla imperdiet morbi ultrices dolor diam dig', - }, - sectionId: 3, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 1466, - views: 569, - downloads: 897, - object: { - id: 58, - fullTitle: { - en: 'Morbi dolor ultrices diam et imperdiet ante tortor dignissim', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 3115, - views: 2861, - downloads: 254, - object: { - id: 59, - fullTitle: { - en: 'Tortor ultrices morbi imperdiet dolor diam nulla et ', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, - { - total: 3050, - views: 2500, - downloads: 550, - object: { - id: 60, - fullTitle: { - en: 'Ante nulla et tortor morbi ultrices dolor diam imperdiet digniss', - }, - sectionId: 1, - authorString: 'Carlo Corino', - urlPublished: '/example/1', - }, - }, -]; -export default stats; diff --git a/src/components/Table/mocks/articleStatsColumns.js b/src/components/Table/mocks/articleStatsColumns.js deleted file mode 100644 index 6f1186f3f..000000000 --- a/src/components/Table/mocks/articleStatsColumns.js +++ /dev/null @@ -1,54 +0,0 @@ -export default [ - { - name: 'id', - label: 'ID', - value(row) { - return row.object.id; - }, - }, - { - name: 'title', - label: 'Title', - isRowHeader: true, - value(row) { - return row.object.fullTitle.en; - }, - }, - { - name: 'author', - label: 'Contributors', - value(row) { - return row.object.authorString; - }, - }, - { - name: 'abstractViews', - label: 'Abstract Views', - value: 'abstractViews', - }, - { - name: 'galleyViews', - label: 'Galley Views', - value: 'galleyViews', - }, - { - name: 'pdf', - label: 'PDF', - value: 'pdf', - }, - { - name: 'html', - label: 'HTML', - value: 'html', - }, - { - name: 'other', - label: 'Other', - value: 'other', - }, - { - name: 'total', - label: 'Total', - value: 'total', - }, -]; From e5a903e9e03a830a1fe1a1ee0a4c8fd3f65d5d57 Mon Sep 17 00:00:00 2001 From: Blesilda Ramirez Date: Fri, 6 Sep 2024 00:33:30 +0800 Subject: [PATCH 2/7] pkp/pkp-lib#9744 Rename TableNext component to Table --- src/components/Container/StatsPage.stories.js | 4 ++-- src/components/Container/StatsPage.vue | 12 ++++++------ src/components/ListPanel/doi/DoiItemVersionModal.vue | 12 ++++++------ src/components/ListPanel/doi/DoiListItem.vue | 12 ++++++------ src/components/{TableNext => Table}/Table.mdx | 0 src/components/{TableNext => Table}/Table.stories.js | 2 +- src/components/{TableNext => Table}/Table.vue | 0 src/components/{TableNext => Table}/TableBody.vue | 0 src/components/{TableNext => Table}/TableCell.vue | 0 src/components/{TableNext => Table}/TableColumn.vue | 0 src/components/{TableNext => Table}/TableHeader.vue | 0 .../{TableNext => Table}/TablePagination.vue | 0 src/components/{TableNext => Table}/TableRow.vue | 0 .../{TableNext => Table}/mocks/articleStats.js | 0 .../mocks/articleStatsColumns.js | 0 src/managers/FileManager/FileManager.vue | 8 ++++---- src/managers/FileManager/FileManagerTableRow.vue | 4 ++-- src/managers/ReviewerManager/ReviewerCellActions.vue | 2 +- src/managers/ReviewerManager/ReviewerManager.vue | 12 ++++++------ .../acceptInvitation/AcceptInvitationUserRoles.vue | 12 ++++++------ .../DashboardTable/CellReviewAssignmentActions.vue | 2 +- .../DashboardTable/CellReviewAssignmentActivity.vue | 2 +- .../DashboardTable/CellReviewAssignmentId.vue | 2 +- .../DashboardTable/CellReviewAssignmentTitle.vue | 2 +- .../DashboardTable/CellSubmissionActions.vue | 2 +- .../CellSubmissionActivity.vue | 2 +- .../components/DashboardTable/CellSubmissionDays.vue | 2 +- .../components/DashboardTable/CellSubmissionId.vue | 2 +- .../DashboardTable/CellSubmissionStage.vue | 2 +- .../DashboardTable/CellSubmissionTitle.vue | 2 +- .../components/DashboardTable/DashboardTable.vue | 12 ++++++------ src/pages/jobs/FailedJobDetailsPage.vue | 12 ++++++------ src/pages/jobs/FailedJobsPage.vue | 12 ++++++------ src/pages/jobs/JobsPage.vue | 12 ++++++------ .../userInvitation/UserInvitationUserGroupsTable.vue | 12 ++++++------ 35 files changed, 80 insertions(+), 80 deletions(-) rename src/components/{TableNext => Table}/Table.mdx (100%) rename src/components/{TableNext => Table}/Table.stories.js (98%) rename src/components/{TableNext => Table}/Table.vue (100%) rename src/components/{TableNext => Table}/TableBody.vue (100%) rename src/components/{TableNext => Table}/TableCell.vue (100%) rename src/components/{TableNext => Table}/TableColumn.vue (100%) rename src/components/{TableNext => Table}/TableHeader.vue (100%) rename src/components/{TableNext => Table}/TablePagination.vue (100%) rename src/components/{TableNext => Table}/TableRow.vue (100%) rename src/components/{TableNext => Table}/mocks/articleStats.js (100%) rename src/components/{TableNext => Table}/mocks/articleStatsColumns.js (100%) diff --git a/src/components/Container/StatsPage.stories.js b/src/components/Container/StatsPage.stories.js index 50434e30a..0e7b692d5 100644 --- a/src/components/Container/StatsPage.stories.js +++ b/src/components/Container/StatsPage.stories.js @@ -1,8 +1,8 @@ import StatsPage from './StatsPage.vue'; import StatsEditorialPage from '@/components/Container/StatsEditorialPage.vue'; import StatsPublicationsPage from '@/components/Container/StatsPublicationsPage.vue'; -import ArticleStatsMock from '@/components/TableNext/mocks/articleStats.js'; -import ArticleStatsColumnsMock from '@/components/TableNext/mocks/articleStatsColumns.js'; +import ArticleStatsMock from '@/components/Table/mocks/articleStats.js'; +import ArticleStatsColumnsMock from '@/components/Table/mocks/articleStatsColumns.js'; import debounce from 'debounce'; export default { diff --git a/src/components/Container/StatsPage.vue b/src/components/Container/StatsPage.vue index f20c15c0c..9f151cdd5 100644 --- a/src/components/Container/StatsPage.vue +++ b/src/components/Container/StatsPage.vue @@ -4,12 +4,12 @@ import DateRange from '@/components/DateRange/DateRange.vue'; import PkpFilter from '@/components/Filter/Filter.vue'; import Pagination from '@/components/Pagination/Pagination.vue'; import PkpHeader from '@/components/Header/Header.vue'; -import PkpTable from '@/components/TableNext/Table.vue'; -import TableCell from '@/components/TableNext/TableCell.vue'; -import TableColumn from '@/components/TableNext/TableColumn.vue'; -import TableHeader from '@/components/TableNext/TableHeader.vue'; -import TableBody from '@/components/TableNext/TableBody.vue'; -import TableRow from '@/components/TableNext/TableRow.vue'; +import PkpTable from '@/components/Table/Table.vue'; +import TableCell from '@/components/Table/TableCell.vue'; +import TableColumn from '@/components/Table/TableColumn.vue'; +import TableHeader from '@/components/Table/TableHeader.vue'; +import TableBody from '@/components/Table/TableBody.vue'; +import TableRow from '@/components/Table/TableRow.vue'; import ajaxError from '@/mixins/ajaxError'; export default { diff --git a/src/components/ListPanel/doi/DoiItemVersionModal.vue b/src/components/ListPanel/doi/DoiItemVersionModal.vue index 58a29abdc..223ef7a55 100644 --- a/src/components/ListPanel/doi/DoiItemVersionModal.vue +++ b/src/components/ListPanel/doi/DoiItemVersionModal.vue @@ -81,12 +81,12 @@ From 661a912c6224a2d23a93915dc557947c4f707111 Mon Sep 17 00:00:00 2001 From: Blesilda Ramirez Date: Mon, 9 Sep 2024 19:40:10 +0800 Subject: [PATCH 4/7] pkp/pkp-lib#9744 Update documentation for Table component --- src/components/Table/Table.mdx | 35 +++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/src/components/Table/Table.mdx b/src/components/Table/Table.mdx index dec749af7..a2667d14b 100644 --- a/src/components/Table/Table.mdx +++ b/src/components/Table/Table.mdx @@ -14,9 +14,38 @@ Use the `Table` component to display tabular data when the user will sort, searc ## Accessibility -Table component requires aria-label attribute to describe content of table. +### General Guidelines -One column should be [rowheader](https://www.w3.org/TR/wai-aria-1.1/#rowheader) to improve screen reader experience. Its prop on TableCell, not on TableColumn as one would expect as it allows for significantly easier implementation. +To ensure the `Table` component is accessible: + +- The `aria-labelledby` and `aria-describedby` attributes are automatically linked when using the `label` and `description` slots, or they can be manually set with the `labelledBy` and `describedBy` props if using external labels and description for the table. +- If neither `labelledBy`/`describedBy` props nor `label`/`description` slots are provided, use the `ariaLabel` prop to provide accessible information about the table. +- One column should be [rowheader](https://www.w3.org/TR/wai-aria-1.1/#rowheader) to improve screen reader experience. It's a prop on TableCell, not on TableColumn as one would expect as it allows for significantly easier implementation. + +### Slots and ARIA Attributes + +If the table has a label or description, ensure that: + +- The `labelledBy` and `describedBy` props point to the correct element IDs, especially if the label or description is external to the component. +- If you're using the `label` or `description` slots, the component will automatically assign IDs and link them to the table via `aria-labelledby` and `aria-describedby`. + +## Slots + +### `label` + +This slot is used to provide a custom label for the table. + +### `description` + +Use this slot to provide additional information or context about the table's content. + +### `top-controls` + +The `top-controls` slot is used to add buttons or other interactive elements that appear above the table. + +### `bottom-controls` + +The `bottom-controls` slot is used for adding controls below the table, such as pagination controls, summary information, or other actionable elements. ## Table Props @@ -26,7 +55,7 @@ One column should be [rowheader](https://www.w3.org/TR/wai-aria-1.1/#rowheader) -# TableCell Props +## TableCell Props From 0d2198bc77e107a86208f89bce20bd8871662f50 Mon Sep 17 00:00:00 2001 From: Blesilda Ramirez Date: Tue, 10 Sep 2024 23:36:35 +0800 Subject: [PATCH 5/7] pkp/pkp-lib#9744 Migrate native tables that use class pkpTable to use the new table component --- .../contributors/ContributorsPreviewModal.vue | 58 ++++++---- .../ListPanel/doi/DoiStatusInfoModal.vue | 103 ++++++++++++------ .../ContextDownloadReportModal.vue | 17 ++- .../statsIssues/IssueDownloadReportModal.vue | 27 +++-- .../PublicationsDownloadReportModal.vue | 41 ++++--- 5 files changed, 153 insertions(+), 93 deletions(-) diff --git a/src/components/ListPanel/contributors/ContributorsPreviewModal.vue b/src/components/ListPanel/contributors/ContributorsPreviewModal.vue index 9496b7576..428eeb702 100644 --- a/src/components/ListPanel/contributors/ContributorsPreviewModal.vue +++ b/src/components/ListPanel/contributors/ContributorsPreviewModal.vue @@ -7,35 +7,47 @@

{{ t('contributor.listPanel.preview.description') }}

- - - - - - - - - - - - - - - - - - - - - -
{{ t('contributor.listPanel.preview.format') }}{{ t('contributor.listPanel.preview.display') }}
{{ t('contributor.listPanel.preview.abbreviated') }}{{ publication.authorsStringShort }}
+ + + + {{ t('contributor.listPanel.preview.format') }} + + + {{ t('contributor.listPanel.preview.display') }} + + + + + + {{ t('contributor.listPanel.preview.abbreviated') }} + + {{ publication.authorsStringShort }} + + + {{ t('contributor.listPanel.preview.publicationLists') }} - {{ publication.authorsStringIncludeInBrowse }}
{{ t('contributor.listPanel.preview.full') }}{{ publication.authorsString }}
+ + + {{ publication.authorsStringIncludeInBrowse }} + + + + {{ t('contributor.listPanel.preview.full') }} + {{ publication.authorsString }} + + + diff --git a/src/pages/statsContext/ContextDownloadReportModal.vue b/src/pages/statsContext/ContextDownloadReportModal.vue index 62e677a71..345b4bd5a 100644 --- a/src/pages/statsContext/ContextDownloadReportModal.vue +++ b/src/pages/statsContext/ContextDownloadReportModal.vue @@ -5,12 +5,14 @@

{{ t('stats.context.downloadReport.description') }}

- - - - - -
{{ t('stats.dateRange') }}{{ dateRangeDescription }}
+ + + + {{ t('stats.dateRange') }} + + {{ dateRangeDescription }} + +

{{ t('context.context') }}

@@ -43,6 +45,9 @@ import SideModalLayoutBasic from '@/components/Modal/SideModalLayoutBasic.vue'; import {useLocalize} from '@/composables/useLocalize'; import ActionPanel from '@/components/ActionPanel/ActionPanel.vue'; import PkpButton from '@/components/Button/Button.vue'; +import PkpTable from '@/components/Table/Table.vue'; +import TableRow from '@/components/Table/TableRow.vue'; +import TableCell from '@/components/Table/TableCell.vue'; const {t} = useLocalize(); defineProps({ diff --git a/src/pages/statsIssues/IssueDownloadReportModal.vue b/src/pages/statsIssues/IssueDownloadReportModal.vue index dd7588197..7876d391c 100644 --- a/src/pages/statsIssues/IssueDownloadReportModal.vue +++ b/src/pages/statsIssues/IssueDownloadReportModal.vue @@ -5,16 +5,20 @@

{{ t('stats.issues.downloadReport.description') }}

- - - - - - - - - -
{{ t('stats.dateRange') }}{{ dateRangeDescription }}
{{ t('common.searchPhrase') }}{{ searchPhrase }}
+ + + + {{ t('stats.dateRange') }} + + {{ dateRangeDescription }} + + + + {{ t('common.searchPhrase') }} + + {{ searchPhrase }} + +

{{ t('issue.issues') }}

@@ -47,6 +51,9 @@ import SideModalLayoutBasic from '@/components/Modal/SideModalLayoutBasic.vue'; import {useLocalize} from '@/composables/useLocalize'; import ActionPanel from '@/components/ActionPanel/ActionPanel.vue'; import PkpButton from '@/components/Button/Button.vue'; +import PkpTable from '@/components/Table/Table.vue'; +import TableRow from '@/components/Table/TableRow.vue'; +import TableCell from '@/components/Table/TableCell.vue'; const {t} = useLocalize(); defineProps({ diff --git a/src/pages/statsPublications/PublicationsDownloadReportModal.vue b/src/pages/statsPublications/PublicationsDownloadReportModal.vue index 4fee9165c..d21e19904 100644 --- a/src/pages/statsPublications/PublicationsDownloadReportModal.vue +++ b/src/pages/statsPublications/PublicationsDownloadReportModal.vue @@ -5,24 +5,26 @@

{{ t('stats.publications.downloadReport.description') }}

- - - - - - - - - - - - - -
{{ t('stats.dateRange') }}{{ dateRangeDescription }}
{{ filterSet.heading }}{{ getFilterDescription(filterSet) }}
{{ t('common.searchPhrase') }}{{ searchPhrase }}
+ + + + {{ t('stats.dateRange') }} + + {{ dateRangeDescription }} + + + + {{ filterSet.heading }} + + {{ getFilterDescription(filterSet) }} + + + + {{ t('common.searchPhrase') }} + + {{ searchPhrase }} + +

{{ t('common.publications') }}

@@ -92,6 +94,9 @@ import {useLocalize} from '@/composables/useLocalize'; import ActionPanel from '@/components/ActionPanel/ActionPanel.vue'; import PkpButton from '@/components/Button/Button.vue'; import Tooltip from '@/components/Tooltip/Tooltip.vue'; +import PkpTable from '@/components/Table/Table.vue'; +import TableRow from '@/components/Table/TableRow.vue'; +import TableCell from '@/components/Table/TableCell.vue'; const {t} = useLocalize(); defineProps({ From 07e4bbc9ba3d2f9ebff50cc59b290bef00fafac3 Mon Sep 17 00:00:00 2001 From: Blesilda Ramirez Date: Tue, 10 Sep 2024 23:38:05 +0800 Subject: [PATCH 6/7] pkp/pkp-lib#9744 Update logic of noContent in TableBody component --- src/components/Table/TableBody.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Table/TableBody.vue b/src/components/Table/TableBody.vue index aa96fad31..52040ad5f 100644 --- a/src/components/Table/TableBody.vue +++ b/src/components/Table/TableBody.vue @@ -27,9 +27,9 @@ const {t} = useLocalize(); const tableContext = inject('tableContext'); const noContent = computed(() => { - const defaultSlot = slots.default(); + const defaultSlot = slots.default ? slots.default() : []; - return !defaultSlot?.[0]?.children?.length; + return !defaultSlot?.[0]?.children?.length && !defaultSlot?.[0]?.type?.render; }); const emptyText = computed(() => { From b78aefb25eae6f32b9d1178cc5230c685eba665d Mon Sep 17 00:00:00 2001 From: Blesilda Ramirez Date: Tue, 10 Sep 2024 23:43:36 +0800 Subject: [PATCH 7/7] pkp/pkp-lib#9744 Remove unused classes related to table component --- src/components/Container/StatsPage.vue | 2 +- src/components/Container/StatsPublicationsPage.vue | 7 ------- src/components/Container/SubmissionWizardPage.vue | 7 ------- src/components/ListPanel/doi/DoiListItem.vue | 6 +----- src/components/Table/Table.vue | 2 +- 5 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/components/Container/StatsPage.vue b/src/components/Container/StatsPage.vue index 9f151cdd5..f5818879c 100644 --- a/src/components/Container/StatsPage.vue +++ b/src/components/Container/StatsPage.vue @@ -486,7 +486,7 @@ export default { } } -.pkpStats__table .pkpTable.-isLoading tbody { +.pkpStats__table .-isLoading tbody { opacity: 0.5; } diff --git a/src/components/Container/StatsPublicationsPage.vue b/src/components/Container/StatsPublicationsPage.vue index 994e71219..6a1a6493b 100644 --- a/src/components/Container/StatsPublicationsPage.vue +++ b/src/components/Container/StatsPublicationsPage.vue @@ -611,13 +611,6 @@ export default { padding-top: 0; } -.pkpStats__reportParams { - th { - font-weight: @bold; - border-right: @grid-border; - } -} - .pkpStats__reportAction { margin: 2rem 0; } diff --git a/src/components/Container/SubmissionWizardPage.vue b/src/components/Container/SubmissionWizardPage.vue index 2bc0c9976..cc49e8a61 100644 --- a/src/components/Container/SubmissionWizardPage.vue +++ b/src/components/Container/SubmissionWizardPage.vue @@ -960,13 +960,6 @@ ul.submissionWizard__reviewPanel__item__value { list-style: none; } -// A table used for a review -.submissionWizard__reviewPanel__body { - .pkpTable { - border: none; - } -} - .submissionWizard__reviewPanel__citation + .submissionWizard__reviewPanel__citation { margin-top: 1rem; diff --git a/src/components/ListPanel/doi/DoiListItem.vue b/src/components/ListPanel/doi/DoiListItem.vue index 476156079..af8e24b30 100644 --- a/src/components/ListPanel/doi/DoiListItem.vue +++ b/src/components/ListPanel/doi/DoiListItem.vue @@ -65,7 +65,7 @@

@@ -923,10 +923,6 @@ export default { margin-left: 2.25rem; } -.listPanel__item--doi .listPanel__itemExpanded .pkpTable { - margin-top: 0.5rem; -} - .doiListPanel__itemExpandedActions { display: flex; align-items: center; diff --git a/src/components/Table/Table.vue b/src/components/Table/Table.vue index a2d2c426a..3cf814601 100644 --- a/src/components/Table/Table.vue +++ b/src/components/Table/Table.vue @@ -16,7 +16,7 @@