stable

Clone or download

Read-only

Submit new comments

part of story #31091 Add the hybrid comment to manage comments Note to reviewer: I apologize for the huge size of this contribution. I had to see if it was really possible to have a single component to handle the creation of file-diff comments and global comments. Turned out that, yes, it was! The good stuff is that when we'll work on the markdown feature, we will not have to do crazy stuff in the angular app. Moreover, we would have to homogenize the design between the two apps for this feature one day or another, and I truely believe that it is better not to have duplicated implementations here and there. How to test: - Pick up a pull-request with no comments --> The empty state is displayed, it is nicely proportioned --> The new comment component is displayed at the bottom of the section - Write a comment and submit --> The comment is added to the section --> The content of the component is cleared --> The empty state is no more displayed --> The component is displayed right after the newly created comment (as per UXD's instructions) - Throw a RestException in PullRequestsResource::1143 - Submit a new comment --> The error modal opens - Go to the [Changes] tab --> No functional changes expected, you should still be able to submit inline comments as before. Change-Id: Idc73c3cea5b8cf3287b975f29baea747ff92f0a2

Modified Files

Name
M plugins/pullrequest/scripts/lib/pullrequest-comments/po/fr_FR.po +3 −0 Go to diff View file
M plugins/pullrequest/scripts/lib/pullrequest-comments/src/comment/PullRequestCommentController.test.ts +11 −8 Go to diff View file
M plugins/pullrequest/scripts/lib/pullrequest-comments/src/comment/PullRequestCommentController.ts +2 −2 Go to diff View file
M plugins/pullrequest/scripts/lib/pullrequest-comments/src/comment/PullRequestCommentReplySaver.ts +2 −2 Go to diff View file
M plugins/pullrequest/scripts/lib/pullrequest-comments/src/main.ts +11 −0 Go to diff View file
R plugins/pullrequest/scripts/pullrequests-app/src/app/comments/new-comment-form/NewInlineCommentForm.test.ts Go to diff View file
A plugins/pullrequest/scripts/lib/pullrequest-comments/src/new-comment-form/NewCommentForm.ts +187 −0 Go to diff View file
A plugins/pullrequest/scripts/lib/pullrequest-comments/src/new-comment-form/NewCommentSaver.test.ts +127 −0 Go to diff View file
A plugins/pullrequest/scripts/lib/pullrequest-comments/src/new-comment-form/NewCommentSaver.ts +95 −0 Go to diff View file
M plugins/pullrequest/scripts/lib/pullrequest-comments/tests/stubs/SaveNewCommentStub.ts +8 −19 Go to diff View file
A plugins/pullrequest/scripts/lib/pullrequest-comments/tests/stubs/SaveNewReplyToCommentStub.ts +57 −0 Go to diff View file
A plugins/pullrequest/scripts/lib/pullrequest-comments/themes/includes/_new-comment.scss +28 −0 Go to diff View file
M plugins/pullrequest/scripts/lib/pullrequest-comments/themes/style.scss +1 −0 Go to diff View file
M plugins/pullrequest/scripts/lib/rest-api-types/src/main.ts +1 −0 Go to diff View file
R plugins/pullrequest/scripts/pullrequests-app/src/app/comments/types.ts Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/OverviewApp.vue +15 −1 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/OverviewPane.vue +9 −1 Go to diff View file
A plugins/pullrequest/scripts/pullrequest-overview/src/components/Threads/OverviewNewCommentForm.test.ts +66 −0 Go to diff View file
A plugins/pullrequest/scripts/pullrequest-overview/src/components/Threads/OverviewNewCommentForm.vue +72 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/Threads/OverviewThreads.vue +28 −10 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/Threads/OverviewThreadsEmptyState.vue +1 −1 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/constants.ts +4 −0 Go to diff View file
R plugins/pullrequest/scripts/pullrequests-app/src/app/comments/new-comment-form/NewInlineCommentContext.ts Go to diff View file
D plugins/pullrequest/scripts/pullrequests-app/src/app/comments/new-comment-form/NewInlineCommentForm.ts +0 −159 Go to diff View file
D plugins/pullrequest/scripts/pullrequests-app/src/app/comments/new-comment-form/NewInlineCommentSaver.test.ts +0 −43 Go to diff View file
D plugins/pullrequest/scripts/pullrequests-app/src/app/comments/new-comment-form/NewInlineCommentSaver.ts +0 −43 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-diff-component.js +4 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/unidiff-component.js +6 −3 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/types-codemirror-overriden.ts +20 −15 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/types.ts +8 −4 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/widgets/SideBySideCodeMirrorWidgetCreator.test.ts +37 −6 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/widgets/SideBySideCodeMirrorWidgetCreator.ts +37 −7 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/widgets/SideBySideCodeMirrorWidgetsCreationManager.test.ts +27 −5 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/widgets/SideBySideCodeMirrorWidgetsCreationManager.ts +9 −3 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/widgets/side-by-side-line-widgets-helper.ts +5 −3 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/gettext-catalog.ts +0 −3 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/tests/stubs/FileDiffWidgetStub.ts +7 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/tests/stubs/InlineCommentContextStub.ts +1 −2 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/tests/stubs/SaveNewInlineCommentStub.ts +3 −19 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/themes/includes/_file-diff.scss +5 −49 Go to diff View file