-
Notifications
You must be signed in to change notification settings - Fork 1
feat: int api remove event #846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| <template> | ||
| <ContextMenu | ||
| class="event-actions-menu" | ||
| :items="items" | ||
| /> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import { ContextMenu, type ContextMenuItem } from '@codexteam/ui/vue'; | ||
|
|
||
| /** | ||
| * Event actions menu props | ||
| */ | ||
| interface Props { | ||
| /** | ||
| * List of action items to show in the menu | ||
| */ | ||
| items: ContextMenuItem[]; | ||
| } | ||
|
|
||
| defineProps<Props>(); | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| .event-actions-menu { | ||
| min-width: 140px; | ||
| } | ||
| </style> | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,12 +1,20 @@ | ||||||||||||||||||||||||||||||||||
| <template> | ||||||||||||||||||||||||||||||||||
| <div class="event-header"> | ||||||||||||||||||||||||||||||||||
| <div class="event-layout__container"> | ||||||||||||||||||||||||||||||||||
| <span | ||||||||||||||||||||||||||||||||||
| v-if="!loading" | ||||||||||||||||||||||||||||||||||
| class="event-header__date" | ||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||
| {{ formattedFullDate }} | ||||||||||||||||||||||||||||||||||
| </span> | ||||||||||||||||||||||||||||||||||
| <div class="event-header__top-right"> | ||||||||||||||||||||||||||||||||||
| <span | ||||||||||||||||||||||||||||||||||
| v-if="!loading" | ||||||||||||||||||||||||||||||||||
| class="event-header__date" | ||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||
| {{ formattedFullDate }} | ||||||||||||||||||||||||||||||||||
| </span> | ||||||||||||||||||||||||||||||||||
| <Icon | ||||||||||||||||||||||||||||||||||
| v-if="isAdmin" | ||||||||||||||||||||||||||||||||||
| class="event-header__button--more" | ||||||||||||||||||||||||||||||||||
| symbol="dots" | ||||||||||||||||||||||||||||||||||
| @click="onMoreClick($event)" | ||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+11
to
+16
|
||||||||||||||||||||||||||||||||||
| <Icon | |
| class="event-header__button--more" | |
| symbol="dots" | |
| @click="onMoreClick($event)" | |
| /> | |
| <button | |
| type="button" | |
| class="event-header__button--more" | |
| aria-label="More actions" | |
| @click="onMoreClick($event)" | |
| > | |
| <Icon | |
| symbol="dots" | |
| aria-hidden="true" | |
| /> | |
| </button> |
Copilot
AI
Mar 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onMoreClick anchors the popover to event.currentTarget from an SVG click, then force-casts it to HTMLElement. This is brittle (and currently anchors to the SVG, not the full button). If you move the click handler to the wrapper element, you can pass a real HTML element to the popover without unsafe casting.
Copilot
AI
Mar 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The deletion flow treats any resolved dispatch as success, but eventsApi.removeEvent() uses api.callOld(), which does not throw on GraphQL errors and may return false/null while still resolving. Please check the boolean result from dispatch(REMOVE_EVENT, ...) and show the error notifier (and avoid emitting event-deleted) when the result is falsy (or switch this API call to api.call() and handle response.errors).
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
| <EventHeader | ||
| v-if="event || loading" | ||
| :event="event" | ||
| @event-deleted="onEventDeleted" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this event is redundant, you can handle it inside
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @neSpecc if i remove this handling, the events list won’t refresh after deleting an event. |
||
| /> | ||
| <div class="event-layout__info"> | ||
| <div class="event-layout__container"> | ||
|
|
@@ -45,6 +46,7 @@ export default defineComponent({ | |
| PopupDialog, | ||
| EventHeader, | ||
| }, | ||
| emits: ['event-deleted'], | ||
| data() { | ||
| return { | ||
| /** | ||
|
|
@@ -125,6 +127,18 @@ export default defineComponent({ | |
| }); | ||
| } | ||
| }, | ||
|
|
||
| /** | ||
| * Called when EventHeader signals that the event was deleted. | ||
| * and navigates back to the project overview to close the modal. | ||
| */ | ||
| onEventDeleted() { | ||
| this.$emit('event-deleted'); | ||
| this.$router.push({ | ||
| name: 'project-overview', | ||
| params: { projectId: this.projectId }, | ||
| }); | ||
| }, | ||
| }, | ||
| }); | ||
| </script> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please, use nesting