Skip to content

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

Merged
merged 3 commits into from
Apr 28, 2025

Conversation

ccastrotrejo
Copy link
Contributor

@ccastrotrejo ccastrotrejo commented Apr 28, 2025

Type of Change

  • Bug fix
  • Feature
  • Other

Current behavior

  • Standalone app is not updating the workflow that is getting passed to BJSWorkflowProvider when saving it, which doesn't trigger lots of actions to update nodes metadata and operations properties.
  • Reset designer dirty state doesn't remove id replacements

New behavior

  • Standalone now updates the workflow definition from the new serialized workflow when saved
  • Added a new resetIdReplacements action in workflowSlice to clear ID mappings when a workflow is saved. This action ensures that ID replacements are reset to an empty object.
  • Updated the resetDesignerDirtyState function to dispatch the resetIdReplacements 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

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 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 = () => {

@ccastrotrejo ccastrotrejo merged commit fefe073 into main Apr 28, 2025
18 of 19 checks passed
@ccastrotrejo ccastrotrejo deleted the ccastrotrejo/fixToolName branch April 28, 2025 20:33
ccastrotrejo added a commit that referenced this pull request Apr 29, 2025
ccastrotrejo added a commit that referenced this pull request Apr 29, 2025
…7118)

fix(designer): Reset id replacements when reset designer dirty state (#7105)

* Add reset id replacements

* Add id replacements
Eric-B-Wu added a commit that referenced this pull request May 8, 2025
Eric-B-Wu added a commit that referenced this pull request May 8, 2025
Eric-B-Wu added a commit that referenced this pull request May 8, 2025
…rty state (#7208)

* Revert "fix(designer): Reset id replacements when reset designer dirty state (#7105)"

This reverts commit fefe073.

* revert idReplacement issue

* Revert "revert idReplacement issue"

This reverts commit 5d29fe8.
Eric-B-Wu added a commit that referenced this pull request May 8, 2025
…rty state (#7209)

* filtering fixes

* :revert "fix(designer): Reset id replacements when reset designer dirty state (#7105)"

This reverts commit fefe073.
Eric-B-Wu added a commit that referenced this pull request May 9, 2025
…7220)

* filtering fixes

* :revert "fix(designer): Reset id replacements when reset designer dirty state (#7105)"

This reverts commit fefe073.

* fix
ccastrotrejo added a commit that referenced this pull request May 13, 2025
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.

3 participants