@firestitch/app-message 12.4.0 → 12.5.0

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