#7276 - Added tableView true/false option in multiplicity

This commit is contained in:
Konstantina Galouni 2022-11-01 16:24:28 +02:00
parent 18dcabbac2
commit 37724380e9
20 changed files with 52 additions and 4 deletions

View File

@ -121,6 +121,7 @@ public class ExportXmlBuilderDatasetProfile {
multiplicity.setAttribute("max", "" + field.getMultiplicity().getMax()); multiplicity.setAttribute("max", "" + field.getMultiplicity().getMax());
multiplicity.setAttribute("min", "" + field.getMultiplicity().getMin()); multiplicity.setAttribute("min", "" + field.getMultiplicity().getMin());
multiplicity.setAttribute("placeholder", field.getMultiplicity().getPlaceholder()); multiplicity.setAttribute("placeholder", field.getMultiplicity().getPlaceholder());
multiplicity.setAttribute("tableView", String.valueOf(field.getMultiplicity().getTableView()));
composite.appendChild(multiplicity); composite.appendChild(multiplicity);
} }
if (field.getTitle() != null && !field.getTitle().isEmpty()) { if (field.getTitle() != null && !field.getTitle().isEmpty()) {

View File

@ -9,6 +9,7 @@ public class Multiplicity {
private int max; private int max;
private int min; private int min;
private String placeholder; private String placeholder;
private boolean tableView;
@XmlAttribute(name = "max") @XmlAttribute(name = "max")
public int getMax() { public int getMax() {
@ -37,11 +38,21 @@ public class Multiplicity {
this.placeholder = placeholder; this.placeholder = placeholder;
} }
@XmlAttribute(name = "tableView")
public boolean getTableView() {
return tableView;
}
public void setTableView(boolean tableView) {
this.tableView = tableView;
}
public eu.eudat.models.data.components.commons.Multiplicity toAdminCompositeModelSection() { public eu.eudat.models.data.components.commons.Multiplicity toAdminCompositeModelSection() {
eu.eudat.models.data.components.commons.Multiplicity multiplicityEntity = new eu.eudat.models.data.components.commons.Multiplicity(); eu.eudat.models.data.components.commons.Multiplicity multiplicityEntity = new eu.eudat.models.data.components.commons.Multiplicity();
multiplicityEntity.setMax(max); multiplicityEntity.setMax(max);
multiplicityEntity.setMin(min); multiplicityEntity.setMin(min);
multiplicityEntity.setPlaceholder(placeholder); multiplicityEntity.setPlaceholder(placeholder);
multiplicityEntity.setTableView(tableView);
return multiplicityEntity; return multiplicityEntity;
} }
} }

View File

@ -5,6 +5,7 @@ public class Multiplicity {
private int min; private int min;
private int max; private int max;
private String placeholder; private String placeholder;
private boolean tableView;
public int getMin() { public int getMin() {
return min; return min;
@ -29,4 +30,12 @@ public class Multiplicity {
public void setPlaceholder(String placeholder) { public void setPlaceholder(String placeholder) {
this.placeholder = placeholder; this.placeholder = placeholder;
} }
public boolean getTableView() {
return tableView;
}
public void setTableView(boolean tableView) {
this.tableView = tableView;
}
} }

View File

@ -122,6 +122,7 @@ public class FieldSet implements DatabaseViewStyleDefinition, XmlSerializable<Fi
multiplicity.setAttribute("min", "" + this.multiplicity.getMin()); multiplicity.setAttribute("min", "" + this.multiplicity.getMin());
multiplicity.setAttribute("max", "" + this.multiplicity.getMax()); multiplicity.setAttribute("max", "" + this.multiplicity.getMax());
multiplicity.setAttribute("placeholder", this.multiplicity.getPlaceholder()); multiplicity.setAttribute("placeholder", this.multiplicity.getPlaceholder());
multiplicity.setAttribute("tableView", String.valueOf(this.multiplicity.getTableView()));
Element commentField = doc.createElement("commentField"); Element commentField = doc.createElement("commentField");
commentField.setAttribute("hasCommentField", "" + this.hasCommentField); commentField.setAttribute("hasCommentField", "" + this.hasCommentField);
@ -185,6 +186,7 @@ public class FieldSet implements DatabaseViewStyleDefinition, XmlSerializable<Fi
this.multiplicity.setMin(Integer.parseInt(multiplicity.getAttribute("min"))); this.multiplicity.setMin(Integer.parseInt(multiplicity.getAttribute("min")));
this.multiplicity.setMax(Integer.parseInt(multiplicity.getAttribute("max"))); this.multiplicity.setMax(Integer.parseInt(multiplicity.getAttribute("max")));
this.multiplicity.setPlaceholder(multiplicity.getAttribute("placeholder")); this.multiplicity.setPlaceholder(multiplicity.getAttribute("placeholder"));
this.multiplicity.setTableView(Boolean.parseBoolean(multiplicity.getAttribute("tableView")));
return this; return this;
} }

View File

@ -45,6 +45,7 @@ export interface Multiplicity {
min: number; min: number;
max: number; max: number;
placeholder: string; placeholder: string;
tableView: boolean;
} }
export interface Field { export interface Field {

View File

@ -4,5 +4,6 @@ export interface Multiplicity {
min: number; min: number;
max: number; max: number;
placeholder: string; placeholder: string;
tableView: boolean;
} }

View File

@ -6,11 +6,13 @@ export class MultiplicityEditorModel extends BaseFormModel {
public min: number; public min: number;
public max: number; public max: number;
public placeholder: string; public placeholder: string;
public tableView: boolean;
fromModel(item: Multiplicity): MultiplicityEditorModel { fromModel(item: Multiplicity): MultiplicityEditorModel {
this.min = item.min; this.min = item.min;
this.max = item.max; this.max = item.max;
this.placeholder = item.placeholder; this.placeholder = item.placeholder;
this.tableView = item.tableView;
return this; return this;
} }
@ -21,7 +23,8 @@ export class MultiplicityEditorModel extends BaseFormModel {
placeholder: [{ placeholder: [{
value: this.placeholder, value: this.placeholder,
disabled: (disabled && !skipDisable.includes('MultiplicityEditorModel.placeholder')) disabled: (disabled && !skipDisable.includes('MultiplicityEditorModel.placeholder'))
}] }],
tableView: [{value: this.tableView, disabled: (disabled && !skipDisable.includes('MultiplicityEditorModel.tableView'))}]
}); });
} }
} }

