Merge remote-tracking branch 'origin/Development' into roadmap

This commit is contained in:
Konstantinos Triantafyllou 2022-05-31 20:49:25 +03:00
commit 48cd6c1d49
15 changed files with 101 additions and 34 deletions

View File

@ -329,10 +329,10 @@ public class DatasetProfileManager {
if (latestVersionDatasetProfile.getVersion().equals(oldDatasetProfile.getVersion())){
eu.eudat.models.data.admin.composite.DatasetProfile sortedProfile = profile.toShort();
eu.eudat.data.entities.DatasetProfile modelDefinition = AdminManager.generateViewStyleDefinition(sortedProfile, apiContext);
modelDefinition.setLabel(oldDatasetProfile.getLabel());
// modelDefinition.setLabel(oldDatasetProfile.getLabel());
modelDefinition.setVersion((short) (oldDatasetProfile.getVersion() + 1));
modelDefinition.setGroupId(oldDatasetProfile.getGroupId());
modelDefinition.setLanguage(oldDatasetProfile.getLanguage());
// modelDefinition.setLanguage(oldDatasetProfile.getLanguage());
apiContext.getOperationsContext().getDatabaseRepository().getDatasetProfileDao().createOrUpdate(modelDefinition);
eu.eudat.data.entities.DatasetProfile datasetProfile = apiContext.getOperationsContext().getDatabaseRepository().getDatasetProfileDao().createOrUpdate(modelDefinition);
this.storeDatasetProfileUsers(datasetProfile, profile, email);

View File

@ -31,7 +31,7 @@ export class DatasetProfileService extends BaseService {
}
createForm(data) {
return this.http.post<DatasetProfileEditorModel>(this.actionUrl + 'addDmp', data);
return this.httpClient.post<string>(this.actionUrl + 'addDmp', data);
}
updateForm(id, data): Observable<DatasetProfileEditorModel> {
@ -55,7 +55,7 @@ export class DatasetProfileService extends BaseService {
}
newVersion(id, data) {
return this.http.post<DatasetProfileEditorModel>(this.actionUrl + 'newVersion/' + id, data);
return this.httpClient.post<string>(this.actionUrl + 'newVersion/' + id, data);
}
delete(id: string, data): Observable<DatasetProfile> {

View File

@ -70,8 +70,8 @@
</mat-form-field>
<!-- [appearance]="titleControl.focused? 'legacy':'none'" floatLabel="never" -->
<mat-form-field class="col field-title" [appearance]="'none'" floatLabel="never">
<input matInput type="text" [placeholder]="('DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.UNTITLED' |translate)+' '+('DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.QUESTION'| translate)" #titleControl="matInput"
[formControl]="this.form.get('title')">
<textarea matInput type="text" [placeholder]="('DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.UNTITLED' |translate)+' '+('DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.QUESTION'| translate)" #titleControl="matInput"
[formControl]="this.form.get('title')"></textarea>
</mat-form-field>
</div>
</div>

View File

@ -12,7 +12,7 @@ import {DatasetProfileComboBoxType} from '@app/core/common/enum/dataset-profile-
import {ErrorStateMatcher} from '@angular/material/core';
import {MatDialog} from '@angular/material/dialog';
import {MatSlideToggleChange} from '@angular/material/slide-toggle';
import {Field} from '@app/core/model/admin/dataset-profile/dataset-profile';
import {DefaultValue, Field} from '@app/core/model/admin/dataset-profile/dataset-profile';
import {DatasetProfileInternalDmpEntitiesType} from '@app/core/common/enum/dataset-profile-internal-dmp-entities-type';
import {FieldEditorModel} from '../../../admin/field-editor-model';
import {
@ -510,9 +510,14 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
const data: CheckBoxFieldData = {
label:''
}
const defaultValue: DefaultValue = {
type: '',
value: 'false'
}
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.CheckBox;
field.data = data;
field.defaultValue = defaultValue;
break;
}

View File

@ -468,27 +468,30 @@
<ng-template #actions>
<div>
<button mat-raised-button class="template_action_btn mr-3" (click)="discardChanges()">{{'DATASET-WIZARD.ACTIONS.CLOSE' | translate}}</button>
<button *ngIf="!viewOnly" mat-raised-button class="template_action_btn save-btn" (click)="onSubmit()" [disabled]="!form.valid">
<button *ngIf="!viewOnly && form.get('status').value!=1" mat-raised-button class="template_action_btn save-btn" (click)="onSubmit()" [disabled]="!form.valid">
{{'DATASET-PROFILE-EDITOR.ACTIONS.SAVE' |translate}}
<mat-icon (click)="$event.stopPropagation();" style="width: 14px;" [matMenuTriggerFor]="menuSave">expand_more</mat-icon>
</button>
<mat-menu #menuSave="matMenu">
<button [disabled]="!form.valid" mat-menu-item (click)="onSubmit(true)" type="button">{{ 'DATASET-WIZARD.ACTIONS.SAVE-AND-CLOSE' | translate }}</button>
<button [disabled]="!form.valid" mat-menu-item (click)="onSubmit()" type="button">{{ 'DATASET-WIZARD.ACTIONS.SAVE-AND-CONTINUE' | translate }}</button>
<button [disabled]="!form.valid" mat-menu-item (click)="onSubmit(true)" type="button">{{ 'DATASET-PROFILE-EDITOR.ACTIONS.SAVE-AND-CLOSE' | translate }}</button>
<button [disabled]="!form.valid" mat-menu-item (click)="onSubmit()" type="button">{{ 'DATASET-PROFILE-EDITOR.ACTIONS.SAVE-AND-CONTINUE' | translate }}</button>
</mat-menu>
<button *ngIf="viewOnly" [@finalize_btn] mat-raised-button class="template_action_btn save-btn" [disabled]="!form.valid" (click)="updateAndFinalize()">
<button *ngIf="viewOnly || form.get('status').value==1" [@finalize_btn] mat-raised-button class="template_action_btn save-btn" [disabled]="!form.valid" (click)="updateAndFinalize()">
{{'DATASET-PROFILE-EDITOR.ACTIONS.UPDATE' |translate}}
<mat-icon (click)="$event.stopPropagation();" style="width: 14px;" [matMenuTriggerFor]="menuUpdate">expand_more</mat-icon>
</button>
<mat-menu #menuUpdate="matMenu">
<button [disabled]="!form.valid" mat-menu-item (click)="updateAndFinalize(true)" type="button">{{ 'DATASET-PROFILE-EDITOR.ACTIONS.UPDATE-AND-CLOSE' | translate }}</button>
<button [disabled]="!form.valid" mat-menu-item (click)="updateAndFinalize()" type="button">{{ 'DATASET-PROFILE-EDITOR.ACTIONS.UPDATE-AND-CONTINUE' | translate }}</button>
</mat-menu>
<button *ngIf="!viewOnly && steps?.length-1 === stepper?.selectedIndex"
<button *ngIf="!viewOnly && form.get('status').value!=1 && steps?.length-1 === stepper?.selectedIndex"
[@finalize_btn] mat-button class="finalize-btn ml-3"
[disabled]="!form.valid"
[class.invisible]="steps?.length-1 !== stepper?.selectedIndex"
(click)="updateAndFinalize()">
<ng-container *ngIf="form.get('status').value!=1">
{{'DATASET-PROFILE-EDITOR.ACTIONS.FINALIZE' |translate}}
</ng-container>
(click)="updateAndFinalize(true)">
{{'DATASET-PROFILE-EDITOR.ACTIONS.FINALIZE' |translate}}
</button>
</div>
</ng-template>

View File

@ -431,6 +431,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
this.datasetProfileService.updateForm(this.datasetProfileId, data)
.pipe(takeUntil(this._destroyed))
.subscribe(() => {
this.afterSave();
this.form.markAsPristine();//deactivate guard
if(close) {
this.router.navigate(['/dataset-profiles']);
@ -442,8 +443,9 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
data.description = this.form.get('description').value;
this.datasetProfileService.newVersion(this.newVersionId, data)
.pipe(takeUntil(this._destroyed))
.subscribe(() => {
this.form.markAsPristine();//deactivate guard
.subscribe((newVersionTemplateId: string) => {
this.afterSave(newVersionTemplateId);
this.form.markAsPristine();//deactivate guard
if(close) {
this.router.navigate(['/dataset-profiles']);
}
@ -458,7 +460,8 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
data = this.form.value;
this.datasetProfileService.createForm(data)
.pipe(takeUntil(this._destroyed))
.subscribe(() => {
.subscribe(newTemplateId => {
this.afterSave(newTemplateId);
this.form.markAsPristine();//deactivate guard
if(close) {
this.router.navigate(['/dataset-profiles']);
@ -468,19 +471,39 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
}
}
afterSave(newId: string = null) {
if(newId) {
this.datasetProfileId = newId;
this.form.value.id = newId;
}
this.isNew = false;
this.newVersionId = null;
// this.dataModel.fromModel(this.form.value);
// if (this.dataModel.status === DatasetProfileEnum.FINALIZED) {
// this.form = this.dataModel.buildForm(true, skipDisable);
// this.viewOnly = true;
// } else {
// this.form = this.dataModel.buildForm();
// }
// this.prepareForm();
}
finalize() {
//const data = this.form.value;
this.form.get('status').setValue(DatasetProfileEnum.FINALIZED);
this.onSubmit();
this.onSubmit(true);
}
updateFinalized() {
updateFinalized(close: boolean = false) {
this.datasetProfileService.updateForm(this.datasetProfileId, this.form.getRawValue())
.pipe(takeUntil(this._destroyed))
.subscribe(() => {
this.form.markAsPristine();//deactivate guard
this.router.navigate(['/dataset-profiles']);
if(close) {
this.router.navigate(['/dataset-profiles']);
}
this.uiNotificationService.snackBarNotification(this.language.instant('DATASET-PROFILE-EDITOR.FEEDBACK-MESSAGES.SAVE-SUCCESS'), SnackBarNotificationLevel.Success)
},error=>this.onCallbackError(error));
}
@ -2081,13 +2104,13 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
}
}
updateAndFinalize(){
updateAndFinalize(close: boolean = false){
if(this.form.get('status').value == DatasetProfileEnum.FINALIZED ){
//UPDATE FORM
if(this.newVersionId){
this.onSubmit();
this.onSubmit(close);
}else{
this.updateFinalized();
this.updateFinalized(close);
}
}else{
//finalize

View File

@ -545,8 +545,12 @@
},
"ACTIONS": {
"SAVE": "Save",
"SAVE-AND-CONTINUE": "Save & Continue",
"SAVE-AND-CLOSE": "Save & Close",
"FINALIZE": "Finalize",
"UPDATE": "Update",
"UPDATE-AND-CONTINUE": "Update & Continue",
"UPDATE-AND-CLOSE": "Update & Close",
"CANCEL": "Cancel",
"DELETE": "Delete",
"ADD-PAGE": "Add Page +",
@ -1306,7 +1310,7 @@
"MANUALLY": "Manually",
"PROFILE": "Dataset Template",
"PREFILLED-DATASET": "Prefilled Dataset",
"SEARCH": "Search a Dataset",
"SEARCH": "Start typing to search for a dataset or software",
"NEXT": "Next"
}
},

View File

@ -545,8 +545,12 @@
},
"ACTIONS": {
"SAVE": "Save",
"SAVE-AND-CONTINUE": "Save & Continue",
"SAVE-AND-CLOSE": "Save & Close",
"FINALIZE": "Finalize",
"UPDATE": "Update",
"UPDATE-AND-CONTINUE": "Update & Continue",
"UPDATE-AND-CLOSE": "Update & Close",
"CANCEL": "Cancel",
"DELETE": "Delete",
"ADD-PAGE": "Add Page +",
@ -1306,7 +1310,7 @@
"MANUALLY": "Manually",
"PROFILE": "Dataset Template",
"PREFILLED-DATASET": "Prefilled Dataset",
"SEARCH": "Search a Dataset",
"SEARCH": "Start typing to search for a dataset or software",
"NEXT": "Next"
}
},

View File

@ -545,8 +545,12 @@
},
"ACTIONS": {
"SAVE": "Grabar",
"SAVE-AND-CONTINUE": "Save & Continue",
"SAVE-AND-CLOSE": "Save & Close",
"FINALIZE": "Finalizar",
"UPDATE": "Actualizar",
"UPDATE-AND-CONTINUE": "Update & Continue",
"UPDATE-AND-CLOSE": "Update & Close",
"CANCEL": "Cancelar",
"DELETE": "Borrar",
"ADD-PAGE": "Añadir página +",
@ -1306,7 +1310,7 @@
"MANUALLY": "Manually",
"PROFILE": "Dataset Template",
"PREFILLED-DATASET": "Prefilled Dataset",
"SEARCH": "Search a Dataset",
"SEARCH": "Start typing to search for a dataset or software",
"NEXT": "Next"
}
},

View File

@ -545,8 +545,12 @@
},
"ACTIONS": {
"SAVE": "Αποθήκευση",
"SAVE-AND-CONTINUE": "Αποθήκευση & Συνέχεια",
"SAVE-AND-CLOSE": "Αποθήκευση & Κλείσιμο",
"FINALIZE": "Οριστικοποίηση",
"UPDATE": "Ενημέρωση",
"UPDATE-AND-CONTINUE": "Ενημέρωση & Συνέχεια",
"UPDATE-AND-CLOSE": "Ενημέρωση & Κλείσιμο",
"CANCEL": "Ακύρωση",
"DELETE": "Διαγραφή",
"ADD-PAGE": "Προσθήκη Σελίδας +",
@ -1306,7 +1310,7 @@
"MANUALLY": "Manually",
"PROFILE": "Dataset Template",
"PREFILLED-DATASET": "Prefilled Dataset",
"SEARCH": "Search a Dataset",
"SEARCH": "Start typing to search for a dataset or software",
"NEXT": "Next"
}
},

View File

@ -545,8 +545,12 @@
},
"ACTIONS": {
"SAVE": "Snimi",
"SAVE-AND-CONTINUE": "Save & Continue",
"SAVE-AND-CLOSE": "Save & Close",
"FINALIZE": "Završi",
"UPDATE": "Dopuni",
"UPDATE-AND-CONTINUE": "Update & Continue",
"UPDATE-AND-CLOSE": "Update & Close",
"CANCEL": "Poništi",
"DELETE": "Obriši",
"ADD-PAGE": "Dodaj stranicu +",
@ -1306,7 +1310,7 @@
"MANUALLY": "Ručno",
"PROFILE": "Predložak za skup podataka",
"PREFILLED-DATASET": "Prethodno uneseni skup podataka",
"SEARCH": "Pretraživanje skupova podataka",
"SEARCH": "Start typing to search for a dataset or software",
"NEXT": "Sljedeće"
}
},

View File

@ -545,8 +545,12 @@
},
"ACTIONS": {
"SAVE": "Guardar",
"SAVE-AND-CONTINUE": "Save & Continue",
"SAVE-AND-CLOSE": "Save & Close",
"FINALIZE": "Concluir",
"UPDATE": "Atualizar",
"UPDATE-AND-CONTINUE": "Update & Continue",
"UPDATE-AND-CLOSE": "Update & Close",
"CANCEL": "Cancelar",
"DELETE": "Eliminar",
"ADD-PAGE": "Adicionar Página +",
@ -1306,7 +1310,7 @@
"MANUALLY": "Manually",
"PROFILE": "Dataset Template",
"PREFILLED-DATASET": "Prefilled Dataset",
"SEARCH": "Search a Dataset",
"SEARCH": "Start typing to search for a dataset or software",
"NEXT": "Next"
}
},

View File

@ -545,8 +545,12 @@
},
"ACTIONS": {
"SAVE": "Uložiť",
"SAVE-AND-CONTINUE": "Save & Continue",
"SAVE-AND-CLOSE": "Save & Close",
"FINALIZE": "Dokončiť",
"UPDATE": "Aktualizovať",
"UPDATE-AND-CONTINUE": "Update & Continue",
"UPDATE-AND-CLOSE": "Update & Close",
"CANCEL": "Zrušiť",
"DELETE": "Vymazať",
"ADD-PAGE": "Pridať stránku +",
@ -1306,7 +1310,7 @@
"MANUALLY": "Manually",
"PROFILE": "Dataset Template",
"PREFILLED-DATASET": "Prefilled Dataset",
"SEARCH": "Search a Dataset",
"SEARCH": "Start typing to search for a dataset or software",
"NEXT": "Next"
}
},

View File

@ -545,8 +545,12 @@
},
"ACTIONS": {
"SAVE": "Sačuvajte",
"SAVE-AND-CONTINUE": "Save & Continue",
"SAVE-AND-CLOSE": "Save & Close",
"FINALIZE": "Završite",
"UPDATE": "Ažurirajte",
"UPDATE-AND-CONTINUE": "Update & Continue",
"UPDATE-AND-CLOSE": "Update & Close",
"CANCEL": "Otkažite",
"DELETE": "Obrišite",
"ADD-PAGE": "Dodajte stranu +",
@ -1306,7 +1310,7 @@
"MANUALLY": "Manually",
"PROFILE": "Dataset Template",
"PREFILLED-DATASET": "Prefilled Dataset",
"SEARCH": "Search a Dataset",
"SEARCH": "Start typing to search for a dataset or software",
"NEXT": "Next"
}
},

View File

@ -545,8 +545,12 @@
},
"ACTIONS": {
"SAVE": "Kaydet",
"SAVE-AND-CONTINUE": "Save & Continue",
"SAVE-AND-CLOSE": "Save & Close",
"FINALIZE": "Tamamla",
"UPDATE": "Güncelle",
"UPDATE-AND-CONTINUE": "Update & Continue",
"UPDATE-AND-CLOSE": "Update & Close",
"CANCEL": "İptal",
"DELETE": "Sil",
"ADD-PAGE": "Sayfa Ekle +",
@ -1306,7 +1310,7 @@
"MANUALLY": "Manually",
"PROFILE": "Dataset Template",
"PREFILLED-DATASET": "Prefilled Dataset",
"SEARCH": "Search a Dataset",
"SEARCH": "Start typing to search for a dataset or software",
"NEXT": "Next"
}
},