#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("min", "" + field.getMultiplicity().getMin());
multiplicity.setAttribute("placeholder", field.getMultiplicity().getPlaceholder());
multiplicity.setAttribute("tableView", String.valueOf(field.getMultiplicity().getTableView()));
composite.appendChild(multiplicity);
}
if (field.getTitle() != null && !field.getTitle().isEmpty()) {

View File

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

View File

@ -5,6 +5,7 @@ public class Multiplicity {
private int min;
private int max;
private String placeholder;
private boolean tableView;
public int getMin() {
return min;
@ -29,4 +30,12 @@ public class Multiplicity {
public void setPlaceholder(String 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("max", "" + this.multiplicity.getMax());
multiplicity.setAttribute("placeholder", this.multiplicity.getPlaceholder());
multiplicity.setAttribute("tableView", String.valueOf(this.multiplicity.getTableView()));
Element commentField = doc.createElement("commentField");
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.setMax(Integer.parseInt(multiplicity.getAttribute("max")));
this.multiplicity.setPlaceholder(multiplicity.getAttribute("placeholder"));
this.multiplicity.setTableView(Boolean.parseBoolean(multiplicity.getAttribute("tableView")));
return this;
}

View File

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

View File

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

View File

@ -6,11 +6,13 @@ export class MultiplicityEditorModel extends BaseFormModel {
public min: number;
public max: number;
public placeholder: string;
public tableView: boolean;
fromModel(item: Multiplicity): MultiplicityEditorModel {
this.min = item.min;
this.max = item.max;
this.placeholder = item.placeholder;
this.tableView = item.tableView;
return this;
}
@ -21,7 +23,8 @@ export class MultiplicityEditorModel extends BaseFormModel {
placeholder: [{
value: this.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')">
</mat-form-field>
</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>

View File

@ -261,7 +261,8 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i
description: formValue.description,
hasCommentField: formValue.hasCommentField,
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,
fields: fields.map(editorField=>{
const model = new DatasetDescriptionFieldEditorModel().fromModel(editorField);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -374,7 +374,8 @@
"MULTIPLICITY-MIN": "$Minimalna wielokrotność$",
"MULTIPLICITY-MAX": "$Maksymalna 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ść",
"COMMENT-PLACEHOLDER": "Proszę doprecyzować",
"COMMENT-HINT": "Podaj dodatkowe informacje lub uzasadnienie swojego wyboru",

View File

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

View File

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

View File

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

View File

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