@firestitch/app-message 9.2.0 → 12.1.0
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/app/helpers/index-name-value.d.ts +1 -1
- package/app/helpers/index.d.ts +1 -1
- package/app/modules/app-message/app-message.module.d.ts +8 -4
- package/app/modules/app-message/injectors/app-message-config.injector.d.ts +3 -3
- package/app/modules/app-message/injectors/index.d.ts +1 -1
- package/app/modules/app-message/interfaces/app-message-config.d.ts +26 -26
- package/app/modules/app-message/interfaces/index.d.ts +1 -1
- package/app/modules/app-message/types/index.d.ts +1 -1
- package/app/modules/app-message/types/types.type.d.ts +40 -40
- package/app/modules/message-preview/components/index.d.ts +1 -1
- package/app/modules/message-preview/components/preview/index.d.ts +1 -1
- package/app/modules/message-preview/components/preview/preview.component.d.ts +11 -8
- package/app/modules/message-preview/message-preview.module.d.ts +11 -2
- package/app/modules/message-queues/components/queue/queue.component.d.ts +43 -40
- package/app/modules/message-queues/components/queues/queues.component.d.ts +24 -21
- package/app/modules/message-queues/components/recipient/recipient.component.d.ts +10 -7
- package/app/modules/message-queues/consts/index.d.ts +1 -1
- package/app/modules/message-queues/consts/message-queue-event-type.const.d.ts +5 -5
- package/app/modules/message-queues/consts/message-queue-states.const.d.ts +5 -5
- package/app/modules/message-queues/enums/email-message-queue-format.enum.d.ts +5 -5
- package/app/modules/message-queues/enums/index.d.ts +3 -3
- package/app/modules/message-queues/enums/message-queue-event-type.enum.d.ts +4 -4
- package/app/modules/message-queues/enums/message-queue-state.enum.d.ts +9 -9
- package/app/modules/message-queues/enums/message-queue-type.enum.d.ts +4 -4
- package/app/modules/message-queues/message-queues.module.d.ts +29 -2
- package/app/modules/message-queues/pipes/linkify.pipe.d.ts +7 -4
- package/app/modules/message-queues/pipes/truncate.pipe.d.ts +7 -4
- package/app/modules/message-queues/services/message-queue.service.d.ts +12 -9
- package/app/modules/message-templates/components/index.d.ts +2 -0
- package/app/modules/message-templates/components/template/index.d.ts +1 -1
- package/app/modules/message-templates/components/template/template.component.d.ts +23 -20
- package/app/modules/message-templates/components/templates/index.d.ts +1 -0
- package/app/modules/message-templates/components/templates/templates.component.d.ts +19 -16
- package/app/modules/message-templates/message-templates.module.d.ts +25 -2
- package/app/modules/messages/components/index.d.ts +2 -2
- package/app/modules/messages/components/message/index.d.ts +1 -1
- package/app/modules/messages/components/message/message.component.d.ts +32 -29
- package/app/modules/messages/components/messages/index.d.ts +1 -1
- package/app/modules/messages/components/messages/messages.component.d.ts +19 -16
- package/app/modules/messages/consts/email-message-formats.const.d.ts +5 -5
- package/app/modules/messages/consts/index.d.ts +1 -1
- package/app/modules/messages/enums/email-message-format.enum.d.ts +5 -5
- package/app/modules/messages/enums/index.d.ts +1 -1
- package/app/modules/messages/messages.module.d.ts +28 -2
- package/app/modules/webhooks/components/webhooks/webhooks.component.d.ts +15 -12
- package/app/modules/webhooks/webhooks.module.d.ts +9 -2
- package/bundles/firestitch-app-message.umd.js +1567 -1260
- package/bundles/firestitch-app-message.umd.js.map +1 -1
- package/esm2015/app/helpers/index-name-value.js +8 -8
- package/esm2015/app/helpers/index.js +2 -2
- package/esm2015/app/modules/app-message/app-message.module.js +17 -15
- package/esm2015/app/modules/app-message/injectors/app-message-config.injector.js +4 -4
- package/esm2015/app/modules/app-message/injectors/index.js +2 -2
- package/esm2015/app/modules/app-message/interfaces/app-message-config.js +2 -1
- package/esm2015/app/modules/app-message/interfaces/index.js +2 -1
- package/esm2015/app/modules/app-message/types/index.js +2 -1
- package/esm2015/app/modules/app-message/types/types.type.js +2 -1
- package/esm2015/app/modules/message-preview/components/index.js +2 -2
- package/esm2015/app/modules/message-preview/components/preview/index.js +2 -2
- package/esm2015/app/modules/message-preview/components/preview/preview.component.js +29 -25
- package/esm2015/app/modules/message-preview/message-preview.module.js +38 -27
- package/esm2015/app/modules/message-queues/components/queue/queue.component.js +209 -200
- package/esm2015/app/modules/message-queues/components/queues/queues.component.js +145 -141
- package/esm2015/app/modules/message-queues/components/recipient/recipient.component.js +30 -29
- package/esm2015/app/modules/message-queues/consts/index.js +2 -2
- package/esm2015/app/modules/message-queues/consts/message-queue-event-type.const.js +6 -6
- package/esm2015/app/modules/message-queues/consts/message-queue-states.const.js +11 -11
- package/esm2015/app/modules/message-queues/enums/email-message-queue-format.enum.js +7 -7
- package/esm2015/app/modules/message-queues/enums/index.js +4 -4
- package/esm2015/app/modules/message-queues/enums/message-queue-event-type.enum.js +6 -6
- package/esm2015/app/modules/message-queues/enums/message-queue-state.enum.js +11 -11
- package/esm2015/app/modules/message-queues/enums/message-queue-type.enum.js +6 -6
- package/esm2015/app/modules/message-queues/message-queues.module.js +120 -70
- package/esm2015/app/modules/message-queues/pipes/linkify.pipe.js +22 -20
- package/esm2015/app/modules/message-queues/pipes/truncate.pipe.js +22 -20
- package/esm2015/app/modules/message-queues/services/message-queue.service.js +29 -31
- package/esm2015/app/modules/message-templates/components/index.js +3 -0
- package/esm2015/app/modules/message-templates/components/template/index.js +2 -2
- package/esm2015/app/modules/message-templates/components/template/template.component.js +84 -75
- package/esm2015/app/modules/message-templates/components/templates/index.js +2 -0
- package/esm2015/app/modules/message-templates/components/templates/templates.component.js +91 -91
- package/esm2015/app/modules/message-templates/message-templates.module.js +98 -57
- package/esm2015/app/modules/messages/components/index.js +3 -3
- package/esm2015/app/modules/messages/components/message/index.js +2 -2
- package/esm2015/app/modules/messages/components/message/message.component.js +136 -125
- package/esm2015/app/modules/messages/components/messages/index.js +2 -2
- package/esm2015/app/modules/messages/components/messages/messages.component.js +74 -74
- package/esm2015/app/modules/messages/consts/email-message-formats.const.js +7 -7
- package/esm2015/app/modules/messages/consts/index.js +2 -2
- package/esm2015/app/modules/messages/enums/email-message-format.enum.js +7 -7
- package/esm2015/app/modules/messages/enums/index.js +2 -2
- package/esm2015/app/modules/messages/messages.module.js +111 -64
- package/esm2015/app/modules/webhooks/components/webhooks/webhooks.component.js +64 -63
- package/esm2015/app/modules/webhooks/webhooks.module.js +30 -23
- package/esm2015/firestitch-app-message.js +5 -13
- package/esm2015/public_api.js +18 -16
- package/fesm2015/firestitch-app-message.js +1166 -998
- package/fesm2015/firestitch-app-message.js.map +1 -1
- package/firestitch-app-message.d.ts +5 -12
- package/package.json +5 -8
- package/public_api.d.ts +15 -13
- package/bundles/firestitch-app-message.umd.min.js +0 -2
- package/bundles/firestitch-app-message.umd.min.js.map +0 -1
- package/esm5/app/helpers/index-name-value.js +0 -8
- package/esm5/app/helpers/index.js +0 -2
- package/esm5/app/modules/app-message/app-message.module.js +0 -19
- package/esm5/app/modules/app-message/injectors/app-message-config.injector.js +0 -4
- package/esm5/app/modules/app-message/injectors/index.js +0 -2
- package/esm5/app/modules/app-message/interfaces/app-message-config.js +0 -1
- package/esm5/app/modules/app-message/interfaces/index.js +0 -1
- package/esm5/app/modules/app-message/types/index.js +0 -1
- package/esm5/app/modules/app-message/types/types.type.js +0 -1
- package/esm5/app/modules/message-preview/components/index.js +0 -2
- package/esm5/app/modules/message-preview/components/preview/index.js +0 -2
- package/esm5/app/modules/message-preview/components/preview/preview.component.js +0 -26
- package/esm5/app/modules/message-preview/message-preview.module.js +0 -30
- package/esm5/app/modules/message-queues/components/queue/queue.component.js +0 -207
- package/esm5/app/modules/message-queues/components/queues/queues.component.js +0 -143
- package/esm5/app/modules/message-queues/components/recipient/recipient.component.js +0 -32
- package/esm5/app/modules/message-queues/consts/index.js +0 -2
- package/esm5/app/modules/message-queues/consts/message-queue-event-type.const.js +0 -6
- package/esm5/app/modules/message-queues/consts/message-queue-states.const.js +0 -11
- package/esm5/app/modules/message-queues/enums/email-message-queue-format.enum.js +0 -7
- package/esm5/app/modules/message-queues/enums/index.js +0 -4
- package/esm5/app/modules/message-queues/enums/message-queue-event-type.enum.js +0 -6
- package/esm5/app/modules/message-queues/enums/message-queue-state.enum.js +0 -11
- package/esm5/app/modules/message-queues/enums/message-queue-type.enum.js +0 -6
- package/esm5/app/modules/message-queues/message-queues.module.js +0 -73
- package/esm5/app/modules/message-queues/pipes/linkify.pipe.js +0 -23
- package/esm5/app/modules/message-queues/pipes/truncate.pipe.js +0 -26
- package/esm5/app/modules/message-queues/services/message-queue.service.js +0 -33
- package/esm5/app/modules/message-templates/components/template/index.js +0 -2
- package/esm5/app/modules/message-templates/components/template/template.component.js +0 -78
- package/esm5/app/modules/message-templates/components/templates/templates.component.js +0 -94
- package/esm5/app/modules/message-templates/message-templates.module.js +0 -60
- package/esm5/app/modules/messages/components/index.js +0 -3
- package/esm5/app/modules/messages/components/message/index.js +0 -2
- package/esm5/app/modules/messages/components/message/message.component.js +0 -130
- package/esm5/app/modules/messages/components/messages/index.js +0 -2
- package/esm5/app/modules/messages/components/messages/messages.component.js +0 -77
- package/esm5/app/modules/messages/consts/email-message-formats.const.js +0 -7
- package/esm5/app/modules/messages/consts/index.js +0 -2
- package/esm5/app/modules/messages/enums/email-message-format.enum.js +0 -7
- package/esm5/app/modules/messages/enums/index.js +0 -2
- package/esm5/app/modules/messages/messages.module.js +0 -67
- package/esm5/app/modules/webhooks/components/webhooks/webhooks.component.js +0 -65
- package/esm5/app/modules/webhooks/webhooks.module.js +0 -26
- package/esm5/firestitch-app-message.js +0 -13
- package/esm5/public_api.js +0 -16
- package/fesm5/firestitch-app-message.js +0 -1127
- package/fesm5/firestitch-app-message.js.map +0 -1
- package/firestitch-app-message.metadata.json +0 -1
|
@@ -1,1127 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param, __metadata, __assign, __spread } from 'tslib';
|
|
2
|
-
import { Inject, Component, InjectionToken, ChangeDetectorRef, ChangeDetectionStrategy, ViewChild, NgModule, Injectable, Input, Pipe } from '@angular/core';
|
|
3
|
-
import { CommonModule } from '@angular/common';
|
|
4
|
-
import { RouterModule } from '@angular/router';
|
|
5
|
-
import { FlexLayoutModule } from '@angular/flex-layout';
|
|
6
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
7
|
-
import { MatOptionModule } from '@angular/material/core';
|
|
8
|
-
import { MAT_DIALOG_DATA, MatDialog, MatDialogModule, MatDialogRef } from '@angular/material/dialog';
|
|
9
|
-
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
10
|
-
import { MatInputModule } from '@angular/material/input';
|
|
11
|
-
import { MatSelectModule } from '@angular/material/select';
|
|
12
|
-
import { MatTabsModule } from '@angular/material/tabs';
|
|
13
|
-
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
14
|
-
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
15
|
-
import { FsLabelModule } from '@firestitch/label';
|
|
16
|
-
import { FsDialogModule } from '@firestitch/dialog';
|
|
17
|
-
import { FsListComponent, FsListModule } from '@firestitch/list';
|
|
18
|
-
import { FsSkeletonModule } from '@firestitch/skeleton';
|
|
19
|
-
import { FormsModule } from '@angular/forms';
|
|
20
|
-
import { FsFormModule } from '@firestitch/form';
|
|
21
|
-
import { FsTextEditorModule } from '@firestitch/text-editor';
|
|
22
|
-
import { FsEditorRichTextModule } from '@firestitch/editor';
|
|
23
|
-
import { tap, switchMap, map, takeUntil } from 'rxjs/operators';
|
|
24
|
-
import { of, Subject } from 'rxjs';
|
|
25
|
-
import { ItemType } from '@firestitch/filter';
|
|
26
|
-
import { FsMessage } from '@firestitch/message';
|
|
27
|
-
import { FsPrompt, FsPromptInputModule } from '@firestitch/prompt';
|
|
28
|
-
import { FsIFrameModule } from '@firestitch/iframe';
|
|
29
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
30
|
-
import { FsDateModule } from '@firestitch/date';
|
|
31
|
-
import { SelectionActionType } from '@firestitch/selection';
|
|
32
|
-
import anchorme from 'anchorme';
|
|
33
|
-
|
|
34
|
-
var EmailMessageFormat;
|
|
35
|
-
(function (EmailMessageFormat) {
|
|
36
|
-
EmailMessageFormat["Text"] = "T";
|
|
37
|
-
EmailMessageFormat["HTML"] = "H";
|
|
38
|
-
EmailMessageFormat["RichText"] = "R";
|
|
39
|
-
})(EmailMessageFormat || (EmailMessageFormat = {}));
|
|
40
|
-
|
|
41
|
-
var EmailMessageFormats = [
|
|
42
|
-
{ name: 'Text', value: EmailMessageFormat.Text },
|
|
43
|
-
{ name: 'HTML', value: EmailMessageFormat.HTML },
|
|
44
|
-
{ name: 'Rich Text', value: EmailMessageFormat.RichText }
|
|
45
|
-
];
|
|
46
|
-
|
|
47
|
-
var PreviewComponent = /** @class */ (function () {
|
|
48
|
-
function PreviewComponent(_data) {
|
|
49
|
-
this._data = _data;
|
|
50
|
-
this.html = _data.html;
|
|
51
|
-
this.styles = _data.styles;
|
|
52
|
-
}
|
|
53
|
-
PreviewComponent.prototype.ngOnInit = function () {
|
|
54
|
-
};
|
|
55
|
-
PreviewComponent.ctorParameters = function () { return [
|
|
56
|
-
{ type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
|
|
57
|
-
]; };
|
|
58
|
-
PreviewComponent = __decorate([
|
|
59
|
-
Component({
|
|
60
|
-
template: "<fs-dialog>\n <div mat-dialog-title>Preview</div>\n <mat-dialog-content>\n <fs-iframe\n [html]=\"html\"\n [styles]=\"styles\">\n </fs-iframe>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button [mat-dialog-close]=\"null\" color=\"primary\" type=\"button\">Done</button>\n </mat-dialog-actions>\n</fs-dialog>\n",
|
|
61
|
-
styles: [""]
|
|
62
|
-
}),
|
|
63
|
-
__param(0, Inject(MAT_DIALOG_DATA)),
|
|
64
|
-
__metadata("design:paramtypes", [Object])
|
|
65
|
-
], PreviewComponent);
|
|
66
|
-
return PreviewComponent;
|
|
67
|
-
}());
|
|
68
|
-
|
|
69
|
-
var FS_APP_MESSAGE_ROOT_CONFIG = new InjectionToken('fs-app-message-root-config');
|
|
70
|
-
var FS_APP_MESSAGE_CONFIG = new InjectionToken('fs-app-message-config');
|
|
71
|
-
|
|
72
|
-
var MessageComponent = /** @class */ (function () {
|
|
73
|
-
function MessageComponent(_config, _data, _prompt, _message, _dialog, _cdRef) {
|
|
74
|
-
var _this = this;
|
|
75
|
-
this._config = _config;
|
|
76
|
-
this._data = _data;
|
|
77
|
-
this._prompt = _prompt;
|
|
78
|
-
this._message = _message;
|
|
79
|
-
this._dialog = _dialog;
|
|
80
|
-
this._cdRef = _cdRef;
|
|
81
|
-
this.messageTemplates = [];
|
|
82
|
-
this.emailMessageFormats = EmailMessageFormats;
|
|
83
|
-
this.emailMessageFormat = EmailMessageFormat;
|
|
84
|
-
this.save = function () {
|
|
85
|
-
return _this._config.saveMessage(_this.message)
|
|
86
|
-
.pipe(tap(function () {
|
|
87
|
-
_this._message.success('Saved Changes');
|
|
88
|
-
}));
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
MessageComponent.prototype.ngOnInit = function () {
|
|
92
|
-
var _this = this;
|
|
93
|
-
this._config.loadMessage(this._data.message)
|
|
94
|
-
.subscribe(function (response) {
|
|
95
|
-
_this.message = response;
|
|
96
|
-
if (_this.message.emailMessage && _this.message.emailMessage.customize === undefined) {
|
|
97
|
-
_this.message.emailMessage.customize = true;
|
|
98
|
-
}
|
|
99
|
-
if (_this.message.smsMessage && _this.message.smsMessage.customize === undefined) {
|
|
100
|
-
_this.message.smsMessage.customize = true;
|
|
101
|
-
}
|
|
102
|
-
_this._cdRef.markForCheck();
|
|
103
|
-
});
|
|
104
|
-
this._config.loadMessageTemplates()
|
|
105
|
-
.subscribe(function (data) {
|
|
106
|
-
_this.messageTemplates = data.data;
|
|
107
|
-
_this._cdRef.markForCheck();
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
|
-
MessageComponent.prototype.tabChange = function (event) {
|
|
111
|
-
switch (event.tab.textLabel) {
|
|
112
|
-
case 'SMS Message':
|
|
113
|
-
this.tab = 'sms';
|
|
114
|
-
break;
|
|
115
|
-
case 'Email Message':
|
|
116
|
-
this.tab = 'email';
|
|
117
|
-
break;
|
|
118
|
-
default:
|
|
119
|
-
this.tab = null;
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
MessageComponent.prototype.openPreview = function () {
|
|
123
|
-
var _this = this;
|
|
124
|
-
var html = this.message.emailMessage.body;
|
|
125
|
-
var styles = this.message.emailMessage.styles;
|
|
126
|
-
if (this.message.emailMessage.messageTemplateId) {
|
|
127
|
-
var messageTemplate = this.messageTemplates
|
|
128
|
-
.find(function (item) {
|
|
129
|
-
return _this.message.emailMessage.messageTemplateId === item.id;
|
|
130
|
-
});
|
|
131
|
-
if (messageTemplate) {
|
|
132
|
-
html = messageTemplate.content.replace('{$content}', html);
|
|
133
|
-
styles = messageTemplate.styles.concat(styles);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
this._dialog.open(PreviewComponent, {
|
|
137
|
-
data: {
|
|
138
|
-
styles: styles,
|
|
139
|
-
html: html,
|
|
140
|
-
},
|
|
141
|
-
width: '95%'
|
|
142
|
-
});
|
|
143
|
-
};
|
|
144
|
-
MessageComponent.prototype.sendTest = function (type) {
|
|
145
|
-
var _this = this;
|
|
146
|
-
of(true)
|
|
147
|
-
.pipe(switchMap(function () {
|
|
148
|
-
return type === 'email' ? _this._config.getTestEmail() : of('');
|
|
149
|
-
}), switchMap(function (default_) {
|
|
150
|
-
var typeName = type === 'email' ? 'an email' : 'phone number';
|
|
151
|
-
return _this._prompt.input({
|
|
152
|
-
label: "Please enter " + typeName + " to send test to",
|
|
153
|
-
title: 'Send Test',
|
|
154
|
-
commitLabel: 'Send',
|
|
155
|
-
default: default_,
|
|
156
|
-
required: true
|
|
157
|
-
});
|
|
158
|
-
}))
|
|
159
|
-
.subscribe(function (value) {
|
|
160
|
-
_this._config.testMessage(_this.message, value, type)
|
|
161
|
-
.subscribe(function () {
|
|
162
|
-
_this._message.success('Test Sent');
|
|
163
|
-
});
|
|
164
|
-
});
|
|
165
|
-
};
|
|
166
|
-
MessageComponent.ctorParameters = function () { return [
|
|
167
|
-
{ type: undefined, decorators: [{ type: Inject, args: [FS_APP_MESSAGE_CONFIG,] }] },
|
|
168
|
-
{ type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] },
|
|
169
|
-
{ type: FsPrompt },
|
|
170
|
-
{ type: FsMessage },
|
|
171
|
-
{ type: MatDialog },
|
|
172
|
-
{ type: ChangeDetectorRef }
|
|
173
|
-
]; };
|
|
174
|
-
MessageComponent = __decorate([
|
|
175
|
-
Component({
|
|
176
|
-
template: "<form\n fsForm\n [submit]=\"save\"\n #form=\"ngForm\"\n *fsSkeleton=\"message\"\n [dirtyConfirmTabs]=\"false\">\n <fs-dialog *ngIf=\"message\">\n <div mat-dialog-title>Edit Message</div>\n <mat-dialog-content>\n\n <mat-tab-group (selectedTabChange)=\"tabChange($event)\">\n <mat-tab label=\"General\">\n <ng-template matTabContent>\n <div fxLayout=\"column\">\n <mat-form-field>\n <input\n matInput\n placeholder=\"Name\"\n [(ngModel)]=\"message.name\"\n name=\"Name\"\n required>\n </mat-form-field>\n <mat-form-field>\n <input\n matInput\n placeholder=\"Description\"\n [(ngModel)]=\"message.description\"\n name=\"description\">\n </mat-form-field>\n\n <div\n fxLayout=\"row\"\n fxLayoutGap=\"10px\"\n fxLayout.xs=\"column\"\n fxLayout.sm=\"column\">\n <mat-form-field fxFlex>\n <input\n matInput\n placeholder=\"From Email\"\n [(ngModel)]=\"message.emailMessage.fromEmail\"\n name=\"from_email\">\n </mat-form-field>\n <mat-form-field fxFlex>\n <input\n matInput\n placeholder=\"From Name\"\n [(ngModel)]=\"message.emailMessage.fromName\"\n name=\"from_name\">\n </mat-form-field>\n <mat-form-field fxFlex>\n <input\n matInput\n placeholder=\"Reply To\"\n [(ngModel)]=\"message.emailMessage.replyTo\"\n name=\"reply_to\">\n </mat-form-field>\n </div>\n\n <div\n fxLayout=\"row\"\n fxLayoutGap=\"10px\"\n fxLayout.xs=\"column\"\n fxLayout.sm=\"column\">\n <mat-form-field fxFlex>\n <input\n matInput\n placeholder=\"To\"\n [(ngModel)]=\"message.emailMessage.toRecipients\"\n name=\"to\">\n </mat-form-field>\n <mat-form-field fxFlex>\n <input\n matInput\n placeholder=\"CC\"\n [(ngModel)]=\"message.emailMessage.ccRecipients\"\n name=\"cc\">\n </mat-form-field>\n <mat-form-field fxFlex>\n <input\n matInput\n placeholder=\"BCC\"\n [(ngModel)]=\"message.emailMessage.bccRecipients\"\n name=\"bcc\">\n </mat-form-field>\n </div>\n </div>\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Email Message\" *ngIf=\"message.emailMessage\">\n <ng-template matTabContent>\n <div fxLayout=\"column\">\n <div fxLayout=\"row\" fxLayoutGap=\"10px\">\n <mat-form-field>\n <mat-select\n required\n placeholder=\"Customize Message\"\n [(ngModel)]=\"message.emailMessage.customize\"\n name=\"customizeEmail\">\n <mat-option [value]=\"true\">Yes</mat-option>\n <mat-option [value]=\"false\">No</mat-option>\n </mat-select>\n </mat-form-field>\n <mat-form-field>\n <mat-select\n required\n placeholder=\"Format\"\n [(ngModel)]=\"message.emailMessage.format\"\n name=\"format\">\n <mat-option *ngFor=\"let item of emailMessageFormats\" [value]=\"item.value\">\n {{item.name}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n <mat-form-field>\n <mat-select\n placeholder=\"Template\"\n [(ngModel)]=\"message.emailMessage.messageTemplateId\"\n name=\"template\">\n <mat-option [value]=\"null\">None</mat-option>\n <mat-option *ngFor=\"let item of messageTemplates\" [value]=\"item.id\">\n {{item.name}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n <ng-container *ngIf=\"message.emailMessage.customize\">\n <mat-form-field fxFlex>\n <input\n matInput\n placeholder=\"Subject\"\n [(ngModel)]=\"message.emailMessage.subject\"\n name=\"name\"\n required>\n </mat-form-field>\n\n <div [@.disabled]=\"true\">\n <mat-tab-group [dynamicHeight]=\"false\">\n <mat-tab label=\"Content\">\n <ng-template matTabContent>\n <fs-text-editor\n *ngIf=\"message.emailMessage.format===emailMessageFormat.HTML\"\n [(ngModel)]=\"message.emailMessage.body\"\n name=\"body\"\n [config]=\"{ language: 'html '}\">\n </fs-text-editor>\n\n <fs-editor-rich-text\n *ngIf=\"message.emailMessage.format===emailMessageFormat.RichText\"\n [(ngModel)]=\"message.emailMessage.body\"\n name=\"body\">\n </fs-editor-rich-text>\n\n <fs-text-editor\n *ngIf=\"message.emailMessage.format===emailMessageFormat.Text\"\n [(ngModel)]=\"message.emailMessage.body\"\n name=\"emailMessageBody\"\n [config]=\"{ language: 'text' }\">\n </fs-text-editor>\n </ng-template>\n </mat-tab>\n <mat-tab\n *ngIf=\"message.emailMessage.format===emailMessageFormat.HTML\"\n label=\"Styles\">\n <ng-template matTabContent>\n <fs-text-editor\n [(ngModel)]=\"message.emailMessage.styles\"\n name=\"styles\"\n [config]=\"{ language: 'scss' }\">\n </fs-text-editor>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n </div>\n\n </ng-container>\n\n <ng-container *ngIf=\"!message.emailMessage.customize\">\n <fs-label-field>\n <fs-label>Subject</fs-label>\n {{message.defaultEmailSubject}}\n </fs-label-field>\n <div>\n <fs-label-field>\n <fs-label>Content</fs-label>\n <div\n class=\"email-body-html-default\"\n *ngIf=\"message.emailMessage.format===emailMessageFormat.HTML\">\n {{message.defaultEmailBody}}\n </div>\n <div\n *ngIf=\"message.emailMessage.format===emailMessageFormat.RichText\"\n fsEditorRenderer\n name=\"defaultEmailBody\"\n [ngModel]=\"message.defaultEmailBody\">\n </div>\n <div\n class=\"email-body-text-default\"\n *ngIf=\"message.emailMessage.format===emailMessageFormat.Text\">\n {{message.defaultEmailBody}}\n </div>\n </fs-label-field>\n </div>\n </ng-container>\n </div>\n </ng-template>\n </mat-tab>\n\n <mat-tab label=\"SMS Message\" *ngIf=\"message.smsMessage\">\n <ng-template matTabContent>\n <mat-form-field>\n <mat-select\n required\n placeholder=\"Customize Message\"\n [(ngModel)]=\"message.smsMessage.customize\"\n name=\"customizeSms\">\n <mat-option [value]=\"true\">Yes</mat-option>\n <mat-option [value]=\"false\">No</mat-option>\n </mat-select>\n </mat-form-field>\n <div\n *ngIf=\"message.smsMessage.customize\"\n [@.disabled]=\"true\">\n <mat-tab-group [dynamicHeight]=\"false\">\n <mat-tab label=\"Content\">\n <ng-template matTabContent>\n <fs-text-editor\n [(ngModel)]=\"message.smsMessage.message\"\n name=\"smsMessageMessage\"\n [config]=\"{ language: 'text '}\">\n </fs-text-editor>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n </div>\n <fs-label-field *ngIf=\"!message.smsMessage.customize\">\n <fs-label>Message</fs-label>\n {{message.defaultSmsMessage}}\n </fs-label-field>\n </ng-template>\n </mat-tab>\n\n <mat-tab label=\"Variables\" *ngIf=\"message.variables\">\n <ng-template matTabContent>\n <div *ngFor=\"let variable of message.variables\" class=\"variable\">\n {{variable.name}}\n </div>\n </ng-template>\n </mat-tab>\n\n <mat-tab label=\"Defaults\">\n <ng-template matTabContent>\n <ng-container *ngIf=\"message.emailMessage\">\n <h2 *ngIf=\"message.emailMessage && message.smsMessage\">Email</h2>\n <fs-label-field>\n <fs-label>Subject</fs-label>\n <div class=\"content\">{{message.defaultEmailSubject}}</div>\n </fs-label-field>\n <fs-label-field>\n <fs-label>Content</fs-label>\n <div class=\"content\">{{message.defaultEmailBody}}</div>\n </fs-label-field>\n </ng-container>\n <ng-container *ngIf=\"message.smsMessage\">\n <h2 *ngIf=\"message.emailMessage && message.smsMessage\">SMS</h2>\n <fs-label-field>\n <fs-label>Content</fs-label>\n <div class=\"content\">{{message.defaultSmsMessage}}</div>\n </fs-label-field>\n </ng-container>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button color=\"primary\">Save</button>\n <button\n *ngIf=\"tab==='email' && message.emailMessage.format===emailMessageFormat.HTML\"\n mat-button\n type=\"button\"\n (click)=\"openPreview()\"\n type=\"button\">\n Preview\n </button>\n <button\n *ngIf=\"tab==='email'\"\n mat-button\n type=\"button\"\n (click)=\"sendTest('email')\"\n type=\"button\">\n Send Test Email\n </button>\n <button\n *ngIf=\"tab==='sms'\"\n mat-button\n type=\"button\"\n (click)=\"sendTest('sms')\"\n type=\"button\">\n Send Test SMS\n </button>\n <button mat-button [mat-dialog-close]=\"null\" type=\"button\">Cancel</button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n",
|
|
177
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
178
|
-
styles: ["fs-label-field .content{white-space:pre-wrap}:host ::ng-deep .mat-tab-body,:host ::ng-deep .mat-tab-body-content{overflow:visible}:host ::ng-deep .sms-message{width:100%}:host ::ng-deep .email-body-html-default,:host ::ng-deep .email-body-text-default{white-space:pre-line}.email-body-text{width:100%}.variable{margin-bottom:4px}"]
|
|
179
|
-
}),
|
|
180
|
-
__param(0, Inject(FS_APP_MESSAGE_CONFIG)),
|
|
181
|
-
__param(1, Inject(MAT_DIALOG_DATA)),
|
|
182
|
-
__metadata("design:paramtypes", [Object, Object, FsPrompt,
|
|
183
|
-
FsMessage,
|
|
184
|
-
MatDialog,
|
|
185
|
-
ChangeDetectorRef])
|
|
186
|
-
], MessageComponent);
|
|
187
|
-
return MessageComponent;
|
|
188
|
-
}());
|
|
189
|
-
|
|
190
|
-
function indexNameValue(arry) {
|
|
191
|
-
var obj = {};
|
|
192
|
-
arry.forEach(function (item) {
|
|
193
|
-
obj[item.value] = item.name;
|
|
194
|
-
});
|
|
195
|
-
return obj;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
var MessagesComponent = /** @class */ (function () {
|
|
199
|
-
function MessagesComponent(_config, _dialog) {
|
|
200
|
-
this._config = _config;
|
|
201
|
-
this._dialog = _dialog;
|
|
202
|
-
this.list = null;
|
|
203
|
-
this.config = null;
|
|
204
|
-
this.emailMessageFormats = {};
|
|
205
|
-
this._destroy$ = new Subject();
|
|
206
|
-
}
|
|
207
|
-
MessagesComponent.prototype.ngOnInit = function () {
|
|
208
|
-
var _this = this;
|
|
209
|
-
this.emailMessageFormats = indexNameValue(EmailMessageFormats);
|
|
210
|
-
this.config = {
|
|
211
|
-
filters: [
|
|
212
|
-
{
|
|
213
|
-
name: 'keyword',
|
|
214
|
-
type: ItemType.Keyword,
|
|
215
|
-
label: 'Search'
|
|
216
|
-
}
|
|
217
|
-
],
|
|
218
|
-
fetch: function (query) {
|
|
219
|
-
return _this._config.loadMessages(query)
|
|
220
|
-
.pipe(map(function (response) {
|
|
221
|
-
return ({ data: response.data, paging: response.paging });
|
|
222
|
-
}));
|
|
223
|
-
}
|
|
224
|
-
};
|
|
225
|
-
};
|
|
226
|
-
MessagesComponent.prototype.open = function (message) {
|
|
227
|
-
var _this = this;
|
|
228
|
-
var dialogRef = this._dialog.open(MessageComponent, {
|
|
229
|
-
data: {
|
|
230
|
-
message: message,
|
|
231
|
-
},
|
|
232
|
-
width: '85%'
|
|
233
|
-
});
|
|
234
|
-
dialogRef.afterClosed()
|
|
235
|
-
.pipe(takeUntil(this._destroy$))
|
|
236
|
-
.subscribe(function () {
|
|
237
|
-
_this.list.reload();
|
|
238
|
-
});
|
|
239
|
-
};
|
|
240
|
-
MessagesComponent.prototype.ngOnDestroy = function () {
|
|
241
|
-
this._destroy$.next();
|
|
242
|
-
this._destroy$.complete();
|
|
243
|
-
};
|
|
244
|
-
MessagesComponent.ctorParameters = function () { return [
|
|
245
|
-
{ type: undefined, decorators: [{ type: Inject, args: [FS_APP_MESSAGE_CONFIG,] }] },
|
|
246
|
-
{ type: MatDialog }
|
|
247
|
-
]; };
|
|
248
|
-
__decorate([
|
|
249
|
-
ViewChild(FsListComponent, { static: true }),
|
|
250
|
-
__metadata("design:type", FsListComponent)
|
|
251
|
-
], MessagesComponent.prototype, "list", void 0);
|
|
252
|
-
MessagesComponent = __decorate([
|
|
253
|
-
Component({
|
|
254
|
-
selector: 'fs-app-messages',
|
|
255
|
-
template: "<fs-list [config]=\"config\">\n <fs-list-column title=\"Name\" name=\"name\" sortable=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"open(row)\">{{row.name}}</a>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Email Format\">\n <ng-template fs-list-cell let-row=\"row\">\n {{emailMessageFormats[row.emailMessage.format]}}\n </ng-template>\n </fs-list-column>\n</fs-list>\n"
|
|
256
|
-
}),
|
|
257
|
-
__param(0, Inject(FS_APP_MESSAGE_CONFIG)),
|
|
258
|
-
__metadata("design:paramtypes", [Object, MatDialog])
|
|
259
|
-
], MessagesComponent);
|
|
260
|
-
return MessagesComponent;
|
|
261
|
-
}());
|
|
262
|
-
|
|
263
|
-
var FsAppMessagePreviewModule = /** @class */ (function () {
|
|
264
|
-
function FsAppMessagePreviewModule() {
|
|
265
|
-
}
|
|
266
|
-
FsAppMessagePreviewModule = __decorate([
|
|
267
|
-
NgModule({
|
|
268
|
-
imports: [
|
|
269
|
-
MatDialogModule,
|
|
270
|
-
MatButtonModule,
|
|
271
|
-
FsDialogModule,
|
|
272
|
-
FsIFrameModule,
|
|
273
|
-
],
|
|
274
|
-
declarations: [
|
|
275
|
-
PreviewComponent,
|
|
276
|
-
],
|
|
277
|
-
exports: [
|
|
278
|
-
PreviewComponent,
|
|
279
|
-
]
|
|
280
|
-
})
|
|
281
|
-
], FsAppMessagePreviewModule);
|
|
282
|
-
return FsAppMessagePreviewModule;
|
|
283
|
-
}());
|
|
284
|
-
|
|
285
|
-
var FsAppMessagesModule = /** @class */ (function () {
|
|
286
|
-
function FsAppMessagesModule() {
|
|
287
|
-
}
|
|
288
|
-
FsAppMessagesModule = __decorate([
|
|
289
|
-
NgModule({
|
|
290
|
-
imports: [
|
|
291
|
-
RouterModule,
|
|
292
|
-
CommonModule,
|
|
293
|
-
FormsModule,
|
|
294
|
-
MatDialogModule,
|
|
295
|
-
MatButtonModule,
|
|
296
|
-
MatTabsModule,
|
|
297
|
-
MatFormFieldModule,
|
|
298
|
-
MatInputModule,
|
|
299
|
-
MatOptionModule,
|
|
300
|
-
MatSelectModule,
|
|
301
|
-
MatTooltipModule,
|
|
302
|
-
MatCheckboxModule,
|
|
303
|
-
FsDialogModule,
|
|
304
|
-
FsListModule,
|
|
305
|
-
FsLabelModule,
|
|
306
|
-
FlexLayoutModule,
|
|
307
|
-
FsSkeletonModule,
|
|
308
|
-
FsFormModule,
|
|
309
|
-
FsTextEditorModule,
|
|
310
|
-
FsEditorRichTextModule,
|
|
311
|
-
FsAppMessagePreviewModule,
|
|
312
|
-
],
|
|
313
|
-
declarations: [
|
|
314
|
-
MessagesComponent,
|
|
315
|
-
MessageComponent,
|
|
316
|
-
],
|
|
317
|
-
exports: [
|
|
318
|
-
MessagesComponent,
|
|
319
|
-
MessageComponent,
|
|
320
|
-
],
|
|
321
|
-
})
|
|
322
|
-
], FsAppMessagesModule);
|
|
323
|
-
return FsAppMessagesModule;
|
|
324
|
-
}());
|
|
325
|
-
|
|
326
|
-
var MessageQueueState;
|
|
327
|
-
(function (MessageQueueState) {
|
|
328
|
-
MessageQueueState["Sent"] = "S";
|
|
329
|
-
MessageQueueState["PartiallySent"] = "P";
|
|
330
|
-
MessageQueueState["Sending"] = "E";
|
|
331
|
-
MessageQueueState["Queued"] = "Q";
|
|
332
|
-
MessageQueueState["Canceled"] = "C";
|
|
333
|
-
MessageQueueState["InvalidRecipients"] = "I";
|
|
334
|
-
MessageQueueState["Failed"] = "F";
|
|
335
|
-
})(MessageQueueState || (MessageQueueState = {}));
|
|
336
|
-
|
|
337
|
-
var MessageQueueStates = [
|
|
338
|
-
{ name: 'Sent', value: MessageQueueState.Sent },
|
|
339
|
-
{ name: 'Partially Sent', value: MessageQueueState.PartiallySent },
|
|
340
|
-
{ name: 'Sending', value: MessageQueueState.Sending },
|
|
341
|
-
{ name: 'Queued', value: MessageQueueState.Queued },
|
|
342
|
-
{ name: 'Canceled', value: MessageQueueState.Canceled },
|
|
343
|
-
{ name: 'Invalid Recipients', value: MessageQueueState.InvalidRecipients },
|
|
344
|
-
{ name: 'Failed', value: MessageQueueState.Failed }
|
|
345
|
-
];
|
|
346
|
-
|
|
347
|
-
var EmailMessageQueueFormat;
|
|
348
|
-
(function (EmailMessageQueueFormat) {
|
|
349
|
-
EmailMessageQueueFormat["Text"] = "T";
|
|
350
|
-
EmailMessageQueueFormat["HTML"] = "H";
|
|
351
|
-
EmailMessageQueueFormat["RichText"] = "R";
|
|
352
|
-
})(EmailMessageQueueFormat || (EmailMessageQueueFormat = {}));
|
|
353
|
-
|
|
354
|
-
var MessageQueueType;
|
|
355
|
-
(function (MessageQueueType) {
|
|
356
|
-
MessageQueueType["Sms"] = "S";
|
|
357
|
-
MessageQueueType["Email"] = "E";
|
|
358
|
-
})(MessageQueueType || (MessageQueueType = {}));
|
|
359
|
-
|
|
360
|
-
var MessageQueueEventType;
|
|
361
|
-
(function (MessageQueueEventType) {
|
|
362
|
-
MessageQueueEventType["Click"] = "click";
|
|
363
|
-
MessageQueueEventType["Open"] = "open";
|
|
364
|
-
})(MessageQueueEventType || (MessageQueueEventType = {}));
|
|
365
|
-
|
|
366
|
-
var MessageQueueEventTypes = [
|
|
367
|
-
{ name: 'Open', value: MessageQueueEventType.Open },
|
|
368
|
-
{ name: 'Click', value: MessageQueueEventType.Click },
|
|
369
|
-
];
|
|
370
|
-
|
|
371
|
-
var QueueComponent = /** @class */ (function () {
|
|
372
|
-
function QueueComponent(_config, _message, _prompt, _dialog, _data) {
|
|
373
|
-
this._config = _config;
|
|
374
|
-
this._message = _message;
|
|
375
|
-
this._prompt = _prompt;
|
|
376
|
-
this._dialog = _dialog;
|
|
377
|
-
this._data = _data;
|
|
378
|
-
this.messageQueueRecipients = {};
|
|
379
|
-
this.emailMessageQueueFormat = EmailMessageQueueFormat;
|
|
380
|
-
this.MessageQueueEventTypes = indexNameValue(MessageQueueEventTypes);
|
|
381
|
-
this.MessageQueueEventType = MessageQueueEventType;
|
|
382
|
-
this._destroy$ = new Subject();
|
|
383
|
-
}
|
|
384
|
-
QueueComponent.prototype.ngOnInit = function () {
|
|
385
|
-
var _this = this;
|
|
386
|
-
this.messageQueueStates = indexNameValue(MessageQueueStates);
|
|
387
|
-
this.resendMessageQueue = this._config.resendMessageQueue;
|
|
388
|
-
this.forwardMessageQueue = this._config.forwardMessageQueue;
|
|
389
|
-
this._config.loadMessageQueue(this._data.messageQueueId)
|
|
390
|
-
.subscribe(function (messageQueue) {
|
|
391
|
-
_this.messageQueue = messageQueue;
|
|
392
|
-
if (_this.messageQueue.emailMessageQueue) {
|
|
393
|
-
var body = _this.messageQueue.emailMessageQueue.body;
|
|
394
|
-
if (_this.messageQueue.emailMessageQueue.format === EmailMessageQueueFormat.HTML) {
|
|
395
|
-
try {
|
|
396
|
-
var doc = new DOMParser().parseFromString(body, 'text/html');
|
|
397
|
-
doc.querySelectorAll('a').forEach(function (el) {
|
|
398
|
-
el.setAttribute('target', '_blank');
|
|
399
|
-
});
|
|
400
|
-
body = doc.documentElement.innerHTML;
|
|
401
|
-
}
|
|
402
|
-
catch (e) {
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
else {
|
|
406
|
-
body = _this.anchorMe(body);
|
|
407
|
-
}
|
|
408
|
-
_this.messageQueue.emailMessageQueue.body = body;
|
|
409
|
-
}
|
|
410
|
-
if (_this.messageQueue.smsMessageQueue) {
|
|
411
|
-
_this.messageQueue.smsMessageQueue.body = _this.anchorMe(_this.messageQueue.smsMessageQueue.body);
|
|
412
|
-
}
|
|
413
|
-
_this.messageQueueRecipients = _this.messageQueue.messageQueueRecipients
|
|
414
|
-
.reduce(function (accum, messageQueueRecipient) {
|
|
415
|
-
accum[messageQueueRecipient.recipient] = messageQueueRecipient.state;
|
|
416
|
-
return accum;
|
|
417
|
-
}, {});
|
|
418
|
-
_this._setLogsConfig(messageQueue);
|
|
419
|
-
_this._setAttachmentsConfig(messageQueue);
|
|
420
|
-
_this._setEventsConfig(messageQueue);
|
|
421
|
-
});
|
|
422
|
-
};
|
|
423
|
-
QueueComponent.prototype.anchorMe = function (html) {
|
|
424
|
-
return anchorme(html, {
|
|
425
|
-
options: {
|
|
426
|
-
attributes: [
|
|
427
|
-
{
|
|
428
|
-
name: 'target',
|
|
429
|
-
value: '_blank'
|
|
430
|
-
},
|
|
431
|
-
],
|
|
432
|
-
},
|
|
433
|
-
});
|
|
434
|
-
};
|
|
435
|
-
QueueComponent.prototype.openMessage = function (message) {
|
|
436
|
-
this._dialog.open(MessageComponent, {
|
|
437
|
-
data: {
|
|
438
|
-
message: message,
|
|
439
|
-
},
|
|
440
|
-
width: '85%'
|
|
441
|
-
});
|
|
442
|
-
};
|
|
443
|
-
QueueComponent.prototype.resend = function () {
|
|
444
|
-
var _this = this;
|
|
445
|
-
this._prompt.confirm({
|
|
446
|
-
title: 'Confirm',
|
|
447
|
-
template: 'Are you sure you would like to resend this message?'
|
|
448
|
-
}).subscribe(function () {
|
|
449
|
-
_this.resendMessageQueue(_this.messageQueue)
|
|
450
|
-
.subscribe(function (messageQueue) {
|
|
451
|
-
Object.assign(_this.messageQueue, messageQueue);
|
|
452
|
-
_this._message.success('Successfully resent');
|
|
453
|
-
if (_this.logList) {
|
|
454
|
-
_this.logList.reload();
|
|
455
|
-
}
|
|
456
|
-
});
|
|
457
|
-
});
|
|
458
|
-
};
|
|
459
|
-
QueueComponent.prototype.forward = function () {
|
|
460
|
-
var _this = this;
|
|
461
|
-
var typeName = this.messageQueue.type === MessageQueueType.Email ? 'an email' : 'a phone number';
|
|
462
|
-
this._prompt.input({
|
|
463
|
-
label: "Please enter " + typeName + " to forward to",
|
|
464
|
-
title: 'Forward Message',
|
|
465
|
-
commitLabel: 'Forward',
|
|
466
|
-
required: true
|
|
467
|
-
}).subscribe(function (value) {
|
|
468
|
-
if (value) {
|
|
469
|
-
_this.forwardMessageQueue(_this.messageQueue, value)
|
|
470
|
-
.subscribe(function (messageQueue) {
|
|
471
|
-
_this.messageQueue = __assign(__assign({}, _this.messageQueue), { messageQueue: messageQueue });
|
|
472
|
-
_this._message.success('Successfully forwarded');
|
|
473
|
-
if (_this.logList) {
|
|
474
|
-
_this.logList.reload();
|
|
475
|
-
}
|
|
476
|
-
});
|
|
477
|
-
}
|
|
478
|
-
});
|
|
479
|
-
};
|
|
480
|
-
QueueComponent.prototype.ngOnDestroy = function () {
|
|
481
|
-
this._destroy$.next();
|
|
482
|
-
this._destroy$.complete();
|
|
483
|
-
};
|
|
484
|
-
QueueComponent.prototype._setLogsConfig = function (messageQueue) {
|
|
485
|
-
var _this = this;
|
|
486
|
-
this.logConfig = {
|
|
487
|
-
loadMore: true,
|
|
488
|
-
queryParam: false,
|
|
489
|
-
fetch: function (query) {
|
|
490
|
-
return _this._config.loadLogs(messageQueue, query);
|
|
491
|
-
}
|
|
492
|
-
};
|
|
493
|
-
};
|
|
494
|
-
QueueComponent.prototype._setEventsConfig = function (messageQueue) {
|
|
495
|
-
var _this = this;
|
|
496
|
-
this.eventConfig = {
|
|
497
|
-
loadMore: true,
|
|
498
|
-
queryParam: false,
|
|
499
|
-
fetch: function (query) {
|
|
500
|
-
return _this._config.loadMessageQueueEvents(messageQueue, query);
|
|
501
|
-
}
|
|
502
|
-
};
|
|
503
|
-
};
|
|
504
|
-
QueueComponent.prototype._setAttachmentsConfig = function (messageQueue) {
|
|
505
|
-
var _this = this;
|
|
506
|
-
this.attachmentConfig = {
|
|
507
|
-
queryParam: false,
|
|
508
|
-
fetch: function (query) {
|
|
509
|
-
return _this._config.loadMessageQueueAttachments(messageQueue, query)
|
|
510
|
-
.pipe(map(function (response) { return ({
|
|
511
|
-
data: response.data.map(function (value) {
|
|
512
|
-
value.prettyFilesize = _this._prettyFilesize(value.filesize);
|
|
513
|
-
return value;
|
|
514
|
-
}), paging: response.paging
|
|
515
|
-
}); }));
|
|
516
|
-
}
|
|
517
|
-
};
|
|
518
|
-
if (this._config.downloadMessageQueueAttachment) {
|
|
519
|
-
this.attachmentConfig.rowActions = [
|
|
520
|
-
{
|
|
521
|
-
click: function (messageAttachment) {
|
|
522
|
-
_this._config.downloadMessageQueueAttachment(messageAttachment, _this.messageQueue);
|
|
523
|
-
},
|
|
524
|
-
label: 'Download',
|
|
525
|
-
}
|
|
526
|
-
];
|
|
527
|
-
}
|
|
528
|
-
};
|
|
529
|
-
QueueComponent.prototype._prettyFilesize = function (bytes) {
|
|
530
|
-
if (bytes === 0) {
|
|
531
|
-
return '0.00 B';
|
|
532
|
-
}
|
|
533
|
-
var e = Math.floor(Math.log(bytes) / Math.log(1024));
|
|
534
|
-
return (bytes / Math.pow(1024, e)).toFixed(2) + ' ' + ' KMGTP'.charAt(e) + 'B';
|
|
535
|
-
};
|
|
536
|
-
QueueComponent.ctorParameters = function () { return [
|
|
537
|
-
{ type: undefined, decorators: [{ type: Inject, args: [FS_APP_MESSAGE_CONFIG,] }] },
|
|
538
|
-
{ type: FsMessage },
|
|
539
|
-
{ type: FsPrompt },
|
|
540
|
-
{ type: MatDialog },
|
|
541
|
-
{ type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
|
|
542
|
-
]; };
|
|
543
|
-
__decorate([
|
|
544
|
-
ViewChild('logList'),
|
|
545
|
-
__metadata("design:type", FsListComponent)
|
|
546
|
-
], QueueComponent.prototype, "logList", void 0);
|
|
547
|
-
QueueComponent = __decorate([
|
|
548
|
-
Component({
|
|
549
|
-
template: "<fs-dialog *fsSkeleton=\"messageQueue\">\n <div mat-dialog-title>Message Queue</div>\n <mat-dialog-content>\n <mat-tab-group>\n <mat-tab label=\"Overview\">\n <ng-template matTabContent>\n <div fxLayout=\"row wrap\" fxLayoutGap=\"25px\">\n <ng-container *ngIf=\"messageQueue.emailMessageQueue\">\n <fs-label-field>\n <fs-label>\n To Recipients\n </fs-label>\n <app-recipient \n *ngFor=\"let recipient of messageQueue.emailMessageQueue.toRecipients\"\n [state]=\"messageQueueRecipients[recipient]\"\n [name]=\"recipient\">\n </app-recipient>\n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.emailMessageQueue.ccRecipients.length\">\n <fs-label>\n CC\n </fs-label>\n <app-recipient \n *ngFor=\"let recipient of messageQueue.emailMessageQueue.ccRecipients\"\n [state]=\"messageQueueRecipients[recipient]\"\n [name]=\"recipient\">\n </app-recipient> \n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.emailMessageQueue.bccRecipients.length\">\n <fs-label>\n BCC\n </fs-label>\n <app-recipient \n *ngFor=\"let recipient of messageQueue.emailMessageQueue.bccRecipients\"\n [state]=\"messageQueueRecipients[recipient]\"\n [name]=\"recipient\">\n </app-recipient> \n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.emailMessageQueue.fromName || messageQueue.emailMessageQueue.fromEmail\">\n <fs-label>\n From\n </fs-label>\n <ng-container *ngIf=\"messageQueue.emailMessageQueue.fromName === messageQueue.emailMessageQueue.fromEmail; else fromEmailName\">\n {{messageQueue.emailMessageQueue.fromName}}\n </ng-container>\n\n <ng-template #fromEmailName>\n {{messageQueue.emailMessageQueue.fromName}}\n <ng-container *ngIf=\"messageQueue.emailMessageQueue.fromEmail\">\n ({{messageQueue.emailMessageQueue.fromEmail}})\n </ng-container>\n </ng-template>\n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.emailMessageQueue.replyEmail && messageQueue.emailMessageQueue.replyEmail.length\">\n <fs-label>\n Reply To\n </fs-label>\n {{messageQueue.emailMessageQueue.replyEmail.join(', ')}}\n </fs-label-field>\n </ng-container>\n\n <ng-container *ngIf=\"messageQueue.smsMessageQueue\">\n <fs-label-field>\n <fs-label>\n To Number\n </fs-label>\n <app-recipient \n [state]=\"messageQueue.state\"\n [name]=\"messageQueue.smsMessageQueue.toNumber\">\n </app-recipient> \n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.smsMessageQueue.fromNumber\">\n <fs-label>\n From Number\n </fs-label>\n {{messageQueue.smsMessageQueue.fromNumber}}\n </fs-label-field>\n </ng-container>\n \n <fs-label-field>\n <fs-label>\n Date\n </fs-label>\n {{messageQueue.scheduledDate | fsDateFormat: 'full-date-time'}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Status\n </fs-label>\n {{messageQueueStates[messageQueue.state]}}\n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.message\">\n <fs-label>\n Message Type\n </fs-label>\n <a\n (click)=\"openMessage(messageQueue.message)\"\n *ngIf=\"loadMessage; else elseMessage\">\n {{messageQueue.message.name}}\n </a>\n <ng-template #elseMessage>\n {{messageQueue.message.name}}\n </ng-template>\n </fs-label-field>\n </div>\n\n <ng-container *ngIf=\"messageQueue.emailMessageQueue\">\n <fs-label-field class=\"subject\">\n <fs-label>\n Subject\n </fs-label>\n {{messageQueue.emailMessageQueue.subject}}\n </fs-label-field>\n\n <fs-label-field class=\"body\">\n <fs-label>\n Body\n </fs-label>\n <div\n *ngIf=\"messageQueue.emailMessageQueue.format===emailMessageQueueFormat.Text\"\n class=\"format-text\"\n [innerHTML]=\"messageQueue.emailMessageQueue.body\">\n </div>\n <fs-iframe\n *ngIf=\"messageQueue.emailMessageQueue.format===emailMessageQueueFormat.HTML || messageQueue.emailMessageQueue.format===emailMessageQueueFormat.RichText\"\n [html]=\"messageQueue.emailMessageQueue.body\">\n </fs-iframe>\n </fs-label-field>\n </ng-container>\n\n <ng-container *ngIf=\"messageQueue.smsMessageQueue\">\n <fs-label-field>\n <fs-label>\n Message\n </fs-label>\n <div\n class=\"format-text\"\n [innerHTML]=\"messageQueue.smsMessageQueue.body\">\n </div>\n </fs-label-field>\n </ng-container>\n\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Logs\">\n <ng-template matTabContent>\n <fs-list [config]=\"logConfig\" #logList>\n <fs-list-column title=\"Message\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.message}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Date\">\n <ng-template fs-list-cell let-row=\"row\">\n <fs-date-ago [date]=\"row.createdDate\"></fs-date-ago>\n </ng-template>\n </fs-list-column>\n </fs-list>\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Attachments\">\n <ng-template matTabContent>\n <fs-list [config]=\"attachmentConfig\">\n <fs-list-column title=\"File Name\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.filename}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"File Size\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.prettyFilesize}}\n </ng-template>\n </fs-list-column>\n </fs-list>\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Events\">\n <ng-template matTabContent>\n <fs-list [config]=\"eventConfig\">\n <fs-list-column title=\"Event\">\n <ng-template fs-list-cell let-row=\"row\">\n {{MessageQueueEventTypes[row.type]}}\n <div class=\"small\" *ngIf=\"row.type === MessageQueueEventType.Click\">\n {{row.meta?.url}}\n </div>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Date\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.createDate | fsDateFormat: 'date-time-yearless'}}\n </ng-template>\n </fs-list-column>\n </fs-list>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n mat-button\n [mat-dialog-close]=\"null\"\n color=\"primary\">\n Done\n </button>\n <button\n mat-button\n *ngIf=\"resendMessageQueue\"\n type=\"button\"\n (click)=\"resend()\"\n type=\"button\">\n Resend\n </button>\n <button\n mat-button\n *ngIf=\"forwardMessageQueue\"\n type=\"button\"\n (click)=\"forward()\"\n type=\"button\">\n Forward\n </button>\n </mat-dialog-actions>\n</fs-dialog>\n",
|
|
550
|
-
styles: [".body,.subject{display:block;margin-top:15px}.body .format-text{white-space:pre-wrap}.body .body-frame{border:0}.body ::ng-deep .field-label{margin-bottom:10px}app-recipient{display:block}[hidden]{display:none!important}"]
|
|
551
|
-
}),
|
|
552
|
-
__param(0, Inject(FS_APP_MESSAGE_CONFIG)),
|
|
553
|
-
__param(4, Inject(MAT_DIALOG_DATA)),
|
|
554
|
-
__metadata("design:paramtypes", [Object, FsMessage,
|
|
555
|
-
FsPrompt,
|
|
556
|
-
MatDialog, Object])
|
|
557
|
-
], QueueComponent);
|
|
558
|
-
return QueueComponent;
|
|
559
|
-
}());
|
|
560
|
-
|
|
561
|
-
var FsMessageQueueService = /** @class */ (function () {
|
|
562
|
-
function FsMessageQueueService(_dialog) {
|
|
563
|
-
this._dialog = _dialog;
|
|
564
|
-
this._destroy$ = new Subject();
|
|
565
|
-
}
|
|
566
|
-
FsMessageQueueService.prototype.openMessageQueue = function (messageQueueId, options) {
|
|
567
|
-
if (options === void 0) { options = {}; }
|
|
568
|
-
return this._dialog.open(QueueComponent, __assign(__assign({}, options), { data: {
|
|
569
|
-
messageQueueId: messageQueueId,
|
|
570
|
-
}, width: options.width || '85%' })).afterClosed()
|
|
571
|
-
.pipe(takeUntil(this._destroy$));
|
|
572
|
-
};
|
|
573
|
-
FsMessageQueueService.prototype.ngOnDestroy = function () {
|
|
574
|
-
this._destroy$.next();
|
|
575
|
-
this._destroy$.complete();
|
|
576
|
-
};
|
|
577
|
-
FsMessageQueueService.ctorParameters = function () { return [
|
|
578
|
-
{ type: MatDialog }
|
|
579
|
-
]; };
|
|
580
|
-
FsMessageQueueService = __decorate([
|
|
581
|
-
Injectable(),
|
|
582
|
-
__metadata("design:paramtypes", [MatDialog])
|
|
583
|
-
], FsMessageQueueService);
|
|
584
|
-
return FsMessageQueueService;
|
|
585
|
-
}());
|
|
586
|
-
|
|
587
|
-
var QueuesComponent = /** @class */ (function () {
|
|
588
|
-
function QueuesComponent(_config, _dialog, _messageQueueService) {
|
|
589
|
-
this._config = _config;
|
|
590
|
-
this._dialog = _dialog;
|
|
591
|
-
this._messageQueueService = _messageQueueService;
|
|
592
|
-
this.list = null;
|
|
593
|
-
this.query = {};
|
|
594
|
-
this.config = null;
|
|
595
|
-
this.messageQueueStates = {};
|
|
596
|
-
this.MessageQueueState = MessageQueueState;
|
|
597
|
-
this._destroy$ = new Subject();
|
|
598
|
-
}
|
|
599
|
-
QueuesComponent.prototype.ngOnInit = function () {
|
|
600
|
-
var _this = this;
|
|
601
|
-
this.messageQueueStates = indexNameValue(MessageQueueStates);
|
|
602
|
-
this.config = {
|
|
603
|
-
filters: [
|
|
604
|
-
{
|
|
605
|
-
name: 'keyword',
|
|
606
|
-
type: ItemType.Keyword,
|
|
607
|
-
label: 'Search'
|
|
608
|
-
},
|
|
609
|
-
{
|
|
610
|
-
name: 'state',
|
|
611
|
-
type: ItemType.Select,
|
|
612
|
-
label: 'Status',
|
|
613
|
-
values: function () {
|
|
614
|
-
return MessageQueueStates;
|
|
615
|
-
}
|
|
616
|
-
},
|
|
617
|
-
{
|
|
618
|
-
name: 'date',
|
|
619
|
-
type: ItemType.DateRange,
|
|
620
|
-
label: ['From Date', 'To Date'],
|
|
621
|
-
},
|
|
622
|
-
],
|
|
623
|
-
sort: { value: 'created_date', direction: 'desc' },
|
|
624
|
-
fetch: function (query) {
|
|
625
|
-
query = __assign(__assign(__assign({}, query), _this.query), { messageQueueAttachmentCounts: true, emailMessageQueues: true, emailMessageQueueBodies: false, smsMessageQueues: true });
|
|
626
|
-
return _this._config.loadMessageQueues(query)
|
|
627
|
-
.pipe(map(function (response) { return ({ data: response.data
|
|
628
|
-
.map(function (messageQueue) {
|
|
629
|
-
return __assign(__assign({}, messageQueue), { messageQueueRecipients: messageQueue.messageQueueRecipients
|
|
630
|
-
.reduce(function (accum, messageQueueRecipient) {
|
|
631
|
-
accum[messageQueueRecipient.recipient] = messageQueueRecipient.state;
|
|
632
|
-
return accum;
|
|
633
|
-
}, {}) });
|
|
634
|
-
}), paging: response.paging }); }));
|
|
635
|
-
}
|
|
636
|
-
};
|
|
637
|
-
// if any bulk actions add the selection object to config.
|
|
638
|
-
if (this._config.cancelMessageQueues) {
|
|
639
|
-
this.config.selection = {
|
|
640
|
-
selectAll: false,
|
|
641
|
-
actions: [],
|
|
642
|
-
actionSelected: function (action) {
|
|
643
|
-
return of(true)
|
|
644
|
-
.pipe(switchMap(function () {
|
|
645
|
-
if (action.action.name === 'cancel') {
|
|
646
|
-
return _this._config.cancelMessageQueues(action);
|
|
647
|
-
}
|
|
648
|
-
return of(true);
|
|
649
|
-
}), tap(function () {
|
|
650
|
-
_this.list.reload();
|
|
651
|
-
}));
|
|
652
|
-
}
|
|
653
|
-
};
|
|
654
|
-
}
|
|
655
|
-
// add each individual bulk action to select actions
|
|
656
|
-
if (this._config.cancelMessageQueues) {
|
|
657
|
-
this.config.selection.actions.push({
|
|
658
|
-
type: SelectionActionType.Action,
|
|
659
|
-
name: 'cancel',
|
|
660
|
-
label: 'Cancel Queued',
|
|
661
|
-
});
|
|
662
|
-
}
|
|
663
|
-
this.config.filters.push({
|
|
664
|
-
name: 'message_id',
|
|
665
|
-
type: ItemType.Select,
|
|
666
|
-
label: 'Message Type',
|
|
667
|
-
values: function (query) {
|
|
668
|
-
query = __assign(__assign({}, query), { limit: 50 });
|
|
669
|
-
return _this._config.loadMessages(query)
|
|
670
|
-
.pipe(map(function (response) {
|
|
671
|
-
return __spread([
|
|
672
|
-
{ value: null, name: 'All', }
|
|
673
|
-
], response.data.map(function (item) { return ({ name: item.name, value: item.id }); }));
|
|
674
|
-
}));
|
|
675
|
-
}
|
|
676
|
-
});
|
|
677
|
-
};
|
|
678
|
-
QueuesComponent.prototype.open = function (messageQueue) {
|
|
679
|
-
var _this = this;
|
|
680
|
-
this._messageQueueService.openMessageQueue(messageQueue.id)
|
|
681
|
-
.pipe(takeUntil(this._destroy$))
|
|
682
|
-
.subscribe(function () {
|
|
683
|
-
_this.list.reload();
|
|
684
|
-
});
|
|
685
|
-
};
|
|
686
|
-
QueuesComponent.prototype.ngOnDestroy = function () {
|
|
687
|
-
this._destroy$.next();
|
|
688
|
-
this._destroy$.complete();
|
|
689
|
-
};
|
|
690
|
-
QueuesComponent.ctorParameters = function () { return [
|
|
691
|
-
{ type: undefined, decorators: [{ type: Inject, args: [FS_APP_MESSAGE_CONFIG,] }] },
|
|
692
|
-
{ type: MatDialog },
|
|
693
|
-
{ type: FsMessageQueueService }
|
|
694
|
-
]; };
|
|
695
|
-
__decorate([
|
|
696
|
-
ViewChild(FsListComponent, { static: true }),
|
|
697
|
-
__metadata("design:type", FsListComponent)
|
|
698
|
-
], QueuesComponent.prototype, "list", void 0);
|
|
699
|
-
__decorate([
|
|
700
|
-
Input(),
|
|
701
|
-
__metadata("design:type", Object)
|
|
702
|
-
], QueuesComponent.prototype, "query", void 0);
|
|
703
|
-
QueuesComponent = __decorate([
|
|
704
|
-
Component({
|
|
705
|
-
selector: 'fs-app-message-queues',
|
|
706
|
-
template: "<fs-list [config]=\"config\" #list>\n <fs-list-column title=\"Message\" name=\"subject\" sortable=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.emailMessageQueue\">\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <a (click)=\"open(row)\">{{row.emailMessageQueue.subject|truncate:100}}</a>\n <mat-icon *ngIf=\"row.messageQueueAttachmentCount\" [matTooltip]=\"row.messageQueueAttachmentCount + ' Attachment(s)'\">attach_file</mat-icon>\n </div>\n </ng-container>\n <ng-container *ngIf=\"row.smsMessageQueue\">\n <a (click)=\"open(row)\">{{row.smsMessageQueue.body|truncate:100}}</a>\n </ng-container>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Recipients\" class=\"col-recipients\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.emailMessageQueue\">\n <ng-container *ngIf=\"row.emailMessageQueue.toRecipients.length; else unspecified\">\n <div class=\"small\" *ngFor=\"let recipient of row.emailMessageQueue.toRecipients\">\n <app-recipient \n [state]=\"row.messageQueueRecipients[recipient] || row.state\"\n [name]=\"recipient\">\n </app-recipient>\n </div>\n </ng-container>\n <div class=\"small\" *ngFor=\"let recipient of row.emailMessageQueue.ccRecipients\">\n <app-recipient \n [state]=\"row.messageQueueRecipients[recipient] || row.state\"\n [name]=\"recipient\">\n </app-recipient>\n </div>\n <div class=\"small\" *ngFor=\"let recipient of row.emailMessageQueue.bccRecipients\">\n <app-recipient \n [state]=\"row.messageQueueRecipients[recipient] || row.state\"\n [name]=\"recipient\">\n </app-recipient>\n </div>\n </ng-container>\n <ng-container *ngIf=\"row.smsMessageQueue\">\n <ng-container *ngIf=\"row.smsMessageQueue.toNumber; else unspecified\">\n <app-recipient \n class=\"small\"\n [state]=\"row.state\"\n [name]=\"row.smsMessageQueue.toNumber\">\n </app-recipient>\n </ng-container>\n </ng-container>\n </ng-template>\n </fs-list-column> \n <fs-list-column title=\"Status\" class=\"col-state\">\n <ng-template fs-list-cell let-row=\"row\">\n <span [class]=\"'state-' + row.state\">{{messageQueueStates[row.state]}}</span>\n </ng-template>\n </fs-list-column> \n <fs-list-column title=\"Date\" name=\"created_date\" sortable=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{ row.createdDate | fsDateFormat: 'date-time-yeardiff' }}\n </ng-template>\n </fs-list-column>\n</fs-list>\n\n<ng-template #unspecified>\n <app-recipient \n class=\"small\"\n [state]=\"MessageQueueState.Failed\"\n name=\"Unspecified\">\n </app-recipient>\n</ng-template>",
|
|
707
|
-
styles: [":host ::ng-deep .col-recipients small+small:before{content:\", \"}:host ::ng-deep .col-state .state-F,:host ::ng-deep .col-state .state-P{color:#d8524e}"]
|
|
708
|
-
}),
|
|
709
|
-
__param(0, Inject(FS_APP_MESSAGE_CONFIG)),
|
|
710
|
-
__metadata("design:paramtypes", [Object, MatDialog,
|
|
711
|
-
FsMessageQueueService])
|
|
712
|
-
], QueuesComponent);
|
|
713
|
-
return QueuesComponent;
|
|
714
|
-
}());
|
|
715
|
-
|
|
716
|
-
var RecipientComponent = /** @class */ (function () {
|
|
717
|
-
function RecipientComponent() {
|
|
718
|
-
}
|
|
719
|
-
RecipientComponent.prototype.ngOnInit = function () {
|
|
720
|
-
var icons = {
|
|
721
|
-
'S': { name: 'check_circle', tooltip: 'Sent' },
|
|
722
|
-
'E': { name: 'offline_bolt', tooltip: 'Sending' },
|
|
723
|
-
'F': { name: 'info', tooltip: 'Failed' },
|
|
724
|
-
};
|
|
725
|
-
this.icon = icons[this.state];
|
|
726
|
-
};
|
|
727
|
-
__decorate([
|
|
728
|
-
Input(),
|
|
729
|
-
__metadata("design:type", Object)
|
|
730
|
-
], RecipientComponent.prototype, "name", void 0);
|
|
731
|
-
__decorate([
|
|
732
|
-
Input(),
|
|
733
|
-
__metadata("design:type", Object)
|
|
734
|
-
], RecipientComponent.prototype, "state", void 0);
|
|
735
|
-
RecipientComponent = __decorate([
|
|
736
|
-
Component({
|
|
737
|
-
selector: 'app-recipient',
|
|
738
|
-
template: "<span class=\"recipient\">\n <span class=\"name\">{{name}}</span>\n <mat-icon *ngIf=\"icon\" [class]=\"'state-' + state\" [matTooltip]=\"icon.tooltip\">{{icon.name}}</mat-icon>\n</span>",
|
|
739
|
-
styles: ["mat-icon{font-size:14px;width:14px;height:14px;line-height:normal;margin-left:2px}mat-icon.state-S{color:#5fa099}mat-icon.state-E{color:#fbbc04}mat-icon.state-F{color:#d8524e}.recipient{display:inline-flex;align-items:center}"]
|
|
740
|
-
})
|
|
741
|
-
], RecipientComponent);
|
|
742
|
-
return RecipientComponent;
|
|
743
|
-
}());
|
|
744
|
-
|
|
745
|
-
var LinkifyPipe = /** @class */ (function () {
|
|
746
|
-
function LinkifyPipe() {
|
|
747
|
-
}
|
|
748
|
-
LinkifyPipe.prototype.transform = function (value) {
|
|
749
|
-
return anchorme(value, {
|
|
750
|
-
attributes: [
|
|
751
|
-
{
|
|
752
|
-
name: 'target',
|
|
753
|
-
value: '_blank'
|
|
754
|
-
},
|
|
755
|
-
]
|
|
756
|
-
});
|
|
757
|
-
};
|
|
758
|
-
LinkifyPipe = __decorate([
|
|
759
|
-
Pipe({ name: 'linkify' })
|
|
760
|
-
], LinkifyPipe);
|
|
761
|
-
return LinkifyPipe;
|
|
762
|
-
}());
|
|
763
|
-
|
|
764
|
-
var TruncatePipe = /** @class */ (function () {
|
|
765
|
-
function TruncatePipe() {
|
|
766
|
-
}
|
|
767
|
-
TruncatePipe.prototype.transform = function (value, limit, completeWords, ellipsis) {
|
|
768
|
-
if (limit === void 0) { limit = 25; }
|
|
769
|
-
if (completeWords === void 0) { completeWords = false; }
|
|
770
|
-
if (ellipsis === void 0) { ellipsis = '...'; }
|
|
771
|
-
if (value.length < limit) {
|
|
772
|
-
return "" + value.substr(0, limit);
|
|
773
|
-
}
|
|
774
|
-
if (completeWords) {
|
|
775
|
-
limit = value.substr(0, limit).lastIndexOf(' ');
|
|
776
|
-
}
|
|
777
|
-
return "" + value.substr(0, limit) + ellipsis;
|
|
778
|
-
};
|
|
779
|
-
TruncatePipe = __decorate([
|
|
780
|
-
Pipe({
|
|
781
|
-
name: 'truncate'
|
|
782
|
-
})
|
|
783
|
-
], TruncatePipe);
|
|
784
|
-
return TruncatePipe;
|
|
785
|
-
}());
|
|
786
|
-
|
|
787
|
-
var FsAppMessageQueuesModule = /** @class */ (function () {
|
|
788
|
-
function FsAppMessageQueuesModule() {
|
|
789
|
-
}
|
|
790
|
-
FsAppMessageQueuesModule = __decorate([
|
|
791
|
-
NgModule({
|
|
792
|
-
imports: [
|
|
793
|
-
RouterModule,
|
|
794
|
-
FormsModule,
|
|
795
|
-
CommonModule,
|
|
796
|
-
FlexLayoutModule,
|
|
797
|
-
MatTooltipModule,
|
|
798
|
-
MatDialogModule,
|
|
799
|
-
MatButtonModule,
|
|
800
|
-
MatIconModule,
|
|
801
|
-
MatTabsModule,
|
|
802
|
-
FsListModule,
|
|
803
|
-
FsDialogModule,
|
|
804
|
-
FsLabelModule,
|
|
805
|
-
FsDateModule,
|
|
806
|
-
FsSkeletonModule,
|
|
807
|
-
FsAppMessagesModule,
|
|
808
|
-
FsFormModule,
|
|
809
|
-
FsPromptInputModule,
|
|
810
|
-
FsIFrameModule,
|
|
811
|
-
],
|
|
812
|
-
declarations: [
|
|
813
|
-
QueuesComponent,
|
|
814
|
-
QueueComponent,
|
|
815
|
-
LinkifyPipe,
|
|
816
|
-
TruncatePipe,
|
|
817
|
-
RecipientComponent,
|
|
818
|
-
],
|
|
819
|
-
exports: [
|
|
820
|
-
QueuesComponent,
|
|
821
|
-
QueueComponent,
|
|
822
|
-
],
|
|
823
|
-
providers: [
|
|
824
|
-
FsMessageQueueService
|
|
825
|
-
]
|
|
826
|
-
})
|
|
827
|
-
], FsAppMessageQueuesModule);
|
|
828
|
-
return FsAppMessageQueuesModule;
|
|
829
|
-
}());
|
|
830
|
-
|
|
831
|
-
var TemplateComponent = /** @class */ (function () {
|
|
832
|
-
function TemplateComponent(_data, _config, _dialogRef, _message, _dialog) {
|
|
833
|
-
var _this = this;
|
|
834
|
-
this._data = _data;
|
|
835
|
-
this._config = _config;
|
|
836
|
-
this._dialogRef = _dialogRef;
|
|
837
|
-
this._message = _message;
|
|
838
|
-
this._dialog = _dialog;
|
|
839
|
-
this.htmlEditorconfig = {
|
|
840
|
-
language: 'html',
|
|
841
|
-
insertSpaces: true,
|
|
842
|
-
tabSize: 2,
|
|
843
|
-
};
|
|
844
|
-
this.cssEditorconfig = {
|
|
845
|
-
language: 'scss',
|
|
846
|
-
insertSpaces: true,
|
|
847
|
-
tabSize: 2,
|
|
848
|
-
};
|
|
849
|
-
this.save = function (event) {
|
|
850
|
-
return _this._config.saveMessageTemplate(_this.messageTemplate)
|
|
851
|
-
.pipe(tap(function (messageTemplate) {
|
|
852
|
-
_this._message.success('Saved Changes');
|
|
853
|
-
if (event.submitter === 'save-close') {
|
|
854
|
-
_this._dialogRef.close(messageTemplate);
|
|
855
|
-
}
|
|
856
|
-
}));
|
|
857
|
-
};
|
|
858
|
-
}
|
|
859
|
-
TemplateComponent.prototype.ngOnInit = function () {
|
|
860
|
-
var _this = this;
|
|
861
|
-
if (this._data.messageTemplate.id) {
|
|
862
|
-
this._config.loadMessageTemplate(this._data.messageTemplate)
|
|
863
|
-
.subscribe(function (messageTemplate) {
|
|
864
|
-
_this.messageTemplate = messageTemplate;
|
|
865
|
-
});
|
|
866
|
-
}
|
|
867
|
-
else {
|
|
868
|
-
this.messageTemplate = {};
|
|
869
|
-
}
|
|
870
|
-
};
|
|
871
|
-
TemplateComponent.prototype.openPreview = function () {
|
|
872
|
-
this._dialog.open(PreviewComponent, {
|
|
873
|
-
data: {
|
|
874
|
-
styles: this.messageTemplate.styles,
|
|
875
|
-
html: this.messageTemplate.content,
|
|
876
|
-
},
|
|
877
|
-
width: '95%'
|
|
878
|
-
});
|
|
879
|
-
};
|
|
880
|
-
TemplateComponent.ctorParameters = function () { return [
|
|
881
|
-
{ type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] },
|
|
882
|
-
{ type: undefined, decorators: [{ type: Inject, args: [FS_APP_MESSAGE_CONFIG,] }] },
|
|
883
|
-
{ type: MatDialogRef },
|
|
884
|
-
{ type: FsMessage },
|
|
885
|
-
{ type: MatDialog }
|
|
886
|
-
]; };
|
|
887
|
-
TemplateComponent = __decorate([
|
|
888
|
-
Component({
|
|
889
|
-
template: "<form\n fsForm\n [submit]=\"save\"\n #form=\"ngForm\"\n *fsSkeleton=\"messageTemplate\"\n [dirtyConfirmTabs]=\"false\">\n <fs-dialog *ngIf=\"messageTemplate\">\n <div mat-dialog-title>Message Template</div>\n <mat-dialog-content>\n <mat-form-field class=\"name\">\n <input\n matInput\n placeholder=\"Name\"\n [(ngModel)]=\"messageTemplate.name\"\n name=\"name\"\n >\n </mat-form-field>\n <div [@.disabled]=\"true\">\n <mat-tab-group\n mat-align-tabs=\"start\"\n [dynamicHeight]=\"false\">\n <mat-tab label=\"Content\">\n <ng-template matTabContent>\n <div class=\"content\">\n <fs-label-field>\n <fs-text-editor\n [(ngModel)]=\"messageTemplate.content\"\n name=\"body\"\n [config]=\"htmlEditorconfig\">\n </fs-text-editor>\n <fs-label-message>\n {$content} will be replaced with the message content.\n </fs-label-message>\n </fs-label-field>\n </div>\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Styles\">\n <ng-template matTabContent>\n <div class=\"styles\">\n <fs-text-editor\n [(ngModel)]=\"messageTemplate.styles\"\n name=\"styles\"\n [config]=\"cssEditorconfig\">\n </fs-text-editor>\n </div>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button color=\"primary\" name=\"close\">Save</button>\n <button mat-button name=\"save-close\">Save & Close</button>\n <button mat-button (click)=\"openPreview()\" type=\"button\">Preview</button>\n <button mat-button [mat-dialog-close]=\"null\" type=\"button\">Cancel</button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n",
|
|
890
|
-
styles: [".name{width:100%}:host ::ng-deep .mat-tab-body,:host ::ng-deep .mat-tab-body-content{overflow:visible}"]
|
|
891
|
-
}),
|
|
892
|
-
__param(0, Inject(MAT_DIALOG_DATA)),
|
|
893
|
-
__param(1, Inject(FS_APP_MESSAGE_CONFIG)),
|
|
894
|
-
__metadata("design:paramtypes", [Object, Object, MatDialogRef,
|
|
895
|
-
FsMessage,
|
|
896
|
-
MatDialog])
|
|
897
|
-
], TemplateComponent);
|
|
898
|
-
return TemplateComponent;
|
|
899
|
-
}());
|
|
900
|
-
|
|
901
|
-
var TemplatesComponent = /** @class */ (function () {
|
|
902
|
-
function TemplatesComponent(_config, _dialog) {
|
|
903
|
-
this._config = _config;
|
|
904
|
-
this._dialog = _dialog;
|
|
905
|
-
this.list = null;
|
|
906
|
-
this.config = null;
|
|
907
|
-
this.messageQueueStates = [];
|
|
908
|
-
this._destroy$ = new Subject();
|
|
909
|
-
}
|
|
910
|
-
TemplatesComponent.prototype.ngOnInit = function () {
|
|
911
|
-
var _this = this;
|
|
912
|
-
this.config = {
|
|
913
|
-
actions: [
|
|
914
|
-
{
|
|
915
|
-
label: 'Create',
|
|
916
|
-
click: function () {
|
|
917
|
-
_this.open({});
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
],
|
|
921
|
-
status: false,
|
|
922
|
-
fetch: function (query) {
|
|
923
|
-
return _this._config.loadMessageTemplates(query);
|
|
924
|
-
}
|
|
925
|
-
};
|
|
926
|
-
if (this._config.deleteMessageTemplate) {
|
|
927
|
-
this.config.rowActions = [
|
|
928
|
-
{
|
|
929
|
-
click: function (data) {
|
|
930
|
-
return _this._config.deleteMessageTemplate(data);
|
|
931
|
-
},
|
|
932
|
-
remove: {
|
|
933
|
-
title: 'Confirm',
|
|
934
|
-
template: 'Are you sure you would like to delete this template?',
|
|
935
|
-
},
|
|
936
|
-
menu: true,
|
|
937
|
-
label: 'Delete'
|
|
938
|
-
}
|
|
939
|
-
];
|
|
940
|
-
}
|
|
941
|
-
};
|
|
942
|
-
TemplatesComponent.prototype.open = function (messageTemplate) {
|
|
943
|
-
var _this = this;
|
|
944
|
-
var dialogRef = this._dialog.open(TemplateComponent, {
|
|
945
|
-
data: {
|
|
946
|
-
messageTemplate: messageTemplate,
|
|
947
|
-
},
|
|
948
|
-
width: '85%'
|
|
949
|
-
});
|
|
950
|
-
dialogRef.afterClosed()
|
|
951
|
-
.pipe(takeUntil(this._destroy$))
|
|
952
|
-
.subscribe(function (response) {
|
|
953
|
-
if (response) {
|
|
954
|
-
var update = _this.list.updateData(response, function (row) {
|
|
955
|
-
return row.id === response.id;
|
|
956
|
-
});
|
|
957
|
-
if (!update) {
|
|
958
|
-
_this.list.reload();
|
|
959
|
-
}
|
|
960
|
-
}
|
|
961
|
-
});
|
|
962
|
-
};
|
|
963
|
-
TemplatesComponent.prototype.ngOnDestroy = function () {
|
|
964
|
-
this._destroy$.next();
|
|
965
|
-
this._destroy$.complete();
|
|
966
|
-
};
|
|
967
|
-
TemplatesComponent.ctorParameters = function () { return [
|
|
968
|
-
{ type: undefined, decorators: [{ type: Inject, args: [FS_APP_MESSAGE_CONFIG,] }] },
|
|
969
|
-
{ type: MatDialog }
|
|
970
|
-
]; };
|
|
971
|
-
__decorate([
|
|
972
|
-
ViewChild(FsListComponent, { static: true }),
|
|
973
|
-
__metadata("design:type", FsListComponent)
|
|
974
|
-
], TemplatesComponent.prototype, "list", void 0);
|
|
975
|
-
TemplatesComponent = __decorate([
|
|
976
|
-
Component({
|
|
977
|
-
selector: 'fs-app-message-templates',
|
|
978
|
-
template: "<fs-list [config]=\"config\">\n <fs-list-column title=\"Name\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"open(row)\">{{row.name}}</a>\n </ng-template>\n </fs-list-column>\n</fs-list>"
|
|
979
|
-
}),
|
|
980
|
-
__param(0, Inject(FS_APP_MESSAGE_CONFIG)),
|
|
981
|
-
__metadata("design:paramtypes", [Object, MatDialog])
|
|
982
|
-
], TemplatesComponent);
|
|
983
|
-
return TemplatesComponent;
|
|
984
|
-
}());
|
|
985
|
-
|
|
986
|
-
var FsAppMessageTemplatesModule = /** @class */ (function () {
|
|
987
|
-
function FsAppMessageTemplatesModule() {
|
|
988
|
-
}
|
|
989
|
-
FsAppMessageTemplatesModule = __decorate([
|
|
990
|
-
NgModule({
|
|
991
|
-
imports: [
|
|
992
|
-
RouterModule,
|
|
993
|
-
CommonModule,
|
|
994
|
-
FormsModule,
|
|
995
|
-
MatTooltipModule,
|
|
996
|
-
MatDialogModule,
|
|
997
|
-
MatButtonModule,
|
|
998
|
-
MatTabsModule,
|
|
999
|
-
MatFormFieldModule,
|
|
1000
|
-
MatFormFieldModule,
|
|
1001
|
-
MatInputModule,
|
|
1002
|
-
FsListModule,
|
|
1003
|
-
FsDialogModule,
|
|
1004
|
-
FsLabelModule,
|
|
1005
|
-
FlexLayoutModule,
|
|
1006
|
-
FsSkeletonModule,
|
|
1007
|
-
FsFormModule,
|
|
1008
|
-
FsTextEditorModule,
|
|
1009
|
-
FsAppMessagePreviewModule,
|
|
1010
|
-
],
|
|
1011
|
-
declarations: [
|
|
1012
|
-
TemplatesComponent,
|
|
1013
|
-
TemplateComponent,
|
|
1014
|
-
],
|
|
1015
|
-
exports: [
|
|
1016
|
-
TemplatesComponent,
|
|
1017
|
-
TemplateComponent,
|
|
1018
|
-
],
|
|
1019
|
-
})
|
|
1020
|
-
], FsAppMessageTemplatesModule);
|
|
1021
|
-
return FsAppMessageTemplatesModule;
|
|
1022
|
-
}());
|
|
1023
|
-
|
|
1024
|
-
var WebhooksComponent = /** @class */ (function () {
|
|
1025
|
-
function WebhooksComponent(_config, _message) {
|
|
1026
|
-
this._config = _config;
|
|
1027
|
-
this._message = _message;
|
|
1028
|
-
}
|
|
1029
|
-
WebhooksComponent.prototype.ngOnInit = function () {
|
|
1030
|
-
var _this = this;
|
|
1031
|
-
this.listConfig = {
|
|
1032
|
-
paging: false,
|
|
1033
|
-
actions: [
|
|
1034
|
-
{
|
|
1035
|
-
click: function () {
|
|
1036
|
-
_this._config.createWebhook()
|
|
1037
|
-
.subscribe(function () {
|
|
1038
|
-
_this._message.success('Created webhook');
|
|
1039
|
-
_this.list.reload();
|
|
1040
|
-
});
|
|
1041
|
-
},
|
|
1042
|
-
label: 'Create',
|
|
1043
|
-
},
|
|
1044
|
-
],
|
|
1045
|
-
rowActions: [
|
|
1046
|
-
{
|
|
1047
|
-
click: function (webhook) {
|
|
1048
|
-
_this._config.deleteWebhook(webhook)
|
|
1049
|
-
.subscribe(function () {
|
|
1050
|
-
_this._message.success('Deleted webhook');
|
|
1051
|
-
_this.list.reload();
|
|
1052
|
-
});
|
|
1053
|
-
},
|
|
1054
|
-
label: 'Delete',
|
|
1055
|
-
},
|
|
1056
|
-
],
|
|
1057
|
-
fetch: function () {
|
|
1058
|
-
return _this._config.loadWebhooks()
|
|
1059
|
-
.pipe(map(function (webhooks) { return ({ data: webhooks }); }));
|
|
1060
|
-
},
|
|
1061
|
-
};
|
|
1062
|
-
};
|
|
1063
|
-
WebhooksComponent.ctorParameters = function () { return [
|
|
1064
|
-
{ type: undefined, decorators: [{ type: Inject, args: [FS_APP_MESSAGE_CONFIG,] }] },
|
|
1065
|
-
{ type: FsMessage }
|
|
1066
|
-
]; };
|
|
1067
|
-
__decorate([
|
|
1068
|
-
ViewChild(FsListComponent),
|
|
1069
|
-
__metadata("design:type", FsListComponent)
|
|
1070
|
-
], WebhooksComponent.prototype, "list", void 0);
|
|
1071
|
-
WebhooksComponent = __decorate([
|
|
1072
|
-
Component({
|
|
1073
|
-
selector: 'fs-app-message-webhooks',
|
|
1074
|
-
template: "<fs-list [config]=\"listConfig\">\r\n <fs-list-column title=\"URL\">\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.url}}\r\n </ng-template>\r\n </fs-list-column>\r\n <fs-list-column title=\"Created\">\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.createDate | fsDate}}\r\n </ng-template>\r\n </fs-list-column>\r\n</fs-list>"
|
|
1075
|
-
}),
|
|
1076
|
-
__param(0, Inject(FS_APP_MESSAGE_CONFIG)),
|
|
1077
|
-
__metadata("design:paramtypes", [Object, FsMessage])
|
|
1078
|
-
], WebhooksComponent);
|
|
1079
|
-
return WebhooksComponent;
|
|
1080
|
-
}());
|
|
1081
|
-
|
|
1082
|
-
var FsAppMessageWebhooksModule = /** @class */ (function () {
|
|
1083
|
-
function FsAppMessageWebhooksModule() {
|
|
1084
|
-
}
|
|
1085
|
-
FsAppMessageWebhooksModule = __decorate([
|
|
1086
|
-
NgModule({
|
|
1087
|
-
imports: [
|
|
1088
|
-
FsListModule,
|
|
1089
|
-
FsDateModule,
|
|
1090
|
-
],
|
|
1091
|
-
declarations: [
|
|
1092
|
-
WebhooksComponent,
|
|
1093
|
-
],
|
|
1094
|
-
exports: [
|
|
1095
|
-
WebhooksComponent,
|
|
1096
|
-
],
|
|
1097
|
-
})
|
|
1098
|
-
], FsAppMessageWebhooksModule);
|
|
1099
|
-
return FsAppMessageWebhooksModule;
|
|
1100
|
-
}());
|
|
1101
|
-
|
|
1102
|
-
var FsAppMessageModule = /** @class */ (function () {
|
|
1103
|
-
function FsAppMessageModule() {
|
|
1104
|
-
}
|
|
1105
|
-
FsAppMessageModule_1 = FsAppMessageModule;
|
|
1106
|
-
FsAppMessageModule.forRoot = function () {
|
|
1107
|
-
return {
|
|
1108
|
-
ngModule: FsAppMessageModule_1,
|
|
1109
|
-
};
|
|
1110
|
-
};
|
|
1111
|
-
var FsAppMessageModule_1;
|
|
1112
|
-
FsAppMessageModule = FsAppMessageModule_1 = __decorate([
|
|
1113
|
-
NgModule({})
|
|
1114
|
-
], FsAppMessageModule);
|
|
1115
|
-
return FsAppMessageModule;
|
|
1116
|
-
}());
|
|
1117
|
-
|
|
1118
|
-
/*
|
|
1119
|
-
* Public API Surface of fs-menu
|
|
1120
|
-
*/
|
|
1121
|
-
|
|
1122
|
-
/**
|
|
1123
|
-
* Generated bundle index. Do not edit.
|
|
1124
|
-
*/
|
|
1125
|
-
|
|
1126
|
-
export { FS_APP_MESSAGE_CONFIG, FsAppMessageModule, FsAppMessageQueuesModule, FsAppMessageTemplatesModule, FsAppMessageWebhooksModule, FsAppMessagesModule, FsMessageQueueService, MessageComponent, MessagesComponent, QueueComponent, QueuesComponent, TemplatesComponent, FsAppMessagePreviewModule as ɵa, PreviewComponent as ɵb, FS_APP_MESSAGE_CONFIG as ɵc, LinkifyPipe as ɵd, TruncatePipe as ɵe, RecipientComponent as ɵf, TemplateComponent as ɵg, WebhooksComponent as ɵh };
|
|
1127
|
-
//# sourceMappingURL=firestitch-app-message.js.map
|