From 89a7a90208697da9240c52a208e8f9a912128522 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Thu, 21 Apr 2016 13:03:23 +0530 Subject: [PATCH] UX: do not show filter controls for PM admin reports --- .../admin/controllers/admin-reports.js.es6 | 5 +++++ app/assets/javascripts/admin/templates/reports.hbs | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/admin/controllers/admin-reports.js.es6 b/app/assets/javascripts/admin/controllers/admin-reports.js.es6 index 17d0c1243f0..b07e3f69cde 100644 --- a/app/assets/javascripts/admin/controllers/admin-reports.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-reports.js.es6 @@ -26,6 +26,11 @@ export default Ember.Controller.extend({ return arr.concat(this.site.groups.map((i) => {return {name: i['name'], value: i['id']};})); }, + @computed('model.type') + showFilterOptions(modelType) { + return !modelType.match(/_private_messages$/); + }, + @computed('model.type') showGroupOptions(modelType) { return modelType === "visits" || modelType === "signups" || modelType === "profile_views"; diff --git a/app/assets/javascripts/admin/templates/reports.hbs b/app/assets/javascripts/admin/templates/reports.hbs index 7f0363a2f35..a3b6797f766 100644 --- a/app/assets/javascripts/admin/templates/reports.hbs +++ b/app/assets/javascripts/admin/templates/reports.hbs @@ -1,13 +1,15 @@

{{model.title}}

- {{i18n 'admin.dashboard.reports.start_date'}} {{date-picker-past value=startDate}} - {{i18n 'admin.dashboard.reports.end_date'}} {{date-picker-past value=endDate}} - {{combo-box valueAttribute="value" content=categoryOptions value=categoryId}} - {{#if showGroupOptions}} - {{combo-box valueAttribute="value" content=groupOptions value=groupId}} + {{#if showFilterOptions}} + {{i18n 'admin.dashboard.reports.start_date'}} {{date-picker-past value=startDate}} + {{i18n 'admin.dashboard.reports.end_date'}} {{date-picker-past value=endDate}} + {{combo-box valueAttribute="value" content=categoryOptions value=categoryId}} + {{#if showGroupOptions}} + {{combo-box valueAttribute="value" content=groupOptions value=groupId}} + {{/if}} + {{d-button action="refreshReport" class="btn-primary" label="admin.dashboard.reports.refresh_report" icon="refresh"}} {{/if}} - {{d-button action="refreshReport" class="btn-primary" label="admin.dashboard.reports.refresh_report" icon="refresh"}} {{d-button action="exportCsv" label="admin.export_csv.button_text" icon="download"}}