s/category/categories for new project

This commit is contained in:
Vincent Fiduccia 2017-03-04 17:28:09 -07:00
parent 9e12a362bd
commit f15f9a0264
No known key found for this signature in database
GPG Key ID: 2B29AD6BB2BB2582
2 changed files with 21 additions and 16 deletions

View File

@ -31,10 +31,10 @@ export default Resource.extend({
}
}.property('catalogTemplate'),
category: function() {
categories: function() {
let tpl = this.get('catalogTemplate');
if ( tpl ) {
return tpl.get('category');
return tpl.get('categories');
}
}.property('catalogTemplate'),
}.property('catalogTemplate.categories'),
});

View File

@ -40,20 +40,22 @@ var ProjectTemplate = Resource.extend(PolledResource, {
};
this.get('stacks').forEach((stack) => {
let category = stack.get('category')||'Unknown';
if ( !map[category] ) {
map[category] = '';
}
let categories = stack.get('categories')||['Unknown'];
categories.forEach((category) => {
if ( !map[category] ) {
map[category] = '';
}
let tpl = stack.get('catalogTemplate');
let name;
if ( tpl ) {
name = tpl.get('name');
} else {
name = stack.get('name');
}
let tpl = stack.get('catalogTemplate');
let name;
if ( tpl ) {
name = tpl.get('name');
} else {
name = stack.get('name');
}
map[category] += (map[category] ? ', ' : '') + name;
map[category] += (map[category] ? ', ' : '') + name;
});
});
if ( !map['Orchestration'] ) {
@ -75,7 +77,10 @@ var ProjectTemplate = Resource.extend(PolledResource, {
}.property('stacks.[]'),
orchestrationIcon: function() {
let orch = this.get('stacks').findBy('catalogTemplate.category','Orchestration');
let orch = this.get('stacks').find((stack) => {
return stack.get('categories').includes('Orchestration');
});
if ( orch ) {
return orch.get('icon');
} else {