cat-qw-lib 0.32.5 → 0.32.6

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.
@@ -739,11 +739,9 @@ class FormContainerComponent {
739
739
  });
740
740
  }
741
741
  handleSaveClick() {
742
- console.log("7");
743
742
  this.onSave.emit();
744
743
  }
745
744
  handleCancelClick() {
746
- console.log("8");
747
745
  this.onCancel.emit();
748
746
  }
749
747
  handleCreateBtnClick() { }
@@ -1187,6 +1185,7 @@ class BaseFormComponent {
1187
1185
  record;
1188
1186
  recordChange = new BehaviorSubject({});
1189
1187
  destroy$ = new Subject();
1188
+ onSave = new EventEmitter();
1190
1189
  onFormNavigate = new EventEmitter();
1191
1190
  onCancel = new EventEmitter();
1192
1191
  constructor(service, validatorService, router, activatedRoute, baseStore, baseQuery) {
@@ -1218,7 +1217,6 @@ class BaseFormComponent {
1218
1217
  }
1219
1218
  }
1220
1219
  handleSubmit() {
1221
- console.log("Submitting form...");
1222
1220
  const validateRecords = this.validatorService
1223
1221
  ? this.validatorService.handleValidateRecords(this.record)
1224
1222
  : true;
@@ -1250,7 +1248,8 @@ class BaseFormComponent {
1250
1248
  });
1251
1249
  });
1252
1250
  if (this.baseStore && this.baseStore.missingFields.length > 0) {
1253
- this.baseStore.setIsFormSubmitted(true);
1251
+ if (this.baseStore)
1252
+ this.baseStore.setIsFormSubmitted(true);
1254
1253
  console.error(ERROR.MISSING_REQUIRED_FIELD, this.baseStore.missingFields);
1255
1254
  }
