mirror of
https://github.com/kemko/nomad.git
synced 2026-01-08 11:25:41 +03:00
Remove all references to onNamespaceChange
This commit is contained in:
@@ -11,7 +11,6 @@ export default Component.extend({
|
||||
sortDescending: null,
|
||||
|
||||
// Provide actions that require routing
|
||||
onNamespaceChange() {},
|
||||
gotoTaskGroup() {},
|
||||
gotoJob() {},
|
||||
|
||||
|
||||
@@ -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")}}
|
||||
|
||||
@@ -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")}}
|
||||
|
||||
@@ -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")}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{#gutter-menu class="page-body" onNamespaceChange=onNamespaceChange}}
|
||||
{{#gutter-menu class="page-body"}}
|
||||
{{partial "jobs/job/subnav"}}
|
||||
<section class="section">
|
||||
{{yield}}
|
||||
|
||||
@@ -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")}}
|
||||
|
||||
@@ -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")}}
|
||||
|
||||
@@ -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")}}
|
||||
|
||||
@@ -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")}}
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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}}
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
sortProperty=sortProperty
|
||||
sortDescending=sortDescending
|
||||
currentPage=currentPage
|
||||
onNamespaceChange=(action "gotoJobs")
|
||||
gotoJob=(action "gotoJob")
|
||||
gotoTaskGroup=(action "gotoTaskGroup")}}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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}}
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user