From 9000328a73b4a2051e0a3fb2b67a7fd6531cee21 Mon Sep 17 00:00:00 2001 From: loganhz Date: Fri, 24 Aug 2018 15:51:19 +0800 Subject: [PATCH 1/2] Fix the issue that user can not deploy catalog item --- lib/shared/addon/catalog/service.js | 4 +++- .../components/schema/input-boolean/component.js | 13 ++++++++----- .../addon/components/schema/input-enum/template.hbs | 8 ++++---- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/lib/shared/addon/catalog/service.js b/lib/shared/addon/catalog/service.js index 32335ac42..34aaced37 100644 --- a/lib/shared/addon/catalog/service.js +++ b/lib/shared/addon/catalog/service.js @@ -75,7 +75,9 @@ export default Service.extend({ apps.forEach((app) => { let extInfo = parseHelmExternalId(app.get('externalId')); - deps.push(this.fetchTemplate(extInfo.templateId, false)); + if ( extInfo && extInfo.templateId ) { + deps.push(this.fetchTemplate(extInfo.templateId, false)); + } }); return allSettled(deps); diff --git a/lib/shared/addon/components/schema/input-boolean/component.js b/lib/shared/addon/components/schema/input-boolean/component.js index fe2122d1f..edc61f094 100644 --- a/lib/shared/addon/components/schema/input-boolean/component.js +++ b/lib/shared/addon/components/schema/input-boolean/component.js @@ -1,14 +1,17 @@ import Component from '@ember/component'; +import { next } from '@ember/runloop'; import layout from './template'; export default Component.extend({ layout, didReceiveAttrs() { - if ( this.get('value') === 'false' ) { - this.set('value', false); - } else if ( this.get('value') === 'true' ) { - this.set('value', true); - } + next(() => { + if ( this.get('value') === 'false' ) { + this.set('value', false); + } else if ( this.get('value') === 'true' ) { + this.set('value', true); + } + }); } }); diff --git a/lib/shared/addon/components/schema/input-enum/template.hbs b/lib/shared/addon/components/schema/input-enum/template.hbs index ab3fcec8d..b92950e6b 100644 --- a/lib/shared/addon/components/schema/input-enum/template.hbs +++ b/lib/shared/addon/components/schema/input-enum/template.hbs @@ -1,11 +1,11 @@