mirror of https://github.com/status-im/consul.git
ui: Controller dead code removal (#9367)
* ui: Controller dead code removal This commit removes a little code that became 'dead' as a result of previous PRs/commits * Remove a little more from the settings Controller * Remove CSS related to being able to set the dashboard_url in settings
This commit is contained in:
parent
527ed5e196
commit
0a9f3c87d1
|
@ -1,3 +0,0 @@
|
||||||
import Controller from '@ember/controller';
|
|
||||||
|
|
||||||
export default class DcController extends Controller {}
|
|
|
@ -1,11 +0,0 @@
|
||||||
import Controller from '@ember/controller';
|
|
||||||
|
|
||||||
export default class DcServicesInstanceUpstreamsController extends Controller {
|
|
||||||
queryParams = {
|
|
||||||
sortBy: 'sort',
|
|
||||||
search: {
|
|
||||||
as: 'filter',
|
|
||||||
replace: true,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -3,14 +3,9 @@ import { alias } from '@ember/object/computed';
|
||||||
import Controller from '@ember/controller';
|
import Controller from '@ember/controller';
|
||||||
import { get, action } from '@ember/object';
|
import { get, action } from '@ember/object';
|
||||||
export default class ShowController extends Controller {
|
export default class ShowController extends Controller {
|
||||||
@service('dom')
|
@service('flashMessages') notify;
|
||||||
dom;
|
|
||||||
|
|
||||||
@service('flashMessages')
|
@alias('items.firstObject') item;
|
||||||
notify;
|
|
||||||
|
|
||||||
@alias('items.firstObject')
|
|
||||||
item;
|
|
||||||
|
|
||||||
@action
|
@action
|
||||||
error(e) {
|
error(e) {
|
||||||
|
|
|
@ -3,26 +3,8 @@ import { get, set } from '@ember/object';
|
||||||
import { inject as service } from '@ember/service';
|
import { inject as service } from '@ember/service';
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
repo: service('settings'),
|
|
||||||
dom: service('dom'),
|
dom: service('dom'),
|
||||||
timeout: service('timeout'),
|
|
||||||
confirming: false,
|
|
||||||
applyTransition: function() {
|
|
||||||
const tick = this.timeout.tick;
|
|
||||||
set(this, 'confirming', true);
|
|
||||||
tick().then(() => {
|
|
||||||
set(this, 'confirming', false);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
actions: {
|
actions: {
|
||||||
key: function(e) {
|
|
||||||
this.applyTransition();
|
|
||||||
switch (true) {
|
|
||||||
case e.keyCode === 13:
|
|
||||||
// disable ENTER
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
change: function(e, value, item) {
|
change: function(e, value, item) {
|
||||||
const event = this.dom.normalizeEvent(e, value);
|
const event = this.dom.normalizeEvent(e, value);
|
||||||
// TODO: Switch to using forms like the rest of the app
|
// TODO: Switch to using forms like the rest of the app
|
||||||
|
@ -37,13 +19,6 @@ export default Controller.extend({
|
||||||
set(this, 'item.client.blocking', !blocking);
|
set(this, 'item.client.blocking', !blocking);
|
||||||
this.send('update', 'client', this.item.client);
|
this.send('update', 'client', this.item.client);
|
||||||
break;
|
break;
|
||||||
case 'urls[service]':
|
|
||||||
if (typeof get(this, 'item.urls') === 'undefined') {
|
|
||||||
set(this, 'item.urls', {});
|
|
||||||
}
|
|
||||||
set(this, 'item.urls.service', target.value);
|
|
||||||
this.send('update', 'urls', this.item.urls);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
@import 'routes/dc/settings/index';
|
|
||||||
@import 'routes/dc/services/index';
|
@import 'routes/dc/services/index';
|
||||||
@import 'routes/dc/nodes/index';
|
@import 'routes/dc/nodes/index';
|
||||||
@import 'routes/dc/kv/index';
|
@import 'routes/dc/kv/index';
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
#urls_service span {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
#urls_service span::after {
|
|
||||||
@extend %with-check-circle-fill-color-icon, %as-pseudo;
|
|
||||||
position: absolute;
|
|
||||||
top: 3px;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
#urls_service span::after {
|
|
||||||
@extend %blink-in-fade-out;
|
|
||||||
transition-delay: 3s;
|
|
||||||
}
|
|
||||||
#urls_service.confirming span::after {
|
|
||||||
@extend %blink-in-fade-out-active;
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
import { module, test } from 'qunit';
|
|
||||||
import { setupTest } from 'ember-qunit';
|
|
||||||
|
|
||||||
module('Unit | Controller | dc', function(hooks) {
|
|
||||||
setupTest(hooks);
|
|
||||||
|
|
||||||
// Replace this with your real tests.
|
|
||||||
test('it exists', function(assert) {
|
|
||||||
let controller = this.owner.lookup('controller:dc');
|
|
||||||
assert.ok(controller);
|
|
||||||
});
|
|
||||||
});
|
|
Loading…
Reference in New Issue