1256
1255
  else {
@@ -1276,6 +1275,7 @@ class BaseFormComponent {
1276
1275
  return;
1277
1276
  this.service.update(this.record._id, this.record).subscribe({
1278
1277
  next: (response) => {
1278
+ console.log('Record updated:', response);
1279
1279
  this.record = {};
1280
1280
  this.baseStore?.setIsApiValidated(null);
1281
1281
  this.onFormNavigate.emit(response);
@@ -1290,6 +1290,7 @@ class BaseFormComponent {
1290
1290
  return;
1291
1291
  this.service.create(this.record).subscribe({
1292
1292
  next: (response) => {
1293
+ console.log('Record created:', response);
1293
1294
  this.record = {};
1294
1295
  this.baseStore?.setIsApiValidated(null);
1295
1296
  this.onFormNavigate.emit(response);
@@ -1308,17 +1309,20 @@ class BaseFormComponent {
1308
1309
  if (this.baseStore) {
1309
1310
  this.baseStore.setAttributeModelList([]);
1310
1311
  this.baseStore.setIsApiValidated(null);
1312
+ console.log(this.currentState);
1311
1313
  }
1312
1314
  this.destroy$.next();
1313
1315
  this.destroy$.complete();
1314
1316
  }
1315
1317
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: BaseFormComponent, deps: [{ token: BaseService }, { token: ValidatorService }, { token: i3$4.Router }, { token: i3$4.ActivatedRoute }, { token: BaseStore }, { token: BaseQuery }], target: i0.ɵɵFactoryTarget.Component });
1316
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.4", type: BaseFormComponent, isStandalone: true, selector: "base-form", outputs: { onFormNavigate: "onFormNavigate", onCancel: "onCancel" }, providers: [ValidatorService], ngImport: i0, template: "<p>base-form works!</p>\r\n", styles: [""] });
1318
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.4", type: BaseFormComponent, isStandalone: true, selector: "base-form", outputs: { onSave: "onSave", onFormNavigate: "onFormNavigate", onCancel: "onCancel" }, providers: [ValidatorService], ngImport: i0, template: "<p>base-form works!</p>\r\n", styles: [""] });
1317
1319
  }
1318
1320
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: BaseFormComponent, decorators: [{
1319
1321
  type: Component,
1320
1322
  args: [{ selector: 'base-form', providers: [ValidatorService], template: "<p>base-form works!</p>\r\n" }]
1321
- }], ctorParameters: () => [{ type: BaseService }, { type: ValidatorService }, { type: i3$4.Router }, { type: i3$4.ActivatedRoute }, { type: BaseStore }, { type: BaseQuery }], propDecorators: { onFormNavigate: [{
1323
+ }], ctorParameters: () => [{ type: BaseService }, { type: ValidatorService }, { type: i3$4.Router }, { type: i3$4.ActivatedRoute }, { type: BaseStore }, { type: BaseQuery }], propDecorators: { onSave: [{
1324
+ type: Output
1325
+ }], onFormNavigate: [{
1322
1326
  type: Output
1323
1327
  }], onCancel: [{
1324
1328
  type: Output
@@ -2061,7 +2065,7 @@ class ApiAdminFormComponent extends BaseFormComponent {
2061
2065
  }
2062
2066
  ngOnInit() {
2063
2067
  this.init();
2064
- this.baseStore.setIsApiValidated(null);
2068
+ this.baseStore.setIsApiValidated(false);
2065
2069
  }
2066
2070
  hanldeValidateApi() {
2067
2071
  const payload = {
@@ -2574,7 +2578,6 @@ class QueueAdminFormComponent extends BaseFormComponent {
2574
2578
  rules: [],
2575
2579
  };
2576
2580
  ngOnInit() {
2577
- this.baseStore.setIsApiValidated(null);
2578
2581
  this.service.initList();
2579
2582
  const id = this.activatedRoute
2580
2583
  ? this.activatedRoute.snapshot.params[SHARED.ID]
@@ -2611,7 +2614,6 @@ class QueueAdminFormComponent extends BaseFormComponent {
2611
2614
  next: (res) => {
2612
2615
  if (res) {
2613
2616
  this.fetchedProperties = res.properties;
2614
- console.log(this.fetchedProperties);
2615
2617
  const updatedPropertyList = res.properties.map((value) => ({ value }));
2616
2618
  this.apiPropertyList = updatedPropertyList;
2617
2619
  this.setupQueryBuilderConfig(res.properties);
@@ -2969,7 +2971,7 @@ class AdminActionFormComponent extends BaseFormComponent {
2969
2971
  }
2970
2972
  ngOnInit() {
2971
2973
  this.init();
2972
- this.baseStore.setIsApiValidated(null);
2974
+ this.baseStore.setIsApiValidated(false);
2973
2975
  }
2974
2976
  handleValidateAction() {
2975
2977
  const payload = { path: this.record.apiDocsUrl };
@@ -3476,6 +3478,9 @@ class TemplateAdminFormComponent extends BaseFormComponent {
3476
3478
  ngOnInit() {
3477
3479
  super.init();
3478
3480
  }
3481
+ ngOnChanges(changes) {
3482
+ console.log(this.record);
3483
+ }
3479
3484
  handleQueueChange(event) {
3480
3485
  this.query.getLists().subscribe((allLists) => {
3481
3486
  const allDictionaryRecords = allLists.find((list) => list.forProperty === 'dictionaryID')?.records;
@@ -3494,7 +3499,7 @@ class TemplateAdminFormComponent extends BaseFormComponent {
3494
3499
  }
3495
3500
  ;
3496
3501
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: TemplateAdminFormComponent, deps: [{ token: TemplateAdminService }, { token: ValidatorService }, { token: i3$4.Router }, { token: i3$4.ActivatedRoute }, { token: TemplateAdminQuery }, { token: TemplateAdminStore }, { token: BaseStore }, { token: BaseQuery }], target: i0.ɵɵFactoryTarget.Component });
3497
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.4", type: TemplateAdminFormComponent, isStandalone: false, selector: "lib-template-admin-form", usesInheritance: true, ngImport: i0, template: "<form-container [record]=\"record\" [showSave]=\"true\" [messages]=\"message\" (onSave)=\"handleSubmit()\"\r\n (onCancel)=\"handleCancel()\">\r\n <div class=\"card p-fluid p-formgrid\">\r\n <h4 class=\"font-bold col-12 md:col-12\">Template Form</h4>\r\n <div class=\"col-12 md:col-12 flex px-0\">\r\n <div class=\"col-12 md:col-6\">\r\n <text-box [store]=\"templateStore\" [record]=\"record\" [attributeModel]=\"{\r\n readonly: false,\r\n name: 'name',\r\n isRequired: true,\r\n displayText: 'Name',\r\n placeholder: 'Enter Template Name'\r\n }\"></text-box>\r\n </div>\r\n\r\n <div class=\"col-12 md:col-6\">\r\n <div class=\"p-field queue-list-wrapper\">\r\n <dropdown [store]=\"templateStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name: 'type',\r\n displayText: 'Type',\r\n listLabelProperty: 'value',\r\n listValueProperty: 'value',\r\n placeholder: 'Select Type',\r\n isRequired: true,\r\n options: templateTypeList\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-12 md:col-12 flex px-0\">\r\n <div class=\"col-12 md:col-6\">\r\n <dropdown [store]=\"templateStore\" [record]=\"record\" [attributeModel]=\"{\r\n name:'queueId',\r\n listLabelProperty: 'name',\r\n listValueProperty: '_id',\r\n displayText : 'Select Queue',\r\n placeholder: 'Select Queue',\r\n isRequired:true\r\n }\" (onInput)=\"handleQueueChange($event)\">\r\n </dropdown>\r\n </div>\r\n\r\n <div class=\"col-12 md:col-6\">\r\n <dropdown [store]=\"templateStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name: 'dictionaryID',\r\n displayText: 'Select Dictionary',\r\n listLabelProperty: 'name',\r\n listValueProperty: '_id',\r\n placeholder: 'Select Dictionary',\r\n options: dictionaries\r\n }\" (onInput)=\"handleDictionarySelect($event)\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-12 md:col-12 flex px-0\">\r\n <div *ngIf=\"record.type === 'email'\" class=\"col-12 md:col-6\">\r\n <text-box [store]=\"templateStore\" [record]=\"record\" [attributeModel]=\"{\r\n readonly: false,\r\n name: 'subject',\r\n isRequired: true,\r\n displayText: 'Subject',\r\n placeholder: 'Enter Subject'\r\n }\"></text-box>\r\n </div>\r\n\r\n <div class=\"col-12 md:col-6\">\r\n <dropdown [store]=\"templateStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name: 'dictionaryItemID',\r\n displayText: 'Select Dictionary Item',\r\n listLabelProperty: 'itemName',\r\n listValueProperty: '_id',\r\n placeholder: 'Select Dictionary Item',\r\n options: dictionaryItems\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-12 md:col-12\">\r\n <label>Message</label>\r\n <span class=\"asterisk ml-1\">*</span>\r\n <quill-editor [(ngModel)]=\"messageContent\" class=\"w-full mt-2\"></quill-editor>\r\n </div>\r\n </div>\r\n</form-container>", styles: [".asterisk{color:red}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TextBoxComponent, selector: "text-box" }, { kind: "component", type: DropdownComponent, selector: "dropdown", inputs: ["isStaticDropdown"] }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: FormContainerComponent, selector: "form-container", inputs: ["messages", "record", "headerText", "showSave", "disableSaveButton"], outputs: ["onSave", "onCancel"] }, { kind: "component", type: i1$2.QuillEditorComponent, selector: "quill-editor" }] });
3502
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.4", type: TemplateAdminFormComponent, isStandalone: false, selector: "lib-template-admin-form", usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<form-container [record]=\"record\" [showSave]=\"true\" [messages]=\"message\" (onSave)=\"handleSubmit()\"\r\n (onCancel)=\"handleCancel()\">\r\n <div class=\"card p-fluid p-formgrid\">\r\n <h4 class=\"font-bold col-12 md:col-12\">Template Form</h4>\r\n <div class=\"col-12 md:col-12 flex px-0\">\r\n <div class=\"col-12 md:col-6\">\r\n <text-box [store]=\"templateStore\" [record]=\"record\" [attributeModel]=\"{\r\n readonly: false,\r\n name: 'name',\r\n isRequired: true,\r\n displayText: 'Name',\r\n placeholder: 'Enter Template Name'\r\n }\"></text-box>\r\n </div>\r\n\r\n <div class=\"col-12 md:col-6\">\r\n <div class=\"p-field queue-list-wrapper\">\r\n <dropdown [store]=\"templateStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name: 'type',\r\n displayText: 'Type',\r\n listLabelProperty: 'value',\r\n listValueProperty: 'value',\r\n placeholder: 'Select Type',\r\n isRequired: true,\r\n options: templateTypeList\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-12 md:col-12 flex px-0\">\r\n <div class=\"col-12 md:col-6\">\r\n <dropdown [store]=\"templateStore\" [record]=\"record\" [attributeModel]=\"{\r\n name:'queueId',\r\n listLabelProperty: 'name',\r\n listValueProperty: '_id',\r\n displayText : 'Select Queue',\r\n placeholder: 'Select Queue',\r\n isRequired:true\r\n }\" (onInput)=\"handleQueueChange($event)\">\r\n </dropdown>\r\n </div>\r\n\r\n <div class=\"col-12 md:col-6\">\r\n <dropdown [store]=\"templateStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name: 'dictionaryID',\r\n displayText: 'Select Dictionary',\r\n listLabelProperty: 'name',\r\n listValueProperty: '_id',\r\n placeholder: 'Select Dictionary',\r\n options: dictionaries\r\n }\" (onInput)=\"handleDictionarySelect($event)\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-12 md:col-12 flex px-0\">\r\n <div *ngIf=\"record.type === 'email'\" class=\"col-12 md:col-6\">\r\n <text-box [store]=\"templateStore\" [record]=\"record\" [attributeModel]=\"{\r\n readonly: false,\r\n name: 'subject',\r\n isRequired: true,\r\n displayText: 'Subject',\r\n placeholder: 'Enter Subject'\r\n }\"></text-box>\r\n </div>\r\n\r\n <div class=\"col-12 md:col-6\">\r\n <dropdown [store]=\"templateStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name: 'dictionaryItemID',\r\n displayText: 'Select Dictionary Item',\r\n listLabelProperty: 'itemName',\r\n listValueProperty: '_id',\r\n placeholder: 'Select Dictionary Item',\r\n options: dictionaryItems\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-12 md:col-12\">\r\n <label>Message</label>\r\n <span class=\"asterisk ml-1\">*</span>\r\n <quill-editor [(ngModel)]=\"messageContent\" class=\"w-full mt-2\"></quill-editor>\r\n </div>\r\n </div>\r\n</form-container>", styles: [".asterisk{color:red}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TextBoxComponent, selector: "text-box" }, { kind: "component", type: DropdownComponent, selector: "dropdown", inputs: ["isStaticDropdown"] }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: FormContainerComponent, selector: "form-container", inputs: ["messages", "record", "headerText", "showSave", "disableSaveButton"], outputs: ["onSave", "onCancel"] }, { kind: "component", type: i1$2.QuillEditorComponent, selector: "quill-editor" }] });
3498
3503
  }
3499
3504
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: TemplateAdminFormComponent, decorators: [{
3500
3505
  type: Component,