feat: club UserAutoComplete + member filter + wallet user name display
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 7m59s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 7m59s
- ActivateClubDialog: replaced numeric UserId input with UserAutoComplete - ClubMembers: added UserAutoComplete filter in toolbar, wired to proto user_id - WalletManagementPage: display user name + ID instead of just UserId - Updated proto NuGet to 0.0.183 (user_name field)
This commit is contained in:
@@ -138,7 +138,7 @@
|
|||||||
|
|
||||||
<!-- CMS Protobuf NuGet package (used for both local dev and Docker builds) -->
|
<!-- CMS Protobuf NuGet package (used for both local dev and Docker builds) -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.180" />
|
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.183" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<!-- ============================================================ -->
|
<!-- ============================================================ -->
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
@using Google.Protobuf.WellKnownTypes
|
@using Google.Protobuf.WellKnownTypes
|
||||||
@using BackOffice.Pages.Club.Components
|
@using BackOffice.Pages.Club.Components
|
||||||
|
@using BackOffice.Pages.AutoComplete
|
||||||
@using CMSMicroservice.Protobuf.Protos.ClubMembership
|
@using CMSMicroservice.Protobuf.Protos.ClubMembership
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
@@ -16,7 +17,8 @@
|
|||||||
<ToolBarContent>
|
<ToolBarContent>
|
||||||
<MudText Typo="Typo.h6">لیست اعضا</MudText>
|
<MudText Typo="Typo.h6">لیست اعضا</MudText>
|
||||||
<MudSpacer />
|
<MudSpacer />
|
||||||
<MudStack Row="true" Spacing="2">
|
<MudStack Row="true" Spacing="2" AlignItems="AlignItems.Center">
|
||||||
|
<UserAutoComplete Label="جستجوی کاربر" @bind-SelectedUserId="_filterUserId" />
|
||||||
<MudSwitch T="bool" @bind-Value="_filterIsActive"
|
<MudSwitch T="bool" @bind-Value="_filterIsActive"
|
||||||
Color="Color.Success"
|
Color="Color.Success"
|
||||||
Label="فقط فعالها" />
|
Label="فقط فعالها" />
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ public partial class ClubMembers
|
|||||||
|
|
||||||
private MudDataGrid<ClubMembershipModel> _gridData;
|
private MudDataGrid<ClubMembershipModel> _gridData;
|
||||||
private bool _filterIsActive = true;
|
private bool _filterIsActive = true;
|
||||||
|
private long? _filterUserId;
|
||||||
|
|
||||||
private async Task<GridData<ClubMembershipModel>> ServerReload(GridState<ClubMembershipModel> state)
|
private async Task<GridData<ClubMembershipModel>> ServerReload(GridState<ClubMembershipModel> state)
|
||||||
{
|
{
|
||||||
@@ -30,6 +31,9 @@ public partial class ClubMembers
|
|||||||
// Always use the filter value since it's now a bool (not nullable)
|
// Always use the filter value since it's now a bool (not nullable)
|
||||||
request.IsActive = _filterIsActive;
|
request.IsActive = _filterIsActive;
|
||||||
|
|
||||||
|
if (_filterUserId.HasValue && _filterUserId.Value > 0)
|
||||||
|
request.UserId = _filterUserId.Value;
|
||||||
|
|
||||||
var result = await ClubContract.GetAllClubMembershipsAsync(request);
|
var result = await ClubContract.GetAllClubMembershipsAsync(request);
|
||||||
|
|
||||||
if (result?.Models != null && result.Models.Any())
|
if (result?.Models != null && result.Models.Any())
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
@using CMSMicroservice.Protobuf.Protos.ClubMembership
|
@using CMSMicroservice.Protobuf.Protos.ClubMembership
|
||||||
|
@using BackOffice.Pages.AutoComplete
|
||||||
|
|
||||||
<MudDialog>
|
<MudDialog>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<MudForm @ref="_form" @bind-IsValid="_formValid">
|
<MudForm @ref="_form" @bind-IsValid="_formValid">
|
||||||
<MudStack Spacing="3">
|
<MudStack Spacing="3">
|
||||||
<MudNumericField @bind-Value="_model.UserId"
|
<UserAutoComplete Label="انتخاب کاربر" @bind-SelectedUserId="_model.UserId" />
|
||||||
Label="شناسه کاربر"
|
|
||||||
Required="true"
|
|
||||||
RequiredError="شناسه کاربر الزامی است"
|
|
||||||
Variant="Variant.Outlined" />
|
|
||||||
|
|
||||||
<MudNumericField @bind-Value="_model.PackageId"
|
<MudNumericField @bind-Value="_model.PackageId"
|
||||||
Label="شناسه پکیج"
|
Label="شناسه پکیج"
|
||||||
@@ -67,12 +64,18 @@
|
|||||||
await _form.Validate();
|
await _form.Validate();
|
||||||
if (!_formValid) return;
|
if (!_formValid) return;
|
||||||
|
|
||||||
|
if (!_model.UserId.HasValue || _model.UserId.Value <= 0)
|
||||||
|
{
|
||||||
|
Snackbar.Add("لطفاً کاربر را انتخاب کنید.", Severity.Warning);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_isSubmitting = true;
|
_isSubmitting = true;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var request = new ActivateClubMembershipRequest
|
var request = new ActivateClubMembershipRequest
|
||||||
{
|
{
|
||||||
UserId = _model.UserId,
|
UserId = _model.UserId.Value,
|
||||||
PackageId = _model.PackageId,
|
PackageId = _model.PackageId,
|
||||||
DurationMonths = _model.DurationMonths
|
DurationMonths = _model.DurationMonths
|
||||||
};
|
};
|
||||||
@@ -94,7 +97,7 @@
|
|||||||
|
|
||||||
private class ActivateModel
|
private class ActivateModel
|
||||||
{
|
{
|
||||||
public long UserId { get; set; }
|
public long? UserId { get; set; }
|
||||||
public long PackageId { get; set; }
|
public long PackageId { get; set; }
|
||||||
public int DurationMonths { get; set; } = 1;
|
public int DurationMonths { get; set; } = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,14 @@
|
|||||||
</ToolBarContent>
|
</ToolBarContent>
|
||||||
<Columns>
|
<Columns>
|
||||||
<PropertyColumn Property="x => x.Id" Title="شناسه" />
|
<PropertyColumn Property="x => x.Id" Title="شناسه" />
|
||||||
<PropertyColumn Property="x => x.UserId" Title="کاربر" />
|
<PropertyColumn Property="x => x.UserId" Title="کاربر">
|
||||||
|
<CellTemplate>
|
||||||
|
<MudStack Spacing="0">
|
||||||
|
<MudText Typo="Typo.body2"><strong>@context.Item.UserName</strong></MudText>
|
||||||
|
<MudText Typo="Typo.caption" Color="Color.Secondary">ID: @context.Item.UserId</MudText>
|
||||||
|
</MudStack>
|
||||||
|
</CellTemplate>
|
||||||
|
</PropertyColumn>
|
||||||
<TemplateColumn Title="موجودی اصلی">
|
<TemplateColumn Title="موجودی اصلی">
|
||||||
<CellTemplate>
|
<CellTemplate>
|
||||||
<MudText Color="Color.Primary"><strong>@context.Item.Balance.ToString("N0")</strong> تومان</MudText>
|
<MudText Color="Color.Primary"><strong>@context.Item.Balance.ToString("N0")</strong> تومان</MudText>
|
||||||
|
|||||||
Reference in New Issue
Block a user