Skip to content

Commit

Permalink
feat (MessageRelay/UI): Add indicator to UI when message has been rel…
Browse files Browse the repository at this point in the history
…ayed successfully. (rnwood#774)

+ Relay recipients added to table MessageRelay
  • Loading branch information
jafin committed Aug 7, 2021
1 parent 37f59c2 commit edecd5a
Show file tree
Hide file tree
Showing 18 changed files with 992 additions and 600 deletions.
4 changes: 3 additions & 1 deletion Rnwood.Smtp4dev.Tests/TestMessagesRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ public Task DeleteAllMessages()
return Task.CompletedTask;
}

public Task DeleteMessage(Guid id)
public Smtp4devDbContext DbContext => throw new NotImplementedException();

public Task DeleteMessage(Guid id)
{
Messages.RemoveAll(m => m.Id == id);
return Task.CompletedTask;
Expand Down
12 changes: 5 additions & 7 deletions Rnwood.Smtp4dev/ApiModel/MessageSummary.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using MimeKit;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System;

namespace Rnwood.Smtp4dev.ApiModel
{
Expand All @@ -18,8 +13,11 @@ public MessageSummary(DbModel.Message dbMessage)
Subject = dbMessage.Subject;
AttachmentCount = dbMessage.AttachmentCount;
IsUnread = dbMessage.IsUnread;
IsRelayed = dbMessage.Relays.Count > 0;
}

public bool IsRelayed { get; set; }

public Guid Id { get; set; }

public string From { get; set; }
Expand All @@ -32,6 +30,6 @@ public MessageSummary(DbModel.Message dbMessage)

public bool IsUnread { get; set; }

string ICacheByKey.CacheKey => Id.ToString() + IsUnread.ToString();
string ICacheByKey.CacheKey => Id.ToString() + IsUnread + IsRelayed;
}
}
50 changes: 28 additions & 22 deletions Rnwood.Smtp4dev/ClientApp/src/ApiClient/MessageSummary.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@

export default class MessageSummary {
constructor(
id: string,
from: string,
to: string,
receivedDate: Date,
subject: string,
attachmentCount: number,
isUnread: boolean,
isRelayed: boolean,
) {
this.id = id;
this.from = from;
this.to = to;
this.receivedDate = receivedDate;
this.subject = subject;
this.attachmentCount = attachmentCount;
this.isUnread = isUnread;
this.isRelayed = isRelayed;
}

export default class MessageSummary {

constructor(id: string, from: string, to: string, receivedDate: Date, subject: string, attachmentCount: number, isUnread: boolean, ) {

this.id = id;
this.from = from;
this.to = to;
this.receivedDate = receivedDate;
this.subject = subject;
this.attachmentCount = attachmentCount;
this.isUnread = isUnread;
}


id: string;
from: string;
to: string;
receivedDate: Date;
subject: string;
attachmentCount: number;
isUnread: boolean;
id: string;
from: string;
to: string;
receivedDate: Date;
subject: string;
attachmentCount: number;
isUnread: boolean;
isRelayed: boolean;
}
4 changes: 2 additions & 2 deletions Rnwood.Smtp4dev/ClientApp/src/components/app/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<script lang="ts">
import Vue from "vue";
import { Component } from "vue-property-decorator";
import '@fortawesome/fontawesome-free/css/all.css'
import '@fortawesome/fontawesome-free/js/all.js'
@Component({})
export default class AppComponent extends Vue {}
Expand All @@ -24,7 +26,5 @@ $--button-small-padding-vertical: 7px;
$--button-small-padding-horizontal: 12px;
$--input-small-padding-vertical: 7px;
@import "~element-ui/packages/theme-chalk/src/index";
</style>

0 comments on commit edecd5a

Please sign in to comment.