Remove the `handleEvent` indirection in js-api-interface
I just stumbled over that and wanted to make it simpler and more
consistent will other js-api events. This also helps with making
the calls type correct any removing the TODOs about `any` type.
Release-Notes: skip
Change-Id: I8c33a7091b9a3010be09bb506385b0d81284b64c
diff --git a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.ts b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.ts
index 834f2b0..ca58dd5 100644
--- a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.ts
+++ b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.ts
@@ -33,7 +33,7 @@
HttpMethod,
NotifyType,
} from '../../../constants/constants';
-import {EventType as PluginEventType, TargetElement} from '../../../api/plugin';
+import {TargetElement} from '../../../api/plugin';
import {
AccountInfo,
ActionInfo,
@@ -108,6 +108,7 @@
import {createSearchUrl} from '../../../models/views/search';
import {createChangeUrl} from '../../../models/views/change';
import {storageServiceToken} from '../../../services/storage/gr-storage_impl';
+import {ShowRevisionActionsDetail} from '../../shared/gr-js-api-interface/gr-js-api-types';
const ERR_BRANCH_EMPTY = 'The destination branch can’t be empty.';
const ERR_COMMIT_EMPTY = 'The commit message can’t be empty.';
@@ -890,11 +891,8 @@
}
// private but used in test
- sendShowRevisionActions(detail: {
- change: ChangeInfo;
- revisionActions: ActionNameToActionInfoMap;
- }) {
- this.jsAPI.handleEvent(PluginEventType.SHOW_REVISION_ACTIONS, detail);
+ sendShowRevisionActions(detail: ShowRevisionActionsDetail) {
+ this.jsAPI.handleShowRevisionActions(detail);
}
addActionButton(type: ActionType, label: string) {