aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/dashboard
diff options
context:
space:
mode:
Diffstat (limited to 'ufund-ui/src/app/components/dashboard')
-rw-r--r--ufund-ui/src/app/components/dashboard/dashboard.component.html3
-rw-r--r--ufund-ui/src/app/components/dashboard/dashboard.component.ts14
2 files changed, 11 insertions, 6 deletions
diff --git a/ufund-ui/src/app/components/dashboard/dashboard.component.html b/ufund-ui/src/app/components/dashboard/dashboard.component.html
index fc8baf0..a1151b7 100644
--- a/ufund-ui/src/app/components/dashboard/dashboard.component.html
+++ b/ufund-ui/src/app/components/dashboard/dashboard.component.html
@@ -1,5 +1,4 @@
<h1>Dashboard</h1>
-<input type="button" value="Back to Login" (click)="back()">
<app-cupboard></app-cupboard>
-<app-funding-basket></app-funding-basket> \ No newline at end of file
+<app-funding-basket *ngIf="!isManager()"></app-funding-basket> \ No newline at end of file
diff --git a/ufund-ui/src/app/components/dashboard/dashboard.component.ts b/ufund-ui/src/app/components/dashboard/dashboard.component.ts
index 48c5894..b9faefa 100644
--- a/ufund-ui/src/app/components/dashboard/dashboard.component.ts
+++ b/ufund-ui/src/app/components/dashboard/dashboard.component.ts
@@ -1,4 +1,6 @@
import { Component } from '@angular/core';
+import { UsersService } from '../../services/users.service';
+import { userType } from '../../models/User';
@Component({
selector: 'app-dashboard',
@@ -7,9 +9,13 @@ import { Component } from '@angular/core';
styleUrl: './dashboard.component.css'
})
export class DashboardComponent {
- constructor() {}
+ constructor(
+ protected usersService: UsersService,
+ ) {}
+
+ isManager() {
+ const type = this.usersService.getCurrentUser()?.type;
+ return type === ("MANAGER" as unknown as userType);
+ }
- back() {
- window.history.back();
- }
}