Commit 960eee57 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'winh-eslint-no-jquery/no-fade' into 'master'

Disable ESLint rule no-jquery/no-fade inline

See merge request gitlab-org/gitlab!21939
parents b8921887 adeaeb49
...@@ -50,7 +50,6 @@ rules: ...@@ -50,7 +50,6 @@ rules:
# all offenses of no-jquery/no-animate-toggle are false positives ( $toast.show() ) # all offenses of no-jquery/no-animate-toggle are false positives ( $toast.show() )
no-jquery/no-animate-toggle: off no-jquery/no-animate-toggle: off
no-jquery/no-event-shorthand: off no-jquery/no-event-shorthand: off
no-jquery/no-fade: off
no-jquery/no-serialize: error no-jquery/no-serialize: error
no-jquery/no-sizzle: off no-jquery/no-sizzle: off
promise/always-return: off promise/always-return: off
......
...@@ -40,7 +40,10 @@ export default class ImageFile { ...@@ -40,7 +40,10 @@ export default class ImageFile {
.removeClass('active') .removeClass('active')
.filter(`.${viewMode}`) .filter(`.${viewMode}`)
.addClass('active'); .addClass('active');
// eslint-disable-next-line no-jquery/no-fade
return $(`.view:visible:not(.${viewMode})`, this.file).fadeOut(200, () => { return $(`.view:visible:not(.${viewMode})`, this.file).fadeOut(200, () => {
// eslint-disable-next-line no-jquery/no-fade
$(`.view.${viewMode}`, this.file).fadeIn(200); $(`.view.${viewMode}`, this.file).fadeIn(200);
return this.initView(viewMode); return this.initView(viewMode);
}); });
......
...@@ -116,11 +116,13 @@ class DueDateSelect { ...@@ -116,11 +116,13 @@ class DueDateSelect {
} }
updateIssueBoardIssue() { updateIssueBoardIssue() {
// eslint-disable-next-line no-jquery/no-fade
this.$loading.fadeIn(); this.$loading.fadeIn();
this.$dropdown.trigger('loading.gl.dropdown'); this.$dropdown.trigger('loading.gl.dropdown');
this.$selectbox.hide(); this.$selectbox.hide();
this.$value.css('display', ''); this.$value.css('display', '');
const fadeOutLoader = () => { const fadeOutLoader = () => {
// eslint-disable-next-line no-jquery/no-fade
this.$loading.fadeOut(); this.$loading.fadeOut();
}; };
...@@ -135,6 +137,7 @@ class DueDateSelect { ...@@ -135,6 +137,7 @@ class DueDateSelect {
const hasDueDate = this.displayedDate !== __('None'); const hasDueDate = this.displayedDate !== __('None');
const displayedDateStyle = hasDueDate ? 'bold' : 'no-value'; const displayedDateStyle = hasDueDate ? 'bold' : 'no-value';
// eslint-disable-next-line no-jquery/no-fade
this.$loading.removeClass('hidden').fadeIn(); this.$loading.removeClass('hidden').fadeIn();
if (isDropdown) { if (isDropdown) {
...@@ -158,6 +161,7 @@ class DueDateSelect { ...@@ -158,6 +161,7 @@ class DueDateSelect {
} }
this.$sidebarCollapsedValue.attr('data-original-title', tooltipText); this.$sidebarCollapsedValue.attr('data-original-title', tooltipText);
// eslint-disable-next-line no-jquery/no-fade
return this.$loading.fadeOut(); return this.$loading.fadeOut();
}); });
} }
......
...@@ -64,6 +64,7 @@ export default class FilterableList { ...@@ -64,6 +64,7 @@ export default class FilterableList {
return false; return false;
} }
// eslint-disable-next-line no-jquery/no-fade
$(this.listHolderElement).fadeTo(250, 0.5); $(this.listHolderElement).fadeTo(250, 0.5);
this.isBusy = true; this.isBusy = true;
...@@ -98,6 +99,7 @@ export default class FilterableList { ...@@ -98,6 +99,7 @@ export default class FilterableList {
onFilterComplete() { onFilterComplete() {
this.isBusy = false; this.isBusy = false;
// eslint-disable-next-line no-jquery/no-fade
$(this.listHolderElement).fadeTo(250, 1); $(this.listHolderElement).fadeTo(250, 1);
} }
} }
...@@ -45,6 +45,7 @@ export default class LabelsSelect { ...@@ -45,6 +45,7 @@ export default class LabelsSelect {
const $sidebarLabelTooltip = $block.find('.js-sidebar-labels-tooltip'); const $sidebarLabelTooltip = $block.find('.js-sidebar-labels-tooltip');
const $value = $block.find('.value'); const $value = $block.find('.value');
const $dropdownMenu = $dropdown.parent().find('.dropdown-menu'); const $dropdownMenu = $dropdown.parent().find('.dropdown-menu');
// eslint-disable-next-line no-jquery/no-fade
const $loading = $block.find('.block-loading').fadeOut(); const $loading = $block.find('.block-loading').fadeOut();
const fieldName = $dropdown.data('fieldName'); const fieldName = $dropdown.data('fieldName');
let initialSelected = $selectbox let initialSelected = $selectbox
...@@ -84,6 +85,7 @@ export default class LabelsSelect { ...@@ -84,6 +85,7 @@ export default class LabelsSelect {
if (!selected.length) { if (!selected.length) {
data[abilityName].label_ids = ['']; data[abilityName].label_ids = [''];
} }
// eslint-disable-next-line no-jquery/no-fade
$loading.removeClass('hidden').fadeIn(); $loading.removeClass('hidden').fadeIn();
$dropdown.trigger('loading.gl.dropdown'); $dropdown.trigger('loading.gl.dropdown');
axios axios
...@@ -91,6 +93,7 @@ export default class LabelsSelect { ...@@ -91,6 +93,7 @@ export default class LabelsSelect {
.then(({ data }) => { .then(({ data }) => {
let labelTooltipTitle; let labelTooltipTitle;
let template; let template;
// eslint-disable-next-line no-jquery/no-fade
$loading.fadeOut(); $loading.fadeOut();
$dropdown.trigger('loaded.gl.dropdown'); $dropdown.trigger('loaded.gl.dropdown');
$selectbox.hide(); $selectbox.hide();
...@@ -361,6 +364,7 @@ export default class LabelsSelect { ...@@ -361,6 +364,7 @@ export default class LabelsSelect {
const label = clickEvent.selectedObj; const label = clickEvent.selectedObj;
const fadeOutLoader = () => { const fadeOutLoader = () => {
// eslint-disable-next-line no-jquery/no-fade
$loading.fadeOut(); $loading.fadeOut();
}; };
...@@ -422,6 +426,7 @@ export default class LabelsSelect { ...@@ -422,6 +426,7 @@ export default class LabelsSelect {
boardsStore.detail.issue.labels = labels; boardsStore.detail.issue.labels = labels;
} }
// eslint-disable-next-line no-jquery/no-fade
$loading.fadeIn(); $loading.fadeIn();
const oldLabels = boardsStore.detail.issue.labels; const oldLabels = boardsStore.detail.issue.labels;
......
...@@ -113,6 +113,7 @@ function deferredInitialisation() { ...@@ -113,6 +113,7 @@ function deferredInitialisation() {
}); });
$('.js-remove-tr').on('ajax:success', function removeTRAjaxSuccessCallback() { $('.js-remove-tr').on('ajax:success', function removeTRAjaxSuccessCallback() {
// eslint-disable-next-line no-jquery/no-fade
$(this) $(this)
.closest('tr') .closest('tr')
.fadeOut(); .fadeOut();
......
...@@ -52,6 +52,7 @@ export default class MilestoneSelect { ...@@ -52,6 +52,7 @@ export default class MilestoneSelect {
const $block = $selectBox.closest('.block'); const $block = $selectBox.closest('.block');
const $sidebarCollapsedValue = $block.find('.sidebar-collapsed-icon'); const $sidebarCollapsedValue = $block.find('.sidebar-collapsed-icon');
const $value = $block.find('.value'); const $value = $block.find('.value');
// eslint-disable-next-line no-jquery/no-fade
const $loading = $block.find('.block-loading').fadeOut(); const $loading = $block.find('.block-loading').fadeOut();
selectedMilestoneDefault = showAny ? '' : null; selectedMilestoneDefault = showAny ? '' : null;
selectedMilestoneDefault = selectedMilestoneDefault =
...@@ -202,15 +203,18 @@ export default class MilestoneSelect { ...@@ -202,15 +203,18 @@ export default class MilestoneSelect {
} }
$dropdown.trigger('loading.gl.dropdown'); $dropdown.trigger('loading.gl.dropdown');
// eslint-disable-next-line no-jquery/no-fade
$loading.removeClass('hidden').fadeIn(); $loading.removeClass('hidden').fadeIn();
boardsStore.detail.issue boardsStore.detail.issue
.update($dropdown.attr('data-issue-update')) .update($dropdown.attr('data-issue-update'))
.then(() => { .then(() => {
$dropdown.trigger('loaded.gl.dropdown'); $dropdown.trigger('loaded.gl.dropdown');
// eslint-disable-next-line no-jquery/no-fade
$loading.fadeOut(); $loading.fadeOut();
}) })
.catch(() => { .catch(() => {
// eslint-disable-next-line no-jquery/no-fade
$loading.fadeOut(); $loading.fadeOut();
}); });
} else { } else {
...@@ -218,12 +222,14 @@ export default class MilestoneSelect { ...@@ -218,12 +222,14 @@ export default class MilestoneSelect {
data = {}; data = {};
data[abilityName] = {}; data[abilityName] = {};
data[abilityName].milestone_id = selected != null ? selected : null; data[abilityName].milestone_id = selected != null ? selected : null;
// eslint-disable-next-line no-jquery/no-fade
$loading.removeClass('hidden').fadeIn(); $loading.removeClass('hidden').fadeIn();
$dropdown.trigger('loading.gl.dropdown'); $dropdown.trigger('loading.gl.dropdown');
return axios return axios
.put(issueUpdateURL, data) .put(issueUpdateURL, data)
.then(({ data }) => { .then(({ data }) => {
$dropdown.trigger('loaded.gl.dropdown'); $dropdown.trigger('loaded.gl.dropdown');
// eslint-disable-next-line no-jquery/no-fade
$loading.fadeOut(); $loading.fadeOut();
$selectBox.hide(); $selectBox.hide();
$value.css('display', ''); $value.css('display', '');
...@@ -247,6 +253,7 @@ export default class MilestoneSelect { ...@@ -247,6 +253,7 @@ export default class MilestoneSelect {
} }
}) })
.catch(() => { .catch(() => {
// eslint-disable-next-line no-jquery/no-fade
$loading.fadeOut(); $loading.fadeOut();
}); });
} }
......
...@@ -53,6 +53,7 @@ function UsersSelect(currentUser, els, options = {}) { ...@@ -53,6 +53,7 @@ function UsersSelect(currentUser, els, options = {}) {
const abilityName = $dropdown.data('abilityName'); const abilityName = $dropdown.data('abilityName');
let $value = $block.find('.value'); let $value = $block.find('.value');
const $collapsedSidebar = $block.find('.sidebar-collapsed-user'); const $collapsedSidebar = $block.find('.sidebar-collapsed-user');
// eslint-disable-next-line no-jquery/no-fade
const $loading = $block.find('.block-loading').fadeOut(); const $loading = $block.find('.block-loading').fadeOut();
const selectedIdDefault = defaultNullUser && showNullUser ? 0 : null; const selectedIdDefault = defaultNullUser && showNullUser ? 0 : null;
let selectedId = $dropdown.data('selected'); let selectedId = $dropdown.data('selected');
...@@ -188,6 +189,7 @@ function UsersSelect(currentUser, els, options = {}) { ...@@ -188,6 +189,7 @@ function UsersSelect(currentUser, els, options = {}) {
const data = {}; const data = {};
data[abilityName] = {}; data[abilityName] = {};
data[abilityName].assignee_id = selected != null ? selected : null; data[abilityName].assignee_id = selected != null ? selected : null;
// eslint-disable-next-line no-jquery/no-fade
$loading.removeClass('hidden').fadeIn(); $loading.removeClass('hidden').fadeIn();
$dropdown.trigger('loading.gl.dropdown'); $dropdown.trigger('loading.gl.dropdown');
...@@ -195,6 +197,7 @@ function UsersSelect(currentUser, els, options = {}) { ...@@ -195,6 +197,7 @@ function UsersSelect(currentUser, els, options = {}) {
let user = {}; let user = {};
let tooltipTitle = user.name; let tooltipTitle = user.name;
$dropdown.trigger('loaded.gl.dropdown'); $dropdown.trigger('loaded.gl.dropdown');
// eslint-disable-next-line no-jquery/no-fade
$loading.fadeOut(); $loading.fadeOut();
if (data.assignee) { if (data.assignee) {
user = { user = {
......
...@@ -11,6 +11,7 @@ function WeightSelect(els, options = {}) { ...@@ -11,6 +11,7 @@ function WeightSelect(els, options = {}) {
const $selectbox = $dropdown.closest('.selectbox'); const $selectbox = $dropdown.closest('.selectbox');
const $block = $selectbox.closest('.block'); const $block = $selectbox.closest('.block');
const $value = $block.find('.value'); const $value = $block.find('.value');
// eslint-disable-next-line no-jquery/no-fade
$block.find('.block-loading').fadeOut(); $block.find('.block-loading').fadeOut();
const fieldName = options.fieldName || $dropdown.data('fieldName'); const fieldName = options.fieldName || $dropdown.data('fieldName');
const inputField = $dropdown.closest('.selectbox').find(`input[name='${fieldName}']`); const inputField = $dropdown.closest('.selectbox').find(`input[name='${fieldName}']`);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment