This commit is contained in:
Diamantis Tziotzios 2024-01-09 09:42:58 +02:00
parent 6bd3302788
commit 536ba9b900
9 changed files with 72 additions and 53 deletions

View File

@ -1422,7 +1422,7 @@ public class DataManagementPlanManager {
for (Researcher researcher : dmpEntity.getResearchers()) { for (Researcher researcher : dmpEntity.getResearchers()) {
XWPFRun runResearcher = systemFieldParagraph.createRun(); XWPFRun runResearcher = systemFieldParagraph.createRun();
runResearcher.addBreak(); runResearcher.addBreak();
runResearcher.setText("" + researcher.getLabel()); runResearcher.setText(researcher.getLabel());
runResearcher.setColor("116a78"); runResearcher.setColor("116a78");
} }
break; break;
@ -1430,7 +1430,7 @@ public class DataManagementPlanManager {
for (Organisation organisation : dmpEntity.getOrganisations()) { for (Organisation organisation : dmpEntity.getOrganisations()) {
XWPFRun runOrganisation = systemFieldParagraph.createRun(); XWPFRun runOrganisation = systemFieldParagraph.createRun();
runOrganisation.addBreak(); runOrganisation.addBreak();
runOrganisation.setText("" + organisation.getLabel()); runOrganisation.setText(organisation.getLabel());
runOrganisation.setColor("116a78"); runOrganisation.setColor("116a78");
} }
break; break;
@ -1581,6 +1581,12 @@ public class DataManagementPlanManager {
//runDatasetTitle.setBold(true); //runDatasetTitle.setBold(true);
//runDatasetTitle.setFontSize(12); //runDatasetTitle.setFontSize(12);
XWPFParagraph descriptionParagraph = document.createParagraph();
XWPFRun descriptionParagraphRun = descriptionParagraph.createRun();
descriptionParagraphRun.setText("Description: ");
descriptionParagraphRun.setColor("000000");
wordBuilder.addParagraphContent(datasetEntity.getDescription(), document, ParagraphStyle.HTML, BigInteger.ZERO, 0);
XWPFParagraph datasetTemplateParagraph = document.createParagraph(); XWPFParagraph datasetTemplateParagraph = document.createParagraph();
// datasetTemplateParagraph.setStyle("Heading3"); // datasetTemplateParagraph.setStyle("Heading3");
XWPFRun runDatasetTemplate1 = datasetTemplateParagraph.createRun(); XWPFRun runDatasetTemplate1 = datasetTemplateParagraph.createRun();

View File

@ -62,7 +62,7 @@ export class DmpBlueprintDefinitionEditor {
const formBuilder = new FormBuilder(); const formBuilder = new FormBuilder();
const formGroup = formBuilder.group({}); const formGroup = formBuilder.group({});
const sectionsFormArray = new Array<FormGroup>(); const sectionsFormArray = new Array<FormGroup>();
this.sections.forEach(item => { this.sections.sort((a, b) => a.ordinal - b.ordinal).forEach(item => {
const form: FormGroup = item.buildForm(); const form: FormGroup = item.buildForm();
sectionsFormArray.push(form); sectionsFormArray.push(form);
}); });
@ -103,7 +103,7 @@ export class SectionDmpBlueprintEditor {
}); });
const formBuilder = new FormBuilder(); const formBuilder = new FormBuilder();
const fieldsFormArray = new Array<FormGroup>(); const fieldsFormArray = new Array<FormGroup>();
this.fields.forEach(item => { this.fields.sort((a, b) => a.ordinal - b.ordinal).forEach(item => {
const form: FormGroup = item.buildForm(); const form: FormGroup = item.buildForm();
fieldsFormArray.push(form); fieldsFormArray.push(form);
}); });

View File

@ -249,6 +249,9 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
removeField(sectionIndex: number, fieldIndex: number): void { removeField(sectionIndex: number, fieldIndex: number): void {
this.fieldsArray(sectionIndex).removeAt(fieldIndex); this.fieldsArray(sectionIndex).removeAt(fieldIndex);
this.fieldsArray(sectionIndex).controls.forEach((field, index) => {
field.get('ordinal').setValue(index + 1);
});
} }
systemFieldsArray(sectionIndex: number): FormArray { systemFieldsArray(sectionIndex: number): FormArray {
@ -366,6 +369,9 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
drop(event: CdkDragDrop<string[]>, sectionIndex: number) { drop(event: CdkDragDrop<string[]>, sectionIndex: number) {
moveItemInArray(this.fieldsArray(sectionIndex).controls, event.previousIndex, event.currentIndex); moveItemInArray(this.fieldsArray(sectionIndex).controls, event.previousIndex, event.currentIndex);
moveItemInArray(this.fieldsArray(sectionIndex).value, event.previousIndex, event.currentIndex); moveItemInArray(this.fieldsArray(sectionIndex).value, event.previousIndex, event.currentIndex);
this.fieldsArray(sectionIndex).controls.forEach((field, index) => {
field.get('ordinal').setValue(index + 1);
});
} }
dropSections(event: CdkDragDrop<string[]>) { dropSections(event: CdkDragDrop<string[]>) {

View File

@ -84,7 +84,7 @@
<div class="col-auto formForStep0" id="editor-form" *ngIf="this.step === 0 && this.isNew"> <div class="col-auto formForStep0" id="editor-form" *ngIf="this.step === 0 && this.isNew">
<div class="col-12 blueprint-section" [hidden]="this.step !== 0"> <div class="col-12 blueprint-section" [hidden]="this.step !== 0">
<div class=""> <div class="">
<div class="heading2">0.1 Title of DMP *</div> <div class="heading2">Title of DMP *</div>
<mat-form-field> <mat-form-field>
<mat-label>Title</mat-label> <mat-label>Title</mat-label>
<input matInput type="text" name="label" [formControl]="formGroup.get('label')" required> <input matInput type="text" name="label" [formControl]="formGroup.get('label')" required>
@ -95,13 +95,13 @@
</mat-form-field> </mat-form-field>
</div> </div>
<div class=""> <div class="">
<div class="heading2">0.2 Description of DMP *</div> <div class="heading2">Description of DMP *</div>
<rich-text-editor-component [parentFormGroup]="formGroup" [controlName]="'description'" <rich-text-editor-component [parentFormGroup]="formGroup" [controlName]="'description'"
[placeholder]="'Fill with description'" [required]="true"> [placeholder]="'Fill with description'" [required]="true">
</rich-text-editor-component> </rich-text-editor-component>
</div> </div>
<div class="" style="margin-top: 3%;"> <div class="" style="margin-top: 3%;">
<div class="heading2">0.3 Blueprint of DMP *</div> <div class="heading2">Blueprint of DMP *</div>
<mat-form-field> <mat-form-field>
<mat-label>Select blueprint</mat-label> <mat-label>Select blueprint</mat-label>
<app-single-auto-complete [required]="false" [formControl]="formGroup.get('profile')" placeholder="Select blueprint" [configuration]="dmpBlueprintAutoCompleteConfiguration"> <app-single-auto-complete [required]="false" [formControl]="formGroup.get('profile')" placeholder="Select blueprint" [configuration]="dmpBlueprintAutoCompleteConfiguration">

View File

@ -425,5 +425,13 @@ a:hover {
::ng-deep .input-form .mat-form-field-appearance-outline .mat-form-field-infix { ::ng-deep .input-form .mat-form-field-appearance-outline .mat-form-field-infix {
font-size: 1rem; font-size: 1rem;
padding: 0.6em 0 1em 0 !important; // padding: 0.6em 0 1em 0 !important;
} }
::ng-deep .mat-form-field-appearance-outline .mat-form-field-infix {
padding: 1em 0 1em 0 !important;
}
// ::ng-deep .mat-form-field-appearance-outline .mat-form-field-infix {
// padding: 0rem 0rem 0.4rem 0rem !important;
// }

View File

@ -332,7 +332,7 @@
vertical-align: bottom; vertical-align: bottom;
} }
::ng-deep .mat-form-field-appearance-outline .mat-form-field-infix { :host ::ng-deep .mat-form-field-appearance-outline .mat-form-field-infix {
padding: 0rem 0rem 0.4rem 0rem !important; padding: 0rem 0rem 0.4rem 0rem !important;
} }

View File

@ -318,7 +318,7 @@
"DATASET-TEMPLATE-REMOVE-USER": "Remove Editor", "DATASET-TEMPLATE-REMOVE-USER": "Remove Editor",
"DATASET-TEMPLATE-NO-USERS-YET": "... No editors yet", "DATASET-TEMPLATE-NO-USERS-YET": "... No editors yet",
"DATASET-TEMPLATE-VALIDATE-AND-ADD-USER": "Validate and Add Editor", "DATASET-TEMPLATE-VALIDATE-AND-ADD-USER": "Validate and Add Editor",
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description", "DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Template description",
"UNTITLED": "Untitled", "UNTITLED": "Untitled",
"QUESTION": "Question", "QUESTION": "Question",
"TEMPLATE-OUTLINE": "Template outline", "TEMPLATE-OUTLINE": "Template outline",
@ -1159,7 +1159,7 @@
"DATASET-SELECTION": "Dataset selection", "DATASET-SELECTION": "Dataset selection",
"DESCRIPTION-INFO": "Description info", "DESCRIPTION-INFO": "Description info",
"LICENSE-INFO": "License", "LICENSE-INFO": "License",
"DATASET": "Dataset", "DATASET": "Description",
"PREVIOUS": "Previous", "PREVIOUS": "Previous",
"NEXT": "Next" "NEXT": "Next"
}, },

View File

@ -1,6 +1,5 @@
[ [
"DatasetProfileEditorModel.description", "DatasetProfileEditorModel.description",
"DatasetProfileEditorModel.type",
"DatasetProfileEditorModel.label", "DatasetProfileEditorModel.label",
"SectionEditorModel.title", "SectionEditorModel.title",
"SectionEditorModel.description", "SectionEditorModel.description",