Commit 1364dd12 authored by Phil Hughes's avatar Phil Hughes

Merge branch '47046-use-sortable-from-npm' into 'master'

Use NPM provided version of SortableJS

Closes #47046

See merge request gitlab-org/gitlab-ce!19274
parents 50fda506 6d2fedf7
/* eslint-disable comma-dangle, space-before-function-paren, one-var */ /* eslint-disable comma-dangle, space-before-function-paren, one-var */
import $ from 'jquery'; import $ from 'jquery';
import Sortable from 'vendor/Sortable'; import Sortable from 'sortablejs';
import Vue from 'vue'; import Vue from 'vue';
import AccessorUtilities from '../../lib/utils/accessor'; import AccessorUtilities from '../../lib/utils/accessor';
import boardList from './board_list.vue'; import boardList from './board_list.vue';
......
<script> <script>
import Sortable from 'vendor/Sortable'; import Sortable from 'sortablejs';
import boardNewIssue from './board_new_issue.vue'; import boardNewIssue from './board_new_issue.vue';
import boardCard from './board_card.vue'; import boardCard from './board_card.vue';
import eventHub from '../eventhub'; import eventHub from '../eventhub';
......
/* eslint-disable comma-dangle, class-methods-use-this, no-underscore-dangle, no-param-reassign, no-unused-vars, consistent-return, func-names, space-before-function-paren, max-len */ /* eslint-disable comma-dangle, class-methods-use-this, no-underscore-dangle, no-param-reassign, no-unused-vars, consistent-return, func-names, space-before-function-paren, max-len */
import $ from 'jquery'; import $ from 'jquery';
import Sortable from 'vendor/Sortable'; import Sortable from 'sortablejs';
import flash from './flash'; import flash from './flash';
import axios from './lib/utils/axios_utils'; import axios from './lib/utils/axios_utils';
......
---
title: Use NPM provided version of SortableJS
merge_request: 19274
author:
type: performance
...@@ -35,7 +35,7 @@ describe 'Issue Boards', :js do ...@@ -35,7 +35,7 @@ describe 'Issue Boards', :js do
end end
it 'moves un-ordered issue to top of list' do it 'moves un-ordered issue to top of list' do
drag(from_index: 3, to_index: 0) drag(from_index: 3, to_index: 0, duration: 1180)
wait_for_requests wait_for_requests
...@@ -156,12 +156,13 @@ describe 'Issue Boards', :js do ...@@ -156,12 +156,13 @@ describe 'Issue Boards', :js do
end end
end end
def drag(selector: '.board-list', list_from_index: 1, from_index: 0, to_index: 0, list_to_index: 1) def drag(selector: '.board-list', list_from_index: 1, from_index: 0, to_index: 0, list_to_index: 1, duration: 1000)
drag_to(selector: selector, drag_to(selector: selector,
scrollable: '#board-app', scrollable: '#board-app',
list_from_index: list_from_index, list_from_index: list_from_index,
from_index: from_index, from_index: from_index,
to_index: to_index, to_index: to_index,
list_to_index: list_to_index) list_to_index: list_to_index,
duration: duration)
end end
end end
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import Vue from 'vue'; import Vue from 'vue';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import Sortable from 'vendor/Sortable'; import Sortable from 'sortablejs';
import BoardList from '~/boards/components/board_list.vue'; import BoardList from '~/boards/components/board_list.vue';
import eventHub from '~/boards/eventhub'; import eventHub from '~/boards/eventhub';
import '~/boards/mixins/sortable_default_options'; import '~/boards/mixins/sortable_default_options';
......
module DragTo module DragTo
def drag_to(list_from_index: 0, from_index: 0, to_index: 0, list_to_index: 0, selector: '', scrollable: 'body') def drag_to(list_from_index: 0, from_index: 0, to_index: 0, list_to_index: 0, selector: '', scrollable: 'body', duration: 1000)
evaluate_script("simulateDrag({scrollable: $('#{scrollable}').get(0), from: {el: $('#{selector}').eq(#{list_from_index}).get(0), index: #{from_index}}, to: {el: $('#{selector}').eq(#{list_to_index}).get(0), index: #{to_index}}});") evaluate_script("simulateDrag({scrollable: $('#{scrollable}').get(0), duration: #{duration}, from: {el: $('#{selector}').eq(#{list_from_index}).get(0), index: #{from_index}}, to: {el: $('#{selector}').eq(#{list_to_index}).get(0), index: #{to_index}}});")
Timeout.timeout(Capybara.default_max_wait_time) do Timeout.timeout(Capybara.default_max_wait_time) do
loop while drag_active? loop while drag_active?
......
This diff is collapsed.
...@@ -7744,6 +7744,10 @@ sort-keys@^2.0.0: ...@@ -7744,6 +7744,10 @@ sort-keys@^2.0.0:
dependencies: dependencies:
is-plain-obj "^1.0.0" is-plain-obj "^1.0.0"
sortablejs@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/sortablejs/-/sortablejs-1.7.0.tgz#80a2b2370abd568e1cec8c271131ef30a904fa28"
source-list-map@^2.0.0: source-list-map@^2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085" resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085"
......
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