stable
Clone or download
part of request #29602 Migrate pullrequest file-diffs to TypeScript This contribution aims to extract the part of the side-by-side-diff-component where we add Comment widgets depending the line on which they are (added, removed, unmoved left & unmoved right) and unit test it. I apologize for the HUGE size of the side-by-side-code-mirror-widgets-creation-manager test file, but at least we have unit test for the placeholder height recomputation mecanism for each kind of line. In the next step, I'll extract the NewCommentFormWidget insertion part. Please note that the unidiff mode HAS to keep using the widget_creator directly, there are no synchronized editors and no state. [Bonus] Since comment placeholders creation is ordered by SideBySideLinesHeightEqualizer through the post_rendering_callback of InlineCommentWidgets, we can drop side-by-side-comment-placeholder-builder \o/ How to test: -- No functional change expected in the side-by-side diff mode -- No functional change expected in the unidiff mode Change-Id: Ie0cfab4a9103471b0ffb3397275c6bf2f00edd58
Modified Files
Name | ||||
---|---|---|---|---|
M | plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-code-mirror-widget-creator.test.ts | +4 | −4 | Go to diff View file |
M | plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-code-mirror-widget-creator.ts | +32 | −25 | Go to diff View file |
A | plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-code-mirror-widgets-creation-manager.test.ts | +524 | −0 | Go to diff View file |
A | plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-code-mirror-widgets-creation-manager.ts | +119 | −0 | Go to diff View file |
M | plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-code-mirrors-content-manager.test.ts | +1 | −1 | Go to diff View file |
M | plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-code-mirrors-content-manager.ts | +4 | −0 | Go to diff View file |
M | plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-code-placeholder-builder.test.ts | +8 | −8 | Go to diff View file |
D | plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-comment-placeholder-builder.test.ts | +0 | −347 | Go to diff View file |
D | plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-comment-placeholder-builder.ts | +0 | −249 | Go to diff View file |
M | plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-diff-component.js | +21 | −108 | Go to diff View file |
M | plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-line-height-equalizer.test.ts | +2 | −2 | Go to diff View file |
M | plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-placeholder-positioner.test.ts | +3 | −3 | Go to diff View file |
M | plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/types-codemirror-overriden.ts | +8 | −0 | Go to diff View file |
M | plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/unidiff-component.js | +7 | −4 | Go to diff View file |
A | plugins/pullrequest/scripts/pullrequests-app/tests/stubs/CreateInlineCommentWidgetStub.ts | +45 | −0 | Go to diff View file |
A | plugins/pullrequest/scripts/pullrequests-app/tests/stubs/CreatePlaceholderWidgetStub.ts | +43 | −0 | Go to diff View file |
M | plugins/pullrequest/scripts/pullrequests-app/tests/stubs/FileLinesStateStub.ts | +30 | −21 | Go to diff View file |
M | plugins/pullrequest/scripts/pullrequests-app/tests/stubs/ReplyCommentFormPresenterStub.ts | +0 | −19 | Go to diff View file |