Commit 422dae62 authored by jerasmus's avatar jerasmus

Enable WYSIWYG editor for the static site editor

Removed the feature flag
parent 62b2360f
<script> <script>
import { GlFormTextarea } from '@gitlab/ui';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import RichContentEditor from '~/vue_shared/components/rich_content_editor/rich_content_editor.vue'; import RichContentEditor from '~/vue_shared/components/rich_content_editor/rich_content_editor.vue';
import PublishToolbar from '../components/publish_toolbar.vue'; import PublishToolbar from '../components/publish_toolbar.vue';
import EditHeader from '../components/edit_header.vue'; import EditHeader from '../components/edit_header.vue';
export default { export default {
components: { components: {
GlFormTextarea,
RichContentEditor, RichContentEditor,
PublishToolbar, PublishToolbar,
EditHeader, EditHeader,
}, },
mixins: [glFeatureFlagsMixin()],
props: { props: {
title: { title: {
type: String, type: String,
...@@ -55,8 +49,7 @@ export default { ...@@ -55,8 +49,7 @@ export default {
<template> <template>
<div class="d-flex flex-grow-1 flex-column"> <div class="d-flex flex-grow-1 flex-column">
<edit-header class="py-2" :title="title" /> <edit-header class="py-2" :title="title" />
<rich-content-editor v-if="glFeatures.richContentEditor" v-model="editableContent" /> <rich-content-editor v-model="editableContent" class="mb-9" />
<gl-form-textarea v-else v-model="editableContent" class="h-100 shadow-none" />
<publish-toolbar <publish-toolbar
class="gl-fixed gl-left-0 gl-bottom-0 gl-w-full" class="gl-fixed gl-left-0 gl-bottom-0 gl-w-full"
:return-url="returnUrl" :return-url="returnUrl"
......
...@@ -10,10 +10,6 @@ class Projects::StaticSiteEditorController < Projects::ApplicationController ...@@ -10,10 +10,6 @@ class Projects::StaticSiteEditorController < Projects::ApplicationController
before_action :assign_ref_and_path, only: [:show] before_action :assign_ref_and_path, only: [:show]
before_action :authorize_edit_tree!, only: [:show] before_action :authorize_edit_tree!, only: [:show]
before_action do
push_frontend_feature_flag(:rich_content_editor)
end
def show def show
@config = Gitlab::StaticSiteEditor::Config.new(@repository, @ref, @path, params[:return_url]) @config = Gitlab::StaticSiteEditor::Config.new(@repository, @ref, @path, params[:return_url])
end end
......
---
title: Add WYSIWYG editor to the Static Site Editor
merge_request: 31099
author:
type: added
...@@ -5,7 +5,8 @@ description: "The static site editor enables users to edit content on static web ...@@ -5,7 +5,8 @@ description: "The static site editor enables users to edit content on static web
# Static Site Editor # Static Site Editor
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/28758) in GitLab 12.10. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/28758) in GitLab 12.10.
> - WYSIWYG editor [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/214559) in GitLab 13.0.
Static Site Editor enables users to edit content on static websites without Static Site Editor enables users to edit content on static websites without
prior knowledge of the underlying templating language, site architecture, or prior knowledge of the underlying templating language, site architecture, or
...@@ -44,7 +45,7 @@ When clicking it, GitLab will open up an editor window from which the content ...@@ -44,7 +45,7 @@ When clicking it, GitLab will open up an editor window from which the content
can be directly edited. When you're ready, you can submit your changes in a can be directly edited. When you're ready, you can submit your changes in a
click of a button: click of a button:
![Static Site Editor](img/static_site_editor_v12_10.png) ![Static Site Editor](img/wysiwyg_editor_v13_0.png)
When an editor submits their changes, in the background, GitLab automatically When an editor submits their changes, in the background, GitLab automatically
creates a new branch, commits their changes, and opens a merge request. The creates a new branch, commits their changes, and opens a merge request. The
...@@ -79,7 +80,8 @@ company and a new feature has been added to the company product. ...@@ -79,7 +80,8 @@ company and a new feature has been added to the company product.
1. You are assigned the task of updating the documentation. 1. You are assigned the task of updating the documentation.
1. You visit a page and see content that needs to be edited. 1. You visit a page and see content that needs to be edited.
1. Click the **Edit this page** button on the production site. 1. Click the **Edit this page** button on the production site.
1. The file is opened in the Static Site Editor. 1. The file is opened in the Static Site Editor in **WYSIWYG** mode. If you wish to edit the raw Markdown
instead, you can toggle the **Markdown** mode in the bottom-right corner.
1. You edit the file right there and click **Submit changes**. 1. You edit the file right there and click **Submit changes**.
1. A new merge request is automatically created and you assign it to your colleague for review. 1. A new merge request is automatically created and you assign it to your colleague for review.
......
...@@ -15,9 +15,6 @@ describe('~/static_site_editor/components/edit_area.vue', () => { ...@@ -15,9 +15,6 @@ describe('~/static_site_editor/components/edit_area.vue', () => {
const buildWrapper = (propsData = {}) => { const buildWrapper = (propsData = {}) => {
wrapper = shallowMount(EditArea, { wrapper = shallowMount(EditArea, {
provide: {
glFeatures: { richContentEditor: true },
},
propsData: { propsData: {
title, title,
content, content,
......
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