diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DatasetProfileManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DatasetProfileManager.java index 292da8ede..3f60426ed 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DatasetProfileManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DatasetProfileManager.java @@ -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); diff --git a/dmp-frontend/src/app/core/services/dataset-profile/dataset-profile.service.ts b/dmp-frontend/src/app/core/services/dataset-profile/dataset-profile.service.ts index add6e1cdd..66208bd08 100644 --- a/dmp-frontend/src/app/core/services/dataset-profile/dataset-profile.service.ts +++ b/dmp-frontend/src/app/core/services/dataset-profile/dataset-profile.service.ts @@ -31,7 +31,7 @@ export class DatasetProfileService extends BaseService { } createForm(data) { - return this.http.post(this.actionUrl + 'addDmp', data); + return this.httpClient.post(this.actionUrl + 'addDmp', data); } updateForm(id, data): Observable { @@ -55,7 +55,7 @@ export class DatasetProfileService extends BaseService { } newVersion(id, data) { - return this.http.post(this.actionUrl + 'newVersion/' + id, data); + return this.httpClient.post(this.actionUrl + 'newVersion/' + id, data); } delete(id: string, data): Observable { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.html index 2e2e80ef9..5aa4096d6 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.html +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.html @@ -70,8 +70,8 @@ - + diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts index db97b8ca0..17663e5aa 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts @@ -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; } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.html index fb1665453..9ea712673 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.html +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.html @@ -468,27 +468,30 @@
- - - + + - + + + + -
diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts index 0990e4d3f..be47cb207 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts @@ -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 diff --git a/dmp-frontend/src/assets/i18n/de.json b/dmp-frontend/src/assets/i18n/de.json index e2967d859..7c84860d5 100644 --- a/dmp-frontend/src/assets/i18n/de.json +++ b/dmp-frontend/src/assets/i18n/de.json @@ -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" } }, diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index 9030a30c2..fe01ef1f1 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -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" } }, diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index 3660bd8f0..1c0e4caf8 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -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" } }, diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index fc89ec303..5dfe58d7b 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -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" } }, diff --git a/dmp-frontend/src/assets/i18n/hr.json b/dmp-frontend/src/assets/i18n/hr.json index 8864d7938..393b7e2a8 100644 --- a/dmp-frontend/src/assets/i18n/hr.json +++ b/dmp-frontend/src/assets/i18n/hr.json @@ -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" } }, diff --git a/dmp-frontend/src/assets/i18n/pt.json b/dmp-frontend/src/assets/i18n/pt.json index bac9b444c..6a39d3511 100644 --- a/dmp-frontend/src/assets/i18n/pt.json +++ b/dmp-frontend/src/assets/i18n/pt.json @@ -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" } }, diff --git a/dmp-frontend/src/assets/i18n/sk.json b/dmp-frontend/src/assets/i18n/sk.json index 22f731a36..728c666b0 100644 --- a/dmp-frontend/src/assets/i18n/sk.json +++ b/dmp-frontend/src/assets/i18n/sk.json @@ -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" } }, diff --git a/dmp-frontend/src/assets/i18n/sr.json b/dmp-frontend/src/assets/i18n/sr.json index d8db6535f..0219d692d 100644 --- a/dmp-frontend/src/assets/i18n/sr.json +++ b/dmp-frontend/src/assets/i18n/sr.json @@ -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" } }, diff --git a/dmp-frontend/src/assets/i18n/tr.json b/dmp-frontend/src/assets/i18n/tr.json index 79648a072..868f0bebd 100644 --- a/dmp-frontend/src/assets/i18n/tr.json +++ b/dmp-frontend/src/assets/i18n/tr.json @@ -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" } },