Commit d4bd2f55 authored by Enrique Alcántara's avatar Enrique Alcántara

Merge branch 'rename-static-site-editor' into 'master'

Move component and spec to static site editor

See merge request gitlab-org/gitlab!55934
parents efefd940 ead8cb57
<script> <script>
import { EDITOR_TYPES } from '~/static_site_editor/rich_content_editor/constants';
import RichContentEditor from '~/static_site_editor/rich_content_editor/rich_content_editor.vue';
import parseSourceFile from '~/static_site_editor/services/parse_source_file'; import parseSourceFile from '~/static_site_editor/services/parse_source_file';
import { EDITOR_TYPES } from '~/vue_shared/components/rich_content_editor/constants';
import RichContentEditor from '~/vue_shared/components/rich_content_editor/rich_content_editor.vue';
import imageRepository from '../image_repository'; import imageRepository from '../image_repository';
import formatter from '../services/formatter'; import formatter from '../services/formatter';
import renderImage from '../services/renderers/render_image'; import renderImage from '../services/renderers/render_image';
......
...@@ -7,8 +7,8 @@ import EditDrawer from '~/static_site_editor/components/edit_drawer.vue'; ...@@ -7,8 +7,8 @@ import EditDrawer from '~/static_site_editor/components/edit_drawer.vue';
import EditHeader from '~/static_site_editor/components/edit_header.vue'; import EditHeader from '~/static_site_editor/components/edit_header.vue';
import PublishToolbar from '~/static_site_editor/components/publish_toolbar.vue'; import PublishToolbar from '~/static_site_editor/components/publish_toolbar.vue';
import UnsavedChangesConfirmDialog from '~/static_site_editor/components/unsaved_changes_confirm_dialog.vue'; import UnsavedChangesConfirmDialog from '~/static_site_editor/components/unsaved_changes_confirm_dialog.vue';
import { EDITOR_TYPES } from '~/vue_shared/components/rich_content_editor/constants'; import { EDITOR_TYPES } from '~/static_site_editor/rich_content_editor/constants';
import RichContentEditor from '~/vue_shared/components/rich_content_editor/rich_content_editor.vue'; import RichContentEditor from '~/static_site_editor/rich_content_editor/rich_content_editor.vue';
import { import {
sourceContentTitle as title, sourceContentTitle as title,
......
import buildCustomRenderer from '~/vue_shared/components/rich_content_editor/services/build_custom_renderer'; import buildCustomRenderer from '~/static_site_editor/rich_content_editor/services/build_custom_renderer';
import buildHTMLToMarkdownRenderer from '~/vue_shared/components/rich_content_editor/services/build_html_to_markdown_renderer'; import buildHTMLToMarkdownRenderer from '~/static_site_editor/rich_content_editor/services/build_html_to_markdown_renderer';
import { import {
generateToolbarItem, generateToolbarItem,
addCustomEventListener, addCustomEventListener,
...@@ -9,12 +9,12 @@ import { ...@@ -9,12 +9,12 @@ import {
insertVideo, insertVideo,
getMarkdown, getMarkdown,
getEditorOptions, getEditorOptions,
} from '~/vue_shared/components/rich_content_editor/services/editor_service'; } from '~/static_site_editor/rich_content_editor/services/editor_service';
import sanitizeHTML from '~/vue_shared/components/rich_content_editor/services/sanitize_html'; import sanitizeHTML from '~/static_site_editor/rich_content_editor/services/sanitize_html';
jest.mock('~/vue_shared/components/rich_content_editor/services/build_html_to_markdown_renderer'); jest.mock('~/static_site_editor/rich_content_editor/services/build_html_to_markdown_renderer');
jest.mock('~/vue_shared/components/rich_content_editor/services/build_custom_renderer'); jest.mock('~/static_site_editor/rich_content_editor/services/build_custom_renderer');
jest.mock('~/vue_shared/components/rich_content_editor/services/sanitize_html'); jest.mock('~/static_site_editor/rich_content_editor/services/sanitize_html');
describe('Editor Service', () => { describe('Editor Service', () => {
let mockInstance; let mockInstance;
......
import { GlModal, GlTabs } from '@gitlab/ui'; import { GlModal, GlTabs } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { IMAGE_TABS } from '~/vue_shared/components/rich_content_editor/constants'; import { IMAGE_TABS } from '~/static_site_editor/rich_content_editor/constants';
import AddImageModal from '~/vue_shared/components/rich_content_editor/modals/add_image/add_image_modal.vue'; import AddImageModal from '~/static_site_editor/rich_content_editor/modals/add_image/add_image_modal.vue';
import UploadImageTab from '~/vue_shared/components/rich_content_editor/modals/add_image/upload_image_tab.vue'; import UploadImageTab from '~/static_site_editor/rich_content_editor/modals/add_image/upload_image_tab.vue';
describe('Add Image Modal', () => { describe('Add Image Modal', () => {
let wrapper; let wrapper;
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import UploadImageTab from '~/vue_shared/components/rich_content_editor/modals/add_image/upload_image_tab.vue'; import UploadImageTab from '~/static_site_editor/rich_content_editor/modals/add_image/upload_image_tab.vue';
describe('Upload Image Tab', () => { describe('Upload Image Tab', () => {
let wrapper; let wrapper;
......
import { GlModal } from '@gitlab/ui'; import { GlModal } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import InsertVideoModal from '~/vue_shared/components/rich_content_editor/modals/insert_video_modal.vue'; import InsertVideoModal from '~/static_site_editor/rich_content_editor/modals/insert_video_modal.vue';
describe('Insert Video Modal', () => { describe('Insert Video Modal', () => {
let wrapper; let wrapper;
......
import Editor from '@toast-ui/editor'; import Editor from '@toast-ui/editor';
import buildMarkdownToHTMLRenderer from '~/vue_shared/components/rich_content_editor/services/build_custom_renderer'; import buildMarkdownToHTMLRenderer from '~/static_site_editor/rich_content_editor/services/build_custom_renderer';
import { registerHTMLToMarkdownRenderer } from '~/vue_shared/components/rich_content_editor/services/editor_service'; import { registerHTMLToMarkdownRenderer } from '~/static_site_editor/rich_content_editor/services/editor_service';
describe('vue_shared/components/rich_content_editor', () => { describe('static_site_editor/rich_content_editor', () => {
let editor; let editor;
const buildEditor = () => { const buildEditor = () => {
......
...@@ -5,10 +5,10 @@ import { ...@@ -5,10 +5,10 @@ import {
EDITOR_HEIGHT, EDITOR_HEIGHT,
EDITOR_PREVIEW_STYLE, EDITOR_PREVIEW_STYLE,
CUSTOM_EVENTS, CUSTOM_EVENTS,
} from '~/vue_shared/components/rich_content_editor/constants'; } from '~/static_site_editor/rich_content_editor/constants';
import AddImageModal from '~/vue_shared/components/rich_content_editor/modals/add_image/add_image_modal.vue'; import AddImageModal from '~/static_site_editor/rich_content_editor/modals/add_image/add_image_modal.vue';
import InsertVideoModal from '~/vue_shared/components/rich_content_editor/modals/insert_video_modal.vue'; import InsertVideoModal from '~/static_site_editor/rich_content_editor/modals/insert_video_modal.vue';
import RichContentEditor from '~/vue_shared/components/rich_content_editor/rich_content_editor.vue'; import RichContentEditor from '~/static_site_editor/rich_content_editor/rich_content_editor.vue';
import { import {
addCustomEventListener, addCustomEventListener,
...@@ -18,9 +18,9 @@ import { ...@@ -18,9 +18,9 @@ import {
registerHTMLToMarkdownRenderer, registerHTMLToMarkdownRenderer,
getEditorOptions, getEditorOptions,
getMarkdown, getMarkdown,
} from '~/vue_shared/components/rich_content_editor/services/editor_service'; } from '~/static_site_editor/rich_content_editor/services/editor_service';
jest.mock('~/vue_shared/components/rich_content_editor/services/editor_service', () => ({ jest.mock('~/static_site_editor/rich_content_editor/services/editor_service', () => ({
addCustomEventListener: jest.fn(), addCustomEventListener: jest.fn(),
removeCustomEventListener: jest.fn(), removeCustomEventListener: jest.fn(),
addImage: jest.fn(), addImage: jest.fn(),
......
import buildCustomHTMLRenderer from '~/vue_shared/components/rich_content_editor/services/build_custom_renderer'; import buildCustomHTMLRenderer from '~/static_site_editor/rich_content_editor/services/build_custom_renderer';
describe('Build Custom Renderer Service', () => { describe('Build Custom Renderer Service', () => {
describe('buildCustomHTMLRenderer', () => { describe('buildCustomHTMLRenderer', () => {
......
import buildHTMLToMarkdownRenderer from '~/vue_shared/components/rich_content_editor/services/build_html_to_markdown_renderer'; import buildHTMLToMarkdownRenderer from '~/static_site_editor/rich_content_editor/services/build_html_to_markdown_renderer';
import { attributeDefinition } from './renderers/mock_data'; import { attributeDefinition } from './renderers/mock_data';
describe('rich_content_editor/services/html_to_markdown_renderer', () => { describe('rich_content_editor/services/html_to_markdown_renderer', () => {
......
...@@ -6,7 +6,7 @@ import { ...@@ -6,7 +6,7 @@ import {
buildUneditableBlockTokens, buildUneditableBlockTokens,
buildUneditableInlineTokens, buildUneditableInlineTokens,
buildUneditableHtmlAsTextTokens, buildUneditableHtmlAsTextTokens,
} from '~/vue_shared/components/rich_content_editor/services/renderers/build_uneditable_token'; } from '~/static_site_editor/rich_content_editor/services/renderers/build_uneditable_token';
import { import {
originInlineToken, originInlineToken,
......
import renderer from '~/vue_shared/components/rich_content_editor/services/renderers/render_attribute_definition'; import renderer from '~/static_site_editor/rich_content_editor/services/renderers/render_attribute_definition';
import { attributeDefinition } from './mock_data'; import { attributeDefinition } from './mock_data';
describe('rich_content_editor/renderers/render_attribute_definition', () => { describe('rich_content_editor/renderers/render_attribute_definition', () => {
......
import renderer from '~/vue_shared/components/rich_content_editor/services/renderers/render_embedded_ruby_text'; import renderer from '~/static_site_editor/rich_content_editor/services/renderers/render_embedded_ruby_text';
import { renderUneditableLeaf } from '~/vue_shared/components/rich_content_editor/services/renderers/render_utils'; import { renderUneditableLeaf } from '~/static_site_editor/rich_content_editor/services/renderers/render_utils';
import { buildMockTextNode, normalTextNode } from './mock_data'; import { buildMockTextNode, normalTextNode } from './mock_data';
......
import { buildUneditableInlineTokens } from '~/vue_shared/components/rich_content_editor/services/renderers/build_uneditable_token'; import { buildUneditableInlineTokens } from '~/static_site_editor/rich_content_editor/services/renderers/build_uneditable_token';
import renderer from '~/vue_shared/components/rich_content_editor/services/renderers/render_font_awesome_html_inline'; import renderer from '~/static_site_editor/rich_content_editor/services/renderers/render_font_awesome_html_inline';
import { normalTextNode } from './mock_data'; import { normalTextNode } from './mock_data';
......
import renderer from '~/vue_shared/components/rich_content_editor/services/renderers/render_heading'; import renderer from '~/static_site_editor/rich_content_editor/services/renderers/render_heading';
import * as renderUtils from '~/vue_shared/components/rich_content_editor/services/renderers/render_utils'; import * as renderUtils from '~/static_site_editor/rich_content_editor/services/renderers/render_utils';
describe('rich_content_editor/renderers/render_heading', () => { describe('rich_content_editor/renderers/render_heading', () => {
it('canRender delegates to renderUtils.willAlwaysRender', () => { it('canRender delegates to renderUtils.willAlwaysRender', () => {
......
import { buildUneditableHtmlAsTextTokens } from '~/vue_shared/components/rich_content_editor/services/renderers/build_uneditable_token'; import { buildUneditableHtmlAsTextTokens } from '~/static_site_editor/rich_content_editor/services/renderers/build_uneditable_token';
import renderer from '~/vue_shared/components/rich_content_editor/services/renderers/render_html_block'; import renderer from '~/static_site_editor/rich_content_editor/services/renderers/render_html_block';
describe('rich_content_editor/services/renderers/render_html_block', () => { describe('rich_content_editor/services/renderers/render_html_block', () => {
const htmlBlockNode = { const htmlBlockNode = {
......
import { buildUneditableInlineTokens } from '~/vue_shared/components/rich_content_editor/services/renderers/build_uneditable_token'; import { buildUneditableInlineTokens } from '~/static_site_editor/rich_content_editor/services/renderers/build_uneditable_token';
import renderer from '~/vue_shared/components/rich_content_editor/services/renderers/render_identifier_instance_text'; import renderer from '~/static_site_editor/rich_content_editor/services/renderers/render_identifier_instance_text';
import { buildMockTextNode, normalTextNode } from './mock_data'; import { buildMockTextNode, normalTextNode } from './mock_data';
......
import renderer from '~/vue_shared/components/rich_content_editor/services/renderers/render_identifier_paragraph'; import renderer from '~/static_site_editor/rich_content_editor/services/renderers/render_identifier_paragraph';
import { buildMockTextNode } from './mock_data'; import { buildMockTextNode } from './mock_data';
......
import renderer from '~/vue_shared/components/rich_content_editor/services/renderers/render_list_item'; import renderer from '~/static_site_editor/rich_content_editor/services/renderers/render_list_item';
import * as renderUtils from '~/vue_shared/components/rich_content_editor/services/renderers/render_utils'; import * as renderUtils from '~/static_site_editor/rich_content_editor/services/renderers/render_utils';
describe('rich_content_editor/renderers/render_list_item', () => { describe('rich_content_editor/renderers/render_list_item', () => {
it('canRender delegates to renderUtils.willAlwaysRender', () => { it('canRender delegates to renderUtils.willAlwaysRender', () => {
......
import renderer from '~/vue_shared/components/rich_content_editor/services/renderers/render_softbreak'; import renderer from '~/static_site_editor/rich_content_editor/services/renderers/render_softbreak';
describe('Render softbreak renderer', () => { describe('Render softbreak renderer', () => {
describe('canRender', () => { describe('canRender', () => {
......
import { import {
buildUneditableBlockTokens, buildUneditableBlockTokens,
buildUneditableOpenTokens, buildUneditableOpenTokens,
} from '~/vue_shared/components/rich_content_editor/services/renderers/build_uneditable_token'; } from '~/static_site_editor/rich_content_editor/services/renderers/build_uneditable_token';
import { import {
renderUneditableLeaf, renderUneditableLeaf,
renderUneditableBranch, renderUneditableBranch,
renderWithAttributeDefinitions, renderWithAttributeDefinitions,
willAlwaysRender, willAlwaysRender,
} from '~/vue_shared/components/rich_content_editor/services/renderers/render_utils'; } from '~/static_site_editor/rich_content_editor/services/renderers/render_utils';
import { originToken, uneditableCloseToken, attributeDefinition } from './mock_data'; import { originToken, uneditableCloseToken, attributeDefinition } from './mock_data';
......
import sanitizeHTML from '~/vue_shared/components/rich_content_editor/services/sanitize_html'; import sanitizeHTML from '~/static_site_editor/rich_content_editor/services/sanitize_html';
describe('rich_content_editor/services/sanitize_html', () => { describe('rich_content_editor/services/sanitize_html', () => {
it.each` it.each`
......
import { GlIcon } from '@gitlab/ui'; import { GlIcon } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
import ToolbarItem from '~/vue_shared/components/rich_content_editor/toolbar_item.vue'; import ToolbarItem from '~/static_site_editor/rich_content_editor/toolbar_item.vue';
describe('Toolbar Item', () => { describe('Toolbar Item', () => {
let wrapper; let wrapper;
......
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