+
+
+

{{ 'ABOUT.WELCOME' | translate }}

+

{{ 'ABOUT.WELCOME-MESSAGE' | translate }}

+
+
+
-
+

{{'DASHBOARD.DATASETS' | translate}} {{titlePrefix}}

-
+
@@ -15,11 +21,11 @@
- +
- +
diff --git a/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.scss b/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.scss index 194373976..e69441181 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.scss +++ b/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.scss @@ -11,6 +11,28 @@ } } +.header-image { + background: url("/assets/images/new-dashboard-bg.png") no-repeat; + background-size: cover; + margin-top: 70px; + min-height: 15em; + position: relative; + } + + .header-text-container { + background: rgba(255, 255, 255, 0.7); + position: absolute; + bottom: 0px; + padding-left: 5em; + padding-right: 10em; + padding-top: 2em; + padding-bottom: 2em; + } + + .explore-dmp-content { + padding: 30px 15px; + } + ::ng-deep .mat-paginator-container { flex-direction: row-reverse !important; justify-content: space-between !important; diff --git a/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts b/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts index af9aceece..90d1550aa 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts +++ b/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts @@ -16,6 +16,9 @@ import { BaseComponent } from '@common/base/base.component'; import { TranslateService } from '@ngx-translate/core'; import { Observable, of as observableOf } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; +import { ExternalTagEditorModel } from '../dataset-wizard/dataset-wizard-editor.model'; +import { AuthService } from '@app/core/services/auth/auth.service'; +import { isNullOrUndefined } from 'util'; @Component({ selector: 'app-dataset-listing-component', @@ -37,17 +40,24 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB dmpSearchEnabled = true; listingItems: DatasetListingModel[] = []; + isPublic: boolean = false; + constructor( private datasetService: DatasetService, private router: Router, private route: ActivatedRoute, private dmpService: DmpService, private language: TranslateService, + private authService: AuthService ) { super(); } ngOnInit() { + this.isPublic = this.router.url === '/explore'; + if (!this.isPublic && isNullOrUndefined(this.authService.current())) { + this.router.navigateByUrl("/explore"); + } this.route.params .pipe(takeUntil(this._destroyed)) .subscribe(async (params: Params) => { @@ -77,7 +87,7 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB this.breadCrumbs = observableOf([{ parentComponentName: null, label: this.language.instant('NAV-BAR.MY-DATASET-DESCRIPTIONS'), - url: "/datasets" + url: this.isPublic ? "/explore" : "/datasets" }]); } @@ -105,7 +115,7 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB role: value.role } if (value.tags) { - request.criteria.tags = value.tags.map(x => x.id); + request.criteria.tags = value.tags.map(x => (x)); } if (value.collaborators) { request.criteria.collaborators = value.collaborators.map(x => x.id); @@ -125,6 +135,10 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB if (value.datasetTemplates) { request.criteria.datasetTemplates = value.datasetTemplates.map(x => x.id) } + if(value.grantStatus) { + request.criteria.grantStatus = value.grantStatus; + } + request.criteria.isPublic = this.isPublic; // if (this.itemId) { // // request.criteria.groupIds = [this.itemId]; // request.criteria.allVersions = true; diff --git a/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.html b/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.html index 012bc584f..6837ff834 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.html +++ b/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.html @@ -1,5 +1,5 @@ -
- +
+
@@ -34,7 +34,7 @@
-
+
history diff --git a/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.ts b/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.ts index 32e67f015..e39083138 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.ts +++ b/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.ts @@ -12,15 +12,33 @@ export class DatasetListingItemComponent implements OnInit { @Input() dataset: DatasetListingModel; @Input() showDivider: boolean = true; + @Input() isPublic: boolean = false; @Output() onClick: EventEmitter = new EventEmitter(); isDraft: boolean; + isDeleted: boolean; constructor(private router: Router) { } ngOnInit() { - if (this.dataset.status == DatasetStatus.Draft) { this.isDraft = true } - else { this.isDraft = false } + if (this.dataset.status === DatasetStatus.Draft) { + this.isDraft = true; + this.isDeleted = false; + } else if (this.dataset.status === DatasetStatus.Deleted) { + this.isDeleted = true; + } + else { + this.isDraft = false; + this.isDeleted = false; + } + } + + getItemLink(): string[] { + return this.isPublic ? [`/datasets/publicEdit/${this.dataset.id}`] : [`/datasets/edit/${this.dataset.id}`]; + } + + getDmpLink(): string[] { + return this.isPublic ? [`/explore-plans/overview/${this.dataset.dmpId}`] : [`/plans/edit/${this.dataset.dmpId}`]; } diff --git a/dmp-frontend/src/app/ui/dmp/dmp.module.ts b/dmp-frontend/src/app/ui/dmp/dmp.module.ts index b701a8e40..c4732a882 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp.module.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp.module.ts @@ -20,7 +20,7 @@ import { PeopleTabComponent } from '@app/ui/dmp/editor/people-tab/people-tab.com import { InvitationAcceptedComponent } from '@app/ui/dmp/invitation/accepted/dmp-invitation-accepted.component'; import { DmpInvitationDialogComponent } from '@app/ui/dmp/invitation/dmp-invitation.component'; import { DmpCriteriaComponent } from '@app/ui/dmp/listing/criteria/dmp-criteria.component'; -import { DmpUploadDialogue } from '@app/ui/dmp/listing/criteria/upload-dialogue/dmp-upload-dialogue.component'; +import { DmpUploadDialogue } from '@app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component'; import { DmpListingComponent } from '@app/ui/dmp/listing/dmp-listing.component'; import { DmpListingItemComponent } from '@app/ui/dmp/listing/listing-item/dmp-listing-item.component'; import { DmpOverviewModule } from '@app/ui/dmp/overview/dmp-overview.module'; diff --git a/dmp-frontend/src/app/ui/dmp/dmp.routing.ts b/dmp-frontend/src/app/ui/dmp/dmp.routing.ts index 3b3fcb74a..0b53447d7 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp.routing.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp.routing.ts @@ -6,6 +6,7 @@ import { DmpListingComponent } from './listing/dmp-listing.component'; import { DmpWizardComponent } from './wizard/dmp-wizard.component'; import { DmpOverviewComponent } from './overview/dmp-overview.component'; import { DmpCloneComponent } from './clone/dmp-clone.component'; +import { AuthGuard } from '@app/core/auth-guard.service'; const routes: Routes = [ { @@ -65,6 +66,7 @@ const routes: Routes = [ { path: 'new', component: DmpEditorComponent, + canActivate: [AuthGuard], data: { breadcrumbs: 'new', title: 'GENERAL.TITLES.PLANS-NEW' diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html index f26d1fa67..52b24dbb7 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html @@ -9,7 +9,7 @@

{{ 'DMP-EDITOR.TITLE.NEW' | translate }}

- @@ -65,21 +65,21 @@ work_outline {{ 'DMP-LISTING.COLUMNS.GRANT' | translate }} - + library_books {{ 'DMP-LISTING.COLUMNS.DATASETS' | translate }} - + person {{ 'DMP-LISTING.COLUMNS.PEOPLE' | translate }} - + @@ -95,26 +95,34 @@ --> -
+
+ info_outlined +
{{'DMP-EDITOR.ACTIONS.LOCK' | translate}}
+
{{'DMP-EDITOR.ACTIONS.PERMISSION' | translate}}
+
+ +
+
+ +
+
+
-
- -
-
+ +
-
-
+
diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts index c9cb70752..b74092256 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts @@ -32,10 +32,17 @@ import { FormValidationErrorsDialogComponent } from '@common/forms/form-validati import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model'; import { TranslateService } from '@ngx-translate/core'; import * as FileSaver from 'file-saver'; -import { Observable, of as observableOf } from 'rxjs'; +import { Observable, of as observableOf, interval } from 'rxjs'; import { map, takeUntil } from 'rxjs/operators'; import { Principal } from "@app/core/model/auth/Principal"; import { Role } from "@app/core/common/enum/role"; +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 'util'; +import { environment } from 'environments/environment'; +import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; @Component({ selector: 'app-dmp-editor-component', @@ -62,6 +69,8 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC selectedDmpProfileDefinition: DmpProfileDefinition; DynamicDmpFieldResolverComponent: any; isUserOwner: boolean = true; + lock: LockModel; + lockStatus: Boolean; constructor( private dmpProfileService: DmpProfileService, @@ -73,7 +82,9 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC private uiNotificationService: UiNotificationService, private authentication: AuthService, private authService: AuthService, - private formService: FormService + private formService: FormService, + private lockService: LockService, + private configurationService: ConfigurationService ) { super(); } @@ -104,6 +115,8 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC this.dmpService.getSingle(itemId).pipe(map(data => data as DmpModel)) .pipe(takeUntil(this._destroyed)) .subscribe(async data => { + this.lockService.checkLockStatus(data.id).pipe(takeUntil(this._destroyed)).subscribe(lockStatus => { + this.lockStatus = lockStatus; this.dmp = new DmpEditorModel(); this.dmp.grant = new GrantTabModel(); this.dmp.project = new ProjectFormModel(); @@ -115,12 +128,22 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC this.isFinalized = true; this.formGroup.disable(); } + //this.registerFormEventsForDmpProfile(this.dmp.definition); - if (!this.editMode || this.dmp.status === DmpStatus.Finalized) { + if (!this.editMode || this.dmp.status === DmpStatus.Finalized || lockStatus) { this.isFinalized = true; this.formGroup.disable(); } + if (this.isAuthenticated) { + if (!lockStatus) { + this.lock = new LockModel(data.id, this.getUserFromDMP()); + + 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.isAuthenticated) { const breadCrumbs = []; breadCrumbs.push({ @@ -139,6 +162,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC } this.associatedUsers = data.associatedUsers; this.people = data.users; + }) }); } else if (publicId != null) { this.isNew = false; @@ -146,6 +170,8 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC this.dmpService.getSinglePublic(publicId).pipe(map(data => data as DmpModel)) .pipe(takeUntil(this._destroyed)) .subscribe(async data => { + this.lockService.checkLockStatus(data.id).pipe(takeUntil(this._destroyed)).subscribe(lockStatus => { + this.lockStatus = lockStatus; this.dmp = new DmpEditorModel(); this.dmp.grant = new GrantTabModel(); this.dmp.project = new ProjectFormModel(); @@ -153,7 +179,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC this.dmp.fromModel(data); this.formGroup = this.dmp.buildForm(); //this.registerFormEventsForDmpProfile(this.dmp.definition); - if (!this.editMode || this.dmp.status === DmpStatus.Finalized) { this.formGroup.disable(); } + if (!this.editMode || this.dmp.status === DmpStatus.Finalized || lockStatus) { this.formGroup.disable(); } // if (!this.isAuthenticated) { const breadcrumbs = []; breadcrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.PUBLIC-DMPS').toUpperCase(), url: '/plans' }); @@ -169,6 +195,15 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC // ); this.associatedUsers = data.associatedUsers; // } + if (!lockStatus) { + this.lock = new LockModel(data.id, this.getUserFromDMP()); + + 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()); + }); + } + }) }); } else { this.dmp = new DmpEditorModel(); @@ -215,6 +250,13 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC } } + getUserFromDMP(): any { + if (this.dmp) { + const principal: Principal = this.authentication.current(); + return this.dmp.users.find(x => x.id === principal.id); + } + } + registerFormEventsForNewItem() { this.breadCrumbs = observableOf([ { @@ -289,6 +331,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC } onCallbackError(error: any) { + this.uiNotificationService.snackBarNotification(error.error.message, SnackBarNotificationLevel.Error); this.setErrorModel(error.error); //this.validateAllFormFields(this.formGroup); } @@ -301,7 +344,17 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC public cancel(id: String): void { if (id != null) { - this.router.navigate(['/plans/overview/' + id]); + this.lockService.unlockTarget(this.dmp.id).pipe(takeUntil(this._destroyed)).subscribe( + complete => { + this.router.navigate(['/plans/overview/' + id]); + }, + error => { + this.formGroup.get('status').setValue(DmpStatus.Draft); + this.onCallbackError(error); + } + + ) + } else { this.router.navigate(['/plans']); } @@ -498,6 +551,11 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC }); } + private pumpLock() { + this.lock.touchedAt = new Date(); + this.lockService.createOrUpdate(this.lock).pipe(takeUntil(this._destroyed)).subscribe( async result => this.lock.id = Guid.parse(result)); + } + // advancedClicked() { // const dialogRef = this.dialog.open(ExportMethodDialogComponent, { // maxWidth: '500px', diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.model.ts b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.model.ts index 372ca7250..105747e01 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.model.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.model.ts @@ -44,6 +44,7 @@ export class DmpEditorModel { public definition: DmpProfileDefinition; public dynamicFields: Array = []; public validationErrorModel: ValidationErrorModel = new ValidationErrorModel(); + public modified: Date; fromModel(item: DmpModel): DmpEditorModel { this.id = item.id; @@ -67,6 +68,7 @@ export class DmpEditorModel { if (item.definition) { this.definition = item.definition; } if (item.dynamicFields) { item.dynamicFields.map(x => this.dynamicFields.push(new DmpDynamicFieldEditorModel().fromModel(x))); } this.creator = item.creator; + this.modified = new Date(item.modified); return this; } @@ -90,7 +92,8 @@ export class DmpEditorModel { datasets: [{ value: this.datasets, disabled: disabled }, context.getValidation('datasets').validators], datasetsToBeFinalized: [{ value: this.datasetsToBeFinalized, disabled: disabled }, context.getValidation('datasetsToBeFinalized').validators], associatedUsers: [{ value: this.associatedUsers, disabled: disabled }, context.getValidation('associatedUsers').validators], - users: [{ value: this.users, disabled: disabled }, context.getValidation('users').validators] + users: [{ value: this.users, disabled: disabled }, context.getValidation('users').validators], + modified: [{value: this.modified, disabled: disabled}, context.getValidation('modified').validators] }); const dynamicFields = new Array(); @@ -128,7 +131,7 @@ export class DmpEditorModel { baseContext.validation.push({ key: 'datasetsToBeFinalized', validators: [BackendErrorValidator(this.validationErrorModel, 'datasetsToBeFinalized')] }); baseContext.validation.push({ key: 'associatedUsers', validators: [BackendErrorValidator(this.validationErrorModel, 'associatedUsers')] }); baseContext.validation.push({ key: 'users', validators: [BackendErrorValidator(this.validationErrorModel, 'users')] }); - + baseContext.validation.push({ key: 'modified', validators: [] }); return baseContext; } } diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-finalize-dialog/dmp-finalize-dialog.component.html b/dmp-frontend/src/app/ui/dmp/editor/dmp-finalize-dialog/dmp-finalize-dialog.component.html index 919b53bb2..a3ad61fa5 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-finalize-dialog/dmp-finalize-dialog.component.html +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-finalize-dialog/dmp-finalize-dialog.component.html @@ -48,7 +48,7 @@
- + {{'DMP-FINALISE-DIALOG.VALIDATION.AT-LEAST-ONE-DATASET-FINALISED' | translate}}
@@ -63,7 +63,7 @@
- +
diff --git a/dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab.component.html b/dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab.component.html index 6e7cd3fcb..2677a7c3a 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab.component.html +++ b/dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab.component.html @@ -57,7 +57,11 @@ {{'GENERAL.VALIDATION.REQUIRED' | translate}} - + + + {{projectFormGroup.get('description').getError('backendError').message}} + + {{'GENERAL.VALIDATION.REQUIRED' | translate}}
@@ -87,14 +91,14 @@
- + {{projectFormGroup.get('label').getError('backendError').message}} {{'GENERAL.VALIDATION.REQUIRED' | translate}} - + {{projectFormGroup.get('description').getError('backendError').message}} diff --git a/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.html b/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.html index b1af0d9aa..790f203e9 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.html +++ b/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.html @@ -83,14 +83,6 @@
- -
- -
-
diff --git a/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.scss b/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.scss index 17d0636d7..7d2c18ab2 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.scss +++ b/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.scss @@ -28,10 +28,7 @@ margin-bottom: 12px; } -.import { - margin: 10px; - padding: 0px; -} + .filters { border: 1px solid #e4e4e4; @@ -39,7 +36,7 @@ } .filters-title { - width: 90px; + width: 93px; color: #089dbb; background-color: white; padding: 0px 20px; diff --git a/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.ts b/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.ts index d6b20728d..ecabe4243 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.ts @@ -15,7 +15,6 @@ import { GrantService } from '@app/core/services/grant/grant.service'; import { OrganisationService } from '@app/core/services/organisation/organisation.service'; import { UserService } from '@app/core/services/user/user.service'; import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration'; -import { DmpUploadDialogue } from '@app/ui/dmp/listing/criteria/upload-dialogue/dmp-upload-dialogue.component'; import { BaseCriteriaComponent } from '@app/ui/misc/criteria/base-criteria.component'; import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model'; import { TranslateService } from '@ngx-translate/core'; @@ -173,20 +172,5 @@ export class DmpCriteriaComponent extends BaseCriteriaComponent implements OnIni return this.dmpService.getDatasetProfilesUsedPaged(datasetTemplateRequestItem).pipe(map(x => x.data)); } - fileSave(event) { - const dialogRef = this.dialog.open(DmpUploadDialogue, { - data: { - fileList: FileList, - success: Boolean, - dmpTitle: String - } - }); - dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { - if (result && result.success) { - this.dmpService.uploadXml(result.fileList, result.dmpTitle) - .pipe(takeUntil(this._destroyed)) - .subscribe(); - } - }); - } + } diff --git a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.html b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.html index 04e6675f5..45693bc03 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.html +++ b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.html @@ -15,6 +15,15 @@
+ + + + + - +
diff --git a/dmp-frontend/src/app/ui/dmp/listing/criteria/upload-dialogue/dmp-upload-dialogue.component.scss b/dmp-frontend/src/app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component.scss similarity index 100% rename from dmp-frontend/src/app/ui/dmp/listing/criteria/upload-dialogue/dmp-upload-dialogue.component.scss rename to dmp-frontend/src/app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component.scss diff --git a/dmp-frontend/src/app/ui/dmp/listing/criteria/upload-dialogue/dmp-upload-dialogue.component.ts b/dmp-frontend/src/app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component.ts similarity index 91% rename from dmp-frontend/src/app/ui/dmp/listing/criteria/upload-dialogue/dmp-upload-dialogue.component.ts rename to dmp-frontend/src/app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component.ts index 9a9dd31ad..09780ab33 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/criteria/upload-dialogue/dmp-upload-dialogue.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component.ts @@ -1,6 +1,6 @@ import { Component, Inject } from '@angular/core'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { DmpService } from '../../../../../core/services/dmp/dmp.service'; +import { DmpService } from '../../../../core/services/dmp/dmp.service'; @Component({ selector: 'dmp-upload-dialogue', diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html index 7933e2671..cb45ad27f 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html @@ -11,6 +11,12 @@ more_horiz + + @@ -117,6 +123,11 @@
+
+
+ add_box +
+
@@ -138,20 +149,27 @@
-
+
{{'DMP-OVERVIEW.GRANT' | translate}}
+
{{ dmp.grant.abbreviation }}

{{ dmp.grant.label }}

-

{{ dmp.grant.startDate | date: "shortDate" }} - {{ dmp.grant.endDate | date: "shortDate" }}

+

{{ dmp.grant.startDate | date: "shortDate" }} - {{ dmp.grant.endDate | date: "shortDate" }}

-

{{ dmp.grant.description }}

- +
+ -
+ open_in_new {{ 'GRANT-EDITOR.ACTIONS.VISIT-WEBSITE' | translate }} diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.scss b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.scss index c06a7179f..bd93feadb 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.scss +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.scss @@ -66,6 +66,16 @@ text-transform: uppercase; } +.grant-title { + width: 68px; + color: #089dbb; + background-color: white; + padding: 0px 10px; + margin-top: -16px; + cursor: default; + text-transform: uppercase; +} + .collaborators { display: flex; flex-direction: column; @@ -76,7 +86,7 @@ } .collaborators-title { - width: 135px; + width: 138px; color: #089dbb; background-color: white; padding: 0px 10px; @@ -205,6 +215,10 @@ h4 span { text-transform: uppercase; } +.desc-container { + margin: 0px; +} + .desc { position: relative; overflow: hidden; @@ -215,6 +229,12 @@ h4 span { cursor: default; } +.desc-expanded { + overflow: visible !important; + height: auto !important; + position: inherit; +} + .desc:after { content: ""; text-align: right; @@ -225,3 +245,12 @@ h4 span { height: 1.4em; background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 50%); } + +.interact-icon { + cursor: pointer; + margin-left: 32px; +} + +.interact-icon :hover { + color: #00b29f !important; +} diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts index ee60fa07b..98c25aac9 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts @@ -21,6 +21,7 @@ import * as FileSaver from 'file-saver'; import { Observable, of as observableOf } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { Role } from "@app/core/common/enum/role"; +import { DmpInvitationDialogComponent } from '../invitation/dmp-invitation.component'; @Component({ selector: 'app-dmp-overview', @@ -36,6 +37,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { hasPublishButton: boolean = true; breadCrumbs: Observable = observableOf(); isUserOwner: boolean; + expand = false; constructor( private route: ActivatedRoute, @@ -73,6 +75,9 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { if (error.status === 404) { return this.onFetchingDeletedCallbackError('/plans/'); } + if (error.status === 403) { + return this.onFetchingForbiddenCallbackError('/plans/'); + } }); } else if (publicId != null) { @@ -92,6 +97,9 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { if (error.status === 404) { return this.onFetchingDeletedCallbackError('/plans/'); } + if (error.status === 403) { + return this.onFetchingForbiddenCallbackError('/plans/'); + } }); } }); @@ -102,6 +110,11 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { this.router.navigate([redirectRoot]); } + onFetchingForbiddenCallbackError(redirectRoot: string) { + this.uiNotificationService.snackBarNotification(this.language.instant('DMP-OVERVIEW.ERROR.FORBIDEN-DMP'), SnackBarNotificationLevel.Error); + this.router.navigate([redirectRoot]); + } + setIsUserOwner() { if (this.dmp) { const principal: Principal = this.authentication.current(); @@ -122,6 +135,19 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { // this.router.navigate(['/grants/edit/' + grantId]); } + expandDesc() { + this.expand = !this.expand; + } + + checkOverflow (element) { + if (this.expand || (element.offsetHeight < element.scrollHeight || + element.offsetWidth < element.scrollWidth)) { + return true; + } else { + return false; + } + } + datasetClicked(datasetId: String) { if (this.isPublicView) { this.router.navigate(['/datasets/publicEdit/' + datasetId]); @@ -266,7 +292,9 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { } roleDisplay(value: UserInfoListingModel) { - if (value.role === Role.Member) { + if (value.role === Role.Owner) { + return this.translate.instant('DMP-LISTING.OWNER'); + } else if (value.role === Role.Member) { return this.translate.instant('DMP-LISTING.MEMBER'); } else { return this.translate.instant('DMP-LISTING.OWNER'); @@ -409,6 +437,22 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { return !(!this.authentication.current()); } + openShareDialog(rowId: any, rowName: any) { + const dialogRef = this.dialog.open(DmpInvitationDialogComponent, { + // height: '250px', + // width: '700px', + restoreFocus: false, + data: { + dmpId: rowId, + dmpName: rowName + } + }); + } + + addDataset(rowId: String) { + this.router.navigate(['/datasets/new/' + rowId]); + } + // advancedClicked() { // const dialogRef = this.dialog.open(ExportMethodDialogComponent, { // maxWidth: '500px', diff --git a/dmp-frontend/src/app/ui/dmp/wizard/listing/dmp-wizard-dataset-listing.component.ts b/dmp-frontend/src/app/ui/dmp/wizard/listing/dmp-wizard-dataset-listing.component.ts index 210b7034b..351dea94f 100644 --- a/dmp-frontend/src/app/ui/dmp/wizard/listing/dmp-wizard-dataset-listing.component.ts +++ b/dmp-frontend/src/app/ui/dmp/wizard/listing/dmp-wizard-dataset-listing.component.ts @@ -64,6 +64,7 @@ export class DmpWizardDatasetListingComponent extends BaseComponent implements O const request: DataTableRequest = new DataTableRequest(null, null, null); request.criteria = new DatasetCriteria(); request.criteria.dmpIds = [this.dmpId]; + request.criteria.allVersions = true; this.datasetService.getPaged(request) .pipe(takeUntil(this._destroyed)) .subscribe(items => { diff --git a/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.scss b/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.scss index ea5be4d58..c5763d039 100644 --- a/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.scss +++ b/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.scss @@ -16,7 +16,7 @@ text-center { } .header-image { - background: url("/assets/images/public-datasets-bg.png") no-repeat; + background: url("/assets/images/new-dashboard-bg.png") no-repeat; background-size: cover; margin-top: 70px; min-height: 15em; diff --git a/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filters.component.scss b/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filters.component.scss index b3f5e80d5..0bceec0ed 100644 --- a/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filters.component.scss +++ b/dmp-frontend/src/app/ui/explore-dmp/dmp-explore-filters/explore-dmp-filters.component.scss @@ -30,7 +30,7 @@ } .filters-title { - width: 90px; + width: 93px; color: #089dbb; background-color: white; padding: 0px 20px; diff --git a/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.scss b/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.scss index fa94d00e3..79bfb137b 100644 --- a/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.scss +++ b/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.scss @@ -20,7 +20,7 @@ text-center { } .header-image { - background: url("/assets/images/public-dmps-bg.png") no-repeat; + background: url("/assets/images/new-dashboard-bg.png") no-repeat; background-size: cover; margin-top: 70px; min-height: 15em; diff --git a/dmp-frontend/src/app/ui/grant/editor/grant-editor.component.ts b/dmp-frontend/src/app/ui/grant/editor/grant-editor.component.ts index 428cf5a1d..eb5325f52 100644 --- a/dmp-frontend/src/app/ui/grant/editor/grant-editor.component.ts +++ b/dmp-frontend/src/app/ui/grant/editor/grant-editor.component.ts @@ -20,6 +20,7 @@ import { TranslateService } from '@ngx-translate/core'; import { environment } from 'environments/environment'; import { Observable, of as observableOf } from 'rxjs'; import { map, takeUntil } from 'rxjs/operators'; +import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; @Component({ @@ -33,7 +34,7 @@ export class GrantEditorComponent extends BaseComponent implements OnInit, IBrea isNew = true; grant: GrantEditorModel; formGroup: FormGroup = null; - host = environment.Server; + host: string; editMode = false; sizeError = false; maxFileSize: number = 1048576; @@ -46,9 +47,11 @@ export class GrantEditorComponent extends BaseComponent implements OnInit, IBrea private dialog: MatDialog, private grantFileUploadService: GrantFileUploadService, private uiNotificationService: UiNotificationService, - private formService: FormService + private formService: FormService, + private configurationService: ConfigurationService ) { super(); + this.host = this.configurationService.server; } ngOnInit() { diff --git a/dmp-frontend/src/app/ui/language-editor/language-editor.component.html b/dmp-frontend/src/app/ui/language-editor/language-editor.component.html index b9eaa1621..b0eaa1c83 100644 --- a/dmp-frontend/src/app/ui/language-editor/language-editor.component.html +++ b/dmp-frontend/src/app/ui/language-editor/language-editor.component.html @@ -1,26 +1,34 @@ -
+
-
- -
- -
- - {{key}} : - - +
+ + +
+ +
+
+ + {{key}} : + + +
-
-
- -
+ + + +
- +
diff --git a/dmp-frontend/src/app/ui/language-editor/language-editor.component.scss b/dmp-frontend/src/app/ui/language-editor/language-editor.component.scss index 39e04d644..a02699a28 100644 --- a/dmp-frontend/src/app/ui/language-editor/language-editor.component.scss +++ b/dmp-frontend/src/app/ui/language-editor/language-editor.component.scss @@ -14,4 +14,33 @@ position: fixed; right: 10px; } + + .sticky { + position: fixed; + left: 200px; + right: 200px; + width: 50%; + } + + .search-bar { + padding-top: inherit !important; + bottom: auto !important; + width: 258px !important; + top: 100px; + position: fixed; + right: 10px; + background-color: white; + border: 1px solid rgb(218, 218, 218); + border-radius: 6px; + padding-left: 10px; + } + + .search-text { + border: 0px solid rgb(218, 218, 218); + border-radius: 6px; + width: 180px; + } + .search-text::placeholder { + color: rgb(197, 194, 194); + } } diff --git a/dmp-frontend/src/app/ui/language-editor/language-editor.component.ts b/dmp-frontend/src/app/ui/language-editor/language-editor.component.ts index 68050e652..21dbbe559 100644 --- a/dmp-frontend/src/app/ui/language-editor/language-editor.component.ts +++ b/dmp-frontend/src/app/ui/language-editor/language-editor.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, OnDestroy } from '@angular/core'; import { LanguageService } from '@app/core/services/language/language.service'; import { BaseComponent } from '@common/base/base.component'; import { takeUntil } from 'rxjs/operators'; @@ -12,8 +12,15 @@ import { Router } from '@angular/router'; templateUrl: './language-editor.component.html', styleUrls: ['./language-editor.component.scss'] }) -export class LanguageEditorComponent extends BaseComponent implements OnInit { +export class LanguageEditorComponent extends BaseComponent implements OnInit, OnDestroy { + readonly rowHeight = 100; + readonly maxElements = 12; + + allkeys = []; keys = []; + visibleKeys = []; + startIndex = 0; + endIndex: number; parseFinished = false; currentLang: string; formGroup: FormGroup; @@ -29,6 +36,8 @@ export class LanguageEditorComponent extends BaseComponent implements OnInit { ngOnInit() { this.formBuilder = new FormBuilder(); this.formGroup = this.formBuilder.group({}); + this.endIndex = this.maxElements; + window.addEventListener('scroll', this.refreshFn, true); this.language.getCurrentLanguageJSON() .pipe(takeUntil(this._destroyed)) .subscribe(response => { @@ -38,13 +47,23 @@ export class LanguageEditorComponent extends BaseComponent implements OnInit { }); } + ngOnDestroy() { + window.removeEventListener('scroll', this.refreshFn, true); + } + convertBlobToJSON(blob: Blob) { const fr = new FileReader(); fr.onload = ev => { const langObj = JSON.parse(fr.result as string); this.convertObjectToForm(langObj, '', this.formGroup); this.currentLang = this.language.getCurrentLanguageName(); + this.keys.length = 0; + for (const key of this.allkeys) { + this.keys.push(key); + } + this.visibleKeys = this.keys.slice(this.startIndex, this.endIndex); this.parseFinished = true; + }; fr.readAsText(blob); } @@ -58,14 +77,14 @@ export class LanguageEditorComponent extends BaseComponent implements OnInit { continue; } else { form.addControl(prop, this.formBuilder.control(obj[prop])); - this.keys.push(key); + this.allkeys.push(key); } } return; } updateLang() { - const json = JSON.stringify(this.formGroup.value); + const json = JSON.stringify(this.formGroup.value, null, " "); this.language.updateLanguage(json).pipe(takeUntil(this._destroyed)) .subscribe( complete => { @@ -88,4 +107,32 @@ onCallbackError(error: any) { //this.validateAllFormFields(this.formGroup); } +refreshFn = (ev: Event) => { + + if ((ev.srcElement as HTMLDocument).scrollingElement !== undefined) { + this.startIndex = Math.floor((ev.srcElement as HTMLDocument).scrollingElement.scrollTop / this.rowHeight); + this.endIndex = this.startIndex + this.maxElements; + const tempKeys = this.keys.slice(this.startIndex, this.endIndex); + this.visibleKeys.length = 0; + for (const key of tempKeys) { + this.visibleKeys.push(key); + } + } +} + +findKeys(ev: any) { + let tempKeys = []; + if (ev.value === "") { + tempKeys = this.allkeys; + } else { + tempKeys = this.allkeys.filter((key) => (this.formGroup.get(key).value as string).toLowerCase().includes(ev.value.toLowerCase())); + window.scrollTo({top: 0}); + } + this.keys.length = 0; + for (const key of tempKeys) { + this.keys.push(key); + } + this.visibleKeys = this.keys.slice(this.startIndex, this.endIndex); +} + } diff --git a/dmp-frontend/src/app/ui/language-editor/language-editor.routing.ts b/dmp-frontend/src/app/ui/language-editor/language-editor.routing.ts index 423d8dd32..fde8ad57b 100644 --- a/dmp-frontend/src/app/ui/language-editor/language-editor.routing.ts +++ b/dmp-frontend/src/app/ui/language-editor/language-editor.routing.ts @@ -1,9 +1,11 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { LanguageEditorComponent } from './language-editor.component'; +import { AuthGuard } from '@app/core/auth-guard.service'; +import { AdminAuthGuard } from '@app/core/admin-auth-guard.service'; const routes: Routes = [ - { path: '', component: LanguageEditorComponent }, + { path: '', component: LanguageEditorComponent, canActivate: [AdminAuthGuard] }, // { path: ':id', component: UserProfileComponent } ]; diff --git a/dmp-frontend/src/app/ui/language/dialog/language-dialog.component.html b/dmp-frontend/src/app/ui/language/dialog/language-dialog.component.html new file mode 100644 index 000000000..e4982c2a1 --- /dev/null +++ b/dmp-frontend/src/app/ui/language/dialog/language-dialog.component.html @@ -0,0 +1,16 @@ +
+
+
+ {{'LANGUAGE.TITLE' | translate}} +
+
+ close +
+
+
+ +
+
+
+
+
diff --git a/dmp-frontend/src/app/ui/language/dialog/language-dialog.component.scss b/dmp-frontend/src/app/ui/language/dialog/language-dialog.component.scss new file mode 100644 index 000000000..6fbd87e8d --- /dev/null +++ b/dmp-frontend/src/app/ui/language/dialog/language-dialog.component.scss @@ -0,0 +1,17 @@ +.form { + min-width: 150px; + max-width: 500px; + width: 100%; +} + +.full-width { + width: 100%; +} + +.close-btn { + cursor: pointer; +} + +.language { + margin-bottom: 1.125rem; +} diff --git a/dmp-frontend/src/app/ui/language/dialog/language-dialog.component.ts b/dmp-frontend/src/app/ui/language/dialog/language-dialog.component.ts new file mode 100644 index 000000000..a43dc91bb --- /dev/null +++ b/dmp-frontend/src/app/ui/language/dialog/language-dialog.component.ts @@ -0,0 +1,31 @@ +import { Component, Inject } from '@angular/core'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; + +@Component({ + selector: 'app-language-dialog', + templateUrl: './language-dialog.component.html', + styleUrls: ['./language-dialog.component.scss'] +}) +export class LanguageDialogComponent { + + public isDialog: boolean; + + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) { + this.isDialog = data.isDialog; + } + + cancel() { + this.dialogRef.close(); + } + + send() { + this.dialogRef.close(this.data); + } + + close() { + this.dialogRef.close(false); + } +} diff --git a/dmp-frontend/src/app/ui/language/language-content/language.component.html b/dmp-frontend/src/app/ui/language/language-content/language.component.html new file mode 100644 index 000000000..d23cad05b --- /dev/null +++ b/dmp-frontend/src/app/ui/language/language-content/language.component.html @@ -0,0 +1,5 @@ + +
+ {{lang.label | translate}} +
+
diff --git a/dmp-frontend/src/app/ui/language/language-content/language.component.scss b/dmp-frontend/src/app/ui/language/language-content/language.component.scss new file mode 100644 index 000000000..aea7dec4f --- /dev/null +++ b/dmp-frontend/src/app/ui/language/language-content/language.component.scss @@ -0,0 +1,9 @@ +::ng-deep.lang-menu { + border-color: transparent; + padding: 8px; +} + +::ng-deep.lang-button { + padding-top: 15px; + padding-bottom: 15px; +} diff --git a/dmp-frontend/src/app/ui/language/language-content/language.component.ts b/dmp-frontend/src/app/ui/language/language-content/language.component.ts new file mode 100644 index 000000000..791ed94d1 --- /dev/null +++ b/dmp-frontend/src/app/ui/language/language-content/language.component.ts @@ -0,0 +1,61 @@ +import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; +import { AuthService } from '@app/core/services/auth/auth.service'; +import { LanguageService } from '@app/core/services/language/language.service'; +import { UserService } from '@app/core/services/user/user.service'; +import { takeUntil } from 'rxjs/operators'; +import { BaseComponent } from '@common/base/base.component'; + +const availableLanguages: any[] = require('../../../../assets/resources/language.json'); + +@Component({ + selector: 'app-language', + templateUrl: './language.component.html', + styleUrls: ['./language.component.scss'] +}) +export class LanguageComponent extends BaseComponent implements OnInit { + + languages = availableLanguages; + + constructor( + private router: Router, + private authentication: AuthService, + private languageService: LanguageService, + private userService: UserService + ) { super(); } + + ngOnInit() { + } + + public isAuthenticated(): boolean { + return !(!this.authentication.current()); +} + + public getCurrentLanguage(): any { + const lang = this.languages.find(lang => lang.value === this.languageService.getCurrentLanguage()); + return lang; +} + + onLanguageSelected(selectedLanguage: any) { + if (this.isAuthenticated()) { + const langMap = new Map(); + langMap.set('language', selectedLanguage.value); + this.userService.updateUserSettings({language: this.languages.find(lang => lang.value === selectedLanguage.value)}) + .pipe(takeUntil(this._destroyed)) + .subscribe((response) => { + this.languageService.changeLanguage(selectedLanguage.value); + this.authentication.me() + .pipe(takeUntil(this._destroyed)) + .subscribe ( innerResponse => + {this.router.navigateByUrl(this.router.url);}); + }, + error => { + console.log(error); + }); + } else { + this.languageService.changeLanguage(selectedLanguage.value); + this.router.navigateByUrl(this.router.url); + } +} + +} diff --git a/dmp-frontend/src/app/ui/language/language.module.ts b/dmp-frontend/src/app/ui/language/language.module.ts new file mode 100644 index 000000000..78c7d5dc0 --- /dev/null +++ b/dmp-frontend/src/app/ui/language/language.module.ts @@ -0,0 +1,25 @@ +import { NgModule } from '@angular/core'; + +import { LanguageComponent } from './language-content/language.component'; +import { CommonUiModule } from '@common/ui/common-ui.module'; +import { LanguageDialogComponent } from './dialog/language-dialog.component'; + + +@NgModule({ + declarations: [ + LanguageComponent, + LanguageDialogComponent +], + imports: [ + CommonUiModule + ], + entryComponents: [ + LanguageComponent, + LanguageDialogComponent + ], + exports: [ + LanguageComponent, + LanguageDialogComponent + ] +}) +export class LanguageModule { } diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.html b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.html index 50d76924d..4fcb0ed64 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.html +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.html @@ -2,25 +2,20 @@
-
- {{form.get('numbering').value}} - {{form.get('title').value}} - -
- info - - -
{{form.get('description').value}}
-
- {{form.get('extendedDescription').value}} -
- - - +
+ +
+
+
+ +
+ +
+
+
@@ -29,33 +24,34 @@
-
- {{form.get('numbering').value}} - {{form.get('title').value}}
- info - -
{{form.get('description').value}}
-
- {{form.get('extendedDescription').value}}
-
- - - + + +
--> +
+
+
+
diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.scss b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.scss index d1edcfbd0..6d8d3d674 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.scss +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.scss @@ -1,6 +1,4 @@ .copositeField { - font-weight: bold; - color: #3a3737; - max-width: 100%; - padding-top: 1em; + padding-left: 0em !important; + padding-top: 2em !important; } diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.ts index 1c3637d08..08a261e48 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormArray, FormGroup } from '@angular/forms'; +import { FormArray, FormGroup, AbstractControl } from '@angular/forms'; import { DatasetDescriptionCompositeFieldEditorModel, DatasetDescriptionFieldEditorModel } from '../../dataset-description-form.model'; import { VisibilityRulesService } from '../../visibility-rules/visibility-rules.service'; @@ -13,6 +13,7 @@ export class FormCompositeFieldComponent { @Input() datasetProfileId: String; @Input() form: FormGroup; @Input() isChild: Boolean = false; + @Input() showDelete: Boolean = false; constructor( public visibilityRulesService: VisibilityRulesService, @@ -32,4 +33,28 @@ export class FormCompositeFieldComponent { // markForConsideration() { // this.markForConsiderationService.markForConsideration(this.compositeField); // } + + deleteCompositeField() { + if (this.isChild) { + this.deleteMultipeFieldFromCompositeFormGroup(); + } else { + this.deleteCompositeFieldFormGroup(); + } + } + + deleteCompositeFieldFormGroup() { + const numberOfItems = this.form.get('multiplicityItems').get('' + 0).get('fields').value.length; + for (let i = 0; i < numberOfItems; i++) { + const multiplicityItem = this.form.get('multiplicityItems').get('' + 0).get('fields').get('' + i).value; + this.form.get('fields').get('' + i).patchValue(multiplicityItem); + } + ((this.form.get('multiplicityItems'))).removeAt(0); + } + + deleteMultipeFieldFromCompositeFormGroup() { + const parent = this.form.parent; + const index = (parent as FormArray).controls.indexOf(this.form); + (parent as FormArray).removeAt(index); + // ((this.form as AbstractControl)).removeAt(fildIndex); + } } diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-title/form-composite-title.component.html b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-title/form-composite-title.component.html new file mode 100644 index 000000000..7a5a8ca69 --- /dev/null +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-title/form-composite-title.component.html @@ -0,0 +1,19 @@ +
+
+
+ {{form.get('numbering').value}} + {{form.get('title').value}} + +
+ info +
+
+ + +
{{form.get('description').value}}
+
+ {{form.get('extendedDescription').value}} +
diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-title/form-composite-title.component.scss b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-title/form-composite-title.component.scss new file mode 100644 index 000000000..330eb7cb5 --- /dev/null +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-title/form-composite-title.component.scss @@ -0,0 +1,6 @@ +.copositeField { + font-weight: bold; + color: #3a3737; + max-width: 100%; + padding-top: 1em; + } diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-title/form-composite-title.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-title/form-composite-title.component.ts new file mode 100644 index 000000000..e11249667 --- /dev/null +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-title/form-composite-title.component.ts @@ -0,0 +1,19 @@ +import { Component, OnInit, Input } from '@angular/core'; +import { FormGroup } from '@angular/forms'; + +@Component({ + selector: 'app-form-composite-title', + templateUrl: './form-composite-title.component.html', + styleUrls: ['./form-composite-title.component.scss'] +}) +export class FormCompositeTitleComponent implements OnInit { + + @Input() form: FormGroup; + @Input() isChild: Boolean = false; + + constructor() { } + + ngOnInit() { + } + +} 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 bf05fa069..48c017bda 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 @@ -17,12 +17,7 @@
-
- -
+ [isChild]="false" [showDelete]="(compositeFieldFormGroup.get('multiplicityItems').length) > 0">
@@ -31,12 +26,7 @@
-
- -
+ [isChild]="true" [showDelete]="true">
(); + } + parseValue(value: any) { if (typeof value === 'string') { if (isNumeric(value)) { return value; } diff --git a/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.html b/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.html index df07a6a64..4b71766a6 100644 --- a/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.html +++ b/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.html @@ -2,8 +2,8 @@
- - + +
{{this.getPrincipalName()}}
diff --git a/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.ts b/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.ts index 80404784a..326dd5280 100644 --- a/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.ts +++ b/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.ts @@ -47,6 +47,10 @@ export class UserDialogComponent implements OnInit { return 'assets/images/profile-placeholder.png'; } + public applyFallbackAvatar(ev: Event) { + (ev.target as HTMLImageElement).src = this.getDefaultAvatar(); + } + public navigateToProfile() { this.dialogRef.close(); this.router.navigate(['/profile']); diff --git a/dmp-frontend/src/app/ui/navbar/navbar.component.html b/dmp-frontend/src/app/ui/navbar/navbar.component.html index aaff6823d..90b73b423 100644 --- a/dmp-frontend/src/app/ui/navbar/navbar.component.html +++ b/dmp-frontend/src/app/ui/navbar/navbar.component.html @@ -37,13 +37,11 @@
-->
- - - + +
@@ -79,8 +77,8 @@
--> +
+
+

+ + {{'FOOTER.GUIDE' | translate}}

+
+

diff --git a/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.ts b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.ts index dda6326be..495defadf 100644 --- a/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.ts +++ b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.ts @@ -14,6 +14,7 @@ import { ValidationErrorModel } from '@common/forms/validation/error-model/valid import { TranslateService } from '@ngx-translate/core'; import { takeUntil } from 'rxjs/operators'; import { AuthService } from "@app/core/services/auth/auth.service"; +import { UserGuideDialogComponent } from '@app/ui/user-guide/dialog/user-guide-dialog.component'; @Component({ selector: 'app-sidebar-footer', @@ -97,6 +98,20 @@ export class SidebarFooterComponent extends BaseComponent implements OnInit { } } + openUserGuideDialog() { + if (this.dialog.openDialogs.length > 0) { + this.dialog.closeAll(); + } + else { + const dialogRef = this.dialog.open(UserGuideDialogComponent, { + disableClose: true, + data: { + isDialog: true + } + }); + } + } + onCallbackSuccess(): void { this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-EMAIL-SEND'), SnackBarNotificationLevel.Success); } diff --git a/dmp-frontend/src/app/ui/sidebar/sidebar.component.html b/dmp-frontend/src/app/ui/sidebar/sidebar.component.html index df25ff991..95839687b 100644 --- a/dmp-frontend/src/app/ui/sidebar/sidebar.component.html +++ b/dmp-frontend/src/app/ui/sidebar/sidebar.component.html @@ -29,8 +29,8 @@

@@ -64,7 +70,7 @@

{{groupMenuItem.title | translate}}