diff options
Diffstat (limited to 'app/assets/javascripts/pages/admin')
4 files changed, 3 insertions, 75 deletions
diff --git a/app/assets/javascripts/pages/admin/application_settings/index.js b/app/assets/javascripts/pages/admin/application_settings/index.js index a6e3a7dc08a..f1e92cf195a 100644 --- a/app/assets/javascripts/pages/admin/application_settings/index.js +++ b/app/assets/javascripts/pages/admin/application_settings/index.js @@ -1,4 +1,4 @@ -import initVariableList from '~/ci_variable_list'; +import initVariableList from '~/ci/ci_variable_list'; import projectSelect from '~/project_select'; import initSearchSettings from '~/search_settings'; import selfMonitor from '~/self_monitor'; diff --git a/app/assets/javascripts/pages/admin/broadcast_messages/broadcast_message.js b/app/assets/javascripts/pages/admin/broadcast_messages/broadcast_message.js deleted file mode 100644 index 40348e0b18a..00000000000 --- a/app/assets/javascripts/pages/admin/broadcast_messages/broadcast_message.js +++ /dev/null @@ -1,60 +0,0 @@ -import $ from 'jquery'; -import { debounce } from 'lodash'; -import { createAlert } from '~/flash'; -import axios from '~/lib/utils/axios_utils'; -import { DEFAULT_DEBOUNCE_AND_THROTTLE_MS } from '~/lib/utils/constants'; -import { __ } from '~/locale'; - -export default () => { - const $broadcastMessageTheme = $('.js-broadcast-message-theme'); - const $broadcastMessageType = $('.js-broadcast-message-type'); - const $broadcastBannerMessagePreview = $('.js-broadcast-banner-message-preview [role="alert"]'); - const $broadcastMessage = $('.js-broadcast-message-message'); - const $jsBroadcastMessagePreview = $('#broadcast-message-preview'); - - const reloadPreview = function reloadPreview() { - const previewPath = $broadcastMessage.data('previewPath'); - const message = $broadcastMessage.val(); - const type = $broadcastMessageType.val(); - const theme = $broadcastMessageTheme.val(); - - axios - .post(previewPath, { - broadcast_message: { - message, - broadcast_type: type, - theme, - }, - }) - .then(({ data }) => { - $jsBroadcastMessagePreview.html(data); - }) - .catch(() => - createAlert({ - message: __('An error occurred while rendering preview broadcast message'), - }), - ); - }; - - $broadcastMessageTheme.on('change', reloadPreview); - - $broadcastMessageType.on('change', () => { - const $broadcastMessageColorFormGroup = $('.js-broadcast-message-background-color-form-group'); - const $broadcastMessageDismissableFormGroup = $('.js-broadcast-message-dismissable-form-group'); - const $broadcastNotificationMessagePreview = $('.js-broadcast-notification-message-preview'); - - $broadcastMessageColorFormGroup.toggleClass('hidden'); - $broadcastMessageDismissableFormGroup.toggleClass('hidden'); - $broadcastBannerMessagePreview.toggleClass('hidden'); - $broadcastNotificationMessagePreview.toggleClass('hidden'); - - reloadPreview(); - }); - - $broadcastMessage.on( - 'input', - debounce(() => { - reloadPreview(); - }, DEFAULT_DEBOUNCE_AND_THROTTLE_MS), - ); -}; diff --git a/app/assets/javascripts/pages/admin/broadcast_messages/edit/index.js b/app/assets/javascripts/pages/admin/broadcast_messages/edit/index.js index 25036984082..94cae500a1e 100644 --- a/app/assets/javascripts/pages/admin/broadcast_messages/edit/index.js +++ b/app/assets/javascripts/pages/admin/broadcast_messages/edit/index.js @@ -1,8 +1,3 @@ import initEditBroadcastMessage from '~/admin/broadcast_messages/edit'; -import initBroadcastMessagesForm from '../broadcast_message'; -if (gon.features.vueBroadcastMessages) { - initEditBroadcastMessage(); -} else { - initBroadcastMessagesForm(); -} +initEditBroadcastMessage(); diff --git a/app/assets/javascripts/pages/admin/broadcast_messages/index/index.js b/app/assets/javascripts/pages/admin/broadcast_messages/index/index.js index 1f37df2b340..2662496be05 100644 --- a/app/assets/javascripts/pages/admin/broadcast_messages/index/index.js +++ b/app/assets/javascripts/pages/admin/broadcast_messages/index/index.js @@ -1,10 +1,3 @@ import initBroadcastMessages from '~/admin/broadcast_messages'; -import initDeprecatedRemoveRowBehavior from '~/behaviors/deprecated_remove_row_behavior'; -import initBroadcastMessagesForm from '../broadcast_message'; -if (gon.features.vueBroadcastMessages) { - initBroadcastMessages(); -} else { - initBroadcastMessagesForm(); - initDeprecatedRemoveRowBehavior(); -} +initBroadcastMessages(); |