From 07f331ea7bf701562e4c0fe5e36d0aa45a90647b Mon Sep 17 00:00:00 2001 From: Arthur Deierlein Date: Tue, 3 Sep 2024 13:40:33 +0200 Subject: [PATCH] chore(frontend/models): adjust for ember-data v5.3 --- frontend/app/models/absence-balance.js | 4 ++-- frontend/app/models/absence-credit.js | 2 +- frontend/app/models/absence.js | 2 +- frontend/app/models/activity.js | 10 +++++----- frontend/app/models/project.js | 2 +- frontend/app/models/report.js | 4 ++-- frontend/app/models/user.js | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/frontend/app/models/absence-balance.js b/frontend/app/models/absence-balance.js index 796e1bb46..ad425b658 100644 --- a/frontend/app/models/absence-balance.js +++ b/frontend/app/models/absence-balance.js @@ -5,8 +5,8 @@ export default class AbsenceBalance extends Model { @attr("number") usedDays; @attr("django-duration") usedDuration; @attr("number") balance; - @belongsTo("user", { async: true, inverse: "absenceBalances" }) user; - @belongsTo("absence-type", { async: true, inverse: "absenceBalances" }) + @belongsTo("user", { async: false, inverse: "absenceBalances" }) user; + @belongsTo("absence-type", { async: false, inverse: "absenceBalances" }) absenceType; @hasMany("absence-credit", { async: true, inverse: null }) absenceCredits; } diff --git a/frontend/app/models/absence-credit.js b/frontend/app/models/absence-credit.js index 9debf7843..417c3960c 100644 --- a/frontend/app/models/absence-credit.js +++ b/frontend/app/models/absence-credit.js @@ -43,7 +43,7 @@ export default class AbsenceCredit extends Model { * @property {AbsenceType} absenceType * @public */ - @belongsTo("absence-type", { async: true, inverse: null }) absenceType; + @belongsTo("absence-type", { async: false, inverse: null }) absenceType; /** * The user to which this credit belongs to diff --git a/frontend/app/models/absence.js b/frontend/app/models/absence.js index 23214164a..630f1b91c 100644 --- a/frontend/app/models/absence.js +++ b/frontend/app/models/absence.js @@ -44,7 +44,7 @@ export default class Absence extends Model { * @property {AbsenceType} absenceType * @public */ - @belongsTo("absence-type", { async: true, inverse: null }) absenceType; + @belongsTo("absence-type", { async: false, inverse: null }) absenceType; /** * The user diff --git a/frontend/app/models/activity.js b/frontend/app/models/activity.js index 8cdbef915..40c64e3a3 100644 --- a/frontend/app/models/activity.js +++ b/frontend/app/models/activity.js @@ -60,12 +60,12 @@ export default class Activity extends Model { } async start() { - const activity = this.store.createRecord("activity", { + const activity = await this.store.createRecord("activity", { date: moment(), fromTime: moment(), - task: this.task, + task: await this.task, comment: this.comment, - review: this.review, + review: await this.review, notBillable: this.notBillable, }); @@ -97,9 +97,9 @@ export default class Activity extends Model { if (moment().diff(this.date, "days") === 1) { activities.push( this.store.createRecord("activity", { - task: this.task, + task: await this.task, comment: this.comment, - user: this.user, + user: await this.user, date: moment(this.date).add(1, "days"), review: this.review, notBillable: this.notBillable, diff --git a/frontend/app/models/project.js b/frontend/app/models/project.js index 651413f2d..a5a0bb80f 100644 --- a/frontend/app/models/project.js +++ b/frontend/app/models/project.js @@ -78,7 +78,7 @@ export default class Project extends Model { * @property {BillingType} billingType * @public */ - @belongsTo("billing-type", { async: true, inverse: null }) billingType; + @belongsTo("billing-type", { async: false, inverse: null }) billingType; /** * The tasks diff --git a/frontend/app/models/report.js b/frontend/app/models/report.js index f55bc4646..1407ecbff 100644 --- a/frontend/app/models/report.js +++ b/frontend/app/models/report.js @@ -86,7 +86,7 @@ export default class Report extends Model { * @property {Task} task * @public */ - @belongsTo("task", { async: true, inverse: null }) task; + @belongsTo("task", { async: false, inverse: null }) task; /** * The user @@ -94,7 +94,7 @@ export default class Report extends Model { * @property {User} user * @public */ - @belongsTo("user", { async: true, inverse: null }) user; + @belongsTo("user", { async: false, inverse: null }) user; /** * The user which verified this report diff --git a/frontend/app/models/user.js b/frontend/app/models/user.js index 1c6976611..a7d479b9c 100644 --- a/frontend/app/models/user.js +++ b/frontend/app/models/user.js @@ -90,7 +90,7 @@ export default class User extends Model { * @property {User[]} supervisors * @public */ - @hasMany("user", { inverse: "supervisees", async: true }) supervisors; + @hasMany("user", { inverse: "supervisees", async: false }) supervisors; /** * The users supervisees @@ -98,7 +98,7 @@ export default class User extends Model { * @property {User[]} supervisees * @public */ - @hasMany("user", { inverse: "supervisors", async: true }) supervisees; + @hasMany("user", { inverse: "supervisors", async: false }) supervisees; /** * The users employments