@social-mail/social-mail-client 1.2.63 → 1.2.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/AdminAppIndex.pack.js +5 -1
- package/dist/admin/AdminAppIndex.pack.js.map +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
- package/dist/common/pages/websites/list/WebSiteListPage.d.ts.map +1 -1
- package/dist/common/pages/websites/list/WebSiteListPage.js +5 -1
- package/dist/common/pages/websites/list/WebSiteListPage.js.map +1 -1
- package/dist/public/channel/BlogService.d.ts +4 -0
- package/dist/public/channel/BlogService.d.ts.map +1 -1
- package/dist/public/channel/BlogService.js +11 -0
- package/dist/public/channel/BlogService.js.map +1 -1
- package/dist/public/channel/ChannelMessage.d.ts.map +1 -1
- package/dist/public/channel/ChannelMessage.js +28 -4
- package/dist/public/channel/ChannelMessage.js.map +1 -1
- package/dist/public/channel/ChannelMessageList.d.ts.map +1 -1
- package/dist/public/channel/ChannelMessageList.js +5 -4
- package/dist/public/channel/ChannelMessageList.js.map +1 -1
- package/dist/public/channel/ChannelView.pack.js +4037 -3976
- package/dist/public/channel/ChannelView.pack.js.map +1 -1
- package/dist/public/channel/ChannelView.pack.min.js +4 -4
- package/dist/public/channel/ChannelView.pack.min.js.map +1 -1
- package/dist/public/channel/UrlService.d.ts +4 -0
- package/dist/public/channel/UrlService.d.ts.map +1 -0
- package/dist/public/channel/UrlService.js +22 -0
- package/dist/public/channel/UrlService.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/web/AppIndex.pack.js +5 -1
- package/dist/web/AppIndex.pack.js.map +1 -1
- package/dist/web/AppIndex.pack.min.js +1 -1
- package/dist/web/AppIndex.pack.min.js.map +1 -1
- package/package.json +1 -1
- package/src/common/pages/websites/list/WebSiteListPage.tsx +3 -1
- package/src/public/channel/BlogService.ts +10 -0
- package/src/public/channel/ChannelMessage.tsx +19 -1
- package/src/public/channel/ChannelMessageList.tsx +2 -1
- package/src/public/channel/UrlService.ts +12 -0
package/package.json
CHANGED
|
@@ -31,7 +31,9 @@ export default class WebSiteListPage extends ContentPage {
|
|
|
31
31
|
data-layout="data-grid"
|
|
32
32
|
items={Bind.oneWayAsync(() => this.websiteService.list(this.search))}
|
|
33
33
|
itemRenderer={(item) => <div data-layout="row">
|
|
34
|
-
<
|
|
34
|
+
<a data-click-event="route"
|
|
35
|
+
href={AppCommands.editWebSite.displayRoute({ id: item.folderID })}
|
|
36
|
+
text={item.folder.name}/>
|
|
35
37
|
<a
|
|
36
38
|
data-click-event="route"
|
|
37
39
|
href={CommonCommands.editWebSite.displayRoute({ id: item.folderID})}>
|
|
@@ -15,6 +15,16 @@ export default class BlogService {
|
|
|
15
15
|
@Inject
|
|
16
16
|
downloader: EmailContentDownloader;
|
|
17
17
|
|
|
18
|
+
async getEmail({
|
|
19
|
+
emailID,
|
|
20
|
+
channelID
|
|
21
|
+
}) {
|
|
22
|
+
const q = this.entityService.query(Email, "channelEmails", channelID)
|
|
23
|
+
.where({ emailID }, (p) => (x) => x.emailID === p.emailID)
|
|
24
|
+
.include((x) => [x.children]);
|
|
25
|
+
return q.firstOrDefault();
|
|
26
|
+
}
|
|
27
|
+
|
|
18
28
|
async getEmails({
|
|
19
29
|
channelID = 0,
|
|
20
30
|
search = "",
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import InjectProperty from "@web-atoms/core/dist/core/InjectProperty";
|
|
2
2
|
import { AtomControl } from "@web-atoms/core/dist/web/controls/AtomControl";
|
|
3
3
|
import BlogService from "./BlogService";
|
|
4
|
+
import XNode from "@web-atoms/core/dist/core/XNode";
|
|
5
|
+
import { DateFormats } from "../../common/date/DateFormats";
|
|
6
|
+
import { renderMail } from "../../web/page/mails/service/ConversationService";
|
|
4
7
|
|
|
5
8
|
const url = (window as any).pageUrl as URL;
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
let {1: channelID = 1, 2: emailID = 82 } = /^\/channels\/([^\/]+)\/([^\/]+)\//.exec(url.pathname) ?? {} as any;
|
|
11
|
+
|
|
12
|
+
channelID = parseInt(channelID, 36);
|
|
13
|
+
emailID = parseInt(emailID, 36);
|
|
8
14
|
|
|
9
15
|
export default class ChannelMessage extends AtomControl {
|
|
10
16
|
|
|
@@ -13,6 +19,18 @@ export default class ChannelMessage extends AtomControl {
|
|
|
13
19
|
|
|
14
20
|
async init() {
|
|
15
21
|
const { items: [ email ]} = await this.blogService.getEmails({ channelID, start: 0, size: 1, cancelToken: null});
|
|
22
|
+
|
|
23
|
+
this.renderer = <section data-element="blog-item">
|
|
24
|
+
<h4 data-element="title">
|
|
25
|
+
<label text={email.subject}/>
|
|
26
|
+
</h4>
|
|
27
|
+
<h6 data-element="date" text={DateFormats.relative.short(email.dateSent)}/>
|
|
28
|
+
<h6 text={email.senderName}/>
|
|
29
|
+
<section
|
|
30
|
+
data-element="content">
|
|
31
|
+
<section { ... renderMail({ email })}/>
|
|
32
|
+
</section>
|
|
33
|
+
</section>;
|
|
16
34
|
}
|
|
17
35
|
|
|
18
36
|
}
|
|
@@ -10,6 +10,7 @@ import { IMailbox, IEmail } from "../../model/model";
|
|
|
10
10
|
import { renderMail } from "../../web/page/mails/service/ConversationService";
|
|
11
11
|
import BlogService from "./BlogService";
|
|
12
12
|
import { channelViewStyle } from "./channelViewStyle";
|
|
13
|
+
import { UrlService } from "./UrlService";
|
|
13
14
|
|
|
14
15
|
export default class ChannelView extends AtomControl {
|
|
15
16
|
|
|
@@ -68,7 +69,7 @@ export default class ChannelView extends AtomControl {
|
|
|
68
69
|
itemRenderer={(email: IEmail) => {
|
|
69
70
|
return <section data-element="blog-item">
|
|
70
71
|
<h4 data-element="title">
|
|
71
|
-
<a href={
|
|
72
|
+
<a href={UrlService.toBlogUrl(channelID, email.emailID, email.subject)} text={email.subject}></a>
|
|
72
73
|
</h4>
|
|
73
74
|
<h6 data-element="date" text={DateFormats.relative.short(email.dateSent)}/>
|
|
74
75
|
<h6 text={email.senderName}/>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const UrlService = {
|
|
2
|
+
|
|
3
|
+
toBlogUrl: (channelID: number, emailID: number, subject: string ) => {
|
|
4
|
+
subject ||= "";
|
|
5
|
+
if(subject.length > 400) {
|
|
6
|
+
subject = subject.substring(0, 400);
|
|
7
|
+
}
|
|
8
|
+
subject = subject.replace(/[^\p{L}\p{N}]+/ug, "-");
|
|
9
|
+
subject = encodeURIComponent(subject).replace(/\%20/g, "-");
|
|
10
|
+
return `/channels/${Number(channelID).toString(36)}/${Number(emailID).toString(36)}/${subject}`;
|
|
11
|
+
}
|
|
12
|
+
};
|