stable

Clone or download

Read-only

Add the markdown "Preview" button in Artifact view

Part of story #18337 markdown replace text How to test: There is a "Preview" button in the following cases (in Markdown format): - When you create a new artifact in Text fields - When you edit an existing artifact in Text fields and new follow-up comment - When you edit an existing follow-up comment - When you Mass-change artifacts and add a new follow-up comment - When you open an existing artifact in the Modal v2 (Cardwall) In all these cases, you can try the following: - When you click on the "Preview" button, the format selector and the "Help" button are disabled. - "Preview" button becomes "Edit" button. When you click on "Edit", they are re-enabled again. Note: lit-html adapter is split in components to ease readability. There is an interface before "EditorAreaState" because in the next patch it will query a remote API. It isolates it and makes it easier to test the renderer without mocking the remote API. There is also another interface before TextEditor. In the next patch, we will need to access it in the state. It leaks less implementation if we only have access to a few methods, the State does not need to know about CKEditor, it will only need getContent(). Change-Id: I3b94f0195f6ec12cc6eed1b279ab839961a7ba07

Modified Files

Name
M plugins/tracker/scripts/lib/rich-text-editor/po/fr_FR.po +6 −0 Go to diff View file
M plugins/tracker/scripts/lib/rich-text-editor/src/RichTextEditorFactory.ts +2 −1 Go to diff View file
M plugins/tracker/scripts/lib/rich-text-editor/src/TextEditor.ts +2 −1 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/TextEditorInterface.ts +26 −0 Go to diff View file
M plugins/tracker/scripts/lib/rich-text-editor/src/format-selector/editor-area/EditorAreaRenderer.test.ts +127 −53 Go to diff View file
M plugins/tracker/scripts/lib/rich-text-editor/src/format-selector/editor-area/EditorAreaRenderer.ts +34 −14 Go to diff View file
M plugins/tracker/scripts/lib/rich-text-editor/src/format-selector/editor-area/EditorAreaState.test.ts +20 −15 Go to diff View file
M plugins/tracker/scripts/lib/rich-text-editor/src/format-selector/editor-area/EditorAreaState.ts +21 −7 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/format-selector/editor-area/EditorAreaStateInterface.ts +34 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/format-selector/editor-area/components/FormatSelect.test.ts +130 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/format-selector/editor-area/components/FormatSelect.ts +101 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/format-selector/editor-area/components/PreviewEditButton.test.ts +68 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/format-selector/editor-area/components/PreviewEditButton.ts +48 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/format-selector/editor-area/components/SyntaxHelpButton.test.ts +50 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/format-selector/editor-area/components/SyntaxHelpButton.ts +50 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/format-selector/editor-area/components/__snapshots__/PreviewEditButton.test.ts.snap +15 −0 Go to diff View file
R plugins/tracker/scripts/lib/rich-text-editor/src/format-selector/editor-area/__snapshots__/lit-html-adapter.test.ts.snap Go to diff View file
M plugins/tracker/scripts/lib/rich-text-editor/src/format-selector/editor-area/lit-html-adapter.test.ts +8 −79 Go to diff View file
M plugins/tracker/scripts/lib/rich-text-editor/src/format-selector/editor-area/lit-html-adapter.ts +2 −92 Go to diff View file
M plugins/tracker/scripts/lib/rich-text-editor/src/index.ts +1 −0 Go to diff View file