Fix various master bugs from ember upgrade

We fixed a few deprecation for jquery on the cluster page but there were some
errors firing when using so I fixed the targeting.
There was also a intl error because of a missing api.
This commit is contained in:
Westly Wright 2019-10-07 12:01:00 -07:00
parent dc2eb9beea
commit 351fd47823
No known key found for this signature in database
GPG Key ID: 4FAB3D8673DC54A3
3 changed files with 19 additions and 19 deletions

View File

@ -148,11 +148,11 @@ export default Component.extend({
let intl = get(this, 'intl');
if ( get(this, 'access.provider') === 'githubconfig' ) {
out = intl.findTranslationByKey('inputIdentity.dropdownLabel.teams');
out = intl.t('inputIdentity.dropdownLabel.teams');
} else {
out = intl.findTranslationByKey('inputIdentity.dropdownLabel.groups');
out = intl.t('inputIdentity.dropdownLabel.groups');
}
return intl.formatMessage(out);
return out;
}),
});

View File

@ -41,7 +41,7 @@ export default SearchableSelect.extend({
didInsertElement() {
// Explicitly not calling super here to not show until there's content this._super(...arguments);
$('input').on('focus', () => {
$(this.element).find('input').on('focus', () => {
if (this.isDestroyed || this.isDestroying) {
return;
}
@ -56,7 +56,7 @@ export default SearchableSelect.extend({
}
});
$('input').on('blur', () => {
$(this.element).find('input').on('blur', () => {
later(() => {
if (this.isDestroyed || this.isDestroying) {
return;
@ -102,7 +102,8 @@ export default SearchableSelect.extend({
if (get(this, 'showOptions') === true) {
return;
}
const toBottom = $('body').height() - $($()[0]).offset().top - 60; // eslint-disable-line
const toBottom = $('body').height() - $(this.element).offset().top - 60; // eslint-disable-line
setProperties(this, {
maxHeight: toBottom < get(this, 'maxHeight') ? toBottom : get(this, 'maxHeight'),

View File

@ -75,10 +75,9 @@ export default Component.extend({
},
didInsertElement() {
const search = $('.input-search');
const search = $(this.element).find('.input-search');
// Stop chrome from showing autocomplete over our options
search.attr('autocomplete', Math.random());
search.attr('autocomplete', 'off');
search.on('click', () => {
this.send('show');
@ -114,7 +113,7 @@ export default Component.extend({
},
mouseEnter(event) {
$('.searchable-option').removeClass('searchable-option-active');
$(this.element).find('.searchable-option').removeClass('searchable-option-active');
const $target = $(event.target);
@ -134,14 +133,14 @@ export default Component.extend({
return;
}
const toBottom = $('body').height() - $($()[0]).offset().top - 60; // eslint-disable-line
const toBottom = $('body').height() - $(this.element).offset().top - 60; // eslint-disable-line
set(this, 'maxHeight', toBottom < MAX_HEIGHT ? toBottom : MAX_HEIGHT)
set(this, 'filter', null);
next(() => {
const checked = $('.searchable-option .icon-check');
const options = $('.searchable-options');
const checked = $(this.element).find('.searchable-option .icon-check');
const options = $(this.element).find('.searchable-options');
if ( options.length && checked.length ) {
options.animate({ scrollTop: `${ checked.parent().offset().top - options.offset().top }px` });
@ -345,7 +344,7 @@ export default Component.extend({
},
on() {
$().on('keydown.searchable-option', (event) => {
$(this.element).on('keydown.searchable-option', (event) => {
const kc = event.keyCode;
// Note: keyup event can't be prevented.
@ -372,7 +371,7 @@ export default Component.extend({
if ($activeTarget.hasClass('searchable-prompt')) {
this.send('selectPrompt');
} else {
let idx = $('.searchable-option').index($activeTarget);
let idx = $(this.element).find('.searchable-option').index($activeTarget);
idx = !!get(this, 'prompt') ? idx - 1 : idx;
@ -395,8 +394,8 @@ export default Component.extend({
},
off() {
if ($()) {
$().off('keydown.searchable-option');
if ($(this.element)) {
$(this.element).off('keydown.searchable-option');
}
},
@ -414,7 +413,7 @@ export default Component.extend({
// https://stackoverflow.com/questions/39624902/new-input-placeholder-behavior-in-safari-10-no-longer-hides-on-change-via-java
next(() => {
const input = $('.input-search');
const input = $(this.element).find('.input-search');
if ( input ) {
input.focus();
@ -431,7 +430,7 @@ export default Component.extend({
stepThroughOptions(step) {
const $activeTarget = get(this, '$activeTarget');
const $options = $('.searchable-option');
const $options = $(this.element).find('.searchable-option');
const len = $options.length;
let currentIdx = -1;