isMobile, message icons, incoming or outgoing
This commit is contained in:
parent
491b7a9669
commit
d2c9186ee3
|
|
@ -365,24 +365,23 @@
|
|||
switch (transferStatusByte)
|
||||
{
|
||||
case 5:
|
||||
return "bg-important";
|
||||
return "bg-important text-body";
|
||||
|
||||
case > 5 and < 35:
|
||||
return "bg-attention";
|
||||
return "bg-attention text-body";
|
||||
|
||||
case 35:
|
||||
return "bg-finished";
|
||||
return "bg-finished text-body";
|
||||
|
||||
case > 35:
|
||||
return "bg-cancel";
|
||||
return "bg-cancel text-body";
|
||||
|
||||
default:
|
||||
return "";
|
||||
return "text-body";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//readonly DriverManageTransfersPageModel PageModel = new();
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,27 +7,22 @@
|
|||
@using TIAMWebApp.Shared.Application.Services
|
||||
@inject ISessionService sessionService;
|
||||
@inject AdminSignalRClient AdminSignalRClient;
|
||||
@* @inject JSRuntime jsRuntime
|
||||
|
||||
<script>
|
||||
function isDevice() {
|
||||
return /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile/i.test(navigator.userAgent);
|
||||
}
|
||||
</script>
|
||||
*@
|
||||
@inject IJSRuntime jsRuntime
|
||||
|
||||
<div class="text-center m-5">
|
||||
<h1>Messages</h1>
|
||||
<h2 style="font-size:small">Manage messages here!</h2>
|
||||
</div>
|
||||
|
||||
<div class="card-body card-admin-body py-2 px-4">
|
||||
<div class="d-flex flex-column mb-4 pb-2">
|
||||
<div class="container-fluid">
|
||||
|
||||
<MessageDetailGridComponent ContextId="UserId" GetAllMessageTag="SignalRTags.GetMessagesByUserId" IsSenderEmailVisible="false" IsMessageTextVisible="!_isMobile"></MessageDetailGridComponent>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@code {
|
||||
[Parameter] public Guid? UserId { get; set; }
|
||||
|
||||
|
|
@ -43,8 +38,7 @@
|
|||
// var upmId = sessionService.User.UserModelDto.UserProductMappings.Select(x => x.Id).FirstOrDefault();
|
||||
// if(!upmId.IsNullOrEmpty()) _contextParams.Add(upmId);
|
||||
|
||||
//_isMobile = await jsRuntime.InvokeAsync<bool>("isDevice");
|
||||
|
||||
_isMobile = await jsRuntime.InvokeAsync<bool>("isDevice");
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
@using AyCode.Core
|
||||
@using AyCode.Core.Enums
|
||||
@using AyCode.Core.Helpers
|
||||
@using TIAM.Entities.Products
|
||||
@using TIAM.Entities.ServiceProviders
|
||||
|
|
@ -6,6 +7,7 @@
|
|||
@using TIAM.Entities.Drivers
|
||||
@using TIAM.Entities.Users
|
||||
@using TIAM.Models.Dtos.Users
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@using TIAMWebApp.Shared.Application.Utility
|
||||
@using AyCode.Services.Loggers
|
||||
|
|
@ -19,6 +21,7 @@
|
|||
@using AyCode.Blazor.Components.Services
|
||||
@using AyCode.Core.Extensions
|
||||
@using TIAM.Services
|
||||
@inherits UserBasePageComponent
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
@inject AdminSignalRClient AdminSignalRClient;
|
||||
|
||||
|
|
@ -33,18 +36,80 @@
|
|||
<DxGridCommandColumn Width="135" MinWidth="135" Visible="AcDomain.IsDeveloperVersion" DeleteButtonVisible="AcDomain.IsDeveloperVersion" EditButtonVisible="AcDomain.IsDeveloperVersion" FixedPosition="GridColumnFixedPosition.Left" />
|
||||
<DxGridDataColumn FieldName="Id" Width="150" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||
<DxGridDataColumn FieldName="ContextId" Width="150px" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||
<DxGridDataColumn FieldName="SenderId" Width="150px" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||
<DxGridDataColumn FieldName="Created" Caption="Received" DisplayFormat="g" Width="130" SortIndex="0" SortOrder="GridColumnSortOrder.Descending" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="ContextType" Caption="Category" Width="75" />
|
||||
<DxGridDataColumn FieldName="Created" Caption="Received" DisplayFormat="g" Width="80" SortIndex="0" SortOrder="GridColumnSortOrder.Descending" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center">
|
||||
<CellDisplayTemplate>
|
||||
@{
|
||||
var Date = ((EmailMessage)context.DataItem).Created.Date;
|
||||
var Time = ((EmailMessage)context.DataItem).Created;
|
||||
<p style="padding:3px; margin: 0 auto;">@Date.ToString("yy.MM.dd")</p>
|
||||
<p style="padding:3px; margin: 0 auto;">@Time.ToString("HH:mm")</p>
|
||||
}
|
||||
</CellDisplayTemplate>
|
||||
</DxGridDataColumn>
|
||||
<DxGridDataColumn FieldName="SenderId" Caption="/" Width="30px" ShowInColumnChooser="AcDomain.IsDeveloperVersion" DisplayFormat="N">
|
||||
<CellDisplayTemplate>
|
||||
@{
|
||||
bool isOutgoing = ((EmailMessage)context.DataItem).SenderId == myUserId;
|
||||
if (isOutgoing)
|
||||
{
|
||||
<i class="fa-solid fa-right-from-bracket text-info"></i>
|
||||
}
|
||||
else
|
||||
{
|
||||
<i class="fa-solid fa-right-to-bracket text-primary"></i>
|
||||
}
|
||||
}
|
||||
<span> | </span>
|
||||
@{
|
||||
MessageContextType a = ((EmailMessage)context.DataItem).ContextType;
|
||||
switch (a)
|
||||
{
|
||||
case MessageContextType.Transfer:
|
||||
{
|
||||
<i class="fa-solid fa-car-side"></i>
|
||||
break;
|
||||
}
|
||||
case MessageContextType.Company:
|
||||
{
|
||||
<i class="fa-solid fa-paperclip"></i>
|
||||
break;
|
||||
}
|
||||
case MessageContextType.Product:
|
||||
{
|
||||
<i class="fa-solid fa-bed"></i>
|
||||
break;
|
||||
}
|
||||
case MessageContextType.Private:
|
||||
{
|
||||
<i class="fa-solid fa-lock"></i>
|
||||
break;
|
||||
}
|
||||
case MessageContextType.Unset:
|
||||
{
|
||||
<i class="fa-solid fa-circle-xmark"></i>
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</CellDisplayTemplate>
|
||||
</DxGridDataColumn>
|
||||
<DxGridDataColumn FieldName="EmailAddress" Caption="Sender" Width="200px" Visible="IsSenderEmailVisible || AcDomain.IsDeveloperVersion" />
|
||||
<DxGridDataColumn FieldName="Subject" />
|
||||
<DxGridDataColumn FieldName="Subject">
|
||||
<CellDisplayTemplate>
|
||||
@{
|
||||
string subjectString = ((EmailMessage)context.DataItem).Subject;
|
||||
<p style="word-break: normal; white-space: normal; padding:0; margin: 0 auto;">@subjectString</p>
|
||||
}
|
||||
</CellDisplayTemplate>
|
||||
</DxGridDataColumn>
|
||||
<DxGridDataColumn FieldName="Text" Visible="@IsMessageTextVisible">
|
||||
<CellDisplayTemplate Context="displayTextContext">
|
||||
<text>@System.Text.RegularExpressions.Regex.Replace((displayTextContext.Value as string)!, "<(.|\n)*?>", string.Empty)</text>
|
||||
</CellDisplayTemplate>
|
||||
</DxGridDataColumn>
|
||||
<DxGridDataColumn FieldName="IsReaded" Caption="Readed" Visible="@IsMessageTextVisible" Width="70" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
|
||||
|
||||
</Columns>
|
||||
<DetailRowTemplate>
|
||||
@{
|
||||
|
|
@ -73,9 +138,12 @@
|
|||
private MessageGrid _messageGrid = null!;
|
||||
private LoggerClient<MessageDetailGridComponent> _logger = null!;
|
||||
|
||||
private Guid? myUserId;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
_logger = new LoggerClient<MessageDetailGridComponent>(LogWriters.ToArray());
|
||||
myUserId = _sessionService.User.UserId;
|
||||
}
|
||||
|
||||
private void CustomizeElement(GridCustomizeElementEventArgs e)
|
||||
|
|
|
|||
|
|
@ -53,6 +53,11 @@
|
|||
<a href="" class="reload">Reload</a>
|
||||
<a class="dismiss">🗙</a>
|
||||
</div>
|
||||
<script>
|
||||
function isDevice() {
|
||||
return /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile/i.test(navigator.userAgent);
|
||||
}
|
||||
</script>
|
||||
<script src="https://kit.fontawesome.com/12c469cb8f.js" crossorigin="anonymous"></script>
|
||||
<script src="_content/TIAMSharedUI/blazorAnimationInterop.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue