Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
fix(TaskSelection): reset component filter when updating the page con…
Browse files Browse the repository at this point in the history
…troller properties
  • Loading branch information
MitanOmar committed Feb 29, 2024
1 parent 1aeede4 commit b6d3974
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
8 changes: 8 additions & 0 deletions app/analysis/index/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ export default class AnalysisController extends QPController {
return this.totalItems > this.exportLimit;
}

get getFromDate() {
return this.fromDate || null;
}

get getToDate() {
return this.toDate || null;
}

get exportLimitMessage() {
return `The export limit is ${this.exportLimit}. Please use filters to reduce the amount of reports.`;
}
Expand Down
4 changes: 2 additions & 2 deletions app/analysis/index/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<fs.filter
data-test-filter-from-date
@type="date"
@selected={{moment this.fromDate}}
@selected={{moment this.getFromDate}}
@onChange={{fn this.updateParam "fromDate"}}
/>
</fs.label>
Expand All @@ -115,7 +115,7 @@
<fs.filter
data-test-filter-to-date
@type="date"
@selected={{moment this.toDate}}
@selected={{moment this.getToDate}}
@onChange={{fn this.updateParam "toDate"}}
/>
</fs.label>
Expand Down
10 changes: 5 additions & 5 deletions app/components/task-selection/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
(ensure-safe-component "optimized-power-select")
options=this.customersAndRecentTasks
disabled=@disabled
selected=this.customer
selected=@initial.customer
placeholder="Select customer..."
searchField="longName"
allowClear=true
Expand All @@ -19,8 +19,8 @@
project=(component
(ensure-safe-component "optimized-power-select")
options=this.projects
disabled=(or @disabled (not this.customer))
selected=this.project
disabled=(or @disabled (not @initial.customer))
selected=@initial.project
placeholder="Select project..."
searchField="name"
allowClear=true
Expand All @@ -35,8 +35,8 @@
task=(component
(ensure-safe-component "optimized-power-select")
options=this.tasks
disabled=(or @disabled (not this.project))
selected=this.task
disabled=(or @disabled (not @initial.project))
selected=@initial.task
placeholder="Select task..."
searchField="name"
allowClear=true
Expand Down

0 comments on commit b6d3974

Please sign in to comment.