From 6ee1ea96ef3a8724b96155425b639970e9a55d00 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Wed, 25 Jul 2018 14:02:21 -0400 Subject: [PATCH] fixes tests (#6176) --- app/assets/javascripts/admin/components/admin-report.js.es6 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/admin/components/admin-report.js.es6 b/app/assets/javascripts/admin/components/admin-report.js.es6 index 1c65ff47a9f..8567bed16d0 100644 --- a/app/assets/javascripts/admin/components/admin-report.js.es6 +++ b/app/assets/javascripts/admin/components/admin-report.js.es6 @@ -52,6 +52,8 @@ export default Ember.Component.extend({ showAllReportsLink: false, startDate: null, endDate: null, + categoryId: null, + groupId: null, showTrend: false, showHeader: true, showTitle: true, @@ -75,7 +77,7 @@ export default Ember.Component.extend({ didReceiveAttrs() { this._super(...arguments); - const state = this.get("filteringState"); + const state = this.get("filteringState") || {}; this.setProperties({ category: Category.findById(state.categoryId), groupId: state.groupId, @@ -276,7 +278,7 @@ export default Ember.Component.extend({ _renderReport(report, forcedModes, currentMode) { const modes = forcedModes ? forcedModes.split(",") : report.modes; - currentMode = currentMode || modes[0]; + currentMode = currentMode || (modes ? modes[0] : null); this.setProperties({ model: report,