File tree Expand file tree Collapse file tree
src/app/shared/form/builder
ds-dynamic-form-ui/models Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ export abstract class DsDynamicVocabularyComponent extends DynamicFormControlCom
5353 */
5454 getInitValueFromModel ( ) : Observable < FormFieldMetadataValueObject > {
5555 let initValue$ : Observable < FormFieldMetadataValueObject > ;
56- if ( isNotEmpty ( this . model . value ) && ( this . model . value instanceof FormFieldMetadataValueObject ) ) {
56+ if ( isNotEmpty ( this . model . value ) && ( this . model . value instanceof FormFieldMetadataValueObject ) && ! this . model . value . hasAuthorityToGenerate ( ) ) {
5757 let initEntry$ : Observable < VocabularyEntry > ;
5858 if ( this . model . value . hasAuthority ( ) ) {
5959 initEntry$ = this . vocabularyService . getVocabularyEntryByID ( this . model . value . authority , this . model . vocabularyOptions ) ;
Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ export interface OtherInformation {
1111 * A class representing a specific input-form field's value
1212 */
1313export class FormFieldMetadataValueObject implements MetadataValueInterface {
14+
15+ static readonly AUTHORITY_SPLIT : string = '::' ;
16+ static readonly AUTHORITY_GENERATE : string = 'will be generated' + FormFieldMetadataValueObject . AUTHORITY_SPLIT ;
17+
1418 metadata ?: string ;
1519 value : any ;
1620 display : string ;
@@ -58,6 +62,13 @@ export class FormFieldMetadataValueObject implements MetadataValueInterface {
5862 return isNotEmpty ( this . authority ) ;
5963 }
6064
65+ /**
66+ * Returns true if this object has an authority value that needs to be generated
67+ */
68+ hasAuthorityToGenerate ( ) : boolean {
69+ return isNotEmpty ( this . authority ) && this . authority . startsWith ( FormFieldMetadataValueObject . AUTHORITY_GENERATE ) ;
70+ }
71+
6172 /**
6273 * Returns true if this this object has a value
6374 */
You can’t perform that action at this time.
0 commit comments