From 09168d3683c980a962966377da89a0d4ea3276c4 Mon Sep 17 00:00:00 2001 From: Francesco Torchia Date: Thu, 14 Sep 2023 17:33:30 +0200 Subject: [PATCH] Add empty availableActions to fake rows in cluster provisioning details page Signed-off-by: Francesco Torchia --- shell/components/SortableTable/index.vue | 2 +- shell/detail/provisioning.cattle.io.cluster.vue | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/shell/components/SortableTable/index.vue b/shell/components/SortableTable/index.vue index 909d0c6f71..ca0e4490a7 100644 --- a/shell/components/SortableTable/index.vue +++ b/shell/components/SortableTable/index.vue @@ -805,7 +805,7 @@ export default { return false; } - const matchingResourceAction = resource.availableActions.find((a) => a.action === this.actionOfInterest.action); + const matchingResourceAction = resource.availableActions?.find((a) => a.action === this.actionOfInterest.action); return matchingResourceAction?.enabled; }, diff --git a/shell/detail/provisioning.cattle.io.cluster.vue b/shell/detail/provisioning.cattle.io.cluster.vue index a43febda7b..819bdbba28 100644 --- a/shell/detail/provisioning.cattle.io.cluster.vue +++ b/shell/detail/provisioning.cattle.io.cluster.vue @@ -339,9 +339,10 @@ export default { pool._clusterSpec = mp; return { - poolId: pool.id, - mainRowKey: 'isFake', + poolId: pool.id, + mainRowKey: 'isFake', pool, + availableActions: [] }; }); }, @@ -361,9 +362,10 @@ export default { const emptyNodePools = this.allNodePools.filter((x) => x.spec.clusterName === this.value.mgmtClusterId && x.spec.quantity === 0); return emptyNodePools.map((np) => ({ - spec: { nodePoolName: np.id.replace('/', ':') }, - mainRowKey: 'isFake', - pool: np, + spec: { nodePoolName: np.id.replace('/', ':') }, + mainRowKey: 'isFake', + pool: np, + availableActions: [] })); },