Add option to make static dataset profile fields with autocomplete to have multiple values

This commit is contained in:
George Kalampokis 2020-12-09 17:51:30 +02:00
parent b5a9aa9ad3
commit 3b00b76f19
22 changed files with 178 additions and 22 deletions

View File

@ -7,10 +7,21 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class DataRepositoriesData extends FieldData<DataRepositoriesData> { public class DataRepositoriesData extends FieldData<DataRepositoriesData> {
private Boolean multiAutoComplete;
public Boolean getMultiAutoComplete() {
return multiAutoComplete;
}
public void setMultiAutoComplete(Boolean multiAutoComplete) {
this.multiAutoComplete = multiAutoComplete;
}
@Override @Override
public DataRepositoriesData fromData(Object data) { public DataRepositoriesData fromData(Object data) {
if (data != null) { if (data != null) {
this.setLabel((String) ((Map<String, Object>) data).get("label")); this.setLabel((String) ((Map<String, Object>) data).get("label"));
this.setMultiAutoComplete(((Map<String, Object>) data).get("multiAutoComplete") != null ? (Boolean) ((Map<String, Object>) data).get("multiAutoComplete") : false);
} }
return this; return this;
} }
@ -24,12 +35,16 @@ public class DataRepositoriesData extends FieldData<DataRepositoriesData> {
public Element toXml(Document doc) { public Element toXml(Document doc) {
Element root = doc.createElement("data"); Element root = doc.createElement("data");
root.setAttribute("label", this.getLabel()); root.setAttribute("label", this.getLabel());
if (this.getMultiAutoComplete() != null) {
root.setAttribute("multiAutoComplete", this.getMultiAutoComplete().toString());
}
return root; return root;
} }
@Override @Override
public DataRepositoriesData fromXml(Element item) { public DataRepositoriesData fromXml(Element item) {
this.setLabel(item != null ? item.getAttribute("label") : ""); this.setLabel(item != null ? item.getAttribute("label") : "");
this.setMultiAutoComplete(Boolean.parseBoolean(item.getAttribute("multiAutoComplete")));
return this; return this;
} }
@ -37,6 +52,7 @@ public class DataRepositoriesData extends FieldData<DataRepositoriesData> {
public Map<String, Object> toMap(Element item) { public Map<String, Object> toMap(Element item) {
HashMap dataMap = new HashMap(); HashMap dataMap = new HashMap();
dataMap.put("label", item != null ? item.getAttribute("label") : ""); dataMap.put("label", item != null ? item.getAttribute("label") : "");
dataMap.put("multiAutoComplete", item != null ? item.getAttribute("multiAutoComplete") : false);
return dataMap; return dataMap;
} }
} }

View File

@ -7,10 +7,21 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class ExternalDatasetsData extends FieldData<ExternalDatasetsData> { public class ExternalDatasetsData extends FieldData<ExternalDatasetsData> {
private Boolean multiAutoComplete;
public Boolean getMultiAutoComplete() {
return multiAutoComplete;
}
public void setMultiAutoComplete(Boolean multiAutoComplete) {
this.multiAutoComplete = multiAutoComplete;
}
@Override @Override
public ExternalDatasetsData fromData(Object data) { public ExternalDatasetsData fromData(Object data) {
if (data != null) { if (data != null) {
this.setLabel((String) ((Map<String, Object>) data).get("label")); this.setLabel((String) ((Map<String, Object>) data).get("label"));
this.setMultiAutoComplete(((Map<String, Object>) data).get("multiAutoComplete") != null ? (Boolean) ((Map<String, Object>) data).get("multiAutoComplete") : false);
} }
return this; return this;
} }
@ -24,12 +35,16 @@ public class ExternalDatasetsData extends FieldData<ExternalDatasetsData> {
public Element toXml(Document doc) { public Element toXml(Document doc) {
Element root = doc.createElement("data"); Element root = doc.createElement("data");
root.setAttribute("label", this.getLabel()); root.setAttribute("label", this.getLabel());
if (this.getMultiAutoComplete() != null) {
root.setAttribute("multiAutoComplete", this.getMultiAutoComplete().toString());
}
return root; return root;
} }
@Override @Override
public ExternalDatasetsData fromXml(Element item) { public ExternalDatasetsData fromXml(Element item) {
this.setLabel(item != null ? item.getAttribute("label") : ""); this.setLabel(item != null ? item.getAttribute("label") : "");
this.setMultiAutoComplete(Boolean.parseBoolean(item.getAttribute("multiAutoComplete")));
return this; return this;
} }
@ -37,6 +52,7 @@ public class ExternalDatasetsData extends FieldData<ExternalDatasetsData> {
public Map<String, Object> toMap(Element item) { public Map<String, Object> toMap(Element item) {
HashMap dataMap = new HashMap(); HashMap dataMap = new HashMap();
dataMap.put("label", item != null ? item.getAttribute("label") : ""); dataMap.put("label", item != null ? item.getAttribute("label") : "");
dataMap.put("multiAutoComplete", item != null ? item.getAttribute("multiAutoComplete") : false);
return dataMap; return dataMap;
} }
} }

View File

@ -7,10 +7,21 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class OrganizationsData extends FieldData<OrganizationsData> { public class OrganizationsData extends FieldData<OrganizationsData> {
private Boolean multiAutoComplete;
public Boolean getMultiAutoComplete() {
return multiAutoComplete;
}
public void setMultiAutoComplete(Boolean multiAutoComplete) {
this.multiAutoComplete = multiAutoComplete;
}
@Override @Override
public OrganizationsData fromData(Object data) { public OrganizationsData fromData(Object data) {
if (data != null) { if (data != null) {
this.setLabel((String) ((Map<String, Object>) data).get("label")); this.setLabel((String) ((Map<String, Object>) data).get("label"));
this.setMultiAutoComplete(((Map<String, Object>) data).get("multiAutoComplete") != null ? (Boolean) ((Map<String, Object>) data).get("multiAutoComplete") : false);
} }
return this; return this;
} }
@ -24,12 +35,16 @@ public class OrganizationsData extends FieldData<OrganizationsData> {
public Element toXml(Document doc) { public Element toXml(Document doc) {
Element root = doc.createElement("data"); Element root = doc.createElement("data");
root.setAttribute("label", this.getLabel()); root.setAttribute("label", this.getLabel());
if (this.getMultiAutoComplete() != null) {
root.setAttribute("multiAutoComplete", this.getMultiAutoComplete().toString());
}
return root; return root;
} }
@Override @Override
public OrganizationsData fromXml(Element item) { public OrganizationsData fromXml(Element item) {
this.setLabel(item != null ? item.getAttribute("label") : ""); this.setLabel(item != null ? item.getAttribute("label") : "");
this.setMultiAutoComplete(Boolean.parseBoolean(item.getAttribute("multiAutoComplete")));
return this; return this;
} }
@ -37,6 +52,7 @@ public class OrganizationsData extends FieldData<OrganizationsData> {
public Map<String, Object> toMap(Element item) { public Map<String, Object> toMap(Element item) {
HashMap dataMap = new HashMap(); HashMap dataMap = new HashMap();
dataMap.put("label", item != null ? item.getAttribute("label") : ""); dataMap.put("label", item != null ? item.getAttribute("label") : "");
dataMap.put("multiAutoComplete", item != null ? item.getAttribute("multiAutoComplete") : false);
return dataMap; return dataMap;
} }
} }

View File

@ -7,10 +7,21 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class RegistriesData extends FieldData<RegistriesData> { public class RegistriesData extends FieldData<RegistriesData> {
private Boolean multiAutoComplete;
public Boolean getMultiAutoComplete() {
return multiAutoComplete;
}
public void setMultiAutoComplete(Boolean multiAutoComplete) {
this.multiAutoComplete = multiAutoComplete;
}
@Override @Override
public RegistriesData fromData(Object data) { public RegistriesData fromData(Object data) {
if (data != null) { if (data != null) {
this.setLabel((String) ((Map<String, Object>) data).get("label")); this.setLabel((String) ((Map<String, Object>) data).get("label"));
this.setMultiAutoComplete((Boolean) ((Map<String, Object>) data).get("multiAutoComplete"));
} }
return this; return this;
} }
@ -24,12 +35,16 @@ public class RegistriesData extends FieldData<RegistriesData> {
public Element toXml(Document doc) { public Element toXml(Document doc) {
Element root = doc.createElement("data"); Element root = doc.createElement("data");
root.setAttribute("label", this.getLabel()); root.setAttribute("label", this.getLabel());
if (this.getMultiAutoComplete() != null) {
root.setAttribute("multiAutoComplete", this.getMultiAutoComplete().toString());
}
return root; return root;
} }
@Override @Override
public RegistriesData fromXml(Element item) { public RegistriesData fromXml(Element item) {
this.setLabel(item != null ? item.getAttribute("label") : ""); this.setLabel(item != null ? item.getAttribute("label") : "");
this.setMultiAutoComplete(Boolean.parseBoolean(item.getAttribute("multiAutoComplete")));
return this; return this;
} }
@ -37,6 +52,7 @@ public class RegistriesData extends FieldData<RegistriesData> {
public Map<String, Object> toMap(Element item) { public Map<String, Object> toMap(Element item) {
HashMap dataMap = new HashMap(); HashMap dataMap = new HashMap();
dataMap.put("label", item != null ? item.getAttribute("label") : ""); dataMap.put("label", item != null ? item.getAttribute("label") : "");
dataMap.put("multiAutoComplete", item != null ? item.getAttribute("multiAutoComplete") : false);
return dataMap; return dataMap;
} }
} }

View File

@ -7,10 +7,21 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class ResearcherData extends FieldData<ResearcherData> { public class ResearcherData extends FieldData<ResearcherData> {
private Boolean multiAutoComplete;
public Boolean getMultiAutoComplete() {
return multiAutoComplete;
}
public void setMultiAutoComplete(Boolean multiAutoComplete) {
this.multiAutoComplete = multiAutoComplete;
}
@Override @Override
public ResearcherData fromData(Object data) { public ResearcherData fromData(Object data) {
if (data != null) { if (data != null) {
this.setLabel((String) ((Map<String, Object>) data).get("label")); this.setLabel((String) ((Map<String, Object>) data).get("label"));
this.setMultiAutoComplete(((Map<String, Object>) data).get("multiAutoComplete") != null ? (Boolean) ((Map<String, Object>) data).get("multiAutoComplete") : false);
} }
return this; return this;
} }
@ -24,12 +35,16 @@ public class ResearcherData extends FieldData<ResearcherData> {
public Element toXml(Document doc) { public Element toXml(Document doc) {
Element root = doc.createElement("data"); Element root = doc.createElement("data");
root.setAttribute("label", this.getLabel()); root.setAttribute("label", this.getLabel());
if (this.getMultiAutoComplete() != null) {
root.setAttribute("multiAutoComplete", this.getMultiAutoComplete().toString());
}
return root; return root;
} }
@Override @Override
public ResearcherData fromXml(Element item) { public ResearcherData fromXml(Element item) {
this.setLabel(item != null ? item.getAttribute("label") : ""); this.setLabel(item != null ? item.getAttribute("label") : "");
this.setMultiAutoComplete(Boolean.parseBoolean(item.getAttribute("multiAutoComplete")));
return this; return this;
} }
@ -37,6 +52,7 @@ public class ResearcherData extends FieldData<ResearcherData> {
public Map<String, Object> toMap(Element item) { public Map<String, Object> toMap(Element item) {
HashMap dataMap = new HashMap(); HashMap dataMap = new HashMap();
dataMap.put("label", item != null ? item.getAttribute("label") : ""); dataMap.put("label", item != null ? item.getAttribute("label") : "");
dataMap.put("multiAutoComplete", item != null ? item.getAttribute("multiAutoComplete") : false);
return dataMap; return dataMap;
} }
} }

View File

@ -7,10 +7,21 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class ServicesData extends FieldData<ServicesData> { public class ServicesData extends FieldData<ServicesData> {
private Boolean multiAutoComplete;
public Boolean getMultiAutoComplete() {
return multiAutoComplete;
}
public void setMultiAutoComplete(Boolean multiAutoComplete) {
this.multiAutoComplete = multiAutoComplete;
}
@Override @Override
public ServicesData fromData(Object data) { public ServicesData fromData(Object data) {
if (data != null) { if (data != null) {
this.setLabel((String) ((Map<String, Object>) data).get("label")); this.setLabel((String) ((Map<String, Object>) data).get("label"));
this.setMultiAutoComplete(((Map<String, Object>) data).get("multiAutoComplete") != null ? (Boolean) ((Map<String, Object>) data).get("multiAutoComplete") : false);
} }
return this; return this;
} }
@ -24,12 +35,16 @@ public class ServicesData extends FieldData<ServicesData> {
public Element toXml(Document doc) { public Element toXml(Document doc) {
Element root = doc.createElement("data"); Element root = doc.createElement("data");
root.setAttribute("label", this.getLabel()); root.setAttribute("label", this.getLabel());
if (this.getMultiAutoComplete() != null) {
root.setAttribute("multiAutoComplete", this.getMultiAutoComplete().toString());
}
return root; return root;
} }
@Override @Override
public ServicesData fromXml(Element item) { public ServicesData fromXml(Element item) {
this.setLabel(item != null ? item.getAttribute("label") : ""); this.setLabel(item != null ? item.getAttribute("label") : "");
this.setMultiAutoComplete(Boolean.parseBoolean(item.getAttribute("multiAutoComplete")));
return this; return this;
} }
@ -37,6 +52,7 @@ public class ServicesData extends FieldData<ServicesData> {
public Map<String, Object> toMap(Element item) { public Map<String, Object> toMap(Element item) {
HashMap dataMap = new HashMap(); HashMap dataMap = new HashMap();
dataMap.put("label", item != null ? item.getAttribute("label") : ""); dataMap.put("label", item != null ? item.getAttribute("label") : "");
dataMap.put("multiAutoComplete", item != null ? item.getAttribute("multiAutoComplete") : false);
return dataMap; return dataMap;
} }
} }

View File

@ -71,19 +71,19 @@ export interface DmpsAutoCompleteFieldData extends FieldData {
} }
export interface ExternalDatasetsFieldData extends FieldData { export interface ExternalDatasetsFieldData extends FieldData {
multiAutoComplete: boolean;
} }
export interface DataRepositoriesFieldData extends FieldData { export interface DataRepositoriesFieldData extends FieldData {
multiAutoComplete: boolean;
} }
export interface RegistriesFieldData extends FieldData { export interface RegistriesFieldData extends FieldData {
multiAutoComplete: boolean;
} }
export interface ServicesFieldData extends FieldData { export interface ServicesFieldData extends FieldData {
multiAutoComplete: boolean;
} }
export interface TagsFieldData extends FieldData { export interface TagsFieldData extends FieldData {

View File

@ -1,19 +1,22 @@
import { FormGroup } from '@angular/forms'; import { FormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model'; import { FieldDataEditorModel } from './field-data-editor-model';
import { DatePickerFieldData, ExternalDatasetsFieldData, DataRepositoriesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { DataRepositoriesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class DataRepositoriesDataEditorModel extends FieldDataEditorModel<DataRepositoriesDataEditorModel> { export class DataRepositoriesDataEditorModel extends FieldDataEditorModel<DataRepositoriesDataEditorModel> {
public label: string; public label: string;
public multiAutoComplete: boolean;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DataRepositoriesDataEditorModel.label')) }] label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]
}); });
return formGroup; return formGroup;
} }
fromModel(item: DataRepositoriesFieldData): DataRepositoriesDataEditorModel { fromModel(item: DataRepositoriesFieldData): DataRepositoriesDataEditorModel {
this.label = item.label; this.label = item.label;
this.multiAutoComplete = item.multiAutoComplete;
return this; return this;
} }
} }

View File

@ -1,6 +1,6 @@
import { FormGroup } from '@angular/forms'; import { FormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model'; import { FieldDataEditorModel } from './field-data-editor-model';
import { DatePickerFieldData, ExternalDatasetsFieldData, DataRepositoriesFieldData, RegistriesFieldData, ServicesFieldData, TagsFieldData, ResearchersFieldData, OrganizationsFieldData, DatasetIdentifierFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { DatasetIdentifierFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class DatasetIdentifierDataEditorModel extends FieldDataEditorModel<DatasetIdentifierDataEditorModel> { export class DatasetIdentifierDataEditorModel extends FieldDataEditorModel<DatasetIdentifierDataEditorModel> {
public label: string; public label: string;

View File

@ -1,19 +1,22 @@
import { FormGroup } from '@angular/forms'; import { FormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model'; import { FieldDataEditorModel } from './field-data-editor-model';
import { DatePickerFieldData, ExternalDatasetsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { ExternalDatasetsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class ExternalDatasetsDataEditorModel extends FieldDataEditorModel<ExternalDatasetsDataEditorModel> { export class ExternalDatasetsDataEditorModel extends FieldDataEditorModel<ExternalDatasetsDataEditorModel> {
public label: string; public label: string;
public multiAutoComplete: boolean;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ExternalDatasetsDataEditorModel.label')) }] label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]
}); });
return formGroup; return formGroup;
} }
fromModel(item: ExternalDatasetsFieldData): ExternalDatasetsDataEditorModel { fromModel(item: ExternalDatasetsFieldData): ExternalDatasetsDataEditorModel {
this.label = item.label; this.label = item.label;
this.multiAutoComplete = item.multiAutoComplete;
return this; return this;
} }
} }

View File

@ -1,6 +1,6 @@
import { FormGroup } from '@angular/forms'; import { FormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model'; import { FieldDataEditorModel } from './field-data-editor-model';
import { DatePickerFieldData, ExternalDatasetsFieldData, DataRepositoriesFieldData, RegistriesFieldData, ServicesFieldData, TagsFieldData, ResearchersFieldData, OrganizationsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { OrganizationsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class OrganizationsDataEditorModel extends FieldDataEditorModel<OrganizationsDataEditorModel> { export class OrganizationsDataEditorModel extends FieldDataEditorModel<OrganizationsDataEditorModel> {
public label: string; public label: string;

View File

@ -1,19 +1,22 @@
import { FormGroup } from '@angular/forms'; import { FormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model'; import { FieldDataEditorModel } from './field-data-editor-model';
import { DatePickerFieldData, ExternalDatasetsFieldData, DataRepositoriesFieldData, RegistriesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { RegistriesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class RegistriesDataEditorModel extends FieldDataEditorModel<RegistriesDataEditorModel> { export class RegistriesDataEditorModel extends FieldDataEditorModel<RegistriesDataEditorModel> {
public label: string; public label: string;
public multiAutoComplete: boolean;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('RegistriesDataEditorModel.label')) }] label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]
}); });
return formGroup; return formGroup;
} }
fromModel(item: RegistriesFieldData): RegistriesDataEditorModel { fromModel(item: RegistriesFieldData): RegistriesDataEditorModel {
this.label = item.label; this.label = item.label;
this.multiAutoComplete = item.multiAutoComplete;
return this; return this;
} }
} }

View File

@ -1,6 +1,6 @@
import { FormGroup } from '@angular/forms'; import { FormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model'; import { FieldDataEditorModel } from './field-data-editor-model';
import { DatePickerFieldData, ExternalDatasetsFieldData, DataRepositoriesFieldData, RegistriesFieldData, ServicesFieldData, TagsFieldData, ResearchersFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { ResearchersFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class ResearchersDataEditorModel extends FieldDataEditorModel<ResearchersDataEditorModel> { export class ResearchersDataEditorModel extends FieldDataEditorModel<ResearchersDataEditorModel> {
public label: string; public label: string;

View File

@ -1,19 +1,22 @@
import { FormGroup } from '@angular/forms'; import { FormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model'; import { FieldDataEditorModel } from './field-data-editor-model';
import { DatePickerFieldData, ExternalDatasetsFieldData, DataRepositoriesFieldData, RegistriesFieldData, ServicesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { ServicesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class ServicesDataEditorModel extends FieldDataEditorModel<ServicesDataEditorModel> { export class ServicesDataEditorModel extends FieldDataEditorModel<ServicesDataEditorModel> {
public label: string; public label: string;
public multiAutoComplete: boolean;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }] label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]
}); });
return formGroup; return formGroup;
} }
fromModel(item: ServicesFieldData): ServicesDataEditorModel { fromModel(item: ServicesFieldData): ServicesDataEditorModel {
this.label = item.label; this.label = item.label;
this.multiAutoComplete = item.multiAutoComplete;
return this; return this;
} }
} }

View File

@ -1,6 +1,6 @@
import { FormGroup } from '@angular/forms'; import { FormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model'; import { FieldDataEditorModel } from './field-data-editor-model';
import { DatePickerFieldData, ExternalDatasetsFieldData, DataRepositoriesFieldData, RegistriesFieldData, ServicesFieldData, TagsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { TagsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class TagsDataEditorModel extends FieldDataEditorModel<TagsDataEditorModel> { export class TagsDataEditorModel extends FieldDataEditorModel<TagsDataEditorModel> {
public label: string; public label: string;

View File

@ -1,6 +1,9 @@
<div class="row" *ngIf="form.get('data')"> <div class="row" *ngIf="form.get('data')">
<h5 style="font-weight: bold" class="col-12">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-DATE-PICKER-TITLE' <h5 style="font-weight: bold" class="col-12">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-DATE-PICKER-TITLE'
| translate}}</h5> | translate}}</h5>
<mat-checkbox class="col-auto" [formControl]="this.form.get('data').get('multiAutoComplete')">
{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-MULTIPLE-AUTOCOMPLETE' | translate}}
</mat-checkbox>
<mat-form-field class="col-12"> <mat-form-field class="col-12">
<input matInput type="string" <input matInput type="string"
placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-CHECKBOX-PLACEHOLDER' | translate}}" placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-CHECKBOX-PLACEHOLDER' | translate}}"

View File

@ -1,6 +1,10 @@
<div class="row" *ngIf="form.get('data')"> <div class="row" *ngIf="form.get('data')">
<h5 style="font-weight: bold" class="col-12">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-DATE-PICKER-TITLE' <h5 style="font-weight: bold" class="col-12">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-DATE-PICKER-TITLE'
| translate}}</h5> | translate}}</h5>
<mat-checkbox class="col-auto" [formControl]="this.form.get('data').get('multiAutoComplete')">
{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-MULTIPLE-AUTOCOMPLETE' | translate}}
</mat-checkbox>
<mat-form-field class="col-12"> <mat-form-field class="col-12">
<input matInput type="string" <input matInput type="string"
placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-CHECKBOX-PLACEHOLDER' | translate}}" placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-CHECKBOX-PLACEHOLDER' | translate}}"

View File

@ -1,6 +1,10 @@
<div class="row" *ngIf="form.get('data')"> <div class="row" *ngIf="form.get('data')">
<h5 style="font-weight: bold" class="col-12">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-DATE-PICKER-TITLE' <h5 style="font-weight: bold" class="col-12">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-DATE-PICKER-TITLE'
| translate}}</h5> | translate}}</h5>
<mat-checkbox class="col-auto" [formControl]="this.form.get('data').get('multiAutoComplete')">
{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-MULTIPLE-AUTOCOMPLETE' | translate}}
</mat-checkbox>
<mat-form-field class="col-12"> <mat-form-field class="col-12">
<input matInput type="string" <input matInput type="string"
placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-CHECKBOX-PLACEHOLDER' | translate}}" placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-CHECKBOX-PLACEHOLDER' | translate}}"

