@firestitch/app-message 13.0.1 → 13.0.2

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