Compare commits
7 Commits
f9cb10556a
...
fcfe879395
| Author | SHA1 | Date |
|---|---|---|
|
|
fcfe879395 | |
|
|
2a8b267934 | |
|
|
34a58f76ce | |
|
|
9a3a7174db | |
|
|
b67759ced4 | |
|
|
afc3719908 | |
|
|
5ed9b38bb7 |
|
|
@ -10,7 +10,7 @@ public static class FruitBankConstClient
|
||||||
public static string BaseUrl = "https://localhost:59579"; //FrutiBank nop
|
public static string BaseUrl = "https://localhost:59579"; //FrutiBank nop
|
||||||
|
|
||||||
#if RELEASE
|
#if RELEASE
|
||||||
//public static string BaseUrl = "https://shop.fruitbank.hu"; //FrutiBank nop
|
// public static string BaseUrl = "https://shop.fruitbank.hu"; //FrutiBank nop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//public static string BaseUrl = "http://10.0.2.2:59579"; //FrutiBank (android) nop
|
//public static string BaseUrl = "http://10.0.2.2:59579"; //FrutiBank (android) nop
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
<style>
|
||||||
|
.order-notification-toast {
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-notification-toast .message {
|
||||||
|
font-weight: 600;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-notification-toast .order-info {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-notification-toast .label {
|
||||||
|
color: #666;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-notification-toast .order-number {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #0066cc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-notification-toast .date {
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div class="order-notification-toast">
|
||||||
|
<div class="message">@Message</div>
|
||||||
|
@if (!string.IsNullOrEmpty(OrderNumber))
|
||||||
|
{
|
||||||
|
<div class="order-info">
|
||||||
|
<span class="label">Rendelés:</span>
|
||||||
|
<span class="order-number">#@OrderNumber</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
@if (DateOfReceipt.HasValue)
|
||||||
|
{
|
||||||
|
<div class="order-info">
|
||||||
|
<span class="label">Átvétel:</span>
|
||||||
|
<span class="date">@DateOfReceipt.Value.ToString("yyyy-MM-dd HH:mm")</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
[Parameter] public string Message { get; set; } = string.Empty;
|
||||||
|
[Parameter] public string? OrderNumber { get; set; }
|
||||||
|
[Parameter] public DateTime? DateOfReceipt { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
<div class="sidebar">
|
<div class="sidebar">
|
||||||
<NavMenu @ref="_navMenu" />
|
<NavMenu @ref="_navMenu" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<div class="top-row px-4">
|
<div class="top-row px-4">
|
||||||
@if (LoggedInModel.IsLoggedIn)
|
@if (LoggedInModel.IsLoggedIn)
|
||||||
|
|
@ -13,13 +12,11 @@
|
||||||
<div style="float: left; text-align: left;" class="col-md-8">
|
<div style="float: left; text-align: left;" class="col-md-8">
|
||||||
<b>@($"{LoggedInModel.CustomerDto!.FullName} [{string.Join(", ", LoggedInModel.CustomerRoles.Where(x => x.SystemName.Contains("Measuring")).Select(x => x.Name))}]")</b>
|
<b>@($"{LoggedInModel.CustomerDto!.FullName} [{string.Join(", ", LoggedInModel.CustomerRoles.Where(x => x.SystemName.Contains("Measuring")).Select(x => x.Name))}]")</b>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="float: right; text-align: right;" class="col-md-4">
|
<div style="float: right; text-align: right;" class="col-md-4">
|
||||||
<DxButton Text="Kijelentkezés" Click="OnLogoutClick" />
|
<DxButton Text="Kijelentkezés" Click="OnLogoutClick" />
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<article class="content px-4">
|
<article class="content px-4">
|
||||||
<DxToastProvider Name="Positioning"
|
<DxToastProvider Name="Positioning"
|
||||||
MaxToastCount="199"
|
MaxToastCount="199"
|
||||||
|
|
@ -31,7 +28,6 @@
|
||||||
RenderStyle="ToastRenderStyle.Info"
|
RenderStyle="ToastRenderStyle.Info"
|
||||||
ShowCloseButton="true">
|
ShowCloseButton="true">
|
||||||
</DxToastProvider>
|
</DxToastProvider>
|
||||||
|
|
||||||
<CascadingValue Value="RefreshMainLayoutEventCallback">
|
<CascadingValue Value="RefreshMainLayoutEventCallback">
|
||||||
@Body
|
@Body
|
||||||
</CascadingValue>
|
</CascadingValue>
|
||||||
|
|
@ -39,6 +35,29 @@
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Custom Toast for Order Notifications -->
|
||||||
|
<DxToast @ref="orderNotificationToast"
|
||||||
|
Title="@toastTitle"
|
||||||
|
ProviderName="Positioning">
|
||||||
|
<div class="order-notification-toast">
|
||||||
|
<div class="message">@toastMessage</div>
|
||||||
|
@if (!string.IsNullOrEmpty(toastOrderNumber))
|
||||||
|
{
|
||||||
|
<div class="order-info">
|
||||||
|
<span class="label">Rendelés:</span>
|
||||||
|
<span class="order-number">#@toastOrderNumber</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
@if (toastDateOfReceipt.HasValue)
|
||||||
|
{
|
||||||
|
<div class="order-info">
|
||||||
|
<span class="label">Átvétel:</span>
|
||||||
|
<span class="date">@toastDateOfReceipt.Value.ToString("yyyy-MM-dd HH:mm")</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</DxToast>
|
||||||
|
|
||||||
<div id="blazor-error-ui" data-nosnippet>
|
<div id="blazor-error-ui" data-nosnippet>
|
||||||
An unhandled error has occurred.
|
An unhandled error has occurred.
|
||||||
<a href="." class="reload">Reload</a>
|
<a href="." class="reload">Reload</a>
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace FruitBankHybrid.Shared.Layout;
|
||||||
public partial class MainLayout : LayoutComponentBase
|
public partial class MainLayout : LayoutComponentBase
|
||||||
{
|
{
|
||||||
[Inject] public required IEnumerable<IAcLogWriterClientBase> LogWriters { get; set; }
|
[Inject] public required IEnumerable<IAcLogWriterClientBase> LogWriters { get; set; }
|
||||||
[Inject] public required NavigationManager NavManager{ get; set; }
|
[Inject] public required NavigationManager NavManager { get; set; }
|
||||||
[Inject] public required LoggedInModel LoggedInModel { get; set; }
|
[Inject] public required LoggedInModel LoggedInModel { get; set; }
|
||||||
[Inject] IToastNotificationService ToastService { get; set; }
|
[Inject] IToastNotificationService ToastService { get; set; }
|
||||||
[Inject] public required FruitBankSignalRClient FruitBankSignalRClient { get; set; }
|
[Inject] public required FruitBankSignalRClient FruitBankSignalRClient { get; set; }
|
||||||
|
|
@ -28,13 +28,18 @@ public partial class MainLayout : LayoutComponentBase
|
||||||
private NavMenu _navMenu = null!;
|
private NavMenu _navMenu = null!;
|
||||||
private LoggerClient _logger = null!;
|
private LoggerClient _logger = null!;
|
||||||
|
|
||||||
|
// Toast fields
|
||||||
|
private DxToast orderNotificationToast;
|
||||||
|
private string toastTitle = "Értesítő!";
|
||||||
|
private string toastMessage = "";
|
||||||
|
private string? toastOrderNumber;
|
||||||
|
private DateTime? toastDateOfReceipt;
|
||||||
|
|
||||||
protected override void OnInitialized()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
_logger = new LoggerClient<MainLayout>(LogWriters.ToArray());
|
_logger = new LoggerClient<MainLayout>(LogWriters.ToArray());
|
||||||
_logger.Info("OnInitializedAsync");
|
_logger.Info("OnInitializedAsync");
|
||||||
|
|
||||||
var loginUri = NavManager.ToAbsoluteUri("/Login").ToString();
|
var loginUri = NavManager.ToAbsoluteUri("/Login").ToString();
|
||||||
|
|
||||||
FruitBankSignalRClient.OnMessageReceived += SignalRClientOnMessageReceived;
|
FruitBankSignalRClient.OnMessageReceived += SignalRClientOnMessageReceived;
|
||||||
|
|
||||||
if (!LoggedInModel.IsLoggedIn && NavManager.Uri != loginUri)
|
if (!LoggedInModel.IsLoggedIn && NavManager.Uri != loginUri)
|
||||||
|
|
@ -57,31 +62,26 @@ public partial class MainLayout : LayoutComponentBase
|
||||||
var orderDto = notificationMessage.Content;
|
var orderDto = notificationMessage.Content;
|
||||||
if ((orderDto?.HasMeasuringAccess(LoggedInModel.CustomerDto!.Id, LoggedInModel.IsRevisor) ?? LoggedInModel.IsRevisor) || orderDto?.MeasurementOwnerId == 0)
|
if ((orderDto?.HasMeasuringAccess(LoggedInModel.CustomerDto!.Id, LoggedInModel.IsRevisor) ?? LoggedInModel.IsRevisor) || orderDto?.MeasurementOwnerId == 0)
|
||||||
{
|
{
|
||||||
var messageText = $"{notificationMessage.Message}";
|
toastMessage = notificationMessage.Message;
|
||||||
if (orderDto != null)
|
toastOrderNumber = orderDto?.CustomOrderNumber;
|
||||||
{
|
toastDateOfReceipt = orderDto?.DateOfReceipt;
|
||||||
messageText += $" Rendelés: #{orderDto.CustomOrderNumber}. Átvétel: {orderDto.DateOfReceipt}";
|
|
||||||
}
|
|
||||||
|
|
||||||
_logger.Debug($"NotificationMessage received. {messageText}");
|
_logger.Debug($"NotificationMessage received. {toastMessage}");
|
||||||
|
|
||||||
ToastService.ShowToast(new ToastOptions
|
InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
ProviderName = "Positioning",
|
orderNotificationToast?.Show();
|
||||||
Title = "Értesítő!",
|
StateHasChanged();
|
||||||
Text = messageText,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnLogoutClick()
|
private void OnLogoutClick()
|
||||||
{
|
{
|
||||||
LoggedInModel.LogOut();
|
LoggedInModel.LogOut();
|
||||||
|
|
||||||
RefreshMainLayout();
|
RefreshMainLayout();
|
||||||
NavManager.NavigateTo("/Login");
|
NavManager.NavigateTo("/Login");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -104,3 +104,34 @@ h1:focus {
|
||||||
--dxbl-grid-row-bg: var(--DS-color-surface-neutral-subdued-rest);
|
--dxbl-grid-row-bg: var(--DS-color-surface-neutral-subdued-rest);
|
||||||
}*/
|
}*/
|
||||||
/*endregion: DSGrids*/
|
/*endregion: DSGrids*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.order-notification-toast {
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-notification-toast .message {
|
||||||
|
font-weight: 600;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-notification-toast .order-info {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-notification-toast .label {
|
||||||
|
color: #666;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-notification-toast .order-number {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #0066cc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-notification-toast .date {
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
@ -30,6 +30,7 @@ Global
|
||||||
{85ADEDE3-C271-47DF-B273-2EDB32792CEF}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
{85ADEDE3-C271-47DF-B273-2EDB32792CEF}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||||
{85ADEDE3-C271-47DF-B273-2EDB32792CEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{85ADEDE3-C271-47DF-B273-2EDB32792CEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{85ADEDE3-C271-47DF-B273-2EDB32792CEF}.Release|Any CPU.Build.0 = Release|Any CPU
|
{85ADEDE3-C271-47DF-B273-2EDB32792CEF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{85ADEDE3-C271-47DF-B273-2EDB32792CEF}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||||
{899988C3-8F36-4B19-A1DE-1D1D85F114D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{899988C3-8F36-4B19-A1DE-1D1D85F114D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{899988C3-8F36-4B19-A1DE-1D1D85F114D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{899988C3-8F36-4B19-A1DE-1D1D85F114D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{899988C3-8F36-4B19-A1DE-1D1D85F114D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{899988C3-8F36-4B19-A1DE-1D1D85F114D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue