Skip to content

Commit 0272f9a

Browse files
authored
Merge branch 'DSpace:main' into orcid-settings-button-accessibility
2 parents bd1881f + e2c5171 commit 0272f9a

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/app/shared/form/builder/ds-dynamic-form-ui/models/dynamic-vocabulary.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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);

src/app/shared/form/builder/models/form-field-metadata-value.model.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ export interface OtherInformation {
1111
* A class representing a specific input-form field's value
1212
*/
1313
export 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
*/

0 commit comments

Comments
 (0)