Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove non strict and non explicit relationships deprecation #1268

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Application from '@ember/application';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';
import './deprecation-workflow';

export default class App extends Application {
modulePrefix = config.modulePrefix;
Expand Down
12 changes: 12 additions & 0 deletions app/deprecation-workflow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
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' },
{ handler: 'silence', matchId: 'ember-data:deprecate-array-like' },
{ handler: 'silence', matchId: 'ember-data:no-a-with-array-like' },
],
});
6 changes: 3 additions & 3 deletions app/models/deposit.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ export default class DepositModel extends Model {
@attr('string') depositStatusRef;
@attr('string') depositStatus;

@belongsTo('repositoryCopy') repositoryCopy;
@belongsTo('submission') submission;
@belongsTo('repository') repository;
@belongsTo('repositoryCopy', { async: false, inverse: null }) repositoryCopy;
@belongsTo('submission', { async: false, inverse: null }) submission;
@belongsTo('repository', { async: false, inverse: null }) repository;
}

export const DepositStatus = {
Expand Down
2 changes: 1 addition & 1 deletion app/models/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default class FileModel extends Model {
@attr('string') uri;
@attr('string') mimeType;

@belongsTo('submission') submission;
@belongsTo('submission', { async: false, inverse: null }) submission;

// not represented on backend
// @attr('string') _file;
Expand Down
2 changes: 1 addition & 1 deletion app/models/funder.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export default class FunderModel extends Model {
@attr('string') url;
@attr('string') localKey;

@belongsTo('policy') policy;
@belongsTo('policy', { async: false, inverse: null }) policy;
}
8 changes: 4 additions & 4 deletions app/models/grant.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export default class GrantModel extends Model {
/** Date the grant ended */
@attr('date') endDate;

@belongsTo('user') pi;
@hasMany('user') coPis;
@belongsTo('funder') primaryFunder;
@belongsTo('funder') directFunder;
@belongsTo('user', { async: false, inverse: null }) pi;
@hasMany('user', { async: false, inverse: null }) coPis;
@belongsTo('funder', { async: true, inverse: null }) primaryFunder;
@belongsTo('funder', { async: false, inverse: null }) directFunder;
}
2 changes: 1 addition & 1 deletion app/models/policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default class PolicyModel extends Model {
@attr('string') description;
@attr('string') policyUrl;

@hasMany('repository') repositories;
@hasMany('repository', { async: false, inverse: null }) repositories;
@attr('string') institution;

@attr('string') _type;
Expand Down
3 changes: 1 addition & 2 deletions app/models/publication.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ export default class PublicationModel extends Model {
@attr('string') issue;
@attr('string') pmid;

@belongsTo('journal', { autoSave: true }) journal;
// submissions: DS.hasMany('submission', { async: true })
@belongsTo('journal', { async: false, inverse: null, autoSave: true }) journal;
get abstract() {
return this.publicationAbstract;
}
Expand Down
4 changes: 2 additions & 2 deletions app/models/repository-copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export default class RepositoryCopyModel extends Model {
@attr('string') accessUrl;
@attr('string') copyStatus;

@belongsTo('publication') publication;
@belongsTo('repository') repository;
@belongsTo('publication', { async: false, inverse: null }) publication;
@belongsTo('repository', { async: false, inverse: null }) repository;
}

export const CopyStatus = {
Expand Down
4 changes: 2 additions & 2 deletions app/models/submission-event.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export default class SubmissionEventModel extends Model {
@attr('string') comment;
@attr('string') link;

@belongsTo('submission') submission;
@belongsTo('user') performedBy;
@belongsTo('submission', { async: true, inverse: '_submissionEvents' }) submission;
@belongsTo('user', { async: false, inverse: null }) performedBy;
}

export const Type = {
Expand Down
12 changes: 7 additions & 5 deletions app/models/submission.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ export default class SubmissionModel extends Model {
submitterEmail;
@attr('number') version;

@belongsTo('user') submitter;
@belongsTo('publication') publication;
@belongsTo('user', { async: false, inverse: null }) submitter;
@belongsTo('publication', { async: false, inverse: null }) publication;

@hasMany('user') preparers;
@hasMany('repository') repositories;
@hasMany('policy') effectivePolicies;
@hasMany('user', { async: false, inverse: null }) preparers;
@hasMany('repository', { async: true, inverse: null }) repositories;
@hasMany('policy', { async: false, inverse: null }) effectivePolicies;
// not on this model on API
@hasMany('submissionEvent', {
async: true,
inverse: 'submission',
})
_submissionEvents;
/**
Expand All @@ -38,6 +39,7 @@ export default class SubmissionModel extends Model {
*/
@hasMany('grant', {
async: true,
inverse: null,
})
grants;

Expand Down
12 changes: 0 additions & 12 deletions config/deprecation-workflow.js

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"ember-cli-content-security-policy": "^2.0.3",
"ember-cli-dependency-checker": "^3.3.2",
"ember-cli-dependency-lint": "^2.0.1",
"ember-cli-deprecation-workflow": "^2.1.0",
"ember-cli-deprecation-workflow": "github:mixonic/ember-cli-deprecation-workflow#master",
"ember-cli-flash": "^4.0.0",
"ember-cli-htmlbars": "^6.1.1",
"ember-cli-inject-live-reload": "^2.1.0",
Expand Down
Loading
Loading