mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-14 05:23:06 +00:00
Added form field parser factory to remove switch in row-parser.ts
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { FormFieldModel } from '../models/form-field.model';
|
||||
import { FieldParser } from './field-parser';
|
||||
import {
|
||||
DynamicLookupNameModel,
|
||||
@@ -7,18 +6,11 @@ import {
|
||||
|
||||
export class LookupNameFieldParser extends FieldParser {
|
||||
|
||||
constructor(protected configData: FormFieldModel,
|
||||
protected initFormValues,
|
||||
protected readOnly: boolean,
|
||||
protected authorityUuid: string) {
|
||||
super(configData, initFormValues, readOnly);
|
||||
}
|
||||
|
||||
public modelFactory(fieldValue: any): any {
|
||||
if (this.configData.selectableMetadata[0].authority) {
|
||||
const lookupModelConfig: DynamicLookupNameModelConfig = this.initModel();
|
||||
|
||||
this.setAuthorityOptions(lookupModelConfig, this.authorityUuid);
|
||||
this.setAuthorityOptions(lookupModelConfig, this.parserOptions.authorityUuid);
|
||||
|
||||
this.setValues(lookupModelConfig, fieldValue, true);
|
||||
|
||||
|
Reference in New Issue
Block a user