Add acceptance parameter to MandatoryInfoDialog

This commit is contained in:
Thorsten Sommer 2026-04-10 16:54:56 +02:00
parent b68c62693f
commit 0989506396
No known key found for this signature in database
GPG Key ID: B0B7E2FC074BF1F5
3 changed files with 6 additions and 1 deletions

View File

@ -3,7 +3,7 @@
<MudDialog>
<DialogContent>
<div class="pt-6" style="max-height: calc(100vh - 11rem); overflow-y: auto; overflow-x: hidden; padding-right: 0.5rem;">
<MandatoryInfoDisplay Info="@this.Info" ShowAcceptanceMetadata="@true" />
<MandatoryInfoDisplay Info="@this.Info" Acceptance="@this.Acceptance" ShowAcceptanceMetadata="@true" />
</div>
</DialogContent>
<DialogActions>

View File

@ -13,6 +13,9 @@ public partial class MandatoryInfoDialog : MSGComponentBase
[Parameter]
public DataMandatoryInfo Info { get; set; } = new();
[Parameter]
public DataMandatoryInfoAcceptance? Acceptance { get; set; }
private void Accept() => this.MudDialog.Close(DialogResult.Ok(true));
private void Reject() => this.MudDialog.Close(DialogResult.Ok(false));

View File

@ -424,9 +424,11 @@ public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver, ILan
private async Task<bool> ShowMandatoryInfoDialog(DataMandatoryInfo info)
{
var acceptance = this.SettingsManager.ConfigurationData.MandatoryInformation.FindAcceptance(info.Id);
var dialogParameters = new DialogParameters<MandatoryInfoDialog>
{
{ x => x.Info, info },
{ x => x.Acceptance, acceptance },
};
var dialogReference = await this.DialogService.ShowAsync<MandatoryInfoDialog>(info.Title, dialogParameters, DialogOptions.BLOCKING_FULLSCREEN);