diff --git a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.ts b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.ts index 6d654d8509..74a87cd403 100644 --- a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.ts +++ b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.ts @@ -367,13 +367,6 @@ export class GrChangeView extends KeyboardShortcutMixin( }) _hideEditCommitMessage?: boolean; - @property({ - type: Boolean, - computed: - '_computeHideShowAllContainer(_hideEditCommitMessage, _commitCollapsible)', - }) - _hideShowAllContainer = false; - @property({type: String}) _diffAgainst?: string; @@ -918,13 +911,6 @@ export class GrChangeView extends KeyboardShortcutMixin( return changeStatuses(change, options); } - _computeHideShowAllContainer( - _hideEditCommitMessage?: boolean, - _commitCollapsible?: boolean - ) { - return !_commitCollapsible && _hideEditCommitMessage; - } - _computeHideEditCommitMessage( loggedIn: boolean, editing: boolean, @@ -2363,6 +2349,9 @@ export class GrChangeView extends KeyboardShortcutMixin( } _computeCommitMessageCollapsed(collapsed?: boolean, collapsible?: boolean) { + if (this._isNewChangeSummaryUiEnabled) { + return false; + } return collapsible && collapsed; } @@ -2371,9 +2360,6 @@ export class GrChangeView extends KeyboardShortcutMixin( } _computeCollapseText(collapsed: boolean) { - if (this._isNewChangeSummaryUiEnabled) { - return collapsed ? 'Show all' : 'Show less'; - } // Symbols are up and down triangles. return collapsed ? '\u25bc Show more' : '\u25b2 Show less'; } diff --git a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view_html.ts b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view_html.ts index 36e73b2ed1..2be7173a4d 100644 --- a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view_html.ts +++ b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view_html.ts @@ -109,25 +109,6 @@ export const htmlTemplate = html` /* Account for border and padding and rounding errors. */ max-width: calc(72ch + 2px + 2 * var(--spacing-m) + 0.4px); } - .show-all-container { - background-color: var(--view-background-color); - display: flex; - justify-content: flex-end; - margin-bottom: 8px; - border-top-width: 1px; - border-top-style: solid; - border-radius: 0 0 4px 4px; - border-color: var(--border-color); - box-shadow: var(--elevation-level-1); - } - .show-all-container .show-all-button { - margin-right: auto; - } - .show-all-container iron-icon { - color: inherit; - --iron-icon-height: 18px; - --iron-icon-width: 18px; - } .commitMessage gr-linked-text { word-break: break-word; } @@ -139,9 +120,6 @@ export const htmlTemplate = html` .new-change-summary-true #commitMessageEditor { --collapsed-max-height: 300px; } - .new-change-summary-true gr-linked-text { - min-height: 160px; - } .editCommitMessage { margin-top: var(--spacing-l); @@ -492,9 +470,11 @@ export const htmlTemplate = html` > @@ -505,37 +485,6 @@ export const htmlTemplate = html` remove-zero-width-space="" > - - - - [[_computeCollapseText(_commitCollapsed)]] - - - Edit - - - + - - - - Save - Cancel + + + + + Save + Cancel + + + + + [[_computeCollapseText(_commitCollapsed)]] + + Edit + + Cancel + Save + + + `; diff --git a/polygerrit-ui/app/elements/shared/gr-editable-content/gr-editable-content_test.js b/polygerrit-ui/app/elements/shared/gr-editable-content/gr-editable-content_test.js index a0481ae542..b99b11952e 100644 --- a/polygerrit-ui/app/elements/shared/gr-editable-content/gr-editable-content_test.js +++ b/polygerrit-ui/app/elements/shared/gr-editable-content/gr-editable-content_test.js @@ -105,7 +105,7 @@ suite('gr-editable-content tests', () => { assert.equal(element._newContent, 'stored content'); assert.isTrue(dispatchSpy.called); - assert.equal(dispatchSpy.lastCall.args[0].type, 'show-alert'); + assert.equal(dispatchSpy.firstCall.args[0].type, 'show-alert'); }); test('editing toggled to true, has no stored data', () => { @@ -114,7 +114,7 @@ suite('gr-editable-content tests', () => { element.editing = true; assert.equal(element._newContent, 'current content'); - assert.isFalse(dispatchSpy.called); + assert.equal(dispatchSpy.firstCall.args[0].type, 'editing-changed'); }); test('edits are cached', () => {