View File

@ -1,6 +1,9 @@
<div class="row" *ngIf="form.get('data')"> <div class="row" *ngIf="form.get('data')">
<h5 style="font-weight: bold" class="col-12">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-DATE-PICKER-TITLE' <h5 style="font-weight: bold" class="col-12">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-DATE-PICKER-TITLE'
| translate}}</h5> | translate}}</h5>
<mat-checkbox class="col-auto" [formControl]="this.form.get('data').get('multiAutoComplete')">
{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-MULTIPLE-AUTOCOMPLETE' | translate}}
</mat-checkbox>
<mat-form-field class="col-12"> <mat-form-field class="col-12">
<input matInput type="string" <input matInput type="string"
placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-CHECKBOX-PLACEHOLDER' | translate}}" placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-CHECKBOX-PLACEHOLDER' | translate}}"

View File

@ -1,6 +1,9 @@
<div class="row" *ngIf="form.get('data')"> <div class="row" *ngIf="form.get('data')">
<h5 style="font-weight: bold" class="col-12">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-DATE-PICKER-TITLE' <h5 style="font-weight: bold" class="col-12">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-DATE-PICKER-TITLE'
| translate}}</h5> | translate}}</h5>
<mat-checkbox class="col-auto" [formControl]="this.form.get('data').get('multiAutoComplete')">
{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-MULTIPLE-AUTOCOMPLETE' | translate}}
</mat-checkbox>
<mat-form-field class="col-12"> <mat-form-field class="col-12">
<input matInput type="string" <input matInput type="string"
placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-CHECKBOX-PLACEHOLDER' | translate}}" placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-CHECKBOX-PLACEHOLDER' | translate}}"

