4643 create a pre hook for calendar events (#4666)
* copy message pre hook * add CalendarQueryHookModule to workspace-pre-query-hook.module * use CalendarChannelVisibility enum * add calendarEvent to workspace-pre-query-hook.config * fix pre-hook * fix findOne prehook in config * rename fragments * fix import * update findOne prehook and create can-access-calendar-event.provider * replace provider with service * fix type * renaming * remove unnecessary eslint skip --------- Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
@ -1,20 +0,0 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
import { attendeeFragment } from '@/activities/calendar/queries/fragments/attendeeFragment';
|
||||
|
||||
export const calendarEventFragment = gql`
|
||||
fragment CalendarEventFragment on TimelineCalendarEvent {
|
||||
id
|
||||
title
|
||||
description
|
||||
location
|
||||
startsAt
|
||||
endsAt
|
||||
isFullDay
|
||||
visibility
|
||||
attendees {
|
||||
...AttendeeFragment
|
||||
}
|
||||
}
|
||||
${attendeeFragment}
|
||||
`;
|
||||
@ -1,7 +1,7 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const attendeeFragment = gql`
|
||||
fragment AttendeeFragment on TimelineCalendarEventAttendee {
|
||||
export const timelineCalendarEventAttendeeFragment = gql`
|
||||
fragment TimelineCalendarEventAttendeeFragment on TimelineCalendarEventAttendee {
|
||||
personId
|
||||
workspaceMemberId
|
||||
firstName
|
||||
@ -0,0 +1,20 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
import { timelineCalendarEventAttendeeFragment } from '@/activities/calendar/queries/fragments/timelineCalendarEventAttendeeFragment';
|
||||
|
||||
export const timelineCalendarEventFragment = gql`
|
||||
fragment TimelineCalendarEventFragment on TimelineCalendarEvent {
|
||||
id
|
||||
title
|
||||
description
|
||||
location
|
||||
startsAt
|
||||
endsAt
|
||||
isFullDay
|
||||
visibility
|
||||
attendees {
|
||||
...TimelineCalendarEventAttendeeFragment
|
||||
}
|
||||
}
|
||||
${timelineCalendarEventAttendeeFragment}
|
||||
`;
|
||||
@ -1,13 +1,13 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
import { calendarEventFragment } from '@/activities/calendar/queries/fragments/calendarEventFragment';
|
||||
import { timelineCalendarEventFragment } from '@/activities/calendar/queries/fragments/timelineCalendarEventFragment';
|
||||
|
||||
export const timelineCalendarEventWithTotalFragment = gql`
|
||||
fragment TimelineCalendarEventsWithTotalFragment on TimelineCalendarEventsWithTotal {
|
||||
totalNumberOfCalendarEvents
|
||||
timelineCalendarEvents {
|
||||
...CalendarEventFragment
|
||||
...TimelineCalendarEventFragment
|
||||
}
|
||||
}
|
||||
${calendarEventFragment}
|
||||
${timelineCalendarEventFragment}
|
||||
`;
|
||||
@ -1,6 +1,6 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
import { timelineCalendarEventWithTotalFragment } from '@/activities/calendar/queries/fragments/calendarEventFragmentWithTotalFragment';
|
||||
import { timelineCalendarEventWithTotalFragment } from '@/activities/calendar/queries/fragments/timelineCalendarEventWithTotalFragment';
|
||||
|
||||
export const getTimelineCalendarEventsFromCompanyId = gql`
|
||||
query GetTimelineCalendarEventsFromCompanyId(
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
import { timelineCalendarEventWithTotalFragment } from '@/activities/calendar/queries/fragments/calendarEventFragmentWithTotalFragment';
|
||||
import { timelineCalendarEventWithTotalFragment } from '@/activities/calendar/queries/fragments/timelineCalendarEventWithTotalFragment';
|
||||
|
||||
export const getTimelineCalendarEventsFromPersonId = gql`
|
||||
query GetTimelineCalendarEventsFromPersonId(
|
||||
|
||||
Reference in New Issue
Block a user