stable

Clone or download

Read-only

refactor: Extract codemirrors init from lines-state

part of request #29602 Migrate pullrequest file-diffs to TypeScript This code inits the content of the two codemirrors and it is not the state's role to do it. Moreover, it forced it to have a dependency on codemirror Editor, and it was not great. Now we have a code-mirror-content-manager doing it for us. The two methods getRightLine and getLeftLines have been moved to this object since they were only used in the side-by-side-diff-component. -- no functional change expected Change-Id: I3bf181d22d391f4249c2e84c6c38aff6f7941294

Modified Files

Name
M plugins/pullrequest/scripts/pullrequests-app/src/app/code-collapse/collapsible-code-sections-test-fixture.ts +24 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/code-collapse/collaspible-code-sections-builder.ts +1 −1 Go to diff View file
A plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-code-mirrors-content-manager.test.ts +71 −0 Go to diff View file
A plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-code-mirrors-content-manager.ts +52 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-diff-component.js +28 −17 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-lines-state.js +1 −21 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/side-by-side-lines-state.test.js +10 −34 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/types.ts +3 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/tests/stubs/FileLineStub.ts +14 −3 Go to diff View file