|
|
@@ -1,4 +1,4 @@
|
|
|
-import { Component, computed, OnInit, Signal } from '@angular/core';
|
|
|
+import { Component, computed, inject, OnInit, Signal } from '@angular/core';
|
|
|
import { RouterModule } from '@angular/router';
|
|
|
import { BaseComponent } from 'angularlib/base.component';
|
|
|
import { LoginModule } from 'angularlib/login';
|
|
|
@@ -16,21 +16,23 @@ import { LeaveModule } from 'fis/leave';
|
|
|
import { MatDivider } from "@angular/material/divider";
|
|
|
import { MatModule } from 'angularlib/mat.module';
|
|
|
import { TenderModule } from 'fis/tender/tender.module';
|
|
|
+import { FISAccess } from 'fis/fis.access';
|
|
|
+import { FISMessaging } from 'fis/index';
|
|
|
|
|
|
@Component({
|
|
|
selector: 'spts-sales-submission-dashitem',
|
|
|
imports: [
|
|
|
- CommonModule,
|
|
|
- RouterModule,
|
|
|
- MatModule,
|
|
|
- LoginModule,
|
|
|
- LabelModule,
|
|
|
- MasterMenuComponent,
|
|
|
- InputModule,
|
|
|
- LeaveModule,
|
|
|
- TenderModule
|
|
|
-],
|
|
|
- providers: [ComponentService],
|
|
|
+ CommonModule,
|
|
|
+ RouterModule,
|
|
|
+ MatModule,
|
|
|
+ LoginModule,
|
|
|
+ LabelModule,
|
|
|
+ MasterMenuComponent,
|
|
|
+ InputModule,
|
|
|
+ LeaveModule,
|
|
|
+ TenderModule
|
|
|
+ ],
|
|
|
+ providers: [ComponentService, FISAccess],
|
|
|
templateUrl: './dashboard.component.html',
|
|
|
styleUrl: './dashboard.component.scss'
|
|
|
})
|
|
|
@@ -41,7 +43,10 @@ export class DashboardComponent extends BaseComponent implements OnInit{
|
|
|
const FIS_NAME = this.loginService?.userSignal()?.fisInfo?.name;
|
|
|
return GIVEN_NAME || FIS_NAME;
|
|
|
});
|
|
|
-
|
|
|
+ protected access = inject(FISAccess);
|
|
|
+ protected hasAccess = {
|
|
|
+ leaveApproval: false
|
|
|
+ };
|
|
|
|
|
|
protected goto = {
|
|
|
field: {
|
|
|
@@ -88,7 +93,14 @@ export class DashboardComponent extends BaseComponent implements OnInit{
|
|
|
}
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
- super.ngOnInit();
|
|
|
+ super.ngOnInit();
|
|
|
+ const run = async () => {
|
|
|
+ const leaveApproval = await this.access.canActivate({data:{serviceId:'09 - Leave Application',accessRight:['canread','canapprove'],noprompt:true}},undefined);
|
|
|
+ this.hasAccess = {
|
|
|
+ ...this.hasAccess,
|
|
|
+ leaveApproval: leaveApproval
|
|
|
+ };
|
|
|
+ }
|
|
|
+ run();
|
|
|
}
|
|
|
-
|
|
|
}
|