Skip to content

feat: Make CTRL+S hotkey work for environment modal #4701

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bacteriostat
Copy link

@bacteriostat bacteriostat commented May 17, 2025

Description

Closes #1447

This PR makes CTRL+S hotkey work for environment modal. Here are the changes that I had to do:

  1. The hotkey didn't have access to data of formik used in the environment modal, so the existing saveEnvironment(values, environmentUid, collectionUid) couldn't be used. So the first step was making it not accept values from dispatcher i.e., saveEnvironment(environmentUid, collectionUid).

  2. Unlike other components (Collections, Requests) where redux states were updated as user edited them, EnvironmentVariables changes were only being tracked in formik. So the next step was to update the redux state of environments. There was already an incorrectly named saveEnvironment which updated the state but was not used. So I renamed it to updateEnvironment (as was the naming convention for other cases) and dispatched the changing form values to it.

  3. Next I added a key called environmentSettingsSelectedTab inside collection's state to track which environment was being edited. This was necessary for saving.

  4. environmentSettingsSelectedTab is updated using the action updateEnvironmentSettingsSelectedTab whenever the tab is switched.

  5. Added toast to inform user that the environment has been persisted.

  6. Passed isModified down to EnvironmentVariables to track changes and save only when there are actual changes.

Contribution Checklist:

  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

@bacteriostat bacteriostat force-pushed the feature/save-environment-hotkey branch from ea75ec2 to c048116 Compare May 17, 2025 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ctrl + S shortcut does not seem to work in environments configuration screen
1 participant