Skip to content

Commit f38de3d

Browse files
[DSC-2038] Set property from environment
1 parent 77c4327 commit f38de3d

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/app/shared/form/builder/parsers/onebox-field-parser.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { DynamicSelectModel, DynamicSelectModelConfig } from '@ng-dynamic-forms/core';
2+
import { environment } from '../../../../../environments/environment';
23

34
import { FieldParser } from './field-parser';
45
import {
@@ -82,6 +83,7 @@ export class OneboxFieldParser extends FieldParser {
8283
const oneboxModelConfig: DsDynamicOneboxModelConfig = this.initModel(null, label);
8384
this.setVocabularyOptions(oneboxModelConfig, this.parserOptions.collectionUUID);
8485
oneboxModelConfig.submissionScope = this.parserOptions.submissionScope;
86+
oneboxModelConfig.minChars = environment.submission.minChars;
8587
this.setValues(oneboxModelConfig, fieldValue, true);
8688

8789
return new DynamicOneboxModel(oneboxModelConfig);

src/app/shared/form/builder/parsers/tag-field-parser.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { FieldParser } from './field-parser';
22
import { FormFieldMetadataValueObject } from '../models/form-field-metadata-value.model';
33
import { DynamicTagModel, DynamicTagModelConfig } from '../ds-dynamic-form-ui/models/tag/dynamic-tag.model';
44
import {DynamicFormControlLayout} from '@ng-dynamic-forms/core';
5+
import { environment } from '../../../../../environments/environment';
6+
57
export class TagFieldParser extends FieldParser {
68
public modelFactory(fieldValue?: FormFieldMetadataValueObject | any, label?: boolean): any {
79
let clsTag: DynamicFormControlLayout;
@@ -15,6 +17,7 @@ export class TagFieldParser extends FieldParser {
1517
&& this.configData.selectableMetadata[0].controlledVocabulary.length > 0) {
1618
this.setVocabularyOptions(tagModelConfig, this.parserOptions.collectionUUID);
1719
}
20+
tagModelConfig.minChars = environment.submission.minChars;
1821
this.setValues(tagModelConfig, fieldValue, null, true);
1922
tagModelConfig.placeholder = 'Enter the Keywords';
2023
const tagModel = new DynamicTagModel(tagModelConfig, clsTag);

0 commit comments

Comments
 (0)