@firestitch/app-message 13.1.0 → 13.1.2

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