stable

Clone or download

Read-only

refactor: Extract widgets creation from Angular

part of request #29602 Migrate pullrequest file-diffs to TypeScript This contribution aims to extract the widget creation part from the codemirror-helper-service, to migrate it to TypeScript and to have unit tests for it. Please note that the widget placement in codemirror part (the one in side-by-side-diff-component) will be extracted and unit tested in another contribution. How to test: - No functional change expected: --> The placeholders/inline comments/new comment forms are still displayed properly --> They work as usual in both diff modes Change-Id: I4fab7085b2c2d61b9277c6369fc41c6b2bba5a47

Modified Files

Name
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/codemirror-helper-service.js +2 −115 Go to diff View file
A plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/file-line-widget-placement-helper.test.ts +91 −0 Go to diff View file
A plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/file-line-widget-placement-helper.ts +57 −0 Go to diff View file
A plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-code-mirror-widget-creator.test.ts +207 −0 Go to diff View file
A plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-code-mirror-widget-creator.ts +144 −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.ts +1 −1 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-diff-component.js +69 −34 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-line-widgets-helper.ts +23 −5 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/types.ts +27 −2 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/unidiff-component.js +49 −8 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/tests/stubs/FileDiffWidgetStub.ts +20 −0 Go to diff View file
A plugins/pullrequest/scripts/pullrequests-app/tests/stubs/InlineCommentContextStub.ts +29 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/tests/stubs/SaveNewInlineCommentStub.ts +11 −2 Go to diff View file