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 support for EffectiveVariableName #37

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<Authors>EasyMicroservices</Authors>
<IsPackable>true</IsPackable>
<Version>0.0.0.31</Version>
<Version>0.0.0.32</Version>
<Description>TemplateGenerator UI compoents.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>component,microcomponent,ui,core,templategenerator,generator,template,form,formgenerator</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<MudStack>
<Actions @ref="ActionsView" @bind-SelectedAction="@viewModel.SelectedAction" />
<FormItems @ref="FormItemsView" @bind-SelectedFormItem="@viewModel.SelectedFormItem" />
<MudTextField @bind-Value="@viewModel.EffectiveVariableName" Placeholder="@viewModel.GetInnerTranslatedByKey("EffectiveVariableName")"
AdornmentIcon="@Icons.Material.Filled.DataObject" IconSize="Size.Medium" Class="mt-0"></MudTextField>
<EventActionsList @ref="EventActionsList" />
</MudStack>
</MudRTLProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,10 @@
return Task.FromResult((MessageContract)true);
}, async () =>
{
Console.WriteLine($"{item.ActionId}-{item.FormItemId}");
var actions = await AddOrUpdateEventActionView.ActionsView.ViewModel.OnGetActionsComplete();
AddOrUpdateEventActionView.ViewModel.SelectedAction = actions.FirstOrDefault(x => x.Id == item.ActionId);
var formItems = await AddOrUpdateEventActionView.FormItemsView.ViewModel.OnGetFormItemsComplete();
AddOrUpdateEventActionView.ViewModel.SelectedFormItem = formItems.FirstOrDefault(x => x.Id == item.FormItemId);
Console.WriteLine($"Selected: {AddOrUpdateEventActionView.ViewModel.SelectedAction?.Id}-{AddOrUpdateEventActionView.ViewModel.SelectedFormItem?.Id}");
AddOrUpdateEventActionView.ViewModel.SelectForUpdate(item);
StateHasChanged();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@
<ToolBarContent>
<MudStack AlignItems="AlignItems.Center" Row="true" Spacing="5">
<MudFab Color="Color.Primary" StartIcon="@Icons.Material.Filled.Add" OnClick="(arg) => ShowAddDialog()" />
<MudText Typo="Typo.h6" mar>@viewModel.GetInnerTranslatedByKey("NoParentFormItems")</MudText>
</MudStack>
<MudText Typo="Typo.h6" mar>
@viewModel.GetInnerTranslatedByKey("NoParentFormItems")
</MudText>
</MudStack>

<MudSpacer />
<MudTextField @bind-Value="_searchString" Placeholder="@viewModel.GetInnerTranslatedByKey("Search")" Adornment="Adornment.Start" Immediate="true"
AdornmentIcon="@Icons.Material.Filled.Search" IconSize="Size.Medium" Class="mt-0"></MudTextField>
<MudButton Variant="Variant.Filled" StartIcon="@Icons.Material.Filled.Search" Color="Color.Primary" Disabled="viewModel.IsBusy" OnClick="(arg) => viewModel.SearchCommand.Execute(null)">
@if (viewModel.IsBusy)
<MudSpacer />
<MudTextField @bind-Value="_searchString" Placeholder="@viewModel.GetInnerTranslatedByKey("Search")" Adornment="Adornment.Start" Immediate="true"
AdornmentIcon="@Icons.Material.Filled.Search" IconSize="Size.Medium" Class="mt-0"></MudTextField>
<MudButton Variant="Variant.Filled" StartIcon="@Icons.Material.Filled.Search" Color="Color.Primary" Disabled="viewModel.IsBusy" OnClick="(arg) => viewModel.SearchCommand.Execute(null)">
@if (viewModel.IsBusy)
{
<MudProgressCircular Class="ms-n1" Size="Size.Small" Indeterminate="true" />
<MudText Class="ms-2">@viewModel.GetInnerTranslatedByKey("Processing")</MudText>
Expand All @@ -50,7 +52,7 @@
}
else
{
<MudIcon Icon="@Icons.Material.Outlined.Edit"/>
<MudIcon Icon="@Icons.Material.Outlined.Edit" />
}
</MudIconButton>
<MudIconButton Size="@Size.Small" Icon="@Icons.Material.Outlined.Delete" Color="Color.Error" OnClick="(arg) => ShowDeleteDialog(context.Item)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<Authors>EasyMicroservices</Authors>
<IsPackable>true</IsPackable>
<Version>0.0.0.31</Version>
<Version>0.0.0.32</Version>
<Description>TemplateGenerator view model.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>component,microcomponent,ui,core,templategenerator,generator,template,form,formgenerator</PackageTags>
Expand All @@ -19,7 +19,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="EasyMicroservices.TemplateGeneratorMicroservice.Clients" Version="0.0.0.30" />
<PackageReference Include="EasyMicroservices.TemplateGeneratorMicroservice.Clients" Version="0.0.0.31" />
<PackageReference Include="EasyMicroservices.UI.Cores.Mvvm" Version="0.0.0.23" />
<PackageReference Include="EasyMicroservices.Utilities" Version="*" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@

public EventActionsListViewModel EventActionsListViewModel { get; set; }

string _EffectiveVariableName;
public string EffectiveVariableName
{
get => _EffectiveVariableName;
set
{
_EffectiveVariableName = value;
OnPropertyChanged(nameof(EffectiveVariableName));
}
}

ActionContract _SelectedAction;
public ActionContract SelectedAction
{
Expand Down Expand Up @@ -45,7 +56,7 @@
public int Length { get; set; } = 50;
public int TotalCount { get; set; }

public async Task Refresh()

Check warning on line 59 in src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/ViewModels/Actions/AddOrUpdateEventActionViewModel.cs

View workflow job for this annotation

GitHub Actions / os-tests

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 59 in src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/ViewModels/Actions/AddOrUpdateEventActionViewModel.cs

View workflow job for this annotation

GitHub Actions / os-tests

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 59 in src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/ViewModels/Actions/AddOrUpdateEventActionViewModel.cs

View workflow job for this annotation

GitHub Actions / os-tests

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
//var filteredResult = await _actionClient.FilterAsync(new FilterRequestContract()
//{
Expand All @@ -70,6 +81,7 @@

public void SelectForUpdate(FormItemEventActionContract update)
{
EffectiveVariableName = update?.InfluencedToVariableName;
EventActionsListViewModel.Children.Clear();
foreach (var item in update.Children)
{
Expand All @@ -92,6 +104,7 @@
Action = SelectedAction,
ActionId = SelectedAction.Id,
FormItemId = SelectedFormItem?.Id,
InfluencedToVariableName = EffectiveVariableName,
Children = EventActionsListViewModel.Children.ToList(),
};
}
Expand Down
Loading