View File

@ -117,6 +117,12 @@
type="text" [formControl]="form.get('multiplicity').get('placeholder')"> type="text" [formControl]="form.get('multiplicity').get('placeholder')">
</mat-form-field> </mat-form-field>
</div> </div>
<div class="row">
<mat-checkbox *ngIf="isMultiplicityEnabled" appearance="legacy" class="col pl-0 underline-line-field fieldset-checkbox-action-dataset-profile-editor"
[formControl]="form.get('multiplicity').get('tableView')">
{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-TABLEVIEW' | translate}}
</mat-checkbox>
</div>
</div> </div>

View File

@ -261,7 +261,8 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i
description: formValue.description, description: formValue.description,
hasCommentField: formValue.hasCommentField, hasCommentField: formValue.hasCommentField,
commentFieldValue: '', commentFieldValue: '',
multiplicity: {max: formValue.multiplicity.max, min: formValue.multiplicity.min, placeholder: formValue.multiplicity.placeholder}, multiplicity: {max: formValue.multiplicity.max, min: formValue.multiplicity.min,
placeholder: formValue.multiplicity.placeholder, tableView: formValue.multiplicity.tableView},
multiplicityItems:null, multiplicityItems:null,
fields: fields.map(editorField=>{ fields: fields.map(editorField=>{
const model = new DatasetDescriptionFieldEditorModel().fromModel(editorField); const model = new DatasetDescriptionFieldEditorModel().fromModel(editorField);

View File

@ -334,11 +334,13 @@ export class DatasetDescriptionMultiplicityEditorModel extends BaseFormModel {
public min: number; public min: number;
public max: number; public max: number;
public placeholder: string; public placeholder: string;
public tableView: boolean;
fromModel(item: Multiplicity): DatasetDescriptionMultiplicityEditorModel { fromModel(item: Multiplicity): DatasetDescriptionMultiplicityEditorModel {
this.min = item.min; this.min = item.min;
this.max = item.max; this.max = item.max;
this.placeholder = item.placeholder; this.placeholder = item.placeholder;
this.tableView = item.tableView;
return this; return this;
} }
@ -346,7 +348,8 @@ export class DatasetDescriptionMultiplicityEditorModel extends BaseFormModel {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
min: [this.min], min: [this.min],
max: [this.max], max: [this.max],
placeholder: [this.placeholder] placeholder: [this.placeholder],
tableView: [this.tableView]
}); });
return formGroup; return formGroup;
} }

View File

@ -374,6 +374,7 @@
"MULTIPLICITY-MIN": "Multiplicity Min", "MULTIPLICITY-MIN": "Multiplicity Min",
"MULTIPLICITY-MAX": "Multiplicity Max", "MULTIPLICITY-MAX": "Multiplicity Max",
"MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text", "MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text",
"MULTIPLICITY-TABLEVIEW": "View inputs in table",
"MULTIPLICITY-ADD-ONE-FIELD": "Add more", "MULTIPLICITY-ADD-ONE-FIELD": "Add more",
"ORDER": "Order", "ORDER": "Order",
"COMMENT-PLACEHOLDER": "Please Specify", "COMMENT-PLACEHOLDER": "Please Specify",

View File

@ -374,6 +374,7 @@
"MULTIPLICITY-MIN": "Multiplicity Min", "MULTIPLICITY-MIN": "Multiplicity Min",
"MULTIPLICITY-MAX": "Multiplicity Max", "MULTIPLICITY-MAX": "Multiplicity Max",
"MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text", "MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text",
"MULTIPLICITY-TABLEVIEW": "View inputs in table",
"MULTIPLICITY-ADD-ONE-FIELD": "Add more", "MULTIPLICITY-ADD-ONE-FIELD": "Add more",
"ORDER": "Order", "ORDER": "Order",
"COMMENT-PLACEHOLDER": "Please Specify", "COMMENT-PLACEHOLDER": "Please Specify",

View File

@ -374,6 +374,7 @@
"MULTIPLICITY-MIN": "Multiplicidad mínima", "MULTIPLICITY-MIN": "Multiplicidad mínima",
"MULTIPLICITY-MAX": "Multiplicidad máxima", "MULTIPLICITY-MAX": "Multiplicidad máxima",
"MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text", "MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text",
"MULTIPLICITY-TABLEVIEW": "View inputs in table",
"MULTIPLICITY-ADD-ONE-FIELD": "Add more", "MULTIPLICITY-ADD-ONE-FIELD": "Add more",
"ORDER": "Orden", "ORDER": "Orden",
"COMMENT-PLACEHOLDER": "Por favir especifique", "COMMENT-PLACEHOLDER": "Por favir especifique",

View File

@ -374,6 +374,7 @@
"MULTIPLICITY-MIN": "Ελάχιστη τιμή Min", "MULTIPLICITY-MIN": "Ελάχιστη τιμή Min",
"MULTIPLICITY-MAX": "Μέγιστη τιμή Max", "MULTIPLICITY-MAX": "Μέγιστη τιμή Max",
"MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text", "MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text",
"MULTIPLICITY-TABLEVIEW": "View inputs in table",
"MULTIPLICITY-ADD-ONE-FIELD": "Add more", "MULTIPLICITY-ADD-ONE-FIELD": "Add more",
"ORDER": "Εντολή", "ORDER": "Εντολή",
"COMMENT-PLACEHOLDER": "Παρακαλώ προσδιορίστε", "COMMENT-PLACEHOLDER": "Παρακαλώ προσδιορίστε",

View File

@ -374,6 +374,7 @@
"MULTIPLICITY-MIN": "Višestrukost, minimalno polja", "MULTIPLICITY-MIN": "Višestrukost, minimalno polja",
"MULTIPLICITY-MAX": "Višestrukost, maksimalno polja", "MULTIPLICITY-MAX": "Višestrukost, maksimalno polja",
"MULTIPLICITY-PLACEHOLDER": "", "MULTIPLICITY-PLACEHOLDER": "",
"MULTIPLICITY-TABLEVIEW": "View inputs in table",
"MULTIPLICITY-ADD-ONE-FIELD": "Dodaj polje", "MULTIPLICITY-ADD-ONE-FIELD": "Dodaj polje",
"ORDER": "Redoslijed", "ORDER": "Redoslijed",
"COMMENT-PLACEHOLDER": "Navedite", "COMMENT-PLACEHOLDER": "Navedite",

View File

@ -374,7 +374,8 @@
"MULTIPLICITY-MIN": "$Minimalna wielokrotność$", "MULTIPLICITY-MIN": "$Minimalna wielokrotność$",
"MULTIPLICITY-MAX": "$Maksymalna wielokrotność$", "MULTIPLICITY-MAX": "$Maksymalna wielokrotność$",
"MULTIPLICITY-PLACEHOLDER": "$Tekst zastępujący wielokrotność$", "MULTIPLICITY-PLACEHOLDER": "$Tekst zastępujący wielokrotność$",
"MULTIPLICITY-ADD-ONE-FIELD": "Dodaj więcej", "MULTIPLICITY-TABLEVIEW": "View inputs in table",
"MULTIPLICITY-ADD-ONE-FIELD": "Dodaj więcej",
"ORDER": "Kolejność", "ORDER": "Kolejność",
"COMMENT-PLACEHOLDER": "Proszę doprecyzować", "COMMENT-PLACEHOLDER": "Proszę doprecyzować",
"COMMENT-HINT": "Podaj dodatkowe informacje lub uzasadnienie swojego wyboru", "COMMENT-HINT": "Podaj dodatkowe informacje lub uzasadnienie swojego wyboru",

View File

@ -374,6 +374,7 @@
"MULTIPLICITY-MIN": "Multiplicidade Min", "MULTIPLICITY-MIN": "Multiplicidade Min",
"MULTIPLICITY-MAX": "Multiplicidade Máx", "MULTIPLICITY-MAX": "Multiplicidade Máx",
"MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text", "MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text",
"MULTIPLICITY-TABLEVIEW": "View inputs in table",
"MULTIPLICITY-ADD-ONE-FIELD": "Add more", "MULTIPLICITY-ADD-ONE-FIELD": "Add more",
"ORDER": "Ordem", "ORDER": "Ordem",
"COMMENT-PLACEHOLDER": "Por favor especifique", "COMMENT-PLACEHOLDER": "Por favor especifique",

View File

@ -374,6 +374,7 @@
"MULTIPLICITY-MIN": "Multiplicity Min", "MULTIPLICITY-MIN": "Multiplicity Min",
"MULTIPLICITY-MAX": "Multiplicity Max", "MULTIPLICITY-MAX": "Multiplicity Max",
"MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text", "MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text",
"MULTIPLICITY-TABLEVIEW": "View inputs in table",
"MULTIPLICITY-ADD-ONE-FIELD": "Add more", "MULTIPLICITY-ADD-ONE-FIELD": "Add more",
"ORDER": "Order", "ORDER": "Order",
"COMMENT-PLACEHOLDER": "Please Specify", "COMMENT-PLACEHOLDER": "Please Specify",

View File

@ -374,6 +374,7 @@
"MULTIPLICITY-MIN": "Višestrukost, minimalno polja", "MULTIPLICITY-MIN": "Višestrukost, minimalno polja",
"MULTIPLICITY-MAX": "Višestrukost, maksimalno polja", "MULTIPLICITY-MAX": "Višestrukost, maksimalno polja",
"MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text", "MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text",
"MULTIPLICITY-TABLEVIEW": "View inputs in table",
"MULTIPLICITY-ADD-ONE-FIELD": "Add more", "MULTIPLICITY-ADD-ONE-FIELD": "Add more",
"ORDER": "Redosled", "ORDER": "Redosled",
"COMMENT-PLACEHOLDER": "Navedite", "COMMENT-PLACEHOLDER": "Navedite",

View File

@ -374,6 +374,7 @@
"MULTIPLICITY-MIN": "En az Çokluk", "MULTIPLICITY-MIN": "En az Çokluk",
"MULTIPLICITY-MAX": "En fazla Çokluk", "MULTIPLICITY-MAX": "En fazla Çokluk",
"MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text", "MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text",
"MULTIPLICITY-TABLEVIEW": "View inputs in table",
"MULTIPLICITY-ADD-ONE-FIELD": "Add more", "MULTIPLICITY-ADD-ONE-FIELD": "Add more",
"ORDER": "Düzen", "ORDER": "Düzen",
"COMMENT-PLACEHOLDER": "Lütfen Belirtiniz", "COMMENT-PLACEHOLDER": "Lütfen Belirtiniz",