gr-change-actions: Remove redundant code
Both Work-In-Progress and Delete actions are per definition change
actions, as there is no currently (and no planned) support for
removing gerrit revisions or marking a revision as WIP.
Change-Id: I37e0362a04acba59e87740f6544e2d0b1639396e
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 98f9707..1004092 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
@@ -744,7 +744,7 @@
} else if (!values.includes(a)) {
return;
}
- actions[a].label = this._getActionLabel(actions[a], type);
+ actions[a].label = this._getActionLabel(actions[a]);
// Triggers a re-render by ensuring object inequality.
result.push(Object.assign({}, actions[a]));
@@ -774,12 +774,12 @@
* Given a change action, return a display label that uses the appropriate
* casing or includes explanatory details.
*/
- _getActionLabel(action, type) {
- if (action.label === 'Delete' && type === ActionType.CHANGE) {
+ _getActionLabel(action) {
+ if (action.label === 'Delete') {
// This label is common within change and revision actions. Make it more
// explicit to the user.
return 'Delete change';
- } else if (action.label === 'WIP' && type === ActionType.CHANGE) {
+ } else if (action.label === 'WIP') {
return 'Mark as work in progress';
}
// Otherwise, just map the anme to sentence case.