Skip to content

Commit

Permalink
🐛 fix(SThirdPartySchemeSelect): The default binding value is not disp…
Browse files Browse the repository at this point in the history
…layed (#722)

* 🆕 feat: SThirdPartySchemeSelect

* 🐛 fix(SThirdPartySchemeSelect): The default binding value is not displayed

* ⚡ refactor(SThirdPartySchemeSelect): support tooltip
  • Loading branch information
wzh425 authored Aug 3, 2024
1 parent 1c0f128 commit a6fe014
Showing 1 changed file with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@

<SSelect Value="Value"
ValueChanged="ValueChanged"
Items="ThirdPartyIdps"
Items="_thirdPartyIdps"
Label="@T(Label??"")"
ItemText="e => e.DisplayName"
ItemValue="e => e.Name"
Small=Small
Clearable=Clearable
BackgroundColor="@(FillBackground?"fill-background":"white")"
Style="@($"{Style}")"
Class="@($"{Class}")">
Class="@($"{Class}")"
Tooltip="@Tooltip">
<ItemContent Context="data">
<div class="d-flex align-center" style="height:48px;">
<MAvatar Size=30>
Expand All @@ -31,9 +32,6 @@
[Parameter]
public EventCallback<string> ValueChanged { get; set; }

[Parameter]
public List<ThirdPartyIdpSelectModel>? ThirdPartyIdps { get; set; }

[Parameter]
public bool Small { get; set; }

Expand All @@ -46,18 +44,23 @@
[Parameter]
public bool FillBackground { get; set; } = true;

[Parameter]
public bool IncludeLdap { get; set; } = true;

[Parameter]
public string? Tooltip { get; set; }

private List<ThirdPartyIdpSelectModel>? _thirdPartyIdps = new();

protected override async Task OnInitializedAsync()
{
if (ThirdPartyIdps is null)
{
await InitThirdPartyIdps();
}
else Label ??= "ThirdPartyIdp";
Label ??= "ThirdPartyIdp";

await InitThirdPartyIdps();
}

public async Task InitThirdPartyIdps()
{
ThirdPartyIdps = new();
ThirdPartyIdps.AddRange(await AuthClient.ThirdPartyIdpService.GetSelectAsync(default, true));
_thirdPartyIdps = await AuthClient.ThirdPartyIdpService.GetSelectAsync(default, IncludeLdap);
}
}

0 comments on commit a6fe014

Please sign in to comment.