stable

Clone or download

Read-only

Edit comments on the Artifact view

Part of story #18336 add support of markdown How to test: - Rebuild the rich text editor lib in tracker and plugin tracker: $ (cd plugins/tracker/scripts/lib/rich-text-editor && npm run build) \ && (cd plugins/tracker && npm run build) - Edit an existing follow-up comment. The format of the comment should be the one that was saved (Markdown, HTML or Text), and the textarea (or CKEditor) should display the contents of the comment. - Change the format and edit the contents of the comment. You should be able to choose the Markdown format when editing. When you submit, the format and contents are saved correctly. - Edit a follow-up without a comment (just some field changes). The format should be "Text" (as before). When you change the format, edit the comment and submit, it is saved correctly. - No other functional change expected. There has never been image upload in this case, so it is still not supported in this case. Notes: I simply moved the Prototype.js code for comment edition and changed the parts that were necessary to change. Refactoring this part into vanilla Typescript is outside of the scope of this story, so for the time being we will still rely on Prototype for Ajax and creating the buttons and stuff. The "new parts" have been extracted to a "helpers" file in Typescript so that they can be unit tested and can use strict types. I also took the opportunity to move files to an artifact/edition folder to separate them from the other artifact views (creation, copy, mass change, etc.) Change-Id: Id72b8741f36411b99fac8d6be1a85cd873f9a2d2

Modified Files

Name
M .eslintrc.js +2 −0 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Changeset/Comment/CommentPresenter.php +15 −7 Go to diff View file
M plugins/tracker/scripts/artifact/RichTextEditorsCreator.ts +5 −9 Go to diff View file
R plugins/tracker/scripts/artifact/TrackerArtifactEditionSwitcher.js Go to diff View file
A plugins/tracker/scripts/artifact/edition/edit-follow-up-comment-helpers.test.ts +172 −0 Go to diff View file
A plugins/tracker/scripts/artifact/edition/edit-follow-up-comment-helpers.ts +85 −0 Go to diff View file
A plugins/tracker/scripts/artifact/edition/edit-follow-up-comment.js +146 −0 Go to diff View file
R plugins/tracker/scripts/artifact/edit-view.ts Go to diff View file
R plugins/tracker/scripts/artifact/text-follow-up.test.ts Go to diff View file
R plugins/tracker/scripts/artifact/text-follow-up.ts Go to diff View file
M plugins/tracker/scripts/constants/fields-constants.d.ts +2 −0 Go to diff View file
M plugins/tracker/scripts/constants/fields-constants.js +3 −0 Go to diff View file
M plugins/tracker/scripts/legacy/TrackerArtifact.js +1 −134 Go to diff View file
M plugins/tracker/scripts/lib/rich-text-editor/src/FormatSelectorBuilder.ts +2 −5 Go to diff View file
M plugins/tracker/templates/artifact/changeset/comment/comment.mustache +4 −1 Go to diff View file
M plugins/tracker/tests/unit/Artifact/Changeset/Comment/CommentPresenterTest.php +5 −2 Go to diff View file
M plugins/tracker/webpack.common.js +1 −1 Go to diff View file