stable

Clone or download

Read-only

Add Markdown support in new follow-ups

Part of story #18336 add support of markdown How to test: - Rebuild tracker - Go to the Artifact view, edit an existing artifact - When writing a new follow-up comment, you can choose the "Markdown" format. When you save, the follow-up comment will be saved in "commonmark" format. - Image drag/drop and upload still functions as before in the new follow-up editor. - Switching to HTML from Text or Markdown should "render" the text content in HTML (Markdown is converted to HTML) - Switching from HTML to Text or Markdown should convert the HTML to Markdown (to preserve formatting as much as possible). - No other functional change expected to the new follow-up editor. Notes: This contribution introduces a new tracker/rich-text-editor library. It is meant to replace completely codendi/RichTextEditor.js + tuleap/textarea_rte.js. The new lib is written in vanilla TypeScript in order to have as few dependencies as possible and be easily testable and (more importantly) easy to change, which is not the case in the former codendi/tuleap combination. The library resides in Tracker and not in core because it is very dependant on FlamingParrot and Tracker Artifact view form. As for now it will be used only in Tracker, it makes sense to have it here. Using it elsewhere will likely require a lot of work and is not in the scope of this story for now, but it should be possible to isolate the library from such dependencies. Some options have been voluntarily left behind. There is only one set of options for CKEditor (others are not used). Some functionality will be added in later patches. For example, there is a snippet of code for default values. This will be done in future contributions (it is not needed for the follow-up comment). Change-Id: I9abf3f3124501c05d45a36448dd427c6ddc6bb54

Modified Files

Name
M plugins/tracker/include/Tracker/Artifact/Renderer/EditRenderer.class.php +1 −2 Go to diff View file
M plugins/tracker/package-lock.json +6 −0 Go to diff View file
M plugins/tracker/package.json +3 −0 Go to diff View file
R plugins/tracker/scripts/legacy/TrackerArtifactEditionSwitcher.js Go to diff View file
A plugins/tracker/scripts/artifact/edit-view.ts +62 −0 Go to diff View file
A plugins/tracker/scripts/constants/fields-constants.d.ts +87 −0 Go to diff View file
M plugins/tracker/scripts/legacy/TrackerRichTextEditor.js +0 −11 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/.gitignore +1 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/README.md +31 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/jest.config.js +23 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/package-lock.json +44 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/package.json +29 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/po/fr_FR.po +25 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/DocumentInterface.ts +51 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/FlamingParrotDocumentAdapter.test.ts +114 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/FlamingParrotDocumentAdapter.ts +76 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/FormatSelectorBuilder.test.ts +120 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/FormatSelectorBuilder.ts +86 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/RichTextEditorFactory.ts +85 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/TextEditor.test.ts +195 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/TextEditor.ts +90 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/__mocks__/ckeditor4.js +28 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/ckeditor4.d.ts +22 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/index.ts +21 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/options-defaulter.test.ts +61 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/options-defaulter.ts +38 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/pofile-shim.d.ts +24 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/src/types.ts +49 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/tsconfig.json +8 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/webpack.common.js +52 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/webpack.dev.js +23 −0 Go to diff View file
A plugins/tracker/scripts/lib/rich-text-editor/webpack.prod.js +23 −0 Go to diff View file
M plugins/tracker/webpack.common.js +4 −4 Go to diff View file