@social-mail/social-mail-client 1.1.39 → 1.2.2
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 +62 -46
- package/dist/admin/AdminAppIndex.pack.js.map +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js +3 -3
- package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
- package/dist/common/events/CommonEvents.d.ts +3 -3
- package/dist/common/events/CommonEvents.d.ts.map +1 -1
- package/dist/common/events/CommonEvents.js.map +1 -1
- package/dist/model/model.d.ts +22 -30
- package/dist/model/model.d.ts.map +1 -1
- package/dist/model/model.js +25 -27
- package/dist/model/model.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/web/AppIndex.pack.js +62 -46
- package/dist/web/AppIndex.pack.js.map +1 -1
- package/dist/web/AppIndex.pack.min.js +4 -4
- package/dist/web/AppIndex.pack.min.js.map +1 -1
- package/dist/web/page/channels/services/ChannelService.d.ts +4 -4
- package/dist/web/page/channels/services/ChannelService.d.ts.map +1 -1
- package/dist/web/page/channels/services/ChannelService.js +5 -5
- package/dist/web/page/channels/services/ChannelService.js.map +1 -1
- package/dist/web/page/channels/subscribers/ChannelSubscribersPage.d.ts +1 -0
- package/dist/web/page/channels/subscribers/ChannelSubscribersPage.d.ts.map +1 -1
- package/dist/web/page/channels/subscribers/ChannelSubscribersPage.js +20 -2
- package/dist/web/page/channels/subscribers/ChannelSubscribersPage.js.map +1 -1
- package/dist/web/page/channels/subscribers/add/AddSubscriberPage.d.ts.map +1 -1
- package/dist/web/page/channels/subscribers/add/AddSubscriberPage.js +5 -5
- package/dist/web/page/channels/subscribers/add/AddSubscriberPage.js.map +1 -1
- package/dist/web/page/mails/ConversationPage.d.ts +5 -5
- package/dist/web/page/mails/ConversationPage.d.ts.map +1 -1
- package/dist/web/page/mails/ConversationPage.js.map +1 -1
- package/dist/web/page/mails/MailboxContacts.d.ts +2 -2
- package/dist/web/page/mails/MailboxContacts.d.ts.map +1 -1
- package/dist/web/page/mails/MailboxContacts.js.map +1 -1
- package/dist/web/page/mails/service/ConversationService.d.ts +3 -3
- package/dist/web/page/mails/service/ConversationService.d.ts.map +1 -1
- package/dist/web/page/mails/service/ConversationService.js +4 -4
- package/dist/web/page/mails/service/ConversationService.js.map +1 -1
- package/dist/web/page/mails/service/MailService.d.ts +1 -1
- package/dist/web/page/mails/service/MailService.d.ts.map +1 -1
- package/dist/web/page/mails/service/MailService.js +3 -3
- package/dist/web/page/mails/service/MailService.js.map +1 -1
- package/package.json +1 -1
- package/src/common/events/CommonEvents.ts +3 -3
- package/src/model/model.ts +21 -32
- package/src/web/page/channels/services/ChannelService.ts +7 -7
- package/src/web/page/channels/subscribers/ChannelSubscribersPage.tsx +23 -5
- package/src/web/page/channels/subscribers/add/AddSubscriberPage.tsx +4 -4
- package/src/web/page/mails/ConversationPage.tsx +8 -8
- package/src/web/page/mails/MailboxContacts.tsx +7 -7
- package/src/web/page/mails/service/ConversationService.tsx +5 -5
- package/src/web/page/mails/service/MailService.ts +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
System.register(["tslib", "@web-atoms/core/dist/di/DISingleton", "@web-atoms/core/dist/di/Inject", "../../../../services/EntityService", "../../../../model/model", "../../../../common/Sql"], function (_export, _context) {
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
var __awaiter, __decorate, __metadata, DISingleton, Inject, EntityService, AppFile, Mailbox,
|
|
4
|
+
var __awaiter, __decorate, __metadata, DISingleton, Inject, EntityService, AppFile, Mailbox, MailboxContact, Sql, MailService;
|
|
5
5
|
return {
|
|
6
6
|
setters: [function (_tslib) {
|
|
7
7
|
__awaiter = _tslib.__awaiter;
|
|
@@ -16,7 +16,7 @@ System.register(["tslib", "@web-atoms/core/dist/di/DISingleton", "@web-atoms/cor
|
|
|
16
16
|
}, function (_modelModel) {
|
|
17
17
|
AppFile = _modelModel.AppFile;
|
|
18
18
|
Mailbox = _modelModel.Mailbox;
|
|
19
|
-
|
|
19
|
+
MailboxContact = _modelModel.MailboxContact;
|
|
20
20
|
}, function (_commonSql) {
|
|
21
21
|
Sql = _commonSql.Sql;
|
|
22
22
|
}],
|
|
@@ -39,7 +39,7 @@ System.register(["tslib", "@web-atoms/core/dist/di/DISingleton", "@web-atoms/cor
|
|
|
39
39
|
cancelToken
|
|
40
40
|
}) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
let q = this.entityService.query(
|
|
42
|
+
let q = this.entityService.query(MailboxContact).where({
|
|
43
43
|
mailboxID,
|
|
44
44
|
showBlocked
|
|
45
45
|
}, p => x => x.mailboxID === p.mailboxID && x.blocked === p.showBlocked).orderByDescending(x => x.dateUpdated);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DISingleton","_webAtomsCoreDistDiDISingleton","default","_webAtomsCoreDistDiInject","Inject","_servicesEntityService","EntityService","_modelModel","AppFile","Mailbox","
|
|
1
|
+
{"version":3,"names":["DISingleton","_webAtomsCoreDistDiDISingleton","default","_webAtomsCoreDistDiInject","Inject","_servicesEntityService","EntityService","_modelModel","AppFile","Mailbox","MailboxContact","_commonSql","Sql","execute","MailService","mailbox","mailboxID","entityService","query","where","p","x","include","emailAddress","firstOrDefault","list","search","start","size","version","showBlocked","cancelToken","q","blocked","orderByDescending","dateUpdated","likeSearch","text","iLike","lastEmail","textBody","subject","name","senderName","toPagedList","raw","email","originalFileID","file","appFileID","rs","fetch","url","send","iterator","recipients","emailAddressText","trim","cloner","attachments","copy","save","__decorate","_export"],"sources":["../../../../../src/web/page/mails/service/MailService.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;MAAOA,WAAW,GAAAC,8BAAA,CAAAC,OAAA;IAAA,aAAAC,yBAAA;MACTC,MAAM,GAAAD,yBAAA,CAANC,MAAM;IAAA,aAAAC,sBAAA;MACRC,aAAa,GAAAD,sBAAA,CAAAH,OAAA;IAAA,aAAAK,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ACrC,IAAID,QAAQ,CAACE,gBAAgB,EAAE;gBAC3BF,QAAQ,CAACE,gBAAgB,GAAGF,QAAQ,CAACE,gBAAgB,CAACC,IAAI,EAAE;;;YAGpE,MAAMC,MAAM,GAAG,IAAI,CAACzC,aAAa,CAACyC,MAAM,CAACZ,KAAK,CAAC,CAACxB,OAAO,CAAED,CAAC,IAAKA,CAAC,CAACkC,UAAU,CAAC,CAACjC,OAAO,CAAED,CAAC,IAAKA,CAAC,CAACsC,WAAW,CAAC,CAACC,IAAI;YAC/G,MAAM,IAAI,CAAC3C,aAAa,CAAC4C,IAAI,CAACH,MAAM,CAAC;UACzC,CAAC;;OACJ;MApDGI,UAAA,EAAC1D,MAAM,E,0BACgBE,aAAa,E,iDAAC;MAHpBQ,WAAW,GAAAgD,UAAA,EAD/B9D,WAAW,EAAE,C,EACOc,WAAW,CAsD/B;MAAAiD,OAAA,YAtDoBjD,WAAW;IAAA;EAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import EventScope from "@web-atoms/core/dist/core/EventScope";
|
|
2
|
-
import {
|
|
2
|
+
import { IMailboxContact, IMailboxContactEmail } from "../../model/model";
|
|
3
3
|
|
|
4
4
|
export const CommonEvents = {
|
|
5
5
|
|
|
6
|
-
onThreadMarkedAsRead: EventScope.create<
|
|
6
|
+
onThreadMarkedAsRead: EventScope.create<IMailboxContactEmail>(),
|
|
7
7
|
|
|
8
|
-
onThreadMarkedAsBlocked: EventScope.create<
|
|
8
|
+
onThreadMarkedAsBlocked: EventScope.create<IMailboxContact>()
|
|
9
9
|
};
|
package/src/model/model.ts
CHANGED
|
@@ -287,6 +287,7 @@ export interface IEmail extends IClrEntity {
|
|
|
287
287
|
status?: "queued" | "received" | "draft" | "pending-approval" | "scheduled" | "sent" | "sent-failed";
|
|
288
288
|
forwardCount?: number;
|
|
289
289
|
replyCount?: number;
|
|
290
|
+
viewCount?: number;
|
|
290
291
|
originalFileID?: number | null;
|
|
291
292
|
originalFileSize?: number;
|
|
292
293
|
workflowID?: string | null;
|
|
@@ -307,14 +308,14 @@ export interface IEmail extends IClrEntity {
|
|
|
307
308
|
recipients?: ICollection<IEmailRecipient>;
|
|
308
309
|
tags?: ICollection<IEmailTag>;
|
|
309
310
|
mailboxes?: ICollection<IMailboxEmail>;
|
|
310
|
-
lastEmailThreads?: ICollection<
|
|
311
|
-
threadEmails?: ICollection<
|
|
311
|
+
lastEmailThreads?: ICollection<IMailboxContact>;
|
|
312
|
+
threadEmails?: ICollection<IMailboxContactEmail>;
|
|
312
313
|
subscriberActivities?: ICollection<ISubscriberActivity>;
|
|
313
314
|
}
|
|
314
315
|
|
|
315
316
|
export const EmailStatusArray = [{"label":"queued","value":"queued"},{"label":"received","value":"received"},{"label":"draft","value":"draft"},{"label":"pending-approval","value":"pending-approval"},{"label":"scheduled","value":"scheduled"},{"label":"sent","value":"sent"},{"label":"sent-failed","value":"sent-failed"}];
|
|
316
317
|
|
|
317
|
-
export const Email: IModel<IEmail> = new Model<IEmail>("Email", ["emailID"], { senderName: "",received: false,dateReceived: new DefaultFactory(() => new DateTime()),dateCreated: new DefaultFactory(() => new DateTime()),status: "queued",forwardCount: 0,replyCount: 0,originalFileSize: 0 });
|
|
318
|
+
export const Email: IModel<IEmail> = new Model<IEmail>("Email", ["emailID"], { senderName: "",received: false,dateReceived: new DefaultFactory(() => new DateTime()),dateCreated: new DefaultFactory(() => new DateTime()),status: "queued",forwardCount: 0,replyCount: 0,viewCount: 0,originalFileSize: 0 });
|
|
318
319
|
|
|
319
320
|
export interface IEmailEngagement extends IClrEntity {
|
|
320
321
|
emailID?: number;
|
|
@@ -378,8 +379,7 @@ export interface IEmailAddress extends IClrEntity {
|
|
|
378
379
|
mailbox?: IMailbox;
|
|
379
380
|
contactEmails?: ICollection<IContactEmail>;
|
|
380
381
|
recipients?: ICollection<IEmailRecipient>;
|
|
381
|
-
threads?: ICollection<
|
|
382
|
-
subscribedMailboxes?: ICollection<IMailboxSubscriber>;
|
|
382
|
+
threads?: ICollection<IMailboxContact>;
|
|
383
383
|
subscriberActivities?: ICollection<ISubscriberActivity>;
|
|
384
384
|
}
|
|
385
385
|
|
|
@@ -419,10 +419,9 @@ export interface IMailbox extends IClrEntity {
|
|
|
419
419
|
contacts?: ICollection<IContact>;
|
|
420
420
|
templates?: ICollection<IEmailTemplate>;
|
|
421
421
|
emails?: ICollection<IMailboxEmail>;
|
|
422
|
-
|
|
423
|
-
threadEmails?: ICollection<
|
|
422
|
+
mailboxContacts?: ICollection<IMailboxContact>;
|
|
423
|
+
threadEmails?: ICollection<IMailboxContactEmail>;
|
|
424
424
|
syncTargets?: ICollection<IMailboxSyncTarget>;
|
|
425
|
-
subscribers?: ICollection<IMailboxSubscriber>;
|
|
426
425
|
subscriberActivities?: ICollection<ISubscriberActivity>;
|
|
427
426
|
userPins?: ICollection<IUserPin>;
|
|
428
427
|
userMailboxes?: ICollection<IUserMailbox>;
|
|
@@ -439,25 +438,33 @@ export interface IMailboxEmail extends IClrEntity {
|
|
|
439
438
|
|
|
440
439
|
export const MailboxEmail: IModel<IMailboxEmail> = new Model<IMailboxEmail>("MailboxEmail", ["mailboxID","emailID"], { });
|
|
441
440
|
|
|
442
|
-
export interface
|
|
441
|
+
export interface IMailboxContact extends IClrEntity {
|
|
443
442
|
mailboxID?: number;
|
|
444
443
|
emailAddressID?: number;
|
|
445
444
|
lastEmailID?: number | null;
|
|
445
|
+
dateCreated?: DateTime;
|
|
446
446
|
dateUpdated?: DateTime;
|
|
447
447
|
unread?: number;
|
|
448
448
|
total?: number;
|
|
449
449
|
doNotIndex?: boolean | null;
|
|
450
450
|
doNotIndexAttachments?: boolean | null;
|
|
451
|
+
isOwner?: boolean;
|
|
452
|
+
canContribute?: boolean;
|
|
451
453
|
priority?: number;
|
|
452
454
|
blocked?: boolean;
|
|
455
|
+
status?: "invited" | "added" | "active" | "unsubscribed" | "blocked";
|
|
456
|
+
emailAddressText?: string;
|
|
457
|
+
name?: string;
|
|
453
458
|
mailbox?: IMailbox;
|
|
454
459
|
emailAddress?: IEmailAddress;
|
|
455
460
|
lastEmail?: IEmail;
|
|
456
461
|
}
|
|
457
462
|
|
|
458
|
-
export const
|
|
463
|
+
export const MailboxContactStatusArray = [{"label":"invited","value":"invited"},{"label":"added","value":"added"},{"label":"active","value":"active"},{"label":"unsubscribed","value":"unsubscribed"},{"label":"blocked","value":"blocked"}];
|
|
459
464
|
|
|
460
|
-
export
|
|
465
|
+
export const MailboxContact: IModel<IMailboxContact> = new Model<IMailboxContact>("MailboxContact", ["mailboxID","emailAddressID"], { dateCreated: new DefaultFactory(() => new DateTime()),dateUpdated: new DefaultFactory(() => new DateTime()),unread: 0,total: 0,isOwner: false,canContribute: false,priority: 0,blocked: false,status: "invited" });
|
|
466
|
+
|
|
467
|
+
export interface IMailboxContactEmail extends IClrEntity {
|
|
461
468
|
mailboxID?: number;
|
|
462
469
|
emailAddressID?: number;
|
|
463
470
|
emailID?: number;
|
|
@@ -468,7 +475,7 @@ export interface IMailboxThreadEmail extends IClrEntity {
|
|
|
468
475
|
email?: IEmail;
|
|
469
476
|
}
|
|
470
477
|
|
|
471
|
-
export const
|
|
478
|
+
export const MailboxContactEmail: IModel<IMailboxContactEmail> = new Model<IMailboxContactEmail>("MailboxContactEmail", ["mailboxID","emailAddressID","emailID"], { dateReceived: new DefaultFactory(() => new DateTime()) });
|
|
472
479
|
|
|
473
480
|
export interface IMailboxSyncTarget extends IClrEntity {
|
|
474
481
|
readonly syncTargetID?: number;
|
|
@@ -498,33 +505,15 @@ export const MailboxSyncTargetLastSyncStatusArray = [{"label":"none","value":"no
|
|
|
498
505
|
|
|
499
506
|
export const MailboxSyncTarget: IModel<IMailboxSyncTarget> = new Model<IMailboxSyncTarget>("MailboxSyncTarget", ["syncTargetID"], { direction: "in",protocol: "imap",username: "",host: "",port: 0,isSecure: false,syncAllFolders: false,syncJunkMails: false,intervalSeconds: 0,active: false });
|
|
500
507
|
|
|
501
|
-
export interface IMailboxSubscriber extends IClrEntity {
|
|
502
|
-
mailboxID?: number;
|
|
503
|
-
subscriberID?: number;
|
|
504
|
-
name?: string | null;
|
|
505
|
-
isOwner?: boolean;
|
|
506
|
-
canContribute?: boolean;
|
|
507
|
-
status?: "invited" | "added" | "active" | "unsubscribed" | "blocked";
|
|
508
|
-
dateCreated?: DateTime;
|
|
509
|
-
dateUpdated?: DateTime;
|
|
510
|
-
/** Used for adding new subscriber only */
|
|
511
|
-
emailAddress?: string;
|
|
512
|
-
mailbox?: IMailbox;
|
|
513
|
-
subscriber?: IEmailAddress;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
export const MailboxSubscriberStatusArray = [{"label":"invited","value":"invited"},{"label":"added","value":"added"},{"label":"active","value":"active"},{"label":"unsubscribed","value":"unsubscribed"},{"label":"blocked","value":"blocked"}];
|
|
517
|
-
|
|
518
|
-
export const MailboxSubscriber: IModel<IMailboxSubscriber> = new Model<IMailboxSubscriber>("MailboxSubscriber", ["mailboxID","subscriberID"], { isOwner: false,canContribute: false,status: "invited",dateCreated: new DefaultFactory(() => new DateTime()),dateUpdated: new DefaultFactory(() => new DateTime()) });
|
|
519
|
-
|
|
520
508
|
export interface ISubscriberActivity extends IClrEntity {
|
|
521
509
|
readonly activityID?: number;
|
|
522
510
|
mailboxID?: number;
|
|
523
511
|
emailID?: number;
|
|
524
|
-
|
|
512
|
+
emailAddressID?: number;
|
|
525
513
|
activity?: string;
|
|
526
514
|
dateCreated?: DateTime;
|
|
527
515
|
uid?: number | null;
|
|
516
|
+
ipAddress?: string | null;
|
|
528
517
|
mailbox?: IMailbox;
|
|
529
518
|
email?: IEmail;
|
|
530
519
|
subscriber?: IEmailAddress;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import DITransient from "@web-atoms/core/dist/di/DITransient";
|
|
2
2
|
import { Inject } from "@web-atoms/core/dist/di/Inject";
|
|
3
3
|
import EntityService from "../../../../services/EntityService";
|
|
4
|
-
import {
|
|
4
|
+
import { IMailboxContact, Mailbox, MailboxContact } from "../../../../model/model";
|
|
5
5
|
import { Sql } from "../../../../common/Sql";
|
|
6
6
|
|
|
7
7
|
@DITransient({})
|
|
@@ -18,29 +18,29 @@ export default class ChannelService {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
public async subscribers({ id, cancelToken, size, start, search, v}) {
|
|
21
|
-
let q = this.entityService.query(
|
|
21
|
+
let q = this.entityService.query(MailboxContact)
|
|
22
22
|
.where({ id }, (p) => (x) => x.mailboxID === p.id);
|
|
23
23
|
if (search) {
|
|
24
24
|
if(!/\%/i.test(search)) {
|
|
25
25
|
search += "%";
|
|
26
26
|
}
|
|
27
27
|
q = q.where( { search }, (p) => (x) =>
|
|
28
|
-
Sql.text.iLike(x.
|
|
29
|
-
|| Sql.text.iLike(x.
|
|
28
|
+
Sql.text.iLike(x.emailAddress.name, p.search)
|
|
29
|
+
|| Sql.text.iLike(x.emailAddress.emailAddress, p.search)
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
|
-
return q.include((x) => x.
|
|
32
|
+
return q.include((x) => x.emailAddress).toPagedList({
|
|
33
33
|
start,
|
|
34
34
|
size,
|
|
35
35
|
cancelToken
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
public save(model:
|
|
39
|
+
public save(model: IMailboxContact) {
|
|
40
40
|
return this.entityService.save(model);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
public async saveAll(subscribers:
|
|
43
|
+
public async saveAll(subscribers: IMailboxContact[]) {
|
|
44
44
|
const cloners = [];
|
|
45
45
|
for (const iterator of subscribers) {
|
|
46
46
|
cloners.push(this.entityService.cloner(iterator).copy);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import InjectProperty from "@web-atoms/core/dist/core/InjectProperty";
|
|
2
2
|
import { ContentPage } from "@web-atoms/web-controls/dist/mobile-app/MobileApp";
|
|
3
3
|
import ChannelService from "../services/ChannelService";
|
|
4
|
-
import { IMailbox,
|
|
4
|
+
import { IMailbox, IMailboxContact } from "../../../../model/model";
|
|
5
5
|
import XNode from "@web-atoms/core/dist/core/XNode";
|
|
6
6
|
import AtomRepeater, { SelectAll, SelectorCheckBox } from "@web-atoms/web-controls/dist/basic/AtomRepeater";
|
|
7
7
|
import InfiniteRepeater from "../../../../common/controls/repeater/InfiniteRepeater";
|
|
@@ -21,11 +21,11 @@ export default class ChannelSubscribersPage extends ContentPage {
|
|
|
21
21
|
|
|
22
22
|
private search = "";
|
|
23
23
|
|
|
24
|
-
private subscribers:
|
|
24
|
+
private subscribers: IMailboxContact[] = [];
|
|
25
25
|
|
|
26
26
|
private version = 1;
|
|
27
27
|
|
|
28
|
-
private selected:
|
|
28
|
+
private selected: IMailboxContact[] = [];
|
|
29
29
|
|
|
30
30
|
@InjectProperty
|
|
31
31
|
private channelService: ChannelService;
|
|
@@ -62,6 +62,7 @@ export default class ChannelSubscribersPage extends ContentPage {
|
|
|
62
62
|
|
|
63
63
|
this.renderer = <div>
|
|
64
64
|
<AtomRepeater
|
|
65
|
+
data-layout="data-grid"
|
|
65
66
|
items={this.subscribers}
|
|
66
67
|
selectedItems={this.selected}
|
|
67
68
|
allowMultipleSelection={true}
|
|
@@ -76,10 +77,10 @@ export default class ChannelSubscribersPage extends ContentPage {
|
|
|
76
77
|
v: this.version
|
|
77
78
|
})
|
|
78
79
|
)}
|
|
79
|
-
itemRenderer={(item:
|
|
80
|
+
itemRenderer={(item: IMailboxContact) => <div data-layout="row">
|
|
80
81
|
<SelectorCheckBox
|
|
81
82
|
/>
|
|
82
|
-
<div text={item.
|
|
83
|
+
<div text={item.emailAddress.emailAddress}/>
|
|
83
84
|
<div text={item.status}/>
|
|
84
85
|
<div
|
|
85
86
|
text={item.isOwner ? "Is Owner": ""}/>
|
|
@@ -91,6 +92,10 @@ export default class ChannelSubscribersPage extends ContentPage {
|
|
|
91
92
|
this.footerRenderer = () => <div
|
|
92
93
|
style-display={Bind.oneWay(() => this.selected.length > 0)}
|
|
93
94
|
data-layout="command-row">
|
|
95
|
+
<SaveIconTextButton
|
|
96
|
+
data-click-event="activate-subscribers"
|
|
97
|
+
text="Activate"
|
|
98
|
+
/>
|
|
94
99
|
<DeleteIconTextButton
|
|
95
100
|
data-click-event="delete-subscribers"
|
|
96
101
|
text="Delete"
|
|
@@ -121,6 +126,19 @@ export default class ChannelSubscribersPage extends ContentPage {
|
|
|
121
126
|
this.version++;
|
|
122
127
|
}
|
|
123
128
|
|
|
129
|
+
@Action({
|
|
130
|
+
onEvent: "activate-subscribers",
|
|
131
|
+
confirm: "Are you sure you want to activate given subscribers?"
|
|
132
|
+
})
|
|
133
|
+
async activateSubscribers() {
|
|
134
|
+
for (const iterator of this.selected) {
|
|
135
|
+
iterator.status = "active";
|
|
136
|
+
}
|
|
137
|
+
await this.channelService.saveAll(this.selected);
|
|
138
|
+
this.selected.clear();
|
|
139
|
+
this.version++;
|
|
140
|
+
}
|
|
141
|
+
|
|
124
142
|
@Action({
|
|
125
143
|
onEvent: "update-rights",
|
|
126
144
|
})
|
|
@@ -3,7 +3,7 @@ import XNode from "@web-atoms/core/dist/core/XNode";
|
|
|
3
3
|
import Form from "@web-atoms/web-controls/dist/basic/Form";
|
|
4
4
|
import FormField from "@web-atoms/web-controls/dist/basic/FormField";
|
|
5
5
|
import { ContentPage, PopupWindowPage } from "@web-atoms/web-controls/dist/mobile-app/MobileApp";
|
|
6
|
-
import {
|
|
6
|
+
import { IMailboxContact, MailboxContact } from "../../../../../model/model";
|
|
7
7
|
import { SaveIconTextButton } from "../../../../../common/controls/buttons/IconButton";
|
|
8
8
|
import Action from "@web-atoms/core/dist/view-model/Action";
|
|
9
9
|
import { Inject } from "@web-atoms/core/dist/di/Inject";
|
|
@@ -15,7 +15,7 @@ export default class AddSubscriberPage extends PopupWindowPage {
|
|
|
15
15
|
|
|
16
16
|
public parameters: { id: number};
|
|
17
17
|
|
|
18
|
-
private model:
|
|
18
|
+
private model: IMailboxContact = MailboxContact.create({});
|
|
19
19
|
|
|
20
20
|
private emailAddress: string = "";
|
|
21
21
|
|
|
@@ -25,7 +25,7 @@ export default class AddSubscriberPage extends PopupWindowPage {
|
|
|
25
25
|
async init() {
|
|
26
26
|
|
|
27
27
|
this.title = "Add/Invite new subscriber";
|
|
28
|
-
this.model.
|
|
28
|
+
this.model.emailAddressText ??= "";
|
|
29
29
|
this.model.mailboxID = this.parameters.id;
|
|
30
30
|
this.renderer = <div>
|
|
31
31
|
{/* <p>We recommend inviting subscribers to maintain your reputation as a sender.
|
|
@@ -38,7 +38,7 @@ export default class AddSubscriberPage extends PopupWindowPage {
|
|
|
38
38
|
<FormField label="Email Address">
|
|
39
39
|
<input
|
|
40
40
|
autofocus={true}
|
|
41
|
-
value={Bind.twoWaysImmediate(() => this.model.
|
|
41
|
+
value={Bind.twoWaysImmediate(() => this.model.emailAddressText)}/>
|
|
42
42
|
</FormField>
|
|
43
43
|
<FormField label="Name">
|
|
44
44
|
<input
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ContentPage, isMobileView } from "@web-atoms/web-controls/dist/mobile-app/MobileApp";
|
|
2
|
-
import { Email, EmailRecipient, IEmail,
|
|
2
|
+
import { Email, EmailRecipient, IEmail, IMailboxContact, IMailboxContactEmail } from "../../../model/model";
|
|
3
3
|
import { Inject } from "@web-atoms/core/dist/di/Inject";
|
|
4
4
|
import MailService from "./service/MailService";
|
|
5
5
|
import XNode from "@web-atoms/core/dist/core/XNode";
|
|
@@ -74,12 +74,12 @@ const fixLinks = () => {
|
|
|
74
74
|
|
|
75
75
|
export default class ConversationPage extends ContentPage {
|
|
76
76
|
|
|
77
|
-
public parameters:
|
|
77
|
+
public parameters: IMailboxContact;
|
|
78
78
|
|
|
79
79
|
@InjectProperty
|
|
80
80
|
private conversationService: ConversationService;
|
|
81
81
|
|
|
82
|
-
private mails:
|
|
82
|
+
private mails: IMailboxContactEmail[] = [];
|
|
83
83
|
|
|
84
84
|
private search: string = "";
|
|
85
85
|
private version = 1;
|
|
@@ -128,7 +128,7 @@ export default class ConversationPage extends ContentPage {
|
|
|
128
128
|
version: this.version,
|
|
129
129
|
cancelToken
|
|
130
130
|
}))}
|
|
131
|
-
itemRenderer={(thread:
|
|
131
|
+
itemRenderer={(thread: IMailboxContactEmail) => {
|
|
132
132
|
const item = thread.email;
|
|
133
133
|
const internalDate = item.dateSent ?? item.dateReceived ?? item.dateCreated;
|
|
134
134
|
const sent = item.senderID === thread.mailboxID;
|
|
@@ -214,7 +214,7 @@ export default class ConversationPage extends ContentPage {
|
|
|
214
214
|
const inReplyTo = url.searchParams.get("inReplyTo") ?? "";
|
|
215
215
|
|
|
216
216
|
const { item } = AtomRepeater.itemFromElement(e.target as HTMLElement);
|
|
217
|
-
const { email: { parentID, headerMessageID }} = item as
|
|
217
|
+
const { email: { parentID, headerMessageID }} = item as IMailboxContactEmail;
|
|
218
218
|
|
|
219
219
|
const recipients = [EmailRecipient.create({ emailAddressText: to })];
|
|
220
220
|
|
|
@@ -237,7 +237,7 @@ export default class ConversationPage extends ContentPage {
|
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
@Action({ onEvent: "mail-options"})
|
|
240
|
-
async mailOptions(thread:
|
|
240
|
+
async mailOptions(thread: IMailboxContactEmail, ce: CustomEvent) {
|
|
241
241
|
void InlinePopupControl.showPopup(ce.target as HTMLElement, <div
|
|
242
242
|
data-click-event="none"
|
|
243
243
|
data-click-animate="none">
|
|
@@ -260,12 +260,12 @@ export default class ConversationPage extends ContentPage {
|
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
@Action({ onEvent: "open-logs"})
|
|
263
|
-
async openLogs({ emailID }:
|
|
263
|
+
async openLogs({ emailID }: IMailboxContactEmail) {
|
|
264
264
|
PageNavigator.pushPage(LogsPage, { emailID });
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
@Action({ onEvent: ["reply-email", "reply-all-email" ]})
|
|
268
|
-
async replyEmail({ email }:
|
|
268
|
+
async replyEmail({ email }: IMailboxContactEmail, ce: CustomEvent) {
|
|
269
269
|
const parse = JSON.parse(email.headers);
|
|
270
270
|
const emailAddressText = ((parse?.replyTo?.[0] ?? this.parameters.emailAddress.emailAddress) as string)
|
|
271
271
|
.toLocaleLowerCase();
|
|
@@ -2,7 +2,7 @@ import InjectProperty from "@web-atoms/core/dist/core/InjectProperty";
|
|
|
2
2
|
import XNode from "@web-atoms/core/dist/core/XNode";
|
|
3
3
|
import MailService from "./service/MailService";
|
|
4
4
|
import AtomRepeater from "@web-atoms/web-controls/dist/basic/AtomRepeater";
|
|
5
|
-
import { IEmail, IMailbox,
|
|
5
|
+
import { IEmail, IMailbox, IMailboxContact } from "../../../model/model";
|
|
6
6
|
import InfiniteRepeater from "../../../common/controls/repeater/InfiniteRepeater";
|
|
7
7
|
import Bind from "@web-atoms/core/dist/core/Bind";
|
|
8
8
|
import MasterDetailPage from "@web-atoms/web-controls/dist/mobile-app/MasterDetailPage";
|
|
@@ -108,7 +108,7 @@ const css = styled.css `
|
|
|
108
108
|
}
|
|
109
109
|
`.installLocal();
|
|
110
110
|
|
|
111
|
-
const displayName = (item:
|
|
111
|
+
const displayName = (item: IMailboxContact) => {
|
|
112
112
|
const { emailAddress: { emailAddress, name } } = item;
|
|
113
113
|
if(name && name !== emailAddress) {
|
|
114
114
|
return name;
|
|
@@ -130,13 +130,13 @@ export default class MailsPage extends MasterDetailPage {
|
|
|
130
130
|
|
|
131
131
|
private currentMailbox: IMailbox;
|
|
132
132
|
|
|
133
|
-
private mails:
|
|
133
|
+
private mails: IMailboxContact[] = [];
|
|
134
134
|
|
|
135
135
|
private search: string = "";
|
|
136
136
|
|
|
137
|
-
private selectedThread:
|
|
137
|
+
private selectedThread: IMailboxContact = null;
|
|
138
138
|
|
|
139
|
-
private previousThread:
|
|
139
|
+
private previousThread: IMailboxContact = null;
|
|
140
140
|
|
|
141
141
|
private showBlocked = false;
|
|
142
142
|
|
|
@@ -209,7 +209,7 @@ export default class MailsPage extends MasterDetailPage {
|
|
|
209
209
|
showBlocked: this.showBlocked,
|
|
210
210
|
cancelToken
|
|
211
211
|
}))}
|
|
212
|
-
itemRenderer={(item:
|
|
212
|
+
itemRenderer={(item: IMailboxContact) => {
|
|
213
213
|
const name = displayName(item) + " " + item.emailAddress.emailAddress;
|
|
214
214
|
const subject = item.lastEmail?.subject;
|
|
215
215
|
const summary = item.lastEmail?.summary;
|
|
@@ -300,7 +300,7 @@ export default class MailsPage extends MasterDetailPage {
|
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
@Action({ onEvent: CommonEvents.onThreadMarkedAsBlocked })
|
|
303
|
-
onThreadMarkedAsBlocked(thread:
|
|
303
|
+
onThreadMarkedAsBlocked(thread: IMailboxContact) {
|
|
304
304
|
const index = this.mails.findIndex((x) => x.emailAddressID === thread.emailAddressID);
|
|
305
305
|
if (index === -1) {
|
|
306
306
|
return;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import DISingleton from "@web-atoms/core/dist/di/DISingleton";
|
|
3
3
|
import { Inject } from "@web-atoms/core/dist/di/Inject";
|
|
4
4
|
import EntityService from "../../../../services/EntityService";
|
|
5
|
-
import { Email, EmailEngagement, IEmail,
|
|
5
|
+
import { Email, EmailEngagement, IEmail, IMailboxContact, IMailboxContactEmail, MailboxContactEmail } from "../../../../model/model";
|
|
6
6
|
import { Sql } from "../../../../common/Sql";
|
|
7
7
|
import DomToString from "@web-atoms/email-dom/dist/DomToString";
|
|
8
8
|
import XNode from "@web-atoms/core/dist/core/XNode";
|
|
@@ -17,7 +17,7 @@ export const renderMail = AtomControl.registerProperty("data-html", "html", (c,
|
|
|
17
17
|
e.innerHTML = "";
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
const thread = value as
|
|
20
|
+
const thread = value as IMailboxContactEmail;
|
|
21
21
|
const mail = thread.email;
|
|
22
22
|
const html = mail.htmlBody;
|
|
23
23
|
const msg = document.createElement("div");
|
|
@@ -55,7 +55,7 @@ export const renderMail = AtomControl.registerProperty("data-html", "html", (c,
|
|
|
55
55
|
thread.timeRead = timeRead;
|
|
56
56
|
const control = AtomControl.from(e);
|
|
57
57
|
const entityService = control.app.resolve(EntityService);
|
|
58
|
-
entityService.save(
|
|
58
|
+
entityService.save(MailboxContactEmail.patch(thread, {
|
|
59
59
|
timeRead
|
|
60
60
|
})).then(() => {
|
|
61
61
|
CommonEvents.onThreadMarkedAsRead.dispatchEvent(thread);
|
|
@@ -111,7 +111,7 @@ export default class ConversationService {
|
|
|
111
111
|
version = 0,
|
|
112
112
|
cancelToken
|
|
113
113
|
}) {
|
|
114
|
-
let q = this.entityService.query(
|
|
114
|
+
let q = this.entityService.query(MailboxContactEmail)
|
|
115
115
|
.where({ mailboxID, emailAddressID }, (p) =>
|
|
116
116
|
(x) => x.mailboxID === p.mailboxID
|
|
117
117
|
&& x.emailAddressID === p.emailAddressID
|
|
@@ -172,7 +172,7 @@ export default class ConversationService {
|
|
|
172
172
|
</div>);
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
async block(thread:
|
|
175
|
+
async block(thread: IMailboxContact) {
|
|
176
176
|
thread.blocked = !thread.blocked;
|
|
177
177
|
const cloner = this.entityService.cloner(thread).copy;
|
|
178
178
|
await this.entityService.save(cloner);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import DISingleton from "@web-atoms/core/dist/di/DISingleton";
|
|
2
2
|
import { Inject } from "@web-atoms/core/dist/di/Inject";
|
|
3
3
|
import EntityService from "../../../../services/EntityService";
|
|
4
|
-
import { AppFile, Email, EmailAddress, IEmail, Mailbox,
|
|
4
|
+
import { AppFile, Email, EmailAddress, IEmail, Mailbox, MailboxContact } from "../../../../model/model";
|
|
5
5
|
import { Sql } from "../../../../common/Sql";
|
|
6
6
|
|
|
7
7
|
@DISingleton()
|
|
@@ -26,7 +26,7 @@ export default class MailService {
|
|
|
26
26
|
showBlocked = false,
|
|
27
27
|
cancelToken
|
|
28
28
|
}) {
|
|
29
|
-
let q = this.entityService.query(
|
|
29
|
+
let q = this.entityService.query(MailboxContact)
|
|
30
30
|
.where({ mailboxID, showBlocked }, (p) => (x) => x.mailboxID === p.mailboxID && x.blocked === p.showBlocked)
|
|
31
31
|
.orderByDescending((x) => x.dateUpdated);
|
|
32
32
|
if (search) {
|