Add Documentation for Generated Suggestion Screenshot: https://imgur.com/a/OdBUyVc Release-Notes: skip Google-Bug-Id: b/311161803 Change-Id: Id36f6ebce23fc768ae417e83474c5d0bec32d57a
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 b12ff20..5dea952 100644 --- a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts +++ b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts
@@ -77,6 +77,8 @@ import {Interaction} from '../../../constants/reporting'; import {Suggestion} from '../../../api/suggestions'; import {when} from 'lit/directives/when.js'; +import {getDocUrl} from '../../../utils/url-util'; +import {configModelToken} from '../../../models/config/config-model'; // visible for testing export const AUTO_SAVE_DEBOUNCE_DELAY_MS = 2000; @@ -235,6 +237,8 @@ @state() commentedText?: string; + @state() private docsBaseUrl = ''; + private readonly restApiService = getAppContext().restApiService; private readonly reporting = getAppContext().reportingService; @@ -247,6 +251,8 @@ private readonly getPluginLoader = resolve(this, pluginLoaderToken); + private readonly getConfigModel = resolve(this, configModelToken); + private readonly flagsService = getAppContext().flagsService; private readonly shortcuts = new ShortcutController(this); @@ -342,6 +348,11 @@ this.autoSave(); } ); + subscribe( + this, + () => this.getConfigModel().docsBaseUrl$, + docsBaseUrl => (this.docsBaseUrl = docsBaseUrl) + ); if (this.flagsService.isEnabled(KnownExperimentId.ML_SUGGESTED_EDIT)) { subscribe( this, @@ -1000,6 +1011,19 @@ () => html`${numberOfSuggestions}` )} </label> + <a + href=${getDocUrl( + this.docsBaseUrl, + 'user-suggest-edits.html#_generate_suggestion' + )} + target="_blank" + rel="noopener noreferrer" + > + <gr-icon + icon="help" + title="About Generated Suggested Edits" + ></gr-icon> + </a> </div> `; }