Merge branch 'master'
[arvados-workbench2.git] / src / store / context-menu / context-menu-actions.ts
index 89d652443cb79d950622af04f015940e377f807c..8e5eb1e795791260474d92e0fffe6e596560081d 100644 (file)
@@ -2,14 +2,15 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-// import { default as unionize, ofType, UnionOf } from "unionize";
+import { default as unionize, ofType, UnionOf } from "unionize";
+import { ContextMenuPosition, ContextMenuResource } from "./context-menu-reducer";
 
-// const actions = unionize({
-//     OPEN_CONTEXT_MENU: ofType<{position: {x: number, y: number}}>()
-// }, {
-//     tag: 'type',
-//     value: 'payload'
-// });
+export const contextMenuActions = unionize({
+    OPEN_CONTEXT_MENU: ofType<{ position: ContextMenuPosition, resource: ContextMenuResource }>(),
+    CLOSE_CONTEXT_MENU: ofType<{}>()
+}, {
+        tag: 'type',
+        value: 'payload'
+    });
 
-// export type ContextMenuAction = UnionOf<typeof actions>;
-// export default actions;
\ No newline at end of file
+export type ContextMenuAction = UnionOf<typeof contextMenuActions>;