-
Notifications
You must be signed in to change notification settings - Fork 147
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: add error handling for selected projects that do not have protection enabled #7566
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for ecommerce-app-base-components ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
b61ad2b
to
40543f4
Compare
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.
Code looks great George! Thanks for adding those awaits and for always adding clean and readable code.
In terms of functionality, when I test it out locally, I am seeing some clobbering logic within the ProjectSelectionSection
file. The two useEffects
are essentially overriding each other so the error is not persisting in the UI (as the bypass error is cleared by the validateProjectEnv
method. I think we should still follow an approach that there should only exist one error at a time for the project selection step, so perhaps we can combine the useEffects
and make the steps sequential in some way? i.e we check that the project has a valid spaceId and then if so, check the bypass token? or vise versa? Also feel free to adjust the logic in the validateProjectEnv
method, as it clears all errors if the spaceId
is valid, which may not be necessary?
ecfd196
to
fb5fd79
Compare
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.
Just leaving one comment, curious your thoughts!! (more a UX thing). Awesome work!
@@ -158,6 +153,7 @@ const ConfigScreen = () => { | |||
renderPostAuthComponents && | |||
!errors.projectSelection.projectNotFound && | |||
!errors.projectSelection.cannotFetchProjects && | |||
!errors.projectSelection.protectionBypassIsDisabled && |
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 think it might be fine to follow the pattern here that we still render the next section even if this error exists, because it is simply a setting they have to change. Just like we allow them to continue to select the next section if the projectSelection.invalidSpaceId
is true (which is a setting they need to change). Or perhaps we choose one line of logic or the other! wdyt? See video below for more context (on the weird standard we have for one but not the other). We kind of already have a pattern where things will NOT work with certain configurations but we still allow them to save most of the changes (i.e in the content type/preview path section we allow them to save empty fields even though that clearly won't work).
Screen.Recording.2024-05-16.at.12.53.17.PM.mov
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.
Sounds good with me!
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.
perhaps we remove this line from the conditional then?
1fae85b
to
5e9f0f8
Compare
…ction bypass enabled
da29ca6
to
9d00166
Compare
Purpose
When a user selects a project, that project may not be setup correctly to be displayed in our Preview. We require the project to have protection bypass enabled.
Approach
Testing steps