mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
[TLC-254] tidy up imports, regexes, mock data
This commit is contained in:
@@ -14,7 +14,7 @@ import {
|
||||
DynamicEditorModel,
|
||||
DynamicFileUploadModel,
|
||||
DynamicFormArrayModel,
|
||||
DynamicFormControlModel, DynamicFormControlRelation,
|
||||
DynamicFormControlModel,
|
||||
DynamicFormGroupModel,
|
||||
DynamicFormsCoreModule,
|
||||
DynamicFormService,
|
||||
|
@@ -73,7 +73,7 @@ export class FormBuilderService extends DynamicFormService {
|
||||
this.formModels = new Map();
|
||||
this.formGroups = new Map();
|
||||
// Replace . with _ in configured type field here, to make configuration more simple and user-friendly
|
||||
this.typeField = environment.submission.typeBind.field.replace('\.', '_');
|
||||
this.typeField = environment.submission.typeBind.field.replace(/\./g, '_');
|
||||
}
|
||||
|
||||
createDynamicFormControlEvent(control: FormControl, group: FormGroup, model: DynamicFormControlModel, type: string): DynamicFormControlEvent {
|
||||
|
@@ -40,7 +40,7 @@ export abstract class FieldParser {
|
||||
@Inject(PARSER_OPTIONS) protected parserOptions: ParserOptions
|
||||
) {
|
||||
// Replace . with _ in configured type field here, to make configuration more simple and user-friendly
|
||||
this.typeField = environment.submission.typeBind.field.replace('\.', '_');
|
||||
this.typeField = environment.submission.typeBind.field.replace(/\./g, '_');
|
||||
}
|
||||
|
||||
public abstract modelFactory(fieldValue?: FormFieldMetadataValueObject, label?: boolean): any;
|
||||
|
@@ -4,26 +4,6 @@ import {DsDynamicInputModel} from '../form/builder/ds-dynamic-form-ui/models/ds-
|
||||
|
||||
export function getMockFormBuilderService(): FormBuilderService {
|
||||
|
||||
const inputWithTypeBindConfig = {
|
||||
name: 'testWithTypeBind',
|
||||
id: 'testWithTypeBind',
|
||||
readOnly: false,
|
||||
disabled: false,
|
||||
repeatable: false,
|
||||
value: {
|
||||
value: 'testWithTypeBind',
|
||||
display: 'testWithTypeBind'
|
||||
},
|
||||
submissionId: '1234',
|
||||
metadataFields: [],
|
||||
hasSelectableMetadata: false,
|
||||
typeBindRelations: [
|
||||
{match: 'VISIBLE', operator: 'OR', when: [{'id': 'dc.type', 'value': 'boundType'}]}
|
||||
]
|
||||
};
|
||||
|
||||
const thing = new DsDynamicInputModel(inputWithTypeBindConfig);
|
||||
|
||||
return jasmine.createSpyObj('FormBuilderService', {
|
||||
modelFromConfiguration: [],
|
||||
createFormGroup: new FormGroup({}),
|
||||
@@ -55,7 +35,7 @@ export function getMockFormBuilderService(): FormBuilderService {
|
||||
metadataFields: ['dc.type'],
|
||||
hasSelectableMetadata: false,
|
||||
typeBindRelations: [
|
||||
{match: 'VISIBLE', operator: 'OR', when: [{'id': 'dc.type', 'value': 'boundType'}]}
|
||||
{match: 'VISIBLE', operator: 'OR', when: [{id: 'dc.type', value: 'boundType'}]}
|
||||
]
|
||||
}
|
||||
)
|
||||
|
Reference in New Issue
Block a user