cat-qw-lib 0.29.2 → 0.29.3

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.
@@ -576,14 +576,14 @@ class BaseControlComponent {
576
576
  this.baseStore.setIsFormSubmitted(false);
577
577
  }
578
578
  });
579
- this.baseQuery.getAttributeModelList()
580
- .pipe(takeUntil(this.attributeDestroy$))
581
- .subscribe((res) => {
582
- console.log(res);
583
- if (res !== undefined && res !== null) {
584
- BaseControlComponent.allAttributes = res;
585
- }
586
- });
579
+ // this.baseQuery.getAttributeModelList()
580
+ // .pipe(takeUntil(this.attributeDestroy$))
581
+ // .subscribe((res) => {
582
+ // console.log(res);
583
+ // if(res !== undefined && res !== null){
584
+ // BaseControlComponent.allAttributes = res;
585
+ // }
586
+ // })
587
587
  }
588
588
  ngOnChanges() {
589
589
  if (this.store) {
@@ -1223,43 +1223,41 @@ class BaseFormComponent {
1223
1223
  this.baseQuery.getAttributeModelList()
1224
1224
  .pipe(takeUntil(this.destroy$))
1225
1225
  .subscribe((attributeModels) => {
1226
- attributeModels.forEach(attr => {
1227
- const handleCheckAndAddMissingField = (value) => {
1228
- if (attr.isRequired &&
1229
- (value === undefined || value === null || (typeof value === SHARED.STRING && value.trim() === SHARED.EMPTY))) {
1230
- if (this.baseStore)
1231
- this.baseStore.missingFields.push(attr.displayText || attr.name);
1232
- }
1233
- };
1234
- if (attr.isRequired && attr.name in this.record) {
1235
- handleCheckAndAddMissingField(this.record[attr.name]);
1236
- }
1237
- [SHARED.DICTIONARYITEMS, SHARED.DATAITEMS].forEach(key => {
1238
- this.record[key]?.forEach((val) => {
1239
- if (val.hasOwnProperty(attr.name)) {
1240
- handleCheckAndAddMissingField(val[attr.name]);
1241
- }
1242
- });
1243
- });
1244
- });
1245
- if (this.baseStore && this.baseStore.missingFields.length > 0) {
1246
- if (this.baseStore)
1247
- this.baseStore.setIsFormSubmitted(true);
1248
- console.error(ERROR.MISSING_REQUIRED_FIELD, this.baseStore.missingFields);
1249
- }
1250
- else {
1251
- if (!this.currentState?.isApiValidated && this.currentState?.isApiValidated !== null) {
1252
- this.baseStore?.setIsShowMessage(!this.currentState?.isApiValidated);
1253
- }
1254
- else if (validateRecords) {
1255
- if (this.record._id) {
1256
- this.handleUpdateRecord();
1257
- }
1258
- else {
1259
- this.handleAddRecord();
1260
- }
1261
- }
1262
- }
1226
+ console.log(attributeModels);
1227
+ // attributeModels.forEach(attr => {
1228
+ // const handleCheckAndAddMissingField = (value: any) => {
1229
+ // if (attr.isRequired &&
1230
+ // (value === undefined || value === null || (typeof value === SHARED.STRING && value.trim() === SHARED.EMPTY))
1231
+ // ) {
1232
+ // if(this.baseStore) this.baseStore.missingFields.push(attr.displayText || attr.name);
1233
+ // }
1234
+ // };
1235
+ // if (attr.isRequired && attr.name in this.record) {
1236
+ // handleCheckAndAddMissingField(this.record[attr.name]);
1237
+ // }
1238
+ // [SHARED.DICTIONARYITEMS, SHARED.DATAITEMS].forEach(key => {
1239
+ // this.record[key]?.forEach((val: any) => {
1240
+ // if(val.hasOwnProperty(attr.name)) {
1241
+ // handleCheckAndAddMissingField(val[attr.name])
1242
+ // }
1243
+ // });
1244
+ // });
1245
+ // });
1246
+ // if (this.baseStore && this.baseStore.missingFields.length > 0) {
1247
+ // if(this.baseStore) this.baseStore.setIsFormSubmitted(true);
1248
+ // console.error(ERROR.MISSING_REQUIRED_FIELD, this.baseStore.missingFields);
1249
+ // } else {
1250
+ // if(!this.currentState?.isApiValidated && this.currentState?.isApiValidated !== null) {
1251
+ // this.baseStore?.setIsShowMessage(!this.currentState?.isApiValidated);
1252
+ // }
1253
+ // else if(validateRecords) {
1254
+ // if (this.record._id) {
1255
+ // this.handleUpdateRecord();
1256
+ // } else {
1257
+ // this.handleAddRecord();
1258
+ // }
1259
+ // }
1260
+ // }
1263
1261
  });
1264
1262
  }
1265
1263
  }