Skip to content

Commit a379b0b

Browse files
merge
2 parents d222732 + f07b169 commit a379b0b

File tree

77 files changed

+2379
-1323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+2379
-1323
lines changed

packages/app/src/app/components/CreateNewSandbox/queries.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,15 @@ export const LIST_BOOKMARKED_TEMPLATES_QUERY = gql`
130130
`;
131131

132132
export const MAKE_SANDBOXES_TEMPLATE_MUTATION = gql`
133-
mutation MakeSandboxesTemplate($sandboxIds: [ID]!) {
133+
mutation MakeSandboxesTemplate($sandboxIds: [ID!]!) {
134134
makeSandboxesTemplates(sandboxIds: $sandboxIds) {
135135
id
136136
}
137137
}
138138
`;
139139

140140
export const UNMAKE_SANDBOXES_TEMPLATE_MUTATION = gql`
141-
mutation UnmakeSandboxesTemplate($sandboxIds: [ID]!) {
141+
mutation UnmakeSandboxesTemplate($sandboxIds: [ID!]!) {
142142
unmakeSandboxesTemplates(sandboxIds: $sandboxIds) {
143143
id
144144
}

packages/app/src/app/constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const DIALOG_TRANSITION_DURATION = 0.25;
2+
export const DIALOG_WIDTH = 420;
3+
export const REPLY_TRANSITION_DELAY = 0.5;

packages/app/src/app/graphql/schema.graphql

Lines changed: 109 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# source: https://codesandbox.stream/api/graphql
2-
# timestamp: Mon Mar 23 2020 21:19:15 GMT+0100 (Central European Standard Time)
1+
# source: http://server:4000/api/graphql
2+
# timestamp: Fri Apr 03 2020 11:58:51 GMT+0000 (Coordinated Universal Time)
33

44
schema {
55
query: RootQuery
@@ -54,8 +54,8 @@ type Collaborator {
5454

5555
type Collection {
5656
id: ID
57-
path: String
58-
sandboxes: [Sandbox]
57+
path: String!
58+
sandboxes: [Sandbox!]!
5959
team: Team
6060
teamId: ID
6161
user: User
@@ -69,29 +69,31 @@ type Comment {
6969
content: String
7070
id: ID!
7171
insertedAt: NaiveDateTime!
72+
isRead: Boolean!
7273
isResolved: Boolean!
7374
parentComment: Comment
7475
references: [Reference!]!
76+
replyCount: Int!
7577
sandbox: Sandbox!
7678
updatedAt: NaiveDateTime!
7779
user: User!
7880
}
7981

8082
type CurrentUser {
81-
bookmarkedTemplates: [Template]
83+
bookmarkedTemplates: [Template!]!
8284
collection(path: String!, teamId: ID): Collection
83-
collections(teamId: ID): [Collection]
84-
email: String
85+
collections(teamId: ID): [Collection!]!
86+
email: String!
8587
firstName: String
86-
id: ID
88+
id: ID!
8789
lastName: String
8890
notifications(limit: Int, orderBy: OrderBy): [Notification]
89-
recentlyUsedTemplates: [Template]
90-
sandboxes(limit: Int, orderBy: OrderBy, showDeleted: Boolean): [Sandbox]
91+
recentlyUsedTemplates: [Template!]!
92+
sandboxes(limit: Int, orderBy: OrderBy, showDeleted: Boolean): [Sandbox!]!
9193
team(id: ID!): Team
92-
teams: [Team]
93-
templates(showAll: Boolean, teamId: ID): [Template]
94-
username: String
94+
teams: [Team!]!
95+
templates(showAll: Boolean, teamId: ID): [Template!]!
96+
username: String!
9597
}
9698

9799
"""
@@ -159,7 +161,25 @@ The metadata of a reference
159161
union ReferenceMetadata = CodeReferenceMetadata
160162

161163
type RootMutation {
162-
redeemSandboxInvitation(invitationToken: String!, sandboxId: ID!): Invitation!
164+
"""
165+
Leave a team
166+
"""
167+
leaveTeam(teamId: ID!): String
168+
169+
"""
170+
Clear notification unread count
171+
"""
172+
clearNotificationCount: User
173+
174+
"""
175+
Remove a collaborator
176+
"""
177+
removeCollaborator(sandboxId: ID!, username: String!): Collaborator!
178+
createSandboxInvitation(
179+
authorization: Authorization!
180+
email: String!
181+
sandboxId: ID!
182+
): Invitation!
163183

164184
"""
165185
Add sandboxes to a collection
@@ -168,27 +188,34 @@ type RootMutation {
168188
collectionPath: String!
169189
sandboxIds: [ID]!
170190
teamId: ID
171-
): Collection
191+
): Collection!
192+
renameSandbox(id: ID!, title: String!): Sandbox!
172193

173194
"""
174-
Clear notification unread count
195+
Revoke an invitation to a team
175196
"""
176-
clearNotificationCount: User
177-
revokeSandboxInvitation(invitationId: ID!, sandboxId: ID!): Invitation!
197+
revokeTeamInvitation(teamId: ID!, userId: ID!): Team
198+
unresolveComment(commentId: ID!, sandboxId: ID!): Comment!
199+
200+
"""
201+
Soft delete a comment. Note: all child comments will also be deleted.
202+
"""
203+
deleteComment(commentId: ID!, sandboxId: ID!): Comment!
178204

179205
"""
180206
bookmark a template
181207
"""
182208
bookmarkTemplate(teamId: ID, templateId: ID!): Template
183209

184210
"""
185-
Change authorization of a collaborator
211+
Set the description of the team
186212
"""
187-
changeCollaboratorAuthorization(
188-
authorization: Authorization!
189-
sandboxId: ID!
190-
username: String!
191-
): Collaborator!
213+
setTeamDescription(description: String!, teamId: ID!): Team
214+
215+
"""
216+
Accept an invitation to a team
217+
"""
218+
acceptTeamInvitation(teamId: ID!): Team
192219

193220
"""
194221
Rename a collection and all subfolders
@@ -198,121 +225,97 @@ type RootMutation {
198225
newTeamId: ID
199226
path: String!
200227
teamId: ID
201-
): [Collection]
202-
203-
"""
204-
Create a team
205-
"""
206-
createTeam(name: String!): Team
228+
): [Collection!]!
207229

208230
"""
209-
Remove someone from a team
231+
Reject an invitation to a team
210232
"""
211-
removeFromTeam(teamId: ID!, userId: ID!): Team
233+
rejectTeamInvitation(teamId: ID!): String
212234

213235
"""
214-
Accept an invitation to a team
236+
Create a collection
215237
"""
216-
acceptTeamInvitation(teamId: ID!): Team
238+
createCollection(path: String!, teamId: ID): Collection!
239+
updateComment(commentId: ID!, content: String, sandboxId: ID!): Comment!
217240

218241
"""
219-
Delete a comment. Note: all child comments will also be deleted.
242+
Make templates from sandboxes
220243
"""
221-
deleteComment(commentId: ID!, sandboxId: ID!): Comment!
244+
makeSandboxesTemplates(sandboxIds: [ID!]!): [Template!]!
222245

223246
"""
224-
Remove a collaborator
247+
Remove someone from a team
225248
"""
226-
removeCollaborator(sandboxId: ID!, username: String!): Collaborator!
227-
changeSandboxInvitationAuthorization(
228-
authorization: Authorization!
229-
invitationId: ID!
230-
sandboxId: ID!
231-
): Invitation!
232-
createSandboxInvitation(
233-
authorization: Authorization!
234-
email: String!
235-
sandboxId: ID!
236-
): Invitation!
237-
setSandboxesPrivacy(privacy: Int, sandboxIds: [ID]!): [Sandbox]
238-
createCodeComment(
239-
codeReference: CodeReference!
240-
content: String!
241-
sandboxId: ID!
242-
): Comment!
243-
createComment(content: String!, parentCommentId: ID, sandboxId: ID!): Comment!
249+
removeFromTeam(teamId: ID!, userId: ID!): Team
244250

245251
"""
246252
Unbookmark a template
247253
"""
248254
unbookmarkTemplate(teamId: ID, templateId: ID!): Template
255+
resolveComment(commentId: ID!, sandboxId: ID!): Comment!
249256

250257
"""
251-
Add a collaborator
258+
Change authorization of a collaborator
252259
"""
253-
addCollaborator(
260+
changeCollaboratorAuthorization(
254261
authorization: Authorization!
255262
sandboxId: ID!
256263
username: String!
257264
): Collaborator!
258-
permanentlyDeleteSandboxes(sandboxIds: [ID]!): [Sandbox]
265+
revokeSandboxInvitation(invitationId: ID!, sandboxId: ID!): Invitation!
259266

260267
"""
261-
Reject an invitation to a team
268+
Mark all notifications as read
262269
"""
263-
rejectTeamInvitation(teamId: ID!): String
270+
markAllNotificationsAsRead: User
264271

265272
"""
266-
Convert templates back to sandboxes
273+
Delete a collection and all subfolders
267274
"""
268-
unmakeSandboxesTemplates(sandboxIds: [ID]!): [Template]
269-
updateComment(
270-
commentId: ID!
271-
content: String
272-
isResolved: Boolean
275+
deleteCollection(path: String!, teamId: ID): [Collection!]!
276+
redeemSandboxInvitation(invitationToken: String!, sandboxId: ID!): Invitation!
277+
278+
"""
279+
Add a collaborator
280+
"""
281+
addCollaborator(
282+
authorization: Authorization!
273283
sandboxId: ID!
274-
): Comment!
284+
username: String!
285+
): Collaborator!
275286

276287
"""
277-
Make templates from sandboxes
288+
Create a team
278289
"""
279-
makeSandboxesTemplates(sandboxIds: [ID]!): [Template]
290+
createTeam(name: String!): Team
280291

281292
"""
282293
Invite someone to a team
283294
"""
284295
inviteToTeam(teamId: ID!, username: String): Team
296+
setSandboxesPrivacy(privacy: Int, sandboxIds: [ID!]!): [Sandbox!]!
285297

286298
"""
287-
Leave a team
299+
Convert templates back to sandboxes
288300
"""
289-
leaveTeam(teamId: ID!): String
301+
unmakeSandboxesTemplates(sandboxIds: [ID!]!): [Template!]!
290302

291303
"""
292304
Delete sandboxes
293305
"""
294-
deleteSandboxes(sandboxIds: [ID]!): [Sandbox]
295-
296-
"""
297-
Revoke an invitation to a team
298-
"""
299-
revokeTeamInvitation(teamId: ID!, userId: ID!): Team
300-
301-
"""
302-
Set the description of the team
303-
"""
304-
setTeamDescription(description: String!, teamId: ID!): Team
305-
306-
"""
307-
Create a collection
308-
"""
309-
createCollection(path: String!, teamId: ID): Collection
310-
renameSandbox(id: ID!, title: String!): Sandbox
311-
312-
"""
313-
Delete a collection and all subfolders
314-
"""
315-
deleteCollection(path: String!, teamId: ID): [Collection]
306+
deleteSandboxes(sandboxIds: [ID!]!): [Sandbox!]!
307+
changeSandboxInvitationAuthorization(
308+
authorization: Authorization!
309+
invitationId: ID!
310+
sandboxId: ID!
311+
): Invitation!
312+
permanentlyDeleteSandboxes(sandboxIds: [ID!]!): [Sandbox!]!
313+
createComment(
314+
codeReference: CodeReference
315+
content: String!
316+
parentCommentId: ID
317+
sandboxId: ID!
318+
): Comment!
316319
}
317320

318321
type RootQuery {
@@ -331,6 +334,9 @@ type RootSubscriptionType {
331334
collaboratorAdded(sandboxId: ID!): Collaborator!
332335
collaboratorChanged(sandboxId: ID!): Collaborator!
333336
collaboratorRemoved(sandboxId: ID!): Collaborator!
337+
commentAdded(sandboxId: ID!): Comment!
338+
commentChanged(sandboxId: ID!): Comment!
339+
commentRemoved(sandboxId: ID!): Comment!
334340
invitationChanged(sandboxId: ID!): Invitation!
335341
invitationCreated(sandboxId: ID!): Invitation!
336342
invitationRemoved(sandboxId: ID!): Invitation!
@@ -365,7 +371,7 @@ type Sandbox {
365371
invitations: [Invitation!]!
366372
privacy: Int!
367373
removedAt: String
368-
screenshotOutdated: Boolean
374+
screenshotOutdated: Boolean!
369375
screenshotUrl: String
370376
source: Source!
371377
title: String
@@ -378,14 +384,14 @@ type Source {
378384
}
379385

380386
type Team {
381-
bookmarkedTemplates: [Template]
382-
collections: [Collection]
387+
bookmarkedTemplates: [Template!]!
388+
collections: [Collection!]!
383389
creatorId: ID
384390
description: String
385-
id: ID
386-
invitees: [User]
387-
name: String
388-
templates: [Template]
391+
id: ID!
392+
invitees: [User!]!
393+
name: String!
394+
templates: [Template!]!
389395
users: [User!]!
390396
}
391397

@@ -409,10 +415,10 @@ type Template {
409415
A CodeSandbox User
410416
"""
411417
type User {
412-
avatarUrl: String
418+
avatarUrl: String!
413419
firstName: String
414-
id: ID
420+
id: ID!
415421
lastName: String
416422
name: String
417-
username: String
423+
username: String!
418424
}

0 commit comments

Comments
 (0)