AMBARI-20904.WFM: Include an option to clear filters in workflow dashboard(Anita Jebaraj via Venkata Sairam)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/201677be Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/201677be Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/201677be Branch: refs/heads/branch-feature-AMBARI-12556 Commit: 201677be8deec6e3d898126fbc23b2114be2fa4c Parents: 9415478 Author: Venkata Sairam <[email protected]> Authored: Tue May 23 08:42:36 2017 +0530 Committer: Venkata Sairam <[email protected]> Committed: Tue May 23 08:42:36 2017 +0530 ---------------------------------------------------------------------- .../ui/app/components/search-create-new-bar.js | 12 +++++++++++- .../app/templates/components/search-create-new-bar.hbs | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/201677be/contrib/views/wfmanager/src/main/resources/ui/app/components/search-create-new-bar.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/search-create-new-bar.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/search-create-new-bar.js index 4bfb5fa..ed761c7 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/search-create-new-bar.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/search-create-new-bar.js @@ -168,7 +168,10 @@ export default Ember.Component.extend(Ember.Evented,{ } this.sendAction('onSearch', { type: this.get('jobType'), filter: this.getAllFilters() }); }, - + doClearFilters(){ + this.filter={}; + this.sendAction('onSearch', { type: this.get('jobType'), filter: this.getAllFilters() }); + }, getAllFilters(){ var allFilters = []; Object.keys(this.filter).forEach(function(value){ @@ -204,6 +207,13 @@ export default Ember.Component.extend(Ember.Evented,{ this.$("#endDate").trigger("dp.show"); } }, + clearFilters() { + this.$("#startDate").val(''); + this.$("#endDate").val(''); + this.$('#search-field').tagsinput('removeAll'); + this.$('.tt-input').val(''); + this.doClearFilters(); + }, onClear(type) { if (type ==='start' && this.get('startDate') === "") { this.filterByDate("", type); http://git-wip-us.apache.org/repos/asf/ambari/blob/201677be/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/search-create-new-bar.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/search-create-new-bar.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/search-create-new-bar.hbs index b9c6029..8bdc768 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/search-create-new-bar.hbs +++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/search-create-new-bar.hbs @@ -38,6 +38,10 @@ <input type='text' class="form-control" value={{endDate}} id='endDate' title="Nominal End Date" placeholder="Nominal End Date" {{action 'onClear' 'end' on="change"}}/> </div> <div class="form-group"> + <span title="Clear Filters" {{action 'clearFilters'}} class="fa fa-close fa-1 pointer btn btn-default" aria-hidden="true"></span> + </div> + <div class="form-group"> <span class="fa fa-refresh fa-1 pointer btn btn-default" title="Refresh" {{action 'refresh'}} aria-hidden="true"></span> </div> </div> +
