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

fix: detect Next.js environment and adjust the AOI preset file paths #1311

Closed
wants to merge 2 commits into from

Conversation

dzole0311
Copy link
Collaborator

Related Ticket: #1259
Related Next.js PR for testing: developmentseed/next-veda-ui#23

Description of Changes

  • Added new isNextJs() util function to detect Next.js environments
  • Adjust the AOI preset path to use the new util for setting the correct path to the assets
  • Persist backwards compatibility for legacy instances that require the /public/ path prefix
  • Removed redundant comments

Notes & Questions About Changes

{Add additonal notes and outstanding questions here related to changes in this pull request}

Validation / Testing

Please test in both repositories:

veda-ui:

  1. Using the preview deployment, check that preset AOIs load correctly when selecting different states
  2. Test locally to confirm the same functionality
  3. Optional: Check in a legacy instance (e.g. GHG Center) that AOIs still load with the /public/ prefix

In next-veda-ui:

  1. Using the preview deployment, check that preset AOIs load correctly when selecting different states
  2. Test locally to confirm the same functionality works

Copy link

netlify bot commented Dec 10, 2024

Deploy Preview for veda-ui ready!

Name Link
🔨 Latest commit f170ca1
🔍 Latest deploy log https://app.netlify.com/sites/veda-ui/deploys/67580d888ef42400086808cd
😎 Deploy Preview https://deploy-preview-1311--veda-ui.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.

Copy link
Member

@AliceR AliceR left a comment

Choose a reason for hiding this comment

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

Thanks for adding comments, and cleaning up as well! 🧹

@dzole0311
Copy link
Collaborator Author

Closing this PR since we decided to fix it by creating a /public subdirectory within the /public directory on the Next.js instance side.

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.

4 participants