Remove all references to onNamespaceChange

This commit is contained in:
Michael Lange
2018-07-25 14:18:37 -07:00
parent 3859c3b1bb
commit d0c76b844a
16 changed files with 18 additions and 48 deletions

View File

@@ -11,7 +11,6 @@ export default Component.extend({
sortDescending: null,
// Provide actions that require routing
onNamespaceChange() {},
gotoTaskGroup() {},
gotoJob() {},

View File

@@ -1,4 +1,4 @@
{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}}
{{#job-page/parts/body job=job}}
{{job-page/parts/error errorMessage=errorMessage onDismiss=(action "clearErrorMessage")}}
{{job-page/parts/title job=job handleError=(action "handleError")}}

View File

@@ -1,4 +1,4 @@
{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}}
{{#job-page/parts/body job=job}}
{{job-page/parts/error errorMessage=errorMessage onDismiss=(action "clearErrorMessage")}}
{{job-page/parts/title job=job title=job.trimmedName handleError=(action "handleError")}}

View File

@@ -1,4 +1,4 @@
{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}}
{{#job-page/parts/body job=job}}
{{job-page/parts/error errorMessage=errorMessage onDismiss=(action "clearErrorMessage")}}
{{#job-page/parts/title job=job handleError=(action "handleError")}}

View File

@@ -1,4 +1,4 @@
{{#gutter-menu class="page-body" onNamespaceChange=onNamespaceChange}}
{{#gutter-menu class="page-body"}}
{{partial "jobs/job/subnav"}}
<section class="section">
{{yield}}

View File

@@ -1,4 +1,4 @@
{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}}
{{#job-page/parts/body job=job}}
{{job-page/parts/error errorMessage=errorMessage onDismiss=(action "clearErrorMessage")}}
{{job-page/parts/title job=job title=job.trimmedName handleError=(action "handleError")}}

View File

@@ -1,4 +1,4 @@
{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}}
{{#job-page/parts/body job=job}}
{{job-page/parts/error errorMessage=errorMessage onDismiss=(action "clearErrorMessage")}}
{{#job-page/parts/title job=job title=job.trimmedName handleError=(action "handleError")}}

View File

@@ -1,4 +1,4 @@
{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}}
{{#job-page/parts/body job=job}}
{{job-page/parts/error errorMessage=errorMessage onDismiss=(action "clearErrorMessage")}}
{{job-page/parts/title job=job handleError=(action "handleError")}}

View File

@@ -1,4 +1,4 @@
{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}}
{{#job-page/parts/body job=job}}
{{job-page/parts/error errorMessage=errorMessage onDismiss=(action "clearErrorMessage")}}
{{job-page/parts/title job=job handleError=(action "handleError")}}

View File

@@ -1,4 +1,4 @@
{{#gutter-menu class="page-body" onNamespaceChange=(action "gotoJobs")}}
{{#gutter-menu class="page-body"}}
{{partial "jobs/job/subnav"}}
<section class="section">
<div class="boxed-section">

View File

@@ -1,4 +1,4 @@
{{#gutter-menu class="page-body" onNamespaceChange=(action "gotoJobs")}}
{{#gutter-menu class="page-body"}}
{{partial "jobs/job/subnav"}}
<section class="section">
{{job-deployments-stream deployments=model.deployments}}

View File

@@ -1,4 +1,4 @@
{{#gutter-menu class="page-body" onNamespaceChange=(action "gotoJobs")}}
{{#gutter-menu class="page-body"}}
{{partial "jobs/job/subnav"}}
<section class="section">
<div class="boxed-section">

View File

@@ -3,6 +3,5 @@
sortProperty=sortProperty
sortDescending=sortDescending
currentPage=currentPage
onNamespaceChange=(action "gotoJobs")
gotoJob=(action "gotoJob")
gotoTaskGroup=(action "gotoTaskGroup")}}

View File

@@ -1,4 +1,4 @@
{{#gutter-menu class="page-body" onNamespaceChange=(action "gotoJobs")}}
{{#gutter-menu class="page-body"}}
<div class="tabs is-subnav">
<ul>
<li>{{#link-to "jobs.job.task-group" model.job model activeClass="is-active"}}Overview{{/link-to}}</li>

View File

@@ -1,4 +1,4 @@
{{#gutter-menu class="page-body" onNamespaceChange=(action "gotoJobs")}}
{{#gutter-menu class="page-body"}}
{{partial "jobs/job/subnav"}}
<section class="section">
{{job-versions-stream versions=model.versions verbose=true}}

View File

@@ -1,11 +1,9 @@
import { run } from '@ember/runloop';
import { getOwner } from '@ember/application';
import { test, moduleForComponent } from 'ember-qunit';
import { click, find, findAll } from 'ember-native-dom-helpers';
import { find, findAll } from 'ember-native-dom-helpers';
import wait from 'ember-test-helpers/wait';
import hbs from 'htmlbars-inline-precompile';
import sinon from 'sinon';
import { clickTrigger } from 'ember-power-select/test-support/helpers';
import { startMirage } from 'nomad-ui/initializers/ember-cli-mirage';
moduleForComponent('job-page/parts/body', 'Integration | Component | job-page/parts/body', {
@@ -23,10 +21,9 @@ moduleForComponent('job-page/parts/body', 'Integration | Component | job-page/pa
test('includes a subnav for the job', function(assert) {
this.set('job', {});
this.set('onNamespaceChange', () => {});
this.render(hbs`
{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}}
{{#job-page/parts/body job=job}}
<div class="inner-content">Inner content</div>
{{/job-page/parts/body}}
`);
@@ -48,10 +45,9 @@ test('the subnav includes the deployments link when the job is a service', funct
});
this.set('job', job);
this.set('onNamespaceChange', () => {});
this.render(hbs`
{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}}
{{#job-page/parts/body job=job}}
<div class="inner-content">Inner content</div>
{{/job-page/parts/body}}
`);
@@ -76,10 +72,9 @@ test('the subnav does not include the deployments link when the job is not a ser
});
this.set('job', job);
this.set('onNamespaceChange', () => {});
this.render(hbs`
{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}}
{{#job-page/parts/body job=job}}
<div class="inner-content">Inner content</div>
{{/job-page/parts/body}}
`);
@@ -94,10 +89,9 @@ test('the subnav does not include the deployments link when the job is not a ser
test('body yields content to a section after the subnav', function(assert) {
this.set('job', {});
this.set('onNamespaceChange', () => {});
this.render(hbs`
{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}}
{{#job-page/parts/body job=job}}
<div class="inner-content">Inner content</div>
{{/job-page/parts/body}}
`);
@@ -113,25 +107,3 @@ test('body yields content to a section after the subnav', function(assert) {
);
});
});
test('onNamespaceChange action is called when the namespace changes in the nested gutter menu', function(assert) {
const namespaceSpy = sinon.spy();
this.set('job', {});
this.set('onNamespaceChange', namespaceSpy);
this.render(hbs`
{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}}
<div class="inner-content">Inner content</div>
{{/job-page/parts/body}}
`);
return wait().then(() => {
clickTrigger('[data-test-namespace-switcher]');
click(findAll('.ember-power-select-option')[1]);
return wait().then(() => {
assert.ok(namespaceSpy.calledOnce, 'Switching namespaces calls the onNamespaceChange action');
});
});
});