PHP 8.2.30
Preview: resource-json.factory.js Size: 1.51 KB
//proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/lib/frontend/components/spec/resource-json.factory.js

import { factory } from 'factory-girl';
import './property-json.factory.js';
const propertyJson = await factory.build('PropertyJSON');
factory.define('ResourceJSON', Object, {
  id: factory.sequence('ResourceJSON.id', i => `resource${i}`),
  name: factory.sequence('ResourceJSON.name', i => `resource ${i}`),
  href: '/admin/resourceName',
  titleProperty: () => propertyJson,
  navigation: {
    name: 'someName',
    icon: 'someIcon',
    show: true
  },
  actions: [],
  resourceActions: [],
  listProperties: [],
  properties: {},
  showProperties: [],
  filterProperties: [],
  editProperties: []
});
factory.extend('ResourceJSON', 'ResourceJSON.full', {}, {
  afterBuild: async model => {
    const properties = [await factory.build('PropertyJSON', {
      name: 'name',
      isTitle: true
    }), await factory.build('PropertyJSON', {
      name: 'surname'
    }), await factory.build('PropertyJSON', {
      name: 'content',
      type: 'string'
    }), await factory.build('PropertyJSON', {
      name: 'longerData',
      type: 'textarea'
    }),
    // await factory.build<PropertyJSON>('PropertyJSON', { name: 'publishedAt', type: 'date' }),
    await factory.build('PropertyJSON', {
      name: 'gender',
      availableValues: [{
        label: 'male',
        value: 'MALE'
      }, {
        label: 'female',
        value: 'FEMALE'
      }]
    })];
    return {
      ...model,
      listProperties: properties,
      showProperties: properties,
      editProperties: properties,
      filterProperties: properties
    };
  }
});

Directory Contents

Dirs: 0 × Files: 8

Name Size Perms Modified Actions
470 B lrw-r--r-- 2026-02-28 00:28:58
Edit Download
302 B lrw-r--r-- 2026-02-28 00:31:30
Edit Download
127 B lrw-r--r-- 2026-02-28 00:31:44
Edit Download
214 B lrw-r--r-- 2026-02-28 00:31:48
Edit Download
793 B lrw-r--r-- 2026-02-28 00:31:48
Edit Download
1.06 KB lrw-r--r-- 2026-02-28 00:31:48
Edit Download
1.51 KB lrw-r--r-- 2026-02-28 00:31:48
Edit Download
946 B lrw-r--r-- 2026-02-28 00:31:50
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).