Default state for type, then if there is host-catalog as parent, inherit its type

This commit is contained in:
Carlos Alcaide Corvo committed 2022-01-26 13:42:58 -08:00
1 parent f0b2152130
commit 92b4dccf78
2 files changed
+6 -1

No files matched your search

+5
View File
@@ -12,6 +12,11 @@ export default factory.extend({
'remove-hosts',
],
id: (i) => `host-set-id-${i}`,
type() {
if (this.hostCatalog) {
return this.hostCatalog.type;
}
},
plugin() {
if (this.type === 'plugin') {
return this.hostCatalog.plugin;
@@ -5,7 +5,7 @@ import { random, date, datatype } from 'faker';
* GeneratedHostSetModelFactory
*/
export default Factory.extend({
type: () => this.hostCatalog.type,
type: 'static',
name: () => random.words(),
description: () => random.words(),
created_time: () => date.recent(),