unknown type

This commit is contained in:
dharini committed 2022-01-31 11:41:15 -08:00
1 parent 0577cdec76
commit 36eab2e0f1
3 files changed
+17 -3

No files matched your search

+13 -1
View File
@@ -26,7 +26,15 @@ export default class HostCatalogModel extends GeneratedHostCatalogModel {
* @type {boolean}
*/
get isUnknown() {
return this.isPlugin && !types.includes(this.plugin.name);
console.log(this.isPlugin, 'IS IT PLUGIN', this.plugin, types);
// if(this.plugin === undefined) {
// console.log('in USEFNNFNF')
// return false;
// } else {
// console.log('in ELSE EE')
return this.isPlugin && !types.includes(this.plugin.name);
// }
}
/**
@@ -51,6 +59,8 @@ export default class HostCatalogModel extends GeneratedHostCatalogModel {
* @type {string}
*/
get compositeType() {
console.log(this, this.isPlugin, 'WHAT IS PLUGNI');
// if(this.plugin === undefined) return 'static';
if (this.isUnknown) return 'unknown';
if (this.isPlugin) return this.plugin.name;
return 'static';
@@ -65,7 +75,9 @@ export default class HostCatalogModel extends GeneratedHostCatalogModel {
this.type = 'static';
} else {
this.type = 'plugin';
this.plugin = { name: type };
console.log('COMPOSITI' , this.plugin, type)
}
}
}
@@ -2,8 +2,8 @@ COMES JERE
{{{log 'BLLL' @model.compositeType}}}
{{{log 'NNFRM' @model.isNew}}}
{{#if @model.isNew}}
{{!-- {{#if @model.compositeType}} --}}
{{!-- {{#if @model.isNew}} --}}
{{#if @model.compositeType}}
{{component
(concat 'form/host-catalog/' @model.compositeType)
model=@model
@@ -25,8 +25,10 @@ export default class ScopesScopeHostCatalogsNewRoute extends Route {
model(params) {
const scopeModel = this.modelFor('scopes.scope');
if (!params.type) params.type = 'plugin';
params.name = 'Avon';
return this.store.createRecord('host-catalog', {
type: params.type,
name: params.name,
scopeModel,
});
}