diff --git a/dmp-backend/web/src/main/resources/externalUrls/ExternalUrls.xml b/dmp-backend/web/src/main/resources/externalUrls/ExternalUrls.xml index 45500328a..e272cae9a 100644 --- a/dmp-backend/web/src/main/resources/externalUrls/ExternalUrls.xml +++ b/dmp-backend/web/src/main/resources/externalUrls/ExternalUrls.xml @@ -1013,7 +1013,7 @@ 1 External - https://sandbox.zenodo.org/api/records/?page={page}&size={pageSize}&q="{like}" + https://zenodo.org/api/records/?page={page}&size={pageSize}&q="{like}" 1 application/json @@ -1028,7 +1028,7 @@ - https://sandbox.zenodo.org/api/records/{id} + https://zenodo.org/api/records/{id} diff --git a/dmp-frontend/src/app/core/core-service.module.ts b/dmp-frontend/src/app/core/core-service.module.ts index e2f71e495..6f81f1095 100644 --- a/dmp-frontend/src/app/core/core-service.module.ts +++ b/dmp-frontend/src/app/core/core-service.module.ts @@ -45,6 +45,7 @@ import { UserService } from './services/user/user.service'; import { CollectionUtils } from './services/utilities/collection-utils.service'; import { TypeUtils } from './services/utilities/type-utils.service'; import { SpecialAuthGuard } from './special-auth-guard.service'; +import {PrefillingService} from "@app/core/services/prefilling.service"; // // // This is shared module that provides all the services. Its imported only once on the AppModule. @@ -118,7 +119,8 @@ export class CoreServiceModule { deps: [ConfigurationService, HttpClient], multi: true }, - LanguageInfoService + LanguageInfoService, + PrefillingService ], }; } diff --git a/dmp-frontend/src/app/core/model/dataset/prefilling.ts b/dmp-frontend/src/app/core/model/dataset/prefilling.ts new file mode 100644 index 000000000..cc3e36a4b --- /dev/null +++ b/dmp-frontend/src/app/core/model/dataset/prefilling.ts @@ -0,0 +1,5 @@ +export interface Prefilling { + pid: string; + name: string; + tag: string; +} diff --git a/dmp-frontend/src/app/core/services/prefilling.service.ts b/dmp-frontend/src/app/core/services/prefilling.service.ts new file mode 100644 index 000000000..3d5527303 --- /dev/null +++ b/dmp-frontend/src/app/core/services/prefilling.service.ts @@ -0,0 +1,25 @@ +import {Injectable} from "@angular/core"; +import {HttpClient, HttpHeaders} from "@angular/common/http"; +import {BaseHttpService} from "@app/core/services/http/base-http.service"; +import {ConfigurationService} from "@app/core/services/configuration/configuration.service"; +import {Observable} from "rxjs"; +import {Prefilling} from "@app/core/model/dataset/prefilling"; +import {DatasetWizardModel} from "@app/core/model/dataset/dataset-wizard"; + +@Injectable() +export class PrefillingService { + private readonly actionUrl: string; + private headers = new HttpHeaders(); + + constructor(private http: BaseHttpService, private httpClient: HttpClient, private configurationService: ConfigurationService) { + this.actionUrl = configurationService.server + 'prefilling/'; + } + + public getPrefillingList(like: string, configId: string): Observable { + return this.http.get(this.actionUrl + 'list?configId=' + encodeURIComponent(configId) + '&like=' + encodeURIComponent(like), { headers: this.headers }); + } + + public getPrefillingDataset(pid: string, profileId: string, configId: string): Observable { + return this.http.get(this.actionUrl + '/generate/' + encodeURIComponent(pid) + '?configId=' + encodeURIComponent(configId) + '&profileId=' + encodeURIComponent(profileId), { headers: this.headers }); + } +} diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts index a4c353977..1c19e5685 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts @@ -981,11 +981,11 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i } canGoUp(index: number): boolean { - return index > 0; + return index > 0 && !this.viewOnly; } canGoDown(index: number): boolean { - return index < (this.fieldsArray.length - 1); + return index < (this.fieldsArray.length - 1) && !this.viewOnly; } } diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts index 27c543b6e..62443db96 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts @@ -1,52 +1,59 @@ -import { Component, OnInit, ViewChild } from '@angular/core'; -import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import { ActivatedRoute, Router } from '@angular/router'; -import { DatasetStatus } from '@app/core/common/enum/dataset-status'; -import { DmpStatus } from '@app/core/common/enum/dmp-status'; -import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; -import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile'; -import { DmpModel } from '@app/core/model/dmp/dmp'; -import { DmpListingModel } from '@app/core/model/dmp/dmp-listing'; -import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria'; -import { DmpCriteria } from '@app/core/query/dmp/dmp-criteria'; -import { RequestItem } from '@app/core/query/request-item'; -import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service'; -import { DmpService } from '@app/core/services/dmp/dmp.service'; -import { ExternalSourcesConfigurationService } from '@app/core/services/external-sources/external-sources-configuration.service'; -import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service'; -import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service'; -import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration'; -import { DatasetCopyDialogueComponent } from '@app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component'; -import { DatasetWizardEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; -import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item'; -import { IBreadCrumbComponent } from '@app/ui/misc/breadcrumb/definition/IBreadCrumbComponent'; -import { DatasetDescriptionFormEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model'; -import { Link, LinkToScroll, TableOfContents } from '@app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents'; -import { BaseComponent } from '@common/base/base.component'; -import { FormService } from '@common/forms/form-service'; -import { FormValidationErrorsDialogComponent } from '@common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component'; -import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model'; -import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; -import { TranslateService } from '@ngx-translate/core'; +import {Component, OnInit, ViewChild} from '@angular/core'; +import {AbstractControl, FormArray, FormControl, FormGroup} from '@angular/forms'; +import {MatDialog} from '@angular/material/dialog'; +import {MatSnackBar} from '@angular/material/snack-bar'; +import {ActivatedRoute, Router} from '@angular/router'; +import {DatasetStatus} from '@app/core/common/enum/dataset-status'; +import {DmpStatus} from '@app/core/common/enum/dmp-status'; +import {DataTableRequest} from '@app/core/model/data-table/data-table-request'; +import {DatasetProfileModel} from '@app/core/model/dataset/dataset-profile'; +import {DmpModel} from '@app/core/model/dmp/dmp'; +import {DmpListingModel} from '@app/core/model/dmp/dmp-listing'; +import {DatasetProfileCriteria} from '@app/core/query/dataset-profile/dataset-profile-criteria'; +import {DmpCriteria} from '@app/core/query/dmp/dmp-criteria'; +import {RequestItem} from '@app/core/query/request-item'; +import {DatasetWizardService} from '@app/core/services/dataset-wizard/dataset-wizard.service'; +import {DmpService} from '@app/core/services/dmp/dmp.service'; +import {ExternalSourcesConfigurationService} from '@app/core/services/external-sources/external-sources-configuration.service'; +import {ExternalSourcesService} from '@app/core/services/external-sources/external-sources.service'; +import { + SnackBarNotificationLevel, + UiNotificationService +} from '@app/core/services/notification/ui-notification-service'; +import {SingleAutoCompleteConfiguration} from '@app/library/auto-complete/single/single-auto-complete-configuration'; +import {DatasetCopyDialogueComponent} from '@app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component'; +import {DatasetWizardEditorModel} from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; +import {BreadcrumbItem} from '@app/ui/misc/breadcrumb/definition/breadcrumb-item'; +import {IBreadCrumbComponent} from '@app/ui/misc/breadcrumb/definition/IBreadCrumbComponent'; +import {DatasetDescriptionFormEditorModel} from '@app/ui/misc/dataset-description-form/dataset-description-form.model'; +import { + Link, + LinkToScroll, + TableOfContents +} from '@app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents'; +import {FormService} from '@common/forms/form-service'; +import {FormValidationErrorsDialogComponent} from '@common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component'; +import {ValidationErrorModel} from '@common/forms/validation/error-model/validation-error-model'; +import {ConfirmationDialogComponent} from '@common/modules/confirmation-dialog/confirmation-dialog.component'; +import {TranslateService} from '@ngx-translate/core'; import * as FileSaver from 'file-saver'; -import { Observable, of as observableOf, interval} from 'rxjs'; -import { catchError, debounceTime, filter, map, takeUntil } from 'rxjs/operators'; -import { LockService } from '@app/core/services/lock/lock.service'; -import { Location } from '@angular/common'; -import { LockModel } from '@app/core/model/lock/lock.model'; -import { Guid } from '@common/types/guid'; -import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; -import { AuthService } from '@app/core/services/auth/auth.service'; -import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; -import { SaveType } from '@app/core/common/enum/save-type'; -import { DatasetWizardModel } from '@app/core/model/dataset/dataset-wizard'; -import { MatomoService } from '@app/core/services/matomo/matomo-service'; -import { HttpClient } from '@angular/common/http'; -import { VisibilityRulesService } from '@app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service'; -import { PopupNotificationDialogComponent } from '@app/library/notification/popup/popup-notification.component'; -import { CheckDeactivateBaseComponent } from '@app/library/deactivate/deactivate.component'; +import {interval, Observable, of as observableOf} from 'rxjs'; +import {catchError, debounceTime, filter, map, takeUntil} from 'rxjs/operators'; +import {LockService} from '@app/core/services/lock/lock.service'; +import {Location} from '@angular/common'; +import {LockModel} from '@app/core/model/lock/lock.model'; +import {Guid} from '@common/types/guid'; +import {isNullOrUndefined} from '@app/utilities/enhancers/utils'; +import {AuthService} from '@app/core/services/auth/auth.service'; +import {ConfigurationService} from '@app/core/services/configuration/configuration.service'; +import {SaveType} from '@app/core/common/enum/save-type'; +import {DatasetWizardModel} from '@app/core/model/dataset/dataset-wizard'; +import {MatomoService} from '@app/core/services/matomo/matomo-service'; +import {HttpClient} from '@angular/common/http'; +import {VisibilityRulesService} from '@app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service'; +import {PopupNotificationDialogComponent} from '@app/library/notification/popup/popup-notification.component'; +import {CheckDeactivateBaseComponent} from '@app/library/deactivate/deactivate.component'; +import {PrefillDatasetComponent} from "@app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component"; @Component({ selector: 'app-dataset-wizard-component', @@ -95,14 +102,14 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme tocScrollTop: number; links: Link[] = []; //the table seraches for elements to scroll on page with id (TOCENTRY_ID_PREFIX+fieldsetId) - TOCENTRY_ID_PREFIX="TocEntRy"; + TOCENTRY_ID_PREFIX = "TocEntRy"; showtocentriesErrors = false; @ViewChild('table0fContents') table0fContents: TableOfContents; hintErrors: boolean = false; datasetIsOnceSaved = false; - fieldsetIdWithFocus:string; - visRulesService:VisibilityRulesService; + fieldsetIdWithFocus: string; + visRulesService: VisibilityRulesService; constructor( private datasetWizardService: DatasetWizardService, @@ -131,7 +138,9 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme this.route .data .pipe(takeUntil(this._destroyed)) - .subscribe(v => this.viewOnly = v['public']); + .subscribe(v => { + this.viewOnly = v['public']; + }); const dmpRequestItem: RequestItem = new RequestItem(); dmpRequestItem.criteria = new DmpCriteria(); @@ -161,51 +170,53 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme this.datasetWizardService.getSingle(this.itemId) .pipe(takeUntil(this._destroyed)) .subscribe(data => { - this.lockService.checkLockStatus(data.id).pipe(takeUntil(this._destroyed)).subscribe(lockStatus => { - this.lockStatus = lockStatus; - this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(data); - this.needsUpdate(); - this.breadCrumbs = observableOf([ - { - parentComponentName: null, - label: this.datasetWizardModel.label, - url: '/datasets/edit/' + this.datasetWizardModel.id, - notFoundResolver: [ - { - parentComponentName: null, - label: this.language.instant('NAV-BAR.MY-DATASET-DESCRIPTIONS').toUpperCase(), - url: '/datasets' - }, - ] - }]); - this.formGroup = this.datasetWizardModel.buildForm(); - this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue())); - this.editMode = this.datasetWizardModel.status === DatasetStatus.Draft; - if (this.datasetWizardModel.status === DatasetStatus.Finalized || lockStatus) { - this.formGroup.disable(); - this.viewOnly = true; - } - if (!lockStatus && !isNullOrUndefined(this.authService.current())) { - this.lock = new LockModel(data.id, this.authService.current()); + this.lockService.checkLockStatus(data.id).pipe(takeUntil(this._destroyed)).subscribe(lockStatus => { + this.lockStatus = lockStatus; + this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(data); + this.needsUpdate(); + this.breadCrumbs = observableOf([ + { + parentComponentName: null, + label: this.datasetWizardModel.label, + url: '/datasets/edit/' + this.datasetWizardModel.id, + notFoundResolver: [ + { + parentComponentName: null, + label: this.language.instant('NAV-BAR.MY-DATASET-DESCRIPTIONS').toUpperCase(), + url: '/datasets' + }, + ] + }]); + this.formGroup = this.datasetWizardModel.buildForm(); + this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue())); + this.editMode = this.datasetWizardModel.status === DatasetStatus.Draft; + if (this.datasetWizardModel.status === DatasetStatus.Finalized || lockStatus) { + this.formGroup.disable(); + this.viewOnly = true; + } + if (!lockStatus && !isNullOrUndefined(this.authService.current())) { + this.lock = new LockModel(data.id, this.authService.current()); - this.lockService.createOrUpdate(this.lock).pipe(takeUntil(this._destroyed)).subscribe(async result => { - this.lock.id = Guid.parse(result); - interval(this.configurationService.lockInterval).pipe(takeUntil(this._destroyed)).subscribe(() => this.pumpLock()); - }); - } - // if (this.viewOnly) { this.formGroup.disable(); } // For future use, to make Dataset edit like DMP. - this.loadDatasetProfiles(); - this.registerFormListeners(); + this.lockService.createOrUpdate(this.lock).pipe(takeUntil(this._destroyed)).subscribe(async result => { + this.lock.id = Guid.parse(result); + interval(this.configurationService.lockInterval).pipe(takeUntil(this._destroyed)).subscribe(() => this.pumpLock()); + }); + } + // if (this.viewOnly) { this.formGroup.disable(); } // For future use, to make Dataset edit like DMP. + this.loadDatasetProfiles(); + this.registerFormListeners(); - if(lockStatus){ - this.dialog.open(PopupNotificationDialogComponent,{data:{ - title:this.language.instant('DATASET-WIZARD.LOCKED.TITLE'), - message:this.language.instant('DATASET-WIZARD.LOCKED.MESSAGE') - }, maxWidth:'30em'}); - } - // this.availableProfiles = this.datasetWizardModel.dmp.profiles; - }) - }, + if (lockStatus) { + this.dialog.open(PopupNotificationDialogComponent, { + data: { + title: this.language.instant('DATASET-WIZARD.LOCKED.TITLE'), + message: this.language.instant('DATASET-WIZARD.LOCKED.MESSAGE') + }, maxWidth: '30em' + }); + } + // this.availableProfiles = this.datasetWizardModel.dmp.profiles; + }) + }, error => { switch (error.status) { case 403: @@ -232,7 +243,24 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue())); this.editMode = this.datasetWizardModel.status === DatasetStatus.Draft; this.formGroup.get('dmp').disable(); - + const dialogRef = this.dialog.open(PrefillDatasetComponent, { + width: '590px', + minHeight: '200px', + restoreFocus: false, + data: { + availableProfiles: this.formGroup.get('dmp').value.profiles, + }, + panelClass: 'custom-modalbox' + }); + dialogRef.afterClosed().subscribe(result => { + if(result) { + this.datasetWizardModel = this.datasetWizardModel.fromModel(result); + this.datasetWizardModel.dmp = data; + this.formGroup = this.datasetWizardModel.buildForm(); + this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue())); + this.formGroup.get('dmp').disable(); + } + }) this.loadDatasetProfiles(); this.registerFormListeners(); // this.availableProfiles = data.profiles; @@ -319,11 +347,11 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme this.isNew = false; this.datasetWizardService.getSinglePublic(this.publicId) .pipe(takeUntil(this._destroyed)).pipe( - catchError((error: any) => { - this.uiNotificationService.snackBarNotification(error.error.message, SnackBarNotificationLevel.Error); - this.router.navigate(['/datasets/publicEdit/' + this.publicId]); - return observableOf(null); - })) + catchError((error: any) => { + this.uiNotificationService.snackBarNotification(error.error.message, SnackBarNotificationLevel.Error); + this.router.navigate(['/datasets/publicEdit/' + this.publicId]); + return observableOf(null); + })) .subscribe(data => { if (data) { this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(data); @@ -334,8 +362,16 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme this.editMode = this.datasetWizardModel.status === DatasetStatus.Draft; this.formGroup.get('dmp').setValue(this.datasetWizardModel.dmp); const breadcrumbs = []; - breadcrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.PUBLIC DATASETS'), url: '/explore' }); - breadcrumbs.push({ parentComponentName: null, label: this.datasetWizardModel.label, url: '/datasets/publicEdit/' + this.datasetWizardModel.id }); + breadcrumbs.push({ + parentComponentName: null, + label: this.language.instant('NAV-BAR.PUBLIC DATASETS'), + url: '/explore' + }); + breadcrumbs.push({ + parentComponentName: null, + label: this.datasetWizardModel.label, + url: '/datasets/publicEdit/' + this.datasetWizardModel.id + }); this.breadCrumbs = observableOf(breadcrumbs); } }); @@ -456,7 +492,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme .subscribe(x => { this.formChanged(); }); - // this._listenersSubscription.add(datasetProfileDefinitionSubscription); + // this._listenersSubscription.add(datasetProfileDefinitionSubscription); } // this._listenersSubscription.add(dmpSubscription); @@ -466,6 +502,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme // this._listenersSubscription.add(uriSubscription); // this._listenersSubscription.add(tagsSubscription); } + // private _unregisterFormListeners(){ // this._listenersSubscription.unsubscribe(); // this._listenersSubscription = new Subscription(); @@ -475,8 +512,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme if (dmp) { this.formGroup.get('profile').enable(); this.loadDatasetProfiles(); - } - else { + } else { this.availableProfiles = []; this.formGroup.get('profile').reset(); this.formGroup.get('profile').disable(); @@ -495,7 +531,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme searchDmp(query: string): Observable { const fields: Array = new Array(); fields.push('-created'); - const dmpDataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); + const dmpDataTableRequest: DataTableRequest = new DataTableRequest(0, null, {fields: fields}); dmpDataTableRequest.criteria = new DmpCriteria(); dmpDataTableRequest.criteria.like = query; dmpDataTableRequest.criteria.status = DmpStatus.Draft; @@ -531,7 +567,6 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme this.formGroup.get('status').setValue(DmpStatus.Draft); this.onCallbackError(error); } - ) } else { this.publicMode ? this.router.navigate(['/explore']) : this.router.navigate(['/datasets']); @@ -542,8 +577,9 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme getDatasetDisplay(item: any): string { if (!this.publicMode) { return (item['status'] ? this.language.instant('TYPES.DATASET-STATUS.FINALISED').toUpperCase() : this.language.instant('TYPES.DATASET-STATUS.DRAFT').toUpperCase()) + ': ' + item['label']; + } else { + return item['label']; } - else { return item['label']; } } getDefinition(profileId: string) { @@ -570,11 +606,11 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme // this.formGroup.addControl('datasetProfileDefinition', datasetProfileDefinitionForm); this.formGroup.get('datasetProfileDefinition').valueChanges - .pipe(debounceTime(600)) - .pipe(takeUntil(this._destroyed)) - .subscribe(x => { - this.formChanged(); - }); + .pipe(debounceTime(600)) + .pipe(takeUntil(this._destroyed)) + .subscribe(x => { + this.formChanged(); + }); }); } @@ -616,7 +652,6 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme // } - submit(saveType?: SaveType) { this.scrollTop = document.getElementById('dataset-editor-form').scrollTop; this.tocScrollTop = document.getElementById('stepper-options').scrollTop; @@ -632,17 +667,22 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme } - - private _getErrorMessage(formControl: AbstractControl, name: string): string[] { const errors: string[] = []; Object.keys(formControl.errors).forEach(key => { - if (key === 'required') { errors.push(this.language.instant(name + ": " + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.REQUIRED'))); } + if (key === 'required') { + errors.push(this.language.instant(name + ": " + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.REQUIRED'))); + } // if (key === 'required') { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + this.getPlaceHolder(formControl) + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.REQUIRED')); } - else if (key === 'email') { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.EMAIL')); } - else if (key === 'min') { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.MIN-VALUE', { 'min': formControl.getError('min').min })); } - else if (key === 'max') { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.MAX-VALUE', { 'max': formControl.getError('max').max })); } - else { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + formControl.errors[key].message); } + else if (key === 'email') { + errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.EMAIL')); + } else if (key === 'min') { + errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.MIN-VALUE', {'min': formControl.getError('min').min})); + } else if (key === 'max') { + errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.MAX-VALUE', {'max': formControl.getError('max').max})); + } else { + errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + formControl.errors[key].message); + } }); return errors; } @@ -661,11 +701,10 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme } - - private _buildSemiFormErrorMessages(): string[]{//not including datasetProfileDefinition + private _buildSemiFormErrorMessages(): string[] {//not including datasetProfileDefinition const errmess: string[] = []; - Object.keys(this.formGroup.controls).forEach(controlName=>{ - if(controlName != 'datasetProfileDefinition' && this.formGroup.get(controlName).invalid){ + Object.keys(this.formGroup.controls).forEach(controlName => { + if (controlName != 'datasetProfileDefinition' && this.formGroup.get(controlName).invalid) { errmess.push(...this._buildErrorMessagesForAbstractControl(this.formGroup.get(controlName), controlName)); } }) @@ -674,16 +713,16 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme } // takes as an input an abstract control and gets its error messages[] - private _buildErrorMessagesForAbstractControl(aControl: AbstractControl, controlName: string):string[]{ - const errmess:string[] = []; + private _buildErrorMessagesForAbstractControl(aControl: AbstractControl, controlName: string): string[] { + const errmess: string[] = []; - if(aControl.invalid){ + if (aControl.invalid) { - if(aControl.errors){ + if (aControl.errors) { //check if has placeholder - if( (aControl).nativeElement !== undefined && (aControl).nativeElement !== null){ + if ((aControl).nativeElement !== undefined && (aControl).nativeElement !== null) { const placeholder = this._getPlaceHolder(aControl); - if(placeholder){ + if (placeholder) { controlName = placeholder; } } @@ -695,19 +734,19 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme /*in case the aControl is FormControl then the it should have provided its error messages above. No need to check case of FormControl below*/ - if(aControl instanceof FormGroup){ + if (aControl instanceof FormGroup) { const fg = aControl as FormGroup; //check children - Object.keys(fg.controls).forEach(controlName=>{ + Object.keys(fg.controls).forEach(controlName => { errmess.push(...this._buildErrorMessagesForAbstractControl(fg.get(controlName), controlName)); }); - }else if(aControl instanceof FormArray){ + } else if (aControl instanceof FormArray) { const fa = aControl as FormArray; - fa.controls.forEach((control,index)=>{ - errmess.push(... this._buildErrorMessagesForAbstractControl(control, `${controlName} --> ${index+1}`)); + fa.controls.forEach((control, index) => { + errmess.push(...this._buildErrorMessagesForAbstractControl(control, `${controlName} --> ${index + 1}`)); }); } @@ -718,8 +757,8 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme save(saveType?: SaveType) { - Object.keys(this.formGroup.controls).forEach(controlName=>{ - if(controlName == 'datasetProfileDefinition'){ + Object.keys(this.formGroup.controls).forEach(controlName => { + if (controlName == 'datasetProfileDefinition') { return; } this.formService.touchAllFormFields(this.formGroup.get(controlName)); @@ -738,17 +777,17 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme } private showValidationErrorsDialog(projectOnly?: boolean, errmess?: string[]) { - if(errmess){ + if (errmess) { const dialogRef = this.dialog.open(FormValidationErrorsDialogComponent, { disableClose: true, autoFocus: false, restoreFocus: false, data: { - errorMessages:errmess, + errorMessages: errmess, projectOnly: projectOnly }, }); - }else{ + } else { const dialogRef = this.dialog.open(FormValidationErrorsDialogComponent, { disableClose: true, @@ -782,21 +821,23 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme reverse() { this.dialog.open(ConfirmationDialogComponent, { - data:{ + data: { message: this.language.instant('DATASET-WIZARD.ACTIONS.UNDO-FINALIZATION-QUESTION'), confirmButton: this.language.instant('DATASET-WIZARD.ACTIONS.CONFIRM'), cancelButton: this.language.instant('DATASET-WIZARD.ACTIONS.REJECT'), }, maxWidth: '30em' }) - .afterClosed() - .pipe( - filter(x=> x), - takeUntil(this._destroyed) - ).subscribe( _ => { + .afterClosed() + .pipe( + filter(x => x), + takeUntil(this._destroyed) + ).subscribe(_ => { this.viewOnly = false; this.datasetWizardModel.status = DatasetStatus.Draft; - setTimeout(x => { this.formGroup = null; }); + setTimeout(x => { + this.formGroup = null; + }); setTimeout(x => { this.formGroup = this.datasetWizardModel.buildForm(); this.registerFormListeners(); @@ -804,7 +845,6 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme }); - } saveFinalize() { @@ -813,8 +853,8 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme if (!this.isSemiFormValid(this.formGroup) || (this.table0fContents && this.table0fContents.hasVisibleInvalidFields())) { // this.showValidationErrorsDialog(); this.dialog.open(FormValidationErrorsDialogComponent, { - data:{ - errorMessages:[this.language.instant('DATASET-WIZARD.MESSAGES.MISSING-FIELDS')] + data: { + errorMessages: [this.language.instant('DATASET-WIZARD.MESSAGES.MISSING-FIELDS')] } }) @@ -845,11 +885,17 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success); if (data) { if (saveType === this.saveAnd.addNew) { - this.router.navigate(['/reload']).then(() => { this.router.navigate(['/datasets', 'new', this.formGroup.get('dmp').value.id]); }) + this.router.navigate(['/reload']).then(() => { + this.router.navigate(['/datasets', 'new', this.formGroup.get('dmp').value.id]); + }) } else if (saveType === this.saveAnd.close) { - this.router.navigate(['/reload']).then(() => { this.router.navigate(['/plans', 'edit', this.formGroup.get('dmp').value.id]); }); + this.router.navigate(['/reload']).then(() => { + this.router.navigate(['/plans', 'edit', this.formGroup.get('dmp').value.id]); + }); } else if (saveType === SaveType.finalize) { - this.router.navigate(['/reload']).then(() => { this.router.navigate(['/datasets', 'edit', data.id]); }); + this.router.navigate(['/reload']).then(() => { + this.router.navigate(['/datasets', 'edit', data.id]); + }); } else { this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(data); this.editMode = this.datasetWizardModel.status === DatasetStatus.Draft; @@ -884,10 +930,10 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme } onCallbackError(error: any) { - const errmes = error && error.message? error.message as string : null; + const errmes = error && error.message ? error.message as string : null; let feedbackMessage = this.language.instant('DATASET-EDITOR.ERRORS.ERROR-OCCURED'); - if(errmes){ - feedbackMessage += errmes; + if (errmes) { + feedbackMessage += errmes; } this.uiNotificationService.snackBarNotification(feedbackMessage, SnackBarNotificationLevel.Warning); this.setErrorModel(error.error); @@ -903,7 +949,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme this.datasetWizardService.downloadPDF(this.downloadDocumentId) .pipe(takeUntil(this._destroyed)) .subscribe(response => { - const blob = new Blob([response.body], { type: 'application/pdf' }); + const blob = new Blob([response.body], {type: 'application/pdf'}); const filename = this.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition')); FileSaver.saveAs(blob, filename); @@ -914,7 +960,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme this.datasetWizardService.downloadDOCX(this.downloadDocumentId) .pipe(takeUntil(this._destroyed)) .subscribe(response => { - const blob = new Blob([response.body], { type: 'application/msword' }); + const blob = new Blob([response.body], {type: 'application/msword'}); const filename = this.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition')); FileSaver.saveAs(blob, filename); @@ -926,7 +972,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme this.datasetWizardService.downloadXML(this.downloadDocumentId) .pipe(takeUntil(this._destroyed)) .subscribe(response => { - const blob = new Blob([response.body], { type: 'application/xml' }); + const blob = new Blob([response.body], {type: 'application/xml'}); const filename = this.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition')); FileSaver.saveAs(blob, filename); @@ -1046,7 +1092,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme .subscribe(result => { if (result && result.datasetProfileExist) { const newDmpId = result.formControl.value.id - this.router.navigate(['/datasets/copy/' + result.datasetId], { queryParams: { newDmpId: newDmpId } }); + this.router.navigate(['/datasets/copy/' + result.datasetId], {queryParams: {newDmpId: newDmpId}}); } }); } @@ -1055,8 +1101,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme if (this.datasetWizardModel.isProfileLatestVersion || (this.datasetWizardModel.status === DatasetStatus.Finalized) || (this.datasetWizardModel.isProfileLatestVersion == undefined && this.datasetWizardModel.status == undefined)) { return false; - } - else { + } else { return true; } } @@ -1081,6 +1126,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme } linkToScroll: LinkToScroll; + onStepFound(linkToScroll: LinkToScroll) { this.linkToScroll = linkToScroll; } @@ -1097,15 +1143,15 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme } public changeStep(index: number, dataset?: FormControl) { - if(this.step != index){ //view is changing + if (this.step != index) { //view is changing this.resetScroll(); } this.step = index; } public nextStep() { - if(this.step < this.maxStep){//view is changing - if(this.step === 0 && this.table0fContents){ + if (this.step < this.maxStep) {//view is changing + if (this.step === 0 && this.table0fContents) { this.table0fContents.seekToFirstElement(); } this.step++; @@ -1115,7 +1161,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme } public previousStep() { - if(this.step > 0){ + if (this.step > 0) { this.resetScroll(); this.step--; } @@ -1136,9 +1182,9 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme // this.hasChanges = false; // this.hintErrors = false; let messageText = ""; - let confirmButtonText =""; + let confirmButtonText = ""; let cancelButtonText = ""; - let isDeleteConfirmation = false; + let isDeleteConfirmation = false; if (this.isNew && !this.datasetIsOnceSaved) { @@ -1173,14 +1219,9 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme // this.isDiscarded = false; - - - } - - const dialogRef = this.dialog.open(ConfirmationDialogComponent, { restoreFocus: false, data: { @@ -1189,7 +1230,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme cancelButton: cancelButtonText, isDeleteConfirmation: true }, - maxWidth:'40em' + maxWidth: '40em' }); dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { if (result) { @@ -1198,8 +1239,6 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme }); - - // this.isDiscarded = false; } @@ -1219,13 +1258,15 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme this.links = currentLinks; } - printForm(){ + printForm() { console.log(this.formGroup); } - printFormValue(){ + + printFormValue() { console.log(this.formGroup.value); } - touchForm(){ + + touchForm() { this.formGroup.markAllAsTouched(); this.showtocentriesErrors = true; } @@ -1234,7 +1275,6 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme // this.tocentries = this.getTocEntries(this.formGroup.get('datasetProfileDefinition')); //TODO - // get tocentries(){ // const form = this.formGroup.get('datasetProfileDefinition') // if(!form) return null; @@ -1336,7 +1376,6 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme // }); - // result.forEach((entry,i)=>{ // const sections = entry.form.get('sections') as FormArray; @@ -1356,6 +1395,4 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme // } - - } diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component.html b/dmp-frontend/src/app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component.html new file mode 100644 index 000000000..7e76e3e79 --- /dev/null +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component.html @@ -0,0 +1,50 @@ +
+
+ {{'DATASET-CREATE-WIZARD.PREFILL-STEP.TITLE' | translate}} + close +
+
+ +
+
+
+ +
{{'DATASET-CREATE-WIZARD.PREFILL-STEP.OR' | translate}}
+ +
+
+
+

