Move generating of diff URLs into diff.ts Release-Notes: skip Google-Bug-Id: b/244279450 Change-Id: I883d8027172597b389606c993f4d401c3ed54783
diff --git a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts index 278bc86..b884941 100644 --- a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts +++ b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts
@@ -20,7 +20,6 @@ import {css, html, LitElement, nothing, PropertyValues} from 'lit'; import {customElement, property, query, state} from 'lit/decorators.js'; import {resolve} from '../../../models/dependency'; -import {GerritNav} from '../../core/gr-navigation/gr-navigation'; import {GrTextarea} from '../gr-textarea/gr-textarea'; import {GrOverlay} from '../gr-overlay/gr-overlay'; import { @@ -66,6 +65,7 @@ import {Interaction} from '../../../constants/reporting'; import {KnownExperimentId} from '../../../services/flags/flags'; import {isBase64FileContent} from '../../../api/rest-api'; +import {createDiffUrl} from '../../../models/views/diff'; const UNSAVED_MESSAGE = 'Unable to save draft'; @@ -947,11 +947,11 @@ const comment = this.comment; if (!comment || !this.changeNum || !this.repoName) return ''; if (!comment.id) throw new Error('comment must have an id'); - return GerritNav.getUrlForComment( - this.changeNum, - this.repoName, - comment.id - ); + return createDiffUrl({ + changeNum: this.changeNum, + project: this.repoName, + commentId: comment.id, + }); } private firstWillUpdateDone = false;