Port drafts across patchsets
Ifeac90995 added support for porting drafts irrespective of their
resolved status.
Drafts are assumed to be relevant for the user even if they are marked
as resolved.
Screenshot: https://imgur.com/a/xdtfxhd
Change-Id: Ic50931a0cf49549f74f986ce9e385d722bebe798
diff --git a/polygerrit-ui/app/test/test-data-generators.ts b/polygerrit-ui/app/test/test-data-generators.ts
index 248e937..1d07cf3 100644
--- a/polygerrit-ui/app/test/test-data-generators.ts
+++ b/polygerrit-ui/app/test/test-data-generators.ts
@@ -60,6 +60,7 @@
AccountDetailInfo,
Requirement,
RequirementType,
+ UrlEncodedCommentId,
} from '../types/common';
import {
AccountsVisibility,
@@ -77,6 +78,7 @@
SubmitType,
TimeFormat,
RequirementStatus,
+ CommentSide,
} from '../constants/constants';
import {formatDate} from '../utils/date-util';
import {GetDiffCommentsOutput} from '../services/services/gr-rest-api/gr-rest-api';
@@ -88,6 +90,7 @@
} from '../elements/shared/gr-rest-api-interface/gr-reviewer-updates-parser';
import {CommitInfoWithRequiredCommit} from '../elements/change/gr-change-metadata/gr-change-metadata';
import {WebLinkInfo} from '../types/diff';
+import {UIComment, UIDraft} from '../utils/comment-util';
export function dateToTimestamp(date: Date): Timestamp {
const nanosecondSuffix = '.000000000';
@@ -441,3 +444,24 @@
image_url: 'gitiles.jpg',
};
}
+
+export function createComment(): UIComment {
+ return {
+ patch_set: 1 as PatchSetNum,
+ id: '12345' as UrlEncodedCommentId,
+ side: CommentSide.REVISION,
+ line: 1,
+ message: 'hello world',
+ updated: '2018-02-13 22:48:48.018000000' as Timestamp,
+ unresolved: false,
+ };
+}
+
+export function createDraft(): UIDraft {
+ return {
+ ...createComment(),
+ collapsed: false,
+ __draft: true,
+ __editing: false,
+ };
+}