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 4b71766a6..689af7f41 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 @@ -1,10 +1,38 @@ -
+ + + +
+ + + + + - + --> + + \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.scss b/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.scss index dc9cbf6a1..68aba8ab8 100644 --- a/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.scss +++ b/dmp-frontend/src/app/ui/misc/navigation/user-dialog/user-dialog.component.scss @@ -6,6 +6,50 @@ $mat-card-header-size: 40px !default; flex-shrink: 0; } -.profile, .logout { - margin-left: 3em; +.top-divider { + border-top-style: none !important; } + +.profile, .logout { + padding-left: 1.1875rem; + font-weight: 300; + color: #212121; + height: 1.875rem; + width: 100%; + text-align: left; +} + +.dropdown-top { + width: 0rem; + border-bottom: 0.625rem solid #FFFFFF; + border-left: 0.625rem solid transparent; + border-right: 0.625rem solid transparent; + margin: 0 87%; +} + +.dropdown-options { + background-color: #FFFFFF; + min-width: 10rem; + width: 13.625rem; +} + +.dropdown-options a:hover { + background-color: rgba(255, 255, 255, 0.609) !important; +} + +.dropdown-options a:hover { + background-color: #ddd; +} + +::ng-deep .mat-dialog-container { + background-color: transparent; + padding: 0rem; + overflow: initial; + box-shadow: none; +} + +.check-icon { + color: #129D99; + transform: scale(0.7); +} + 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 21d7e79bc..f0be0d5bc 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 @@ -55,4 +55,9 @@ export class UserDialogComponent implements OnInit { this.dialogRef.close(); this.router.navigate(['/profile']); } + + public navigateToMyDmps() { + this.dialogRef.close(); + this.router.navigate(['/plans']); + } } diff --git a/dmp-frontend/src/app/ui/navbar/navbar.component.ts b/dmp-frontend/src/app/ui/navbar/navbar.component.ts index de3141bf9..537fcbb59 100644 --- a/dmp-frontend/src/app/ui/navbar/navbar.component.ts +++ b/dmp-frontend/src/app/ui/navbar/navbar.component.ts @@ -14,6 +14,8 @@ import { UserService } from '@app/core/services/user/user.service'; import { FaqDialogComponent } from '../faq/dialog/faq-dialog.component'; import { DmpInvitationDialogComponent } from '../dmp/invitation/dmp-invitation.component'; import { StartNewDmpDialogComponent } from '../dmp/start-new-dmp-dialogue/start-new-dmp-dialog.component'; +import { UserListingModel } from '@app/core/model/user/user-listing'; +import { Principal } from '@app/core/model/auth/principal'; const availableLanguages: any[] = require('../../../assets/resources/language.json'); @@ -33,6 +35,7 @@ export class NavbarComponent extends BaseComponent implements OnInit { language = this.languages[0]; currentRoute: string; selectedLanguage = 'en'; + private user: UserListingModel; @Output() sidebarToggled: EventEmitter = new EventEmitter(); constructor(location: Location, @@ -41,7 +44,8 @@ export class NavbarComponent extends BaseComponent implements OnInit { private authentication: AuthService, private dialog: MatDialog, private progressIndicationService: ProgressIndicationService, - private languageService: LanguageService + private languageService: LanguageService, + public userService: UserService ) { super(); this.location = location; @@ -69,6 +73,7 @@ export class NavbarComponent extends BaseComponent implements OnInit { this.progressIndicationService.getProgressIndicationObservable().pipe(takeUntil(this._destroyed)).subscribe(x => { setTimeout(() => { this.progressIndication = x; }); }); + this.getPrincipalAsUser(); } public isAuthenticated(): boolean { @@ -79,6 +84,13 @@ export class NavbarComponent extends BaseComponent implements OnInit { return this.currentRoute === '/language-editor' || this.currentRoute === '/profile'; } + public getPrincipalAsUser() { + const principal: Principal = this.authentication.current(); + if (principal) { + this.userService.getUser(principal.id).pipe(takeUntil(this._destroyed)).subscribe(result => this.user = result); + } + } + sidebarOpen() { const toggleButton = this.toggleButton; const body = document.getElementsByTagName('body')[0]; @@ -211,6 +223,9 @@ export class NavbarComponent extends BaseComponent implements OnInit { autoFocus: false, closeOnNavigation: true, disableClose: false, + data: { + user: this.user + }, position: { top: '64px', right: '1em' } }); } diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index e962f693f..b435d26e0 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -1217,6 +1217,7 @@ }, "USER-DIALOG": { "USER-PROFILE": "My Profile", + "USER-PROFILE-SETTINGS": "My Profile Settings...", "EXIT": "Exit ", "LOG-OUT": "Log Out" }, diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index 7d5a06b08..36a9cfeb1 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -1198,6 +1198,7 @@ }, "USER-DIALOG": { "USER-PROFILE": "Mi perfil", + "USER-PROFILE-SETTINGS": "My Profile Settings...", "EXIT": "Salir ", "LOG-OUT": "Cerrar la sesión" }, diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index 91b1e8487..279ed81b0 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -1199,6 +1199,7 @@ }, "USER-DIALOG": { "USER-PROFILE": "Το Προφίλ μου", + "USER-PROFILE-SETTINGS": "My Profile Settings...", "EXIT": "Έξοδος ", "LOG-OUT": "Αποσύνδεση" },