diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-20 12:10:03 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-20 12:10:03 +0000 |
commit | 43b4b3e2d2ddebc0a89b94a8251c162ec5719780 (patch) | |
tree | 8a21146370cfd1b24b25cfcacef53e889746f5aa /app/assets/javascripts | |
parent | 196ada0844fff7642463fbd08a44609a1e1fa713 (diff) | |
download | gitlab-ce-43b4b3e2d2ddebc0a89b94a8251c162ec5719780.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts')
6 files changed, 35 insertions, 26 deletions
diff --git a/app/assets/javascripts/filtered_search/dropdown_operator.js b/app/assets/javascripts/filtered_search/dropdown_operator.js index d9794e326f8..0c8c8140ee9 100644 --- a/app/assets/javascripts/filtered_search/dropdown_operator.js +++ b/app/assets/javascripts/filtered_search/dropdown_operator.js @@ -24,10 +24,12 @@ export default class DropdownOperator extends FilteredSearchDropdown { if (selected.tagName === 'LI') { if (selected.hasAttribute('data-value')) { + const name = FilteredSearchVisualTokens.getLastTokenPartial(); const operator = selected.dataset.value; + FilteredSearchVisualTokens.removeLastTokenPartial(); FilteredSearchDropdownManager.addWordToInput({ - tokenName: this.filter, + tokenName: name, tokenOperator: operator, clicked: false, }); @@ -38,8 +40,6 @@ export default class DropdownOperator extends FilteredSearchDropdown { } renderContent(forceShowList = false) { - this.filter = FilteredSearchVisualTokens.getLastTokenPartial(); - const dropdownData = [ { tag: 'equal', diff --git a/app/assets/javascripts/groups/components/group_folder.vue b/app/assets/javascripts/groups/components/group_folder.vue index cf8c9bf74ec..8c7192b49a0 100644 --- a/app/assets/javascripts/groups/components/group_folder.vue +++ b/app/assets/javascripts/groups/components/group_folder.vue @@ -35,7 +35,7 @@ export default { </script> <template> - <ul class="content-list group-list-tree"> + <ul class="groups-list group-list-tree"> <group-item v-for="(group, index) in groups" :key="index" diff --git a/app/assets/javascripts/groups/constants.js b/app/assets/javascripts/groups/constants.js index e27265b7b4a..c538934a37d 100644 --- a/app/assets/javascripts/groups/constants.js +++ b/app/assets/javascripts/groups/constants.js @@ -8,7 +8,7 @@ export const ACTIVE_TAB_ARCHIVED = 'archived'; export const GROUPS_LIST_HOLDER_CLASS = '.js-groups-list-holder'; export const GROUPS_FILTER_FORM_CLASS = '.js-group-filter-form'; -export const CONTENT_LIST_CLASS = '.content-list'; +export const CONTENT_LIST_CLASS = '.groups-list'; export const COMMON_STR = { FAILURE: __('An error occurred. Please try again.'), diff --git a/app/assets/javascripts/pages/admin/broadcast_messages/broadcast_message.js b/app/assets/javascripts/pages/admin/broadcast_messages/broadcast_message.js index 34a024b1b33..f64e0bbbfda 100644 --- a/app/assets/javascripts/pages/admin/broadcast_messages/broadcast_message.js +++ b/app/assets/javascripts/pages/admin/broadcast_messages/broadcast_message.js @@ -10,9 +10,30 @@ export default () => { const $broadcastMessageType = $('.js-broadcast-message-type'); const $broadcastBannerMessagePreview = $('.js-broadcast-banner-message-preview'); const $broadcastMessage = $('.js-broadcast-message-message'); - const previewPath = $broadcastMessage.data('previewPath'); const $jsBroadcastMessagePreview = $('.js-broadcast-message-preview'); + const reloadPreview = function reloadPreview() { + const previewPath = $broadcastMessage.data('previewPath'); + const message = $broadcastMessage.val(); + const type = $broadcastMessageType.val(); + + if (message === '') { + $jsBroadcastMessagePreview.text(__('Your message here')); + } else { + axios + .post(previewPath, { + broadcast_message: { + message, + broadcast_type: type, + }, + }) + .then(({ data }) => { + $jsBroadcastMessagePreview.html(data.message); + }) + .catch(() => flash(__('An error occurred while rendering preview broadcast message'))); + } + }; + $broadcastMessageColor.on('input', function onMessageColorInput() { const previewColor = $(this).val(); $broadcastBannerMessagePreview.css('background-color', previewColor); @@ -32,26 +53,14 @@ export default () => { $broadcastMessageDismissableFormGroup.toggleClass('hidden'); $broadcastBannerMessagePreview.toggleClass('hidden'); $broadcastNotificationMessagePreview.toggleClass('hidden'); + + reloadPreview(); }); $broadcastMessage.on( 'input', - debounce(function onMessageInput() { - const message = $(this).val(); - if (message === '') { - $jsBroadcastMessagePreview.text(__('Your message here')); - } else { - axios - .post(previewPath, { - broadcast_message: { - message, - }, - }) - .then(({ data }) => { - $jsBroadcastMessagePreview.html(data.message); - }) - .catch(() => flash(__('An error occurred while rendering preview broadcast message'))); - } + debounce(() => { + reloadPreview(); }, 250), ); diff --git a/app/assets/javascripts/repository/log_tree.js b/app/assets/javascripts/repository/log_tree.js index ade92cc92e0..8cad4a14f31 100644 --- a/app/assets/javascripts/repository/log_tree.js +++ b/app/assets/javascripts/repository/log_tree.js @@ -27,9 +27,9 @@ export function fetchLogsTree(client, path, offset, resolver = null) { fetchpromise = axios .get( - `${gon.relative_url_root}/${projectPath}/-/refs/${escape(ref)}/logs_tree/${encodeURIComponent( - path.replace(/^\//, ''), - )}`, + `${gon.relative_url_root}/${projectPath}/-/refs/${encodeURIComponent( + ref, + )}/logs_tree/${encodeURIComponent(path.replace(/^\//, ''))}`, { params: { format: 'json', offset }, }, diff --git a/app/assets/javascripts/repository/router.js b/app/assets/javascripts/repository/router.js index 2386773699c..d74447dd566 100644 --- a/app/assets/javascripts/repository/router.js +++ b/app/assets/javascripts/repository/router.js @@ -12,7 +12,7 @@ export default function createRouter(base, baseRef) { base: joinPaths(gon.relative_url_root || '', base), routes: [ { - path: `(/-)?/tree/${escape(baseRef)}/:path*`, + path: `(/-)?/tree/(${encodeURIComponent(baseRef)}|${baseRef})/:path*`, name: 'treePath', component: TreePage, props: route => ({ |