@firestitch/app-message 13.0.6 → 13.0.7

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