Skip to content
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 message when project not aligned to spaceId #7587

Merged
merged 10 commits into from
May 7, 2024

Conversation

lilbitner
Copy link
Contributor

@lilbitner lilbitner commented May 6, 2024

Purpose

The purpose of this PR is to add an error message when the user selects a project that is not configured to be in the space where the current app is installed/being installed.

Approach

I added the below error message on render of the page AND when the user changes project, and the selected project contains an incompatible CONTENTFUL_SPACE_ID variable. The error lingers until the user changes to a valid project, but they are still able to install and save changes.

Screenshot 2024-05-07 at 7 07 56 AM

Testing steps

Within this space, I have created one Vercel project that is compatible with the space: nextjs-lb-4. The rest of the projects are not compatible, so you should see warnings for all other project selections.

@lilbitner lilbitner force-pushed the add-warning-when-project-in-different-space-vercel branch from 334ac4a to 555a24d Compare May 6, 2024 21:25
Copy link

netlify bot commented May 6, 2024

Deploy Preview for ecommerce-app-base-components canceled.

Name Link
🔨 Latest commit 334ac4a
🔍 Latest deploy log https://app.netlify.com/sites/ecommerce-app-base-components/deploys/66394acefddf9d00086258af

Copy link

netlify bot commented May 6, 2024

Deploy Preview for ecommerce-app-base-components ready!

Name Link
🔨 Latest commit 45f72c8
🔍 Latest deploy log https://app.netlify.com/sites/ecommerce-app-base-components/deploys/663a64e4c77f410008c188cd
😎 Deploy Preview https://deploy-preview-7587--ecommerce-app-base-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@lilbitner lilbitner force-pushed the add-warning-when-project-in-different-space-vercel branch 4 times, most recently from 1181671 to eb0dd3c Compare May 7, 2024 13:27
@lilbitner lilbitner marked this pull request as ready for review May 7, 2024 13:43
@lilbitner lilbitner requested a review from a team as a code owner May 7, 2024 13:43
Copy link
Member

@jsdalton jsdalton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, just one or two small suggestions.

A few questions about the error message:

  • Should this be a warning? I feel like we don't have enough confidence that it's wrong to show a true error.
  • Probably would be nice to show the value of that env var in the message? I guess it might help allay confusion.

@lilbitner lilbitner requested a review from matthew-gordon May 7, 2024 17:25
@lilbitner
Copy link
Contributor Author

lilbitner commented May 7, 2024

Code looks good, just one or two small suggestions.

A few questions about the error message:

  • Should this be a warning? I feel like we don't have enough confidence that it's wrong to show a true error.
  • Probably would be nice to show the value of that env var in the message? I guess it might help allay confusion.

Yeah good questions!

  1. In my opinion, we do have a solid amount of confidence that there is a mismatch of spaceIds here and that the app will not work without this being fixed (per my understanding, I could be missing something). Along with this, there really isn't precedent in our design system for a "warning" type for the Select component. It is fairly binary (valid or invalid). I could certainly create custom component to add here instead, but I do think it is breaking enough to warrant an error. Honestly might be good feedback for F36 🤔
  2. Yeah I also considered this. This adds a bit more complexity to the error handling, but I could do this as part of some follow-up work, to make it easier for the user to adjust the spaceId if they need to 👍

@lilbitner lilbitner force-pushed the add-warning-when-project-in-different-space-vercel branch from 54f9824 to 45f72c8 Compare May 7, 2024 17:29
@lilbitner lilbitner requested a review from jsdalton May 7, 2024 17:29
Copy link
Contributor

@matthew-gordon matthew-gordon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and makes sense to me 🤌 ✨

@lilbitner lilbitner merged commit 4dd4720 into master May 7, 2024
12 checks passed
@lilbitner lilbitner deleted the add-warning-when-project-in-different-space-vercel branch May 7, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants