From df9373b333b2a3debc28b255ee806ffe61ac2b03 Mon Sep 17 00:00:00 2001 From: Dmitry Baev Date: Thu, 27 Jul 2017 19:22:31 +0300 Subject: [PATCH] remove unsupported find --- .../javascript/components/testresult/TestResultView.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/allure-generator/src/main/javascript/components/testresult/TestResultView.js b/allure-generator/src/main/javascript/components/testresult/TestResultView.js index d0c553b4d..241263516 100644 --- a/allure-generator/src/main/javascript/components/testresult/TestResultView.js +++ b/allure-generator/src/main/javascript/components/testresult/TestResultView.js @@ -1,6 +1,6 @@ import './styles.scss'; import {View} from 'backbone.marionette'; -import {regions, behavior, className, on} from '../../decorators'; +import {behavior, className, on, regions} from '../../decorators'; import template from './TestResultView.hbs'; import TestResultOverviewView from '../testresult-overview/TestResultOverviewView'; import ErrorSplashView from '../error-splash/ErrorSplashView'; @@ -8,6 +8,7 @@ import pluginsRegistry from '../../util/pluginsRegistry'; import ModalView from '../modal/ModalView'; import AttachmentView from '../attachment/AttachmentView'; import translate from '../../helpers/t'; +import {findWhere} from 'underscore'; const subViews = [ {id: '', name: 'testResult.overview.name', View: TestResultOverviewView} @@ -25,13 +26,13 @@ class TestResultView extends View { initialize({routeState}) { this.routeState = routeState; this.tabs = subViews.concat(pluginsRegistry.testResultTabs); - this.tabName = this.routeState.get('testResultTab') || ''; + this.tabName = this.routeState.get('testResultTab') || ''; this.listenTo(this.routeState, 'change:testResultTab', (_, tabName) => this.onTabChange(tabName)); this.listenTo(this.routeState, 'change:attachment', (_, uid) => this.onShowAttachment(uid)); } onRender() { - const subView = this.tabs.find(view => view.id === this.tabName); + const subView = findWhere(this.tabs, {id: this.tabName}); this.showChildView('content', !subView ? new ErrorSplashView({code: 404, message: `Tab "${this.tabName}" not found`}) : new subView.View(this.options) @@ -53,7 +54,7 @@ class TestResultView extends View { this.modalView.destroy(); } - if(uid) { + if (uid) { const attachment = this.model.getAttachment(uid); this.modalView = new ModalView({ childView: attachment