@@ -132,16 +132,14 @@ import AssigneeBar from '../utils/AssigneeBar.vue';
132132import EntityImage from ' ../utils/EntityImage.vue' ;
133133
134134import { HawkEvent , HawkEventBacktraceFrame } from ' @/types/events' ;
135- import { REMOVE_EVENT , TOGGLE_EVENT_MARK } from ' @/store/modules/events/actionTypes' ;
135+ import { TOGGLE_EVENT_MARK } from ' @/store/modules/events/actionTypes' ;
136136import { Project } from ' @/types/project' ;
137137import { Workspace } from ' @/types/workspaces' ;
138138import { projectBadges } from ' ../../mixins/projectBadges' ;
139139import ProjectBadge from ' ../project/ProjectBadge.vue' ;
140140import { JavaScriptAddons } from ' @hawk.so/types' ;
141- import { ContextMenuItem , usePopover } from ' @codexteam/ui/vue' ;
141+ import { usePopover } from ' @codexteam/ui/vue' ;
142142import EventActionsMenu from ' ./EventActionsMenu.vue' ;
143- import { ActionType } from ' ../utils/ConfirmationWindow/types' ;
144- import notifier from ' codex-notifier' ;
145143import Icon from ' ../utils/Icon.vue' ;
146144
147145export default defineComponent ({
@@ -167,7 +165,6 @@ export default defineComponent({
167165 validator : prop => typeof prop === ' object' || prop === null ,
168166 },
169167 },
170- emits: [' event-deleted' ],
171168 setup() {
172169 const { showPopover, hide } = usePopover ();
173170
@@ -333,23 +330,6 @@ export default defineComponent({
333330 }
334331 },
335332
336- /**
337- * Build "more options" context menu items
338- */
339- eventActionsMenuItems(): ContextMenuItem [] {
340- return [
341- {
342- type: ' default' ,
343- title: this .$t (' event.remove' ) as string ,
344- icon: ' Trash' ,
345- onActivate : () => {
346- this .hidePopover ();
347- this .confirmRemoveEvent ();
348- },
349- },
350- ];
351- },
352-
353333 /**
354334 * Open the "more options" context menu near the 3-dot button
355335 *
@@ -365,7 +345,9 @@ export default defineComponent({
365345 with: {
366346 component: EventActionsMenu ,
367347 props: {
368- items: this .eventActionsMenuItems (),
348+ projectId: this .projectId ,
349+ eventId: this .$route .params .eventId ,
350+ onClose : () => this .hidePopover (),
369351 },
370352 },
371353 align: {
@@ -374,42 +356,6 @@ export default defineComponent({
374356 },
375357 });
376358 },
377-
378- /**
379- * Show confirmation dialog and, on confirm, delete the event then navigate back
380- */
381- confirmRemoveEvent() {
382- const { projectId, eventId } = this .$route .params ;
383-
384- this .$confirm .open ({
385- description: this .$t (' event.removeConfirmation' ).toString (),
386- actionType: ActionType .DELETION ,
387- continueButtonText: this .$t (' event.removeButton' ).toString (),
388- onConfirm : async () => {
389- const isRemoved = await this .$store .dispatch (REMOVE_EVENT , {
390- projectId ,
391- eventId ,
392- });
393-
394- if (isRemoved ) {
395- notifier .show ({
396- message: this .$t (' event.removeSuccess' ).toString (),
397- style: ' success' ,
398- time: 5000 ,
399- });
400- this .$emit (' event-deleted' );
401-
402- return ;
403- }
404-
405- notifier .show ({
406- message: this .$t (' event.removeError' ).toString (),
407- style: ' error' ,
408- time: 5000 ,
409- });
410- },
411- });
412- },
413359 },
414360});
415361 </script >
0 commit comments