diff --git a/assets/translations/en-us.yaml b/assets/translations/en-us.yaml index 8e421e6501..7a1429d44c 100644 --- a/assets/translations/en-us.yaml +++ b/assets/translations/en-us.yaml @@ -417,3 +417,9 @@ resourceYaml: buttons: continue: Continue Editing diff: Show Diff + +resourceList: + head: + create: Create + createFromYaml: Create from YAML + diff --git a/components/ResourceDetail/index.vue b/components/ResourceDetail/index.vue index 46bed9e5f4..cf4787468c 100644 --- a/components/ResourceDetail/index.vue +++ b/components/ResourceDetail/index.vue @@ -285,6 +285,7 @@ export default { :yaml="yaml" :offer-preview="offerPreview" :done-route="doneRoute" + :done-override="model.doneOverride" /> diff --git a/config/type-config.js b/config/type-config.js index 1bdc36f33d..f62d120d30 100644 --- a/config/type-config.js +++ b/config/type-config.js @@ -43,8 +43,8 @@ export default function(store) { NODE, 'workload', 'gatekeeper', - 'gatekeeper-constraints', - 'gatekeeper-templates', + 'gatekeeper-constraint', + 'gatekeeper-template', ]); mapTypeToComponentName(/^constraints.gatekeeper.sh.*$/, 'gatekeeper-constraint'); @@ -245,7 +245,7 @@ export default function(store) { virtualType({ label: 'Constraint', namespaced: false, - name: 'gatekeeper-constraints', + name: 'gatekeeper-constraint', group: 'Cluster::OPA Gatekeeper', route: { name: 'c-cluster-gatekeeper-constraints' }, ifHaveType: GATEKEEPER_CONSTRAINT_TEMPLATE @@ -254,7 +254,7 @@ export default function(store) { virtualType({ label: 'Template', namespaced: false, - name: 'gatekeeper-templates', + name: 'gatekeeper-template', group: 'Cluster::OPA Gatekeeper', route: { name: 'c-cluster-gatekeeper-templates' }, ifHaveType: GATEKEEPER_CONSTRAINT_TEMPLATE diff --git a/models/gatekeeper-constraint.js b/models/gatekeeper-constraint.js new file mode 100644 index 0000000000..f33da1847d --- /dev/null +++ b/models/gatekeeper-constraint.js @@ -0,0 +1,7 @@ +export default { + doneOverride() { + return () => { + this.currentRouter().replace({ name: 'c-cluster-gatekeeper-constraints' }); + }; + } +}; diff --git a/models/templates.gatekeeper.sh.constrainttemplate.js b/models/templates.gatekeeper.sh.constrainttemplate.js index c4e23c3d6a..af7d35973f 100644 --- a/models/templates.gatekeeper.sh.constrainttemplate.js +++ b/models/templates.gatekeeper.sh.constrainttemplate.js @@ -15,5 +15,11 @@ export default { return constraints.length > 0 ? `There are still constaints using this template. You cannot delete this template while it's in use.` : null; + }, + + doneOverride() { + return () => { + this.currentRouter().replace({ name: 'c-cluster-gatekeeper-templates' }); + }; } }; diff --git a/pages/c/_cluster/_resource/index.vue b/pages/c/_cluster/_resource/index.vue index 1c256dbe7d..07909b3d6c 100644 --- a/pages/c/_cluster/_resource/index.vue +++ b/pages/c/_cluster/_resource/index.vue @@ -1,14 +1,12 @@