From ee48202da721ff759998fe8f422125c100076837 Mon Sep 17 00:00:00 2001 From: Amin_Shokrzade_geeksltd Date: Tue, 15 Aug 2023 13:56:29 +0100 Subject: [PATCH] Add Order ro Board --- Olive.Email/Email.Sending/EmailOutbox.cs | 2 +- Olive.Email/Email.Sending/EmailRepository.cs | 6 ++---- Olive.Email/Email.Sending/IEmailRepository.cs | 2 +- Olive.Email/Olive.Email.csproj | 2 +- Olive.Mvc.Microservices/Navigation/Board/BoardBox.cs | 6 ++++++ Olive.Mvc.Microservices/Navigation/Board/BoardBoxContent.cs | 5 +++++ Olive.Mvc.Microservices/Navigation/Navigation.cs | 2 +- Olive.Mvc.Microservices/Olive.Mvc.Microservices.csproj | 2 +- 8 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Olive.Email/Email.Sending/EmailOutbox.cs b/Olive.Email/Email.Sending/EmailOutbox.cs index 5f9c0c133..b66c0f35f 100644 --- a/Olive.Email/Email.Sending/EmailOutbox.cs +++ b/Olive.Email/Email.Sending/EmailOutbox.cs @@ -52,7 +52,7 @@ public async Task SendAll(TimeSpan? delayPerSend = null) async Task DoSendAll(TimeSpan? delayPerSend) { - var toSend = await Repository.GetUnsentEmails(); + var toSend = await Repository.GetUnsentEmails(); Log.Info($"Loaded {toSend.Count()} emails to send ..."); diff --git a/Olive.Email/Email.Sending/EmailRepository.cs b/Olive.Email/Email.Sending/EmailRepository.cs index f42b69f0f..9a3a31be2 100644 --- a/Olive.Email/Email.Sending/EmailRepository.cs +++ b/Olive.Email/Email.Sending/EmailRepository.cs @@ -18,12 +18,10 @@ public EmailRepository(IConfiguration config) Config = config.GetSection("Email").Get(); } - public async Task> GetUnsentEmails() where T : IEmailMessage + public async Task> GetUnsentEmails() { - var records = await Database.GetList(); + var records = await Database.Of().GetList(); var result = records - .OfType() - .Cast() .Where(x => x.Retries < Config.MaxRetries) .OrderBy(x => x.SendableDate); diff --git a/Olive.Email/Email.Sending/IEmailRepository.cs b/Olive.Email/Email.Sending/IEmailRepository.cs index cfe317ef5..9aa9d1ff0 100644 --- a/Olive.Email/Email.Sending/IEmailRepository.cs +++ b/Olive.Email/Email.Sending/IEmailRepository.cs @@ -11,7 +11,7 @@ namespace Olive.Email public interface IEmailRepository { /// Gets all emails ready to be sent. - Task> GetUnsentEmails() where T : IEmailMessage; + Task> GetUnsentEmails(); /// Gets all emails that have been sent Task> GetSentEmails() where T : IEmailMessage; diff --git a/Olive.Email/Olive.Email.csproj b/Olive.Email/Olive.Email.csproj index f1731b7b6..19cf17d28 100644 --- a/Olive.Email/Olive.Email.csproj +++ b/Olive.Email/Olive.Email.csproj @@ -1,7 +1,7 @@  netcoreapp3.1 - 3.1.118 + 3.1.120 diff --git a/Olive.Mvc.Microservices/Navigation/Board/BoardBox.cs b/Olive.Mvc.Microservices/Navigation/Board/BoardBox.cs index 8b9ca6afe..555fdaec5 100644 --- a/Olive.Mvc.Microservices/Navigation/Board/BoardBox.cs +++ b/Olive.Mvc.Microservices/Navigation/Board/BoardBox.cs @@ -26,12 +26,18 @@ public class BoardBox /// internal string Title { get; set; } + /// + /// Order number in board + /// + internal int Order { get; set; } + public void Add(Action action) => action(this); BoardBoxContent Add(BoardBoxContent content) { content.BoxColour = Colour; content.BoxTitle = Title; + content.BoxOrder = Order; Navigation.BoardContents.Add(content); return content; } diff --git a/Olive.Mvc.Microservices/Navigation/Board/BoardBoxContent.cs b/Olive.Mvc.Microservices/Navigation/Board/BoardBoxContent.cs index 69a5e8bda..84071d098 100644 --- a/Olive.Mvc.Microservices/Navigation/Board/BoardBoxContent.cs +++ b/Olive.Mvc.Microservices/Navigation/Board/BoardBoxContent.cs @@ -16,5 +16,10 @@ public class BoardBoxContent /// Type of the item /// public string BoxTitle { get; set; } + + /// + /// Order of the item + /// + public int BoxOrder { get; set; } } } \ No newline at end of file diff --git a/Olive.Mvc.Microservices/Navigation/Navigation.cs b/Olive.Mvc.Microservices/Navigation/Navigation.cs index be268b937..180d1fdde 100644 --- a/Olive.Mvc.Microservices/Navigation/Navigation.cs +++ b/Olive.Mvc.Microservices/Navigation/Navigation.cs @@ -88,7 +88,7 @@ protected void AddIntro(string name, string url, string imageUrl = null, string }); } - protected BoardBox ForBox(string boxTitle, string colour) => new BoardBox(this) { Title = boxTitle, Colour = colour }; + protected BoardBox ForBox(string boxTitle, string colour,int order=-1) => new BoardBox(this) { Title = boxTitle, Colour = colour, Order=order }; protected void Add(Feature feature) => Features.Add(feature); diff --git a/Olive.Mvc.Microservices/Olive.Mvc.Microservices.csproj b/Olive.Mvc.Microservices/Olive.Mvc.Microservices.csproj index 50391f3c9..ca268a430 100644 --- a/Olive.Mvc.Microservices/Olive.Mvc.Microservices.csproj +++ b/Olive.Mvc.Microservices/Olive.Mvc.Microservices.csproj @@ -1,7 +1,7 @@  netcoreapp3.1 - 3.1.150 + 3.1.151