stable

Clone or download

Read-only

refactor: Migrate side-by-side-line-mapper to TypeScript

part of request #29602 Migrate pullrequest file-diffs to TypeScript In this refactoring, I also introduce a file-line-helper which provides type guards function to tell whether a line is unmoved, added or removed, so we can make sure the line we are processing has the right type while DRYing some code. note: We may need a stub for LineHandles, but it is too early to introduce it in unit tests. For now I'l keep things as they are. -- No functionnal change expected Change-Id: I733ce5a1d1a3f4f490acc2803f7d28fd27a2c77f

Modified Files

Name
M plugins/pullrequest/scripts/pullrequests-app/src/app/code-collapse/collaspible-code-sections-builder.ts +1 −4 Go to diff View file
A plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/file-line-helper.test.ts +59 −0 Go to diff View file
A plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/file-line-helper.ts +32 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-comment-placeholder-builder.js +2 −5 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-diff-component.js +6 −7 Go to diff View file
D plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-line-mapper.js +0 −81 Go to diff View file
R plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-line-mapper.test.js Go to diff View file
A plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-line-mapper.ts +94 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-lines-state.js +4 −8 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-lines-state.test.js +61 −61 Go to diff View file
A plugins/pullrequest/scripts/pullrequests-app/tests/stubs/MapSideBySideLinesStub.ts +46 −0 Go to diff View file