\ No newline at end of file
diff --git a/Wonky.Client/Components/Home.razor.cs b/Wonky.Client/Components/Home.razor.cs
index 5169138b..14708771 100644
--- a/Wonky.Client/Components/Home.razor.cs
+++ b/Wonky.Client/Components/Home.razor.cs
@@ -34,10 +34,7 @@ public partial class Home : IDisposable
[Inject] public UserPreferenceService UserPrefs { get; set; }
[Inject] public ILogger Logger { get; set; }
[Inject] private HttpInterceptorService Interceptor { get; set; }
- [Inject] private NavigationManager Navigator { get; set; }
- [Inject] private IActivityHttpRepository ActivityRepo { get; set; }
[Inject] private IToastService _toast { get; set; }
- private NgActivityListView _view { get; set; } = new();
private Preferences _prefs { get; set; } = new();
private string _workDate { get; set; } = $"{DateTime.Now:yyyy-MM-dd}";
@@ -50,15 +47,12 @@ public partial class Home : IDisposable
Interceptor.RegisterEvent();
Interceptor.RegisterBeforeSendEvent();
- await GetActivities(_workDate);
+ await GetCalender(_workDate);
}
- private async Task GetActivities(string workDate)
+ private async Task GetCalender(string workDate)
{
- _toast.ShowInfo("Vent nogle sekunder for data");
_workDate = workDate;
- _view = new NgActivityListView();
- _view = await ActivityRepo.GetActivities(workDate);
}
public void Dispose()
diff --git a/Wonky.Client/HttpInterceptors/HttpInterceptorService.cs b/Wonky.Client/HttpInterceptors/HttpInterceptorService.cs
index 1a0fc942..8f36d43c 100644
--- a/Wonky.Client/HttpInterceptors/HttpInterceptorService.cs
+++ b/Wonky.Client/HttpInterceptors/HttpInterceptorService.cs
@@ -62,7 +62,7 @@ namespace Wonky.Client.HttpInterceptors
_interceptor.BeforeSendAsync -= InterceptBeforeSendAsync;
}
- public async Task InterceptBeforeSendAsync(object sender, HttpClientInterceptorEventArgs e)
+ private async Task InterceptBeforeSendAsync(object sender, HttpClientInterceptorEventArgs e)
{
var absolutePath = e.Request.RequestUri.AbsolutePath;
@@ -78,27 +78,24 @@ namespace Wonky.Client.HttpInterceptors
}
}
- public void AfterSend (object sender, HttpClientInterceptorEventArgs e)
+ private void AfterSend (object sender, HttpClientInterceptorEventArgs e)
{
if (e.Response == null || e.Response.IsSuccessStatusCode)
return;
string message;
var currDoc = _navigation.ToBaseRelativePath(_navigation.Uri);
+ if (currDoc.Contains("login"))
+ currDoc = "/";
switch (e.Response.StatusCode)
{
case HttpStatusCode.NotFound:
//_navigation.NavigateTo("/404");
- message = "Der er ingen data ...";
+ message = "Der var ingen data ...";
_toast.ShowInfo(message);
break;
case HttpStatusCode.BadRequest:
- ClearInfo();
- _navigation.NavigateTo($"/login/{currDoc}");
- message = "Login info skal fornyes ...";
- _toast.ShowInfo(message);
- break;
case HttpStatusCode.Unauthorized:
ClearInfo();
_navigation.NavigateTo($"/login/{currDoc}");
diff --git a/Wonky.Client/Pages/ActivityCreate.razor b/Wonky.Client/Pages/ActivityCreate.razor
index f1503c3e..4538eea8 100644
--- a/Wonky.Client/Pages/ActivityCreate.razor
+++ b/Wonky.Client/Pages/ActivityCreate.razor
@@ -19,6 +19,7 @@
@using Microsoft.AspNetCore.Authorization
@attribute [Authorize(Roles = "Adviser")]
@using Wonky.Client.Components
+
@_workDate.ToLongDateString()
diff --git a/Wonky.Client/Pages/ActivityToday.razor b/Wonky.Client/Pages/ActivityToday.razor
new file mode 100644
index 00000000..69c8bc8a
--- /dev/null
+++ b/Wonky.Client/Pages/ActivityToday.razor
@@ -0,0 +1,66 @@
+@*
+// Copyright (C) 2022 FCS Frede's Computer Services.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as
+// published by the Free Software Foundation, either version 3 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html]
+//
+*@
+@using Microsoft.AspNetCore.Authorization
+@using Wonky.Client.Components
+@attribute [Authorize(Roles = "Adviser")]
+@page "/activity-today"
+
+
\ No newline at end of file
diff --git a/Wonky.Client/Shared/MainLayout.razor b/Wonky.Client/Shared/MainLayout.razor
index 318471cb..9b0e1eb7 100644
--- a/Wonky.Client/Shared/MainLayout.razor
+++ b/Wonky.Client/Shared/MainLayout.razor
@@ -30,10 +30,6 @@