-
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
feat: Fetch team_settings
data for Editor forms and adding Update fn
#3366
Conversation
Removed vultr server and associated DNS entries |
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.
Looking good - a lot simpler and cleaner following those naming updates 👍
There's a few outstanding issues to address, please see comments.
Also, I'd take a look at co-locating errors alongside their inputs. This will lead to a better user experience, and is required for accessibility reasons. This can be addressed here or in a follow up PR - whatever works best for you.
{ | ||
name: "General", | ||
route: "general", | ||
Component: GeneralSettings, | ||
}, |
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.
nit: I think I'd reorder this array to be General → Design → Team
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.
@DafyddLlyr do you think it is worth doing these types of changes as a final PR when error handling is all sorted?
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.
Thought about it again, and tit doesn't really make it difference, so I've added it to this PR
const isSuccess = await useStore.getState().updateTeamSettings({ | ||
helpEmail: values.helpEmail, | ||
helpOpeningHours: values.helpOpeningHours, | ||
helpPhone: values.helpPhone, |
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.
homepage
is missing here which means that changes to the URL are not persisted.
onSubmit(values, { resetForm }) { | ||
onSuccess(); | ||
resetForm({ values }); | ||
onSubmit: async (values, { resetForm }) => { |
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.
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.
I'll do the error handling in another PR, hopefully make it a lot cleaner. Current ones were just to test my understanding of formik and yup
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.
I have added basic validation now though
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.
Perfect! Looking great 😄 ✅
Agree that validation in the next PR will be the best way to go here 👍
Maybe I should move that last commit to a new PR then? @DafyddLlyr |
Sorry for not being clear, I think this should merge as-is, and we can tackle per-field validation next in a follow up PR. |
What does this PR do?
This is a cleaner branch from the work undertaken on this previous branch: #3319
Continuing work on the
team_settings
implementation, this PR pulls in data from the database with a graphQL query and populates the corresponding form inputs.This PR also uses the update mutation, similar to
team_themes
to update the form fields and database.This PR aligns with a planx-core change where the requests and types for a Team were altered to incorporate the new
team_settings
table.Reference to the planx-core changes