-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8237 from michaelchadwick/reports-add-show-new-fi…
…lter-form-tracking Reports > Start tracking showNewReportForm as queryParam
- Loading branch information
Showing
8 changed files
with
67 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,34 @@ | ||
import Controller from '@ember/controller'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import { restartableTask, timeout } from 'ember-concurrency'; | ||
import { action } from '@ember/object'; | ||
|
||
export default class ReportsController extends Controller { | ||
queryParams = [{ sortReportsBy: 'sortBy' }, { titleFilter: 'filter' }]; | ||
queryParams = [ | ||
{ sortReportsBy: 'sortBy' }, | ||
{ titleFilter: 'filter' }, | ||
{ showNewReportForm: 'showNewReportForm' }, | ||
]; | ||
|
||
@tracked sortReportsBy = 'title'; | ||
@tracked titleFilter = null; | ||
@tracked showNewReportForm = false; | ||
@tracked runningSubjectReport = null; | ||
|
||
changeTitleFilter = restartableTask(async (value) => { | ||
this.titleFilter = value; | ||
await timeout(250); | ||
return value; | ||
}); | ||
|
||
@action | ||
setRunningSubjectReport(report) { | ||
this.runningSubjectReport = report; | ||
} | ||
|
||
@action | ||
toggleNewReportForm() { | ||
this.runningSubjectReport = null; | ||
this.showNewReportForm = !this.showNewReportForm; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters