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

Store environment form values in hash object #400

Conversation

gabalafou
Copy link
Contributor

@gabalafou gabalafou commented May 8, 2024

  • Create new environment form key: "{namespace}/new-environment"
  • Edit existing environment form key: "{namespace}/{environment}"

Fixes #394.

IMPORTANT: DRAFT

I'm uploading this PR as a draft so folks can take a look if they're curious. But I'm not sure it should be merged. I think we should first see if #389 prevents the issues mentioned in #385 from surfacing.

Why?

  • This PR is a lot of changes -> risky -> might not be worth it
  • This PR took a lot of work but it's still not quite finished, it will require even more work -> might not be worth the extra effort if Bye tabs, hi URLs #389 takes care of the issues that this PR is trying to fix (see Tasks from tabs discussion #385)
    • Still not quite finished. For example, when clicking the edit button the values of the environment are synced to the form, but to prevent previously editing form values from getting clobbered, I need to check first if the environment form exists.
    • But here's the catch: when the user clicks an environment, they should see the most current values, and when they click the edit button, do they expect the form to contain the current values or their previously edited values? I don't find the user experience intuitive at all

Description

This pull request enables a user to start filling out a form to create an environment in a particular namespace, abandon the form, start a second form to create another environment in a different namespace, then return to the first form with all of their changes still in place. It persists state between pushState navigations, such as clicking a link or use the back button, but it does not persist state between page loads such as if the user presses the refresh button, opens a link in a new tab or window, or enters a URL directly into the browser address bar. It stores form values in a hash object in app memory

Pull request checklist

  • Did you test this change locally?
  • Did you update the documentation (if required)?
  • Did you add/update relevant tests for this change (if required)?

- Create new environment form key: "{namespace}/new-environment"
- Edit existing environment form key: "{namespace}/{environment}"
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.

Give each environment its own edit form state in the UI app global state (Redux)
1 participant