From dc0f294b804f815037f56e2c73fa622155a2a21e Mon Sep 17 00:00:00 2001 From: Paladox none Date: Sat, 30 Sep 2017 14:26:08 +0000 Subject: [PATCH] Replace Mute/Unmute by Mark as Reviewed/Unreviewed (Part 2) Adapt PolyGerrit to use Mark As Reviewed/Unreviewed instead of Mute/Unmute. Bug: Issue 7237 Change-Id: Id916b2921c0999ef36b878b60d2bda0e6571d88a --- .../gr-change-actions/gr-change-actions.js | 8 +-- .../gr-change-actions_test.html | 49 ++++++++++--------- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.js b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.js index f69e3937ac..f9e878c372 100644 --- a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.js +++ b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.js @@ -54,15 +54,15 @@ DELETE_EDIT: 'deleteEdit', IGNORE: 'ignore', MOVE: 'move', - MUTE: 'mute', PRIVATE: 'private', PRIVATE_DELETE: 'private.delete', PUBLISH_EDIT: 'publishEdit', REBASE_EDIT: 'rebaseEdit', RESTORE: 'restore', REVERT: 'revert', + REVIEWED: 'reviewed', UNIGNORE: 'unignore', - UNMUTE: 'unmute', + UNREVIEWED: 'unreviewed', WIP: 'wip', }; @@ -267,11 +267,11 @@ }, { type: ActionType.CHANGE, - key: ChangeActions.MUTE, + key: ChangeActions.REVIEWED, }, { type: ActionType.CHANGE, - key: ChangeActions.UNMUTE, + key: ChangeActions.UNREVIEWED, }, { type: ActionType.CHANGE, diff --git a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions_test.html b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions_test.html index e0991704a5..70d26bf318 100644 --- a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions_test.html +++ b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions_test.html @@ -866,22 +866,22 @@ limitations under the License. }); }); - suite('mute change', () => { + suite('reviewed change', () => { setup(done => { sandbox.stub(element, '_fireAction'); - const MuteAction = { - __key: 'mute', + const ReviewedAction = { + __key: 'reviewed', __type: 'change', __primary: false, method: 'PUT', - label: 'Mute', + label: 'Mark reviewed', title: 'Working...', enabled: true, }; element.actions = { - mute: MuteAction, + reviewed: ReviewedAction, }; element.changeNum = '2'; @@ -890,37 +890,38 @@ limitations under the License. element.reload().then(() => { flush(done); }); }); - test('make sure the mute button is not outside of the overflow menu', + test('make sure the reviewed button is not outside of the overflow menu', () => { - assert.isNotOk(element.$$('[data-action-key="mute"]')); + assert.isNotOk(element.$$('[data-action-key="reviewed"]')); }); - test('muting change', () => { - assert.isOk(element.$.moreActions.$$('span[data-id="mute-change"]')); - element.setActionOverflow('change', 'mute', false); + test('reviewing change', () => { + assert.isOk( + element.$.moreActions.$$('span[data-id="reviewed-change"]')); + element.setActionOverflow('change', 'reviewed', false); flushAsynchronousOperations(); - assert.isOk(element.$$('[data-action-key="mute"]')); + assert.isOk(element.$$('[data-action-key="reviewed"]')); assert.isNotOk( - element.$.moreActions.$$('span[data-id="mute-change"]')); + element.$.moreActions.$$('span[data-id="reviewed-change"]')); }); }); - suite('unmute change', () => { + suite('unreviewed change', () => { setup(done => { sandbox.stub(element, '_fireAction'); - const UnmuteAction = { - __key: 'unmute', + const UnreviewedAction = { + __key: 'unreviewed', __type: 'change', __primary: false, method: 'PUT', - label: 'Unmute', + label: 'Mark unreviewed', title: 'Working...', enabled: true, }; element.actions = { - unmute: UnmuteAction, + unreviewed: UnreviewedAction, }; element.changeNum = '2'; @@ -930,18 +931,18 @@ limitations under the License. }); - test('unmute button not outside of the overflow menu', () => { - assert.isNotOk(element.$$('[data-action-key="unmute"]')); + test('unreviewed button not outside of the overflow menu', () => { + assert.isNotOk(element.$$('[data-action-key="unreviewed"]')); }); - test('unmuting change', () => { + test('unreviewed change', () => { assert.isOk( - element.$.moreActions.$$('span[data-id="unmute-change"]')); - element.setActionOverflow('change', 'unmute', false); + element.$.moreActions.$$('span[data-id="unreviewed-change"]')); + element.setActionOverflow('change', 'unreviewed', false); flushAsynchronousOperations(); - assert.isOk(element.$$('[data-action-key="unmute"]')); + assert.isOk(element.$$('[data-action-key="unreviewed"]')); assert.isNotOk( - element.$.moreActions.$$('span[data-id="unmute-change"]')); + element.$.moreActions.$$('span[data-id="unreviewed-change"]')); }); });