github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/mirage/factories/policy.js (about)

     1  import { Factory } from 'ember-cli-mirage';
     2  import faker from 'nomad-ui/mirage/faker';
     3  
     4  export default Factory.extend({
     5    id: () => faker.hacker.verb(),
     6    name() {
     7      return this.id;
     8    },
     9    description: () => (faker.random.number(10) >= 2 ? faker.lorem.sentence() : null),
    10    rules: `# Allow read only access to the default namespace
    11  namespace "default" {
    12      policy = "read"
    13  }
    14  
    15  node {
    16      policy = "read"
    17  }`,
    18    rulesJSON: () => ({
    19      Node: {
    20        Policy: 'read',
    21      },
    22    }),
    23  });