mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 02:45:42 +03:00
* Related entities scaffolded * Added hint on edit * Re-classic'd * Dont create entities when path goes beyond task level * only show the related entities hint for new vars, not edited ones * Unit tests for pathLinkedEntities * Acceptance tests for linked entities * Add hint on creation * Will be vs Is on @new boolean flag * Link styles and namespaces on links * Unused component class * Delog * Defensive shouldShowLinked * Properly instantiating the accessibilty check test
36 lines
1019 B
JavaScript
36 lines
1019 B
JavaScript
import { Factory } from 'ember-cli-mirage';
|
|
import faker from 'nomad-ui/mirage/faker';
|
|
import { pickOne } from '../utils';
|
|
export default Factory.extend({
|
|
id: () => faker.random.words(3).split(' ').join('/').toLowerCase(),
|
|
path() {
|
|
return this.id;
|
|
},
|
|
namespace: null,
|
|
createdIndex: 100,
|
|
modifiedIndex: 100,
|
|
createTime: () => faker.date.past(15),
|
|
modifyTime: () => faker.date.recent(1),
|
|
items() {
|
|
return (
|
|
this.Items || {
|
|
[faker.database.column()]: faker.database.collation(),
|
|
[faker.database.column()]: faker.database.collation(),
|
|
[faker.database.column()]: faker.database.collation(),
|
|
[faker.database.column()]: faker.database.collation(),
|
|
[faker.database.column()]: faker.database.collation(),
|
|
}
|
|
);
|
|
},
|
|
|
|
afterCreate(variable, server) {
|
|
if (!variable.namespaceId) {
|
|
const namespace =
|
|
(server.db.jobs && server.db.jobs[0]?.namespace) || 'default';
|
|
variable.update({
|
|
namespace,
|
|
});
|
|
}
|
|
},
|
|
});
|