diff options
| author | Filipa Lacerda <filipa@gitlab.com> | 2017-10-24 16:20:18 +0300 |
|---|---|---|
| committer | Filipa Lacerda <filipa@gitlab.com> | 2017-10-24 16:20:18 +0300 |
| commit | 2fb0697e806a19dc39f8ad3192e64603fc72c412 (patch) | |
| tree | 14af769d5542c19e0b7ef692fa5992a8bf167528 /app/assets/javascripts/groups_select.js | |
| parent | b51c12a4c1524eeb019fbb2960dd566637e16872 (diff) | |
| download | gitlab-ce-38869-groups-select.tar.gz | |
Fix broken rspec tests38869-groups-select
Diffstat (limited to 'app/assets/javascripts/groups_select.js')
| -rw-r--r-- | app/assets/javascripts/groups_select.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/assets/javascripts/groups_select.js b/app/assets/javascripts/groups_select.js index f7f40b557f3..a69a0bde17b 100644 --- a/app/assets/javascripts/groups_select.js +++ b/app/assets/javascripts/groups_select.js @@ -2,7 +2,8 @@ import Api from './api'; import { normalizeCRLFHeaders } from './lib/utils/common_utils'; export default function groupsSelect() { - const PER_PAGE = 20; + // Needs to be accessible in rspec + window.GROUP_SELECT_PER_PAGE = 20; $('.ajax-groups-select').each(function setAjaxGroupsSelect2() { const $select = $(this); const allAvailable = $select.data('all-available'); @@ -16,8 +17,7 @@ export default function groupsSelect() { dataType: 'json', quietMillis: 250, transport(params) { - // eslint-disable-next-line promise/catch-or-return - $.ajax(params) + return $.ajax(params) .then((data, status, xhr) => { const results = data || []; @@ -40,7 +40,7 @@ export default function groupsSelect() { return { search, page, - per_page: PER_PAGE, + per_page: window.GROUP_SELECT_PER_PAGE, all_available: allAvailable, }; }, |
