File tree Expand file tree Collapse file tree
src/app/core/json-patch/builder Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ import { VocabularyEntry } from '../../submission/vocabularies/models/vocabulary
1313import { FormFieldMetadataValueObject } from '../../../shared/form/builder/models/form-field-metadata-value.model' ;
1414import { FormFieldLanguageValueObject } from '../../../shared/form/builder/models/form-field-language-value.model' ;
1515import { CoreState } from '../../core-state.model' ;
16+ import { Metadata } from '../../shared/metadata.utils' ;
17+ import { ConfidenceType } from '../../shared/confidence-type' ;
1618
1719/**
1820 * Provides methods to dispatch JsonPatch Operations Actions
@@ -148,6 +150,11 @@ export class JsonPatchOperationsBuilder {
148150 } else {
149151 operationValue = value ;
150152 }
153+ //Update confidence if was added once the field was already created, value is set only in constructor of FormFieldMetadataValueObject
154+ if ( Metadata . hasValidAuthority ( operationValue . authority ) && ( isEmpty ( operationValue . confidence ) || operationValue . confidence === - 1 ) ) {
155+ operationValue . confidence = ConfidenceType . CF_ACCEPTED ;
156+ }
157+
151158 } else if ( value instanceof Date ) {
152159 if ( securityLevel != null ) {
153160 operationValue = new FormFieldMetadataValueObject ( dateToISOFormat ( value ) , null , securityLevel ) ;
You can’t perform that action at this time.
0 commit comments