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

Netlify cms #224

Closed
wants to merge 24 commits into from
Closed

Netlify cms #224

wants to merge 24 commits into from

Conversation

hanbyul-here
Copy link
Collaborator

@hanbyul-here hanbyul-here commented Aug 2, 2022

related to: NASA-IMPACT/veda-config#87
cms ui is deployed to: https://deploy-preview-224--veda-ui.netlify.app/admin/index.html

The page should show up login window like this:
Screen Shot 2022-08-03 at 4 25 39 PM

After registration, the page will show the dashboard like below. A user can access to netlify cms editor by clicking 'new dataset' button.

Screen Shot 2022-08-03 at 4 28 00 PM

This is how the editor looks like. We can pre-embed options that a user can choose through dropdown. We can use our api endpoints to show what collections are available too.

Screen Shot 2022-08-03 at 4 28 47 PM

This is a dataset file generated through this process: https://github.com/NASA-IMPACT/delta-ui/blob/6785319f70974b2e2877ba2e536b52f07e5d71b7/mock/datasets/see-image.data.mdx

  • cannot save through preview link for now with error below.
    Screen Shot 2022-08-02 at 3 29 41 PM

@netlify
Copy link

netlify bot commented Aug 2, 2022

Deploy Preview for veda-ui ready!

Name Link
🔨 Latest commit 778cdbc
🔍 Latest deploy log https://app.netlify.com/sites/veda-ui/deploys/637ea4fb6e9ff70009c2c58f
😎 Deploy Preview https://deploy-preview-224--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 settings.

@hanbyul-here hanbyul-here changed the title Netlify cms [do not merge] Netlify cms Aug 2, 2022
@hanbyul-here
Copy link
Collaborator Author

hanbyul-here commented Aug 5, 2022

To run CMS on local:

  1. Uncomment line 2 of config.yml : https://github.com/NASA-IMPACT/delta-ui/pull/224/files#diff-2a71451a3327b5be51d2420abc4a205adb5de8531414203b316bf05f51b0d12dR2
  2. run yarn to install dependencies if you haven't after checking out to this branch.
  3. run yarn cms to power netlify cms proxy server.
  4. Open a new tab, run yarn serve
  5. go to https://localhost:9000/admin/index.html
  6. If the login button prompts the url to put, use the netlify app url : https://veda-ui.netlify.app/ (I am not sure this is a bug or something I set up wrong, but I had to input this url very fast otherwise the prompt was gone.)
  7. Follow the instruction to set up your account

@hanbyul-here hanbyul-here changed the title [do not merge] Netlify cms Netlify cms Nov 23, 2022
@hanbyul-here
Copy link
Collaborator Author

hanbyul-here commented Nov 23, 2022

While looking at how to customize the editor widget on Netlify CMS (to show how the data will look to users), @slesaad gave this great idea to directly link the preview page from the editor. It turned out, Netlify CMS already offers this functionality from v2.4 (We were on 2.0 before, I updated Netlify CMS to 2.10)

Workflow

  1. User 'saves' the dataset (Netlify CMS makes a pr with the change.)
  2. User will see this 'Check for preview' button while preview is being built

Screen Shot 2022-11-23 at 11 57 13 AM

  1. When the preview is ready + 'Check for preview' button is pressed, the button will change its text to 'View Preview'

Screen Shot 2022-11-23 at 1 25 09 PM

  1. The link will take the user to the explorer preview page.

This requires a user some additional clicks and wait time for the preview build. However, the user can see exactly how the data will get rendered. Also, it is a very low effort on our side. I think it is worth at least testing. I would love your opinion @danielfdsilva @aboydnw @nerik (We can go over this feature sometime next week.)

Some caveats make me think we still need to look into customizing Netlify Widgets.

  • Netlify Widgets don't allow conditional fields (ex. When the legend is categorical, we require users to put an array of object({label:.., value:..}). When the legend is gradient, we require users to put an array of strings (color value). But there is no out-of-box solution for Netlify Widget to suggest different fields depending on pre-selected values. (There seems to be enough interest in this feature though .)
  • I also disabled the preview on the right pane because it doesn't seem to help.

@aboydnw
Copy link
Contributor

aboydnw commented Nov 25, 2022

I'll let others weigh in, just wanted to put out there that I'd feel comfortable accompanying documentation with a POC like this. I think IMPACT and scientists would see it as an improvement and would be willing to read documentation for things like conditional fields or less-than-optimal workflows. Would allow us to get feedback on whether something like this is useful and then we can go from there.

@netlify
Copy link

netlify bot commented Nov 29, 2022

Deploy Preview for veda-ui ready!

Name Link
🔨 Latest commit 076cffa
🔍 Latest deploy log https://app.netlify.com/sites/veda-ui/deploys/6386213b07e63f0008589c7a
😎 Deploy Preview https://deploy-preview-224--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 settings.

@hanbyul-here
Copy link
Collaborator Author

We decided to move forward with this approach. But this change needs to go in config repo, not here. I will close this PR for now but will open one in config repo.

@hanbyul-here
Copy link
Collaborator Author

Reopening for demo purpose

@hanbyul-here hanbyul-here reopened this Nov 30, 2022
@danielfdsilva danielfdsilva deleted the netlify-cms branch December 6, 2022 13:44
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