diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-07 00:09:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-07 00:09:08 +0300 |
commit | f2143c9986ad7b6206b8a41cc9aeb419e543d3f5 (patch) | |
tree | 215aecfdd982c53e2b8565cb5b2299d7dd4665b0 /app/assets/javascripts/ide | |
parent | 5a73318262aab6ab952f2b7205b3674ea1f20053 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/ide')
-rw-r--r-- | app/assets/javascripts/ide/components/panes/right.vue | 17 | ||||
-rw-r--r-- | app/assets/javascripts/ide/components/switch_editors/switch_editors_view.vue | 103 | ||||
-rw-r--r-- | app/assets/javascripts/ide/constants.js | 1 | ||||
-rw-r--r-- | app/assets/javascripts/ide/index.js | 1 | ||||
-rw-r--r-- | app/assets/javascripts/ide/stores/state.js | 1 |
5 files changed, 2 insertions, 121 deletions
diff --git a/app/assets/javascripts/ide/components/panes/right.vue b/app/assets/javascripts/ide/components/panes/right.vue index c74a5052573..da2d4fbe7f0 100644 --- a/app/assets/javascripts/ide/components/panes/right.vue +++ b/app/assets/javascripts/ide/components/panes/right.vue @@ -7,7 +7,6 @@ import PipelinesList from '../pipelines/list.vue'; import Clientside from '../preview/clientside.vue'; import ResizablePanel from '../resizable_panel.vue'; import TerminalView from '../terminal/view.vue'; -import SwitchEditorsView from '../switch_editors/switch_editors_view.vue'; import CollapsibleSidebar from './collapsible_sidebar.vue'; // Need to add the width of the nav buttons since the resizable container contains those as well @@ -21,7 +20,7 @@ export default { }, computed: { ...mapState('terminal', { isTerminalVisible: 'isVisible' }), - ...mapState(['currentMergeRequestId', 'clientsidePreviewEnabled', 'canUseNewWebIde']), + ...mapState(['currentMergeRequestId', 'clientsidePreviewEnabled']), ...mapGetters(['packageJson']), ...mapState('rightPane', ['isOpen']), showLivePreview() { @@ -30,12 +29,6 @@ export default { rightExtensionTabs() { return [ { - show: this.canUseNewWebIde, - title: __('Switch editors'), - views: [{ component: SwitchEditorsView, ...rightSidebarViews.switchEditors }], - icon: 'bullhorn', - }, - { show: true, title: __('Pipelines'), views: [ @@ -60,7 +53,6 @@ export default { }, }, WIDTH, - SWITCH_EDITORS_VIEW_NAME: rightSidebarViews.switchEditors.name, }; </script> @@ -72,11 +64,6 @@ export default { :min-size="$options.WIDTH" :resizable="isOpen" > - <collapsible-sidebar - class="gl-w-full" - :extension-tabs="rightExtensionTabs" - :init-open-view="$options.SWITCH_EDITORS_VIEW_NAME" - side="right" - /> + <collapsible-sidebar class="gl-w-full" :extension-tabs="rightExtensionTabs" side="right" /> </resizable-panel> </template> diff --git a/app/assets/javascripts/ide/components/switch_editors/switch_editors_view.vue b/app/assets/javascripts/ide/components/switch_editors/switch_editors_view.vue deleted file mode 100644 index 00164f65e33..00000000000 --- a/app/assets/javascripts/ide/components/switch_editors/switch_editors_view.vue +++ /dev/null @@ -1,103 +0,0 @@ -<script> -import { GlButton, GlEmptyState, GlLink } from '@gitlab/ui'; -import { mapState } from 'vuex'; -import { createAlert } from '~/flash'; -import { logError } from '~/lib/logger'; -import axios from '~/lib/utils/axios_utils'; -import { confirmAction } from '~/lib/utils/confirm_via_gl_modal/confirm_via_gl_modal'; -import { ignoreWhilePending } from '~/lib/utils/ignore_while_pending'; -import { s__, __ } from '~/locale'; -import eventHub from '../../eventhub'; - -export const MSG_DESCRIPTION = s__('WebIDE|You are invited to experience the new Web IDE.'); -export const MSG_BUTTON_TEXT = s__('WebIDE|Switch to new Web IDE'); -export const MSG_LEARN_MORE = __('Learn more'); -export const MSG_TITLE = s__('WebIDE|Ready for something new?'); - -export const MSG_CONFIRM = s__( - 'WebIDE|Are you sure you want to switch editors? You will lose any unsaved changes.', -); -export const MSG_ERROR_ALERT = s__( - 'WebIDE|Something went wrong while updating the user preferences. Please see developer console for details.', -); - -export default { - components: { - GlButton, - GlEmptyState, - GlLink, - }, - data() { - return { - loading: false, - }; - }, - computed: { - ...mapState(['switchEditorSvgPath', 'links', 'userPreferencesPath']), - }, - methods: { - async submitSwitch() { - const confirmed = await confirmAction(MSG_CONFIRM, { - primaryBtnText: __('Switch editors'), - cancelBtnText: __('Cancel'), - }); - - if (!confirmed) { - return; - } - - try { - await axios.put(this.userPreferencesPath, { - user: { use_legacy_web_ide: false }, - }); - } catch (e) { - // why: We do not want to translate console logs - // eslint-disable-next-line @gitlab/require-i18n-strings - logError('Error while updating user preferences', e); - createAlert({ - message: MSG_ERROR_ALERT, - }); - return; - } - - eventHub.$emit('skip-beforeunload'); - window.location.reload(); - }, - // what: ignoreWhilePending prevents double confirmation boxes - onSwitchClicked: ignoreWhilePending(async function onSwitchClicked() { - this.loading = true; - - try { - await this.submitSwitch(); - } finally { - this.loading = false; - } - }), - }, - MSG_TITLE, - MSG_DESCRIPTION, - MSG_BUTTON_TEXT, - MSG_LEARN_MORE, -}; -</script> - -<template> - <div class="gl-h-full gl-display-flex gl-flex-direction-column gl-justify-content-center"> - <gl-empty-state :svg-path="switchEditorSvgPath" :svg-height="150" :title="$options.MSG_TITLE"> - <template #description> - <span>{{ $options.MSG_DESCRIPTION }}</span> - <gl-link :href="links.newWebIDEHelpPagePath">{{ $options.MSG_LEARN_MORE }}</gl-link - >. - </template> - <template #actions> - <gl-button - category="primary" - variant="confirm" - :loading="loading" - @click="onSwitchClicked" - >{{ $options.MSG_BUTTON_TEXT }}</gl-button - > - </template> - </gl-empty-state> - </div> -</template> diff --git a/app/assets/javascripts/ide/constants.js b/app/assets/javascripts/ide/constants.js index c8e737fa6f5..bfe4c3ac271 100644 --- a/app/assets/javascripts/ide/constants.js +++ b/app/assets/javascripts/ide/constants.js @@ -61,7 +61,6 @@ export const leftSidebarViews = { }; export const rightSidebarViews = { - switchEditors: { name: 'switch-editors', keepAlive: true }, pipelines: { name: 'pipelines-list', keepAlive: true }, jobsDetail: { name: 'jobs-detail', keepAlive: false }, mergeRequestInfo: { name: 'merge-request-info', keepAlive: true }, diff --git a/app/assets/javascripts/ide/index.js b/app/assets/javascripts/ide/index.js index cacc6708895..1347d92b3b7 100644 --- a/app/assets/javascripts/ide/index.js +++ b/app/assets/javascripts/ide/index.js @@ -73,7 +73,6 @@ export const initLegacyWebIDE = (el, options = {}) => { codesandboxBundlerUrl: el.dataset.codesandboxBundlerUrl, environmentsGuidanceAlertDismissed: !parseBoolean(el.dataset.enableEnvironmentsGuidance), previewMarkdownPath: el.dataset.previewMarkdownPath, - canUseNewWebIde: parseBoolean(el.dataset.canUseNewWebIde), userPreferencesPath: el.dataset.userPreferencesPath, }); }, diff --git a/app/assets/javascripts/ide/stores/state.js b/app/assets/javascripts/ide/stores/state.js index 70efda970bf..b89d9d38a1a 100644 --- a/app/assets/javascripts/ide/stores/state.js +++ b/app/assets/javascripts/ide/stores/state.js @@ -34,5 +34,4 @@ export default () => ({ environmentsGuidanceAlertDetected: false, previewMarkdownPath: '', userPreferencesPath: '', - canUseNewWebIde: false, }); |