fix description checkBox bug and add hash conflict to callback errors

This commit is contained in:
amentis 2024-04-23 18:52:41 +03:00
parent f5b0af516a
commit a3350b2f2c
3 changed files with 7 additions and 1 deletions

View File

@ -113,7 +113,7 @@ public class FieldPersist {
boolean required = this.fieldEntity != null && this.fieldEntity.getValidations() != null ? this.fieldEntity.getValidations().contains(FieldValidationType.Required) : false; boolean required = this.fieldEntity != null && this.fieldEntity.getValidations() != null ? this.fieldEntity.getValidations().contains(FieldValidationType.Required) : false;
return Arrays.asList( return Arrays.asList(
this.spec() this.spec()
.iff(()-> FieldType.isTextType(fieldType) && DescriptionStatus.Finalized.equals(this.status) && required) .iff(()-> FieldType.isTextType(fieldType) && !fieldType.equals(FieldType.CHECK_BOX) && DescriptionStatus.Finalized.equals(this.status) && required)
.must(() -> !this.isEmpty(item.getTextValue())) .must(() -> !this.isEmpty(item.getTextValue()))
.failOn(FieldPersist._textValue).failWith(messageSource.getMessage("Validation_Required", new Object[]{FieldPersist._textValue}, LocaleContextHolder.getLocale())), .failOn(FieldPersist._textValue).failWith(messageSource.getMessage("Validation_Required", new Object[]{FieldPersist._textValue}, LocaleContextHolder.getLocale())),
this.spec() this.spec()

View File

@ -163,6 +163,9 @@ export class DescriptionFormFieldComponent extends BaseComponent implements OnIn
// this.form.disable(); // this.form.disable();
// } // }
break; break;
case DescriptionTemplateFieldType.CHECK_BOX:
if (this.propertiesFormGroup?.get(this.field.id).get('textValue').value == "false") this.propertiesFormGroup?.get(this.field.id).get('textValue').setValue(undefined);
break;
} }
// this.form = this.visibilityRulesService.getFormGroup(this.field.id); // this.form = this.visibilityRulesService.getFormGroup(this.field.id);

View File

@ -132,6 +132,9 @@ export abstract class BaseEditor<EditorModelType extends BaseEditorModel, Entity
const error: HttpError = this.httpErrorHandlingService.getError(errorResponse); const error: HttpError = this.httpErrorHandlingService.getError(errorResponse);
if (error.statusCode === 400) { if (error.statusCode === 400) {
this.editorModel.validationErrorModel.fromJSONObject(errorResponse.error); this.editorModel.validationErrorModel.fromJSONObject(errorResponse.error);
if(errorResponse.error.code === ResponseErrorCode.HashConflict){
this.uiNotificationService.snackBarNotification(errorResponse.error.error, SnackBarNotificationLevel.Error);
}
if(errorResponse.error.code === ResponseErrorCode.DmpBlueprintHasNoDescriptionTemplates){ if(errorResponse.error.code === ResponseErrorCode.DmpBlueprintHasNoDescriptionTemplates){
this.uiNotificationService.snackBarNotification(errorResponse.error.error, SnackBarNotificationLevel.Error); this.uiNotificationService.snackBarNotification(errorResponse.error.error, SnackBarNotificationLevel.Error);
} }