Fix template problems with gr-apply-fix-dialog Change-Id: I731c893937be9e2dbe28832ac6aaab117ab1db92
diff --git a/polygerrit-ui/app/BUILD b/polygerrit-ui/app/BUILD index 5f9c3c5..6eb4efe 100644 --- a/polygerrit-ui/app/BUILD +++ b/polygerrit-ui/app/BUILD
@@ -106,7 +106,6 @@ "elements/change/gr-reply-dialog/gr-reply-dialog_html.ts", "elements/change/gr-reviewer-list/gr-reviewer-list_html.ts", "elements/change/gr-thread-list/gr-thread-list_html.ts", - "elements/diff/gr-apply-fix-dialog/gr-apply-fix-dialog_html.ts", "elements/diff/gr-diff-builder/gr-diff-builder-element_html.ts", "elements/diff/gr-diff-host/gr-diff-host_html.ts", "elements/diff/gr-diff-mode-selector/gr-diff-mode-selector_html.ts",
diff --git a/polygerrit-ui/app/elements/diff/gr-apply-fix-dialog/gr-apply-fix-dialog.ts b/polygerrit-ui/app/elements/diff/gr-apply-fix-dialog/gr-apply-fix-dialog.ts index 5cd7bfc..e60c2bb 100644 --- a/polygerrit-ui/app/elements/diff/gr-apply-fix-dialog/gr-apply-fix-dialog.ts +++ b/polygerrit-ui/app/elements/diff/gr-apply-fix-dialog/gr-apply-fix-dialog.ts
@@ -97,7 +97,7 @@ '_computeDisableApplyFixButton(_isApplyFixLoading, change, ' + '_patchNum)', }) - _disableApplyFixButton?: boolean; + _disableApplyFixButton = false; layers = appContext.flagsService.isEnabled( KnownExperimentId.TOKEN_HIGHLIGHTING @@ -187,12 +187,13 @@ return (_fixSuggestions || []).length === 1; } - overridePartialPrefs(prefs: DiffPreferencesInfo): DiffPreferencesInfo { + overridePartialPrefs(prefs?: DiffPreferencesInfo) { + if (!prefs) return undefined; // generate a smaller gr-diff than fullscreen for dialog return {...prefs, line_length: 50}; } - onCancel(e: CustomEvent) { + onCancel(e: Event) { if (e) { e.stopPropagation(); } @@ -203,7 +204,7 @@ return _selectedFixIdx + 1; } - _onPrevFixClick(e: CustomEvent) { + _onPrevFixClick(e: Event) { if (e) e.stopPropagation(); if (this._selectedFixIdx >= 1 && this._fixSuggestions) { this._selectedFixIdx -= 1; @@ -213,7 +214,7 @@ } } - _onNextFixClick(e: CustomEvent) { + _onNextFixClick(e: Event) { if (e) e.stopPropagation(); if ( this._fixSuggestions && @@ -257,7 +258,7 @@ } _computeDisableApplyFixButton( - isApplyFixLoading?: boolean, + isApplyFixLoading: boolean, change?: ParsedChangeInfo, patchNum?: PatchSetNum ) { @@ -271,7 +272,7 @@ return isApplyFixLoading; } - _handleApplyFix(e: CustomEvent) { + _handleApplyFix(e: Event) { if (e) { e.stopPropagation(); }
diff --git a/polygerrit-ui/app/elements/diff/gr-diff/gr-diff.ts b/polygerrit-ui/app/elements/diff/gr-diff/gr-diff.ts index fdde355..888e514 100644 --- a/polygerrit-ui/app/elements/diff/gr-diff/gr-diff.ts +++ b/polygerrit-ui/app/elements/diff/gr-diff/gr-diff.ts
@@ -40,7 +40,12 @@ } from './gr-diff-utils'; import {getHiddenScroll} from '../../../scripts/hiddenscroll'; import {customElement, observe, property} from '@polymer/decorators'; -import {BlameInfo, CommentRange, ImageInfo} from '../../../types/common'; +import { + BlameInfo, + CommentRange, + ImageInfo, + NumericChangeId, +} from '../../../types/common'; import { DiffInfo, DiffPreferencesInfo, @@ -155,7 +160,7 @@ */ @property({type: String}) - changeNum?: string; + changeNum?: NumericChangeId; @property({type: Boolean}) noAutoRender = false;