Commit 2a779800 authored by David O'Regan's avatar David O'Regan

Merge branch 'remove-switch-control-feature-flag' into 'master'

Remove switch editing controls feature flag

See merge request gitlab-org/gitlab!83760
parents fae2b4b1 716a98ca
<script> <script>
import { import { GlForm, GlIcon, GlLink, GlButton, GlSprintf, GlAlert } from '@gitlab/ui';
GlForm,
GlIcon,
GlLink,
GlButton,
GlSprintf,
GlAlert,
GlModal,
GlModalDirective,
} from '@gitlab/ui';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import csrf from '~/lib/utils/csrf'; import csrf from '~/lib/utils/csrf';
import { setUrlFragment } from '~/lib/utils/url_utility'; import { setUrlFragment } from '~/lib/utils/url_utility';
import { __, s__, sprintf } from '~/locale'; import { __, s__, sprintf } from '~/locale';
import Tracking from '~/tracking'; import Tracking from '~/tracking';
import MarkdownField from '~/vue_shared/components/markdown/field.vue'; import MarkdownField from '~/vue_shared/components/markdown/field.vue';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { import {
CONTENT_EDITOR_LOADED_ACTION, CONTENT_EDITOR_LOADED_ACTION,
SAVED_USING_CONTENT_EDITOR_ACTION, SAVED_USING_CONTENT_EDITOR_ACTION,
...@@ -64,28 +54,6 @@ export default { ...@@ -64,28 +54,6 @@ export default {
), ),
primaryAction: s__('WikiPage|Retry'), primaryAction: s__('WikiPage|Retry'),
}, },
useNewEditor: {
primaryLabel: s__('WikiPage|Use the new editor'),
secondaryLabel: s__('WikiPage|Try this later'),
title: s__('WikiPage|Get a richer editing experience'),
text: s__(
"WikiPage|Try the new visual Markdown editor. Read the %{linkStart}documentation%{linkEnd} to learn what's currently supported.",
),
},
switchToOldEditor: {
label: s__('WikiPage|Switch me back to the classic editor.'),
helpText: s__(
"WikiPage|This editor is in beta and may not display the page's contents properly. Switching back to the classic editor will discard changes you've made in the new editor.",
),
modal: {
title: s__('WikiPage|Are you sure you want to switch back to the classic editor?'),
primary: s__('WikiPage|Switch to classic editor'),
cancel: s__('WikiPage|Keep editing'),
text: s__(
"WikiPage|Switching to the classic editor will discard any changes you've made in the new editor.",
),
},
},
feedbackTip: __( feedbackTip: __(
'Tell us your experiences with the new Markdown editor %{linkStart}in this feedback issue%{linkEnd}.', 'Tell us your experiences with the new Markdown editor %{linkStart}in this feedback issue%{linkEnd}.',
), ),
...@@ -108,7 +76,6 @@ export default { ...@@ -108,7 +76,6 @@ export default {
editSourceButtonText: s__('WikiPage|Edit source'), editSourceButtonText: s__('WikiPage|Edit source'),
editRichTextButtonText: s__('WikiPage|Edit rich text'), editRichTextButtonText: s__('WikiPage|Edit rich text'),
}, },
contentEditorFeedbackIssue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/332629',
components: { components: {
GlAlert, GlAlert,
GlForm, GlForm,
...@@ -116,24 +83,19 @@ export default { ...@@ -116,24 +83,19 @@ export default {
GlIcon, GlIcon,
GlLink, GlLink,
GlButton, GlButton,
GlModal,
MarkdownField, MarkdownField,
ContentEditor: () => ContentEditor: () =>
import( import(
/* webpackChunkName: 'content_editor' */ '~/content_editor/components/content_editor.vue' /* webpackChunkName: 'content_editor' */ '~/content_editor/components/content_editor.vue'
), ),
}, },
directives: { mixins: [trackingMixin],
GlModalDirective,
},
mixins: [trackingMixin, glFeatureFlagMixin()],
inject: ['formatOptions', 'pageInfo'], inject: ['formatOptions', 'pageInfo'],
data() { data() {
return { return {
title: this.pageInfo.title?.trim() || '', title: this.pageInfo.title?.trim() || '',
format: this.pageInfo.format || 'markdown', format: this.pageInfo.format || 'markdown',
content: this.pageInfo.content || '', content: this.pageInfo.content || '',
isContentEditorAlertDismissed: false,
useContentEditor: false, useContentEditor: false,
commitMessage: '', commitMessage: '',
isDirty: false, isDirty: false,
...@@ -194,25 +156,9 @@ export default { ...@@ -194,25 +156,9 @@ export default {
isMarkdownFormat() { isMarkdownFormat() {
return this.format === 'markdown'; return this.format === 'markdown';
}, },
showContentEditorAlert() {
return (
!this.glFeatures.wikiSwitchBetweenContentEditorRawMarkdown &&
this.isMarkdownFormat &&
!this.useContentEditor &&
!this.isContentEditorAlertDismissed
);
},
showSwitchEditingModeButton() {
return this.glFeatures.wikiSwitchBetweenContentEditorRawMarkdown && this.isMarkdownFormat;
},
displayWikiSpecificMarkdownHelp() { displayWikiSpecificMarkdownHelp() {
return !this.isContentEditorActive; return !this.isContentEditorActive;
}, },
displaySwitchBackToClassicEditorMessage() {
return (
!this.glFeatures.wikiSwitchBetweenContentEditorRawMarkdown && this.isContentEditorActive
);
},
disableSubmitButton() { disableSubmitButton() {
return this.noContent || !this.title || this.contentEditorRenderFailed; return this.noContent || !this.title || this.contentEditorRenderFailed;
}, },
...@@ -312,23 +258,6 @@ export default { ...@@ -312,23 +258,6 @@ export default {
this.commitMessage = newCommitMessage; this.commitMessage = newCommitMessage;
}, },
initContentEditor() {
this.useContentEditor = true;
},
switchToOldEditor() {
this.useContentEditor = false;
},
confirmSwitchToOldEditor() {
if (this.contentEditorRenderFailed) {
this.contentEditorRenderFailed = false;
this.switchToOldEditor();
} else {
this.$refs.confirmSwitchToOldEditorModal.show();
}
},
trackContentEditorLoaded() { trackContentEditorLoaded() {
this.track(CONTENT_EDITOR_LOADED_ACTION); this.track(CONTENT_EDITOR_LOADED_ACTION);
}, },
...@@ -349,10 +278,6 @@ export default { ...@@ -349,10 +278,6 @@ export default {
}, },
}); });
}, },
dismissContentEditorAlert() {
this.isContentEditorAlertDismissed = true;
},
}, },
}; };
</script> </script>
...@@ -438,10 +363,7 @@ export default { ...@@ -438,10 +363,7 @@ export default {
}}</label> }}</label>
</div> </div>
<div class="col-sm-10"> <div class="col-sm-10">
<div <div v-if="isMarkdownFormat" class="gl-display-flex gl-justify-content-end gl-mb-3">
v-if="showSwitchEditingModeButton"
class="gl-display-flex gl-justify-content-end gl-mb-3"
>
<gl-button <gl-button
data-testid="toggle-editing-mode-button" data-testid="toggle-editing-mode-button"
data-qa-selector="editing_mode_button" data-qa-selector="editing_mode_button"
...@@ -451,42 +373,6 @@ export default { ...@@ -451,42 +373,6 @@ export default {
>{{ toggleEditingModeButtonText }}</gl-button >{{ toggleEditingModeButtonText }}</gl-button
> >
</div> </div>
<gl-alert
v-if="showContentEditorAlert"
class="gl-mb-6"
variant="info"
data-qa-selector="try_new_editor_container"
:primary-button-text="$options.i18n.contentEditor.useNewEditor.primaryLabel"
:secondary-button-text="$options.i18n.contentEditor.useNewEditor.secondaryLabel"
:dismiss-label="$options.i18n.contentEditor.useNewEditor.secondaryLabel"
:title="$options.i18n.contentEditor.useNewEditor.title"
@primaryAction="initContentEditor"
@secondaryAction="dismissContentEditorAlert"
@dismiss="dismissContentEditorAlert"
>
<gl-sprintf :message="$options.i18n.contentEditor.useNewEditor.text">
<template
#link="// eslint-disable-next-line vue/no-template-shadow
{ content }"
><gl-link
:href="contentEditorHelpPath"
target="_blank"
data-testid="content-editor-help-link"
>{{ content }}</gl-link
></template
>
</gl-sprintf>
</gl-alert>
<gl-modal
ref="confirmSwitchToOldEditorModal"
modal-id="confirm-switch-to-old-editor"
:title="$options.i18n.contentEditor.switchToOldEditor.modal.title"
:action-primary="{ text: $options.i18n.contentEditor.switchToOldEditor.modal.primary }"
:action-cancel="{ text: $options.i18n.contentEditor.switchToOldEditor.modal.cancel }"
@primary="switchToOldEditor"
>
{{ $options.i18n.contentEditor.switchToOldEditor.modal.text }}
</gl-modal>
<markdown-field <markdown-field
v-if="!isContentEditorActive" v-if="!isContentEditorActive"
:markdown-preview-path="pageInfo.markdownPreviewPath" :markdown-preview-path="pageInfo.markdownPreviewPath"
...@@ -516,7 +402,6 @@ export default { ...@@ -516,7 +402,6 @@ export default {
</textarea> </textarea>
</template> </template>
</markdown-field> </markdown-field>
<div v-if="isContentEditorActive"> <div v-if="isContentEditorActive">
<gl-alert class="gl-mb-6" variant="tip" :dismissible="false"> <gl-alert class="gl-mb-6" variant="tip" :dismissible="false">
<gl-sprintf :message="$options.i18n.contentEditor.feedbackTip"> <gl-sprintf :message="$options.i18n.contentEditor.feedbackTip">
...@@ -560,12 +445,6 @@ export default { ...@@ -560,12 +445,6 @@ export default {
></template ></template
> >
</gl-sprintf> </gl-sprintf>
<span v-if="displaySwitchBackToClassicEditorMessage">
{{ $options.i18n.contentEditor.switchToOldEditor.helpText }}
<gl-button variant="link" @click="confirmSwitchToOldEditor">{{
$options.i18n.contentEditor.switchToOldEditor.label
}}</gl-button>
</span>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -21,10 +21,6 @@ module WikiActions ...@@ -21,10 +21,6 @@ module WikiActions
before_action :load_sidebar, except: [:pages] before_action :load_sidebar, except: [:pages]
before_action :set_content_class before_action :set_content_class
before_action do
push_frontend_feature_flag(:wiki_switch_between_content_editor_raw_markdown, @group, default_enabled: :yaml)
end
before_action only: [:show, :edit, :update] do before_action only: [:show, :edit, :update] do
@valid_encoding = valid_encoding? @valid_encoding = valid_encoding?
end end
......
---
name: wiki_switch_between_content_editor_raw_markdown
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/74457
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/345398
milestone: '14.6'
type: development
group: group::editor
default_enabled: true
...@@ -327,13 +327,7 @@ to disable the wiki but toggle it on (in blue). ...@@ -327,13 +327,7 @@ to disable the wiki but toggle it on (in blue).
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/5643) in GitLab 14.0. > - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/5643) in GitLab 14.0.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/345398) switching between editing experiences in GitLab 14.7 [with a flag](../../../administration/feature_flags.md) named `wiki_switch_between_content_editor_raw_markdown`. Enabled by default. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/345398) switching between editing experiences in GitLab 14.7 [with a flag](../../../administration/feature_flags.md) named `wiki_switch_between_content_editor_raw_markdown`. Enabled by default.
> - Switching between editing experiences generally available in GitLab 14.10. [Feature flag `wiki_switch_between_content_editor_raw_markdown`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/83760) removed.
FLAG:
On self-managed GitLab, by default this feature is available.
To hide the feature, ask an administrator to
[disable the feature flag](../../../administration/feature_flags.md) named
`wiki_switch_between_content_editor_raw_markdown`.
On GitLab.com, this feature is available.
GitLab version 14.0 introduces a WYSIWYG editing experience for GitLab Flavored Markdown GitLab version 14.0 introduces a WYSIWYG editing experience for GitLab Flavored Markdown
in Wikis through the [Content Editor](../../../development/fe_guide/content_editor.md). in Wikis through the [Content Editor](../../../development/fe_guide/content_editor.md).
......
...@@ -42283,9 +42283,6 @@ msgstr "" ...@@ -42283,9 +42283,6 @@ msgstr ""
msgid "WikiPage|An error occurred while trying to render the content editor. Please try again later." msgid "WikiPage|An error occurred while trying to render the content editor. Please try again later."
msgstr "" msgstr ""
msgid "WikiPage|Are you sure you want to switch back to the classic editor?"
msgstr ""
msgid "WikiPage|Cancel" msgid "WikiPage|Cancel"
msgstr "" msgstr ""
...@@ -42310,12 +42307,6 @@ msgstr "" ...@@ -42310,12 +42307,6 @@ msgstr ""
msgid "WikiPage|Format" msgid "WikiPage|Format"
msgstr "" msgstr ""
msgid "WikiPage|Get a richer editing experience"
msgstr ""
msgid "WikiPage|Keep editing"
msgstr ""
msgid "WikiPage|Learn more." msgid "WikiPage|Learn more."
msgstr "" msgstr ""
...@@ -42328,18 +42319,6 @@ msgstr "" ...@@ -42328,18 +42319,6 @@ msgstr ""
msgid "WikiPage|Save changes" msgid "WikiPage|Save changes"
msgstr "" msgstr ""
msgid "WikiPage|Switch me back to the classic editor."
msgstr ""
msgid "WikiPage|Switch to classic editor"
msgstr ""
msgid "WikiPage|Switching to the classic editor will discard any changes you've made in the new editor."
msgstr ""
msgid "WikiPage|This editor is in beta and may not display the page's contents properly. Switching back to the classic editor will discard changes you've made in the new editor."
msgstr ""
msgid "WikiPage|Tip: You can move this page by adding the path to the beginning of the title." msgid "WikiPage|Tip: You can move this page by adding the path to the beginning of the title."
msgstr "" msgstr ""
...@@ -42352,18 +42331,9 @@ msgstr "" ...@@ -42352,18 +42331,9 @@ msgstr ""
msgid "WikiPage|To link to a (new) page, simply type %{linkExample}. More examples are in the %{linkStart}documentation%{linkEnd}." msgid "WikiPage|To link to a (new) page, simply type %{linkExample}. More examples are in the %{linkStart}documentation%{linkEnd}."
msgstr "" msgstr ""
msgid "WikiPage|Try the new visual Markdown editor. Read the %{linkStart}documentation%{linkEnd} to learn what's currently supported."
msgstr ""
msgid "WikiPage|Try this later"
msgstr ""
msgid "WikiPage|Update %{pageTitle}" msgid "WikiPage|Update %{pageTitle}"
msgstr "" msgstr ""
msgid "WikiPage|Use the new editor"
msgstr ""
msgid "WikiPage|Write your content or drag files here…" msgid "WikiPage|Write your content or drag files here…"
msgstr "" msgstr ""
......
...@@ -14,7 +14,6 @@ module QA ...@@ -14,7 +14,6 @@ module QA
element :wiki_content_textarea element :wiki_content_textarea
element :wiki_message_textbox element :wiki_message_textbox
element :wiki_submit_button element :wiki_submit_button
element :try_new_editor_container
element :editing_mode_button element :editing_mode_button
end end
......
...@@ -145,19 +145,6 @@ RSpec.shared_examples 'User updates wiki page' do ...@@ -145,19 +145,6 @@ RSpec.shared_examples 'User updates wiki page' do
it_behaves_like 'edits content using the content editor' it_behaves_like 'edits content using the content editor'
end end
context 'with feature flag off' do
before do
stub_feature_flags(wiki_switch_between_content_editor_raw_markdown: false)
visit(wiki_path(wiki))
click_link('Edit')
click_button 'Use the new editor'
end
it_behaves_like 'edits content using the content editor'
end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment