Skip to content

[NU-2197] save and deploy buttons changes #8130

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

Merged
merged 28 commits into from
May 28, 2025

Conversation

Dzuming
Copy link
Contributor

@Dzuming Dzuming commented May 21, 2025

Describe your changes

Provide quick save
https://github.com/user-attachments/assets/48cc2262-be3c-4d72-8791-7b6920d6c00f

Provide quick deploy/redeploy

Screen.Recording.2025-05-27.at.10.50.12.mov

Checklist before merge

  • Related issue ID is placed at the beginning of PR title in [brackets] (can be GH issue or Nu Jira issue)
  • Code is cleaned from temporary changes and commented out lines
  • Parts of the code that are not easy to understand are documented in the code
  • Changes are covered by automated tests
  • Showcase in dev-application.conf added to demonstrate the feature
  • Documentation added or updated
  • Added entry in Changelog.md describing the change from the perspective of a public distribution user
  • Added MigrationGuide.md entry in the appropriate subcategory if introducing a breaking change
  • Verify that PR will be squashed during merge

@github-actions github-actions bot added client client main fe ui labels May 21, 2025
@Dzuming Dzuming requested a review from Copilot May 21, 2025 10:51
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements changes to the save and deploy buttons by updating import paths, refactoring the button interactions to use new preset options, and renaming button labels for consistency with the updated UI.

  • Updated the import reference for the save scenario dialog.
  • Refactored the DeployButton and SaveButton to use preset options and updated their callback structures.
  • Renamed button labels (e.g., "deploy" to "start" and "cancel" to "stop") for clarity.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
designer/client/src/windowManager/ContentGetter.tsx Updated import path for the save scenario dialog.
designer/client/src/components/toolbars/scenarioActions/buttons/DeployButton.tsx Refactored deployment callbacks and integrated new preset handling.
designer/client/src/components/toolbars/scenarioActions/buttons/CancelDeployButton.tsx Updated button label from "cancel" to "stop" (note potential spelling in translation key).
designer/client/src/components/toolbars/process/buttons/SaveButton.tsx Adjusted save callback logic with new preset options and validation.
designer/client/src/components/toolbarComponents/toolbarButtons/ButtonRoot.tsx Added conditional styling for the indicator based on button variant.
designer/client/src/components/modals/saveScenario/useSaveScenario.ts Introduced hook for handling scenario save actions.
designer/client/src/components/modals/saveScenario/SaveScenarioDialog.tsx New dialog component for saving scenarios integrating the updated save hook.
designer/client/src/components/modals/SaveProcessDialog.tsx Removed in favor of the new SaveScenarioDialog.

Dzuming added 2 commits May 21, 2025 12:59
# Conflicts:
#	designer/client/src/components/toolbarComponents/toolbarButtons/ButtonRoot.tsx
Copy link
Contributor

github-actions bot commented May 21, 2025

none: #8159
⚠️ Be careful! Snapshot changes are not necessarily the cause of the error. Check the logs.

Copy link
Member

@arkadius arkadius left a comment

Choose a reason for hiding this comment

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

In movie, looks good, I didn't check the code

@Dzuming Dzuming requested a review from Copilot May 26, 2025 14:06
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds quick-save and quick-deploy options, introduces a new save-scenario dialog, and refactors related toolbar buttons to support presets and loading states.

  • Added scenario.allowQuickSave and scenario.allowQuickDeploy user settings and default flags.
  • Replaced the old SaveProcessDialog with SaveScenarioDialog and a useSaveScenario hook.
  • Enhanced Save, Deploy, Redeploy, and Cancel buttons with loading indicators, presets, and quick-action behavior.

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
designer/client/src/windowManager/ContentGetter.tsx Updated import to SaveScenarioDialog
designer/client/src/reducers/userSettings.ts Added scenario.allowQuickSave and scenario.allowQuickDeploy
designer/client/src/reducers/selectors/scenarioState.ts New selectors getIsDeploying and getIsRedeploying
designer/client/src/components/toolbars/.../DeployButton.tsx Added quick-deploy presets, loading state, and notification handling
designer/client/src/components/toolbars/.../RedeployButton.tsx Added quick-redeploy presets, loading state, and notification handling
designer/client/src/components/toolbars/.../CancelDeployButton.tsx Added quick stop option; updated label and settings check
designer/client/src/components/toolbars/process/buttons/SaveButton.tsx Added quick-save presets, loading state, and validation flow
designer/client/src/components/toolbarComponents/toolbarButtons/ButtonRoot.tsx Updated badge logic to show a dot or * indicator
designer/client/src/components/modals/saveScenario/* New useSaveScenario hook and SaveScenarioDialog modal
Comments suppressed due to low confidence (3)

designer/client/src/windowManager/ContentGetter.tsx:43

  • The constant name SaveProcessDialog no longer matches the imported SaveScenarioDialog component—consider renaming it to SaveScenarioDialog for clarity.
const SaveProcessDialog = loadable(() => import("../components/modals/saveScenario/SaveScenarioDialog"), {

designer/client/src/components/toolbars/scenarioActions/buttons/CancelDeployButton.tsx:38

  • The variable available is not defined in this component, which will cause a runtime error—define available (e.g. via useSelector(isCancelPossible)) or adjust the disabled prop.
disabled={!available}

designer/client/src/components/toolbars/process/buttons/SaveButton.tsx:21

  • [nitpick] The preset values mix lowercase (save) and PascalCase (SaveWithComment); consider using a consistent casing (e.g. saveWithComment) for both.
type SavePresetValue = "save" | "SaveWithComment";

@Dzuming Dzuming merged commit b607a07 into staging May 28, 2025
14 checks passed
@Dzuming Dzuming deleted the NU-2197-save-and-deploy-buttons-changes branch May 28, 2025 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client client main fe ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants