Skip to content

Commit

Permalink
Merge branch 'main' into raspberry
Browse files Browse the repository at this point in the history
  • Loading branch information
sfmskywalker committed Dec 12, 2024
2 parents 055ae19 + a1453d5 commit f5a456e
Showing 7 changed files with 116 additions and 43 deletions.
70 changes: 51 additions & 19 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
@@ -95,23 +95,23 @@ 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
name: elsa-studio-npm-react-packages
path: ./src/wrappers/wrappers/react-wrapper/*.tgz

publish_npm_preview_feedzio:
@@ -121,19 +121,36 @@ jobs:
timeout-minutes: 10
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
steps:
- name: Download Packages
uses: actions/download-artifact@v3
- 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
@@ -147,19 +164,34 @@ jobs:
timeout-minutes: 10
if: ${{ github.event_name == 'release' && github.event.action == 'published' }}
steps:
- name: Download Packages
uses: actions/download-artifact@v3
- 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
@@ -174,7 +206,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
@@ -190,7 +222,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
33 changes: 33 additions & 0 deletions src/framework/Elsa.Studio.Translations/Translations.fr.resx
Original file line number Diff line number Diff line change
@@ -190,4 +190,37 @@
<data name="Used" xml:space="preserve">
<value>Utilisé</value>
</data>
<data name="Activities" xml:space="preserve">
<value>Activités</value>
</data>
<data name="Agent" xml:space="preserve">
<value>Agent</value>
</data>
<data name="Agents" xml:space="preserve">
<value>Agents</value>
</data>
<data name="Auto-save" xml:space="preserve">
<value>Sauvegarde automatique</value>
</data>
<data name="Close" xml:space="preserve">
<value>Fermer</value>
</data>
<data name="Create API Key" xml:space="preserve">
<value>Créer une clé d'API</value>
</data>
<data name="Date" xml:space="preserve">
<value>Date</value>
</data>
<data name="Default configuration" xml:space="preserve">
<value>Configuration par défaut</value>
</data>
<data name="HTTP" xml:space="preserve">
<value>HTTP</value>
</data>
<data name="ID" xml:space="preserve">
<value>ID</value>
</data>
<data name="Information" xml:space="preserve">
<value>Information</value>
</data>
</root>
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@
}
</MudSelect>
<MudSelect
T="IncidentStrategyDescriptor?"
T="IncidentStrategyDescriptor"
Label="@Localizer["Incident handling strategy"]"
Variant="@Variant.Outlined"
Value="@_selectedIncidentStrategy"
@@ -48,19 +48,20 @@
DisplayName="@Localizer["Log Persistence Strategy"]"
Description="@Localizer["Enter the expression that will be used to determine the log persistence strategy for this property."]"
ReadOnly="IsReadOnly">
<MudSelect
T="string"
<MudSelect
T="LogPersistenceStrategyDescriptor"
Label="@Localizer["Log Persistence Strategy"]"
Variant="@Variant.Outlined"
Value="@_logPersistenceConfiguration?.StrategyType"
Value="@_selectedLogPersistenceStrategy"
ToStringFunc="@(x => x?.DisplayName ?? "Inherit")"
ValueChanged="@OnLogPersistenceStrategyChanged"
ReadOnly="IsReadOnly"
Disabled="IsReadOnly"
HelperText="@Localizer["Select the log persistence strategy to use for activity properties of this workflow."]"
>
@foreach (var strategy in _logPersistenceStrategyDescriptors)
{
<MudSelectItem T="string" Value="@strategy.TypeName">@(strategy.DisplayName)</MudSelectItem>
<MudSelectItem T="LogPersistenceStrategyDescriptor" Value="@strategy">@(strategy.DisplayName ?? "Inherit")</MudSelectItem>
}
</MudSelect>
</ExpressionEditor>
Original file line number Diff line number Diff line change
@@ -46,6 +46,7 @@ public partial class Settings
private ICollection<LogPersistenceStrategyDescriptor> _logPersistenceStrategyDescriptors = new List<LogPersistenceStrategyDescriptor>();
private WorkflowActivationStrategyDescriptor? _selectedActivationStrategy;
private IncidentStrategyDescriptor? _selectedIncidentStrategy;
private LogPersistenceStrategyDescriptor? _selectedLogPersistenceStrategy;
private LogPersistenceConfiguration? _logPersistenceConfiguration;

/// <inheritdoc />
@@ -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);
Original file line number Diff line number Diff line change
@@ -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()
Original file line number Diff line number Diff line change
@@ -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<string, DataPanelItem> ActivityInfo { get; set; } = new Dictionary<string, DataPanelItem>();
private IDictionary<string, DataPanelItem> ActivityData { get; set; } = new Dictionary<string, DataPanelItem>();
@@ -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<string, DataPanelItem>
{
@@ -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<string, DataPanelItem>();

@@ -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<string, string?> { ["Outcomes"] = outcomesValue.ToString()! }
: default;
: null;

var outputData = new Dictionary<string, string?>();

Original file line number Diff line number Diff line change
@@ -267,6 +267,10 @@ private async Task<ICollection<ActivityExecutionRecordSummary>> GetActivityExecu
var lastRecord = records.Last();
LastActivityExecution = await ActivityExecutionService.GetAsync(lastRecord.Id);
}
else
{
LastActivityExecution = null;
}

return records;
}

0 comments on commit f5a456e

Please sign in to comment.