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

CFODEV-1051: Wording amendments for incoming/outgoing PRIs #438

Merged
merged 2 commits into from
Jan 29, 2025
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 @@ -18,16 +18,16 @@ public class PRIAdvancedFilter : PaginationFilter
public UserProfile? CurrentUser { get; set; }

/// <summary>
/// Flag to indicate that you only want to see your own cases.
/// Flag to indicate that you only want to see your incoming PRI's.
/// </summary>
[Description("Just My Community PRI's")]
public bool JustMyCommunityPRIs { get; set; } = false;
[Description("Incoming PRIs")]
public bool IncludeIncoming { get; set; } = false;

/// <summary>
/// Flag to indicate that you only want to see your own cases.
/// Flag to indicate that you only want to see your outgoing PRI's.
/// </summary>
[Description("Just My Custody PRI's")]
public bool JustMyCustodyPRIs { get; set; } = false;
[Description("Outgoing PRIs")]
public bool IncludeOutgoing { get; set; } = false;
}

//Leave in if they want a list at some point
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ public class PRIAdvancedSpecification : Specification<Domain.Entities.PRIs.PRI>
{
public PRIAdvancedSpecification(PRIAdvancedFilter filter)
{
Query.Where(p => p.CreatedBy == filter.CurrentUser!.UserId, filter.JustMyCustodyPRIs);
Query.Where(p => p.CreatedBy == filter.CurrentUser!.UserId, filter.IncludeOutgoing);

Query.Where(p => p.AssignedTo == filter.CurrentUser!.UserId, filter.JustMyCommunityPRIs);
Query.Where(p => p.AssignedTo == filter.CurrentUser!.UserId, filter.IncludeIncoming);

Query.Where(
// if we have passed a filter through, search the surname and current location
Expand Down
56 changes: 28 additions & 28 deletions src/Server.UI/Pages/PRIs/ActivePRIs.razor
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@
<ToolBarContent>
<div class="d-flex align-start flex-grow-1">
<MudIcon Icon="@Icons.Material.Filled.Inventory" Size="Size.Large" />
<MudText Typo="Typo.caption">@L["Active Pre - Release Inventory"]</MudText>
<MudText Typo="Typo.caption">@L["Active Pre-Release Inventory (PRI)"]</MudText>

<div class="d-flex flex-column">
<MudSwitch T="bool" Class="mt-10" Value="@Query!.JustMyCustodyPRIs" Label="Just My Custody PRI's" Color="Color.Primary" ValueChanged="OnShowCustodyPRIChanged"></MudSwitch>
<MudSwitch Class="mt-10" @bind-Value="@Query!.IncludeOutgoing" @bind-Value:after="OnOutgoingChange" Label="@Query?.GetMemberDescription(q => q.IncludeOutgoing)" Color="Color.Primary"></MudSwitch>
</div>

<div class="d-flex flex-column">
<MudSwitch T="bool" Class="mt-10" Value="@Query.JustMyCommunityPRIs" Label="Just My Community PRI's" Color="Color.Primary" ValueChanged="OnShowCommunityPRIChanged"></MudSwitch>
<MudSwitch Class="mt-10" @bind-Value="@Query!.IncludeIncoming" @bind-Value:after="OnIncomingChange" Label="@Query?.GetMemberDescription(q => q.IncludeIncoming)" Color="Color.Primary"></MudSwitch>
</div>

<div class="flex-grow-1"></div>
Expand Down Expand Up @@ -103,19 +103,19 @@
</MudMenuItem>

@if (context.Item.ActualReleaseDate == null)
{
<MudMenuItem OnClick="@(()=> AddActualReleaseDate(context.Item))">
@ConstantString.AddActualReleaseDate
</MudMenuItem>
}

<MudMenuItem OnClick="@(()=> CompletePRI(context.Item))">
@ConstantString.CompletePRI
{
<MudMenuItem OnClick="@(()=> AddActualReleaseDate(context.Item))">
@ConstantString.AddActualReleaseDate
</MudMenuItem>
}

<MudMenuItem OnClick="@(()=> AbandonPRI(context.Item))">
@ConstantString.AbandonPRI
</MudMenuItem>
<MudMenuItem OnClick="@(()=> CompletePRI(context.Item))">
@ConstantString.CompletePRI
</MudMenuItem>

<MudMenuItem OnClick="@(()=> AbandonPRI(context.Item))">
@ConstantString.AbandonPRI
</MudMenuItem>
</MudMenu>
</CellTemplate>
</TemplateColumn>
Expand Down Expand Up @@ -193,7 +193,7 @@
</PagerContent>
</MudDataGrid>


@code {
[CascadingParameter] private UserProfile? UserProfile { get; set; }

Expand All @@ -215,11 +215,11 @@
Title = L["Active Pre-Release Inventory"];

Query = new GetActivePRIsByUserId.Query()
{
CurrentUser = UserProfile
};
{
CurrentUser = UserProfile
};

await Task.CompletedTask;
await base.OnInitializedAsync();
}

private async Task<GridData<PRIPaginationDto>> ServerReload(GridState<PRIPaginationDto> state)
Expand Down Expand Up @@ -259,23 +259,23 @@
await _table.ReloadServerData();
}

private async Task OnShowCustodyPRIChanged(bool value)
private async Task OnOutgoingChange()
{
if (value) // Only toggle the other off if this one is turned on
if (Query!.IncludeOutgoing) // Only toggle the other off if this one is turned on
{
Query!.JustMyCommunityPRIs = false;
Query!.IncludeIncoming = false;
}
Query!.JustMyCustodyPRIs = value;

await _table.ReloadServerData();
}

private async Task OnShowCommunityPRIChanged(bool value)
private async Task OnIncomingChange()
{
if (value) // Only toggle the other off if this one is turned on
if (Query!.IncludeIncoming) // Only toggle the other off if this one is turned on
{
Query!.JustMyCustodyPRIs = false;
Query!.IncludeOutgoing = false;
}
Query!.JustMyCommunityPRIs = value;

await _table.ReloadServerData();
}

Expand Down