Skip to content

Commit

Permalink
chore(frontend/deps): use ember-data v4.12
Browse files Browse the repository at this point in the history
  • Loading branch information
c0rydoras committed Aug 16, 2024
1 parent d2a7bf6 commit 06b998b
Show file tree
Hide file tree
Showing 7 changed files with 174 additions and 121 deletions.
7 changes: 3 additions & 4 deletions frontend/app/analysis/index/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@ export default class AnalysisController extends QPController {
this.data.perform();
}

@task
*prefetchData() {
prefetchData = task(async () => {
const {
customer: customerId,
project: projectId,
Expand All @@ -179,7 +178,7 @@ export default class AnalysisController extends QPController {
reviewer: reviewerId,
} = this.allQueryParams;

return yield hash({
return await hash({
customer: customerId && this.store.findRecord("customer", customerId),
project: projectId && this.store.findRecord("project", projectId),
task: taskId && this.store.findRecord("task", taskId),
Expand All @@ -188,7 +187,7 @@ export default class AnalysisController extends QPController {
billingTypes: this.store.findAll("billing-type"),
costCenters: this.store.findAll("cost-center"),
});
}
});

@enqueueTask
*data() {
Expand Down
6 changes: 2 additions & 4 deletions frontend/app/analysis/index/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<PagePermission>
<h1>Analysis</h1>

{{#unless this.prefetchData.isRunning}}
<TaskSelection
@history={{false}}
@archived={{true}}
Expand All @@ -22,9 +23,6 @@
@onReset={{queue t.clear this.reset}}
as |fs|
>
{{#if this.prefetchData.isRunning}}
<LoadingIcon />
{{else}}
<fs.group @label="Task" @expanded={{true}}>
<fs.label>
Customer
Expand Down Expand Up @@ -222,9 +220,9 @@
</fs.label>

</fs.group>
{{/if}}
</FilterSidebar>
</TaskSelection>
{{/unless}}

{{#if this.appliedFilters.length}}
{{#if (and (not this._dataCache.length) this.data.isRunning)}}
Expand Down
4 changes: 1 addition & 3 deletions frontend/app/index/activities/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ export default class ActivitiesIndexController extends Controller {
*/
@action
generateReportsCheck() {
const hasUnknown = !!this.activities.find(
(a) => a.task.get("id") === undefined
);
const hasUnknown = !!this.activities.find((a) => !a.task.get("id"));
const hasOverlapping = !!this.sortedActivities.find((a) => {
return a.get("active") && !a.get("from").isSame(moment(), "day");
});
Expand Down
2 changes: 2 additions & 0 deletions frontend/app/index/reports/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default class IndexReportController extends Controller {
@tracked notBillable = false;

@tracked showReschedule = false;
@tracked checkForEmptyRecord = false;
@tracked _center;

@service store;
Expand Down Expand Up @@ -96,6 +97,7 @@ export default class IndexReportController extends Controller {

@action
async createEmptyReport() {
if (!this.checkForEmptyRecord) return;
await this.store.createRecord("report", {
date: this.model,
user: this.currentUser.user,
Expand Down
1 change: 1 addition & 0 deletions frontend/app/index/reports/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@ export default class IndexReportsRoute extends Route {
this.notify.error("Could not create report");
}
}
controller.checkForEmptyRecord = true;
}
}
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"ember-component-css": "0.8.1",
"ember-composable-helpers": "5.0.0",
"ember-concurrency": "^4.0.2",
"ember-data": "~4.11.3",
"ember-data": "~4.12.8",
"ember-decorators": "6.1.1",
"ember-event-helpers": "^0.1.1",
"ember-fetch": "8.1.2",
Expand Down
273 changes: 164 additions & 109 deletions frontend/pnpm-lock.yaml

Large diffs are not rendered by default.

0 comments on commit 06b998b

Please sign in to comment.