View File

@ -1,6 +1,9 @@
<div class="row" *ngIf="form.get('data')"> <div class="row" *ngIf="form.get('data')">
<h5 style="font-weight: bold" class="col-12">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-DATE-PICKER-TITLE' <h5 style="font-weight: bold" class="col-12">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-DATE-PICKER-TITLE'
| translate}}</h5> | translate}}</h5>
<mat-checkbox class="col-auto" [formControl]="this.form.get('data').get('multiAutoComplete')">
{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-MULTIPLE-AUTOCOMPLETE' | translate}}
</mat-checkbox>
<mat-form-field class="col-12"> <mat-form-field class="col-12">
<input matInput type="string" <input matInput type="string"
placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-CHECKBOX-PLACEHOLDER' | translate}}" placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-CHECKBOX-PLACEHOLDER' | translate}}"

View File

@ -138,11 +138,18 @@
<div *ngSwitchCase="datasetProfileFieldViewStyleEnum.ExternalDatasets" class="col-12"> <div *ngSwitchCase="datasetProfileFieldViewStyleEnum.ExternalDatasets" class="col-12">
<div class="row"> <div class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<div *ngIf="form.get('data').value.multiAutoComplete">
<app-multiple-auto-complete placeholder="{{ form.get('data').value.label | translate }}" [formControl]="form.get('value')"
[configuration]="externalDatasetAutoCompleteConfiguration">
</app-multiple-auto-complete>
</div>
<div *ngIf="!(form.get('data').value.multiAutoComplete)">
<app-single-auto-complete placeholder="{{ form.get('data').value.label | translate }}" [formControl]="form.get('value')" <app-single-auto-complete placeholder="{{ form.get('data').value.label | translate }}" [formControl]="form.get('value')"
[configuration]="externalDatasetAutoCompleteConfiguration" [required]="form.get('validationRequired').value"> [configuration]="externalDatasetAutoCompleteConfiguration" [required]="form.get('validationRequired').value">
</app-single-auto-complete> </app-single-auto-complete>
<mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}} <mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error> </mat-error>
</div>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint> <mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
@ -151,11 +158,18 @@
<div *ngSwitchCase="datasetProfileFieldViewStyleEnum.DataRepositories" class="col-12"> <div *ngSwitchCase="datasetProfileFieldViewStyleEnum.DataRepositories" class="col-12">
<div class="row"> <div class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<div *ngIf="form.get('data').value.multiAutoComplete">
<app-multiple-auto-complete placeholder="{{ form.get('data').value.label | translate }}" [formControl]="form.get('value')"
[configuration]="dataRepositoriesAutoCompleteConfiguration">
</app-multiple-auto-complete>
</div>
<div *ngIf="!(form.get('data').value.multiAutoComplete)">
<app-single-auto-complete placeholder="{{ form.get('data').value.label | translate }}" [formControl]="form.get('value')" <app-single-auto-complete placeholder="{{ form.get('data').value.label | translate }}" [formControl]="form.get('value')"
[configuration]="dataRepositoriesAutoCompleteConfiguration" [required]="form.get('validationRequired').value"> [configuration]="dataRepositoriesAutoCompleteConfiguration" [required]="form.get('validationRequired').value">
</app-single-auto-complete> </app-single-auto-complete>
<mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}} <mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error> </mat-error>
</div>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint> <mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
@ -164,11 +178,18 @@
<div *ngSwitchCase="datasetProfileFieldViewStyleEnum.Registries" class="col-12"> <div *ngSwitchCase="datasetProfileFieldViewStyleEnum.Registries" class="col-12">
<div class="row"> <div class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<div *ngIf="form.get('data').value.multiAutoComplete">
<app-multiple-auto-complete placeholder="{{ form.get('data').value.label | translate }}" [formControl]="form.get('value')"
[configuration]="registriesAutoCompleteConfiguration">
</app-multiple-auto-complete>
</div>
<div *ngIf="!(form.get('data').value.multiAutoComplete)">
<app-single-auto-complete placeholder="{{ form.get('data').value.label | translate }}" [formControl]="form.get('value')" <app-single-auto-complete placeholder="{{ form.get('data').value.label | translate }}" [formControl]="form.get('value')"
[configuration]="registriesAutoCompleteConfiguration" [required]="form.get('validationRequired').value"> [configuration]="registriesAutoCompleteConfiguration" [required]="form.get('validationRequired').value">
</app-single-auto-complete> </app-single-auto-complete>
<mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}} <mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error> </mat-error>
</div>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint> <mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
@ -177,11 +198,18 @@
<div *ngSwitchCase="datasetProfileFieldViewStyleEnum.Services" class="col-12"> <div *ngSwitchCase="datasetProfileFieldViewStyleEnum.Services" class="col-12">
<div class="row"> <div class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<div *ngIf="form.get('data').value.multiAutoComplete">
<app-multiple-auto-complete placeholder="{{ form.get('data').value.label | translate }}" [formControl]="form.get('value')"
[configuration]="servicesAutoCompleteConfiguration">
</app-multiple-auto-complete>
</div>
<div *ngIf="!(form.get('data').value.multiAutoComplete)">
<app-single-auto-complete placeholder="{{ form.get('data').value.label | translate }}" [formControl]="form.get('value')" <app-single-auto-complete placeholder="{{ form.get('data').value.label | translate }}" [formControl]="form.get('value')"
[configuration]="servicesAutoCompleteConfiguration" [required]="form.get('validationRequired').value"> [configuration]="servicesAutoCompleteConfiguration" [required]="form.get('validationRequired').value">
</app-single-auto-complete> </app-single-auto-complete>
<mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}} <mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error> </mat-error>
</div>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint> <mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>