Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

feat: warn when calendar or calendar event wasn't created #2371

140 changes: 80 additions & 60 deletions client/graphql.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1691,18 +1691,6 @@
"name": "Event",
"description": null,
"fields": [
{
"name": "calendar_event_id",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "canceled",
"description": null,
Expand Down Expand Up @@ -1767,6 +1755,22 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "has_calendar_event",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "id",
"description": null,
Expand Down Expand Up @@ -2692,18 +2696,6 @@
"name": "EventWithRelationsWithEventUser",
"description": null,
"fields": [
{
"name": "calendar_event_id",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "canceled",
"description": null,
Expand Down Expand Up @@ -2808,6 +2800,22 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "has_calendar_event",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "id",
"description": null,
Expand Down Expand Up @@ -2975,18 +2983,6 @@
"name": "EventWithRelationsWithEventUserRelations",
"description": null,
"fields": [
{
"name": "calendar_event_id",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "canceled",
"description": null,
Expand Down Expand Up @@ -3091,6 +3087,22 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "has_calendar_event",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "id",
"description": null,
Expand Down Expand Up @@ -3258,18 +3270,6 @@
"name": "EventWithVenue",
"description": null,
"fields": [
{
"name": "calendar_event_id",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "canceled",
"description": null,
Expand Down Expand Up @@ -3334,6 +3334,22 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "has_calendar_event",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "id",
"description": null,
Expand Down Expand Up @@ -3477,18 +3493,6 @@
"name": "EventsWithChapters",
"description": null,
"fields": [
{
"name": "calendar_event_id",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "canceled",
"description": null,
Expand Down Expand Up @@ -3569,6 +3573,22 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "has_calendar_event",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "id",
"description": null,
Expand Down
24 changes: 15 additions & 9 deletions client/src/generated/graphql.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ export type CreateSponsorInputs = {

export type Event = {
__typename?: 'Event';
calendar_event_id?: Maybe<Scalars['String']>;
canceled: Scalars['Boolean'];
capacity: Scalars['Int'];
description: Scalars['String'];
ends_at: Scalars['DateTime'];
has_calendar_event: Scalars['Boolean'];
id: Scalars['Int'];
image_url: Scalars['String'];
invite_only: Scalars['Boolean'];
Expand Down Expand Up @@ -272,13 +272,13 @@ export type EventUserWithRolePermissions = {

export type EventWithRelationsWithEventUser = {
__typename?: 'EventWithRelationsWithEventUser';
calendar_event_id?: Maybe<Scalars['String']>;
canceled: Scalars['Boolean'];
capacity: Scalars['Int'];
chapter: Chapter;
description: Scalars['String'];
ends_at: Scalars['DateTime'];
event_users: Array<EventUserWithAttendanceAndUser>;
has_calendar_event: Scalars['Boolean'];
id: Scalars['Int'];
image_url: Scalars['String'];
invite_only: Scalars['Boolean'];
Expand All @@ -293,13 +293,13 @@ export type EventWithRelationsWithEventUser = {

export type EventWithRelationsWithEventUserRelations = {
__typename?: 'EventWithRelationsWithEventUserRelations';
calendar_event_id?: Maybe<Scalars['String']>;
canceled: Scalars['Boolean'];
capacity: Scalars['Int'];
chapter: Chapter;
description: Scalars['String'];
ends_at: Scalars['DateTime'];
event_users: Array<EventUserWithRelations>;
has_calendar_event: Scalars['Boolean'];
id: Scalars['Int'];
image_url: Scalars['String'];
invite_only: Scalars['Boolean'];
Expand All @@ -314,11 +314,11 @@ export type EventWithRelationsWithEventUserRelations = {

export type EventWithVenue = {
__typename?: 'EventWithVenue';
calendar_event_id?: Maybe<Scalars['String']>;
canceled: Scalars['Boolean'];
capacity: Scalars['Int'];
description: Scalars['String'];
ends_at: Scalars['DateTime'];
has_calendar_event: Scalars['Boolean'];
id: Scalars['Int'];
image_url: Scalars['String'];
invite_only: Scalars['Boolean'];
Expand All @@ -332,12 +332,12 @@ export type EventWithVenue = {

export type EventsWithChapters = {
__typename?: 'EventsWithChapters';
calendar_event_id?: Maybe<Scalars['String']>;
canceled: Scalars['Boolean'];
capacity: Scalars['Int'];
chapter: Chapter;
description: Scalars['String'];
ends_at: Scalars['DateTime'];
has_calendar_event: Scalars['Boolean'];
id: Scalars['Int'];
image_url: Scalars['String'];
invite_only: Scalars['Boolean'];
Expand Down Expand Up @@ -878,6 +878,7 @@ export type MeQuery = {
__typename?: 'Chapter';
id: number;
name: string;
has_calendar: boolean;
}>;
user_bans: Array<{ __typename?: 'UserBan'; chapter_id: number }>;
user_chapters: Array<{
Expand Down Expand Up @@ -1057,6 +1058,7 @@ export type CreateChapterMutation = {
region: string;
country: string;
chat_url?: string | null;
has_calendar: boolean;
};
};

Expand Down Expand Up @@ -1260,6 +1262,7 @@ export type CreateEventMutation = {
url?: string | null;
streaming_url?: string | null;
capacity: number;
has_calendar_event: boolean;
};
};

Expand Down Expand Up @@ -1292,7 +1295,7 @@ export type CreateCalendarEventMutation = {
createCalendarEvent: {
__typename?: 'Event';
id: number;
calendar_event_id?: string | null;
has_calendar_event: boolean;
};
};

Expand Down Expand Up @@ -1386,7 +1389,7 @@ export type DashboardEventQuery = {
start_at: any;
ends_at: any;
image_url: string;
calendar_event_id?: string | null;
has_calendar_event: boolean;
venue_type: VenueType;
chapter: {
__typename?: 'Chapter';
Expand Down Expand Up @@ -2048,6 +2051,7 @@ export const MeDocument = gql`
admined_chapters {
id
name
has_calendar
}
auto_subscribe
image_url
Expand Down Expand Up @@ -2634,6 +2638,7 @@ export const CreateChapterDocument = gql`
region
country
chat_url
has_calendar
}
}
`;
Expand Down Expand Up @@ -3399,6 +3404,7 @@ export const CreateEventDocument = gql`
url
streaming_url
capacity
has_calendar_event
}
}
`;
Expand Down Expand Up @@ -3509,7 +3515,7 @@ export const CreateCalendarEventDocument = gql`
mutation createCalendarEvent($eventId: Int!) {
createCalendarEvent(id: $eventId) {
id
calendar_event_id
has_calendar_event
}
}
`;
Expand Down Expand Up @@ -3893,7 +3899,7 @@ export const DashboardEventDocument = gql`
start_at
ends_at
image_url
calendar_event_id
has_calendar_event
chapter {
id
name
Expand Down
1 change: 1 addition & 0 deletions client/src/modules/auth/graphql/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const meQuery = gql`
admined_chapters {
id
name
has_calendar
}
auto_subscribe
image_url
Expand Down
1 change: 1 addition & 0 deletions client/src/modules/dashboard/Chapters/graphql/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const createChapter = gql`
region
country
chat_url
has_calendar
}
}
`;
Expand Down
2 changes: 2 additions & 0 deletions client/src/modules/dashboard/Chapters/pages/ChapterPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {
} from '../../../../util/check-permission';
import { Permission } from '../../../../../../common/permissions';
import { DeleteChapterButton } from '../components/DeleteChapterButton';
import { meQuery } from '../../../auth/graphql/queries';
import { DASHBOARD_CHAPTER } from '../graphql/queries';
import { DASHBOARD_EVENT } from '../../Events/graphql/queries';

Expand Down Expand Up @@ -86,6 +87,7 @@ export const ChapterPage: NextPageWithLayout = () => {
variables: { chapterId },
refetchQueries: [
{ query: DASHBOARD_CHAPTER, variables: { chapterId } },
{ query: meQuery },
],
});
addAlert({ title: 'Chapter calendar created', status: 'success' });
Expand Down
Loading