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
This commit is contained in:
commit
1364dd12cc
10 changed files with 20 additions and 1383 deletions
|
@ -1,7 +1,7 @@
|
||||||
/* 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';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<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';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* 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';
|
||||||
|
|
5
changelogs/unreleased/47046-use-sortable-from-npm.yml
Normal file
5
changelogs/unreleased/47046-use-sortable-from-npm.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: Use NPM provided version of SortableJS
|
||||||
|
merge_request: 19274
|
||||||
|
author:
|
||||||
|
type: performance
|
|
@ -75,6 +75,7 @@
|
||||||
"sanitize-html": "^1.16.1",
|
"sanitize-html": "^1.16.1",
|
||||||
"select2": "3.5.2-browserify",
|
"select2": "3.5.2-browserify",
|
||||||
"sha1": "^1.1.1",
|
"sha1": "^1.1.1",
|
||||||
|
"sortablejs": "^1.7.0",
|
||||||
"sql.js": "^0.4.0",
|
"sql.js": "^0.4.0",
|
||||||
"stickyfilljs": "^2.0.5",
|
"stickyfilljs": "^2.0.5",
|
||||||
"style-loader": "^0.21.0",
|
"style-loader": "^0.21.0",
|
||||||
|
|
|
@ -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
|
||||||
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 @@
|
||||||
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';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
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?
|
||||||
|
|
1374
vendor/assets/javascripts/Sortable.js
vendored
1374
vendor/assets/javascripts/Sortable.js
vendored
File diff suppressed because it is too large
Load diff
|
@ -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"
|
||||||
|
|
Loading…
Reference in a new issue