Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unsupported find (fixes #493, fixes #507) #510

Merged
merged 1 commit into from
Jul 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
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';
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}
Expand All @@ -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)
Expand All @@ -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
Expand Down