{{'DATASET-CREATE-WIZARD.PREFILL-STEP.PROFILE' | translate}}

+
+ + + + {{profile.label}} + + + {{prefillForm.get('profile').getError('backendError').message}} + +
+
+
+

{{'DATASET-CREATE-WIZARD.PREFILL-STEP.PREFILLED-DATASET' | translate}}

+
+ + + + +
+ +
+
+
+ +
+
+
diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component.scss b/dmp-frontend/src/app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component.scss new file mode 100644 index 000000000..727031a7c --- /dev/null +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component.scss @@ -0,0 +1,57 @@ +.template-container { + .header { + display: flex; + width: 100%; + height: 60px; + background-color: #f7dd72; + color: #212121; + font-size: 1.25rem; + } + + .template-title { + margin-left: 37px; + white-space: nowrap; + width: 480px; + overflow: hidden; + text-overflow: ellipsis; + } + + .close-icon { + cursor: pointer; + margin-right: 20px; + } + + .close-icon:hover { + background-color: #fefefe6e !important; + border-radius: 50%; + } + + .definition-content { + display: block; + margin: 0; + padding: 25px; + } + + .empty-btn, .prefill-btn { + background: #f7dd72 0 0 no-repeat padding-box; + border: 1px solid #f7dd72; + border-radius: 30px; + opacity: 1; + width: 101px; + height: 43px; + color: #212121; + font-weight: 500; + } + + .prefill-btn:disabled { + background: #a1a1a1 0 0 no-repeat padding-box; + border: 1px solid #a1a1a1; + opacity: 0.5; + } + + .empty-btn { + background: #ffffff 0 0 no-repeat padding-box; + border: 1px solid #a1a1a1; + } +} + diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component.ts new file mode 100644 index 000000000..c0b206553 --- /dev/null +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component.ts @@ -0,0 +1,76 @@ +import {Component, Inject, OnInit} from "@angular/core"; +import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; +import {takeUntil} from "rxjs/operators"; +import {ProgressIndicationService} from "@app/core/services/progress-indication/progress-indication-service"; +import {BaseComponent} from "@common/base/base.component"; +import {SingleAutoCompleteConfiguration} from "@app/library/auto-complete/single/single-auto-complete-configuration"; +import {Observable} from "rxjs"; +import {Prefilling} from "@app/core/model/dataset/prefilling"; +import {PrefillingService} from "@app/core/services/prefilling.service"; +import {FormBuilder, FormGroup, Validators} from "@angular/forms"; + +@Component({ + selector: 'prefill-dataset-component', + templateUrl: 'prefill-dataset.component.html', + styleUrls: ['prefill-dataset.component.scss'] +}) +export class PrefillDatasetComponent extends BaseComponent implements OnInit { + + progressIndication = false; + prefillAutoCompleteConfiguration: SingleAutoCompleteConfiguration; + configId: string = "zenodo"; + isPrefilled: boolean = false; + prefillForm: FormGroup; + + constructor(public dialogRef: MatDialogRef, + private prefillingService: PrefillingService, + private progressIndicationService: ProgressIndicationService, + private fb: FormBuilder, + @Inject(MAT_DIALOG_DATA) public data: any) { + super(); + } + + ngOnInit() { + this.progressIndicationService.getProgressIndicationObservable().pipe(takeUntil(this._destroyed)).subscribe(x => { + setTimeout(() => { this.progressIndication = x; }); + }); + this.prefillForm = this.fb.group({ + type: this.fb.control(false), + profile: this.fb.control('', Validators.required), + prefill: this.fb.control(null, Validators.required) + }) + if(this.data.availableProfiles && this.data.availableProfiles.length === 1) { + this.prefillForm.get('profile').patchValue(this.data.availableProfiles[0]); + } + this.prefillAutoCompleteConfiguration = { + filterFn: this.searchDatasets.bind(this), + initialItems: (extraData) => this.searchDatasets(''), + displayFn: (item) => (item['name'].length > 60)?(item['name'].substr(0, 60) + "..." ):item['name'], + titleFn: (item) => item['name'], + subtitleFn: (item) => item['pid'] + }; + } + + public compareWith(object1: any, object2: any) { + return object1 && object2 && object1.id === object2.id; + } + + searchDatasets(query: string): Observable { + return this.prefillingService.getPrefillingList(query, this.configId); + } + + next() { + if(this.isPrefilled) { + this.prefillingService.getPrefillingDataset(this.prefillForm.get('prefill').value.pid, this.prefillForm.get('profile').value.id, this.configId).subscribe(wizard => { + wizard.profile = this.prefillForm.get('profile').value; + this.closeDialog(wizard); + }) + } else { + this.closeDialog(); + } + } + + closeDialog(result = null): void { + this.dialogRef.close(result); + } +} diff --git a/dmp-frontend/src/app/ui/dataset/dataset.module.ts b/dmp-frontend/src/app/ui/dataset/dataset.module.ts index 9a0d0ee1e..c08b69868 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset.module.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset.module.ts @@ -28,6 +28,7 @@ import { DatasetCopyDialogModule } from './dataset-wizard/dataset-copy-dialogue/ import { DatasetCriteriaDialogComponent } from './listing/criteria/dataset-criteria-dialogue/dataset-criteria-dialog.component'; import { DatasetOverviewModule } from './overview/dataset-overview.module'; import {RichTextEditorModule} from "@app/library/rich-text-editor/rich-text-editor.module"; +import {PrefillDatasetComponent} from "@app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component"; @NgModule({ imports: [ @@ -62,6 +63,7 @@ import {RichTextEditorModule} from "@app/library/rich-text-editor/rich-text-edit DatasetUploadDialogue, DatasetListingItemComponent, DatasetCriteriaDialogComponent, + PrefillDatasetComponent ], entryComponents: [ DatasetExternalDataRepositoryDialogEditorComponent, diff --git a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.scss b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.scss index d3b0ddec5..2d71d0e3d 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.scss +++ b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.scss @@ -24,7 +24,6 @@ } ::ng-deep .mat-icon-button { - height: 30px !important; font-size: 12px !important; } diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section-inner/form-section-inner.component.html b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section-inner/form-section-inner.component.html index 6f0dd0648..d8ee36071 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section-inner/form-section-inner.component.html +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section-inner/form-section-inner.component.html @@ -20,12 +20,12 @@
- + {{compositeFieldFormGroup.get('multiplicity').value.placeholder}} + {{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-ADD-ONE-FIELD' | translate}}
diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.html b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.html index d0a526fce..38b422f0b 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.html +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.html @@ -32,12 +32,12 @@
- + {{compositeFieldFormGroup.get('multiplicity').value.placeholder}} + {{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-ADD-ONE-FIELD' | translate}}
@@ -101,12 +101,12 @@
- + {{fieldsetEntry.form.get('multiplicity').value.placeholder}} + {{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-ADD-ONE-FIELD' | translate}}
diff --git a/dmp-frontend/src/assets/i18n/de.json b/dmp-frontend/src/assets/i18n/de.json index 927a98f10..a2310f2fc 100644 --- a/dmp-frontend/src/assets/i18n/de.json +++ b/dmp-frontend/src/assets/i18n/de.json @@ -367,7 +367,8 @@ "ADDITIONAL-INFORMATION": "Additional Information", "MULTIPLICITY-MIN": "Multiplicity Min", "MULTIPLICITY-MAX": "Multiplicity Max", - "MULTIPLICITY-ADD-ONE-FIELD": "Add one more fieldset", + "MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text", + "MULTIPLICITY-ADD-ONE-FIELD": "Add more", "ORDER": "Order", "COMMENT-PLACEHOLDER": "Please Specify", "COMMENT-HINT": "Provide additional information or justification about your selection", @@ -1269,6 +1270,16 @@ "FIRST-STEP": { "TITLE": "DMP", "PLACEHOLDER": "Bestehenden DMP auswählen" + }, + "PREFILL-STEP": { + "TITLE": "Initialize your Dataset", + "PREFILL": "Prefill", + "OR": "OR", + "EMPTY": "Empty", + "PROFILE": "Dataset Template", + "PREFILLED-DATASET": "Prefilled Dataset", + "SEARCH": "Search a Dataset", + "NEXT": "Next" } }, "INVITATION-EDITOR": { diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index abca78016..e14620fb9 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -368,7 +368,7 @@ "MULTIPLICITY-MIN": "Multiplicity Min", "MULTIPLICITY-MAX": "Multiplicity Max", "MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text", - "MULTIPLICITY-ADD-ONE-FIELD": "Add one more fieldset", + "MULTIPLICITY-ADD-ONE-FIELD": "Add more", "ORDER": "Order", "COMMENT-PLACEHOLDER": "Please Specify", "COMMENT-HINT": "Provide additional information or justification about your selection", @@ -386,7 +386,6 @@ "VIEW-STYLE": "Type", "MULTIPLICITY-MIN": "Multiplicity Min", "MULTIPLICITY-MAX": "Multiplicity Max", - "MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text", "ORDER": "Order", "DEFAULT-VALUE": "Default Value", "VALIDATION": "Validation", @@ -1271,6 +1270,16 @@ "FIRST-STEP": { "TITLE": "DMP", "PLACEHOLDER": "Pick an existing DMP" + }, + "PREFILL-STEP": { + "TITLE": "Initialize your Dataset", + "PREFILL": "Prefill", + "OR": "OR", + "EMPTY": "Empty", + "PROFILE": "Dataset Template", + "PREFILLED-DATASET": "Prefilled Dataset", + "SEARCH": "Search a Dataset", + "NEXT": "Next" } }, "INVITATION-EDITOR": { diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index 5bf81b680..1dccdcf1f 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -367,7 +367,8 @@ "ADDITIONAL-INFORMATION": "Información adicional", "MULTIPLICITY-MIN": "Multiplicidad mínima", "MULTIPLICITY-MAX": "Multiplicidad máxima", - "MULTIPLICITY-ADD-ONE-FIELD": "Añadir un elemento más", + "MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text", + "MULTIPLICITY-ADD-ONE-FIELD": "Add more", "ORDER": "Orden", "COMMENT-PLACEHOLDER": "Por favir especifique", "COMMENT-HINT": "Proporcione información adicional o justifique su selección", @@ -1269,6 +1270,16 @@ "FIRST-STEP": { "TITLE": "PGD", "PLACEHOLDER": "Seleccione un PGD existente" + }, + "PREFILL-STEP": { + "TITLE": "Initialize your Dataset", + "PREFILL": "Prefill", + "OR": "OR", + "EMPTY": "Empty", + "PROFILE": "Dataset Template", + "PREFILLED-DATASET": "Prefilled Dataset", + "SEARCH": "Search a Dataset", + "NEXT": "Next" } }, "INVITATION-EDITOR": { diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index 5ba205304..b2a49db5f 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -367,7 +367,8 @@ "ADDITIONAL-INFORMATION": "Επιπλέον Πληροφορίες", "MULTIPLICITY-MIN": "Ελάχιστη τιμή Min", "MULTIPLICITY-MAX": "Μέγιστη τιμή Max", - "MULTIPLICITY-ADD-ONE-FIELD": "Προσθήκη ακόμα ενός πεδίου", + "MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text", + "MULTIPLICITY-ADD-ONE-FIELD": "Add more", "ORDER": "Εντολή", "COMMENT-PLACEHOLDER": "Παρακαλώ προσδιορίστε", "COMMENT-HINT": "Προσθέστε επιπλέον πληροφορίες ή αιτιολόγηση σχετικά με την επιλογή σας", @@ -1269,6 +1270,16 @@ "FIRST-STEP": { "TITLE": "Σχέδιο Διαχείρισης Δεδομένων", "PLACEHOLDER": "Επιλέξτε ένα Σχέδιο Διαχείρισης Δεδομένων από τη συλλογή σας" + }, + "PREFILL-STEP": { + "TITLE": "Initialize your Dataset", + "PREFILL": "Prefill", + "OR": "OR", + "EMPTY": "Empty", + "PROFILE": "Dataset Template", + "PREFILLED-DATASET": "Prefilled Dataset", + "SEARCH": "Search a Dataset", + "NEXT": "Next" } }, "INVITATION-EDITOR": { diff --git a/dmp-frontend/src/assets/i18n/pt.json b/dmp-frontend/src/assets/i18n/pt.json index 76503ef92..e7ac4b3b3 100644 --- a/dmp-frontend/src/assets/i18n/pt.json +++ b/dmp-frontend/src/assets/i18n/pt.json @@ -367,7 +367,8 @@ "ADDITIONAL-INFORMATION": "Informação Adicional", "MULTIPLICITY-MIN": "Multiplicidade Min", "MULTIPLICITY-MAX": "Multiplicidade Máx", - "MULTIPLICITY-ADD-ONE-FIELD": "Adicionar mais um conjunto de campos", + "MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text", + "MULTIPLICITY-ADD-ONE-FIELD": "Add more", "ORDER": "Ordem", "COMMENT-PLACEHOLDER": "Por favor especifique", "COMMENT-HINT": "Disponibilize informação ou justificação adicional sobre a sua seleção", @@ -1269,6 +1270,16 @@ "FIRST-STEP": { "TITLE": "PGD", "PLACEHOLDER": "Selecione um PGD existente" + }, + "PREFILL-STEP": { + "TITLE": "Initialize your Dataset", + "PREFILL": "Prefill", + "OR": "OR", + "EMPTY": "Empty", + "PROFILE": "Dataset Template", + "PREFILLED-DATASET": "Prefilled Dataset", + "SEARCH": "Search a Dataset", + "NEXT": "Next" } }, "INVITATION-EDITOR": { diff --git a/dmp-frontend/src/assets/i18n/sk.json b/dmp-frontend/src/assets/i18n/sk.json index 3a8726434..2c11186af 100644 --- a/dmp-frontend/src/assets/i18n/sk.json +++ b/dmp-frontend/src/assets/i18n/sk.json @@ -367,7 +367,8 @@ "ADDITIONAL-INFORMATION": "Additional Information", "MULTIPLICITY-MIN": "Multiplicity Min", "MULTIPLICITY-MAX": "Multiplicity Max", - "MULTIPLICITY-ADD-ONE-FIELD": "Add one more fieldset", + "MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text", + "MULTIPLICITY-ADD-ONE-FIELD": "Add more", "ORDER": "Order", "COMMENT-PLACEHOLDER": "Please Specify", "COMMENT-HINT": "Provide additional information or justification about your selection", @@ -1269,6 +1270,16 @@ "FIRST-STEP": { "TITLE": "DMP", "PLACEHOLDER": "Vybrať existujúci DMP." + }, + "PREFILL-STEP": { + "TITLE": "Initialize your Dataset", + "PREFILL": "Prefill", + "OR": "OR", + "EMPTY": "Empty", + "PROFILE": "Dataset Template", + "PREFILLED-DATASET": "Prefilled Dataset", + "SEARCH": "Search a Dataset", + "NEXT": "Next" } }, "INVITATION-EDITOR": { diff --git a/dmp-frontend/src/assets/i18n/sr.json b/dmp-frontend/src/assets/i18n/sr.json index be76fe7be..3a07e80fa 100644 --- a/dmp-frontend/src/assets/i18n/sr.json +++ b/dmp-frontend/src/assets/i18n/sr.json @@ -367,7 +367,8 @@ "ADDITIONAL-INFORMATION": "Dodatne informacije", "MULTIPLICITY-MIN": "Višestrukost, minimalno polja", "MULTIPLICITY-MAX": "Višestrukost, maksimalno polja", - "MULTIPLICITY-ADD-ONE-FIELD": "Dodajte jedan ili više skupova polja", + "MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text", + "MULTIPLICITY-ADD-ONE-FIELD": "Add more", "ORDER": "Redosled", "COMMENT-PLACEHOLDER": "Navedite", "COMMENT-HINT": "Navedite dodatne informacije ili obrazložite izbor", @@ -1269,6 +1270,16 @@ "FIRST-STEP": { "TITLE": "Plan upravljanja podacima", "PLACEHOLDER": "Odaberite postojeći Plan" + }, + "PREFILL-STEP": { + "TITLE": "Initialize your Dataset", + "PREFILL": "Prefill", + "OR": "OR", + "EMPTY": "Empty", + "PROFILE": "Dataset Template", + "PREFILLED-DATASET": "Prefilled Dataset", + "SEARCH": "Search a Dataset", + "NEXT": "Next" } }, "INVITATION-EDITOR": { diff --git a/dmp-frontend/src/assets/i18n/tr.json b/dmp-frontend/src/assets/i18n/tr.json index 05590c73d..4b0bb49e7 100644 --- a/dmp-frontend/src/assets/i18n/tr.json +++ b/dmp-frontend/src/assets/i18n/tr.json @@ -367,7 +367,8 @@ "ADDITIONAL-INFORMATION": "Ek Bilgi", "MULTIPLICITY-MIN": "En az Çokluk", "MULTIPLICITY-MAX": "En fazla Çokluk", - "MULTIPLICITY-ADD-ONE-FIELD": "Bir alan seti daha ekle", + "MULTIPLICITY-PLACEHOLDER": "Multiplicity Placeholder Text", + "MULTIPLICITY-ADD-ONE-FIELD": "Add more", "ORDER": "Düzen", "COMMENT-PLACEHOLDER": "Lütfen Belirtiniz", "COMMENT-HINT": "Seçiminiz hakkında gerekçe veya ek bilgi veriniz", @@ -1269,6 +1270,16 @@ "FIRST-STEP": { "TITLE": "VYP", "PLACEHOLDER": "Mevcut olan bir VYP seçin" + }, + "PREFILL-STEP": { + "TITLE": "Initialize your Dataset", + "PREFILL": "Prefill", + "OR": "OR", + "EMPTY": "Empty", + "PROFILE": "Dataset Template", + "PREFILLED-DATASET": "Prefilled Dataset", + "SEARCH": "Search a Dataset", + "NEXT": "Next" } }, "INVITATION-EDITOR": {