@adlfe/campaign-management-library 2.11.3 → 2.11.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/adlfe-campaign-management-library.d.ts +6 -4
- package/adlfe-campaign-management-library.metadata.json +1 -1
- package/bundles/adlfe-campaign-management-library.umd.js +285 -86
- package/bundles/adlfe-campaign-management-library.umd.js.map +1 -1
- package/bundles/adlfe-campaign-management-library.umd.min.js +1 -1
- package/bundles/adlfe-campaign-management-library.umd.min.js.map +1 -1
- package/esm2015/adlfe-campaign-management-library.js +7 -5
- package/esm2015/lib/campaign-management/campaign-management.module.js +4 -2
- package/esm2015/lib/campaign-management/components/input-numeric/input-numeric.component.js +113 -0
- package/esm2015/lib/campaign-management/components/input-numeric/input-numeric.module.js +18 -0
- package/esm2015/lib/campaign-management/models/general-information-wa-req.model.js +2 -1
- package/esm2015/lib/campaign-management/modules/campaign-index/dialog/pending-approval-dialog-view/pending-approval-dialog-view.component.js +40 -38
- package/esm2015/lib/campaign-management/modules/new-campaign/components/general-information-wa/general-information-wa.component.js +17 -7
- package/esm2015/lib/campaign-management/modules/new-campaign/new-campaign.component.js +41 -39
- package/esm2015/lib/campaign-management/validators/index.js +12 -0
- package/esm2015/lib/campaign-management/validators/max.validator.js +14 -0
- package/esm2015/lib/campaign-management/validators/min.validator.js +14 -0
- package/esm2015/lib/campaign-management/validators/required.validator.js +10 -0
- package/esm2015/lib/core/const/validation-message.const.js +5 -2
- package/esm5/adlfe-campaign-management-library.js +7 -5
- package/esm5/lib/campaign-management/campaign-management.module.js +4 -2
- package/esm5/lib/campaign-management/components/input-numeric/input-numeric.component.js +127 -0
- package/esm5/lib/campaign-management/components/input-numeric/input-numeric.module.js +21 -0
- package/esm5/lib/campaign-management/models/general-information-wa-req.model.js +2 -1
- package/esm5/lib/campaign-management/modules/campaign-index/dialog/pending-approval-dialog-view/pending-approval-dialog-view.component.js +40 -38
- package/esm5/lib/campaign-management/modules/new-campaign/components/general-information-wa/general-information-wa.component.js +17 -7
- package/esm5/lib/campaign-management/modules/new-campaign/new-campaign.component.js +41 -39
- package/esm5/lib/campaign-management/validators/index.js +12 -0
- package/esm5/lib/campaign-management/validators/max.validator.js +14 -0
- package/esm5/lib/campaign-management/validators/min.validator.js +14 -0
- package/esm5/lib/campaign-management/validators/required.validator.js +10 -0
- package/esm5/lib/core/const/validation-message.const.js +5 -2
- package/fesm2015/adlfe-campaign-management-library.js +345 -165
- package/fesm2015/adlfe-campaign-management-library.js.map +1 -1
- package/fesm5/adlfe-campaign-management-library.js +362 -165
- package/fesm5/adlfe-campaign-management-library.js.map +1 -1
- package/lib/campaign-management/components/input-numeric/input-numeric.component.d.ts +30 -0
- package/lib/campaign-management/components/input-numeric/input-numeric.module.d.ts +2 -0
- package/lib/campaign-management/models/general-information-wa-req.model.d.ts +1 -0
- package/lib/campaign-management/validators/index.d.ts +8 -0
- package/lib/campaign-management/validators/max.validator.d.ts +2 -0
- package/lib/campaign-management/validators/min.validator.d.ts +2 -0
- package/lib/campaign-management/validators/required.validator.d.ts +2 -0
- package/package.json +1 -1
- package/types.d.ts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __extends, __assign, __spread, __param, __values } from 'tslib';
|
|
2
|
-
import { Component, EventEmitter, Output, Input, NgModule, NgZone, Directive, ɵɵdefineInjectable, ɵɵinject, Injectable, Inject, ViewChild } from '@angular/core';
|
|
2
|
+
import { Component, EventEmitter, Output, Input, NgModule, ContentChild, forwardRef, NgZone, Directive, ɵɵdefineInjectable, ɵɵinject, Injectable, Inject, ViewChild } from '@angular/core';
|
|
3
3
|
import { MapsAPILoader, AgmCoreModule } from '@agm/core';
|
|
4
4
|
import { CommonModule, DatePipe } from '@angular/common';
|
|
5
5
|
import { HttpHeaders, HttpClient, HttpParams, HttpClientModule } from '@angular/common/http';
|
|
@@ -8,7 +8,7 @@ import { MatPaginatorIntl, MatPaginatorModule } from '@angular/material/paginato
|
|
|
8
8
|
import { NgxEchartsModule } from 'ngx-echarts';
|
|
9
9
|
import { ToastrService, ToastrModule } from 'ngx-toastr';
|
|
10
10
|
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
11
|
-
import { FormControl, FormsModule, ReactiveFormsModule, FormGroup, Validators, FormArray } from '@angular/forms';
|
|
11
|
+
import { FormControl, FormsModule, ReactiveFormsModule, ControlContainer, NG_VALUE_ACCESSOR, FormGroup, Validators as Validators$1, FormArray } from '@angular/forms';
|
|
12
12
|
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
13
13
|
import { MatBadgeModule } from '@angular/material/badge';
|
|
14
14
|
import { MatButtonModule } from '@angular/material/button';
|
|
@@ -164,6 +164,142 @@ var CampaignManagementComponent = /** @class */ (function () {
|
|
|
164
164
|
return CampaignManagementComponent;
|
|
165
165
|
}());
|
|
166
166
|
|
|
167
|
+
var InputNumericComponent = /** @class */ (function () {
|
|
168
|
+
function InputNumericComponent(controlContainer) {
|
|
169
|
+
this.controlContainer = controlContainer;
|
|
170
|
+
this.allowDecimal = true;
|
|
171
|
+
}
|
|
172
|
+
InputNumericComponent_1 = InputNumericComponent;
|
|
173
|
+
InputNumericComponent.prototype.handleInput = function (event) {
|
|
174
|
+
var inputElement = event.target;
|
|
175
|
+
var value = inputElement.value || '';
|
|
176
|
+
var numeric = this.allowDecimal ? value.replace(/[^0-9.]/g, '') : value.replace(/\D/g, '');
|
|
177
|
+
if (this.allowDecimal) {
|
|
178
|
+
var parts = numeric.split('.');
|
|
179
|
+
if (parts.length > 2) {
|
|
180
|
+
numeric = parts[0] + '.' + parts.slice(1).join('');
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (this.disallowLeadingZero &&
|
|
184
|
+
numeric.startsWith('0') &&
|
|
185
|
+
numeric.length > 1 &&
|
|
186
|
+
numeric[1] !== '.') {
|
|
187
|
+
numeric = numeric.replace(/^0+/, '');
|
|
188
|
+
}
|
|
189
|
+
var finalValue = numeric;
|
|
190
|
+
if (this.trimLeadingZeros && numeric !== '' && !numeric.includes('.')) {
|
|
191
|
+
finalValue = +numeric;
|
|
192
|
+
}
|
|
193
|
+
this.formControl.patchValue(finalValue, { emitEvent: false });
|
|
194
|
+
};
|
|
195
|
+
InputNumericComponent.prototype.ngOnInit = function () {
|
|
196
|
+
this.setBaseStateInitialization();
|
|
197
|
+
};
|
|
198
|
+
InputNumericComponent.prototype.setBaseStateInitialization = function () {
|
|
199
|
+
if (!this.formControlName)
|
|
200
|
+
return;
|
|
201
|
+
var formGroup = this.controlContainer.control;
|
|
202
|
+
this.formControl = formGroup.get(this.formControlName);
|
|
203
|
+
};
|
|
204
|
+
Object.defineProperty(InputNumericComponent.prototype, "isValid", {
|
|
205
|
+
get: function () {
|
|
206
|
+
var _a, _b;
|
|
207
|
+
return !!(((_a = this.formControl) === null || _a === void 0 ? void 0 : _a.touched) && ((_b = this.formControl) === null || _b === void 0 ? void 0 : _b.valid));
|
|
208
|
+
},
|
|
209
|
+
enumerable: true,
|
|
210
|
+
configurable: true
|
|
211
|
+
});
|
|
212
|
+
Object.defineProperty(InputNumericComponent.prototype, "isInvalid", {
|
|
213
|
+
get: function () {
|
|
214
|
+
var _a, _b;
|
|
215
|
+
return !!(((_a = this.formControl) === null || _a === void 0 ? void 0 : _a.touched) && ((_b = this.formControl) === null || _b === void 0 ? void 0 : _b.invalid));
|
|
216
|
+
},
|
|
217
|
+
enumerable: true,
|
|
218
|
+
configurable: true
|
|
219
|
+
});
|
|
220
|
+
Object.defineProperty(InputNumericComponent.prototype, "errors", {
|
|
221
|
+
get: function () {
|
|
222
|
+
return this.formControl.errors;
|
|
223
|
+
},
|
|
224
|
+
enumerable: true,
|
|
225
|
+
configurable: true
|
|
226
|
+
});
|
|
227
|
+
InputNumericComponent.prototype.writeValue = function (value) {
|
|
228
|
+
this._value = value;
|
|
229
|
+
};
|
|
230
|
+
InputNumericComponent.prototype.registerOnChange = function (fn) {
|
|
231
|
+
this._onBaseChange = fn;
|
|
232
|
+
};
|
|
233
|
+
InputNumericComponent.prototype.registerOnTouched = function (fn) {
|
|
234
|
+
this._onBaseTouched = fn;
|
|
235
|
+
};
|
|
236
|
+
InputNumericComponent.prototype.setDisabledState = function (isDisabled) {
|
|
237
|
+
this._isDisabled = isDisabled;
|
|
238
|
+
};
|
|
239
|
+
var InputNumericComponent_1;
|
|
240
|
+
InputNumericComponent.ctorParameters = function () { return [
|
|
241
|
+
{ type: ControlContainer }
|
|
242
|
+
]; };
|
|
243
|
+
__decorate([
|
|
244
|
+
Input()
|
|
245
|
+
], InputNumericComponent.prototype, "formControlName", void 0);
|
|
246
|
+
__decorate([
|
|
247
|
+
Input()
|
|
248
|
+
], InputNumericComponent.prototype, "formControl", void 0);
|
|
249
|
+
__decorate([
|
|
250
|
+
Input()
|
|
251
|
+
], InputNumericComponent.prototype, "trimLeadingZeros", void 0);
|
|
252
|
+
__decorate([
|
|
253
|
+
Input()
|
|
254
|
+
], InputNumericComponent.prototype, "disallowLeadingZero", void 0);
|
|
255
|
+
__decorate([
|
|
256
|
+
Input()
|
|
257
|
+
], InputNumericComponent.prototype, "allowDecimal", void 0);
|
|
258
|
+
__decorate([
|
|
259
|
+
Input()
|
|
260
|
+
], InputNumericComponent.prototype, "identifier", void 0);
|
|
261
|
+
__decorate([
|
|
262
|
+
Input()
|
|
263
|
+
], InputNumericComponent.prototype, "placeholder", void 0);
|
|
264
|
+
__decorate([
|
|
265
|
+
Input()
|
|
266
|
+
], InputNumericComponent.prototype, "label", void 0);
|
|
267
|
+
__decorate([
|
|
268
|
+
Input()
|
|
269
|
+
], InputNumericComponent.prototype, "maxLength", void 0);
|
|
270
|
+
__decorate([
|
|
271
|
+
ContentChild('suffix')
|
|
272
|
+
], InputNumericComponent.prototype, "suffixTmpl", void 0);
|
|
273
|
+
InputNumericComponent = InputNumericComponent_1 = __decorate([
|
|
274
|
+
Component({
|
|
275
|
+
selector: 'app-input[type=numeric]',
|
|
276
|
+
template: "<div class=\"grid\">\r\n <mat-form-field class=\"w-full\" appearance=\"outline\" floatLabel=\"always\">\r\n <mat-label *ngIf=\"label\">\r\n <span>{{ label }}</span>\r\n </mat-label>\r\n <input\r\n type=\"text\"\r\n [id]=\"identifier\"\r\n [attr.data-testid]=\"identifier\"\r\n matInput\r\n [placeholder]=\"placeholder\"\r\n [formControl]=\"formControl\"\r\n (input)=\"handleInput($event)\"\r\n [attr.maxlength]=\"maxLength\"\r\n />\r\n <span *ngIf=\"suffixTmpl\" matSuffix>\r\n <ng-container *ngTemplateOutlet=\"suffixTmpl\"></ng-container>\r\n </span>\r\n </mat-form-field>\r\n <mat-error align=\"end\" class=\"leading-zero\" *ngIf=\"isInvalid\">\r\n <small class=\"text-xs\">\r\n {{ errors?.message }}\r\n </small>\r\n </mat-error>\r\n</div>\r\n",
|
|
277
|
+
providers: [
|
|
278
|
+
{
|
|
279
|
+
provide: NG_VALUE_ACCESSOR,
|
|
280
|
+
useExisting: forwardRef(function () { return InputNumericComponent_1; }),
|
|
281
|
+
multi: true,
|
|
282
|
+
},
|
|
283
|
+
],
|
|
284
|
+
styles: [":host ::ng-deep .mat-form-field-appearance-outline .mat-form-field-prefix,:host ::ng-deep .mat-form-field-appearance-outline .mat-form-field-suffix{top:0}"]
|
|
285
|
+
})
|
|
286
|
+
], InputNumericComponent);
|
|
287
|
+
return InputNumericComponent;
|
|
288
|
+
}());
|
|
289
|
+
|
|
290
|
+
var InputNumericModule = /** @class */ (function () {
|
|
291
|
+
function InputNumericModule() {
|
|
292
|
+
}
|
|
293
|
+
InputNumericModule = __decorate([
|
|
294
|
+
NgModule({
|
|
295
|
+
imports: [MatFormFieldModule, MatInputModule, ReactiveFormsModule, CommonModule],
|
|
296
|
+
declarations: [InputNumericComponent],
|
|
297
|
+
exports: [InputNumericComponent],
|
|
298
|
+
})
|
|
299
|
+
], InputNumericModule);
|
|
300
|
+
return InputNumericModule;
|
|
301
|
+
}());
|
|
302
|
+
|
|
167
303
|
var MatSelectInfiniteScrollDirective = /** @class */ (function () {
|
|
168
304
|
function MatSelectInfiniteScrollDirective(matSelect, ngZone) {
|
|
169
305
|
this.matSelect = matSelect;
|
|
@@ -1287,7 +1423,10 @@ var GeneralInformationMessageValidationConst = {
|
|
|
1287
1423
|
var GeneralInformationWAMessageValidationConst = {
|
|
1288
1424
|
channel: [{ type: 'required', message: 'Message Type is required' }],
|
|
1289
1425
|
from: [{ type: 'required', message: 'From is required' }],
|
|
1290
|
-
text: [
|
|
1426
|
+
text: [
|
|
1427
|
+
{ type: 'required', message: 'Text is required' },
|
|
1428
|
+
{ type: 'maxlength', message: 'Maximum character 1024' },
|
|
1429
|
+
],
|
|
1291
1430
|
media: [{ type: 'required', message: 'Media Type is required' }],
|
|
1292
1431
|
fileName: [{ type: 'required', message: 'File is required' }],
|
|
1293
1432
|
template: [{ type: 'required', message: 'Template is required' }],
|
|
@@ -1682,7 +1821,7 @@ var PendingApprovalDialogViewComponent = /** @class */ (function () {
|
|
|
1682
1821
|
var subs = this.apiAdapterService
|
|
1683
1822
|
.executeApiRequest([], "/campaign/" + ((_d = (_c = this.getCampaignStorage) === null || _c === void 0 ? void 0 : _c.generalInformation) === null || _d === void 0 ? void 0 : _d.id), 'GET')
|
|
1684
1823
|
.subscribe(function (resp) {
|
|
1685
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63;
|
|
1824
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67;
|
|
1686
1825
|
if (!resp)
|
|
1687
1826
|
return;
|
|
1688
1827
|
var generalInformation = {
|
|
@@ -1694,59 +1833,61 @@ var PendingApprovalDialogViewComponent = /** @class */ (function () {
|
|
|
1694
1833
|
: (_f = (_e = resp.data) === null || _e === void 0 ? void 0 : _e.type) === null || _f === void 0 ? void 0 : _f.toUpperCase(),
|
|
1695
1834
|
media: (_h = (_g = resp.data) === null || _g === void 0 ? void 0 : _g.type) === null || _h === void 0 ? void 0 : _h.toUpperCase(),
|
|
1696
1835
|
isPrevTemplate: (_k = (_j = resp) === null || _j === void 0 ? void 0 : _j.data) === null || _k === void 0 ? void 0 : _k.isPrevTemplate,
|
|
1836
|
+
templateName: (_m = (_l = resp) === null || _l === void 0 ? void 0 : _l.data) === null || _m === void 0 ? void 0 : _m.templateName,
|
|
1837
|
+
ttl: (_p = (_o = resp) === null || _o === void 0 ? void 0 : _o.data) === null || _p === void 0 ? void 0 : _p.ttlSeconds,
|
|
1697
1838
|
from: {
|
|
1698
|
-
id: (
|
|
1699
|
-
name: (
|
|
1700
|
-
platform: (
|
|
1701
|
-
clientId: (
|
|
1702
|
-
clientName: (
|
|
1703
|
-
accountNo: (
|
|
1704
|
-
wabaId: (
|
|
1839
|
+
id: (_q = resp.data) === null || _q === void 0 ? void 0 : _q.accountId,
|
|
1840
|
+
name: (_r = resp.data) === null || _r === void 0 ? void 0 : _r.accountName,
|
|
1841
|
+
platform: (_s = resp.data) === null || _s === void 0 ? void 0 : _s.platform,
|
|
1842
|
+
clientId: (_t = resp.data) === null || _t === void 0 ? void 0 : _t.clientId,
|
|
1843
|
+
clientName: (_u = resp.data) === null || _u === void 0 ? void 0 : _u.clientName,
|
|
1844
|
+
accountNo: (_v = resp.data) === null || _v === void 0 ? void 0 : _v.accountNo,
|
|
1845
|
+
wabaId: (_x = (_w = resp.data) === null || _w === void 0 ? void 0 : _w.wabaId, (_x !== null && _x !== void 0 ? _x : '')),
|
|
1705
1846
|
},
|
|
1706
|
-
text: (
|
|
1707
|
-
targetURL: (
|
|
1708
|
-
paramHeader: (
|
|
1709
|
-
paramBody: (
|
|
1710
|
-
paramButton: (
|
|
1711
|
-
otpValue: (
|
|
1847
|
+
text: (_z = (_y = resp.data) === null || _y === void 0 ? void 0 : _y.details) === null || _z === void 0 ? void 0 : _z.text,
|
|
1848
|
+
targetURL: (_11 = (_7 = (_3 = (_2 = (_1 = (_0 = resp.data) === null || _0 === void 0 ? void 0 : _0.details) === null || _1 === void 0 ? void 0 : _1.image) === null || _2 === void 0 ? void 0 : _2.url, (_3 !== null && _3 !== void 0 ? _3 : (_6 = (_5 = (_4 = resp.data) === null || _4 === void 0 ? void 0 : _4.details) === null || _5 === void 0 ? void 0 : _5.document) === null || _6 === void 0 ? void 0 : _6.url)), (_7 !== null && _7 !== void 0 ? _7 : (_10 = (_9 = (_8 = resp.data) === null || _8 === void 0 ? void 0 : _8.details) === null || _9 === void 0 ? void 0 : _9.video) === null || _10 === void 0 ? void 0 : _10.url)), (_11 !== null && _11 !== void 0 ? _11 : (_14 = (_13 = (_12 = resp.data) === null || _12 === void 0 ? void 0 : _12.details) === null || _13 === void 0 ? void 0 : _13.template) === null || _14 === void 0 ? void 0 : _14.headerURL)),
|
|
1849
|
+
paramHeader: (_17 = (_16 = (_15 = resp.data) === null || _15 === void 0 ? void 0 : _15.details) === null || _16 === void 0 ? void 0 : _16.template) === null || _17 === void 0 ? void 0 : _17.header,
|
|
1850
|
+
paramBody: (_20 = (_19 = (_18 = resp.data) === null || _18 === void 0 ? void 0 : _18.details) === null || _19 === void 0 ? void 0 : _19.template) === null || _20 === void 0 ? void 0 : _20.data,
|
|
1851
|
+
paramButton: (_23 = (_22 = (_21 = resp.data) === null || _21 === void 0 ? void 0 : _21.details) === null || _22 === void 0 ? void 0 : _22.template) === null || _23 === void 0 ? void 0 : _23.button,
|
|
1852
|
+
otpValue: (_28 = __spread((_27 = (_26 = (_25 = (_24 = resp.data) === null || _24 === void 0 ? void 0 : _24.details) === null || _25 === void 0 ? void 0 : _25.template) === null || _26 === void 0 ? void 0 : _26.data, (_27 !== null && _27 !== void 0 ? _27 : [])))) === null || _28 === void 0 ? void 0 : _28.pop(),
|
|
1712
1853
|
template: {
|
|
1713
|
-
ID: (
|
|
1714
|
-
name: (
|
|
1715
|
-
lang: (
|
|
1716
|
-
platform: (
|
|
1717
|
-
headerURL: (
|
|
1854
|
+
ID: (_31 = (_30 = (_29 = resp.data) === null || _29 === void 0 ? void 0 : _29.details) === null || _30 === void 0 ? void 0 : _30.template) === null || _31 === void 0 ? void 0 : _31.id,
|
|
1855
|
+
name: (_34 = (_33 = (_32 = resp.data) === null || _32 === void 0 ? void 0 : _32.details) === null || _33 === void 0 ? void 0 : _33.template) === null || _34 === void 0 ? void 0 : _34.name,
|
|
1856
|
+
lang: (_37 = (_36 = (_35 = resp.data) === null || _35 === void 0 ? void 0 : _35.details) === null || _36 === void 0 ? void 0 : _36.template) === null || _37 === void 0 ? void 0 : _37.lang,
|
|
1857
|
+
platform: (_38 = resp.data) === null || _38 === void 0 ? void 0 : _38.platform,
|
|
1858
|
+
headerURL: (_41 = (_40 = (_39 = resp.data) === null || _39 === void 0 ? void 0 : _39.details) === null || _40 === void 0 ? void 0 : _40.template) === null || _41 === void 0 ? void 0 : _41.headerURL,
|
|
1718
1859
|
header: {
|
|
1719
|
-
examples: (
|
|
1860
|
+
examples: (_44 = (_43 = (_42 = resp.data) === null || _42 === void 0 ? void 0 : _42.details) === null || _43 === void 0 ? void 0 : _43.template) === null || _44 === void 0 ? void 0 : _44.header,
|
|
1720
1861
|
},
|
|
1721
1862
|
body: {
|
|
1722
|
-
examples: (
|
|
1863
|
+
examples: (_47 = (_46 = (_45 = resp.data) === null || _45 === void 0 ? void 0 : _45.details) === null || _46 === void 0 ? void 0 : _46.template) === null || _47 === void 0 ? void 0 : _47.data,
|
|
1723
1864
|
},
|
|
1724
|
-
buttons: (
|
|
1725
|
-
ClientId: (
|
|
1726
|
-
ClientName: (
|
|
1865
|
+
buttons: (_50 = (_49 = (_48 = resp.data) === null || _48 === void 0 ? void 0 : _48.details) === null || _49 === void 0 ? void 0 : _49.template) === null || _50 === void 0 ? void 0 : _50.button,
|
|
1866
|
+
ClientId: (_51 = resp.data) === null || _51 === void 0 ? void 0 : _51.clientId,
|
|
1867
|
+
ClientName: (_52 = resp.data) === null || _52 === void 0 ? void 0 : _52.clientName,
|
|
1727
1868
|
},
|
|
1728
|
-
isUpload: ((
|
|
1729
|
-
fileId: (
|
|
1869
|
+
isUpload: ((_53 = resp.data) === null || _53 === void 0 ? void 0 : _53.fileId) !== '',
|
|
1870
|
+
fileId: (_54 = resp.data) === null || _54 === void 0 ? void 0 : _54.fileId,
|
|
1730
1871
|
};
|
|
1731
1872
|
localStorage.setItem('telin.campaign', JSON.stringify(__assign(__assign({}, _this.getCampaignStorage), {
|
|
1732
1873
|
generalInformation: {
|
|
1733
|
-
id: (
|
|
1874
|
+
id: (_55 = resp.data) === null || _55 === void 0 ? void 0 : _55.id,
|
|
1734
1875
|
form: generalInformation,
|
|
1735
1876
|
},
|
|
1736
|
-
failover: (
|
|
1737
|
-
targetAudience: (
|
|
1877
|
+
failover: (_56 = resp.data) === null || _56 === void 0 ? void 0 : _56.failover,
|
|
1878
|
+
targetAudience: (_57 = resp.data) === null || _57 === void 0 ? void 0 : _57.targets,
|
|
1738
1879
|
targetAudienceFile: {
|
|
1739
|
-
name: (
|
|
1740
|
-
targetURL: (
|
|
1880
|
+
name: (_58 = resp.data) === null || _58 === void 0 ? void 0 : _58.fileName,
|
|
1881
|
+
targetURL: (_59 = resp.data) === null || _59 === void 0 ? void 0 : _59.targetURL,
|
|
1741
1882
|
},
|
|
1742
1883
|
scheduler: {
|
|
1743
|
-
schedulerType: ((
|
|
1884
|
+
schedulerType: ((_60 = resp.data) === null || _60 === void 0 ? void 0 : _60.scheduleType) === 'MULTI'
|
|
1744
1885
|
? 'ONE_TIME'
|
|
1745
|
-
: (
|
|
1746
|
-
startDate: (
|
|
1747
|
-
startTime: (
|
|
1748
|
-
isRepeat: ((
|
|
1749
|
-
delivery: (
|
|
1886
|
+
: (_61 = resp.data) === null || _61 === void 0 ? void 0 : _61.scheduleType,
|
|
1887
|
+
startDate: (_63 = (_62 = resp.data) === null || _62 === void 0 ? void 0 : _62.startTime) === null || _63 === void 0 ? void 0 : _63.split(' ')[0],
|
|
1888
|
+
startTime: (_65 = (_64 = resp.data) === null || _64 === void 0 ? void 0 : _64.startTime) === null || _65 === void 0 ? void 0 : _65.split(' ')[1],
|
|
1889
|
+
isRepeat: ((_66 = resp.data) === null || _66 === void 0 ? void 0 : _66.scheduleType) === 'MULTI',
|
|
1890
|
+
delivery: (_67 = resp.data) === null || _67 === void 0 ? void 0 : _67.repeat,
|
|
1750
1891
|
},
|
|
1751
1892
|
})));
|
|
1752
1893
|
_this.isLoading = false;
|
|
@@ -2428,6 +2569,7 @@ var GeneralInformationWAReqModel = /** @class */ (function () {
|
|
|
2428
2569
|
this.category = 'utility';
|
|
2429
2570
|
this.template = ((_l = source) === null || _l === void 0 ? void 0 : _l.isUseExistingTemplate) ? (_m = source) === null || _m === void 0 ? void 0 : _m.template : { name: '', lang: 'id', header: null, button: null, data: [] };
|
|
2430
2571
|
this.isNeedSave = source.isNeedSave;
|
|
2572
|
+
this.ttlSeconds = source.ttl;
|
|
2431
2573
|
if ((_o = source) === null || _o === void 0 ? void 0 : _o.isUseExistingTemplate) {
|
|
2432
2574
|
this.text = (_r = (_q = (_p = source) === null || _p === void 0 ? void 0 : _p.template) === null || _q === void 0 ? void 0 : _q.body) === null || _r === void 0 ? void 0 : _r.text;
|
|
2433
2575
|
}
|
|
@@ -2557,7 +2699,7 @@ var NewCampaignComponent = /** @class */ (function () {
|
|
|
2557
2699
|
var subs = this.apiAdapterService
|
|
2558
2700
|
.executeApiRequest([], "/campaign/" + this.campaignID, 'GET')
|
|
2559
2701
|
.subscribe(function (resp) {
|
|
2560
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64;
|
|
2702
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68;
|
|
2561
2703
|
if (!resp)
|
|
2562
2704
|
return;
|
|
2563
2705
|
var generalInformation = {
|
|
@@ -2569,62 +2711,64 @@ var NewCampaignComponent = /** @class */ (function () {
|
|
|
2569
2711
|
: (_f = (_e = resp.data) === null || _e === void 0 ? void 0 : _e.type) === null || _f === void 0 ? void 0 : _f.toUpperCase(),
|
|
2570
2712
|
media: (_h = (_g = resp.data) === null || _g === void 0 ? void 0 : _g.type) === null || _h === void 0 ? void 0 : _h.toUpperCase(),
|
|
2571
2713
|
isPrevTemplate: (_k = (_j = resp) === null || _j === void 0 ? void 0 : _j.data) === null || _k === void 0 ? void 0 : _k.isPrevTemplate,
|
|
2714
|
+
templateName: (_m = (_l = resp) === null || _l === void 0 ? void 0 : _l.data) === null || _m === void 0 ? void 0 : _m.templateName,
|
|
2715
|
+
ttl: (_p = (_o = resp) === null || _o === void 0 ? void 0 : _o.data) === null || _p === void 0 ? void 0 : _p.ttlSeconds,
|
|
2572
2716
|
from: {
|
|
2573
|
-
id: (
|
|
2574
|
-
name: (
|
|
2575
|
-
platform: (
|
|
2576
|
-
clientId: (
|
|
2577
|
-
clientName: (
|
|
2578
|
-
accountNo: (
|
|
2579
|
-
wabaId: (
|
|
2717
|
+
id: (_q = resp.data) === null || _q === void 0 ? void 0 : _q.accountId,
|
|
2718
|
+
name: (_r = resp.data) === null || _r === void 0 ? void 0 : _r.accountName,
|
|
2719
|
+
platform: (_s = resp.data) === null || _s === void 0 ? void 0 : _s.platform,
|
|
2720
|
+
clientId: (_t = resp.data) === null || _t === void 0 ? void 0 : _t.clientId,
|
|
2721
|
+
clientName: (_u = resp.data) === null || _u === void 0 ? void 0 : _u.clientName,
|
|
2722
|
+
accountNo: (_v = resp.data) === null || _v === void 0 ? void 0 : _v.accountNo,
|
|
2723
|
+
wabaId: (_x = (_w = resp.data) === null || _w === void 0 ? void 0 : _w.wabaId, (_x !== null && _x !== void 0 ? _x : '')),
|
|
2580
2724
|
},
|
|
2581
|
-
text: (
|
|
2582
|
-
targetURL: (
|
|
2583
|
-
paramHeader: (
|
|
2584
|
-
paramBody: (
|
|
2585
|
-
paramButton: (
|
|
2586
|
-
otpValue: (
|
|
2725
|
+
text: (_z = (_y = resp.data) === null || _y === void 0 ? void 0 : _y.details) === null || _z === void 0 ? void 0 : _z.text,
|
|
2726
|
+
targetURL: (_11 = (_7 = (_3 = (_2 = (_1 = (_0 = resp.data) === null || _0 === void 0 ? void 0 : _0.details) === null || _1 === void 0 ? void 0 : _1.image) === null || _2 === void 0 ? void 0 : _2.url, (_3 !== null && _3 !== void 0 ? _3 : (_6 = (_5 = (_4 = resp.data) === null || _4 === void 0 ? void 0 : _4.details) === null || _5 === void 0 ? void 0 : _5.document) === null || _6 === void 0 ? void 0 : _6.url)), (_7 !== null && _7 !== void 0 ? _7 : (_10 = (_9 = (_8 = resp.data) === null || _8 === void 0 ? void 0 : _8.details) === null || _9 === void 0 ? void 0 : _9.video) === null || _10 === void 0 ? void 0 : _10.url)), (_11 !== null && _11 !== void 0 ? _11 : (_14 = (_13 = (_12 = resp.data) === null || _12 === void 0 ? void 0 : _12.details) === null || _13 === void 0 ? void 0 : _13.template) === null || _14 === void 0 ? void 0 : _14.headerURL)),
|
|
2727
|
+
paramHeader: (_17 = (_16 = (_15 = resp.data) === null || _15 === void 0 ? void 0 : _15.details) === null || _16 === void 0 ? void 0 : _16.template) === null || _17 === void 0 ? void 0 : _17.header,
|
|
2728
|
+
paramBody: (_20 = (_19 = (_18 = resp.data) === null || _18 === void 0 ? void 0 : _18.details) === null || _19 === void 0 ? void 0 : _19.template) === null || _20 === void 0 ? void 0 : _20.data,
|
|
2729
|
+
paramButton: (_23 = (_22 = (_21 = resp.data) === null || _21 === void 0 ? void 0 : _21.details) === null || _22 === void 0 ? void 0 : _22.template) === null || _23 === void 0 ? void 0 : _23.button,
|
|
2730
|
+
otpValue: (_28 = __spread((_27 = (_26 = (_25 = (_24 = resp.data) === null || _24 === void 0 ? void 0 : _24.details) === null || _25 === void 0 ? void 0 : _25.template) === null || _26 === void 0 ? void 0 : _26.data, (_27 !== null && _27 !== void 0 ? _27 : [])))) === null || _28 === void 0 ? void 0 : _28.pop(),
|
|
2587
2731
|
template: {
|
|
2588
|
-
ID: (
|
|
2589
|
-
name: (
|
|
2590
|
-
lang: (
|
|
2591
|
-
platform: (
|
|
2592
|
-
headerURL: (
|
|
2732
|
+
ID: (_31 = (_30 = (_29 = resp.data) === null || _29 === void 0 ? void 0 : _29.details) === null || _30 === void 0 ? void 0 : _30.template) === null || _31 === void 0 ? void 0 : _31.id,
|
|
2733
|
+
name: (_34 = (_33 = (_32 = resp.data) === null || _32 === void 0 ? void 0 : _32.details) === null || _33 === void 0 ? void 0 : _33.template) === null || _34 === void 0 ? void 0 : _34.name,
|
|
2734
|
+
lang: (_37 = (_36 = (_35 = resp.data) === null || _35 === void 0 ? void 0 : _35.details) === null || _36 === void 0 ? void 0 : _36.template) === null || _37 === void 0 ? void 0 : _37.lang,
|
|
2735
|
+
platform: (_38 = resp.data) === null || _38 === void 0 ? void 0 : _38.platform,
|
|
2736
|
+
headerURL: (_41 = (_40 = (_39 = resp.data) === null || _39 === void 0 ? void 0 : _39.details) === null || _40 === void 0 ? void 0 : _40.template) === null || _41 === void 0 ? void 0 : _41.headerURL,
|
|
2593
2737
|
header: {
|
|
2594
|
-
examples: (
|
|
2738
|
+
examples: (_44 = (_43 = (_42 = resp.data) === null || _42 === void 0 ? void 0 : _42.details) === null || _43 === void 0 ? void 0 : _43.template) === null || _44 === void 0 ? void 0 : _44.header,
|
|
2595
2739
|
},
|
|
2596
2740
|
body: {
|
|
2597
|
-
examples: (
|
|
2741
|
+
examples: (_47 = (_46 = (_45 = resp.data) === null || _45 === void 0 ? void 0 : _45.details) === null || _46 === void 0 ? void 0 : _46.template) === null || _47 === void 0 ? void 0 : _47.data,
|
|
2598
2742
|
},
|
|
2599
|
-
buttons: (
|
|
2600
|
-
ClientId: (
|
|
2601
|
-
ClientName: (
|
|
2743
|
+
buttons: (_50 = (_49 = (_48 = resp.data) === null || _48 === void 0 ? void 0 : _48.details) === null || _49 === void 0 ? void 0 : _49.template) === null || _50 === void 0 ? void 0 : _50.button,
|
|
2744
|
+
ClientId: (_51 = resp.data) === null || _51 === void 0 ? void 0 : _51.clientId,
|
|
2745
|
+
ClientName: (_52 = resp.data) === null || _52 === void 0 ? void 0 : _52.clientName,
|
|
2602
2746
|
},
|
|
2603
|
-
isUpload: ((
|
|
2604
|
-
fileId: (
|
|
2747
|
+
isUpload: ((_53 = resp.data) === null || _53 === void 0 ? void 0 : _53.fileId) !== '',
|
|
2748
|
+
fileId: (_54 = resp.data) === null || _54 === void 0 ? void 0 : _54.fileId,
|
|
2605
2749
|
};
|
|
2606
2750
|
localStorage.setItem('telin.campaign', JSON.stringify(__assign(__assign({}, _this.getCampaignStorage), {
|
|
2607
2751
|
generalInformation: {
|
|
2608
|
-
id: (
|
|
2752
|
+
id: (_55 = resp.data) === null || _55 === void 0 ? void 0 : _55.id,
|
|
2609
2753
|
form: generalInformation,
|
|
2610
2754
|
},
|
|
2611
|
-
failover: (
|
|
2612
|
-
targetAudience: (
|
|
2755
|
+
failover: (_56 = resp.data) === null || _56 === void 0 ? void 0 : _56.failover,
|
|
2756
|
+
targetAudience: (_57 = resp.data) === null || _57 === void 0 ? void 0 : _57.targets,
|
|
2613
2757
|
targetAudienceFile: {
|
|
2614
|
-
name: (
|
|
2615
|
-
targetURL: (
|
|
2758
|
+
name: (_58 = resp.data) === null || _58 === void 0 ? void 0 : _58.fileName,
|
|
2759
|
+
targetURL: (_59 = resp.data) === null || _59 === void 0 ? void 0 : _59.targetURL,
|
|
2616
2760
|
},
|
|
2617
2761
|
scheduler: {
|
|
2618
|
-
schedulerType: ((
|
|
2762
|
+
schedulerType: ((_60 = resp.data) === null || _60 === void 0 ? void 0 : _60.scheduleType) === 'MULTI'
|
|
2619
2763
|
? 'ONE_TIME'
|
|
2620
|
-
: (
|
|
2621
|
-
startDate: (
|
|
2622
|
-
startTime: (
|
|
2623
|
-
isRepeat: ((
|
|
2624
|
-
delivery: (
|
|
2764
|
+
: (_61 = resp.data) === null || _61 === void 0 ? void 0 : _61.scheduleType,
|
|
2765
|
+
startDate: (_63 = (_62 = resp.data) === null || _62 === void 0 ? void 0 : _62.startTime) === null || _63 === void 0 ? void 0 : _63.split(' ')[0],
|
|
2766
|
+
startTime: (_65 = (_64 = resp.data) === null || _64 === void 0 ? void 0 : _64.startTime) === null || _65 === void 0 ? void 0 : _65.split(' ')[1],
|
|
2767
|
+
isRepeat: ((_66 = resp.data) === null || _66 === void 0 ? void 0 : _66.scheduleType) === 'MULTI',
|
|
2768
|
+
delivery: (_67 = resp.data) === null || _67 === void 0 ? void 0 : _67.repeat,
|
|
2625
2769
|
},
|
|
2626
2770
|
})));
|
|
2627
|
-
_this.isLine = ((
|
|
2771
|
+
_this.isLine = ((_68 = resp.data) === null || _68 === void 0 ? void 0 : _68.platform) === 'LINE';
|
|
2628
2772
|
_this.isLoading = false;
|
|
2629
2773
|
_this.initWizard();
|
|
2630
2774
|
}, function () {
|
|
@@ -2971,11 +3115,11 @@ var GeneralInformationEmailComponent = /** @class */ (function () {
|
|
|
2971
3115
|
GeneralInformationEmailComponent.prototype.initForm = function () {
|
|
2972
3116
|
var _this = this;
|
|
2973
3117
|
this.form = new FormGroup({
|
|
2974
|
-
channel: new FormControl(null, Validators.required),
|
|
2975
|
-
from: new FormControl(null, Validators.required),
|
|
2976
|
-
text: new FormControl(null, Validators.required),
|
|
2977
|
-
template: new FormControl(null, Validators.required),
|
|
2978
|
-
paramBody: new FormArray([], Validators.required),
|
|
3118
|
+
channel: new FormControl(null, Validators$1.required),
|
|
3119
|
+
from: new FormControl(null, Validators$1.required),
|
|
3120
|
+
text: new FormControl(null, Validators$1.required),
|
|
3121
|
+
template: new FormControl(null, Validators$1.required),
|
|
3122
|
+
paramBody: new FormArray([], Validators$1.required),
|
|
2979
3123
|
isUpload: new FormControl(false),
|
|
2980
3124
|
fileId: new FormControl(''),
|
|
2981
3125
|
});
|
|
@@ -3032,16 +3176,16 @@ var GeneralInformationEmailComponent = /** @class */ (function () {
|
|
|
3032
3176
|
this.form.controls[key].clearValidators();
|
|
3033
3177
|
this.form.controls[key].updateValueAndValidity();
|
|
3034
3178
|
}
|
|
3035
|
-
this.form.get('channel').setValidators(Validators.required);
|
|
3036
|
-
this.form.get('from').setValidators(Validators.required);
|
|
3179
|
+
this.form.get('channel').setValidators(Validators$1.required);
|
|
3180
|
+
this.form.get('from').setValidators(Validators$1.required);
|
|
3037
3181
|
if (this.getIsTemplate) {
|
|
3038
|
-
this.form.get('template').setValidators(Validators.required);
|
|
3182
|
+
this.form.get('template').setValidators(Validators$1.required);
|
|
3039
3183
|
this.form.get('template').updateValueAndValidity();
|
|
3040
|
-
this.form.get('paramBody').setValidators(Validators.required);
|
|
3184
|
+
this.form.get('paramBody').setValidators(Validators$1.required);
|
|
3041
3185
|
this.form.get('paramBody').updateValueAndValidity();
|
|
3042
3186
|
}
|
|
3043
3187
|
else {
|
|
3044
|
-
this.form.get('text').setValidators(Validators.required);
|
|
3188
|
+
this.form.get('text').setValidators(Validators$1.required);
|
|
3045
3189
|
this.form.get('text').updateValueAndValidity();
|
|
3046
3190
|
}
|
|
3047
3191
|
};
|
|
@@ -3127,7 +3271,7 @@ var GeneralInformationEmailComponent = /** @class */ (function () {
|
|
|
3127
3271
|
value: value,
|
|
3128
3272
|
disabled: this.isReadOnlyMode ||
|
|
3129
3273
|
['UnsubscribeAccount'].includes(value),
|
|
3130
|
-
}, Validators.required),
|
|
3274
|
+
}, Validators$1.required),
|
|
3131
3275
|
});
|
|
3132
3276
|
return form;
|
|
3133
3277
|
};
|
|
@@ -3173,7 +3317,7 @@ var GeneralInformationEmailComponent = /** @class */ (function () {
|
|
|
3173
3317
|
return;
|
|
3174
3318
|
this.isHaveTemplateParam = ((_a = template.body.examples) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
3175
3319
|
((_b = template.body.examples) === null || _b === void 0 ? void 0 : _b.length) > 0
|
|
3176
|
-
? this.form.get('paramBody').setValidators(Validators.required)
|
|
3320
|
+
? this.form.get('paramBody').setValidators(Validators$1.required)
|
|
3177
3321
|
: this.form.get('paramBody').clearValidators();
|
|
3178
3322
|
this.form.get('paramBody').controls = [];
|
|
3179
3323
|
this.form.get('paramBody').reset();
|
|
@@ -3282,12 +3426,12 @@ var GeneralInformationLineComponent = /** @class */ (function () {
|
|
|
3282
3426
|
GeneralInformationLineComponent.prototype.initForm = function () {
|
|
3283
3427
|
var _this = this;
|
|
3284
3428
|
this.form = new FormGroup({
|
|
3285
|
-
channel: new FormControl(null, Validators.required),
|
|
3286
|
-
from: new FormControl(null, Validators.required),
|
|
3429
|
+
channel: new FormControl(null, Validators$1.required),
|
|
3430
|
+
from: new FormControl(null, Validators$1.required),
|
|
3287
3431
|
text: new FormControl(null),
|
|
3288
3432
|
template: new FormControl(null),
|
|
3289
3433
|
isJSON: new FormControl(false),
|
|
3290
|
-
paramBody: new FormArray([], Validators.required),
|
|
3434
|
+
paramBody: new FormArray([], Validators$1.required),
|
|
3291
3435
|
});
|
|
3292
3436
|
this.form.valueChanges.subscribe(function () {
|
|
3293
3437
|
setTimeout(function () {
|
|
@@ -3325,16 +3469,16 @@ var GeneralInformationLineComponent = /** @class */ (function () {
|
|
|
3325
3469
|
this.form.controls[key].clearValidators();
|
|
3326
3470
|
this.form.controls[key].updateValueAndValidity();
|
|
3327
3471
|
}
|
|
3328
|
-
this.form.get('channel').setValidators(Validators.required);
|
|
3329
|
-
this.form.get('from').setValidators(Validators.required);
|
|
3472
|
+
this.form.get('channel').setValidators(Validators$1.required);
|
|
3473
|
+
this.form.get('from').setValidators(Validators$1.required);
|
|
3330
3474
|
if (this.isText) {
|
|
3331
|
-
this.form.get('text').setValidators(Validators.required);
|
|
3475
|
+
this.form.get('text').setValidators(Validators$1.required);
|
|
3332
3476
|
this.form.get('text').updateValueAndValidity();
|
|
3333
3477
|
return;
|
|
3334
3478
|
}
|
|
3335
|
-
this.form.get('template').setValidators(Validators.required);
|
|
3479
|
+
this.form.get('template').setValidators(Validators$1.required);
|
|
3336
3480
|
this.form.get('template').updateValueAndValidity();
|
|
3337
|
-
this.form.get('paramBody').setValidators(Validators.required);
|
|
3481
|
+
this.form.get('paramBody').setValidators(Validators$1.required);
|
|
3338
3482
|
this.form.get('paramBody').updateValueAndValidity();
|
|
3339
3483
|
};
|
|
3340
3484
|
GeneralInformationLineComponent.prototype.formReset = function () {
|
|
@@ -3411,7 +3555,7 @@ var GeneralInformationLineComponent = /** @class */ (function () {
|
|
|
3411
3555
|
GeneralInformationLineComponent.prototype.initParameter = function (value) {
|
|
3412
3556
|
if (value === void 0) { value = ''; }
|
|
3413
3557
|
var form = new FormGroup({
|
|
3414
|
-
name: new FormControl({ value: value, disabled: this.isReadOnlyMode }, Validators.required),
|
|
3558
|
+
name: new FormControl({ value: value, disabled: this.isReadOnlyMode }, Validators$1.required),
|
|
3415
3559
|
});
|
|
3416
3560
|
return form;
|
|
3417
3561
|
};
|
|
@@ -3483,7 +3627,7 @@ var GeneralInformationLineComponent = /** @class */ (function () {
|
|
|
3483
3627
|
var findBrackets = (_a = bodyText) === null || _a === void 0 ? void 0 : _a.match(/{{/g);
|
|
3484
3628
|
var formStorage = (_c = (_b = this.getCampaignStorage) === null || _b === void 0 ? void 0 : _b.generalInformation) === null || _c === void 0 ? void 0 : _c.form;
|
|
3485
3629
|
((_d = findBrackets) === null || _d === void 0 ? void 0 : _d.length) > 0
|
|
3486
|
-
? this.form.get('paramBody').setValidators(Validators.required)
|
|
3630
|
+
? this.form.get('paramBody').setValidators(Validators$1.required)
|
|
3487
3631
|
: this.form.get('paramBody').clearValidators();
|
|
3488
3632
|
(_e = findBrackets) === null || _e === void 0 ? void 0 : _e.forEach(function (_, index) {
|
|
3489
3633
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -3585,11 +3729,11 @@ var GeneralInformationSMSComponent = /** @class */ (function () {
|
|
|
3585
3729
|
GeneralInformationSMSComponent.prototype.initForm = function () {
|
|
3586
3730
|
var _this = this;
|
|
3587
3731
|
this.form = new FormGroup({
|
|
3588
|
-
channel: new FormControl(null, Validators.required),
|
|
3589
|
-
from: new FormControl(null, Validators.required),
|
|
3590
|
-
text: new FormControl(null, Validators.required),
|
|
3591
|
-
template: new FormControl(null, Validators.required),
|
|
3592
|
-
paramBody: new FormArray([], Validators.required),
|
|
3732
|
+
channel: new FormControl(null, Validators$1.required),
|
|
3733
|
+
from: new FormControl(null, Validators$1.required),
|
|
3734
|
+
text: new FormControl(null, Validators$1.required),
|
|
3735
|
+
template: new FormControl(null, Validators$1.required),
|
|
3736
|
+
paramBody: new FormArray([], Validators$1.required),
|
|
3593
3737
|
isUpload: new FormControl(false),
|
|
3594
3738
|
fileId: new FormControl(''),
|
|
3595
3739
|
});
|
|
@@ -3645,16 +3789,16 @@ var GeneralInformationSMSComponent = /** @class */ (function () {
|
|
|
3645
3789
|
this.form.controls[key].clearValidators();
|
|
3646
3790
|
this.form.controls[key].updateValueAndValidity();
|
|
3647
3791
|
}
|
|
3648
|
-
this.form.get('channel').setValidators(Validators.required);
|
|
3649
|
-
this.form.get('from').setValidators(Validators.required);
|
|
3792
|
+
this.form.get('channel').setValidators(Validators$1.required);
|
|
3793
|
+
this.form.get('from').setValidators(Validators$1.required);
|
|
3650
3794
|
if (this.getIsTemplate) {
|
|
3651
|
-
this.form.get('template').setValidators(Validators.required);
|
|
3652
|
-
this.form.get('paramBody').setValidators(Validators.required);
|
|
3795
|
+
this.form.get('template').setValidators(Validators$1.required);
|
|
3796
|
+
this.form.get('paramBody').setValidators(Validators$1.required);
|
|
3653
3797
|
this.form.get('template').updateValueAndValidity();
|
|
3654
3798
|
this.form.get('paramBody').updateValueAndValidity();
|
|
3655
3799
|
}
|
|
3656
3800
|
else {
|
|
3657
|
-
this.form.get('text').setValidators(Validators.required);
|
|
3801
|
+
this.form.get('text').setValidators(Validators$1.required);
|
|
3658
3802
|
this.form.get('text').updateValueAndValidity();
|
|
3659
3803
|
}
|
|
3660
3804
|
};
|
|
@@ -3740,7 +3884,7 @@ var GeneralInformationSMSComponent = /** @class */ (function () {
|
|
|
3740
3884
|
value: value,
|
|
3741
3885
|
disabled: this.isReadOnlyMode ||
|
|
3742
3886
|
['UnsubscribeAccount'].includes(value),
|
|
3743
|
-
}, Validators.required),
|
|
3887
|
+
}, Validators$1.required),
|
|
3744
3888
|
});
|
|
3745
3889
|
return form;
|
|
3746
3890
|
};
|
|
@@ -3786,7 +3930,7 @@ var GeneralInformationSMSComponent = /** @class */ (function () {
|
|
|
3786
3930
|
return;
|
|
3787
3931
|
this.isHaveTemplateParam = ((_a = template.body.examples) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
3788
3932
|
((_b = template.body.examples) === null || _b === void 0 ? void 0 : _b.length) > 0
|
|
3789
|
-
? this.form.get('paramBody').setValidators(Validators.required)
|
|
3933
|
+
? this.form.get('paramBody').setValidators(Validators$1.required)
|
|
3790
3934
|
: this.form.get('paramBody').clearValidators();
|
|
3791
3935
|
this.form.get('paramBody').controls = [];
|
|
3792
3936
|
this.form.get('paramBody').reset();
|
|
@@ -3860,6 +4004,49 @@ var EnumData;
|
|
|
3860
4004
|
EnumData["SCHEDULER_TYPE_MULTIPLE"] = "MULTIPLE";
|
|
3861
4005
|
})(EnumData || (EnumData = {}));
|
|
3862
4006
|
|
|
4007
|
+
var maxValidator = function (max, message) {
|
|
4008
|
+
return function (AC) {
|
|
4009
|
+
var isError = Validators$1.max(max)(AC);
|
|
4010
|
+
if (isError)
|
|
4011
|
+
return {
|
|
4012
|
+
max: max,
|
|
4013
|
+
actual: AC.value,
|
|
4014
|
+
message: message || "Max Value equals to " + max,
|
|
4015
|
+
};
|
|
4016
|
+
return null;
|
|
4017
|
+
};
|
|
4018
|
+
};
|
|
4019
|
+
|
|
4020
|
+
var minValidator = function (min, message) {
|
|
4021
|
+
return function (AC) {
|
|
4022
|
+
var isError = Validators$1.min(min)(AC);
|
|
4023
|
+
if (isError)
|
|
4024
|
+
return {
|
|
4025
|
+
min: min,
|
|
4026
|
+
actual: AC.value,
|
|
4027
|
+
message: message || "Min Value equals to " + min,
|
|
4028
|
+
};
|
|
4029
|
+
return null;
|
|
4030
|
+
};
|
|
4031
|
+
};
|
|
4032
|
+
|
|
4033
|
+
var requiredValidator = function (message) {
|
|
4034
|
+
return function (ac) {
|
|
4035
|
+
var isError = Validators$1.required(ac);
|
|
4036
|
+
if (isError)
|
|
4037
|
+
return { message: message };
|
|
4038
|
+
return null;
|
|
4039
|
+
};
|
|
4040
|
+
};
|
|
4041
|
+
|
|
4042
|
+
var Validators = {
|
|
4043
|
+
compose: Validators$1.compose,
|
|
4044
|
+
composeAync: Validators$1.composeAsync,
|
|
4045
|
+
max: maxValidator,
|
|
4046
|
+
min: minValidator,
|
|
4047
|
+
required: requiredValidator,
|
|
4048
|
+
};
|
|
4049
|
+
|
|
3863
4050
|
var GeneralInformationWAComponent = /** @class */ (function () {
|
|
3864
4051
|
function GeneralInformationWAComponent(ngZone, mapsAPILoader, apiAdapterService, toastr) {
|
|
3865
4052
|
this.ngZone = ngZone;
|
|
@@ -3932,7 +4119,7 @@ var GeneralInformationWAComponent = /** @class */ (function () {
|
|
|
3932
4119
|
GeneralInformationWAComponent.prototype.initForm = function () {
|
|
3933
4120
|
var _this = this;
|
|
3934
4121
|
this.form = new FormGroup({
|
|
3935
|
-
channel: new FormControl(null, Validators.required),
|
|
4122
|
+
channel: new FormControl(null, Validators$1.required),
|
|
3936
4123
|
media: new FormControl(null),
|
|
3937
4124
|
from: new FormControl(null),
|
|
3938
4125
|
text: new FormControl(null),
|
|
@@ -3943,9 +4130,9 @@ var GeneralInformationWAComponent = /** @class */ (function () {
|
|
|
3943
4130
|
latitude: new FormControl(null),
|
|
3944
4131
|
longitude: new FormControl(null),
|
|
3945
4132
|
template: new FormControl(null),
|
|
3946
|
-
paramHeader: new FormArray([], Validators.required),
|
|
3947
|
-
paramBody: new FormArray([], Validators.required),
|
|
3948
|
-
paramButton: new FormArray([], Validators.required),
|
|
4133
|
+
paramHeader: new FormArray([], Validators$1.required),
|
|
4134
|
+
paramBody: new FormArray([], Validators$1.required),
|
|
4135
|
+
paramButton: new FormArray([], Validators$1.required),
|
|
3949
4136
|
otpValue: new FormControl(''),
|
|
3950
4137
|
isUpload: new FormControl(false),
|
|
3951
4138
|
fileId: new FormControl(''),
|
|
@@ -3955,6 +4142,7 @@ var GeneralInformationWAComponent = /** @class */ (function () {
|
|
|
3955
4142
|
body: new FormControl(null),
|
|
3956
4143
|
isUseExistingTemplate: new FormControl(false),
|
|
3957
4144
|
isNeedSave: new FormControl(false),
|
|
4145
|
+
ttl: new FormControl(null),
|
|
3958
4146
|
});
|
|
3959
4147
|
this.form.valueChanges.subscribe(function () {
|
|
3960
4148
|
setTimeout(function () {
|
|
@@ -3969,7 +4157,7 @@ var GeneralInformationWAComponent = /** @class */ (function () {
|
|
|
3969
4157
|
this.form.disable();
|
|
3970
4158
|
};
|
|
3971
4159
|
GeneralInformationWAComponent.prototype.initEdit = function () {
|
|
3972
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
|
|
4160
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
|
|
3973
4161
|
if (Object.entries(this.getCampaignStorage).length === 0 ||
|
|
3974
4162
|
((_c = (_b = (_a = this.getCampaignStorage) === null || _a === void 0 ? void 0 : _a.generalInformation) === null || _b === void 0 ? void 0 : _b.form) === null || _c === void 0 ? void 0 : _c.medium) !== 'WA')
|
|
3975
4163
|
return;
|
|
@@ -3997,39 +4185,40 @@ var GeneralInformationWAComponent = /** @class */ (function () {
|
|
|
3997
4185
|
.setValue((_z = (_y = this.getCampaignStorage) === null || _y === void 0 ? void 0 : _y.generalInformation) === null || _z === void 0 ? void 0 : _z.form.otpValue);
|
|
3998
4186
|
this.form
|
|
3999
4187
|
.get('isUseExistingTemplate')
|
|
4000
|
-
.setValue(!!((_2 = (_1 = (_0 = this.getCampaignStorage) === null || _0 === void 0 ? void 0 : _0.generalInformation) === null || _1 === void 0 ? void 0 : _1.form) === null || _2 === void 0 ? void 0 : _2.
|
|
4188
|
+
.setValue(!!((_2 = (_1 = (_0 = this.getCampaignStorage) === null || _0 === void 0 ? void 0 : _0.generalInformation) === null || _1 === void 0 ? void 0 : _1.form) === null || _2 === void 0 ? void 0 : _2.templateName));
|
|
4001
4189
|
this.form
|
|
4002
4190
|
.get('isNeedSave')
|
|
4003
4191
|
.setValue(!!((_5 = (_4 = (_3 = this.getCampaignStorage) === null || _3 === void 0 ? void 0 : _3.generalInformation) === null || _4 === void 0 ? void 0 : _4.form) === null || _5 === void 0 ? void 0 : _5.isNeedSave));
|
|
4192
|
+
this.form.get('ttl').setValue((_8 = (_7 = (_6 = this.getCampaignStorage) === null || _6 === void 0 ? void 0 : _6.generalInformation) === null || _7 === void 0 ? void 0 : _7.form) === null || _8 === void 0 ? void 0 : _8.ttl);
|
|
4004
4193
|
this.isHaveTemplateParam = this.form.get('isUpload').value;
|
|
4005
|
-
this.getTemplateOptionService(null, (
|
|
4194
|
+
this.getTemplateOptionService(null, (_9 = this.form.get('template').value) === null || _9 === void 0 ? void 0 : _9.name);
|
|
4006
4195
|
};
|
|
4007
4196
|
GeneralInformationWAComponent.prototype.initValidation = function () {
|
|
4008
4197
|
for (var key in this.form.controls) {
|
|
4009
4198
|
this.form.controls[key].clearValidators();
|
|
4010
4199
|
this.form.controls[key].updateValueAndValidity();
|
|
4011
4200
|
}
|
|
4012
|
-
this.form.get('channel').setValidators(Validators.required);
|
|
4201
|
+
this.form.get('channel').setValidators(Validators$1.required);
|
|
4013
4202
|
if (this.getIsText) {
|
|
4014
|
-
this.form.get('from').setValidators(Validators.required);
|
|
4015
|
-
this.form.get('text').setValidators(Validators.required);
|
|
4203
|
+
this.form.get('from').setValidators(Validators$1.required);
|
|
4204
|
+
this.form.get('text').setValidators(Validators$1.required);
|
|
4016
4205
|
this.form.get('from').updateValueAndValidity();
|
|
4017
4206
|
this.form.get('text').updateValueAndValidity();
|
|
4018
4207
|
}
|
|
4019
4208
|
else if (this.getIsMedia) {
|
|
4020
|
-
this.form.get('media').setValidators(Validators.required);
|
|
4021
|
-
this.form.get('from').setValidators(Validators.required);
|
|
4022
|
-
this.form.get('fileName').setValidators(Validators.required);
|
|
4209
|
+
this.form.get('media').setValidators(Validators$1.required);
|
|
4210
|
+
this.form.get('from').setValidators(Validators$1.required);
|
|
4211
|
+
this.form.get('fileName').setValidators(Validators$1.required);
|
|
4023
4212
|
this.form.get('media').updateValueAndValidity();
|
|
4024
4213
|
this.form.get('from').updateValueAndValidity();
|
|
4025
4214
|
this.form.get('fileName').updateValueAndValidity();
|
|
4026
4215
|
}
|
|
4027
4216
|
else if (this.getIsTemplate) {
|
|
4028
|
-
this.form.get('from').setValidators(Validators.required);
|
|
4029
|
-
this.form.get('template').setValidators(Validators.required);
|
|
4030
|
-
this.form.get('paramHeader').setValidators(Validators.required);
|
|
4031
|
-
this.form.get('paramBody').setValidators(Validators.required);
|
|
4032
|
-
this.form.get('paramButton').setValidators(Validators.required);
|
|
4217
|
+
this.form.get('from').setValidators(Validators$1.required);
|
|
4218
|
+
this.form.get('template').setValidators(Validators$1.required);
|
|
4219
|
+
this.form.get('paramHeader').setValidators(Validators$1.required);
|
|
4220
|
+
this.form.get('paramBody').setValidators(Validators$1.required);
|
|
4221
|
+
this.form.get('paramButton').setValidators(Validators$1.required);
|
|
4033
4222
|
this.form.get('from').updateValueAndValidity();
|
|
4034
4223
|
this.form.get('template').updateValueAndValidity();
|
|
4035
4224
|
this.form.get('paramHeader').updateValueAndValidity();
|
|
@@ -4037,11 +4226,11 @@ var GeneralInformationWAComponent = /** @class */ (function () {
|
|
|
4037
4226
|
this.form.get('paramButton').updateValueAndValidity();
|
|
4038
4227
|
}
|
|
4039
4228
|
else if (this.getIsCatalogue) {
|
|
4040
|
-
this.form.get('from').setValidators(Validators.required);
|
|
4041
|
-
this.form.get('category').setValidators(Validators.required);
|
|
4042
|
-
this.form.get('catalogue').setValidators(Validators.required);
|
|
4043
|
-
this.form.get('product').setValidators(Validators.required);
|
|
4044
|
-
this.form.get('body').setValidators(Validators.maxLength(100));
|
|
4229
|
+
this.form.get('from').setValidators(Validators$1.required);
|
|
4230
|
+
this.form.get('category').setValidators(Validators$1.required);
|
|
4231
|
+
this.form.get('catalogue').setValidators(Validators$1.required);
|
|
4232
|
+
this.form.get('product').setValidators(Validators$1.required);
|
|
4233
|
+
this.form.get('body').setValidators(Validators$1.maxLength(100));
|
|
4045
4234
|
this.form.get('from').updateValueAndValidity();
|
|
4046
4235
|
this.form.get('category').updateValueAndValidity();
|
|
4047
4236
|
this.form.get('catalogue').updateValueAndValidity();
|
|
@@ -4049,14 +4238,21 @@ var GeneralInformationWAComponent = /** @class */ (function () {
|
|
|
4049
4238
|
this.form.get('body').updateValueAndValidity();
|
|
4050
4239
|
}
|
|
4051
4240
|
else if (this.getIsUtility) {
|
|
4052
|
-
this.form.get('from').setValidators(Validators.required);
|
|
4053
|
-
this.form.get('text').setValidators(Validators.required);
|
|
4241
|
+
this.form.get('from').setValidators(Validators$1.required);
|
|
4242
|
+
this.form.get('text').setValidators([Validators$1.required, Validators$1.maxLength(1024)]);
|
|
4243
|
+
this.form
|
|
4244
|
+
.get('ttl')
|
|
4245
|
+
.setValidators([
|
|
4246
|
+
Validators.min(30, 'Minimum TTL 30'),
|
|
4247
|
+
Validators.max(43200, 'Maximum TTL 43200'),
|
|
4248
|
+
]);
|
|
4054
4249
|
this.form.get('from').updateValueAndValidity();
|
|
4055
4250
|
this.form.get('text').updateValueAndValidity();
|
|
4251
|
+
this.form.get('ttl').updateValueAndValidity();
|
|
4056
4252
|
}
|
|
4057
4253
|
else {
|
|
4058
|
-
this.form.get('from').setValidators(Validators.required);
|
|
4059
|
-
this.form.get('text').setValidators(Validators.required);
|
|
4254
|
+
this.form.get('from').setValidators(Validators$1.required);
|
|
4255
|
+
this.form.get('text').setValidators(Validators$1.required);
|
|
4060
4256
|
this.form.get('from').updateValueAndValidity();
|
|
4061
4257
|
this.form.get('text').updateValueAndValidity();
|
|
4062
4258
|
}
|
|
@@ -4164,13 +4360,13 @@ var GeneralInformationWAComponent = /** @class */ (function () {
|
|
|
4164
4360
|
if (value === void 0) { value = ''; }
|
|
4165
4361
|
var form = isButton
|
|
4166
4362
|
? new FormGroup({
|
|
4167
|
-
name: new FormArray([], Validators.required),
|
|
4363
|
+
name: new FormArray([], Validators$1.required),
|
|
4168
4364
|
})
|
|
4169
4365
|
: new FormGroup({
|
|
4170
4366
|
name: new FormControl({
|
|
4171
4367
|
value: value,
|
|
4172
4368
|
disabled: this.isReadOnlyMode || ['$UnsubscribeAccount'].includes(value),
|
|
4173
|
-
}, Validators.required),
|
|
4369
|
+
}, Validators$1.required),
|
|
4174
4370
|
});
|
|
4175
4371
|
return form;
|
|
4176
4372
|
};
|
|
@@ -4299,7 +4495,7 @@ var GeneralInformationWAComponent = /** @class */ (function () {
|
|
|
4299
4495
|
this.form.get('file').setValue(file[0]);
|
|
4300
4496
|
this.form.get('fileType').setValue('image');
|
|
4301
4497
|
this.form.get('fileName').setValue(file[0].name);
|
|
4302
|
-
this.form.get('targetURL').setValidators(Validators.required);
|
|
4498
|
+
this.form.get('targetURL').setValidators(Validators$1.required);
|
|
4303
4499
|
this.form.get('targetURL').updateValueAndValidity();
|
|
4304
4500
|
if (file[0].type.indexOf('video') > -1)
|
|
4305
4501
|
this.form.get('fileType').setValue('video');
|
|
@@ -4346,13 +4542,13 @@ var GeneralInformationWAComponent = /** @class */ (function () {
|
|
|
4346
4542
|
this.fileTypeChange((_t = (_s = (_r = template) === null || _r === void 0 ? void 0 : _r.header) === null || _s === void 0 ? void 0 : _s.type) === null || _t === void 0 ? void 0 : _t.toLowerCase());
|
|
4347
4543
|
}
|
|
4348
4544
|
((_u = template.header.examples) === null || _u === void 0 ? void 0 : _u.length) > 0
|
|
4349
|
-
? this.form.get('paramHeader').setValidators(Validators.required)
|
|
4545
|
+
? this.form.get('paramHeader').setValidators(Validators$1.required)
|
|
4350
4546
|
: this.form.get('paramHeader').clearValidators();
|
|
4351
4547
|
((_v = template.body.examples) === null || _v === void 0 ? void 0 : _v.length) > 0
|
|
4352
|
-
? this.form.get('paramBody').setValidators(Validators.required)
|
|
4548
|
+
? this.form.get('paramBody').setValidators(Validators$1.required)
|
|
4353
4549
|
: this.form.get('paramBody').clearValidators();
|
|
4354
4550
|
((_w = template.buttons) === null || _w === void 0 ? void 0 : _w.length) > 0
|
|
4355
|
-
? this.form.get('paramButton').setValidators(Validators.required)
|
|
4551
|
+
? this.form.get('paramButton').setValidators(Validators$1.required)
|
|
4356
4552
|
: this.form.get('paramButton').clearValidators();
|
|
4357
4553
|
this.form.get('paramHeader').controls = [];
|
|
4358
4554
|
this.form.get('paramHeader').reset();
|
|
@@ -4371,7 +4567,7 @@ var GeneralInformationWAComponent = /** @class */ (function () {
|
|
|
4371
4567
|
this.form
|
|
4372
4568
|
.get('otpValue')
|
|
4373
4569
|
.setValue((_6 = (_0 = (_z = formStorage) === null || _z === void 0 ? void 0 : _z.otpValue, (_0 !== null && _0 !== void 0 ? _0 : (_5 = __spread((_4 = (_3 = (_2 = (_1 = formStorage) === null || _1 === void 0 ? void 0 : _1.template) === null || _2 === void 0 ? void 0 : _2.body) === null || _3 === void 0 ? void 0 : _3.examples, (_4 !== null && _4 !== void 0 ? _4 : [])))) === null || _5 === void 0 ? void 0 : _5.pop())), (_6 !== null && _6 !== void 0 ? _6 : '')));
|
|
4374
|
-
this.form.get('otpValue').setValidators(Validators.required);
|
|
4570
|
+
this.form.get('otpValue').setValidators(Validators$1.required);
|
|
4375
4571
|
this.form.get('otpValue').updateValueAndValidity();
|
|
4376
4572
|
}
|
|
4377
4573
|
(_7 = template.header.examples) === null || _7 === void 0 ? void 0 : _7.forEach(function (each, index) {
|
|
@@ -4496,7 +4692,7 @@ var GeneralInformationWAComponent = /** @class */ (function () {
|
|
|
4496
4692
|
};
|
|
4497
4693
|
GeneralInformationWAComponent.prototype.handleChangeTemplate = function (useExisting) {
|
|
4498
4694
|
if (useExisting) {
|
|
4499
|
-
this.form.get('template').setValidators(Validators.required);
|
|
4695
|
+
this.form.get('template').setValidators(Validators$1.required);
|
|
4500
4696
|
this.form.get('text').reset();
|
|
4501
4697
|
this.form.get('text').clearValidators();
|
|
4502
4698
|
this.form.get('text').updateValueAndValidity();
|
|
@@ -4505,7 +4701,7 @@ var GeneralInformationWAComponent = /** @class */ (function () {
|
|
|
4505
4701
|
else {
|
|
4506
4702
|
this.form.get('template').reset();
|
|
4507
4703
|
this.form.get('template').clearValidators();
|
|
4508
|
-
this.form.get('text').setValidators(Validators.required);
|
|
4704
|
+
this.form.get('text').setValidators([Validators$1.required, Validators$1.max(1024)]);
|
|
4509
4705
|
this.form.get('text').updateValueAndValidity();
|
|
4510
4706
|
this.form.get('template').updateValueAndValidity();
|
|
4511
4707
|
}
|
|
@@ -4540,7 +4736,7 @@ var GeneralInformationWAComponent = /** @class */ (function () {
|
|
|
4540
4736
|
GeneralInformationWAComponent = __decorate([
|
|
4541
4737
|
Component({
|
|
4542
4738
|
selector: 'lib-general-information-wa',
|
|
4543
|
-
template: "<form autocomplete=\"off\" [formGroup]=\"form\">\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">Message Type</mat-label>\r\n\r\n <mat-select placeholder=\"Select message type\" formControlName=\"channel\">\r\n <mat-option\r\n *ngFor=\"let option of msgTypeWAOption\"\r\n [value]=\"option.code\"\r\n (click)=\"formReset()\"\r\n >\r\n {{ option.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.channel\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('channel')?.touched && form.get('channel')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n\r\n <div\r\n *ngIf=\"!getIsTemplate\"\r\n role=\"alert\"\r\n class=\"alert alert-warning d-flex align-items-center\"\r\n style=\"margin-top: 16px; border: 1px solid rgb(243, 124, 44)\"\r\n >\r\n <mat-icon style=\"margin-right: 10px !important\">error_outline</mat-icon>\r\n <div>\r\n If you select this channel, keep in mind that the message might not be delivered to\r\n all selected customers. This is because the customer must have had a conversation\r\n previously with BSP.\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <ng-container *ngIf=\"getIsText\">\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">From</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"from\"\r\n placeholder=\"Select from\"\r\n [complete]=\"isHaveNextAccountOption === false\"\r\n [compareWith]=\"accountSelectedDisplay\"\r\n (infiniteScroll)=\"getNextAccountBatch()\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('from').value?.name\"\r\n (searchRes)=\"updateSearchAccount($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name + ' (' + option.accountNo + ')' }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingAccountOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.from\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('from').touched && form.get('from').hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\">\r\n <mat-label class=\"asterix--after\">Text</mat-label>\r\n\r\n <textarea\r\n matInput\r\n rows=\"6\"\r\n cols=\"50\"\r\n cdkTextareaAutosize\r\n cdkAutosizeMinRows=\"2\"\r\n cdkAutosizeMaxRows=\"15\"\r\n formControlName=\"text\"\r\n placeholder=\"Enter text\"\r\n #autosize=\"cdkTextareaAutosize\"\r\n ></textarea>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.text\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('text')?.touched && form.get('text')?.hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getIsMedia\">\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">Media Type</mat-label>\r\n\r\n <mat-select\r\n placeholder=\"Select media type\"\r\n formControlName=\"media\"\r\n (selectionChange)=\"updateMediaType($event.value)\"\r\n >\r\n <mat-option *ngFor=\"let option of mediaTypeOption\" [value]=\"option.code\">\r\n {{ option.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.media\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('media').touched && form.get('media').hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">From</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"from\"\r\n placeholder=\"Select from\"\r\n [complete]=\"isHaveNextAccountOption === false\"\r\n [compareWith]=\"accountSelectedDisplay\"\r\n (infiniteScroll)=\"getNextAccountBatch()\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('from').value?.name\"\r\n (searchRes)=\"updateSearchAccount($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name + ' (' + option.accountNo + ')' }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingAccountOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.from\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('from').touched && form.get('from').hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <ng-container *ngIf=\"form.get('media').value?.toLowerCase() !== 'location'\">\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">File</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n autocomplete=\"off\"\r\n (click)=\"filePicker.click()\"\r\n formControlName=\"fileName\"\r\n />\r\n\r\n <button\r\n mat-button\r\n matSuffix\r\n mat-icon-button\r\n aria-label=\"Choose File\"\r\n (click)=\"filePicker.click()\"\r\n >\r\n <mat-icon>attach_file</mat-icon>\r\n </button>\r\n\r\n <input\r\n #filePicker\r\n hidden\r\n type=\"file\"\r\n [accept]=\"extFileAccepted\"\r\n (change)=\"onFileSelected($event)\"\r\n />\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.fileName\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('fileName').touched &&\r\n form.get('fileName').hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"form.get('media').value?.toLowerCase() === 'location'\">\r\n <div class=\"w-100\">\r\n <h4 class=\"asterix--after\">Location</h4>\r\n\r\n <div class=\"w-100\">\r\n <agm-map\r\n style=\"width: 100%; height: 400px\"\r\n [latitude]=\"maps.latitude\"\r\n [longitude]=\"maps.longitude\"\r\n [disableDoubleClickZoom]=\"maps.isDoubleClickZoom\"\r\n [zoom]=\"maps.zoom\"\r\n >\r\n <agm-marker\r\n [latitude]=\"maps.latitude\"\r\n [longitude]=\"maps.longitude\"\r\n [markerDraggable]=\"maps.isDraggable\"\r\n (dragEnd)=\"markerDragEnd($event)\"\r\n ></agm-marker>\r\n </agm-map>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label>Location</mat-label>\r\n\r\n <input\r\n #mapSearch\r\n matInput\r\n type=\"text\"\r\n maxlength=\"100\"\r\n placeholder=\"Enter location here\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getIsTemplate\">\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">From</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"from\"\r\n placeholder=\"Select from\"\r\n [complete]=\"isHaveNextAccountOption === false\"\r\n [compareWith]=\"accountSelectedDisplay\"\r\n (infiniteScroll)=\"getNextAccountBatch()\"\r\n (selectionChange)=\"getTemplateOptionService($event.value)\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('from').value?.name\"\r\n (searchRes)=\"updateSearchAccount($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name + ' (' + option.accountNo + ')' }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingAccountOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.from\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('from')?.touched && form.get('from')?.hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">Template</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"template\"\r\n placeholder=\"Select template\"\r\n [complete]=\"isHaveNextTemplateOption === false\"\r\n [compareWith]=\"templateSelectedDisplay\"\r\n (infiniteScroll)=\"getNextTemplateBatch()\"\r\n (selectionChange)=\"updateTemplate($event.value)\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('template').value?.name\"\r\n (searchRes)=\"updateSearch($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of templateOption\" [value]=\"option\">\r\n {{ option.name }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingTemplateOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.template\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('template')?.touched &&\r\n form.get('template')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div *ngIf=\"isHaveTemplateParam\" class=\"d-flex justify-content-end\">\r\n <mat-checkbox\r\n labelPosition=\"before\"\r\n formControlName=\"isUpload\"\r\n (change)=\"updateDownloadCSV($event.checked)\"\r\n >\r\n Using Download XLSX\r\n </mat-checkbox>\r\n </div>\r\n\r\n <ng-container *ngIf=\"!form.get('isUpload')?.value\">\r\n <div\r\n *ngIf=\"form.get('template')?.value?.category === 'AUTHENTICATION'\"\r\n class=\"form-group\"\r\n >\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label> OTP Value </mat-label>\r\n\r\n <input matInput type=\"text\" formControlName=\"otpValue\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <ng-container *ngIf=\"getParamHeader?.length > 0\">\r\n <p class=\"font-16px font-PoppinsBold\">Header Parameter</p>\r\n\r\n <div\r\n *ngFor=\"let param of getParamHeader; let paramHeaderIndex = index\"\r\n class=\"form-group\"\r\n >\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label>Parameter {{ paramHeaderIndex + 1 }}</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n [placeholder]=\"'Parameter ' + (paramHeaderIndex + 1)\"\r\n [formControl]=\"param.get('name')\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getParamBody?.length > 0\">\r\n <p class=\"font-16px font-PoppinsBold mt-3\">Body Parameter</p>\r\n\r\n <div\r\n *ngFor=\"let param of getParamBody; let paramBodyIndex = index\"\r\n class=\"form-group\"\r\n >\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label>Parameter {{ paramBodyIndex + 1 }}</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n [placeholder]=\"'Parameter ' + (paramBodyIndex + 1)\"\r\n [formControl]=\"param.get('name')\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"isShowParameter\">\r\n <p class=\"font-16px font-PoppinsBold mt-3\">Button Parameter</p>\r\n\r\n <ng-container *ngFor=\"let button of getButton; let buttonIndex = index\">\r\n <ng-container *ngIf=\"getParamButton(buttonIndex)?.length > 0\">\r\n <p class=\"font-14px font-PoppinsBold mt-3\">Button {{ buttonIndex + 1 }}</p>\r\n\r\n <div\r\n *ngFor=\"\r\n let param of getParamButton(buttonIndex);\r\n let paramIndex = index\r\n \"\r\n class=\"form-group\"\r\n >\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label>Parameter {{ paramIndex + 1 }}</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n [placeholder]=\"'Parameter ' + (paramIndex + 1)\"\r\n [formControl]=\"param.get('name')\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-container\r\n *ngIf=\"\r\n ['image', 'video', 'document'].includes(\r\n form.get('template')?.value?.header?.type?.toLowerCase()\r\n )\r\n \"\r\n >\r\n <p class=\"font-16px font-PoppinsBold mt-3\">File</p>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">File</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n autocomplete=\"off\"\r\n (click)=\"filePicker.click()\"\r\n formControlName=\"fileName\"\r\n />\r\n\r\n <button\r\n mat-button\r\n matSuffix\r\n mat-icon-button\r\n aria-label=\"Choose File\"\r\n (click)=\"filePicker.click()\"\r\n >\r\n <mat-icon>attach_file</mat-icon>\r\n </button>\r\n\r\n <input\r\n #filePicker\r\n hidden\r\n type=\"file\"\r\n [accept]=\"extFileAccepted\"\r\n (change)=\"onFileSelected($event)\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getIsCatalogue\">\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">From</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"from\"\r\n placeholder=\"Select from\"\r\n [complete]=\"isHaveNextAccountOption === false\"\r\n [compareWith]=\"accountSelectedDisplay\"\r\n (infiniteScroll)=\"getNextAccountBatch()\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('from').value?.name\"\r\n (searchRes)=\"updateSearchAccount($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name + ' (' + option.accountNo + ')' }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingAccountOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.from\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('from')?.touched && form.get('from')?.hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">Category</mat-label>\r\n\r\n <mat-select formControlName=\"category\" placeholder=\"Select category\">\r\n <mat-option *ngFor=\"let option of categoryOption\" [value]=\"option.value\">\r\n {{ option.label }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.category\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('category')?.touched &&\r\n form.get('category')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">Catalog</mat-label>\r\n\r\n <mat-select formControlName=\"catalogue\" placeholder=\"Select catalog\">\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.catalogue\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('catalogue')?.touched &&\r\n form.get('catalogue')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"form.get('category')?.value === 'product'\"\r\n style=\"padding: 8px; border-radius: 8px; border: 1px solid #6177c4\"\r\n >\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">Product</mat-label>\r\n\r\n <mat-select formControlName=\"product\" placeholder=\"Select product\">\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.product\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('product')?.touched &&\r\n form.get('product')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label>Body</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n maxlength=\"100\"\r\n formControlName=\"body\"\r\n placeholder=\"Enter body\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getIsUtility\">\r\n <div style=\"display: grid; gap: 0.5rem\">\r\n <mat-label class=\"asterix--after\">Template</mat-label>\r\n <mat-radio-group\r\n style=\"display: flex; gap: 0.5rem; flex-wrap: wrap\"\r\n formControlName=\"isUseExistingTemplate\"\r\n (change)=\"handleChangeTemplate($event.value)\"\r\n >\r\n <mat-radio-button\r\n [value]=\"option.value\"\r\n *ngFor=\"let option of templates\"\r\n color=\"primary\"\r\n >\r\n {{ option.label }}\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">From</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"from\"\r\n placeholder=\"Select from\"\r\n [complete]=\"isHaveNextAccountOption === false\"\r\n [compareWith]=\"accountSelectedDisplay\"\r\n (infiniteScroll)=\"getNextAccountBatch()\"\r\n (selectionChange)=\"handleChangeFrom($event.value)\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('from').value?.name\"\r\n (searchRes)=\"updateSearchAccount($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name + ' (' + option.accountNo + ')' }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingAccountOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.from\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('from')?.touched && form.get('from')?.hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <ng-container *ngIf=\"!form.get('isUseExistingTemplate')?.value; else existingTmpl\">\r\n <div\r\n role=\"alert\"\r\n class=\"alert alert-warning d-flex align-items-center\"\r\n style=\"margin-top: 8px; border: 1px solid rgb(243, 124, 44)\"\r\n >\r\n <mat-icon style=\"margin-right: 10px !important\">error_outline</mat-icon>\r\n <div>\r\n Direct Send access restricted for 30 days due to continued misuse. Final warning\r\n before permanent revocation.\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\">\r\n <mat-label class=\"asterix--after\">Body</mat-label>\r\n\r\n <textarea\r\n matInput\r\n rows=\"6\"\r\n cols=\"50\"\r\n cdkTextareaAutosize\r\n cdkAutosizeMinRows=\"2\"\r\n cdkAutosizeMaxRows=\"15\"\r\n formControlName=\"text\"\r\n placeholder=\"Enter text\"\r\n #autosize=\"cdkTextareaAutosize\"\r\n ></textarea>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.text\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('text').touched && form.get('text').hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div *ngIf=\"!isReadOnlyMode\">\r\n <mat-checkbox formControlName=\"isNeedSave\">\r\n Save this message as future template\r\n </mat-checkbox>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-template #existingTmpl>\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">Template</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"template\"\r\n placeholder=\"Select template\"\r\n [complete]=\"isHaveNextTemplateOption === false\"\r\n [compareWith]=\"templateSelectedDisplay\"\r\n (infiniteScroll)=\"getNextTemplateBatch()\"\r\n (selectionChange)=\"updateTemplate($event.value)\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('template').value?.name\"\r\n (searchRes)=\"updateSearch($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of templateOption\" [value]=\"option\">\r\n {{ option.name }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingTemplateOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.template\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('template')?.touched &&\r\n form.get('template')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n</form>\r\n",
|
|
4739
|
+
template: "<form autocomplete=\"off\" [formGroup]=\"form\">\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">Message Type</mat-label>\r\n\r\n <mat-select placeholder=\"Select message type\" formControlName=\"channel\">\r\n <mat-option\r\n *ngFor=\"let option of msgTypeWAOption\"\r\n [value]=\"option.code\"\r\n (click)=\"formReset()\"\r\n >\r\n {{ option.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.channel\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('channel')?.touched && form.get('channel')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n\r\n <div\r\n *ngIf=\"!getIsTemplate\"\r\n role=\"alert\"\r\n class=\"alert alert-warning d-flex align-items-center\"\r\n style=\"margin-top: 16px; border: 1px solid rgb(243, 124, 44)\"\r\n >\r\n <mat-icon style=\"margin-right: 10px !important\">error_outline</mat-icon>\r\n <div>\r\n If you select this channel, keep in mind that the message might not be delivered to\r\n all selected customers. This is because the customer must have had a conversation\r\n previously with BSP.\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <ng-container *ngIf=\"getIsText\">\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">From</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"from\"\r\n placeholder=\"Select from\"\r\n [complete]=\"isHaveNextAccountOption === false\"\r\n [compareWith]=\"accountSelectedDisplay\"\r\n (infiniteScroll)=\"getNextAccountBatch()\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('from').value?.name\"\r\n (searchRes)=\"updateSearchAccount($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name + ' (' + option.accountNo + ')' }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingAccountOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.from\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('from').touched && form.get('from').hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\">\r\n <mat-label class=\"asterix--after\">Text</mat-label>\r\n\r\n <textarea\r\n matInput\r\n rows=\"6\"\r\n cols=\"50\"\r\n cdkTextareaAutosize\r\n cdkAutosizeMinRows=\"2\"\r\n cdkAutosizeMaxRows=\"15\"\r\n formControlName=\"text\"\r\n placeholder=\"Enter text\"\r\n #autosize=\"cdkTextareaAutosize\"\r\n ></textarea>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.text\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('text')?.touched && form.get('text')?.hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getIsMedia\">\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">Media Type</mat-label>\r\n\r\n <mat-select\r\n placeholder=\"Select media type\"\r\n formControlName=\"media\"\r\n (selectionChange)=\"updateMediaType($event.value)\"\r\n >\r\n <mat-option *ngFor=\"let option of mediaTypeOption\" [value]=\"option.code\">\r\n {{ option.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.media\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('media').touched && form.get('media').hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">From</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"from\"\r\n placeholder=\"Select from\"\r\n [complete]=\"isHaveNextAccountOption === false\"\r\n [compareWith]=\"accountSelectedDisplay\"\r\n (infiniteScroll)=\"getNextAccountBatch()\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('from').value?.name\"\r\n (searchRes)=\"updateSearchAccount($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name + ' (' + option.accountNo + ')' }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingAccountOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.from\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('from').touched && form.get('from').hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <ng-container *ngIf=\"form.get('media').value?.toLowerCase() !== 'location'\">\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">File</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n autocomplete=\"off\"\r\n (click)=\"filePicker.click()\"\r\n formControlName=\"fileName\"\r\n />\r\n\r\n <button\r\n mat-button\r\n matSuffix\r\n mat-icon-button\r\n aria-label=\"Choose File\"\r\n (click)=\"filePicker.click()\"\r\n >\r\n <mat-icon>attach_file</mat-icon>\r\n </button>\r\n\r\n <input\r\n #filePicker\r\n hidden\r\n type=\"file\"\r\n [accept]=\"extFileAccepted\"\r\n (change)=\"onFileSelected($event)\"\r\n />\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.fileName\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('fileName').touched &&\r\n form.get('fileName').hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"form.get('media').value?.toLowerCase() === 'location'\">\r\n <div class=\"w-100\">\r\n <h4 class=\"asterix--after\">Location</h4>\r\n\r\n <div class=\"w-100\">\r\n <agm-map\r\n style=\"width: 100%; height: 400px\"\r\n [latitude]=\"maps.latitude\"\r\n [longitude]=\"maps.longitude\"\r\n [disableDoubleClickZoom]=\"maps.isDoubleClickZoom\"\r\n [zoom]=\"maps.zoom\"\r\n >\r\n <agm-marker\r\n [latitude]=\"maps.latitude\"\r\n [longitude]=\"maps.longitude\"\r\n [markerDraggable]=\"maps.isDraggable\"\r\n (dragEnd)=\"markerDragEnd($event)\"\r\n ></agm-marker>\r\n </agm-map>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label>Location</mat-label>\r\n\r\n <input\r\n #mapSearch\r\n matInput\r\n type=\"text\"\r\n maxlength=\"100\"\r\n placeholder=\"Enter location here\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getIsTemplate\">\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">From</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"from\"\r\n placeholder=\"Select from\"\r\n [complete]=\"isHaveNextAccountOption === false\"\r\n [compareWith]=\"accountSelectedDisplay\"\r\n (infiniteScroll)=\"getNextAccountBatch()\"\r\n (selectionChange)=\"getTemplateOptionService($event.value)\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('from').value?.name\"\r\n (searchRes)=\"updateSearchAccount($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name + ' (' + option.accountNo + ')' }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingAccountOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.from\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('from')?.touched && form.get('from')?.hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">Template</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"template\"\r\n placeholder=\"Select template\"\r\n [complete]=\"isHaveNextTemplateOption === false\"\r\n [compareWith]=\"templateSelectedDisplay\"\r\n (infiniteScroll)=\"getNextTemplateBatch()\"\r\n (selectionChange)=\"updateTemplate($event.value)\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('template').value?.name\"\r\n (searchRes)=\"updateSearch($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of templateOption\" [value]=\"option\">\r\n {{ option.name }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingTemplateOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.template\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('template')?.touched &&\r\n form.get('template')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div *ngIf=\"isHaveTemplateParam\" class=\"d-flex justify-content-end\">\r\n <mat-checkbox\r\n labelPosition=\"before\"\r\n formControlName=\"isUpload\"\r\n (change)=\"updateDownloadCSV($event.checked)\"\r\n >\r\n Using Download XLSX\r\n </mat-checkbox>\r\n </div>\r\n\r\n <ng-container *ngIf=\"!form.get('isUpload')?.value\">\r\n <div\r\n *ngIf=\"form.get('template')?.value?.category === 'AUTHENTICATION'\"\r\n class=\"form-group\"\r\n >\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label> OTP Value </mat-label>\r\n\r\n <input matInput type=\"text\" formControlName=\"otpValue\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <ng-container *ngIf=\"getParamHeader?.length > 0\">\r\n <p class=\"font-16px font-PoppinsBold\">Header Parameter</p>\r\n\r\n <div\r\n *ngFor=\"let param of getParamHeader; let paramHeaderIndex = index\"\r\n class=\"form-group\"\r\n >\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label>Parameter {{ paramHeaderIndex + 1 }}</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n [placeholder]=\"'Parameter ' + (paramHeaderIndex + 1)\"\r\n [formControl]=\"param.get('name')\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getParamBody?.length > 0\">\r\n <p class=\"font-16px font-PoppinsBold mt-3\">Body Parameter</p>\r\n\r\n <div\r\n *ngFor=\"let param of getParamBody; let paramBodyIndex = index\"\r\n class=\"form-group\"\r\n >\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label>Parameter {{ paramBodyIndex + 1 }}</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n [placeholder]=\"'Parameter ' + (paramBodyIndex + 1)\"\r\n [formControl]=\"param.get('name')\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"isShowParameter\">\r\n <p class=\"font-16px font-PoppinsBold mt-3\">Button Parameter</p>\r\n\r\n <ng-container *ngFor=\"let button of getButton; let buttonIndex = index\">\r\n <ng-container *ngIf=\"getParamButton(buttonIndex)?.length > 0\">\r\n <p class=\"font-14px font-PoppinsBold mt-3\">Button {{ buttonIndex + 1 }}</p>\r\n\r\n <div\r\n *ngFor=\"\r\n let param of getParamButton(buttonIndex);\r\n let paramIndex = index\r\n \"\r\n class=\"form-group\"\r\n >\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label>Parameter {{ paramIndex + 1 }}</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n [placeholder]=\"'Parameter ' + (paramIndex + 1)\"\r\n [formControl]=\"param.get('name')\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-container\r\n *ngIf=\"\r\n ['image', 'video', 'document'].includes(\r\n form.get('template')?.value?.header?.type?.toLowerCase()\r\n )\r\n \"\r\n >\r\n <p class=\"font-16px font-PoppinsBold mt-3\">File</p>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">File</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n autocomplete=\"off\"\r\n (click)=\"filePicker.click()\"\r\n formControlName=\"fileName\"\r\n />\r\n\r\n <button\r\n mat-button\r\n matSuffix\r\n mat-icon-button\r\n aria-label=\"Choose File\"\r\n (click)=\"filePicker.click()\"\r\n >\r\n <mat-icon>attach_file</mat-icon>\r\n </button>\r\n\r\n <input\r\n #filePicker\r\n hidden\r\n type=\"file\"\r\n [accept]=\"extFileAccepted\"\r\n (change)=\"onFileSelected($event)\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getIsCatalogue\">\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">From</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"from\"\r\n placeholder=\"Select from\"\r\n [complete]=\"isHaveNextAccountOption === false\"\r\n [compareWith]=\"accountSelectedDisplay\"\r\n (infiniteScroll)=\"getNextAccountBatch()\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('from').value?.name\"\r\n (searchRes)=\"updateSearchAccount($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name + ' (' + option.accountNo + ')' }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingAccountOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.from\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('from')?.touched && form.get('from')?.hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">Category</mat-label>\r\n\r\n <mat-select formControlName=\"category\" placeholder=\"Select category\">\r\n <mat-option *ngFor=\"let option of categoryOption\" [value]=\"option.value\">\r\n {{ option.label }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.category\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('category')?.touched &&\r\n form.get('category')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">Catalog</mat-label>\r\n\r\n <mat-select formControlName=\"catalogue\" placeholder=\"Select catalog\">\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.catalogue\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('catalogue')?.touched &&\r\n form.get('catalogue')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"form.get('category')?.value === 'product'\"\r\n style=\"padding: 8px; border-radius: 8px; border: 1px solid #6177c4\"\r\n >\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">Product</mat-label>\r\n\r\n <mat-select formControlName=\"product\" placeholder=\"Select product\">\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.product\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('product')?.touched &&\r\n form.get('product')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label>Body</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n maxlength=\"100\"\r\n formControlName=\"body\"\r\n placeholder=\"Enter body\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getIsUtility\">\r\n <div style=\"display: grid; gap: 0.5rem\">\r\n <mat-label class=\"asterix--after\">Template</mat-label>\r\n <mat-radio-group\r\n style=\"display: flex; gap: 0.5rem; flex-wrap: wrap\"\r\n formControlName=\"isUseExistingTemplate\"\r\n (change)=\"handleChangeTemplate($event.value)\"\r\n >\r\n <mat-radio-button\r\n [value]=\"option.value\"\r\n *ngFor=\"let option of templates\"\r\n color=\"primary\"\r\n >\r\n {{ option.label }}\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">From</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"from\"\r\n placeholder=\"Select from\"\r\n [complete]=\"isHaveNextAccountOption === false\"\r\n [compareWith]=\"accountSelectedDisplay\"\r\n (infiniteScroll)=\"getNextAccountBatch()\"\r\n (selectionChange)=\"handleChangeFrom($event.value)\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('from').value?.name\"\r\n (searchRes)=\"updateSearchAccount($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name + ' (' + option.accountNo + ')' }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingAccountOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.from\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('from')?.touched && form.get('from')?.hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <ng-container *ngIf=\"!form.get('isUseExistingTemplate')?.value; else existingTmpl\">\r\n <div\r\n role=\"alert\"\r\n class=\"alert alert-warning d-flex align-items-center\"\r\n style=\"margin-top: 8px; border: 1px solid rgb(243, 124, 44)\"\r\n >\r\n <mat-icon style=\"margin-right: 10px !important\">error_outline</mat-icon>\r\n <div>\r\n Direct Send access restricted for 30 days due to continued misuse. Final warning\r\n before permanent revocation.\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\">\r\n <mat-label class=\"asterix--after\">Body</mat-label>\r\n\r\n <textarea\r\n matInput\r\n rows=\"6\"\r\n cols=\"50\"\r\n cdkTextareaAutosize\r\n cdkAutosizeMinRows=\"2\"\r\n cdkAutosizeMaxRows=\"15\"\r\n formControlName=\"text\"\r\n placeholder=\"Enter text\"\r\n #autosize=\"cdkTextareaAutosize\"\r\n ></textarea>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.text\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('text').touched && form.get('text').hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <app-input\r\n type=\"numeric\"\r\n formControlName=\"ttl\"\r\n label=\"TTL\"\r\n placeholder=\"Enter ttl\"\r\n [trimLeadingZeros]=\"true\"\r\n ></app-input>\r\n </div>\r\n\r\n <div *ngIf=\"!isReadOnlyMode\">\r\n <mat-checkbox formControlName=\"isNeedSave\">\r\n Save this message as future template\r\n </mat-checkbox>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-template #existingTmpl>\r\n <div\r\n role=\"alert\"\r\n class=\"alert alert-warning d-flex align-items-center\"\r\n style=\"margin-top: 8px; border: 1px solid rgb(243, 124, 44)\"\r\n >\r\n <mat-icon style=\"margin-right: 10px !important\">error_outline</mat-icon>\r\n <div>\r\n Direct Send access restricted for 30 days due to continued misuse. Final warning\r\n before permanent revocation.\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">Template</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"template\"\r\n placeholder=\"Select template\"\r\n [complete]=\"isHaveNextTemplateOption === false\"\r\n [compareWith]=\"templateSelectedDisplay\"\r\n (infiniteScroll)=\"getNextTemplateBatch()\"\r\n (selectionChange)=\"updateTemplate($event.value)\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('template').value?.name\"\r\n (searchRes)=\"updateSearch($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of templateOption\" [value]=\"option\">\r\n {{ option.name }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingTemplateOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.template\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('template')?.touched &&\r\n form.get('template')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <app-input\r\n type=\"numeric\"\r\n formControlName=\"ttl\"\r\n label=\"TTL\"\r\n placeholder=\"Enter ttl\"\r\n [trimLeadingZeros]=\"true\"\r\n ></app-input>\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n</form>\r\n",
|
|
4544
4740
|
styles: [".asterix--after:after{content:\"*\";color:red}"]
|
|
4545
4741
|
})
|
|
4546
4742
|
], GeneralInformationWAComponent);
|
|
@@ -4618,7 +4814,7 @@ var FailoverMechanismComponent = /** @class */ (function () {
|
|
|
4618
4814
|
FailoverMechanismComponent.prototype.initForm = function () {
|
|
4619
4815
|
var _this = this;
|
|
4620
4816
|
this.form = new FormGroup({
|
|
4621
|
-
active: new FormControl(false, Validators.required),
|
|
4817
|
+
active: new FormControl(false, Validators$1.required),
|
|
4622
4818
|
type: new FormControl(''),
|
|
4623
4819
|
interval: new FormControl(null),
|
|
4624
4820
|
accounts: new FormArray([]),
|
|
@@ -4668,7 +4864,7 @@ var FailoverMechanismComponent = /** @class */ (function () {
|
|
|
4668
4864
|
}
|
|
4669
4865
|
: (_g = (_f = data) === null || _f === void 0 ? void 0 : _f.accountId, (_g !== null && _g !== void 0 ? _g : '')),
|
|
4670
4866
|
disabled: this.isReadOnlyMode,
|
|
4671
|
-
}, Validators.required),
|
|
4867
|
+
}, Validators$1.required),
|
|
4672
4868
|
accountName: new FormControl((_j = (_h = data) === null || _h === void 0 ? void 0 : _h.accountName, (_j !== null && _j !== void 0 ? _j : ''))),
|
|
4673
4869
|
subject: new FormControl({
|
|
4674
4870
|
value: (_l = (_k = data) === null || _k === void 0 ? void 0 : _k.subject, (_l !== null && _l !== void 0 ? _l : '')),
|
|
@@ -4700,7 +4896,7 @@ var FailoverMechanismComponent = /** @class */ (function () {
|
|
|
4700
4896
|
};
|
|
4701
4897
|
FailoverMechanismComponent.prototype.initParameter = function () {
|
|
4702
4898
|
var form = new FormGroup({
|
|
4703
|
-
name: new FormControl('', Validators.required),
|
|
4899
|
+
name: new FormControl('', Validators$1.required),
|
|
4704
4900
|
});
|
|
4705
4901
|
return form;
|
|
4706
4902
|
};
|
|
@@ -4808,7 +5004,7 @@ var FailoverMechanismComponent = /** @class */ (function () {
|
|
|
4808
5004
|
this.form
|
|
4809
5005
|
.get('type')
|
|
4810
5006
|
.setValue((_c = (_b = (_a = this.getCampaignStorage) === null || _a === void 0 ? void 0 : _a.failover) === null || _b === void 0 ? void 0 : _b.type, (_c !== null && _c !== void 0 ? _c : '')));
|
|
4811
|
-
this.form.get('type').setValidators(Validators.required);
|
|
5007
|
+
this.form.get('type').setValidators(Validators$1.required);
|
|
4812
5008
|
this.form.get('type').updateValueAndValidity();
|
|
4813
5009
|
if (_active) {
|
|
4814
5010
|
var accounts_1 = (_f = (_e = (_d = this.getCampaignStorage) === null || _d === void 0 ? void 0 : _d.failover) === null || _e === void 0 ? void 0 : _e.accounts) === null || _f === void 0 ? void 0 : _f.filter(function (t) {
|
|
@@ -4846,7 +5042,7 @@ var FailoverMechanismComponent = /** @class */ (function () {
|
|
|
4846
5042
|
.setValue((_c = (_b = (_a = this.getCampaignStorage) === null || _a === void 0 ? void 0 : _a.failover) === null || _b === void 0 ? void 0 : _b.interval, (_c !== null && _c !== void 0 ? _c : null)));
|
|
4847
5043
|
this.form
|
|
4848
5044
|
.get('interval')
|
|
4849
|
-
.setValidators([Validators.required, intervalTimeValidator()]);
|
|
5045
|
+
.setValidators([Validators$1.required, intervalTimeValidator()]);
|
|
4850
5046
|
this.form.get('interval').updateValueAndValidity();
|
|
4851
5047
|
return;
|
|
4852
5048
|
}
|
|
@@ -4861,9 +5057,9 @@ var FailoverMechanismComponent = /** @class */ (function () {
|
|
|
4861
5057
|
var isChooseAccount = this.getAccount.filter(function (control) { return control.get('accountId').value; });
|
|
4862
5058
|
this.getAccount.forEach(function (control) {
|
|
4863
5059
|
var _a;
|
|
4864
|
-
control.get('accountId').setValidators(Validators.required);
|
|
4865
|
-
control.get('subject').setValidators(Validators.required);
|
|
4866
|
-
control.get('template').setValidators(Validators.required);
|
|
5060
|
+
control.get('accountId').setValidators(Validators$1.required);
|
|
5061
|
+
control.get('subject').setValidators(Validators$1.required);
|
|
5062
|
+
control.get('template').setValidators(Validators$1.required);
|
|
4867
5063
|
if (!control.get('accountId').value &&
|
|
4868
5064
|
((_a = isChooseAccount) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
4869
5065
|
control.get('accountId').clearValidators();
|
|
@@ -4972,10 +5168,10 @@ var GeneralInformationComponent = /** @class */ (function () {
|
|
|
4972
5168
|
this.form = new FormGroup({
|
|
4973
5169
|
id: new FormControl(null),
|
|
4974
5170
|
campaignName: new FormControl(null, [
|
|
4975
|
-
Validators.required,
|
|
4976
|
-
Validators.maxLength(100),
|
|
5171
|
+
Validators$1.required,
|
|
5172
|
+
Validators$1.maxLength(100),
|
|
4977
5173
|
]),
|
|
4978
|
-
medium: new FormControl(null, [Validators.required]),
|
|
5174
|
+
medium: new FormControl(null, [Validators$1.required]),
|
|
4979
5175
|
});
|
|
4980
5176
|
this.form.valueChanges.subscribe(function () {
|
|
4981
5177
|
_this.isTouchedWAForm = !_this.isTouchedWAForm;
|
|
@@ -5498,7 +5694,7 @@ var SchedulerComponent = /** @class */ (function () {
|
|
|
5498
5694
|
SchedulerComponent.prototype.initForm = function () {
|
|
5499
5695
|
var _this = this;
|
|
5500
5696
|
this.form = new FormGroup({
|
|
5501
|
-
schedulerType: new FormControl(null, Validators.required),
|
|
5697
|
+
schedulerType: new FormControl(null, Validators$1.required),
|
|
5502
5698
|
startDate: new FormControl(null),
|
|
5503
5699
|
startTime: new FormControl(null),
|
|
5504
5700
|
isRepeat: new FormControl(false),
|
|
@@ -5554,9 +5750,9 @@ var SchedulerComponent = /** @class */ (function () {
|
|
|
5554
5750
|
this.form.get('isRepeat').setValue(false);
|
|
5555
5751
|
return;
|
|
5556
5752
|
}
|
|
5557
|
-
this.form.get('startDate').setValidators(Validators.required);
|
|
5753
|
+
this.form.get('startDate').setValidators(Validators$1.required);
|
|
5558
5754
|
this.form.get('startDate').updateValueAndValidity();
|
|
5559
|
-
this.form.get('startTime').setValidators(Validators.required);
|
|
5755
|
+
this.form.get('startTime').setValidators(Validators$1.required);
|
|
5560
5756
|
this.form.get('startTime').updateValueAndValidity();
|
|
5561
5757
|
this.initEdit(false);
|
|
5562
5758
|
};
|
|
@@ -5572,7 +5768,7 @@ var SchedulerComponent = /** @class */ (function () {
|
|
|
5572
5768
|
};
|
|
5573
5769
|
SchedulerComponent.prototype.updateRepeat = function (isChecked) {
|
|
5574
5770
|
if (isChecked) {
|
|
5575
|
-
this.form.get('delivery').setValidators(Validators.required);
|
|
5771
|
+
this.form.get('delivery').setValidators(Validators$1.required);
|
|
5576
5772
|
this.form.get('delivery').updateValueAndValidity();
|
|
5577
5773
|
return;
|
|
5578
5774
|
}
|
|
@@ -5698,6 +5894,7 @@ var CampaignManagementModule = /** @class */ (function () {
|
|
|
5698
5894
|
MatSlideToggleModule,
|
|
5699
5895
|
DragDropModule,
|
|
5700
5896
|
CampaignIndexModule,
|
|
5897
|
+
InputNumericModule,
|
|
5701
5898
|
],
|
|
5702
5899
|
exports: [CampaignManagementComponent, SummaryComponent],
|
|
5703
5900
|
entryComponents: [PendingApprovalDialogViewComponent],
|
|
@@ -5753,5 +5950,5 @@ var ConfirmationModule = /** @class */ (function () {
|
|
|
5753
5950
|
* Generated bundle index. Do not edit.
|
|
5754
5951
|
*/
|
|
5755
5952
|
|
|
5756
|
-
export { AdlCampaignManagementLibraryInternalComponent, AdlCampaignManagementLibraryInternalModule, CampaignIndexModule, CampaignManagementComponent, CampaignManagementModule, ConfirmationComponent, ConfirmationModule, DashboardModule, SearchModule, WizardComponent as ɵa, NewCampaignComponent as ɵb, GeneralInformationComponent as ɵc, SchedulerComponent as ɵd, SummaryComponent as ɵe, NewNumberBasesComponent as ɵf, GeneralInformationLineComponent as ɵg, GeneralInformationWAComponent as ɵh, GeneralInformationSMSComponent as ɵi, GeneralInformationEmailComponent as ɵj, PendingApprovalDialogViewComponent as ɵk, FailoverMechanismComponent as ɵl, DashboardComponent as ɵm, ApiAdapterServiceService as ɵn, SearchComponent as ɵo, ViewingListOfCampaignTableComponent as ɵp, FilterInListOfCampaignComponent as ɵq, CampaignIndexComponent as ɵr, ApiAdapterServiceService as ɵs, MatSelectInfiniteScrollDirective as ɵt,
|
|
5953
|
+
export { AdlCampaignManagementLibraryInternalComponent, AdlCampaignManagementLibraryInternalModule, CampaignIndexModule, CampaignManagementComponent, CampaignManagementModule, ConfirmationComponent, ConfirmationModule, DashboardModule, SearchModule, WizardComponent as ɵa, NewCampaignComponent as ɵb, GeneralInformationComponent as ɵc, SchedulerComponent as ɵd, SummaryComponent as ɵe, NewNumberBasesComponent as ɵf, GeneralInformationLineComponent as ɵg, GeneralInformationWAComponent as ɵh, GeneralInformationSMSComponent as ɵi, GeneralInformationEmailComponent as ɵj, PendingApprovalDialogViewComponent as ɵk, FailoverMechanismComponent as ɵl, DashboardComponent as ɵm, ApiAdapterServiceService as ɵn, SearchComponent as ɵo, ViewingListOfCampaignTableComponent as ɵp, FilterInListOfCampaignComponent as ɵq, CampaignIndexComponent as ɵr, ApiAdapterServiceService as ɵs, MatSelectInfiniteScrollDirective as ɵt, InputNumericModule as ɵu, InputNumericComponent as ɵv, CustomPaginator as ɵw, ConfirmationComponent as ɵx, ConfirmationModel as ɵy, SharedServicesService as ɵz };
|
|
5757
5954
|
//# sourceMappingURL=adlfe-campaign-management-library.js.map
|