@firestitch/app-message 15.0.0 → 17.0.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/modules/message-queues/components/queues/queues.component.d.ts +1 -1
- package/app/modules/message-queues/components/recipient/recipient.component.d.ts +1 -1
- package/app/modules/messages/components/attachments/attachments.component.d.ts +1 -1
- package/{esm2020 → esm2022}/app/modules/app-message/app-message.module.mjs +5 -5
- package/esm2022/app/modules/message-preview/components/preview/preview.component.mjs +29 -0
- package/{esm2020 → esm2022}/app/modules/message-preview/message-preview.module.mjs +11 -11
- package/esm2022/app/modules/message-queues/components/queue/queue.component.mjs +225 -0
- package/esm2022/app/modules/message-queues/components/queues/queues.component.mjs +203 -0
- package/esm2022/app/modules/message-queues/components/recipient/recipient.component.mjs +29 -0
- package/{esm2020 → esm2022}/app/modules/message-queues/message-queues.module.mjs +46 -46
- package/{esm2020 → esm2022}/app/modules/message-queues/pipes/linkify.pipe.mjs +4 -4
- package/esm2022/app/modules/message-queues/pipes/truncate.pipe.mjs +22 -0
- package/esm2022/app/modules/message-queues/services/message-queue.service.mjs +30 -0
- package/esm2022/app/modules/message-templates/components/template/template.component.mjs +87 -0
- package/esm2022/app/modules/message-templates/components/templates/templates.component.mjs +83 -0
- package/{esm2020 → esm2022}/app/modules/message-templates/message-templates.module.mjs +39 -39
- package/esm2022/app/modules/messages/components/attachments/attachments.component.mjs +84 -0
- package/esm2022/app/modules/messages/components/message/message.component.mjs +136 -0
- package/esm2022/app/modules/messages/components/messages/messages.component.mjs +74 -0
- package/{esm2020 → esm2022}/app/modules/messages/messages.module.mjs +52 -52
- package/esm2022/app/modules/webhooks/components/webhooks/webhooks.component.mjs +67 -0
- package/{esm2020 → esm2022}/app/modules/webhooks/webhooks.module.mjs +7 -7
- package/{fesm2020 → fesm2022}/firestitch-app-message.mjs +320 -269
- package/fesm2022/firestitch-app-message.mjs.map +1 -0
- package/package.json +5 -11
- package/esm2020/app/modules/message-preview/components/preview/preview.component.mjs +0 -26
- package/esm2020/app/modules/message-queues/components/queue/queue.component.mjs +0 -210
- package/esm2020/app/modules/message-queues/components/queues/queues.component.mjs +0 -198
- package/esm2020/app/modules/message-queues/components/recipient/recipient.component.mjs +0 -26
- package/esm2020/app/modules/message-queues/pipes/truncate.pipe.mjs +0 -22
- package/esm2020/app/modules/message-queues/services/message-queue.service.mjs +0 -29
- package/esm2020/app/modules/message-templates/components/template/template.component.mjs +0 -81
- package/esm2020/app/modules/message-templates/components/templates/templates.component.mjs +0 -81
- package/esm2020/app/modules/messages/components/attachments/attachments.component.mjs +0 -81
- package/esm2020/app/modules/messages/components/message/message.component.mjs +0 -129
- package/esm2020/app/modules/messages/components/messages/messages.component.mjs +0 -72
- package/esm2020/app/modules/webhooks/components/webhooks/webhooks.component.mjs +0 -63
- package/fesm2015/firestitch-app-message.mjs +0 -1317
- package/fesm2015/firestitch-app-message.mjs.map +0 -1
- package/fesm2020/firestitch-app-message.mjs.map +0 -1
- /package/{esm2020 → esm2022}/app/helpers/index-name-value.mjs +0 -0
- /package/{esm2020 → esm2022}/app/helpers/index.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/app-message/injectors/app-message-config.injector.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/app-message/injectors/index.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/app-message/interfaces/app-message-config.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/app-message/interfaces/index.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/app-message/types/index.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/app-message/types/types.type.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/message-preview/components/index.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/message-preview/components/preview/index.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/message-queues/consts/index.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/message-queues/consts/message-queue-event-type.const.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/message-queues/consts/message-queue-states.const.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/message-queues/enums/email-message-queue-format.enum.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/message-queues/enums/index.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/message-queues/enums/message-queue-event-type.enum.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/message-queues/enums/message-queue-state.enum.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/message-queues/enums/message-queue-type.enum.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/message-templates/components/index.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/message-templates/components/template/index.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/message-templates/components/templates/index.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/messages/components/attachments/index.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/messages/components/index.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/messages/components/message/index.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/messages/components/messages/index.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/messages/consts/email-message-formats.const.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/messages/consts/index.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/messages/enums/email-message-format.enum.mjs +0 -0
- /package/{esm2020 → esm2022}/app/modules/messages/enums/index.mjs +0 -0
- /package/{esm2020 → esm2022}/firestitch-app-message.mjs +0 -0
- /package/{esm2020 → esm2022}/public_api.mjs +0 -0
|
@@ -1,1317 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { NgModule, Component, Inject, InjectionToken, ChangeDetectionStrategy, ViewChild, Input, Injectable, Pipe } from '@angular/core';
|
|
3
|
-
import * as i4$1 from '@angular/common';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
|
-
import * as i5$1 from '@angular/forms';
|
|
6
|
-
import { FormsModule } from '@angular/forms';
|
|
7
|
-
import { RouterModule } from '@angular/router';
|
|
8
|
-
import * as i5 from '@angular/material/button';
|
|
9
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
10
|
-
import * as i1 from '@angular/material/dialog';
|
|
11
|
-
import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
|
12
|
-
import * as i3$2 from '@angular/material/icon';
|
|
13
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
14
|
-
import * as i6 from '@angular/material/tabs';
|
|
15
|
-
import { MatTabsModule } from '@angular/material/tabs';
|
|
16
|
-
import * as i2$1 from '@angular/material/tooltip';
|
|
17
|
-
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
18
|
-
import * as i10$1 from '@firestitch/date';
|
|
19
|
-
import { FsDateModule } from '@firestitch/date';
|
|
20
|
-
import * as i3 from '@firestitch/dialog';
|
|
21
|
-
import { FsDialogModule } from '@firestitch/dialog';
|
|
22
|
-
import * as i12 from '@firestitch/form';
|
|
23
|
-
import { FsFormModule } from '@firestitch/form';
|
|
24
|
-
import * as i4 from '@firestitch/iframe';
|
|
25
|
-
import { FsIFrameModule } from '@firestitch/iframe';
|
|
26
|
-
import * as i13 from '@firestitch/label';
|
|
27
|
-
import { FsLabelModule } from '@firestitch/label';
|
|
28
|
-
import * as i2 from '@firestitch/list';
|
|
29
|
-
import { FsListComponent, FsListModule } from '@firestitch/list';
|
|
30
|
-
import * as i1$1 from '@firestitch/message';
|
|
31
|
-
import { FsMessageModule } from '@firestitch/message';
|
|
32
|
-
import * as i1$2 from '@firestitch/prompt';
|
|
33
|
-
import { FsPromptInputModule } from '@firestitch/prompt';
|
|
34
|
-
import * as i11$1 from '@firestitch/skeleton';
|
|
35
|
-
import { FsSkeletonModule } from '@firestitch/skeleton';
|
|
36
|
-
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
37
|
-
import * as i10 from '@angular/material/core';
|
|
38
|
-
import { MatOptionModule } from '@angular/material/core';
|
|
39
|
-
import * as i8 from '@angular/material/form-field';
|
|
40
|
-
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
41
|
-
import * as i9 from '@angular/material/input';
|
|
42
|
-
import { MatInputModule } from '@angular/material/input';
|
|
43
|
-
import * as i11 from '@angular/material/select';
|
|
44
|
-
import { MatSelectModule } from '@angular/material/select';
|
|
45
|
-
import * as i3$1 from '@firestitch/common';
|
|
46
|
-
import { FsCommonModule } from '@firestitch/common';
|
|
47
|
-
import * as i17 from '@firestitch/html-editor';
|
|
48
|
-
import { FsHtmlEditorModule, FsHtmlRendererModule } from '@firestitch/html-editor';
|
|
49
|
-
import * as i18 from '@firestitch/tabs';
|
|
50
|
-
import { FsTabsModule } from '@firestitch/tabs';
|
|
51
|
-
import * as i16 from '@firestitch/text-editor';
|
|
52
|
-
import { FsTextEditorModule } from '@firestitch/text-editor';
|
|
53
|
-
import { tap, switchMap, map, takeUntil, filter } from 'rxjs/operators';
|
|
54
|
-
import { Subject, of } from 'rxjs';
|
|
55
|
-
import { ActionMode, ItemType } from '@firestitch/filter';
|
|
56
|
-
import anchorme from 'anchorme';
|
|
57
|
-
import { SelectionActionType } from '@firestitch/selection';
|
|
58
|
-
import { isAfter } from 'date-fns';
|
|
59
|
-
import * as i2$2 from '@firestitch/store';
|
|
60
|
-
|
|
61
|
-
class FsAppMessageModule {
|
|
62
|
-
static forRoot() {
|
|
63
|
-
return {
|
|
64
|
-
ngModule: FsAppMessageModule,
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
FsAppMessageModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
69
|
-
FsAppMessageModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessageModule });
|
|
70
|
-
FsAppMessageModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessageModule });
|
|
71
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessageModule, decorators: [{
|
|
72
|
-
type: NgModule,
|
|
73
|
-
args: [{}]
|
|
74
|
-
}] });
|
|
75
|
-
|
|
76
|
-
class PreviewComponent {
|
|
77
|
-
constructor(_data) {
|
|
78
|
-
this._data = _data;
|
|
79
|
-
this.html = _data.html;
|
|
80
|
-
this.styles = _data.styles;
|
|
81
|
-
}
|
|
82
|
-
ngOnInit() {
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
PreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PreviewComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
86
|
-
PreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PreviewComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog>\n <div mat-dialog-title>Preview</div>\n <mat-dialog-content>\n <fs-iframe\n [html]=\"html\"\n [width]=\"'100%'\"\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", styles: [""], dependencies: [{ kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout", "dock", "dockable", "fullscreenPercent"] }, { kind: "component", type: i4.FsIFrameComponent, selector: "fs-iframe", inputs: ["html", "src", "styles", "width", "height"], outputs: ["loaded"] }] });
|
|
87
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PreviewComponent, decorators: [{
|
|
88
|
-
type: Component,
|
|
89
|
-
args: [{ template: "<fs-dialog>\n <div mat-dialog-title>Preview</div>\n <mat-dialog-content>\n <fs-iframe\n [html]=\"html\"\n [width]=\"'100%'\"\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" }]
|
|
90
|
-
}], ctorParameters: function () {
|
|
91
|
-
return [{ type: undefined, decorators: [{
|
|
92
|
-
type: Inject,
|
|
93
|
-
args: [MAT_DIALOG_DATA]
|
|
94
|
-
}] }];
|
|
95
|
-
} });
|
|
96
|
-
|
|
97
|
-
class FsAppMessagePreviewModule {
|
|
98
|
-
}
|
|
99
|
-
FsAppMessagePreviewModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessagePreviewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
100
|
-
FsAppMessagePreviewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessagePreviewModule, declarations: [PreviewComponent], imports: [MatDialogModule,
|
|
101
|
-
MatButtonModule,
|
|
102
|
-
FsDialogModule,
|
|
103
|
-
FsIFrameModule], exports: [PreviewComponent] });
|
|
104
|
-
FsAppMessagePreviewModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessagePreviewModule, imports: [MatDialogModule,
|
|
105
|
-
MatButtonModule,
|
|
106
|
-
FsDialogModule,
|
|
107
|
-
FsIFrameModule] });
|
|
108
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessagePreviewModule, decorators: [{
|
|
109
|
-
type: NgModule,
|
|
110
|
-
args: [{
|
|
111
|
-
imports: [
|
|
112
|
-
MatDialogModule,
|
|
113
|
-
MatButtonModule,
|
|
114
|
-
FsDialogModule,
|
|
115
|
-
FsIFrameModule,
|
|
116
|
-
],
|
|
117
|
-
declarations: [
|
|
118
|
-
PreviewComponent,
|
|
119
|
-
],
|
|
120
|
-
exports: [
|
|
121
|
-
PreviewComponent,
|
|
122
|
-
]
|
|
123
|
-
}]
|
|
124
|
-
}] });
|
|
125
|
-
|
|
126
|
-
const FS_APP_MESSAGE_ROOT_CONFIG = new InjectionToken('fs-app-message-root-config');
|
|
127
|
-
const FS_APP_MESSAGE_CONFIG = new InjectionToken('fs-app-message-config');
|
|
128
|
-
|
|
129
|
-
var EmailMessageFormat;
|
|
130
|
-
(function (EmailMessageFormat) {
|
|
131
|
-
EmailMessageFormat["Text"] = "T";
|
|
132
|
-
EmailMessageFormat["HTML"] = "H";
|
|
133
|
-
EmailMessageFormat["RichText"] = "R";
|
|
134
|
-
})(EmailMessageFormat || (EmailMessageFormat = {}));
|
|
135
|
-
|
|
136
|
-
const EmailMessageFormats = [
|
|
137
|
-
{ name: 'Text', value: EmailMessageFormat.Text },
|
|
138
|
-
{ name: 'HTML', value: EmailMessageFormat.HTML },
|
|
139
|
-
{ name: 'Rich Text', value: EmailMessageFormat.RichText }
|
|
140
|
-
];
|
|
141
|
-
|
|
142
|
-
class AttachmentsComponent {
|
|
143
|
-
constructor(_config, _message) {
|
|
144
|
-
this._config = _config;
|
|
145
|
-
this._message = _message;
|
|
146
|
-
this.list = null;
|
|
147
|
-
this.config = null;
|
|
148
|
-
this._destroy$ = new Subject();
|
|
149
|
-
}
|
|
150
|
-
ngOnInit() {
|
|
151
|
-
this.config = {
|
|
152
|
-
rowActions: [],
|
|
153
|
-
actions: [
|
|
154
|
-
{
|
|
155
|
-
label: 'Upload',
|
|
156
|
-
mode: ActionMode.File,
|
|
157
|
-
select: (fsFile) => {
|
|
158
|
-
this._config.uploadMessageAttachment(this.message, fsFile)
|
|
159
|
-
.subscribe(() => {
|
|
160
|
-
this._message.success('Saved attachment');
|
|
161
|
-
this.list.reload();
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
],
|
|
166
|
-
fetch: query => {
|
|
167
|
-
return this._config.loadMessageAttachments(this.message, query);
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
if (this._config.downloadMessageAttachment) {
|
|
171
|
-
this.config.rowActions
|
|
172
|
-
.push({
|
|
173
|
-
click: data => {
|
|
174
|
-
return this._config.downloadMessageAttachment(data);
|
|
175
|
-
},
|
|
176
|
-
label: 'Download',
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
if (this._config.deleteMessageAttachment) {
|
|
180
|
-
this.config.rowActions
|
|
181
|
-
.push({
|
|
182
|
-
click: data => {
|
|
183
|
-
return this._config.deleteMessageAttachment(data);
|
|
184
|
-
},
|
|
185
|
-
remove: {
|
|
186
|
-
title: 'Confirm',
|
|
187
|
-
template: 'Are you sure you would like to delete this template?',
|
|
188
|
-
},
|
|
189
|
-
label: 'Delete',
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
ngOnDestroy() {
|
|
194
|
-
this._destroy$.next();
|
|
195
|
-
this._destroy$.complete();
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
AttachmentsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AttachmentsComponent, deps: [{ token: FS_APP_MESSAGE_CONFIG }, { token: i1$1.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
|
|
199
|
-
AttachmentsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AttachmentsComponent, selector: "fs-app-message-attachments", inputs: { message: "message" }, viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true, static: true }], ngImport: i0, template: "<fs-list [config]=\"config\">\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.size | fsFormatBytes}}\n </ng-template>\n </fs-list-column>\n</fs-list>", dependencies: [{ kind: "component", type: i2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { kind: "directive", type: i2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "pipe", type: i3$1.FsFormatBytesPipe, name: "fsFormatBytes" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
200
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AttachmentsComponent, decorators: [{
|
|
201
|
-
type: Component,
|
|
202
|
-
args: [{ selector: 'fs-app-message-attachments', changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-list [config]=\"config\">\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.size | fsFormatBytes}}\n </ng-template>\n </fs-list-column>\n</fs-list>" }]
|
|
203
|
-
}], ctorParameters: function () {
|
|
204
|
-
return [{ type: undefined, decorators: [{
|
|
205
|
-
type: Inject,
|
|
206
|
-
args: [FS_APP_MESSAGE_CONFIG]
|
|
207
|
-
}] }, { type: i1$1.FsMessage }];
|
|
208
|
-
}, propDecorators: { list: [{
|
|
209
|
-
type: ViewChild,
|
|
210
|
-
args: [FsListComponent, { static: true }]
|
|
211
|
-
}], message: [{
|
|
212
|
-
type: Input
|
|
213
|
-
}] } });
|
|
214
|
-
|
|
215
|
-
class MessageComponent {
|
|
216
|
-
constructor(_config, _data, _prompt, _message, _dialog, _cdRef) {
|
|
217
|
-
this._config = _config;
|
|
218
|
-
this._data = _data;
|
|
219
|
-
this._prompt = _prompt;
|
|
220
|
-
this._message = _message;
|
|
221
|
-
this._dialog = _dialog;
|
|
222
|
-
this._cdRef = _cdRef;
|
|
223
|
-
this.tab = 'general';
|
|
224
|
-
this.messageTemplates = [];
|
|
225
|
-
this.emailMessageFormats = EmailMessageFormats;
|
|
226
|
-
this.emailMessageFormat = EmailMessageFormat;
|
|
227
|
-
this.save = () => {
|
|
228
|
-
return this._config.saveMessage(this.message)
|
|
229
|
-
.pipe(tap(() => {
|
|
230
|
-
this._message.success('Saved Changes');
|
|
231
|
-
}));
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
ngOnInit() {
|
|
235
|
-
this._config.loadMessage(this._data.message)
|
|
236
|
-
.subscribe((message) => {
|
|
237
|
-
this.message = message;
|
|
238
|
-
if (this.message.emailMessage && this.message.emailMessage.customize === undefined) {
|
|
239
|
-
this.message.emailMessage.customize = true;
|
|
240
|
-
}
|
|
241
|
-
if (this.message.smsMessage && this.message.smsMessage.customize === undefined) {
|
|
242
|
-
this.message.smsMessage.customize = true;
|
|
243
|
-
}
|
|
244
|
-
this.message.reference = String(message.tag)
|
|
245
|
-
.toLocaleLowerCase()
|
|
246
|
-
.split('_')
|
|
247
|
-
.map((item) => item.charAt(0).toUpperCase() + item.slice(1))
|
|
248
|
-
.join('');
|
|
249
|
-
this._cdRef.markForCheck();
|
|
250
|
-
});
|
|
251
|
-
this._config.loadMessageTemplates()
|
|
252
|
-
.subscribe((data) => {
|
|
253
|
-
this.messageTemplates = data.data;
|
|
254
|
-
this._cdRef.markForCheck();
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
openPreview() {
|
|
258
|
-
const emailMessage = this.message.emailMessage;
|
|
259
|
-
let html = emailMessage.customize ? emailMessage.body : this.message.defaultEmailBody;
|
|
260
|
-
let styles = emailMessage.styles || '';
|
|
261
|
-
if (emailMessage.messageTemplateId) {
|
|
262
|
-
const messageTemplate = this.messageTemplates
|
|
263
|
-
.find((item) => {
|
|
264
|
-
return emailMessage.messageTemplateId === item.id;
|
|
265
|
-
});
|
|
266
|
-
if (messageTemplate) {
|
|
267
|
-
html = messageTemplate.content.replace('{$content}', html);
|
|
268
|
-
styles = `${messageTemplate.styles || ''}\n\n${styles}`;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
this._dialog.open(PreviewComponent, {
|
|
272
|
-
data: {
|
|
273
|
-
styles,
|
|
274
|
-
html,
|
|
275
|
-
},
|
|
276
|
-
width: '95%'
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
sendTest(type) {
|
|
280
|
-
of(true)
|
|
281
|
-
.pipe(switchMap(() => {
|
|
282
|
-
return type === 'email' ? this._config.getTestEmail() : of('');
|
|
283
|
-
}), switchMap((default_) => {
|
|
284
|
-
const typeName = type === 'email' ? 'an email' : 'phone number';
|
|
285
|
-
return this._prompt.input({
|
|
286
|
-
label: `Please enter ${typeName} to send test to`,
|
|
287
|
-
title: 'Send Test',
|
|
288
|
-
commitLabel: 'Send',
|
|
289
|
-
default: default_,
|
|
290
|
-
required: true
|
|
291
|
-
});
|
|
292
|
-
}))
|
|
293
|
-
.subscribe((value) => {
|
|
294
|
-
this._config.testMessage(this.message, value, type)
|
|
295
|
-
.subscribe(() => {
|
|
296
|
-
this._message.success('Test Sent');
|
|
297
|
-
});
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
MessageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MessageComponent, deps: [{ token: FS_APP_MESSAGE_CONFIG }, { token: MAT_DIALOG_DATA }, { token: i1$2.FsPrompt }, { token: i1$1.FsMessage }, { token: i1.MatDialog }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
302
|
-
MessageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: MessageComponent, selector: "ng-component", ngImport: i0, template: "<form\n fsForm\n [submit]=\"save\"\n #form=\"ngForm\"\n *fsSkeleton=\"message\"\n [confirmTabs]=\"false\">\n <fs-dialog *ngIf=\"message\">\n <div mat-dialog-title>Edit Message</div>\n <mat-dialog-content>\n <mat-tab-group\n fsTabs\n [(selected)]=\"tab\">\n <mat-tab label=\"General\" name=\"general\">\n <ng-template matTabContent>\n <div class=\"fs-column\">\n <mat-form-field>\n <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.name\"\n name=\"Name\"\n required>\n </mat-form-field>\n <fs-label-field>\n <fs-label>Reference</fs-label>\n {{message.reference}}\n </fs-label-field>\n <mat-form-field>\n <mat-label>Description</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.description\"\n name=\"description\">\n </mat-form-field>\n\n <div class=\"fs-row.gap-small.wrap\">\n <mat-form-field>\n <mat-label>From Email</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.fromEmail\"\n name=\"from_email\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>From Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.fromName\"\n name=\"from_name\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>Reply To</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.replyEmail\"\n name=\"reply_to\">\n </mat-form-field>\n </div>\n\n <div class=\"fs-row.gap-small.wrap\">\n <mat-form-field>\n <mat-label>To</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.toRecipients\"\n name=\"to\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>CC</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.ccRecipients\"\n name=\"cc\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>BCC</mat-label>\n <input\n matInput\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\" name=\"email\">\n <ng-template matTabContent>\n <div class=\"fs-column\">\n <div class=\"fs-row.gap-small\">\n <mat-form-field>\n <mat-label>Customize Message</mat-label>\n <mat-select\n required\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-label>Format</mat-label>\n <mat-select\n required\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-label>Template</mat-label>\n <mat-select\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>\n <mat-label>Subject</mat-label>\n <input\n matInput\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 <ng-container *ngIf=\"message.emailMessage.format===emailMessageFormat.HTML\">\n <fs-text-editor\n [(ngModel)]=\"message.emailMessage.body\"\n name=\"body\"\n [config]=\"{ language: 'html '}\">\n </fs-text-editor>\n </ng-container>\n\n <ng-container *ngIf=\"message.emailMessage.format===emailMessageFormat.RichText\">\n <fs-html-editor\n [(ngModel)]=\"message.emailMessage.body\"\n name=\"body\">\n </fs-html-editor>\n </ng-container>\n\n <ng-container *ngIf=\"message.emailMessage.format===emailMessageFormat.Text\">\n <fs-text-editor\n [(ngModel)]=\"message.emailMessage.body\"\n name=\"emailMessageBody\"\n [config]=\"{ language: 'text' }\">\n </fs-text-editor>\n </ng-container>\n </ng-template>\n </mat-tab>\n <mat-tab\n *ngIf=\"message.emailMessage.format===emailMessageFormat.HTML || message.emailMessage.format===emailMessageFormat.RichText\"\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 </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 class=\"email-body-html-default\">\n <fs-html-renderer\n *ngIf=\"message.emailMessage.format===emailMessageFormat.RichText || message.emailMessage.format===emailMessageFormat.HTML\"\n [html]=\"message.defaultEmailBody\">\n </fs-html-renderer>\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 <ng-container *ngIf=\"!!message.smsMessage\">\n <mat-tab label=\"SMS Message\" name=\"sms\">\n <ng-template matTabContent>\n <mat-form-field>\n <mat-label>Customize Message</mat-label>\n <mat-select\n required\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 <div class=\"content\">{{message.defaultSmsMessage}}</div> \n </fs-label-field>\n </ng-template>\n </mat-tab>\n </ng-container>\n\n <mat-tab label=\"Attachments\" *ngIf=\"message.emailMessage\" name=\"attachments\">\n <ng-template matTabContent>\n <fs-app-message-attachments\n [message]=\"message\">\n </fs-app-message-attachments>\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 <ng-container *ngIf=\"tab==='email' || tab==='sms' || tab==='general'; else done\">\n <button\n mat-button\n color=\"primary\">\n Save\n </button>\n <ng-container *ngIf=\"tab==='email'\">\n <button\n mat-button\n type=\"button\"\n (click)=\"openPreview()\"\n type=\"button\">\n Preview\n </button>\n <button\n mat-button\n type=\"button\"\n (click)=\"sendTest('email')\"\n type=\"button\">\n Send Test Email\n </button>\n </ng-container>\n <ng-container *ngIf=\"tab==='sms'\">\n <button\n mat-button\n type=\"button\"\n (click)=\"sendTest('sms')\"\n type=\"button\">\n Send Test SMS\n </button>\n </ng-container>\n <button\n mat-button\n [mat-dialog-close]=\"null\"\n type=\"button\">\n Cancel\n </button>\n </ng-container>\n <ng-template #done>\n <button\n mat-button\n color=\"primary\"\n [mat-dialog-close]=\"null\"\n type=\"button\">\n Close\n </button>\n </ng-template>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: ["fs-label-field .content{white-space:pre-wrap}:host ::ng-deep .mat-tab-body-content,:host ::ng-deep .mat-tab-body{overflow:visible}:host ::ng-deep .sms-message{width:100%}:host ::ng-deep .email-body-text-default{white-space:pre-line}.fs-column .mat-form-field{flex:1}.email-body-text{width:100%}.variable{margin-bottom:4px}\n"], dependencies: [{ kind: "directive", type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i5$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i6.MatTabContent, selector: "[matTabContent]" }, { kind: "component", type: i6.MatTab, selector: "mat-tab", inputs: ["disabled"], exportAs: ["matTab"] }, { kind: "component", type: i6.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple", "fitInkBarToContent", "mat-stretch-tabs"], exportAs: ["matTabGroup"] }, { kind: "component", type: i8.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8.MatLabel, selector: "mat-label" }, { kind: "directive", type: i9.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i10.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i11.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "component", type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout", "dock", "dockable", "fullscreenPercent"] }, { kind: "component", type: i13.FsLabelComponent, selector: "fs-label" }, { kind: "component", type: i13.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { kind: "directive", type: i11$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { kind: "directive", type: i12.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { kind: "directive", type: i12.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { kind: "directive", type: i12.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormGreaterEqual]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { kind: "directive", type: i12.FsButtonDirective, selector: "[mat-raised-button]:not([fsFormButtonStandalone]),[mat-button]:not([fsFormButtonStandalone]),[mat-flat-button]:not([fsFormButtonStandalone]),[mat-stroked-button]:not([fsFormButtonStandalone])", inputs: ["name", "dirtySubmit", "form"] }, { kind: "component", type: i16.FsTextEditorComponent, selector: "fs-text-editor", inputs: ["config", "scrollable"], outputs: ["ready", "blur"] }, { kind: "component", type: i17.FsHtmlEditorComponent, selector: "fs-html-editor", inputs: ["config", "disabled"] }, { kind: "component", type: i17.FsHtmlRendererComponent, selector: "fs-html-renderer", inputs: ["html"] }, { kind: "directive", type: i18.FsTabsHeaderTabGroupDirective, selector: "mat-tab-group, matTabGroup, [matTabGroup]", inputs: ["orientation", "selected", "selectedData"], outputs: ["selectedChange", "selectedDataChange"], exportAs: ["fsTabsHeaderTabGroup"] }, { kind: "directive", type: i18.FsTabsTabDirective, selector: "mat-tab,matTab", inputs: ["name", "data"], exportAs: ["fsTabsTab"] }, { kind: "component", type: AttachmentsComponent, selector: "fs-app-message-attachments", inputs: ["message"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
303
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MessageComponent, decorators: [{
|
|
304
|
-
type: Component,
|
|
305
|
-
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<form\n fsForm\n [submit]=\"save\"\n #form=\"ngForm\"\n *fsSkeleton=\"message\"\n [confirmTabs]=\"false\">\n <fs-dialog *ngIf=\"message\">\n <div mat-dialog-title>Edit Message</div>\n <mat-dialog-content>\n <mat-tab-group\n fsTabs\n [(selected)]=\"tab\">\n <mat-tab label=\"General\" name=\"general\">\n <ng-template matTabContent>\n <div class=\"fs-column\">\n <mat-form-field>\n <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.name\"\n name=\"Name\"\n required>\n </mat-form-field>\n <fs-label-field>\n <fs-label>Reference</fs-label>\n {{message.reference}}\n </fs-label-field>\n <mat-form-field>\n <mat-label>Description</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.description\"\n name=\"description\">\n </mat-form-field>\n\n <div class=\"fs-row.gap-small.wrap\">\n <mat-form-field>\n <mat-label>From Email</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.fromEmail\"\n name=\"from_email\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>From Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.fromName\"\n name=\"from_name\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>Reply To</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.replyEmail\"\n name=\"reply_to\">\n </mat-form-field>\n </div>\n\n <div class=\"fs-row.gap-small.wrap\">\n <mat-form-field>\n <mat-label>To</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.toRecipients\"\n name=\"to\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>CC</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.ccRecipients\"\n name=\"cc\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>BCC</mat-label>\n <input\n matInput\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\" name=\"email\">\n <ng-template matTabContent>\n <div class=\"fs-column\">\n <div class=\"fs-row.gap-small\">\n <mat-form-field>\n <mat-label>Customize Message</mat-label>\n <mat-select\n required\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-label>Format</mat-label>\n <mat-select\n required\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-label>Template</mat-label>\n <mat-select\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>\n <mat-label>Subject</mat-label>\n <input\n matInput\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 <ng-container *ngIf=\"message.emailMessage.format===emailMessageFormat.HTML\">\n <fs-text-editor\n [(ngModel)]=\"message.emailMessage.body\"\n name=\"body\"\n [config]=\"{ language: 'html '}\">\n </fs-text-editor>\n </ng-container>\n\n <ng-container *ngIf=\"message.emailMessage.format===emailMessageFormat.RichText\">\n <fs-html-editor\n [(ngModel)]=\"message.emailMessage.body\"\n name=\"body\">\n </fs-html-editor>\n </ng-container>\n\n <ng-container *ngIf=\"message.emailMessage.format===emailMessageFormat.Text\">\n <fs-text-editor\n [(ngModel)]=\"message.emailMessage.body\"\n name=\"emailMessageBody\"\n [config]=\"{ language: 'text' }\">\n </fs-text-editor>\n </ng-container>\n </ng-template>\n </mat-tab>\n <mat-tab\n *ngIf=\"message.emailMessage.format===emailMessageFormat.HTML || message.emailMessage.format===emailMessageFormat.RichText\"\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 </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 class=\"email-body-html-default\">\n <fs-html-renderer\n *ngIf=\"message.emailMessage.format===emailMessageFormat.RichText || message.emailMessage.format===emailMessageFormat.HTML\"\n [html]=\"message.defaultEmailBody\">\n </fs-html-renderer>\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 <ng-container *ngIf=\"!!message.smsMessage\">\n <mat-tab label=\"SMS Message\" name=\"sms\">\n <ng-template matTabContent>\n <mat-form-field>\n <mat-label>Customize Message</mat-label>\n <mat-select\n required\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 <div class=\"content\">{{message.defaultSmsMessage}}</div> \n </fs-label-field>\n </ng-template>\n </mat-tab>\n </ng-container>\n\n <mat-tab label=\"Attachments\" *ngIf=\"message.emailMessage\" name=\"attachments\">\n <ng-template matTabContent>\n <fs-app-message-attachments\n [message]=\"message\">\n </fs-app-message-attachments>\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 <ng-container *ngIf=\"tab==='email' || tab==='sms' || tab==='general'; else done\">\n <button\n mat-button\n color=\"primary\">\n Save\n </button>\n <ng-container *ngIf=\"tab==='email'\">\n <button\n mat-button\n type=\"button\"\n (click)=\"openPreview()\"\n type=\"button\">\n Preview\n </button>\n <button\n mat-button\n type=\"button\"\n (click)=\"sendTest('email')\"\n type=\"button\">\n Send Test Email\n </button>\n </ng-container>\n <ng-container *ngIf=\"tab==='sms'\">\n <button\n mat-button\n type=\"button\"\n (click)=\"sendTest('sms')\"\n type=\"button\">\n Send Test SMS\n </button>\n </ng-container>\n <button\n mat-button\n [mat-dialog-close]=\"null\"\n type=\"button\">\n Cancel\n </button>\n </ng-container>\n <ng-template #done>\n <button\n mat-button\n color=\"primary\"\n [mat-dialog-close]=\"null\"\n type=\"button\">\n Close\n </button>\n </ng-template>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: ["fs-label-field .content{white-space:pre-wrap}:host ::ng-deep .mat-tab-body-content,:host ::ng-deep .mat-tab-body{overflow:visible}:host ::ng-deep .sms-message{width:100%}:host ::ng-deep .email-body-text-default{white-space:pre-line}.fs-column .mat-form-field{flex:1}.email-body-text{width:100%}.variable{margin-bottom:4px}\n"] }]
|
|
306
|
-
}], ctorParameters: function () {
|
|
307
|
-
return [{ type: undefined, decorators: [{
|
|
308
|
-
type: Inject,
|
|
309
|
-
args: [FS_APP_MESSAGE_CONFIG]
|
|
310
|
-
}] }, { type: undefined, decorators: [{
|
|
311
|
-
type: Inject,
|
|
312
|
-
args: [MAT_DIALOG_DATA]
|
|
313
|
-
}] }, { type: i1$2.FsPrompt }, { type: i1$1.FsMessage }, { type: i1.MatDialog }, { type: i0.ChangeDetectorRef }];
|
|
314
|
-
} });
|
|
315
|
-
|
|
316
|
-
function indexNameValue(arry) {
|
|
317
|
-
const obj = {};
|
|
318
|
-
arry.forEach(item => {
|
|
319
|
-
obj[item.value] = item.name;
|
|
320
|
-
});
|
|
321
|
-
return obj;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
class MessagesComponent {
|
|
325
|
-
constructor(_config, _dialog) {
|
|
326
|
-
this._config = _config;
|
|
327
|
-
this._dialog = _dialog;
|
|
328
|
-
this.list = null;
|
|
329
|
-
this.config = null;
|
|
330
|
-
this.emailMessageFormats = {};
|
|
331
|
-
this._destroy$ = new Subject();
|
|
332
|
-
}
|
|
333
|
-
ngOnInit() {
|
|
334
|
-
this.emailMessageFormats = indexNameValue(EmailMessageFormats);
|
|
335
|
-
this.config = {
|
|
336
|
-
filters: [
|
|
337
|
-
{
|
|
338
|
-
name: 'keyword',
|
|
339
|
-
type: ItemType.Keyword,
|
|
340
|
-
label: 'Search'
|
|
341
|
-
}
|
|
342
|
-
],
|
|
343
|
-
fetch: query => {
|
|
344
|
-
return this._config.loadMessages(query)
|
|
345
|
-
.pipe(map(response => {
|
|
346
|
-
return ({ data: response.data, paging: response.paging });
|
|
347
|
-
}));
|
|
348
|
-
}
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
open(message) {
|
|
352
|
-
const dialogRef = this._dialog.open(MessageComponent, {
|
|
353
|
-
data: {
|
|
354
|
-
message: message,
|
|
355
|
-
},
|
|
356
|
-
width: '85%'
|
|
357
|
-
});
|
|
358
|
-
dialogRef.afterClosed()
|
|
359
|
-
.pipe(takeUntil(this._destroy$))
|
|
360
|
-
.subscribe(() => {
|
|
361
|
-
this.list.reload();
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
ngOnDestroy() {
|
|
365
|
-
this._destroy$.next();
|
|
366
|
-
this._destroy$.complete();
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
MessagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MessagesComponent, deps: [{ token: FS_APP_MESSAGE_CONFIG }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
|
370
|
-
MessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: MessagesComponent, selector: "fs-app-messages", viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true, static: true }], ngImport: i0, 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-column title=\"Email Message Template\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.emailMessage.messageTemplate?.name || 'None'}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Customized Message\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.emailMessage?.customize || row.smsMessage?.customize; else noCustomize\">\n <ng-container *ngIf=\"row.emailMessage?.customize\">\n {{row.emailMessage.customize ? 'Email' : ''}}\n </ng-container> \n <ng-container *ngIf=\"row.smsMessage?.customize\">\n {{row.smsMessage.customize ? 'SMS' : ''}}\n </ng-container> \n </ng-container>\n <ng-template #noCustomize>\n None\n </ng-template>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", dependencies: [{ kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { kind: "directive", type: i2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }] });
|
|
371
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MessagesComponent, decorators: [{
|
|
372
|
-
type: Component,
|
|
373
|
-
args: [{ selector: 'fs-app-messages', 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-column title=\"Email Message Template\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.emailMessage.messageTemplate?.name || 'None'}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Customized Message\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.emailMessage?.customize || row.smsMessage?.customize; else noCustomize\">\n <ng-container *ngIf=\"row.emailMessage?.customize\">\n {{row.emailMessage.customize ? 'Email' : ''}}\n </ng-container> \n <ng-container *ngIf=\"row.smsMessage?.customize\">\n {{row.smsMessage.customize ? 'SMS' : ''}}\n </ng-container> \n </ng-container>\n <ng-template #noCustomize>\n None\n </ng-template>\n </ng-template>\n </fs-list-column>\n</fs-list>\n" }]
|
|
374
|
-
}], ctorParameters: function () {
|
|
375
|
-
return [{ type: undefined, decorators: [{
|
|
376
|
-
type: Inject,
|
|
377
|
-
args: [FS_APP_MESSAGE_CONFIG]
|
|
378
|
-
}] }, { type: i1.MatDialog }];
|
|
379
|
-
}, propDecorators: { list: [{
|
|
380
|
-
type: ViewChild,
|
|
381
|
-
args: [FsListComponent, { static: true }]
|
|
382
|
-
}] } });
|
|
383
|
-
|
|
384
|
-
class FsAppMessagesModule {
|
|
385
|
-
}
|
|
386
|
-
FsAppMessagesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessagesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
387
|
-
FsAppMessagesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessagesModule, declarations: [MessagesComponent,
|
|
388
|
-
MessageComponent,
|
|
389
|
-
AttachmentsComponent], imports: [RouterModule,
|
|
390
|
-
CommonModule,
|
|
391
|
-
FormsModule,
|
|
392
|
-
MatDialogModule,
|
|
393
|
-
MatButtonModule,
|
|
394
|
-
MatTabsModule,
|
|
395
|
-
MatFormFieldModule,
|
|
396
|
-
MatInputModule,
|
|
397
|
-
MatOptionModule,
|
|
398
|
-
MatSelectModule,
|
|
399
|
-
MatTooltipModule,
|
|
400
|
-
MatCheckboxModule,
|
|
401
|
-
FsDialogModule,
|
|
402
|
-
FsListModule,
|
|
403
|
-
FsLabelModule,
|
|
404
|
-
FsSkeletonModule,
|
|
405
|
-
FsFormModule,
|
|
406
|
-
FsTextEditorModule,
|
|
407
|
-
FsHtmlEditorModule,
|
|
408
|
-
FsHtmlRendererModule,
|
|
409
|
-
FsCommonModule,
|
|
410
|
-
FsTabsModule,
|
|
411
|
-
FsAppMessagePreviewModule], exports: [MessagesComponent,
|
|
412
|
-
MessageComponent] });
|
|
413
|
-
FsAppMessagesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessagesModule, imports: [RouterModule,
|
|
414
|
-
CommonModule,
|
|
415
|
-
FormsModule,
|
|
416
|
-
MatDialogModule,
|
|
417
|
-
MatButtonModule,
|
|
418
|
-
MatTabsModule,
|
|
419
|
-
MatFormFieldModule,
|
|
420
|
-
MatInputModule,
|
|
421
|
-
MatOptionModule,
|
|
422
|
-
MatSelectModule,
|
|
423
|
-
MatTooltipModule,
|
|
424
|
-
MatCheckboxModule,
|
|
425
|
-
FsDialogModule,
|
|
426
|
-
FsListModule,
|
|
427
|
-
FsLabelModule,
|
|
428
|
-
FsSkeletonModule,
|
|
429
|
-
FsFormModule,
|
|
430
|
-
FsTextEditorModule,
|
|
431
|
-
FsHtmlEditorModule,
|
|
432
|
-
FsHtmlRendererModule,
|
|
433
|
-
FsCommonModule,
|
|
434
|
-
FsTabsModule,
|
|
435
|
-
FsAppMessagePreviewModule] });
|
|
436
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessagesModule, decorators: [{
|
|
437
|
-
type: NgModule,
|
|
438
|
-
args: [{
|
|
439
|
-
imports: [
|
|
440
|
-
RouterModule,
|
|
441
|
-
CommonModule,
|
|
442
|
-
FormsModule,
|
|
443
|
-
MatDialogModule,
|
|
444
|
-
MatButtonModule,
|
|
445
|
-
MatTabsModule,
|
|
446
|
-
MatFormFieldModule,
|
|
447
|
-
MatInputModule,
|
|
448
|
-
MatOptionModule,
|
|
449
|
-
MatSelectModule,
|
|
450
|
-
MatTooltipModule,
|
|
451
|
-
MatCheckboxModule,
|
|
452
|
-
FsDialogModule,
|
|
453
|
-
FsListModule,
|
|
454
|
-
FsLabelModule,
|
|
455
|
-
FsSkeletonModule,
|
|
456
|
-
FsFormModule,
|
|
457
|
-
FsTextEditorModule,
|
|
458
|
-
FsHtmlEditorModule,
|
|
459
|
-
FsHtmlRendererModule,
|
|
460
|
-
FsCommonModule,
|
|
461
|
-
FsTabsModule,
|
|
462
|
-
FsAppMessagePreviewModule,
|
|
463
|
-
],
|
|
464
|
-
declarations: [
|
|
465
|
-
MessagesComponent,
|
|
466
|
-
MessageComponent,
|
|
467
|
-
AttachmentsComponent,
|
|
468
|
-
],
|
|
469
|
-
exports: [
|
|
470
|
-
MessagesComponent,
|
|
471
|
-
MessageComponent,
|
|
472
|
-
],
|
|
473
|
-
}]
|
|
474
|
-
}] });
|
|
475
|
-
|
|
476
|
-
var MessageQueueState;
|
|
477
|
-
(function (MessageQueueState) {
|
|
478
|
-
MessageQueueState["Sent"] = "S";
|
|
479
|
-
MessageQueueState["PartiallySent"] = "P";
|
|
480
|
-
MessageQueueState["Sending"] = "E";
|
|
481
|
-
MessageQueueState["Queued"] = "Q";
|
|
482
|
-
MessageQueueState["Canceled"] = "C";
|
|
483
|
-
MessageQueueState["InvalidRecipients"] = "I";
|
|
484
|
-
MessageQueueState["Failed"] = "F";
|
|
485
|
-
})(MessageQueueState || (MessageQueueState = {}));
|
|
486
|
-
|
|
487
|
-
const MessageQueueStates = [
|
|
488
|
-
{ name: 'Sent', value: MessageQueueState.Sent },
|
|
489
|
-
{ name: 'Partially Sent', value: MessageQueueState.PartiallySent },
|
|
490
|
-
{ name: 'Sending', value: MessageQueueState.Sending },
|
|
491
|
-
{ name: 'Queued', value: MessageQueueState.Queued },
|
|
492
|
-
{ name: 'Canceled', value: MessageQueueState.Canceled },
|
|
493
|
-
{ name: 'Invalid Recipients', value: MessageQueueState.InvalidRecipients },
|
|
494
|
-
{ name: 'Failed', value: MessageQueueState.Failed }
|
|
495
|
-
];
|
|
496
|
-
|
|
497
|
-
var EmailMessageQueueFormat;
|
|
498
|
-
(function (EmailMessageQueueFormat) {
|
|
499
|
-
EmailMessageQueueFormat["Text"] = "T";
|
|
500
|
-
EmailMessageQueueFormat["HTML"] = "H";
|
|
501
|
-
EmailMessageQueueFormat["RichText"] = "R";
|
|
502
|
-
})(EmailMessageQueueFormat || (EmailMessageQueueFormat = {}));
|
|
503
|
-
|
|
504
|
-
var MessageQueueType;
|
|
505
|
-
(function (MessageQueueType) {
|
|
506
|
-
MessageQueueType["Sms"] = "S";
|
|
507
|
-
MessageQueueType["Email"] = "E";
|
|
508
|
-
})(MessageQueueType || (MessageQueueType = {}));
|
|
509
|
-
|
|
510
|
-
var MessageQueueEventType;
|
|
511
|
-
(function (MessageQueueEventType) {
|
|
512
|
-
MessageQueueEventType["Click"] = "click";
|
|
513
|
-
MessageQueueEventType["Open"] = "open";
|
|
514
|
-
})(MessageQueueEventType || (MessageQueueEventType = {}));
|
|
515
|
-
|
|
516
|
-
const MessageQueueEventTypes = [
|
|
517
|
-
{ name: 'Open', value: MessageQueueEventType.Open },
|
|
518
|
-
{ name: 'Click', value: MessageQueueEventType.Click },
|
|
519
|
-
];
|
|
520
|
-
|
|
521
|
-
class RecipientComponent {
|
|
522
|
-
ngOnInit() {
|
|
523
|
-
const icons = {
|
|
524
|
-
'S': { name: 'check_circle', tooltip: 'Sent' },
|
|
525
|
-
'E': { name: 'offline_bolt', tooltip: 'Sending' },
|
|
526
|
-
'F': { name: 'info', tooltip: 'Failed' },
|
|
527
|
-
};
|
|
528
|
-
this.icon = icons[this.state];
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
RecipientComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RecipientComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
532
|
-
RecipientComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: RecipientComponent, selector: "app-recipient", inputs: { name: "name", state: "state" }, ngImport: i0, 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>", 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}\n"], dependencies: [{ kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
533
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RecipientComponent, decorators: [{
|
|
534
|
-
type: Component,
|
|
535
|
-
args: [{ selector: 'app-recipient', changeDetection: ChangeDetectionStrategy.OnPush, 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>", 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}\n"] }]
|
|
536
|
-
}], propDecorators: { name: [{
|
|
537
|
-
type: Input
|
|
538
|
-
}], state: [{
|
|
539
|
-
type: Input
|
|
540
|
-
}] } });
|
|
541
|
-
|
|
542
|
-
class QueueComponent {
|
|
543
|
-
constructor(_config, _data, _message, _prompt, _dialog, _cdRef) {
|
|
544
|
-
this._config = _config;
|
|
545
|
-
this._data = _data;
|
|
546
|
-
this._message = _message;
|
|
547
|
-
this._prompt = _prompt;
|
|
548
|
-
this._dialog = _dialog;
|
|
549
|
-
this._cdRef = _cdRef;
|
|
550
|
-
this.messageQueueRecipients = {};
|
|
551
|
-
this.emailMessageQueueFormat = EmailMessageQueueFormat;
|
|
552
|
-
this.MessageQueueEventTypes = indexNameValue(MessageQueueEventTypes);
|
|
553
|
-
this.MessageQueueEventType = MessageQueueEventType;
|
|
554
|
-
this._destroy$ = new Subject();
|
|
555
|
-
}
|
|
556
|
-
ngOnInit() {
|
|
557
|
-
this.messageQueueStates = indexNameValue(MessageQueueStates);
|
|
558
|
-
this.resendMessageQueue = this._config.resendMessageQueue;
|
|
559
|
-
this.forwardMessageQueue = this._config.forwardMessageQueue;
|
|
560
|
-
this._config.loadMessageQueue(this._data.messageQueueId)
|
|
561
|
-
.subscribe((messageQueue) => {
|
|
562
|
-
this.messageQueue = messageQueue;
|
|
563
|
-
if (this.messageQueue.emailMessageQueue) {
|
|
564
|
-
let body = this.messageQueue.emailMessageQueue.body;
|
|
565
|
-
if (this.messageQueue.emailMessageQueue.format === EmailMessageQueueFormat.HTML) {
|
|
566
|
-
try {
|
|
567
|
-
const doc = new DOMParser().parseFromString(body, 'text/html');
|
|
568
|
-
doc.querySelectorAll('a').forEach((el) => {
|
|
569
|
-
el.setAttribute('target', '_blank');
|
|
570
|
-
});
|
|
571
|
-
body = doc.documentElement.innerHTML;
|
|
572
|
-
}
|
|
573
|
-
catch (e) {
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
else {
|
|
577
|
-
body = this.anchorMe(body);
|
|
578
|
-
}
|
|
579
|
-
this.messageQueue.emailMessageQueue.body = body;
|
|
580
|
-
}
|
|
581
|
-
if (this.messageQueue.smsMessageQueue) {
|
|
582
|
-
this.messageQueue.smsMessageQueue.body = this.anchorMe(this.messageQueue.smsMessageQueue.body);
|
|
583
|
-
}
|
|
584
|
-
this.messageQueueRecipients = this.messageQueue.messageQueueRecipients
|
|
585
|
-
.reduce((accum, messageQueueRecipient) => {
|
|
586
|
-
accum[messageQueueRecipient.recipient] = messageQueueRecipient.state;
|
|
587
|
-
return accum;
|
|
588
|
-
}, {});
|
|
589
|
-
this._setLogsConfig(messageQueue);
|
|
590
|
-
this._setAttachmentsConfig(messageQueue);
|
|
591
|
-
this._setEventsConfig(messageQueue);
|
|
592
|
-
this._cdRef.markForCheck();
|
|
593
|
-
});
|
|
594
|
-
}
|
|
595
|
-
anchorMe(input) {
|
|
596
|
-
return anchorme({
|
|
597
|
-
input,
|
|
598
|
-
options: {
|
|
599
|
-
attributes: {
|
|
600
|
-
target: "_blank",
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
});
|
|
604
|
-
}
|
|
605
|
-
openMessage(message) {
|
|
606
|
-
this._dialog.open(MessageComponent, {
|
|
607
|
-
data: {
|
|
608
|
-
message: message,
|
|
609
|
-
},
|
|
610
|
-
width: '85%'
|
|
611
|
-
});
|
|
612
|
-
}
|
|
613
|
-
resend() {
|
|
614
|
-
this._prompt.confirm({
|
|
615
|
-
title: 'Confirm',
|
|
616
|
-
template: 'Are you sure you would like to resend this message?'
|
|
617
|
-
}).subscribe(() => {
|
|
618
|
-
this.resendMessageQueue(this.messageQueue)
|
|
619
|
-
.subscribe(messageQueue => {
|
|
620
|
-
Object.assign(this.messageQueue, messageQueue);
|
|
621
|
-
this._cdRef.markForCheck();
|
|
622
|
-
this._message.success('Successfully resent');
|
|
623
|
-
if (this.logList) {
|
|
624
|
-
this.logList.reload();
|
|
625
|
-
}
|
|
626
|
-
});
|
|
627
|
-
});
|
|
628
|
-
}
|
|
629
|
-
forward() {
|
|
630
|
-
const typeName = this.messageQueue.type === MessageQueueType.Email ? 'an email' : 'a phone number';
|
|
631
|
-
this._prompt.input({
|
|
632
|
-
label: `Please enter ${typeName} to forward to`,
|
|
633
|
-
title: 'Forward Message',
|
|
634
|
-
commitLabel: 'Forward',
|
|
635
|
-
required: true
|
|
636
|
-
}).subscribe((value) => {
|
|
637
|
-
if (value) {
|
|
638
|
-
this.forwardMessageQueue(this.messageQueue, value)
|
|
639
|
-
.subscribe(messageQueue => {
|
|
640
|
-
this.messageQueue = Object.assign(Object.assign({}, this.messageQueue), { messageQueue });
|
|
641
|
-
this._message.success('Successfully forwarded');
|
|
642
|
-
this._cdRef.markForCheck();
|
|
643
|
-
if (this.logList) {
|
|
644
|
-
this.logList.reload();
|
|
645
|
-
}
|
|
646
|
-
});
|
|
647
|
-
}
|
|
648
|
-
});
|
|
649
|
-
}
|
|
650
|
-
ngOnDestroy() {
|
|
651
|
-
this._destroy$.next();
|
|
652
|
-
this._destroy$.complete();
|
|
653
|
-
}
|
|
654
|
-
_setLogsConfig(messageQueue) {
|
|
655
|
-
this.logConfig = {
|
|
656
|
-
loadMore: true,
|
|
657
|
-
queryParam: false,
|
|
658
|
-
fetch: query => {
|
|
659
|
-
return this._config.loadLogs(messageQueue, query);
|
|
660
|
-
}
|
|
661
|
-
};
|
|
662
|
-
}
|
|
663
|
-
_setEventsConfig(messageQueue) {
|
|
664
|
-
this.eventConfig = {
|
|
665
|
-
loadMore: true,
|
|
666
|
-
queryParam: false,
|
|
667
|
-
fetch: (query) => {
|
|
668
|
-
return this._config.loadMessageQueueEvents(messageQueue, query);
|
|
669
|
-
}
|
|
670
|
-
};
|
|
671
|
-
}
|
|
672
|
-
_setAttachmentsConfig(messageQueue) {
|
|
673
|
-
this.attachmentConfig = {
|
|
674
|
-
queryParam: false,
|
|
675
|
-
fetch: query => {
|
|
676
|
-
return this._config.loadMessageQueueAttachments(messageQueue, query)
|
|
677
|
-
.pipe(map(response => ({
|
|
678
|
-
data: response.data.map(value => {
|
|
679
|
-
value.prettyFilesize = this._prettyFilesize(value.filesize);
|
|
680
|
-
return value;
|
|
681
|
-
}), paging: response.paging
|
|
682
|
-
})));
|
|
683
|
-
}
|
|
684
|
-
};
|
|
685
|
-
if (this._config.downloadMessageQueueAttachment) {
|
|
686
|
-
this.attachmentConfig.rowActions = [
|
|
687
|
-
{
|
|
688
|
-
click: (messageAttachment) => {
|
|
689
|
-
this._config.downloadMessageQueueAttachment(messageAttachment, this.messageQueue);
|
|
690
|
-
},
|
|
691
|
-
label: 'Download',
|
|
692
|
-
}
|
|
693
|
-
];
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
_prettyFilesize(bytes) {
|
|
697
|
-
if (bytes === 0) {
|
|
698
|
-
return '0.00 B';
|
|
699
|
-
}
|
|
700
|
-
const e = Math.floor(Math.log(bytes) / Math.log(1024));
|
|
701
|
-
return (bytes / Math.pow(1024, e)).toFixed(2) + ' ' + ' KMGTP'.charAt(e) + 'B';
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
QueueComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: QueueComponent, deps: [{ token: FS_APP_MESSAGE_CONFIG }, { token: MAT_DIALOG_DATA }, { token: i1$1.FsMessage }, { token: i1$2.FsPrompt }, { token: i1.MatDialog }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
705
|
-
QueueComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: QueueComponent, selector: "ng-component", viewQueries: [{ propertyName: "logList", first: true, predicate: ["logList"], descendants: true }], ngImport: i0, 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 class=\"fs-row.gap-large.wrap\">\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 [width]=\"'100%'\">\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=\"Recipient\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.messageQueueRecipient.recipient}}\n </ng-template>\n </fs-list-column>\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 <a [href]=\"row.meta?.url\" target=\"_blank\">{{row.meta?.url}}</a>\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", styles: [".subject,.body{display:block;margin-top:15px}.format-text{white-space:pre-wrap}app-recipient{display:block}\n"], dependencies: [{ kind: "directive", type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i6.MatTabContent, selector: "[matTabContent]" }, { kind: "component", type: i6.MatTab, selector: "mat-tab", inputs: ["disabled"], exportAs: ["matTab"] }, { kind: "component", type: i6.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple", "fitInkBarToContent", "mat-stretch-tabs"], exportAs: ["matTabGroup"] }, { kind: "component", type: i2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { kind: "directive", type: i2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "component", type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout", "dock", "dockable", "fullscreenPercent"] }, { kind: "component", type: i13.FsLabelComponent, selector: "fs-label" }, { kind: "component", type: i13.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { kind: "component", type: i10$1.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }, { kind: "directive", type: i11$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { kind: "directive", type: i12.FsButtonDirective, selector: "[mat-raised-button]:not([fsFormButtonStandalone]),[mat-button]:not([fsFormButtonStandalone]),[mat-flat-button]:not([fsFormButtonStandalone]),[mat-stroked-button]:not([fsFormButtonStandalone])", inputs: ["name", "dirtySubmit", "form"] }, { kind: "component", type: i4.FsIFrameComponent, selector: "fs-iframe", inputs: ["html", "src", "styles", "width", "height"], outputs: ["loaded"] }, { kind: "component", type: RecipientComponent, selector: "app-recipient", inputs: ["name", "state"] }, { kind: "pipe", type: i10$1.FsDateFormatPipe, name: "fsDateFormat" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
706
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: QueueComponent, decorators: [{
|
|
707
|
-
type: Component,
|
|
708
|
-
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, 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 class=\"fs-row.gap-large.wrap\">\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 [width]=\"'100%'\">\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=\"Recipient\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.messageQueueRecipient.recipient}}\n </ng-template>\n </fs-list-column>\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 <a [href]=\"row.meta?.url\" target=\"_blank\">{{row.meta?.url}}</a>\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", styles: [".subject,.body{display:block;margin-top:15px}.format-text{white-space:pre-wrap}app-recipient{display:block}\n"] }]
|
|
709
|
-
}], ctorParameters: function () {
|
|
710
|
-
return [{ type: undefined, decorators: [{
|
|
711
|
-
type: Inject,
|
|
712
|
-
args: [FS_APP_MESSAGE_CONFIG]
|
|
713
|
-
}] }, { type: undefined, decorators: [{
|
|
714
|
-
type: Inject,
|
|
715
|
-
args: [MAT_DIALOG_DATA]
|
|
716
|
-
}] }, { type: i1$1.FsMessage }, { type: i1$2.FsPrompt }, { type: i1.MatDialog }, { type: i0.ChangeDetectorRef }];
|
|
717
|
-
}, propDecorators: { logList: [{
|
|
718
|
-
type: ViewChild,
|
|
719
|
-
args: ['logList']
|
|
720
|
-
}] } });
|
|
721
|
-
|
|
722
|
-
class FsMessageQueueService {
|
|
723
|
-
constructor(_dialog) {
|
|
724
|
-
this._dialog = _dialog;
|
|
725
|
-
}
|
|
726
|
-
openMessageQueue(messageQueueId, options = {}) {
|
|
727
|
-
return this._dialog.open(QueueComponent, Object.assign(Object.assign({}, options), { data: {
|
|
728
|
-
messageQueueId,
|
|
729
|
-
}, width: options.width || '85%' }))
|
|
730
|
-
.afterClosed();
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
FsMessageQueueService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsMessageQueueService, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
734
|
-
FsMessageQueueService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsMessageQueueService, providedIn: 'root' });
|
|
735
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsMessageQueueService, decorators: [{
|
|
736
|
-
type: Injectable,
|
|
737
|
-
args: [{
|
|
738
|
-
providedIn: 'root',
|
|
739
|
-
}]
|
|
740
|
-
}], ctorParameters: function () { return [{ type: i1.MatDialog }]; } });
|
|
741
|
-
|
|
742
|
-
class TruncatePipe {
|
|
743
|
-
transform(value, limit = 25, completeWords = false, ellipsis = '...') {
|
|
744
|
-
if (value.length < limit) {
|
|
745
|
-
return `${value.substr(0, limit)}`;
|
|
746
|
-
}
|
|
747
|
-
if (completeWords) {
|
|
748
|
-
limit = value.substr(0, limit).lastIndexOf(' ');
|
|
749
|
-
}
|
|
750
|
-
return `${value.substr(0, limit)}${ellipsis}`;
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
TruncatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TruncatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
754
|
-
TruncatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: TruncatePipe, name: "truncate" });
|
|
755
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TruncatePipe, decorators: [{
|
|
756
|
-
type: Pipe,
|
|
757
|
-
args: [{
|
|
758
|
-
name: 'truncate'
|
|
759
|
-
}]
|
|
760
|
-
}] });
|
|
761
|
-
|
|
762
|
-
class QueuesComponent {
|
|
763
|
-
constructor(_config, _messageQueueService, _cdRef, _store) {
|
|
764
|
-
this._config = _config;
|
|
765
|
-
this._messageQueueService = _messageQueueService;
|
|
766
|
-
this._cdRef = _cdRef;
|
|
767
|
-
this._store = _store;
|
|
768
|
-
this.list = null;
|
|
769
|
-
this.query = {};
|
|
770
|
-
this.type = null;
|
|
771
|
-
this.config = null;
|
|
772
|
-
this.messageQueueStates = {};
|
|
773
|
-
this.MessageQueueState = MessageQueueState;
|
|
774
|
-
this._destroy$ = new Subject();
|
|
775
|
-
}
|
|
776
|
-
ngOnInit() {
|
|
777
|
-
this.messageQueueStates = indexNameValue(MessageQueueStates);
|
|
778
|
-
this.initList();
|
|
779
|
-
this.initWebhook();
|
|
780
|
-
}
|
|
781
|
-
enableWebhook() {
|
|
782
|
-
this._config.createWebhook()
|
|
783
|
-
.subscribe(() => {
|
|
784
|
-
this.initWebhook();
|
|
785
|
-
});
|
|
786
|
-
}
|
|
787
|
-
initWebhook() {
|
|
788
|
-
const domain = document.location.hostname;
|
|
789
|
-
if (domain === 'localhost' || domain === '[::1]') {
|
|
790
|
-
return;
|
|
791
|
-
}
|
|
792
|
-
this._config.loadWebhooks({ domain })
|
|
793
|
-
.pipe(filter(() => {
|
|
794
|
-
return !this._store.get('messagesWebhookEnabled');
|
|
795
|
-
}))
|
|
796
|
-
.subscribe((webhooks) => {
|
|
797
|
-
this._cdRef.markForCheck();
|
|
798
|
-
this.webHookEnabled = webhooks
|
|
799
|
-
.some((webhook) => {
|
|
800
|
-
const url = new URL(webhook.url);
|
|
801
|
-
return url.host === domain;
|
|
802
|
-
});
|
|
803
|
-
this._store.set('messagesWebhookEnabled', this.webHookEnabled);
|
|
804
|
-
});
|
|
805
|
-
}
|
|
806
|
-
initList() {
|
|
807
|
-
this.config = {
|
|
808
|
-
filters: [
|
|
809
|
-
{
|
|
810
|
-
name: 'keyword',
|
|
811
|
-
type: ItemType.Keyword,
|
|
812
|
-
label: 'Search',
|
|
813
|
-
},
|
|
814
|
-
{
|
|
815
|
-
name: 'state',
|
|
816
|
-
type: ItemType.Select,
|
|
817
|
-
label: 'Status',
|
|
818
|
-
values: () => {
|
|
819
|
-
return MessageQueueStates;
|
|
820
|
-
},
|
|
821
|
-
},
|
|
822
|
-
{
|
|
823
|
-
name: 'date',
|
|
824
|
-
type: ItemType.DateRange,
|
|
825
|
-
label: ['From Date', 'To Date'],
|
|
826
|
-
},
|
|
827
|
-
],
|
|
828
|
-
sort: { value: 'created_date', direction: 'desc' },
|
|
829
|
-
fetch: (query) => {
|
|
830
|
-
query = Object.assign(Object.assign(Object.assign({}, query), this.query), { type: this.type, messageQueueAttachmentCounts: true, emailMessageQueues: true, emailMessageQueueBodies: false, smsMessageQueues: true });
|
|
831
|
-
return this._config.loadMessageQueues(query)
|
|
832
|
-
.pipe(map((response) => ({
|
|
833
|
-
data: response.data
|
|
834
|
-
.map((messageQueue) => {
|
|
835
|
-
return Object.assign(Object.assign({}, messageQueue), { scheduled: messageQueue.state === MessageQueueState.Queued && isAfter(messageQueue.scheduledDate, new Date()), messageQueueRecipients: messageQueue.messageQueueRecipients
|
|
836
|
-
.reduce((accum, messageQueueRecipient) => {
|
|
837
|
-
accum[messageQueueRecipient.recipient] = messageQueueRecipient.state;
|
|
838
|
-
return accum;
|
|
839
|
-
}, {}) });
|
|
840
|
-
}), paging: response.paging,
|
|
841
|
-
})));
|
|
842
|
-
},
|
|
843
|
-
};
|
|
844
|
-
if (this._config.bulkMessageQueues) {
|
|
845
|
-
this.config.selection = {
|
|
846
|
-
selectAll: false,
|
|
847
|
-
actions: [
|
|
848
|
-
{
|
|
849
|
-
type: SelectionActionType.Action,
|
|
850
|
-
name: 'queue',
|
|
851
|
-
label: 'Queue',
|
|
852
|
-
},
|
|
853
|
-
{
|
|
854
|
-
type: SelectionActionType.Action,
|
|
855
|
-
name: 'resend',
|
|
856
|
-
label: 'Resend',
|
|
857
|
-
},
|
|
858
|
-
{
|
|
859
|
-
type: SelectionActionType.Action,
|
|
860
|
-
name: 'cancel',
|
|
861
|
-
label: 'Cancel',
|
|
862
|
-
},
|
|
863
|
-
],
|
|
864
|
-
actionSelected: (actionSelected) => {
|
|
865
|
-
return this._config.bulkMessageQueues(actionSelected.action.name, actionSelected.selected)
|
|
866
|
-
.pipe(tap(() => {
|
|
867
|
-
this.list.reload();
|
|
868
|
-
}));
|
|
869
|
-
},
|
|
870
|
-
};
|
|
871
|
-
}
|
|
872
|
-
this.config.filters.push({
|
|
873
|
-
name: 'messageId',
|
|
874
|
-
type: ItemType.Select,
|
|
875
|
-
label: 'Message Type',
|
|
876
|
-
values: (query) => {
|
|
877
|
-
query = Object.assign(Object.assign({}, query), { limit: 50 });
|
|
878
|
-
return this._config.loadMessages(query)
|
|
879
|
-
.pipe(map((response) => {
|
|
880
|
-
return [
|
|
881
|
-
{ value: null, name: 'All' },
|
|
882
|
-
...response.data
|
|
883
|
-
.map((item) => ({ name: item.name, value: item.id })),
|
|
884
|
-
];
|
|
885
|
-
}));
|
|
886
|
-
},
|
|
887
|
-
});
|
|
888
|
-
}
|
|
889
|
-
open(messageQueue) {
|
|
890
|
-
this._messageQueueService.openMessageQueue(messageQueue.id)
|
|
891
|
-
.pipe(takeUntil(this._destroy$))
|
|
892
|
-
.subscribe(() => {
|
|
893
|
-
this.list.reload();
|
|
894
|
-
});
|
|
895
|
-
}
|
|
896
|
-
ngOnDestroy() {
|
|
897
|
-
this._destroy$.next();
|
|
898
|
-
this._destroy$.complete();
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
QueuesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: QueuesComponent, deps: [{ token: FS_APP_MESSAGE_CONFIG }, { token: FsMessageQueueService }, { token: i0.ChangeDetectorRef }, { token: i2$2.FsStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
902
|
-
QueuesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: QueuesComponent, selector: "fs-app-message-queues", inputs: { query: "query", type: "type" }, viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true, static: true }], ngImport: i0, template: "<ng-container *ngIf=\"webHookEnabled === false\">\n <fs-message-info>\n <div class=\"fs-row\">\n <span class=\"fs-flex\">The webhook which provides email delivery confirmations is not enabled.</span>\n <a \n (click)=\"enableWebhook()\"\n mat-raised-button>\n Enable\n </a>\n </div>\n\n </fs-message-info>\n</ng-container>\n\n<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 <a (click)=\"open(row)\">{{row.emailMessageQueue.subject|truncate:100}}</a>\n <ng-container *ngIf=\"row.messageQueueAttachmentCount\">\n <mat-icon \n class=\"attachment-icon\"\n [matTooltip]=\"row.messageQueueAttachmentCount + ' Attachment(s)'\">\n attach_file\n </mat-icon>\n </ng-container>\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 <ng-container *ngIf=\"row.scheduled; else state\">\n Scheduled\n <div class=\"small\">\n {{row.scheduledDate | fsDateFormat: 'date-time' }}\n </div>\n </ng-container>\n <ng-template #state>\n <span [class]=\"'state-' + row.state\">{{messageQueueStates[row.state]}}</span>\n </ng-template>\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>", 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}.attachment-icon{vertical-align:bottom}fs-message-info{margin-bottom:10px;display:block}\n"], dependencies: [{ kind: "directive", type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i5.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { kind: "directive", type: i2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "directive", type: i12.FsButtonDirective, selector: "[mat-raised-button]:not([fsFormButtonStandalone]),[mat-button]:not([fsFormButtonStandalone]),[mat-flat-button]:not([fsFormButtonStandalone]),[mat-stroked-button]:not([fsFormButtonStandalone])", inputs: ["name", "dirtySubmit", "form"] }, { kind: "component", type: i1$1.FsMessageInfoComponent, selector: "fs-message-info" }, { kind: "component", type: RecipientComponent, selector: "app-recipient", inputs: ["name", "state"] }, { kind: "pipe", type: i10$1.FsDateFormatPipe, name: "fsDateFormat" }, { kind: "pipe", type: TruncatePipe, name: "truncate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
903
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: QueuesComponent, decorators: [{
|
|
904
|
-
type: Component,
|
|
905
|
-
args: [{ selector: 'fs-app-message-queues', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"webHookEnabled === false\">\n <fs-message-info>\n <div class=\"fs-row\">\n <span class=\"fs-flex\">The webhook which provides email delivery confirmations is not enabled.</span>\n <a \n (click)=\"enableWebhook()\"\n mat-raised-button>\n Enable\n </a>\n </div>\n\n </fs-message-info>\n</ng-container>\n\n<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 <a (click)=\"open(row)\">{{row.emailMessageQueue.subject|truncate:100}}</a>\n <ng-container *ngIf=\"row.messageQueueAttachmentCount\">\n <mat-icon \n class=\"attachment-icon\"\n [matTooltip]=\"row.messageQueueAttachmentCount + ' Attachment(s)'\">\n attach_file\n </mat-icon>\n </ng-container>\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 <ng-container *ngIf=\"row.scheduled; else state\">\n Scheduled\n <div class=\"small\">\n {{row.scheduledDate | fsDateFormat: 'date-time' }}\n </div>\n </ng-container>\n <ng-template #state>\n <span [class]=\"'state-' + row.state\">{{messageQueueStates[row.state]}}</span>\n </ng-template>\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>", 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}.attachment-icon{vertical-align:bottom}fs-message-info{margin-bottom:10px;display:block}\n"] }]
|
|
906
|
-
}], ctorParameters: function () {
|
|
907
|
-
return [{ type: undefined, decorators: [{
|
|
908
|
-
type: Inject,
|
|
909
|
-
args: [FS_APP_MESSAGE_CONFIG]
|
|
910
|
-
}] }, { type: FsMessageQueueService }, { type: i0.ChangeDetectorRef }, { type: i2$2.FsStore }];
|
|
911
|
-
}, propDecorators: { list: [{
|
|
912
|
-
type: ViewChild,
|
|
913
|
-
args: [FsListComponent, { static: true }]
|
|
914
|
-
}], query: [{
|
|
915
|
-
type: Input
|
|
916
|
-
}], type: [{
|
|
917
|
-
type: Input
|
|
918
|
-
}] } });
|
|
919
|
-
|
|
920
|
-
class LinkifyPipe {
|
|
921
|
-
transform(input) {
|
|
922
|
-
return anchorme({
|
|
923
|
-
input,
|
|
924
|
-
options: {
|
|
925
|
-
attributes: {
|
|
926
|
-
target: "_blank",
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
});
|
|
930
|
-
}
|
|
931
|
-
}
|
|
932
|
-
LinkifyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LinkifyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
933
|
-
LinkifyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: LinkifyPipe, name: "linkify" });
|
|
934
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LinkifyPipe, decorators: [{
|
|
935
|
-
type: Pipe,
|
|
936
|
-
args: [{ name: 'linkify' }]
|
|
937
|
-
}] });
|
|
938
|
-
|
|
939
|
-
class FsAppMessageQueuesModule {
|
|
940
|
-
}
|
|
941
|
-
FsAppMessageQueuesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessageQueuesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
942
|
-
FsAppMessageQueuesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessageQueuesModule, declarations: [QueuesComponent,
|
|
943
|
-
QueueComponent,
|
|
944
|
-
LinkifyPipe,
|
|
945
|
-
TruncatePipe,
|
|
946
|
-
RecipientComponent], imports: [RouterModule,
|
|
947
|
-
FormsModule,
|
|
948
|
-
CommonModule,
|
|
949
|
-
MatTooltipModule,
|
|
950
|
-
MatDialogModule,
|
|
951
|
-
MatButtonModule,
|
|
952
|
-
MatIconModule,
|
|
953
|
-
MatTabsModule,
|
|
954
|
-
FsListModule,
|
|
955
|
-
FsDialogModule,
|
|
956
|
-
FsLabelModule,
|
|
957
|
-
FsDateModule,
|
|
958
|
-
FsSkeletonModule,
|
|
959
|
-
FsAppMessagesModule,
|
|
960
|
-
FsFormModule,
|
|
961
|
-
FsPromptInputModule,
|
|
962
|
-
FsIFrameModule,
|
|
963
|
-
FsMessageModule], exports: [QueuesComponent,
|
|
964
|
-
QueueComponent] });
|
|
965
|
-
FsAppMessageQueuesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessageQueuesModule, providers: [
|
|
966
|
-
FsMessageQueueService,
|
|
967
|
-
], imports: [RouterModule,
|
|
968
|
-
FormsModule,
|
|
969
|
-
CommonModule,
|
|
970
|
-
MatTooltipModule,
|
|
971
|
-
MatDialogModule,
|
|
972
|
-
MatButtonModule,
|
|
973
|
-
MatIconModule,
|
|
974
|
-
MatTabsModule,
|
|
975
|
-
FsListModule,
|
|
976
|
-
FsDialogModule,
|
|
977
|
-
FsLabelModule,
|
|
978
|
-
FsDateModule,
|
|
979
|
-
FsSkeletonModule,
|
|
980
|
-
FsAppMessagesModule,
|
|
981
|
-
FsFormModule,
|
|
982
|
-
FsPromptInputModule,
|
|
983
|
-
FsIFrameModule,
|
|
984
|
-
FsMessageModule] });
|
|
985
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessageQueuesModule, decorators: [{
|
|
986
|
-
type: NgModule,
|
|
987
|
-
args: [{
|
|
988
|
-
imports: [
|
|
989
|
-
RouterModule,
|
|
990
|
-
FormsModule,
|
|
991
|
-
CommonModule,
|
|
992
|
-
MatTooltipModule,
|
|
993
|
-
MatDialogModule,
|
|
994
|
-
MatButtonModule,
|
|
995
|
-
MatIconModule,
|
|
996
|
-
MatTabsModule,
|
|
997
|
-
FsListModule,
|
|
998
|
-
FsDialogModule,
|
|
999
|
-
FsLabelModule,
|
|
1000
|
-
FsDateModule,
|
|
1001
|
-
FsSkeletonModule,
|
|
1002
|
-
FsAppMessagesModule,
|
|
1003
|
-
FsFormModule,
|
|
1004
|
-
FsPromptInputModule,
|
|
1005
|
-
FsIFrameModule,
|
|
1006
|
-
FsMessageModule,
|
|
1007
|
-
],
|
|
1008
|
-
declarations: [
|
|
1009
|
-
QueuesComponent,
|
|
1010
|
-
QueueComponent,
|
|
1011
|
-
LinkifyPipe,
|
|
1012
|
-
TruncatePipe,
|
|
1013
|
-
RecipientComponent,
|
|
1014
|
-
],
|
|
1015
|
-
exports: [
|
|
1016
|
-
QueuesComponent,
|
|
1017
|
-
QueueComponent,
|
|
1018
|
-
],
|
|
1019
|
-
providers: [
|
|
1020
|
-
FsMessageQueueService,
|
|
1021
|
-
],
|
|
1022
|
-
}]
|
|
1023
|
-
}] });
|
|
1024
|
-
|
|
1025
|
-
class TemplateComponent {
|
|
1026
|
-
constructor(_data, _config, _dialogRef, _message, _dialog) {
|
|
1027
|
-
this._data = _data;
|
|
1028
|
-
this._config = _config;
|
|
1029
|
-
this._dialogRef = _dialogRef;
|
|
1030
|
-
this._message = _message;
|
|
1031
|
-
this._dialog = _dialog;
|
|
1032
|
-
this.htmlEditorconfig = {
|
|
1033
|
-
language: 'html',
|
|
1034
|
-
insertSpaces: true,
|
|
1035
|
-
tabSize: 2,
|
|
1036
|
-
};
|
|
1037
|
-
this.cssEditorconfig = {
|
|
1038
|
-
language: 'scss',
|
|
1039
|
-
insertSpaces: true,
|
|
1040
|
-
tabSize: 2,
|
|
1041
|
-
};
|
|
1042
|
-
this.save = (event) => {
|
|
1043
|
-
return this._config.saveMessageTemplate(this.messageTemplate)
|
|
1044
|
-
.pipe(tap((messageTemplate) => {
|
|
1045
|
-
this._message.success('Saved Changes');
|
|
1046
|
-
if (event.submitter === 'save-close') {
|
|
1047
|
-
this._dialogRef.close(messageTemplate);
|
|
1048
|
-
}
|
|
1049
|
-
}));
|
|
1050
|
-
};
|
|
1051
|
-
}
|
|
1052
|
-
ngOnInit() {
|
|
1053
|
-
if (this._data.messageTemplate.id) {
|
|
1054
|
-
this._config.loadMessageTemplate(this._data.messageTemplate)
|
|
1055
|
-
.subscribe(messageTemplate => {
|
|
1056
|
-
this.messageTemplate = messageTemplate;
|
|
1057
|
-
});
|
|
1058
|
-
}
|
|
1059
|
-
else {
|
|
1060
|
-
this.messageTemplate = {};
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1063
|
-
openPreview() {
|
|
1064
|
-
this._dialog.open(PreviewComponent, {
|
|
1065
|
-
data: {
|
|
1066
|
-
styles: this.messageTemplate.styles,
|
|
1067
|
-
html: this.messageTemplate.content,
|
|
1068
|
-
},
|
|
1069
|
-
width: '95%',
|
|
1070
|
-
});
|
|
1071
|
-
}
|
|
1072
|
-
}
|
|
1073
|
-
TemplateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TemplateComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: FS_APP_MESSAGE_CONFIG }, { token: i1.MatDialogRef }, { token: i1$1.FsMessage }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
|
1074
|
-
TemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TemplateComponent, selector: "ng-component", ngImport: i0, template: "<form\n fsForm\n [submit]=\"save\"\n #form=\"ngForm\"\n *fsSkeleton=\"messageTemplate\"\n [confirmTabs]=\"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 <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"messageTemplate.name\"\n required\n name=\"name\">\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 type=\"submit\" color=\"primary\" name=\"close\">Save</button>\n <button mat-button type=\"submit\" 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", styles: [".name{width:100%}:host ::ng-deep .mat-tab-body-content,:host ::ng-deep .mat-tab-body{overflow:visible}\n"], dependencies: [{ kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i5$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i6.MatTabContent, selector: "[matTabContent]" }, { kind: "component", type: i6.MatTab, selector: "mat-tab", inputs: ["disabled"], exportAs: ["matTab"] }, { kind: "component", type: i6.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple", "fitInkBarToContent", "mat-stretch-tabs"], exportAs: ["matTabGroup"] }, { kind: "component", type: i8.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8.MatLabel, selector: "mat-label" }, { kind: "directive", type: i9.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout", "dock", "dockable", "fullscreenPercent"] }, { kind: "component", type: i13.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { kind: "component", type: i13.FsLabelMessageComponent, selector: "fs-label-message" }, { kind: "directive", type: i11$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { kind: "directive", type: i12.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { kind: "directive", type: i12.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { kind: "directive", type: i12.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormGreaterEqual]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { kind: "directive", type: i12.FsButtonDirective, selector: "[mat-raised-button]:not([fsFormButtonStandalone]),[mat-button]:not([fsFormButtonStandalone]),[mat-flat-button]:not([fsFormButtonStandalone]),[mat-stroked-button]:not([fsFormButtonStandalone])", inputs: ["name", "dirtySubmit", "form"] }, { kind: "component", type: i16.FsTextEditorComponent, selector: "fs-text-editor", inputs: ["config", "scrollable"], outputs: ["ready", "blur"] }] });
|
|
1075
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TemplateComponent, decorators: [{
|
|
1076
|
-
type: Component,
|
|
1077
|
-
args: [{ template: "<form\n fsForm\n [submit]=\"save\"\n #form=\"ngForm\"\n *fsSkeleton=\"messageTemplate\"\n [confirmTabs]=\"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 <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"messageTemplate.name\"\n required\n name=\"name\">\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 type=\"submit\" color=\"primary\" name=\"close\">Save</button>\n <button mat-button type=\"submit\" 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", styles: [".name{width:100%}:host ::ng-deep .mat-tab-body-content,:host ::ng-deep .mat-tab-body{overflow:visible}\n"] }]
|
|
1078
|
-
}], ctorParameters: function () {
|
|
1079
|
-
return [{ type: undefined, decorators: [{
|
|
1080
|
-
type: Inject,
|
|
1081
|
-
args: [MAT_DIALOG_DATA]
|
|
1082
|
-
}] }, { type: undefined, decorators: [{
|
|
1083
|
-
type: Inject,
|
|
1084
|
-
args: [FS_APP_MESSAGE_CONFIG]
|
|
1085
|
-
}] }, { type: i1.MatDialogRef }, { type: i1$1.FsMessage }, { type: i1.MatDialog }];
|
|
1086
|
-
} });
|
|
1087
|
-
|
|
1088
|
-
class TemplatesComponent {
|
|
1089
|
-
constructor(_config, _dialog) {
|
|
1090
|
-
this._config = _config;
|
|
1091
|
-
this._dialog = _dialog;
|
|
1092
|
-
this.list = null;
|
|
1093
|
-
this.config = null;
|
|
1094
|
-
this.messageQueueStates = [];
|
|
1095
|
-
this._destroy$ = new Subject();
|
|
1096
|
-
}
|
|
1097
|
-
ngOnInit() {
|
|
1098
|
-
this.config = {
|
|
1099
|
-
actions: [
|
|
1100
|
-
{
|
|
1101
|
-
label: 'Create',
|
|
1102
|
-
click: () => {
|
|
1103
|
-
this.open({});
|
|
1104
|
-
}
|
|
1105
|
-
}
|
|
1106
|
-
],
|
|
1107
|
-
status: false,
|
|
1108
|
-
fetch: query => {
|
|
1109
|
-
return this._config.loadMessageTemplates(query);
|
|
1110
|
-
}
|
|
1111
|
-
};
|
|
1112
|
-
if (this._config.deleteMessageTemplate) {
|
|
1113
|
-
this.config.rowActions = [
|
|
1114
|
-
{
|
|
1115
|
-
click: data => {
|
|
1116
|
-
return this._config.deleteMessageTemplate(data);
|
|
1117
|
-
},
|
|
1118
|
-
remove: {
|
|
1119
|
-
title: 'Confirm',
|
|
1120
|
-
template: 'Are you sure you would like to delete this template?',
|
|
1121
|
-
},
|
|
1122
|
-
menu: true,
|
|
1123
|
-
label: 'Delete',
|
|
1124
|
-
},
|
|
1125
|
-
];
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
open(messageTemplate) {
|
|
1129
|
-
const dialogRef = this._dialog.open(TemplateComponent, {
|
|
1130
|
-
data: {
|
|
1131
|
-
messageTemplate,
|
|
1132
|
-
},
|
|
1133
|
-
width: '85%',
|
|
1134
|
-
});
|
|
1135
|
-
dialogRef.afterClosed()
|
|
1136
|
-
.pipe(takeUntil(this._destroy$))
|
|
1137
|
-
.subscribe(() => {
|
|
1138
|
-
this.list.reload();
|
|
1139
|
-
});
|
|
1140
|
-
}
|
|
1141
|
-
ngOnDestroy() {
|
|
1142
|
-
this._destroy$.next();
|
|
1143
|
-
this._destroy$.complete();
|
|
1144
|
-
}
|
|
1145
|
-
}
|
|
1146
|
-
TemplatesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TemplatesComponent, deps: [{ token: FS_APP_MESSAGE_CONFIG }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
|
1147
|
-
TemplatesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TemplatesComponent, selector: "fs-app-message-templates", viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true, static: true }], ngImport: i0, 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>", dependencies: [{ kind: "component", type: i2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { kind: "directive", type: i2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }] });
|
|
1148
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TemplatesComponent, decorators: [{
|
|
1149
|
-
type: Component,
|
|
1150
|
-
args: [{ selector: 'fs-app-message-templates', 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>" }]
|
|
1151
|
-
}], ctorParameters: function () {
|
|
1152
|
-
return [{ type: undefined, decorators: [{
|
|
1153
|
-
type: Inject,
|
|
1154
|
-
args: [FS_APP_MESSAGE_CONFIG]
|
|
1155
|
-
}] }, { type: i1.MatDialog }];
|
|
1156
|
-
}, propDecorators: { list: [{
|
|
1157
|
-
type: ViewChild,
|
|
1158
|
-
args: [FsListComponent, { static: true }]
|
|
1159
|
-
}] } });
|
|
1160
|
-
|
|
1161
|
-
class FsAppMessageTemplatesModule {
|
|
1162
|
-
}
|
|
1163
|
-
FsAppMessageTemplatesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessageTemplatesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1164
|
-
FsAppMessageTemplatesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessageTemplatesModule, declarations: [TemplatesComponent,
|
|
1165
|
-
TemplateComponent], imports: [RouterModule,
|
|
1166
|
-
CommonModule,
|
|
1167
|
-
FormsModule,
|
|
1168
|
-
MatTooltipModule,
|
|
1169
|
-
MatDialogModule,
|
|
1170
|
-
MatButtonModule,
|
|
1171
|
-
MatTabsModule,
|
|
1172
|
-
MatFormFieldModule,
|
|
1173
|
-
MatFormFieldModule,
|
|
1174
|
-
MatInputModule,
|
|
1175
|
-
FsListModule,
|
|
1176
|
-
FsDialogModule,
|
|
1177
|
-
FsLabelModule,
|
|
1178
|
-
FsSkeletonModule,
|
|
1179
|
-
FsFormModule,
|
|
1180
|
-
FsTextEditorModule,
|
|
1181
|
-
FsAppMessagePreviewModule], exports: [TemplatesComponent,
|
|
1182
|
-
TemplateComponent] });
|
|
1183
|
-
FsAppMessageTemplatesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessageTemplatesModule, imports: [RouterModule,
|
|
1184
|
-
CommonModule,
|
|
1185
|
-
FormsModule,
|
|
1186
|
-
MatTooltipModule,
|
|
1187
|
-
MatDialogModule,
|
|
1188
|
-
MatButtonModule,
|
|
1189
|
-
MatTabsModule,
|
|
1190
|
-
MatFormFieldModule,
|
|
1191
|
-
MatFormFieldModule,
|
|
1192
|
-
MatInputModule,
|
|
1193
|
-
FsListModule,
|
|
1194
|
-
FsDialogModule,
|
|
1195
|
-
FsLabelModule,
|
|
1196
|
-
FsSkeletonModule,
|
|
1197
|
-
FsFormModule,
|
|
1198
|
-
FsTextEditorModule,
|
|
1199
|
-
FsAppMessagePreviewModule] });
|
|
1200
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessageTemplatesModule, decorators: [{
|
|
1201
|
-
type: NgModule,
|
|
1202
|
-
args: [{
|
|
1203
|
-
imports: [
|
|
1204
|
-
RouterModule,
|
|
1205
|
-
CommonModule,
|
|
1206
|
-
FormsModule,
|
|
1207
|
-
MatTooltipModule,
|
|
1208
|
-
MatDialogModule,
|
|
1209
|
-
MatButtonModule,
|
|
1210
|
-
MatTabsModule,
|
|
1211
|
-
MatFormFieldModule,
|
|
1212
|
-
MatFormFieldModule,
|
|
1213
|
-
MatInputModule,
|
|
1214
|
-
FsListModule,
|
|
1215
|
-
FsDialogModule,
|
|
1216
|
-
FsLabelModule,
|
|
1217
|
-
FsSkeletonModule,
|
|
1218
|
-
FsFormModule,
|
|
1219
|
-
FsTextEditorModule,
|
|
1220
|
-
FsAppMessagePreviewModule,
|
|
1221
|
-
],
|
|
1222
|
-
declarations: [
|
|
1223
|
-
TemplatesComponent,
|
|
1224
|
-
TemplateComponent,
|
|
1225
|
-
],
|
|
1226
|
-
exports: [
|
|
1227
|
-
TemplatesComponent,
|
|
1228
|
-
TemplateComponent,
|
|
1229
|
-
],
|
|
1230
|
-
}]
|
|
1231
|
-
}] });
|
|
1232
|
-
|
|
1233
|
-
class WebhooksComponent {
|
|
1234
|
-
constructor(_config, _message) {
|
|
1235
|
-
this._config = _config;
|
|
1236
|
-
this._message = _message;
|
|
1237
|
-
}
|
|
1238
|
-
ngOnInit() {
|
|
1239
|
-
this.listConfig = {
|
|
1240
|
-
paging: false,
|
|
1241
|
-
actions: [
|
|
1242
|
-
{
|
|
1243
|
-
click: () => {
|
|
1244
|
-
this._config.createWebhook()
|
|
1245
|
-
.subscribe(() => {
|
|
1246
|
-
this._message.success('Created webhook');
|
|
1247
|
-
this.list.reload();
|
|
1248
|
-
});
|
|
1249
|
-
},
|
|
1250
|
-
label: 'Create',
|
|
1251
|
-
},
|
|
1252
|
-
],
|
|
1253
|
-
rowActions: [
|
|
1254
|
-
{
|
|
1255
|
-
click: (webhook) => {
|
|
1256
|
-
this._config.deleteWebhook(webhook)
|
|
1257
|
-
.subscribe(() => {
|
|
1258
|
-
this._message.success('Deleted webhook');
|
|
1259
|
-
this.list.reload();
|
|
1260
|
-
});
|
|
1261
|
-
},
|
|
1262
|
-
label: 'Delete',
|
|
1263
|
-
},
|
|
1264
|
-
],
|
|
1265
|
-
fetch: () => {
|
|
1266
|
-
return this._config.loadWebhooks({
|
|
1267
|
-
domain: window.location.hostname,
|
|
1268
|
-
})
|
|
1269
|
-
.pipe(map((webhooks) => ({ data: webhooks })));
|
|
1270
|
-
},
|
|
1271
|
-
};
|
|
1272
|
-
}
|
|
1273
|
-
}
|
|
1274
|
-
WebhooksComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WebhooksComponent, deps: [{ token: FS_APP_MESSAGE_CONFIG }, { token: i1$1.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
|
|
1275
|
-
WebhooksComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: WebhooksComponent, selector: "fs-app-message-webhooks", viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, 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>", dependencies: [{ kind: "component", type: i2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { kind: "directive", type: i2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "pipe", type: i10$1.FsDatePipe, name: "fsDate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1276
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WebhooksComponent, decorators: [{
|
|
1277
|
-
type: Component,
|
|
1278
|
-
args: [{ selector: 'fs-app-message-webhooks', changeDetection: ChangeDetectionStrategy.OnPush, 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>" }]
|
|
1279
|
-
}], ctorParameters: function () {
|
|
1280
|
-
return [{ type: undefined, decorators: [{
|
|
1281
|
-
type: Inject,
|
|
1282
|
-
args: [FS_APP_MESSAGE_CONFIG]
|
|
1283
|
-
}] }, { type: i1$1.FsMessage }];
|
|
1284
|
-
}, propDecorators: { list: [{
|
|
1285
|
-
type: ViewChild,
|
|
1286
|
-
args: [FsListComponent]
|
|
1287
|
-
}] } });
|
|
1288
|
-
|
|
1289
|
-
class FsAppMessageWebhooksModule {
|
|
1290
|
-
}
|
|
1291
|
-
FsAppMessageWebhooksModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessageWebhooksModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1292
|
-
FsAppMessageWebhooksModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessageWebhooksModule, declarations: [WebhooksComponent], imports: [FsListModule,
|
|
1293
|
-
FsDateModule], exports: [WebhooksComponent] });
|
|
1294
|
-
FsAppMessageWebhooksModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessageWebhooksModule, imports: [FsListModule,
|
|
1295
|
-
FsDateModule] });
|
|
1296
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAppMessageWebhooksModule, decorators: [{
|
|
1297
|
-
type: NgModule,
|
|
1298
|
-
args: [{
|
|
1299
|
-
imports: [
|
|
1300
|
-
FsListModule,
|
|
1301
|
-
FsDateModule,
|
|
1302
|
-
],
|
|
1303
|
-
declarations: [
|
|
1304
|
-
WebhooksComponent,
|
|
1305
|
-
],
|
|
1306
|
-
exports: [
|
|
1307
|
-
WebhooksComponent,
|
|
1308
|
-
],
|
|
1309
|
-
}]
|
|
1310
|
-
}] });
|
|
1311
|
-
|
|
1312
|
-
/**
|
|
1313
|
-
* Generated bundle index. Do not edit.
|
|
1314
|
-
*/
|
|
1315
|
-
|
|
1316
|
-
export { FS_APP_MESSAGE_CONFIG, FsAppMessageModule, FsAppMessageQueuesModule, FsAppMessageTemplatesModule, FsAppMessageWebhooksModule, FsAppMessagesModule, FsMessageQueueService, MessageComponent, MessageQueueType, MessagesComponent, QueueComponent, QueuesComponent, TemplateComponent, TemplatesComponent, WebhooksComponent };
|
|
1317
|
-
//# sourceMappingURL=firestitch-app-message.mjs.map
|