From 6ffa836a641946ad4c4da44ae41f7886fe4bd8dc Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Tue, 26 May 2020 14:05:45 -0700 Subject: [PATCH 1/6] Remove jquery from line-chart --- ui/app/components/line-chart.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/app/components/line-chart.js b/ui/app/components/line-chart.js index 138d8d60d..a5c1d9258 100644 --- a/ui/app/components/line-chart.js +++ b/ui/app/components/line-chart.js @@ -322,9 +322,9 @@ export default Component.extend(WindowResizable, { }, updateDimensions() { - const $svg = this.$('svg'); - const width = $svg.width(); - const height = $svg.height(); + const $svg = this.element.querySelector('svg'); + const width = $svg.clientWidth; + const height = $svg.clientHeight; this.setProperties({ width, height }); this.renderChart(); From 718114cb98072786469ddb115c9ec44d47d37fb4 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Tue, 26 May 2020 14:11:08 -0700 Subject: [PATCH 2/6] Remove jquery from the distribution bar chart --- ui/app/components/distribution-bar.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/app/components/distribution-bar.js b/ui/app/components/distribution-bar.js index adc7d972c..ee672b4ac 100644 --- a/ui/app/components/distribution-bar.js +++ b/ui/app/components/distribution-bar.js @@ -43,11 +43,12 @@ export default Component.extend(WindowResizable, { }), didInsertElement() { - const chart = d3.select(this.$('svg')[0]); + const svg = this.element.querySelector('svg'); + const chart = d3.select(svg); const maskId = `dist-mask-${guidFor(this)}`; this.setProperties({ chart, maskId }); - this.$('svg clipPath').attr('id', maskId); + svg.querySelector('clipPath').setAttribute('id', maskId); chart.on('mouseleave', () => { run(() => { @@ -75,7 +76,7 @@ export default Component.extend(WindowResizable, { /* eslint-disable */ renderChart() { const { chart, _data, isNarrow } = this; - const width = this.$('svg').width(); + const width = this.element.querySelector('svg').clientWidth; const filteredData = _data.filter(d => d.value > 0); filteredData.forEach((d, index) => { set(d, 'index', index); From 756069c9a2c2fdf30250fc05fdd718e100030714 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Tue, 26 May 2020 14:13:29 -0700 Subject: [PATCH 3/6] Remove jquery from gauge chart --- ui/app/components/gauge-chart.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ui/app/components/gauge-chart.js b/ui/app/components/gauge-chart.js index 2f30a2f3d..3df1f5e4d 100644 --- a/ui/app/components/gauge-chart.js +++ b/ui/app/components/gauge-chart.js @@ -74,9 +74,7 @@ export default Component.extend(WindowResizable, { }, updateDimensions() { - const $svg = this.$('svg'); - const width = $svg.width(); - + const width = this.element.querySelector('svg').clientWidth; this.setProperties({ width, height: width / 2 }); }, From 4bb24ac8f00059202cc55156bf9086173b3ba301 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Tue, 26 May 2020 14:31:15 -0700 Subject: [PATCH 4/6] Remove jquery from the lazy-click helper --- ui/app/helpers/lazy-click.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/app/helpers/lazy-click.js b/ui/app/helpers/lazy-click.js index de96d1c0e..e5927aa3a 100644 --- a/ui/app/helpers/lazy-click.js +++ b/ui/app/helpers/lazy-click.js @@ -1,5 +1,4 @@ import Helper from '@ember/component/helper'; -import $ from 'jquery'; /** * Lazy Click Event @@ -10,7 +9,7 @@ import $ from 'jquery'; * that should be handled instead. */ export function lazyClick([onClick, event]) { - if (!$(event.target).is('a')) { + if (event.target.tagName.toLowerCase() !== 'a') { onClick(event); } } From 07ce413ce8dbb1476de5d34c2d1b8816d6aaf88c Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Tue, 26 May 2020 14:35:57 -0700 Subject: [PATCH 5/6] Remove jquery from the window resize helper --- ui/app/mixins/window-resizable.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ui/app/mixins/window-resizable.js b/ui/app/mixins/window-resizable.js index 808143538..a2daf1f85 100644 --- a/ui/app/mixins/window-resizable.js +++ b/ui/app/mixins/window-resizable.js @@ -2,7 +2,6 @@ import Mixin from '@ember/object/mixin'; import { run } from '@ember/runloop'; import { assert } from '@ember/debug'; import { on } from '@ember/object/evented'; -import $ from 'jquery'; export default Mixin.create({ windowResizeHandler() { @@ -12,11 +11,11 @@ export default Mixin.create({ setupWindowResize: on('didInsertElement', function() { run.scheduleOnce('afterRender', this, () => { this.set('_windowResizeHandler', this.windowResizeHandler.bind(this)); - $(window).on('resize', this._windowResizeHandler); + window.addEventListener('resize', this._windowResizeHandler); }); }), removeWindowResize: on('willDestroyElement', function() { - $(window).off('resize', this._windowResizeHandler); + window.removeEventListener('resize', this._windowResizeHandler); }), }); From 97e26b82e47272d23d46ea2ae2f18ec53711b0aa Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Tue, 26 May 2020 14:54:59 -0700 Subject: [PATCH 6/6] Remove test code --- ui/app/initializers/app-env.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/ui/app/initializers/app-env.js b/ui/app/initializers/app-env.js index c5fa7542b..0d5284f2d 100644 --- a/ui/app/initializers/app-env.js +++ b/ui/app/initializers/app-env.js @@ -4,15 +4,6 @@ export function initialize() { // Provides the app config to all templates application.inject('controller', 'config', 'service:config'); application.inject('component', 'config', 'service:config'); - - const jQuery = window.jQuery; - - jQuery.__ajax = jQuery.ajax; - jQuery.ajax = function() { - // eslint-disable-next-line - console.log('jQuery.ajax called:', ...arguments); - return jQuery.__ajax(...arguments); - }; } export default {