Skip to content

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

@ccastrotrejo ccastrotrejo added the risk:low Low risk change with minimal impact label Apr 28, 2025
@ccastrotrejo ccastrotrejo requested a review from Copilot April 28, 2025 20:17
Copy link
Contributor

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
Eric-B-Wu added a commit that referenced this pull request May 19, 2025
* filtering fixes

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

This reverts commit fefe073.

* revert part of pr

* revert

* fix test

* Actully fix test
Eric-B-Wu added a commit that referenced this pull request May 27, 2025
* filtering fixes

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

This reverts commit fefe073.

* revert part of pr

* revert

* fix(designer): Fix Variable Editor Causing Issues on Strings (#7302)

* quick fix

* my brain hurts

* fix changes

* fix test

* is it working?

* add logic to agent params and created tests

* fix test

* update code

* Revert "update code"

This reverts commit 7669b64.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:low Low risk change with minimal impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants