From b0ff68cd7d6a579ff505d8e7eebcad1d33915974 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Thu, 14 Jun 2018 11:14:06 +0100 Subject: [PATCH] Lint --- ui-v2/app/adapters/intention.js | 4 ++-- ui-v2/app/controllers/dc/intentions/edit.js | 11 ++++++++--- ui-v2/tests/unit/routes/dc/intentions/create-test.js | 8 +++++++- ui-v2/tests/unit/routes/dc/intentions/edit-test.js | 8 +++++++- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/ui-v2/app/adapters/intention.js b/ui-v2/app/adapters/intention.js index cd0299d96b..d749efeb8b 100644 --- a/ui-v2/app/adapters/intention.js +++ b/ui-v2/app/adapters/intention.js @@ -53,9 +53,9 @@ export default Adapter.extend({ switch (true) { case this.isQueryRecord(url): case this.isUpdateRecord(url): - // TODO: We just need to upgrade this entire API to - // use a full request-like object case this.isCreateRecord(url, requestData.method): + // TODO: We just need to upgrade this (^^ sorry linter) entire API to + // use a full request-like object response = { ...response, ...{ diff --git a/ui-v2/app/controllers/dc/intentions/edit.js b/ui-v2/app/controllers/dc/intentions/edit.js index c9151e25af..a9f8307b26 100644 --- a/ui-v2/app/controllers/dc/intentions/edit.js +++ b/ui-v2/app/controllers/dc/intentions/edit.js @@ -39,6 +39,11 @@ export default Controller.extend({ change: function(e, value, _target) { // normalize back to standard event const target = e.target || { ..._target, ...{ name: e, value: value } }; + let name, + selected = target.value; + // TODO: + // linter needs this here? + let match; switch (target.name) { case 'Description': case 'Action': @@ -46,14 +51,14 @@ export default Controller.extend({ break; case 'SourceName': case 'DestinationName': - let name = target.value; - let selected = target.value; if (typeof name !== 'string') { name = get(target.value, 'Name'); } - const match = get(this, 'items').filterBy('Name', name); + // linter doesn't like const here + match = get(this, 'items').filterBy('Name', name); if (match.length === 0) { selected = { Name: name }; + // linter doesn't mind const here? const items = [selected].concat(this.items.toArray()); set(this, 'items', items); } diff --git a/ui-v2/tests/unit/routes/dc/intentions/create-test.js b/ui-v2/tests/unit/routes/dc/intentions/create-test.js index 45f688c8ec..97b24ee224 100644 --- a/ui-v2/tests/unit/routes/dc/intentions/create-test.js +++ b/ui-v2/tests/unit/routes/dc/intentions/create-test.js @@ -2,7 +2,13 @@ import { moduleFor, test } from 'ember-qunit'; moduleFor('route:dc/intentions/create', 'Unit | Route | dc/intentions/create', { // Specify the other units that are required for this test. - needs: ['service:intentions', 'service:feedback', 'service:logger', 'service:flashMessages'], + needs: [ + 'service:services', + 'service:intentions', + 'service:feedback', + 'service:logger', + 'service:flashMessages', + ], }); test('it exists', function(assert) { diff --git a/ui-v2/tests/unit/routes/dc/intentions/edit-test.js b/ui-v2/tests/unit/routes/dc/intentions/edit-test.js index 9bb112394a..50ce0ca789 100644 --- a/ui-v2/tests/unit/routes/dc/intentions/edit-test.js +++ b/ui-v2/tests/unit/routes/dc/intentions/edit-test.js @@ -2,7 +2,13 @@ import { moduleFor, test } from 'ember-qunit'; moduleFor('route:dc/intentions/edit', 'Unit | Route | dc/intentions/edit', { // Specify the other units that are required for this test. - needs: ['service:intentions', 'service:feedback', 'service:logger', 'service:flashMessages'], + needs: [ + 'service:services', + 'service:intentions', + 'service:feedback', + 'service:logger', + 'service:flashMessages', + ], }); test('it exists', function(assert) {