Skip to content
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

Add UI Support for Controlled Commit States in Elsa Studio #385

Merged
merged 16 commits into from
Feb 6, 2025

Conversation

sfmskywalker
Copy link
Member

@sfmskywalker sfmskywalker commented Jan 27, 2025

This pull request implements the user interface enhancements in Elsa Studio to support the new "Controlled Commit States" feature. It provides users with the ability to configure commit state behaviors for workflows and individual activities directly from the UI.

Feature Overview

Workflow-Level Configuration

Users can now configure commit state options for workflows through a new section in the workflow settings panel. The following options are available:

  • Commit before workflow starts executing
  • Commit before each activity starts executing
  • Commit after each activity has executed

Multiple options can be selected simultaneously to accommodate different scenarios.

Activity-Level Configuration

Each activity in the workflow designer has been updated with a "Commit State Behavior" dropdown, allowing users to select one of the following options:

  • Commit before executing
  • Commit after executing
  • Commit before and after executing
  • Inherit from workflow
  • Never commit

Implementation Details

  • Workflow-Level UI: Added a new settings panel in the workflow designer to manage workflow-level commit state configurations.
  • Activity-Level UI: Updated the activity properties sidebar to include the "Commit State Behavior" dropdown.

Screenshots

image

Notes

This PR complements the backend implementation of Controlled Commit States (see issue elsa-workflows/elsa-core#4835). Together, they provide users with comprehensive control over state persistence in workflows.

Introduced the ability to configure commit state behavior for workflows and activities via new UI components and logic. This enhancement allows specifying when workflow state should be committed, improving flexibility and control. Integrated changes across activity property panels and settings to support this feature.
Added specific migration flags to ensure compatibility with updated ReSharper code style settings. This change aims to streamline formatting rules and improve maintainability.
MariusVuscanNx
MariusVuscanNx previously approved these changes Jan 28, 2025
Replaced MudDialogInstance with IMudDialogInstance to align with the new interface. This improves consistency and ensures compatibility with future updates.
Bumped the base_version from 3.3.1 to 3.3.2 in the packages.yml workflow file. This ensures compatibility with the latest release and updates the build configuration accordingly.
Replaced `ActivityCommitStateBehavior` with a more flexible commit strategy approach utilizing `CommitStrategyDescriptor`. Updated relevant APIs, services, and UI components to support the new model, enhancing configurability and maintainability.
Ensure null-safe access when selecting the commit strategy by adding a null conditional check. This prevents potential runtime issues when a commit strategy name is not present.
Updated the `ToStringFunc` and select item display logic to handle null `DisplayName` values gracefully, defaulting to "-". Also ensured `_selectedCommitStrategy` is updated on selection change to maintain consistency.
Updated the Settings component to initialize and select a commit strategy based on the workflow definition's options. This ensures consistency with other strategy selections and improves functionality in workflow configuration.
Updated string formatting to handle null or whitespace display names more robustly for commit strategies. This ensures proper fallback to "-" when no valid display name is provided.
Replaced project reference with a NuGet package reference for Elsa.Api.Client in Elsa.Studio.Core. Updated ElsaVersion to 3.3.2-preview.2609 to ensure compatibility with the new package version.
@sfmskywalker sfmskywalker merged commit 1b5ec28 into main Feb 6, 2025
6 checks passed
@sfmskywalker sfmskywalker deleted the feature/4835 branch February 6, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants