Merge pull request #15405 from codyrancher/constraint

Fixing an issue where the Constraint subtype menu wasn't displayed/selected causing problems with saving
This commit is contained in:
codyrancher 2025-09-11 12:54:45 -07:00 committed by GitHub
commit e84cfd0260
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View File

@ -3228,6 +3228,7 @@ footer:
slack: Slack
gatekeeperConstraint:
templateRequired: You must have at least one Template before attempting to create a Constraint.
downloadViolations: Download Violations
match:
title: Match

View File

@ -17,6 +17,7 @@ import { saferDump } from '@shell/utils/create-yaml';
import NamespaceList, { NAMESPACE_FILTERS_HELPER } from './NamespaceList';
import MatchKinds from './MatchKinds';
import Scope, { SCOPE_OPTIONS } from './Scope';
import Banner from '@components/Banner/Banner';
function findConstraintTypes(schemas) {
return schemas
@ -43,7 +44,8 @@ export default {
Scope,
Tab,
Tabbed,
YamlEditor
YamlEditor,
Banner
},
mixins: [CreateEditView],
@ -230,11 +232,17 @@ export default {
};
</script>
<template>
<Banner
v-if="templateSubtypes.length === 0"
color="warning"
>
{{ t('gatekeeperConstraint.templateRequired') }}
</Banner>
<CruResource
v-else
:done-route="doneRoute"
:mode="mode"
:resource="value"
:selected-subtype="value.kind"
:subtypes="templateSubtypes"
:validation-passed="true"
:errors="errors"