From 711ea595a638f85557a20214da79946d427ebd59 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Tue, 10 Dec 2024 20:59:51 +0100 Subject: [PATCH 1/6] Update upload/download GitHub actions to V4 --- .github/workflows/packages.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index d05fedaf..4e706808 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -94,21 +94,21 @@ jobs: # Upload nuget packages - name: Upload nuget packages - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: elsa-studio-nuget-packages path: ./packages/nuget/*nupkg # Upload npm wasm package - name: Upload npm wasm package - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: elsa-studio-npm-packages path: ./packages/wasm/wwwroot/*.tgz # Upload npm react wrapper package - name: Upload npm react wrapper package - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: elsa-studio-npm-packages path: ./src/wrappers/wrappers/react-wrapper/*.tgz @@ -121,7 +121,7 @@ jobs: if: ${{ github.event_name == 'release' || github.event_name == 'push'}} steps: - name: Download Packages - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: elsa-studio-npm-packages path: elsa-studio-npm-packages @@ -147,7 +147,7 @@ jobs: if: ${{ github.event_name == 'release' && github.event.action == 'published' }} steps: - name: Download Packages - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: elsa-studio-npm-packages path: elsa-studio-npm-packages @@ -173,7 +173,7 @@ jobs: if: ${{ github.event_name == 'release' || github.event_name == 'push'}} steps: - name: Download Packages - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: elsa-studio-nuget-packages path: elsa-studio-nuget-packages @@ -189,7 +189,7 @@ jobs: if: ${{ github.event_name == 'release' && github.event.action == 'published' }} steps: - name: Download Packages - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: elsa-studio-nuget-packages path: elsa-studio-nuget-packages From d78b7a9a75aacb1538498cb5eba313b1da7ef84a Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Wed, 11 Dec 2024 14:09:28 +0100 Subject: [PATCH 2/6] Disable auto-refresh in WorkflowInstanceList initialization Auto-refresh was commented out to avoid issues with maintaining selected state, pagination, and other UI elements. This change ensures a more consistent user experience until proper handling is implemented. --- .../WorkflowInstanceList/WorkflowInstanceList.razor.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/Elsa.Studio.Workflows/Components/WorkflowInstanceList/WorkflowInstanceList.razor.cs b/src/modules/Elsa.Studio.Workflows/Components/WorkflowInstanceList/WorkflowInstanceList.razor.cs index c5e5cea3..b0e598b4 100644 --- a/src/modules/Elsa.Studio.Workflows/Components/WorkflowInstanceList/WorkflowInstanceList.razor.cs +++ b/src/modules/Elsa.Studio.Workflows/Components/WorkflowInstanceList/WorkflowInstanceList.razor.cs @@ -58,7 +58,9 @@ public partial class WorkflowInstanceList : IAsyncDisposable protected override async Task OnInitializedAsync() { await LoadWorkflowDefinitionsAsync(); - StartElapsedTimer(); + + // Disable auto refresh until we implement a way to maintain the selected state, pagination etc. + //StartElapsedTimer(); } private async Task LoadWorkflowDefinitionsAsync() From d820fec87d962e15ba4e57dcbbb062d2768df2f1 Mon Sep 17 00:00:00 2001 From: jdevillard Date: Tue, 10 Dec 2024 15:10:27 +0000 Subject: [PATCH 3/6] Translated using Weblate (French) Currently translated at 17.7% (55 of 310 strings) Translation: Elsa Studio/Elsa Studio Translations Translate-URL: https://hosted.weblate.org/projects/elsa-studio/elsa-studio-translations/fr/ --- .../Translations.fr.resx | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/framework/Elsa.Studio.Translations/Translations.fr.resx b/src/framework/Elsa.Studio.Translations/Translations.fr.resx index 9d9cbc36..2f030184 100644 --- a/src/framework/Elsa.Studio.Translations/Translations.fr.resx +++ b/src/framework/Elsa.Studio.Translations/Translations.fr.resx @@ -190,4 +190,37 @@ Utilisé + + Activités + + + Agent + + + Agents + + + Sauvegarde automatique + + + Fermer + + + Créer une clé d'API + + + Date + + + Configuration par défaut + + + HTTP + + + ID + + + Information + \ No newline at end of file From 134318c66a3c9ad7dc1831872005cef80117e753 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Thu, 12 Dec 2024 15:41:43 +0100 Subject: [PATCH 4/6] Fix null handling and default value assignments in components (#337) Adjusted multiple properties and variables to explicitly use null instead of default values, ensuring consistency and clarity in initialization. Added fallback logic for cases where execution details or outputs are unavailable, enhancing application stability. --- .../Components/ActivityDetailsTab.razor.cs | 24 +++++++++++-------- .../WorkflowInstanceDesigner.razor.cs | 4 ++++ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/modules/Elsa.Studio.Workflows/Components/WorkflowInstanceViewer/Components/ActivityDetailsTab.razor.cs b/src/modules/Elsa.Studio.Workflows/Components/WorkflowInstanceViewer/Components/ActivityDetailsTab.razor.cs index 97a0c29f..2643c8af 100644 --- a/src/modules/Elsa.Studio.Workflows/Components/WorkflowInstanceViewer/Components/ActivityDetailsTab.razor.cs +++ b/src/modules/Elsa.Studio.Workflows/Components/WorkflowInstanceViewer/Components/ActivityDetailsTab.razor.cs @@ -21,14 +21,14 @@ public record ActivityExecutionRecordTableRow(int Number, ActivityExecutionRecor [Parameter] public int VisiblePaneHeight { get; set; } /// The activity to display details for. - [Parameter] public JsonObject Activity { get; set; } = default!; + [Parameter] public JsonObject Activity { get; set; } = null!; /// The latest activity execution record. Used for displaying the last state of the activity. [Parameter] public ActivityExecutionRecord? LastActivityExecution { get; set; } - [Inject] private IActivityRegistry ActivityRegistry { get; set; } = default!; + [Inject] private IActivityRegistry ActivityRegistry { get; set; } = null!; - private ActivityExecutionRecord? SelectedItem { get; set; } = default!; + private ActivityExecutionRecord? SelectedItem { get; set; } = null!; private IDictionary ActivityInfo { get; set; } = new Dictionary(); private IDictionary ActivityData { get; set; } = new Dictionary(); @@ -66,9 +66,9 @@ private void CreateDataModels() var activityName = activity.GetName(); var activityType = activity.GetTypeName(); var execution = LastActivityExecution; - var activityVersion = execution?.ActivityTypeVersion; + var activityVersion = activity.GetVersion(); var exception = execution?.Exception; - var workflowDefinitionId = activity.GetIsWorkflowDefinitionActivity() ? activity.GetWorkflowDefinitionId() : default; + var workflowDefinitionId = activity.GetIsWorkflowDefinitionActivity() ? activity.GetWorkflowDefinitionId() : null; var activityInfo = new Dictionary { @@ -99,11 +99,15 @@ private void CreateDataModels() foreach (var outputDescriptor in outputDescriptors) { var outputValue = outputs != null - ? outputs.TryGetValue(outputDescriptor.Name, out var value) ? value : default - : default; + ? outputs.TryGetValue(outputDescriptor.Name, out var value) ? value : null + : null; outputData[outputDescriptor.Name] = new(outputValue?.ToString()); } } + else + { + activityInfo["Status"] = new("Not executed"); + } var exceptionData = new Dictionary(); @@ -112,7 +116,7 @@ private void CreateDataModels() exceptionData["Message"] = new(exception.Message); exceptionData["InnerException"] = new(exception.InnerException != null ? exception.InnerException.Type + ": " + exception.InnerException.Message - : default); + : null); exceptionData["StackTrace"] = new(exception.StackTrace); } @@ -123,7 +127,7 @@ private void CreateDataModels() { foreach (var inputDescriptor in activityDescriptor.Inputs) { - var inputValue = activityState.TryGetValue(inputDescriptor.Name, out var value) ? value : default; + var inputValue = activityState.TryGetValue(inputDescriptor.Name, out var value) ? value : null; activityStateData[inputDescriptor.Name] = new(inputValue?.ToString()); } } @@ -151,7 +155,7 @@ private void CreateSelectedItemDataModels(ActivityExecutionRecord? record) var outcomesData = record.Payload?.TryGetValue("Outcomes", out var outcomesValue) == true ? new Dictionary { ["Outcomes"] = outcomesValue.ToString()! } - : default; + : null; var outputData = new Dictionary(); diff --git a/src/modules/Elsa.Studio.Workflows/Components/WorkflowInstanceViewer/Components/WorkflowInstanceDesigner.razor.cs b/src/modules/Elsa.Studio.Workflows/Components/WorkflowInstanceViewer/Components/WorkflowInstanceDesigner.razor.cs index 70970316..b6d9a5a2 100644 --- a/src/modules/Elsa.Studio.Workflows/Components/WorkflowInstanceViewer/Components/WorkflowInstanceDesigner.razor.cs +++ b/src/modules/Elsa.Studio.Workflows/Components/WorkflowInstanceViewer/Components/WorkflowInstanceDesigner.razor.cs @@ -267,6 +267,10 @@ private async Task> GetActivityExecu var lastRecord = records.Last(); LastActivityExecution = await ActivityExecutionService.GetAsync(lastRecord.Id); } + else + { + LastActivityExecution = null; + } return records; } From 5eba6a88fb6ed27e456074aedb5302bb9e8925be Mon Sep 17 00:00:00 2001 From: MariusVuscanNx <96233009+MariusVuscanNx@users.noreply.github.com> Date: Thu, 12 Dec 2024 18:11:35 +0200 Subject: [PATCH 5/6] Fixed display of log persistance type input (#338) Co-authored-by: Sipke Schoorstra --- .../Properties/Sections/Settings/Settings.razor | 11 ++++++----- .../Properties/Sections/Settings/Settings.razor.cs | 13 +++++-------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/modules/Elsa.Studio.Workflows/Components/WorkflowDefinitionEditor/Components/WorkflowProperties/Tabs/Properties/Sections/Settings/Settings.razor b/src/modules/Elsa.Studio.Workflows/Components/WorkflowDefinitionEditor/Components/WorkflowProperties/Tabs/Properties/Sections/Settings/Settings.razor index 3ff0e0fa..50a63f89 100644 --- a/src/modules/Elsa.Studio.Workflows/Components/WorkflowDefinitionEditor/Components/WorkflowProperties/Tabs/Properties/Sections/Settings/Settings.razor +++ b/src/modules/Elsa.Studio.Workflows/Components/WorkflowDefinitionEditor/Components/WorkflowProperties/Tabs/Properties/Sections/Settings/Settings.razor @@ -28,7 +28,7 @@ } - @foreach (var strategy in _logPersistenceStrategyDescriptors) { - @(strategy.DisplayName) + @(strategy.DisplayName ?? "Inherit") } diff --git a/src/modules/Elsa.Studio.Workflows/Components/WorkflowDefinitionEditor/Components/WorkflowProperties/Tabs/Properties/Sections/Settings/Settings.razor.cs b/src/modules/Elsa.Studio.Workflows/Components/WorkflowDefinitionEditor/Components/WorkflowProperties/Tabs/Properties/Sections/Settings/Settings.razor.cs index b66d1436..6443e790 100644 --- a/src/modules/Elsa.Studio.Workflows/Components/WorkflowDefinitionEditor/Components/WorkflowProperties/Tabs/Properties/Sections/Settings/Settings.razor.cs +++ b/src/modules/Elsa.Studio.Workflows/Components/WorkflowDefinitionEditor/Components/WorkflowProperties/Tabs/Properties/Sections/Settings/Settings.razor.cs @@ -46,6 +46,7 @@ public partial class Settings private ICollection _logPersistenceStrategyDescriptors = new List(); private WorkflowActivationStrategyDescriptor? _selectedActivationStrategy; private IncidentStrategyDescriptor? _selectedIncidentStrategy; + private LogPersistenceStrategyDescriptor? _selectedLogPersistenceStrategy; private LogPersistenceConfiguration? _logPersistenceConfiguration; /// @@ -55,15 +56,10 @@ protected override async Task OnInitializedAsync() var incidentStrategies = (await IncidentStrategiesProvider.GetIncidentStrategiesAsync()).ToList(); _incidentStrategies = new IncidentStrategyDescriptor?[] { default }.Concat(incidentStrategies).ToList(); _logPersistenceStrategyDescriptors = (await LogPersistenceStrategyService.GetLogPersistenceStrategiesAsync()).ToList(); - _selectedActivationStrategy = _activationStrategies.FirstOrDefault(x => x.TypeName == WorkflowDefinition!.Options.ActivationStrategyType) ?? _activationStrategies.FirstOrDefault(); _selectedIncidentStrategy = _incidentStrategies.FirstOrDefault(x => x?.TypeName == WorkflowDefinition!.Options.IncidentStrategyType) ?? _incidentStrategies.FirstOrDefault(); - } - - protected override Task OnParametersSetAsync() - { _logPersistenceConfiguration = GetLogPersistenceConfiguration(); - return base.OnParametersSetAsync(); + _selectedLogPersistenceStrategy = _logPersistenceStrategyDescriptors.FirstOrDefault(x => x.TypeName == _logPersistenceConfiguration?.StrategyType) ?? _logPersistenceStrategyDescriptors.FirstOrDefault(); } private LogPersistenceMode? GetLegacyGetLogPersistenceMode() @@ -134,13 +130,14 @@ private async Task OnIncidentStrategyChanged(IncidentStrategyDescriptor? value) await RaiseWorkflowUpdatedAsync(); } - private async Task OnLogPersistenceStrategyChanged(string? value) + private async Task OnLogPersistenceStrategyChanged(LogPersistenceStrategyDescriptor? value) { + _selectedLogPersistenceStrategy = value; var currentConfig = _logPersistenceConfiguration; var newConfig = new LogPersistenceConfiguration { EvaluationMode = LogPersistenceEvaluationMode.Strategy, - StrategyType = value, + StrategyType = value?.TypeName, Expression = currentConfig?.Expression }; await UpdateLogPersistenceConfigAsync(newConfig); From cd5d31c7f45f74dfc33409314b5990ccf89c56f4 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Thu, 12 Dec 2024 17:24:22 +0100 Subject: [PATCH 6/6] Enhance workflows to handle React npm package publishing Updated GitHub Actions workflows to separately download and publish React npm packages alongside existing npm packages. Added new steps for handling React-specific artifacts for both feedz.io and npmjs.com registries, ensuring better organization and clarity in package publishing. --- .github/workflows/packages.yml | 56 ++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 4e706808..252d4606 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -110,7 +110,7 @@ jobs: - name: Upload npm react wrapper package uses: actions/upload-artifact@v4 with: - name: elsa-studio-npm-packages + name: elsa-studio-npm-react-packages path: ./src/wrappers/wrappers/react-wrapper/*.tgz publish_npm_preview_feedzio: @@ -120,19 +120,36 @@ jobs: timeout-minutes: 10 if: ${{ github.event_name == 'release' || github.event_name == 'push'}} steps: - - name: Download Packages + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 18.12.1 + registry-url: ${{ env.npm_feed_feedzio }} + + - name: Download npm Packages uses: actions/download-artifact@v4 with: name: elsa-studio-npm-packages path: elsa-studio-npm-packages - - uses: actions/setup-node@v3 + - name: Publish npm packages to feedz.io + run: | + for file in ./elsa-studio-npm-packages/*.tgz + do + npm publish "$file" --access public + done + env: + NODE_AUTH_TOKEN: ${{secrets.FEEDZ_API_KEY_BASE64}} + + - name: Download npm react Packages + uses: actions/download-artifact@v4 with: - node-version: 18.12.1 - registry-url: ${{ env.npm_feed_feedzio }} + name: elsa-studio-npm-react-packages + path: elsa-studio-npm-react-packages - - run: | - for file in ./elsa-studio-npm-packages/*.tgz + - name: Publish npm react packages to feedz.io + run: | + for file in ./elsa-studio-npm-react-packages/*.tgz do npm publish "$file" --access public done @@ -146,19 +163,34 @@ jobs: timeout-minutes: 10 if: ${{ github.event_name == 'release' && github.event.action == 'published' }} steps: - - name: Download Packages + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 18.12.1 + registry-url: ${{ env.npm_feed_npm }} + + - name: Download npm Packages uses: actions/download-artifact@v4 with: name: elsa-studio-npm-packages path: elsa-studio-npm-packages - - uses: actions/setup-node@v3 + - run: | + for file in ./elsa-studio-npm-packages/*.tgz + do + npm publish "$file" --access public + done + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_API_KEY }} + + - name: Download npm react Packages + uses: actions/download-artifact@v4 with: - node-version: 18.12.1 - registry-url: ${{ env.npm_feed_npm }} + name: elsa-studio-npm-react-packages + path: elsa-studio-npm-react-packages - run: | - for file in ./elsa-studio-npm-packages/*.tgz + for file in ./elsa-studio-npm-react-packages/*.tgz do npm publish "$file" --access public done