Skip to content

Commit

Permalink
Add Order ro Board
Browse files Browse the repository at this point in the history
  • Loading branch information
GeeksAmin committed Aug 15, 2023
1 parent 5bb7609 commit ee48202
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Olive.Email/Email.Sending/EmailOutbox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public async Task SendAll(TimeSpan? delayPerSend = null)

async Task DoSendAll(TimeSpan? delayPerSend)
{
var toSend = await Repository.GetUnsentEmails<IEmailMessage>();
var toSend = await Repository.GetUnsentEmails();

Log.Info($"Loaded {toSend.Count()} emails to send ...");

Expand Down
6 changes: 2 additions & 4 deletions Olive.Email/Email.Sending/EmailRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ public EmailRepository(IConfiguration config)
Config = config.GetSection("Email").Get<EmailConfiguration>();
}

public async Task<IEnumerable<T>> GetUnsentEmails<T>() where T : IEmailMessage
public async Task<IEnumerable<IEmailMessage>> GetUnsentEmails()
{
var records = await Database.GetList<T>();
var records = await Database.Of<IEmailMessage>().GetList();
var result = records
.OfType<Entity>()
.Cast<T>()
.Where(x => x.Retries < Config.MaxRetries)
.OrderBy(x => x.SendableDate);

Expand Down
2 changes: 1 addition & 1 deletion Olive.Email/Email.Sending/IEmailRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Olive.Email
public interface IEmailRepository
{
/// <summary>Gets all emails ready to be sent.</summary>
Task<IEnumerable<T>> GetUnsentEmails<T>() where T : IEmailMessage;
Task<IEnumerable<IEmailMessage>> GetUnsentEmails();

/// <summary>Gets all emails that have been sent</summary>
Task<IEnumerable<T>> GetSentEmails<T>() where T : IEmailMessage;
Expand Down
2 changes: 1 addition & 1 deletion Olive.Email/Olive.Email.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>3.1.118</Version>
<Version>3.1.120</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions Olive.Mvc.Microservices/Navigation/Board/BoardBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@ public class BoardBox
/// </summary>
internal string Title { get; set; }

/// <summary>
/// Order number in board
/// </summary>
internal int Order { get; set; }

public void Add(Action<BoardBox> action) => action(this);

BoardBoxContent Add(BoardBoxContent content)
{
content.BoxColour = Colour;
content.BoxTitle = Title;
content.BoxOrder = Order;
Navigation.BoardContents.Add(content);
return content;
}
Expand Down
5 changes: 5 additions & 0 deletions Olive.Mvc.Microservices/Navigation/Board/BoardBoxContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,10 @@ public class BoardBoxContent
/// Type of the item
/// </summary>
public string BoxTitle { get; set; }

/// <summary>
/// Order of the item
/// </summary>
public int BoxOrder { get; set; }
}
}
2 changes: 1 addition & 1 deletion Olive.Mvc.Microservices/Navigation/Navigation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion Olive.Mvc.Microservices/Olive.Mvc.Microservices.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>3.1.150</Version>
<Version>3.1.151</Version>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit ee48202

Please sign in to comment.