1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/mirage/factories/user.js
Kevin Ansfield 38b138d759 Use token input to allow selection of multiple authors in PSM
requires https://github.com/TryGhost/Ghost/pull/9426
- fixed default token component display in {{gh-token-input}}
    - if no `tokenComponent` is passed to `{{gh-token-input}}` then it should default to the ember-drag-drop `draggable-object` component but instead it didn't output anything
    - put `draggable-object` in quotes because `{{component}}` needs a component name rather than an object
    - rename `option` attribute to `content` to match the default `{{draggable-object}}` interface
- add embedded `authors` attr to the Post model
    - ensure authors is populated when starting new post
    - add validation for empty authors list
- swap author dropdown for a token input in PSM
- show all post authors in posts list
- update tests for `authors`
  - always provide through an authors array
  - fix mirage serialisation for paginated responses (embedded records were not being serialised)
- unify tags and author inputs design
  - remove highlight of primary tags
  - highlight internal tags
  - remove unnecessary/redundant title attributes on tags
  - use SVG icon for "remove option" button in token inputs
2018-03-27 18:50:52 +01:00

26 lines
727 B
JavaScript

import {Factory} from 'ember-cli-mirage';
export default Factory.extend({
accessibility: null,
bio: null,
coverImage: null,
createdAt: '2015-09-02T13:41:50.000Z',
createdBy: null,
email(i) { return `user-${i}@example.com`; },
profileImage: '//www.gravatar.com/avatar/3ae045bc198a157401827c8455cd7c99?s=250&d=mm&r=x',
lastLogin: '2015-11-02T16:12:05.000Z',
location: null,
metaDescription: null,
metaTitle: null,
name(i) { return `User ${i}`; },
slug(i) { return `user-${i}`; },
status: 'active',
tour: null,
updatedAt: '2015-11-02T16:12:05.000Z',
updatedBy: '1',
website: 'http://example.com',
posts() { return []; },
roles() { return []; }
});