Skip to content

Commit

Permalink
Merged in DSC-1590 (pull request DSpace#1530)
Browse files Browse the repository at this point in the history
[DSC-1590]

Approved-by: Andrea Barbasso
  • Loading branch information
Simone-Ramundi authored and Andrea Barbasso committed Apr 24, 2024
2 parents f835e19 + 97ce799 commit f3f7983
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ds-chips [chips]="chips"
[editable]="!model.readOnly"
[showIcons]="model.hasAuthority"
[wrapperClass]="'border-bottom border-light'">
[wrapperClass]="'border-bottom'">

<input *ngIf="!model.hasAuthority"
class="border-0 form-control-plaintext tag-input flex-grow-1 mt-1 mb-1"
Expand Down
15 changes: 9 additions & 6 deletions src/app/shared/form/builder/parsers/tag-field-parser.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
import { FieldParser } from './field-parser';
import { FormFieldMetadataValueObject } from '../models/form-field-metadata-value.model';
import { DynamicTagModel, DynamicTagModelConfig } from '../ds-dynamic-form-ui/models/tag/dynamic-tag.model';

import {DynamicFormControlLayout} from '@ng-dynamic-forms/core';
export class TagFieldParser extends FieldParser {

public modelFactory(fieldValue?: FormFieldMetadataValueObject | any, label?: boolean): any {
let clsTag: DynamicFormControlLayout;
clsTag = {
grid: {
container: 'mb-3 mt-3',
}
};
const tagModelConfig: DynamicTagModelConfig = this.initModel(null, label);
if (this.configData.selectableMetadata[0].controlledVocabulary
&& this.configData.selectableMetadata[0].controlledVocabulary.length > 0) {
this.setVocabularyOptions(tagModelConfig, this.parserOptions.collectionUUID);
}

this.setValues(tagModelConfig, fieldValue, null, true);

const tagModel = new DynamicTagModel(tagModelConfig);

tagModelConfig.placeholder = 'Enter the Keywords';
const tagModel = new DynamicTagModel(tagModelConfig, clsTag);
return tagModel;
}

Expand Down

0 comments on commit f3f7983

Please sign in to comment.