From 8c080cb39f22455e6dc7dd7dbeca494895aa3c47 Mon Sep 17 00:00:00 2001 From: Nancy Butler <42977925+mantis-toboggan-md@users.noreply.github.com> Date: Wed, 7 Oct 2020 14:49:16 -0700 Subject: [PATCH] remove default option from clusterscanprofile dropdown --- edit/cis.cattle.io.clusterscan.vue | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/edit/cis.cattle.io.clusterscan.vue b/edit/cis.cattle.io.clusterscan.vue index 130957f487c..5aeb1e649dd 100644 --- a/edit/cis.cattle.io.clusterscan.vue +++ b/edit/cis.cattle.io.clusterscan.vue @@ -66,10 +66,6 @@ export default { return { label: profile.id, value: profile.id }; }); - if (profileNames.length !== 1 && this.defaultProfile) { - profileNames.unshift({ label: this.t('generic.default'), value: this.defaultProfile }); - } - return profileNames; }, @@ -78,7 +74,11 @@ export default { const profiles = this.defaultConfigMap.data; const provider = this.currentCluster.status.provider; - return profiles[provider] || profiles.default; + const name = profiles[provider] || profiles.default; + + if (name) { + return this.allProfiles.find(profile => profile.id === name); + } } return null; @@ -86,9 +86,9 @@ export default { }, watch: { - validProfiles(neu) { + defaultProfile(neu) { if (neu && !this.scanProfileName) { - this.scanProfileName = neu[0]?.value; + this.scanProfileName = neu?.id; } }, }, @@ -133,7 +133,13 @@ export default {