Skip to content

Commit

Permalink
Changes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-cox committed Dec 9, 2024
1 parent 545da46 commit 6858b5b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
8 changes: 6 additions & 2 deletions shell/components/PaginatedResourceTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,15 @@ export default defineComponent({
},
async fetch() {
await this.$fetchType(this.resource, [], this.inStore);
const promises = [
this.$fetchType(this.resource, [], this.inStore),
];
if (this.fetchSecondaryResources) {
await this.fetchSecondaryResources({ canPaginate: this.canPaginate });
promises.push(this.fetchSecondaryResources({ canPaginate: this.canPaginate }))

Check warning on line 84 in shell/components/PaginatedResourceTable.vue

View workflow job for this annotation

GitHub Actions / lint

Missing semicolon
}
await Promise.all(promises);
},
computed: {
Expand Down
1 change: 1 addition & 0 deletions shell/components/nav/TopLevelMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ export default {
}
},
// See https://github.com/rancher/dashboard/issues/12831 for outstanding performance related work
watch: {
$route() {
this.shown = false;
Expand Down
4 changes: 2 additions & 2 deletions shell/plugins/dashboard-store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export default {
/**
*
* @param {*} ctx
* @param { {type: string, opt: ActionFindPageArgs} } opt
* @param { {type: string, opt: ActionFindAllArgs} } opt
*/
async findAll(ctx, { type, opt }) {
const {
Expand Down Expand Up @@ -364,7 +364,7 @@ export default {
/**
*
* @param {*} ctx
* @param { {type: string, opt: FindPageOpt} } opt
* @param { {type: string, opt: ActionFindPageArgs} } opt
*/
async findPage(ctx, { type, opt }) {
const { getters, commit, dispatch } = ctx;
Expand Down
4 changes: 4 additions & 0 deletions shell/types/store/dashboard-store.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,9 @@ export interface ActionFindPageArgs extends ActionCoreFindArgs {
* The single namespace to filter by (used in url path, not part of pagination params)
*/
namespaced?: string,
/**
* Result of request is transient and not persisted to store
*/
transient?: boolean,
hasManualRefresh?: boolean,
}
4 changes: 2 additions & 2 deletions shell/utils/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ export function paginationFilterOnlyKubernetesClusters(store) {

return PaginationParamFilter.createMultipleFields([
new PaginationFilterField({
field: `metadata.labels."${ CAPI.PROVIDER }"`, // TODO: TEST
field: `metadata.labels."${ CAPI.PROVIDER }"`, // TODO: RC (home page/side bar) TEST
equals: false,
value: VIRTUAL_HARVESTER_PROVIDER,
exact: true
}),
new PaginationFilterField({
field: `status.provider`, // TODO: TEST
field: `status.provider`, // TODO: RC (home page/side bar) TEST
equals: false,
value: VIRTUAL_HARVESTER_PROVIDER,
exact: true
Expand Down
3 changes: 2 additions & 1 deletion shell/utils/pagination-wrapper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import paginationUtils from '@shell/utils/pagination-utils';
import { PaginationArgs, PaginationResourceContext, StorePagination } from '@shell/types/store/pagination.types';
import { VuexStore } from '@shell/types/store/vuex';
import { ActionFindPageArgs } from '@shell/types/store/dashboard-store.types';

interface Result<T> {
data: Array<T>
Expand Down Expand Up @@ -49,7 +50,7 @@ class PaginationWrapper<T = any> {
throw new Error(`Wrapper for type '${ this.enabledFor.store }/${ this.enabledFor.resource?.id }' in context '${ this.enabledFor.resource?.context }' not supported`);
}
const { pagination, classify: doClassify } = args;
const opt = {
const opt: ActionFindPageArgs = {
transient: true,
pagination
};
Expand Down

0 comments on commit 6858b5b

Please sign in to comment.