stable

Clone or download

Read-only

refactor: refactor PullRequestCommentPresenter

part of story #29240 reply to pull request comment What have been done: - The file have been renamed to PullRequestCommentPresenter to match the case used by every files in the /comments folder. - Interfaces regarding the presenter of the comment have been moved to PullRequestCommentPresenter to unclutter PullRequestComment.ts - We now have static methods to build the presenter from different payloads. This way, we do not have to pass a State object, unless we actually need it to build urls. - Payloads attributes has been set to readonly as they are never supposed to be mutated. - We now stictly inject in the presenter what's needed by the custom element, instead of injecting everything else contained in the payload. It will allow us to know better what we have in the presenters. Please note that the interface PullRequestInlineCommentPresenter seems unused, but it is needed to keep the app working, as the file diff needs the attributes defined in it to work. No functional change expected Change-Id: Icca93b547515f5902fd2407d036ddf43eb3204cd

Modified Files

Name
M plugins/pullrequest/scripts/pullrequests-app/src/app/comments/PullRequestComment.ts +1 −26 Go to diff View file
R plugins/pullrequest/scripts/pullrequests-app/src/app/comments/pullrequest-comment-presenter-builder.test.ts Go to diff View file
R plugins/pullrequest/scripts/pullrequests-app/src/app/comments/pullrequest-comment-presenter-builder.ts Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/codemirror-helper-service.js +2 −2 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/file-diff-component.js +3 −10 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/src/app/overview/timeline/timeline-service.js +5 −23 Go to diff View file
M plugins/pullrequest/scripts/pullrequests-app/tests/stubs/PullRequestCommentPresenterStub.ts +3 −2 Go to diff View file