From c514d63c95ce7745c097672d00d5d4d34a94e329 Mon Sep 17 00:00:00 2001 From: Amadeusz Nowak Date: Sun, 2 Jun 2024 14:27:24 +0200 Subject: [PATCH 01/15] (#57) set form fields not to allow floating labels at page for updating an event --- .../Pages/Events/EventCreate.razor | 3 +- .../Pages/Events/EventUpdate.razor | 45 ++++++++++++------- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/EventCreate.razor b/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/EventCreate.razor index 0cdca58ed..a215bcfaf 100644 --- a/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/EventCreate.razor +++ b/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/EventCreate.razor @@ -146,7 +146,8 @@ @if (publishInfo == 2) { - + - + - + - + - + - + - + @@ -67,10 +73,12 @@ - + - + - + - + - + - + - + @@ -108,7 +121,8 @@ @if (publishInfo == 2) { - + - + From e7cd62b5ffb7e6a09e68c86059399034c9bad11c Mon Sep 17 00:00:00 2001 From: Amadeusz Nowak Date: Sun, 2 Jun 2024 14:29:34 +0200 Subject: [PATCH 02/15] (#57) fix url in navigation after handling post update --- MiniSpace.Web/src/MiniSpace.Web/Pages/Posts/PostUpdate.razor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MiniSpace.Web/src/MiniSpace.Web/Pages/Posts/PostUpdate.razor b/MiniSpace.Web/src/MiniSpace.Web/Pages/Posts/PostUpdate.razor index 36a8c8fbf..ddf77fe04 100644 --- a/MiniSpace.Web/src/MiniSpace.Web/Pages/Posts/PostUpdate.razor +++ b/MiniSpace.Web/src/MiniSpace.Web/Pages/Posts/PostUpdate.razor @@ -100,7 +100,7 @@ } else { - NavigationManager.NavigateTo($"events/{EventId}/posts/{PostId}/author/{AuthorName}"); + NavigationManager.NavigateTo($"events/{EventId}/posts/{PostId}"); } } } From 47d8ceb3230d1f72f98cbfcc984d70a1cf7cbfde Mon Sep 17 00:00:00 2001 From: Amadeusz Nowak Date: Sun, 2 Jun 2024 14:35:28 +0200 Subject: [PATCH 03/15] (#57) fix wrapping text without spaces for post content --- .../src/MiniSpace.Web/Components/RadzenPostCard.razor | 3 ++- MiniSpace.Web/src/MiniSpace.Web/Pages/Posts/Post.razor | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/MiniSpace.Web/src/MiniSpace.Web/Components/RadzenPostCard.razor b/MiniSpace.Web/src/MiniSpace.Web/Components/RadzenPostCard.razor index 5ea09ab64..5c332ce62 100644 --- a/MiniSpace.Web/src/MiniSpace.Web/Components/RadzenPostCard.razor +++ b/MiniSpace.Web/src/MiniSpace.Web/Components/RadzenPostCard.razor @@ -33,7 +33,8 @@ - + @(Post.TextContent) diff --git a/MiniSpace.Web/src/MiniSpace.Web/Pages/Posts/Post.razor b/MiniSpace.Web/src/MiniSpace.Web/Pages/Posts/Post.razor index 57afafb39..1384cec7b 100644 --- a/MiniSpace.Web/src/MiniSpace.Web/Pages/Posts/Post.razor +++ b/MiniSpace.Web/src/MiniSpace.Web/Pages/Posts/Post.razor @@ -91,7 +91,8 @@ - + @(post.TextContent) From 8bd2228f3ae8200bafc235a55f49a9cfcfa894ba Mon Sep 17 00:00:00 2001 From: Amadeusz Nowak Date: Sun, 2 Jun 2024 15:03:49 +0200 Subject: [PATCH 04/15] (#57) first fixes for (#259) --- .../Pages/Events/Dialogs/InviteFriendsToEventDialog.razor | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/Dialogs/InviteFriendsToEventDialog.razor b/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/Dialogs/InviteFriendsToEventDialog.razor index cde004a66..4686d0d87 100644 --- a/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/Dialogs/InviteFriendsToEventDialog.razor +++ b/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/Dialogs/InviteFriendsToEventDialog.razor @@ -26,7 +26,7 @@ Friend - @($"{friend.StudentDetails.FirstName} {friend.StudentDetails.LastName}") + @($"{friend.StudentDetails?.FirstName} {friend.StudentDetails?.LastName}") @@ -60,8 +60,10 @@ { foreach (var friend in friends) { + if (friend.StudentDetails == null) continue; + Console.WriteLine(friend.StudentDetails.ProfileImage); var result = await MediaFilesService.GetFileAsync(friend.StudentDetails.ProfileImage); - images[friend.FriendId] = result?.Base64Content ?? "images/user_default.png"; + images[friend.StudentDetails.Id] = result?.Base64Content ?? "images/user_default.png"; } } From 128d60efc49514526caeeb4727490978f1e6d8dd Mon Sep 17 00:00:00 2001 From: Amadeusz Nowak Date: Sun, 2 Jun 2024 15:12:30 +0200 Subject: [PATCH 05/15] (#57) fix #259 but only by frontend side --- .../Dialogs/InviteFriendsToEventDialog.razor | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/Dialogs/InviteFriendsToEventDialog.razor b/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/Dialogs/InviteFriendsToEventDialog.razor index 4686d0d87..96c7d18a3 100644 --- a/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/Dialogs/InviteFriendsToEventDialog.razor +++ b/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/Dialogs/InviteFriendsToEventDialog.razor @@ -21,17 +21,20 @@ @foreach (var friend in friends) { - - - - - Friend - @($"{friend.StudentDetails?.FirstName} {friend.StudentDetails?.LastName}") - + @if (friend.StudentDetails != null) + { + + + + + Friend + @($"{friend.StudentDetails?.FirstName} {friend.StudentDetails?.LastName}") + + - - + + } } From 2fbea5e6a087408b9654e63bbba16b04af563e38 Mon Sep 17 00:00:00 2001 From: Amadeusz Nowak Date: Sun, 2 Jun 2024 15:55:19 +0200 Subject: [PATCH 06/15] (#57) update default values of fields for creating an event --- .../src/MiniSpace.Web/Pages/Events/EventCreate.razor | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/EventCreate.razor b/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/EventCreate.razor index a215bcfaf..c7efbebd6 100644 --- a/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/EventCreate.razor +++ b/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/EventCreate.razor @@ -225,18 +225,18 @@ private CreateEventModel _createEventModel = new() { Name = "One of first events!", - Category = "Art", + Category = "Education", StartDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0,0,0), - EndDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0,0,0), + EndDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day + 1, 0,0,0), BuildingName = "Gmach Główny", Street = "Plac Politechniki", BuildingNumber = "1", ApartmentNumber = "1", City = "Warszawa", - ZipCode = "00-061", + ZipCode = "00-661", Description = "Great event!", Capacity = 30, - Fee = 34.44M + Fee = 15.00M }; private bool showError = false; private string errorMessage = string.Empty; From adb1c60478cf8e6ccd2b9dbd4ddabb66d6a06187 Mon Sep 17 00:00:00 2001 From: Amadeusz Nowak Date: Sun, 2 Jun 2024 16:08:05 +0200 Subject: [PATCH 07/15] (#57) fix fullname at show account page --- MiniSpace.Web/src/MiniSpace.Web/DTO/StudentDto.cs | 1 + MiniSpace.Web/src/MiniSpace.Web/Pages/Account/ShowAccount.razor | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/MiniSpace.Web/src/MiniSpace.Web/DTO/StudentDto.cs b/MiniSpace.Web/src/MiniSpace.Web/DTO/StudentDto.cs index 629e4c423..f05da8759 100644 --- a/MiniSpace.Web/src/MiniSpace.Web/DTO/StudentDto.cs +++ b/MiniSpace.Web/src/MiniSpace.Web/DTO/StudentDto.cs @@ -9,6 +9,7 @@ public class StudentDto public string Email { get; set; } public string FirstName { get; set; } public string LastName { get; set; } + public string FullName => $"{FirstName} {LastName}"; public int NumberOfFriends { get; set; } public Guid ProfileImage { get; set; } public string Description { get; set; } diff --git a/MiniSpace.Web/src/MiniSpace.Web/Pages/Account/ShowAccount.razor b/MiniSpace.Web/src/MiniSpace.Web/Pages/Account/ShowAccount.razor index ccf90f556..bfb1ab0bb 100644 --- a/MiniSpace.Web/src/MiniSpace.Web/Pages/Account/ShowAccount.razor +++ b/MiniSpace.Web/src/MiniSpace.Web/Pages/Account/ShowAccount.razor @@ -39,7 +39,7 @@ } - + @if (studentDto.State == "valid") From 6ba97f2fc0c0b16269c195b1e661e7a016dba959 Mon Sep 17 00:00:00 2001 From: Amadeusz Nowak Date: Sun, 2 Jun 2024 16:22:23 +0200 Subject: [PATCH 08/15] (#57) add refreshing datagrid component for admin reports --- MiniSpace.Web/src/MiniSpace.Web/Pages/Admin/ManageReports.razor | 1 + 1 file changed, 1 insertion(+) diff --git a/MiniSpace.Web/src/MiniSpace.Web/Pages/Admin/ManageReports.razor b/MiniSpace.Web/src/MiniSpace.Web/Pages/Admin/ManageReports.razor index 8ba6a53a4..c2910342f 100644 --- a/MiniSpace.Web/src/MiniSpace.Web/Pages/Admin/ManageReports.razor +++ b/MiniSpace.Web/src/MiniSpace.Web/Pages/Admin/ManageReports.razor @@ -200,5 +200,6 @@ Width = "700px", Height = "600px", Resizable = true, Draggable = true, AutoFocusFirstElement = false }); + StateHasChanged(); } } From a76bb1be9e999785a21b1b4fecd141330528d00e Mon Sep 17 00:00:00 2001 From: Amadeusz Nowak Date: Sun, 2 Jun 2024 16:39:47 +0200 Subject: [PATCH 09/15] (#57)(#260) add using of LocalStorage to save criteria for searching events --- .../Pages/Events/EventsSearch.razor | 52 ++++++++++++------- .../src/MiniSpace.Web/Shared/MainLayout.razor | 1 + 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/EventsSearch.razor b/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/EventsSearch.razor index 887fc8e9f..51f68fec4 100644 --- a/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/EventsSearch.razor +++ b/MiniSpace.Web/src/MiniSpace.Web/Pages/Events/EventsSearch.razor @@ -22,7 +22,7 @@ @inject IStudentsService StudentsService @inject IIdentityService IdentityService @inject NavigationManager NavigationManager - +@inject Blazored.LocalStorage.ILocalStorageService LocalStorage