diff --git a/shell/models/management.cattle.io.cluster.js b/shell/models/management.cattle.io.cluster.js index 0adab10bc9..8a23bdf39b 100644 --- a/shell/models/management.cattle.io.cluster.js +++ b/shell/models/management.cattle.io.cluster.js @@ -10,7 +10,7 @@ import { addParams } from '@shell/utils/url'; import { isEmpty } from '@shell/utils/object'; import { HARVESTER_NAME as HARVESTER } from '@shell/config/features'; import { isHarvesterCluster } from '@shell/utils/cluster'; -import HybridModel from '@shell/plugins/steve/hybrid-class'; +import SteveModel from '@shell/plugins/steve/steve-class'; import { LINUX, WINDOWS } from '@shell/store/catalog'; import { KONTAINER_TO_DRIVER } from './management.cattle.io.kontainerdriver'; import { PINNED_CLUSTERS } from '@shell/store/prefs'; @@ -27,7 +27,7 @@ function findRelationship(verb, type, relationships = []) { return relationships.find((r) => r[from] === type)?.[id]; } -export default class MgmtCluster extends HybridModel { +export default class MgmtCluster extends SteveModel { get details() { const out = [ { diff --git a/shell/models/provisioning.cattle.io.cluster.js b/shell/models/provisioning.cattle.io.cluster.js index 74d603825b..f060cadd6e 100644 --- a/shell/models/provisioning.cattle.io.cluster.js +++ b/shell/models/provisioning.cattle.io.cluster.js @@ -986,4 +986,8 @@ export default class ProvCluster extends SteveModel { 'spec.rkeConfig.machinePools.dynamicSchemaSpec', ]; } + + get description() { + return super.description || this.mgmt?.description; + } } diff --git a/shell/pages/home.vue b/shell/pages/home.vue index 1abb7d2f44..4a1b03bd91 100644 --- a/shell/pages/home.vue +++ b/shell/pages/home.vue @@ -91,10 +91,6 @@ export default { ...mapGetters(['currentCluster', 'defaultClusterId', 'releaseNotesUrl']), mcm: mapFeature(MULTI_CLUSTER), - mgmtClusters() { - return this.$store.getters['management/all'](MANAGEMENT.CLUSTER); - }, - provClusters() { return this.$store.getters['management/all'](CAPI.RANCHER_CLUSTER); }, @@ -211,15 +207,7 @@ export default { }, kubeClusters() { - const filteredClusters = filterHiddenLocalCluster(filterOnlyKubernetesClusters(this.provClusters || [], this.$store), this.$store); - - return filteredClusters.map((provCluster) => { - const mgmtCluster = this.mgmtClusters?.find((c) => provCluster.mgmt?.id === c.id); - - provCluster.description = provCluster.description || mgmtCluster?.description; - - return provCluster; - }); + return filterHiddenLocalCluster(filterOnlyKubernetesClusters(this.provClusters || [], this.$store), this.$store); } }, diff --git a/shell/plugins/steve/hybrid-class.js b/shell/plugins/steve/hybrid-class.js index 0a43509993..e004d6e423 100644 --- a/shell/plugins/steve/hybrid-class.js +++ b/shell/plugins/steve/hybrid-class.js @@ -1,4 +1,4 @@ -import { ANNOTATIONS_TO_IGNORE_REGEX, LABELS_TO_IGNORE_REGEX, DESCRIPTION } from '@shell/config/labels-annotations'; +import { ANNOTATIONS_TO_IGNORE_REGEX, LABELS_TO_IGNORE_REGEX } from '@shell/config/labels-annotations'; import omitBy from 'lodash/omitBy'; import pickBy from 'lodash/pickBy'; import Vue from 'vue'; @@ -100,8 +100,4 @@ export default class HybridModel extends Resource { get state() { return this.stateObj?.name || 'unknown'; } - - get description() { - return this.metadata?.annotations?.[DESCRIPTION] || this.spec?.description || this._description; - } }