From 634996e6d473f2e9e947f14c064c3d9bab3cbcc6 Mon Sep 17 00:00:00 2001 From: Richard Cox Date: Thu, 14 Nov 2024 15:57:48 +0000 Subject: [PATCH] Server-side pagination for home page clusters list and side bar clusters - Functional Changes - SSP now works after vue3 bump - Home Page Clusters list now uses server-side pagination - Side Bar clusters list now uses server-side pagination - Wire in now supported sorting / filtering by id and name used for table columns - Allow pagination to be enabled given a specific context - Call findPage without persisting to store - New Pagination Tools - PaginatedResourceTable - Convenience Component, wraps ResourceTable with pagination specific props - PaginationWrapper - Convenience class to handle requests for resources and updates to them (avoiding store) - Regressions - Side Nav menu ready state was `mgmtCluster.isReady && !pCluster?.hasError`, now ??? --- shell/components/PaginatedResourceTable.vue | 125 ++++ shell/components/SortableTable/index.vue | 20 +- .../components/form/ResourceLabeledSelect.vue | 4 +- shell/components/nav/TopLevelMenu.helper.ts | 539 ++++++++++++++++++ shell/components/nav/TopLevelMenu.vue | 257 ++++----- shell/config/pagination-table-headers.js | 8 +- shell/config/product/explorer.js | 2 + shell/config/settings.ts | 14 +- shell/list/node.vue | 13 +- shell/mixins/resource-fetch-api-pagination.js | 29 +- shell/mixins/resource-fetch.js | 29 +- shell/pages/home.vue | 366 ++++++++---- shell/plugins/dashboard-store/actions.js | 43 +- shell/plugins/dashboard-store/getters.js | 7 +- shell/plugins/steve/steve-pagination-utils.ts | 30 +- shell/types/resources/settings.d.ts | 2 +- shell/types/store/pagination.types.ts | 13 + shell/types/store/vuex.d.ts | 8 + shell/utils/cluster.js | 81 ++- shell/utils/pagination-utils.ts | 25 +- shell/utils/pagination-wrapper.ts | 57 ++ 21 files changed, 1338 insertions(+), 334 deletions(-) create mode 100644 shell/components/PaginatedResourceTable.vue create mode 100644 shell/components/nav/TopLevelMenu.helper.ts create mode 100644 shell/utils/pagination-wrapper.ts diff --git a/shell/components/PaginatedResourceTable.vue b/shell/components/PaginatedResourceTable.vue new file mode 100644 index 00000000000..b296cd7bcec --- /dev/null +++ b/shell/components/PaginatedResourceTable.vue @@ -0,0 +1,125 @@ + + + diff --git a/shell/components/SortableTable/index.vue b/shell/components/SortableTable/index.vue index 5bf3f6dfccd..5a06aa7676b 100644 --- a/shell/components/SortableTable/index.vue +++ b/shell/components/SortableTable/index.vue @@ -361,7 +361,13 @@ export default { externalPaginationResult: { type: Object, default: null + }, + + manualRefreshButtonSize: { + type: String, + default: '' } + }, data() { @@ -571,9 +577,9 @@ export default { showHeaderRow() { return this.search || this.tableActions || - this.$slots['header-left']?.() || - this.$slots['header-middle']?.() || - this.$slots['header-right']?.(); + this.$slots['header-left'] || + this.$slots['header-middle'] || + this.$slots['header-right']; }, columns() { @@ -1109,6 +1115,7 @@ export default { +
+