-
Notifications
You must be signed in to change notification settings - Fork 86
fix(designer): Reset id replacements when reset designer dirty state #7105
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
Conversation
There was a problem hiding this 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 fixes a bug in the designer by ensuring that ID replacements are reset when the designer dirty state is reset and a workflow is saved. Key changes include:
- Adding a new resetIdReplacements action in workflowSlice to clear ID mappings.
- Dispatching resetIdReplacements in the global resetDesignerDirtyState function.
- Updating components to pass and use a setWorkflow callback for updating the workflow definition after saving.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
libs/designer/src/lib/core/state/workflow/workflowSlice.ts | Added resetIdReplacements action to clear ID mappings on save. |
libs/designer/src/lib/core/state/global.ts | Updated resetDesignerDirtyState to dispatch resetIdReplacements. |
apps/Standalone/src/designer/app/AzureLogicAppsDesigner/laDesigner.tsx | Propagated the new setWorkflow prop to support workflow updates. |
apps/Standalone/src/designer/app/AzureLogicAppsDesigner/DesignerCommandBar.tsx | Updated save workflow logic to include state updates via setWorkflow. |
Comments suppressed due to low confidence (2)
libs/designer/src/lib/core/state/workflow/workflowSlice.ts:675
- Consider adding unit tests for the resetIdReplacements action to verify that the idReplacements state is properly reset when the workflow is saved.
+ resetIdReplacements: (state) => {
apps/Standalone/src/designer/app/AzureLogicAppsDesigner/DesignerCommandBar.tsx:140
- Ensure that clearDirtyState updates the workflow state consistently; consider adding tests to validate that setWorkflow correctly updates the workflow definition after saving.
const clearDirtyState = () => {
…7105) * Add reset id replacements * Add id replacements
…7105) * Add reset id replacements * Add id replacements
Type of Change
Current behavior
New behavior
resetIdReplacements
action inworkflowSlice
to clear ID mappings when a workflow is saved. This action ensures that ID replacements are reset to an empty object.resetDesignerDirtyState
function to dispatch theresetIdReplacements
action, resetting ID mappings along with other dirty state properties.Impact of Change
Not a breaking change
Test Plan
Screenshots or Videos (if applicable)
Screen recording
Before
CleanShot.2025-04-28.at.15.41.46.mp4
After
CleanShot.2025-04-28.at.15.50.10.mp4