diff --git a/lib/shared/addon/components/cru-config-map/component.js b/lib/shared/addon/components/cru-config-map/component.js index b26ca2114..f638bf390 100644 --- a/lib/shared/addon/components/cru-config-map/component.js +++ b/lib/shared/addon/components/cru-config-map/component.js @@ -36,7 +36,10 @@ export default Component.extend(ViewNewEdit, OptionallyNamespaced, { }, validate() { - return true; + const errors = []; + errors.pushObjects(get(this,'namespaceErrors')||[]); + set(this,'errors', errors); + return errors.length === 0; }, doSave() { diff --git a/lib/shared/addon/components/cru-secret/component.js b/lib/shared/addon/components/cru-secret/component.js index 47d9c27f2..20a22ddd3 100644 --- a/lib/shared/addon/components/cru-secret/component.js +++ b/lib/shared/addon/components/cru-secret/component.js @@ -1,4 +1,4 @@ -import { set } from '@ember/object'; +import { get, set } from '@ember/object'; import Component from '@ember/component'; import ViewNewEdit from 'shared/mixins/view-new-edit'; import OptionallyNamespaced from 'shared/mixins/optionally-namespaced'; @@ -21,6 +21,14 @@ export default Component.extend(ViewNewEdit, OptionallyNamespaced, { projectType: 'secret', namespacedType: 'namespacedSecret', + + validate() { + const errors = []; + errors.pushObjects(get(this,'namespaceErrors')||[]); + set(this,'errors', errors); + return errors.length === 0; + }, + doSave() { let self = this; let sup = self._super; diff --git a/lib/shared/addon/components/cru-secret/template.hbs b/lib/shared/addon/components/cru-secret/template.hbs index 4779f12ad..44e46597a 100644 --- a/lib/shared/addon/components/cru-secret/template.hbs +++ b/lib/shared/addon/components/cru-secret/template.hbs @@ -22,7 +22,7 @@ }} {{/if}} -{{optionally-namespaced scope=scope mode=mode namespace=namespace model=model}} +{{optionally-namespaced namespaceErrors=namespaceErrors scope=scope mode=mode namespace=namespace model=model}}
diff --git a/lib/shared/addon/components/optionally-namespaced/component.js b/lib/shared/addon/components/optionally-namespaced/component.js index da563ebc2..1ae5a361d 100644 --- a/lib/shared/addon/components/optionally-namespaced/component.js +++ b/lib/shared/addon/components/optionally-namespaced/component.js @@ -11,6 +11,7 @@ export default Component.extend({ scope: null, namespace: null, model: null, + namespaceErrors: null, isView: equal('mode', VIEW), isNew: equal('mode', NEW),