-
Notifications
You must be signed in to change notification settings - Fork 2
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
tidy: release add Team Editor feature #3580
Conversation
…s/AddNewEditorModal.tsx Co-authored-by: Dafydd Llŷr Pearson <[email protected]>
Removed vultr server and associated DNS entries |
setShowSuccessToast, | ||
setShowErrorToast, |
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.
This is the sort of thing I hope to get rid of with a useToast
hook in another PR 😁
if (err.message === "Unable to create user") { | ||
setShowErrorToast(true); | ||
} |
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.
Not sure if we'll ever reach this due to the error handling already in src/lib/graphql.ts
but hopefully a good fallback
const handleCloseErrorToast = ( | ||
_event?: React.SyntheticEvent | Event, | ||
reason?: string, | ||
) => { | ||
if (reason === "clickaway") { | ||
return; | ||
} | ||
|
||
setShowErrorToast(false); |
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.
Leaving this as duplicated for now and will revisit with a useToast hook 🤞
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.
Great! All looks good, just the small issue highlighted by @jessicamcinchak on Slack but then I think that's it 🙌
@@ -11,7 +15,7 @@ export const createAndAddUserToTeam = async ( | |||
teamSlug: string, | |||
) => { | |||
// NB: the user is hard-coded with the 'teamEditor' role for now | |||
const response = (await client.mutate({ | |||
const response: CreateAndAddUserResponse = await client.mutate({ |
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.
FYI: client.mutate
also accepts a generic which will automatically wrap the provided type with FetchResult
, e.g. client.mutate<MyType>
Ticket: https://trello.com/c/piMcGsJa/2973-add-user-in-editor
✅ Done