Skip to content

Commit

Permalink
Merge pull request #1643 from mantis-toboggan-md/bugfix-cis
Browse files Browse the repository at this point in the history
Clarify custerscan's default profile in dropdown
  • Loading branch information
vincent99 authored Oct 12, 2020
2 parents 8875b93 + 8c080cb commit 4084881
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions edit/cis.cattle.io.clusterscan.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand All @@ -78,17 +74,21 @@ 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;
}
},
watch: {
validProfiles(neu) {
defaultProfile(neu) {
if (neu && !this.scanProfileName) {
this.scanProfileName = neu[0]?.value;
this.scanProfileName = neu?.id;
}
},
},
Expand Down Expand Up @@ -133,7 +133,13 @@ export default {
<div v-else class="row">
<div class="col span-6">
<LabeledSelect v-model="scanProfileName" :mode="mode" :label="t('cis.profile')" :options="validProfiles" @input="value.spec.scanProfileName = $event" />
<LabeledSelect
v-model="scanProfileName"
:mode="mode"
:label="t('cis.profile')"
:options="validProfiles"
@input="value.spec.scanProfileName = $event"
/>
</div>
</div>
</template>
Expand Down

0 comments on commit 4084881

Please sign in to comment.