Skip to content

Commit

Permalink
refactor: fix deprecate-early-static (#1269)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredgalanis authored Jun 27, 2024
1 parent 2ceff3a commit 2826c09
Show file tree
Hide file tree
Showing 8 changed files with 289 additions and 1,688 deletions.
1 change: 0 additions & 1 deletion app/deprecation-workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import setupDeprecationWorkflow from 'ember-cli-deprecation-workflow';

setupDeprecationWorkflow({
workflow: [
{ handler: 'silence', matchId: 'ember-data:deprecate-early-static' },
{ handler: 'silence', matchId: 'ensure-safe-component.string' },
{ handler: 'silence', matchId: 'routing.transition-methods' },
{ handler: 'silence', matchId: 'ember-data:deprecate-promise-many-array-behaviors' },
Expand Down
2 changes: 1 addition & 1 deletion mirage/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function (config) {

let finalConfig = {
...config,
models: { ...discoverEmberDataModels(), ...config.models },
models: { ...discoverEmberDataModels(config.store), ...config.models },
serializers: {
application: JSONAPISerializer.extend({
keyForAttribute: (attr) => (attr ? camelize(attr) : null),
Expand Down
File renamed without changes.
3 changes: 0 additions & 3 deletions mirage/models/schema.js

This file was deleted.

12 changes: 8 additions & 4 deletions mirage/routes/schemas.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
// import { metaDataSchemas } from 'pass-ui/mirage/custom-fixtures/schemas';
import metaDataSchemas from '../custom-fixtures/schemas';

export default function (server) {
server.get('/schema', (schema, request) => {
server.get('/schema', (_schema, request) => {
// if there are more than one repositories in the request body return the
// the schema that includes PMC, otherwise return the schema without PMC
let metaDataSchema;

if (request.queryParams.entityIds.split(',').length > 1) {
metaDataSchema = schema.schemas.all().models[0];
metaDataSchema = metaDataSchemas[0];
} else {
metaDataSchema = schema.schemas.all().models[1];
metaDataSchema = metaDataSchemas[1];
}

return [metaDataSchema.attrs];
return [metaDataSchema];
});
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"ember-cli-htmlbars": "^6.1.1",
"ember-cli-inject-live-reload": "^2.1.0",
"ember-cli-inline-content": "^0.4.1",
"ember-cli-mirage": "^2.4.0",
"ember-cli-mirage": "^3.0.3",
"ember-cli-sri": "^2.1.1",
"ember-cli-terser": "^4.0.2",
"ember-composable-helpers": "^5.0.0",
Expand Down Expand Up @@ -102,6 +102,7 @@
"lint-to-the-future-eslint": "^2.0.1",
"loader.js": "^4.7.0",
"merge": ">=1.2.1",
"miragejs": "^0.1.48",
"popper.js": "^1.14.5",
"prettier": "^2.8.7",
"qunit": "^2.19.2",
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/services/policies-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import EmberObject from '@ember/object';
import { setupTest } from 'ember-qunit';
import { setupMirage } from 'ember-cli-mirage/test-support';
import { module, test } from 'qunit';
import { Response } from 'ember-cli-mirage';
import { Response } from 'miragejs';

module('Unit | Service | policies', (hooks) => {
setupTest(hooks);
Expand Down
1,954 changes: 277 additions & 1,677 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 2826c09

Please sign in to comment.