From 9161dbda5627c1baa07f14a53fd8428b7f0851a3 Mon Sep 17 00:00:00 2001 From: Kristan Ntavidi Date: Thu, 17 Jun 2021 12:25:46 +0300 Subject: [PATCH] UI fixes and bug fixes * Member of dmp cannot see dmp editor anymore. Redirects to overview * Hide percentage bar in dmp editor when editor is disabled (when finalized or locked) * Change font sizes on Resource page (static pages) * Fix issue of indeterministic disabled on DMP editor. --- .../app/ui/dmp/editor/dmp-editor.component.html | 2 +- .../app/ui/dmp/editor/dmp-editor.component.ts | 16 ++++++++++++++-- dmp-frontend/src/assets/splash/css/section.css | 6 +++--- 3 files changed, 18 insertions(+), 6 deletions(-) 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 7c979743a..177145027 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 @@ -79,7 +79,7 @@
- +
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 b01094924..ee448b199 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 @@ -33,7 +33,7 @@ import { ValidationErrorModel } from '@common/forms/validation/error-model/valid import { TranslateService } from '@ngx-translate/core'; import * as FileSaver from 'file-saver'; import { Observable, of as observableOf, interval } from 'rxjs'; -import { delay, map, takeUntil } from 'rxjs/operators'; +import { catchError, delay, 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'; @@ -185,6 +185,10 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC this.setIsUserOwner(); if (!this.isUserOwner) { + + if(this.isUserMember()){ + this.router.navigate(['plans', 'overview', itemId]); + } this.isFinalized = true; this.formGroup.disable(); } @@ -365,7 +369,15 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC setIsUserOwner() { if (this.dmp) { const principal: Principal = this.authentication.current(); - this.isUserOwner = principal.id === this.dmp.users.find(x => x.role === Role.Owner).id; + this.isUserOwner = !!this.dmp.users.find(x => (x.role === Role.Owner) && (x.id === principal.id) ); + } + } + isUserMember(): boolean{ + try{ + const principal: Principal = this.authentication.current(); + return !!this.dmp.users.find(x => (x.role === Role.Member) && (x.id === principal.id) ); + }catch{ + return false; } } diff --git a/dmp-frontend/src/assets/splash/css/section.css b/dmp-frontend/src/assets/splash/css/section.css index f43025fb5..10943753b 100644 --- a/dmp-frontend/src/assets/splash/css/section.css +++ b/dmp-frontend/src/assets/splash/css/section.css @@ -199,7 +199,7 @@ section.benefits { text-align: left; font-weight: 300; font-family: 'Roboto',sans-serif; - font-size: 1.25rem; + font-size: 1.688rem; letter-spacing: 0px; color: #212121; opacity: 0.81; @@ -209,7 +209,7 @@ section.benefits { text-align: left; font-family: 'Roboto', sans-serif; font-weight: 400; - font-size: 0.87rem; + font-size: 1.125rem; line-height: 1.6rem; letter-spacing: 0px; color: #212121; @@ -218,7 +218,7 @@ section.benefits { } .list { - font-size: 0.87rem; + font-size: 1.125rem; color: #212121; opacity: 0.8; }