Skip to content

Commit

Permalink
chore(frontend): use ember-cli-mirage v3
Browse files Browse the repository at this point in the history
  • Loading branch information
c0rydoras committed May 21, 2024
1 parent b4ead5b commit d751b6d
Show file tree
Hide file tree
Showing 30 changed files with 50 additions and 90 deletions.
7 changes: 4 additions & 3 deletions frontend/mirage/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Response, discoverEmberDataModels } from "ember-cli-mirage";
import { createServer } from "miragejs";
import { discoverEmberDataModels } from "ember-cli-mirage";
import { createServer, Response } from "miragejs";
import moment from "moment";
import formatDuration from "timed/utils/format-duration";
import parseDjangoDuration from "timed/utils/parse-django-duration";
Expand Down Expand Up @@ -48,7 +48,8 @@ const byUserAndDate = (modelName) => {
export default function (config) {
const finalConfig = {
...config,
models: { ...discoverEmberDataModels(), ...config.models },
trackRequests: true,
models: { ...discoverEmberDataModels(config.store), ...config.models },
routes,
};

Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/absence-balance.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Factory, trait } from "ember-cli-mirage";
import faker from "faker";
import { Factory, trait } from "miragejs";
import moment from "moment";

import { randomDuration } from "../helpers/duration";
Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/absence-credit.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Factory } from "ember-cli-mirage";
import faker from "faker";
import { Factory } from "miragejs";
import moment from "moment";

export default Factory.extend({
Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/absence-type.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Factory } from "ember-cli-mirage";
import faker from "faker";
import { Factory } from "miragejs";

export default Factory.extend({
name: () => faker.lorem.word(),
Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/absence.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Factory } from "ember-cli-mirage";
import faker from "faker";
import { Factory } from "miragejs";
import moment from "moment";

export default Factory.extend({
Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/activity.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Factory, trait } from "ember-cli-mirage";
import faker from "faker";
import { Factory, trait } from "miragejs";
import moment from "moment";

export default Factory.extend({
Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/attendance.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Factory, trait } from "ember-cli-mirage";
import { Factory, trait } from "miragejs";
import moment from "moment";

export default Factory.extend({
Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/billing-type.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Factory } from "ember-cli-mirage";
import faker from "faker";
import { Factory } from "miragejs";

export default Factory.extend({
name: () => faker.lorem.word(),
Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/cost-center.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Factory } from "ember-cli-mirage";
import faker from "faker";
import { Factory } from "miragejs";

export default Factory.extend({
name: () => faker.finance.accountName(),
Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/customer-statistic.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Factory } from "ember-cli-mirage";
import { Factory } from "miragejs";

import { randomDuration } from "../helpers/duration";

Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/customer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Factory } from "ember-cli-mirage";
import faker from "faker";
import { Factory } from "miragejs";

export default Factory.extend({
name: () => faker.company.companyName(),
Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/employment.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Factory, trait } from "ember-cli-mirage";
import faker from "faker";
import { Factory, trait } from "miragejs";
import moment from "moment";
import DjangoDurationTransform from "timed/transforms/django-duration";

Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/location.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Factory } from "ember-cli-mirage";
import faker from "faker";
import { Factory } from "miragejs";

export default Factory.extend({
name: () => faker.address.city(),
Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/month-statistic.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Factory } from "ember-cli-mirage";
import { Factory } from "miragejs";

import { randomDuration } from "../helpers/duration";

Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/overtime-credit.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Factory } from "ember-cli-mirage";
import faker from "faker";
import { Factory } from "miragejs";
import moment from "moment";

import { randomDuration } from "../helpers/duration";
Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/project-assignee.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Factory } from "ember-cli-mirage";
import { Factory } from "miragejs";

export default Factory.extend({
isReviewer: true,
Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/project-statistic.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Factory } from "ember-cli-mirage";
import { Factory } from "miragejs";

import { randomDuration } from "../helpers/duration";

Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/project.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Factory, association, trait } from "ember-cli-mirage";
import faker from "faker";
import { Factory, association, trait } from "miragejs";

import { randomDuration } from "../helpers/duration";

Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/public-holiday.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Factory } from "ember-cli-mirage";
import faker from "faker";
import { Factory } from "miragejs";
import moment from "moment";

export default Factory.extend({
Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/report-intersection.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Factory } from "ember-cli-mirage";
import faker from "faker";
import { Factory } from "miragejs";

export default Factory.extend({
comment: () => faker.lorem.sentence(),
Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/report.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Factory } from "ember-cli-mirage";
import faker from "faker";
import { Factory } from "miragejs";
import moment from "moment";

import { randomDuration } from "../helpers/duration";
Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/task-statistic.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Factory } from "ember-cli-mirage";
import { Factory } from "miragejs";

import { randomDuration } from "../helpers/duration";

Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/task.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { capitalize } from "@ember/string";
import { Factory } from "ember-cli-mirage";
import faker from "faker";
import { Factory } from "miragejs";

import { randomDuration } from "../helpers/duration";

Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/user-statistic.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Factory } from "ember-cli-mirage";
import { Factory } from "miragejs";

import { randomDuration } from "../helpers/duration";

Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/user.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Factory } from "ember-cli-mirage";
import faker from "faker";
import { Factory } from "miragejs";
import moment from "moment";

export default Factory.extend({
Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/worktime-balance.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Factory } from "ember-cli-mirage";
import { Factory } from "miragejs";
import moment from "moment";

import { randomDuration } from "../helpers/duration";
Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/year-statistic.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Factory } from "ember-cli-mirage";
import { Factory } from "miragejs";

import { randomDuration } from "../helpers/duration";

Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/serializers/application.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JSONAPISerializer } from "ember-cli-mirage";
import { JSONAPISerializer } from "miragejs";

export default JSONAPISerializer.extend({
alwaysIncludeLinkageData: true,
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"ember-cli-deprecation-workflow": "2.1.0",
"ember-cli-htmlbars": "6.2.0",
"ember-cli-inject-live-reload": "2.1.0",
"ember-cli-mirage": "2.4.0",
"ember-cli-mirage": "^3.0.0",
"ember-cli-moment-shim": "3.8.0",
"ember-cli-nouislider": "derrabauke/ember-cli-nouislider#cf0d87986cf25d5795e1edd6c8b9f008c5b39872",
"ember-cli-sass": "11.0.1",
Expand Down
77 changes: 18 additions & 59 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d751b6d

Please sign in to comment.