Commit 1043b35e by sawit

permission

parent 09a9899a
export type PermissionModel = PermissionModel2[]
export interface PermissionModel2 {
employeeId: string
bossId: string
fname: string
lname: string
efname: string
elname: string
bu1: Bu1
bu2: Bu2
bu3: Bu3
bu4: Bu4
bu5: Bu5
bu6: Bu6
bu7: Bu7
position: Position
pl: Pl
picture: string
busNo: string
status: Status
}
export interface Bu1 {
bu1id: string
tdesc: string
edesc: string
}
export interface Bu2 {
bu2id: string
tdesc: string
edesc: string
parent: any
}
export interface Bu3 {
bu3id: string
tdesc: string
edesc: string
parent: any
}
export interface Bu4 {
bu4id: string
tdesc: string
edesc: string
parent: any
}
export interface Bu5 {
bu5id: string
tdesc: string
edesc: string
parent: any
}
export interface Bu6 {
bu6id: string
tdesc: string
edesc: string
parent: any
}
export interface Bu7 {
bu7id: string
tdesc: string
edesc: string
parent: any
}
export interface Position {
positionId: string
tdesc: string
edesc: string
consolidate: any
shortName: any
}
export interface Pl {
plId: string
tdesc: string
edesc: string
}
export interface Status {}
<div class="container mx-auto p-4" *ngIf="role$ | async as role">
<h1 class="text-2xl font-bold mb-1">{{ 'EDIT_PERMISSIONS' | translate }}</h1>
<h2 class="text-lg text-gray-600 mb-6">{{ 'ROLE' | translate }}: <span class="font-semibold">{{ role.name }}</span></h2>
<div class="bg-white rounded-lg shadow-md p-6">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div *ngFor="let app of (applications$ | async)" class="flex items-center justify-between p-4 border rounded-lg hover:bg-gray-50 transition-colors">
<div>
<div class="font-semibold text-gray-800">{{ app.appName }}</div>
<div class="text-sm text-gray-500 mt-1">{{ app.description }}</div>
</div>
<mat-slide-toggle
[checked]="rolePermission.permissions[app.appId]"
(change)="onPermissionChange(app.appId, $event.checked)"
color="primary">
</mat-slide-toggle>
</div>
</div>
<div class="flex justify-end mt-8">
<button mat-stroked-button (click)="cancel()" class="mr-2">{{ 'CANCEL' | translate }}</button>
<button mat-flat-button color="primary" (click)="savePermissions()">{{ 'SAVE_CHANGES' | translate }}</button>
</div>
</div>
</div>
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { AppPermission, Role, RolePermission } from '../permission.model';
import { PermissionService } from '../permission.service';
// Core Angular & Material imports
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { MatButtonModule } from '@angular/material/button';
// Translation
import { TranslateModule } from '@ngx-translate/core';
@Component({
selector: 'app-permission-edit',
standalone: true,
imports: [
CommonModule,
FormsModule,
MatSlideToggleModule,
MatButtonModule,
TranslateModule
],
templateUrl: './permission-edit.component.html',
styleUrls: ['./permission-edit.component.scss']
})
export class PermissionEditComponent implements OnInit {
roleId!: string;
role$!: Observable<Role | undefined>;
applications$!: Observable<AppPermission[]>;
rolePermission: RolePermission = { roleId: '', permissions: {} };
constructor(
private route: ActivatedRoute,
private router: Router,
private permissionService: PermissionService
) { }
ngOnInit(): void {
this.roleId = this.route.snapshot.paramMap.get('roleId')!;
this.rolePermission.roleId = this.roleId;
this.role$ = this.permissionService.getRoles().pipe(
map(roles => roles.find(r => r.id === this.roleId))
);
this.applications$ = this.permissionService.getApplications();
this.permissionService.getRolePermissions(this.roleId).subscribe(permissions => {
if (permissions) {
this.rolePermission = permissions;
}
});
}
onPermissionChange(appId: string, isChecked: boolean): void {
this.rolePermission.permissions[appId] = isChecked;
}
savePermissions(): void {
this.permissionService.updateRolePermission(this.rolePermission).subscribe(() => {
this.router.navigate(['/portal-manage/permission-management']);
});
}
cancel(): void {
this.router.navigate(['/portal-manage/permission-management']);
}
}
<app-page-header [title]="'จัดการสิทธิ์พนักงาน'" [activeTitle]="'ผู้ดูแลระบบ'" [title1]="'จัดการสิทธิ์พนักงาน'"></app-page-header>
<div class="grid grid-cols-12 gap-6">
<div class="xl:col-span-12 col-span-12">
<div class="box">
<div class="box-header justify-between">
<div class="box-title">
{{ 'All List' | translate}} <span
class="badge bg-light text-default rounded-full ms-1 text-[0.75rem] align-middle">{{itemsList.length}}</span>
</div>
<div class="flex flex-wrap gap-2">
<!-- <a href="javascript:void(0);" class="hs-dropdown-toggle ti-btn ti-btn-primary-full me-2" (click)="new()"
data-hs-overlay="#modal-detail"><i class="ri-add-line font-semibold align-middle"></i>{{ 'Create' |
translate}}
</a> -->
<!-- <a href="javascript:void(0);" class="hs-dropdown-toggle ti-btn ti-btn-success-full me-2" *ngIf="someSelected"
(click)="adjustSelect(1)"><i class="ri-user-follow-line font-semibold align-middle"></i>{{ 'Active' |
translate}}
</a>
<a href="javascript:void(0);" class="hs-dropdown-toggle ti-btn ti-btn-secondary-full me-2"
*ngIf="someSelected" (click)="adjustSelect(0)"><i
class="ri-user-unfollow-line font-semibold align-middle"></i>{{ 'Unactive' |
translate}}
</a> -->
<!-- <a href="javascript:void(0);" class="hs-dropdown-toggle ti-btn ti-btn-danger-full me-2" *ngIf="someSelected"
(click)="deleteSelect()"><i class="ri-delete-bin-line font-semibold align-middle"></i>{{ 'Delete' |
translate}}
</a> -->
<div>
<input class="form-control form-control" type="text" placeholder="ค้นหาพนักงาน"
aria-label=".form-control-sm example" [(ngModel)]='searchTerm'>
</div>
</div>
</div>
<div class="box-body">
<div class="table-responsive">
<table class="table whitespace-nowrap min-w-full ti-custom-table-hover">
<thead>
<tr class="border-b border-defaultborder">
<th scope="col" class="!text-start">
<input class="form-check-input check-all" type="checkbox" id="all-products"
(change)="toggleAll($event)" [checked]="allSelected" aria-label="...">
</th>
<th scope="col" class="text-start">{{"Employee" | translate}}</th>
<th scope="col" class="text-start">{{"Position" | translate}}</th>
<th scope="col" class="text-start">{{"Bu1" | translate}}</th>
<th scope="col" class="text-start">{{"Bu2" | translate}}</th>
<th scope="col" class="text-start">{{"Bu3" | translate}}</th>
<!-- <th scope="col" class="text-start">{{"Update Date" | translate}}</th> -->
<th scope="col" class="text-start">{{ 'Action' | translate}}</th>
<th scope="col" class="text-start"></th>
</tr>
</thead>
<tbody>
@if (pagedList.length > 0) {
@for (item of pagedList; track item.employeeId) {
<tr class="border border-defaultborder dark:border-defaultborder/10">
<td class="product-checkbox">
<input class="form-check-input" type="checkbox" [checked]="selectedItems.get(item.employeeId) || false"
(change)="onCheckboxChange(item.employeeId)" aria-label="...">
</td>
<td>
<div class="flex items-center">
<span class="avatar avatar-sm p-1 me-1 bg-light !rounded-full">
<img [src]="item.getPicture()" alt="" id="profile-img">
</span>
<div class="ms-2">
<p class="font-semibold mb-0 flex items-center text-primary">
<a routerLink="/company/home/{{item.employeeId}}" routerLinkActive="active">
{{item.fname}}
</a>
</p>
</div>
</div>
</td>
<td>
<div>
<span class="block mb-1">
{{item.email}}
<!-- {{item.bu1}} {{item.thLastnameContact}} -->
</span>
</div>
</td>
<td>
<span class="badge bg-{{ item.status == 1 ? 'primary' : 'warning'}} text-white">
{{item.getStatus()}}
</span>
</td>
<!-- <td>
<span class="badge bg-info/10 text-primary">
<i class="bi bi-clock me-1"></i>
{{item.updatedAt | date : 'medium'}}
</span>
</td> -->
<td>
<div class="flex flex-row items-center !gap-2 ">
<a aria-label="anchor" (click)="view(item)" data-hs-overlay="#modal-detail"
class="ti-btn ti-btn-wave !gap-0 !m-0 bg-info/10 text-info hover:bg-info hover:text-white hover:border-info">
<i class="ri-pencil-line"></i>
</a>
<!-- <a aria-label="anchor" href="javascript:void(0);" (click)="delete(item)"
class="ti-btn ti-btn-wave product-btn !gap-0 !m-0 bg-danger/10 text-danger hover:bg-danger hover:text-white hover:border-danger">
<i class="ri-delete-bin-line"></i>
</a> -->
</div>
</td>
</tr>
}
} @else {
<tr>
<td [attr.colspan]="6" class="text-center py-4">
<ng-container *ngIf="itemsList.length === 0 && !searchTerm">
<p>กำลังโหลดข้อมูล หรือไม่มีข้อมูลเลย...</p>
</ng-container>
<ng-container *ngIf="itemsList.length > 0 && filterList.length === 0 && searchTerm">
<p>ไม่พบข้อมูลที่ค้นหา...</p>
</ng-container>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
<div class="box-footer">
<div class="flex items-center flex-wrap overflow-auto" *ngIf="filterList.length > 0">
<div class="mb-2 sm:mb-0">
<div>
{{'Showing' | translate}} {{ (pageIndex * pageSize) + 1 }} – {{ showingEnd }} {{'entries' | translate}}
<i class="bi bi-arrow-right ms-2 font-semibold"></i>
</div>
</div>
<div class="ms-auto">
<nav aria-label="Page navigation" *ngIf="totalPages > 1">
<ul class="ti-pagination mb-0">
<li class="page-item" [class.disabled]="pageIndex === 0">
<a class="page-link px-3 py-[0.375rem] cursor-pointer" (click)="goPrev()">{{'Previous' | translate}}</a>
</li>
<li class="page-item" *ngFor="let p of pages">
<a class="page-link px-3 py-[0.375rem] cursor-pointer"
[class.active]="p === pageIndex"
(click)="goTo(p)">{{ p + 1 }}</a>
</li>
<li class="page-item" [class.disabled]="pageIndex >= totalPages - 1">
<a class="page-link px-3 py-[0.375rem] cursor-pointer" (click)="goNext()">{{'Next' | translate}}</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="modal-detail" class="hs-overlay hidden ti-modal [--overlay-backdrop:static]">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out">
<div class="ti-modal-content">
<div class="ti-modal-header">
<h6 class="modal-title text-[1rem] font-semibold text-defaulttextcolor" id="mail-ComposeLabel">
{{ (action == 'add' ? ('Create' | translate) : ('Edit' | translate)) + ' ' + ('Company' | translate) }}
</h6>
<button type="button" class="hs-dropdown-toggle !text-[1rem] !font-semibold !text-defaulttextcolor"
data-hs-overlay="#modal-detail" #closeModal>
<span class="sr-only">{{'Close' | translate}}</span>
<i class="ri-close-line"></i>
</button>
</div>
<div class="ti-modal-body px-4">
<div class="grid grid-cols-12 gap-4">
<div class="xl:col-span-12 col-span-12">
<div class="mb-0 text-center">
<span class="avatar avatar-xxl avatar-rounded">
<img [src]="selectModel.getPicture()" alt="" id="profile-img">
<span class="badge rounded-full bg-primary avatar-badge">
<input (click)="triggerFileInput()" ng2FileSelect [uploader]="uploaderProfile" type="file"
name="photo" class="absolute w-full h-full opacity-[0]" id="profile-change"
[disabled]="action === 'edit'">
<i class="fe fe-camera text-[.625rem]"></i>
</span>
</span>
</div>
</div>
<div class="xl:col-span-12 col-span-12" *ngIf="action == 'edit'">
<label for="employeeId" class="form-label">{{'รหัสบริษัท' | translate}}</label>
<input type="text" class="form-control !bg-gray-200 cursor-not-allowed" id="employeeId" placeholder=""
[(ngModel)]="selectModel.employeeId" [disabled]="action === 'edit'">
<!-- <div class="text-danger" *ngIf="!selectModel.employeeId && action === 'add'">
{{'Please fill in information' | translate}}
</div> -->
</div>
<div class="xl:col-span-12 col-span-12">
<label for="fname" class="form-label">{{'ชื่อบริษัท ไทย' | translate}}</label>
<input type="text" class="form-control" id="fname" placeholder="" [(ngModel)]="selectModel.fname">
<div class="text-danger" *ngIf="!selectModel.fname">
{{'Please fill in information' | translate}}
</div>
</div>
<div class="xl:col-span-12 col-span-12">
<label for="fname" class="form-label">{{'ชื่อบริษัท อังกฤษ' | translate}}</label>
<input type="text" class="form-control" id="fname" placeholder="" [(ngModel)]="selectModel.engName">
<div class="text-danger" *ngIf="!selectModel.engName">
{{'Please fill in information' | translate}}
</div>
</div>
<div class="xl:col-span-12 col-span-12">
<label for="email" class="form-label">{{'Email' | translate}}</label>
<input type="email" class="form-control" id="emailAddress" placeholder="Email Addresss"
[(ngModel)]="selectModel.email" (input)="filterEngInput($event)">
<div class="text-danger" *ngIf="!selectModel.email">
{{ 'Please fill in information' | translate }}
</div>
<div class="text-danger" *ngIf="selectModel.email && (!selectModel.email.includes('@'))">
{{ 'Invalid email format @' | translate }}
</div>
<div class="text-danger"
*ngIf="selectModel.email && selectModel.email.includes('@') && !selectModel.email.split('@')[1]?.includes('.')">
{{ 'Invalid email format .' | translate }}
</div>
</div>
<div class="xl:col-span-6 col-span-12" *ngIf="action !== 'edit'">
<label for="password" class="form-label">{{'Password' | translate}}</label>
<input type="password" class="form-control" id="password" placeholder="" [(ngModel)]="password">
<div class="text-danger" *ngIf="!password">
{{ 'Please fill in information' | translate }}
</div>
</div>
<div class="xl:col-span-6 col-span-12" *ngIf="action !== 'edit'">
<label for="deal-title" class="form-label">{{'Confirm Password' | translate}}</label>
<input type="password" class="form-control" id="deal-title" placeholder="" [(ngModel)]="confirmPassword">
<div class="text-danger" *ngIf="!confirmPassword">
{{'Please fill in information' | translate}}
</div>
<div class="text-danger" *ngIf="confirmPassword && (confirmPassword != password)">
{{'Password Not Match' | translate}}
</div>
</div>
<!-- <div class="xl:col-span-12 col-span-12">
<label for="lname" class="form-label">{{'ข้อมูลบริษัท' | translate}}</label>
<textarea class="form-control" id="lname" placeholder="" [(ngModel)]="selectModel.lname">
</textarea>
<app-rendered-html class="small-html" [htmlContent]="selectModel.lname" *ngIf="action === 'edit'">
</app-rendered-html>
<div class="text-danger" *ngIf="!selectModel.lname">
{{'Please fill in information' | translate}}
</div>
</div> -->
<!-- <div class="xl:col-span-12 col-span-12">
<label for="position" class="form-label">{{'ที่อยู่' | translate}}</label>
<textarea class="form-control" id="position" placeholder="" [(ngModel)]="selectModel.position">
</textarea>
<app-rendered-html class="small-html" [htmlContent]="selectModel.position" *ngIf="action === 'edit'">
</app-rendered-html>
</div> -->
<!-- <div class="xl:col-span-6 col-span-12">
<label for="bu1" class="form-label">{{'ชื่อเจ้าของ' | translate}}</label>
<input type="text" class="form-control" id="bu1" placeholder=""
[(ngModel)]="selectModel.bu1">
</div> -->
<!-- <div class="xl:col-span-6 col-span-12">
<label for="thLastnameContact" class="form-label">{{'นามสกุลเจ้าของ' | translate}}</label>
<input type="text" class="form-control" id="thLastnameContact" placeholder=""
[(ngModel)]="selectModel.thLastnameContact">
</div> -->
<!-- <div class="xl:col-span-12 col-span-12">
<label for="phoneContact" class="form-label">{{'เบอร์ติดต่อ' | translate}}</label>
<input type="text" class="form-control" id="phoneContact" placeholder=""
[(ngModel)]="selectModel.phoneContact">
</div> -->
<div class="xl:col-span-12 col-span-12">
<label class="form-label">{{'Status' | translate}}</label>
<ng-select name="statusSelect" id="statusSelect" placeholder="" [(ngModel)]="selectModel.status">
<ng-option [value]="0">{{'Pending' | translate}}</ng-option>
<ng-option [value]="1">{{'Public' | translate}}</ng-option>
</ng-select>
</div>
<!-- Change Password Section -->
<div class="xl:col-span-12 col-span-12" *ngIf="action === 'edit'">
<hr class="my-4 border-gray-200 dark:border-white/10">
<div class="flex justify-end">
<button type="button" (click)="togglePasswordFields()" class="ti-btn ti-btn-link text-primary !p-0">
{{ (showPasswordFields ? ('Cancel' | translate) : ('Change Password' | translate)) }}
</button>
</div>
</div>
<ng-container *ngIf="showPasswordFields && action === 'edit'">
<div class="xl:col-span-6 col-span-12">
<label for="newPassword" class="form-label">{{'Password' | translate}}</label>
<div class="relative">
<input [type]="newPasswordVisible ? 'text' : 'password'" class="form-control" id="newPassword" placeholder="{{'Enter new password' | translate}}" [(ngModel)]="newPassword">
<button type="button" class="absolute top-1/2 end-3 -translate-y-1/2" (click)="newPasswordVisible = !newPasswordVisible">
<i class="ri-eye-line" *ngIf="!newPasswordVisible"></i>
<i class="ri-eye-off-line" *ngIf="newPasswordVisible"></i>
</button>
</div>
<div class="text-danger" *ngIf="!newPassword">
{{ 'Please fill in information' | translate }}
</div>
<!-- <div class="text-danger text-xs mt-1" *ngIf="newPassword && newPassword.length < 8">
{{ 'Password must be at least 8 characters' | translate }}
</div> -->
</div>
<div class="xl:col-span-6 col-span-12">
<label for="confirmNewPassword" class="form-label">{{'Confirm Password' | translate}}</label>
<div class="relative">
<input [type]="confirmNewPasswordVisible ? 'text' : 'password'" class="form-control" id="confirmNewPassword" placeholder="{{'Confirm new password' | translate}}" [(ngModel)]="confirmNewPassword">
<button type="button" class="absolute top-1/2 end-3 -translate-y-1/2" (click)="confirmNewPasswordVisible = !confirmNewPasswordVisible">
<i class="ri-eye-line" *ngIf="!confirmNewPasswordVisible"></i>
<i class="ri-eye-off-line" *ngIf="confirmNewPasswordVisible"></i>
</button>
</div>
<div class="text-danger" *ngIf="!confirmNewPassword">
{{ 'Please fill in information' | translate }}
</div>
<div class="text-danger text-xs mt-1" *ngIf="confirmNewPassword && (confirmNewPassword != newPassword)">
{{'Password Not Match' | translate}}
</div>
</div>
</ng-container>
</div>
</div>
<div class="ti-modal-footer">
<button type="button" class="hs-dropdown-toggle ti-btn ti-btn-light align-middle"
data-hs-overlay="#modal-detail">
{{'Cancel' | translate}}
</button>
<button *ngIf="action === 'add'" type="button" (click)="save()"
class="ti-btn bg-primary text-white !font-medium" [class.ti-btn-disabled]="!selectModel.fname||
!selectModel.engName ||
!password || !confirmPassword || (confirmPassword !== password) ||
(!selectModel.email || isEmailDuplicate || !selectModel.email.includes('@') || !selectModel.email.includes('.'))"
[disabled]="!selectModel.fname||
!selectModel.engName ||
!password || !confirmPassword || (confirmPassword !== password) ||
(!selectModel.email || isEmailDuplicate || !selectModel.email.includes('@') || !selectModel.email.includes('.'))">
{{'Save' | translate}}</button>
<button *ngIf="action === 'edit'" type="button" (click)="save()"
class="ti-btn bg-primary text-white !font-medium"
[class.ti-btn-disabled]="!selectModel.fname||
!selectModel.engName ||
(!selectModel.email || isEmailDuplicate || !selectModel.email.includes('@') || !selectModel.email.includes('.'))"
[disabled]="!selectModel.fname||
!selectModel.engName ||
(!selectModel.email || isEmailDuplicate || !selectModel.email.includes('@') || !selectModel.email.includes('.'))">
{{'Save' | translate}}</button>
</div>
</div>
</div>
</div>
/* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { PermissionEmployeelistComponent } from './permission-employeelist.component';
describe('PermissionEmployeelistComponent', () => {
let component: PermissionEmployeelistComponent;
let fixture: ComponentFixture<PermissionEmployeelistComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ PermissionEmployeelistComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(PermissionEmployeelistComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { NgSelectModule } from '@ng-select/ng-select';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { SharedModule } from '../../../shared/shared.module';
import { CommonModule } from '@angular/common';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import swal from 'sweetalert';
import { MatPaginator } from '@angular/material/paginator';
import { FileItem, FileUploader, FileUploadModule, ParsedResponseHeaders } from "ng2-file-upload";
import { environment } from '../../../../environments/environment';
import { TokenService } from '../../../shared/services/token.service';
import { UserService } from '../../services/user.service';
import { AuthModel } from '../../models/auth.model';
import { RoleModel } from '../../models/role.model';
import { Observable, forkJoin } from 'rxjs';
import { PermissionModel, PermissionModel2, PermissionModel2 as PermissionModel2_1 } from '../../models/permission/permission.model';
import { PermissionService } from '../../services/permission/permission.service';
@Component({
selector: 'app-permission-employeelist',
templateUrl: './permission-employeelist.component.html',
styleUrls: ['./permission-employeelist.component.css'],
standalone: true,
imports: [
CommonModule,
SharedModule,
TranslateModule,
NgSelectModule,
FormsModule,
RouterModule,
FileUploadModule
]
})
export class PermissionEmployeelistComponent implements OnInit {
@ViewChild('closeModal') public childModal?: ElementRef;
@ViewChild('modalDetail') public modalDetail?: ElementRef;
@ViewChild('profileChangeInput') profileChangeInputRef!: ElementRef;
action = "new";
allSelected = false;
someSelected = false;
itemsList: PermissionModel2[] = [];
filterList: PermissionModel2[] = [];
selectModel: any = {};
selectedItems = new Map<string, boolean>();
existingEmails: PermissionModel2[] = []
// empList: PermissionModel2[] = [];
// descName = 'engName';
pageIndex = 0;
pageSize = 10;
totalCount = 0;
totalPages = 1;
pagedList: PermissionModel2[] = [];
uploaderProfile: FileUploader | undefined;
uploadErrorMsg: string = "";
password: string = '';
confirmPassword = ""
isEmailDuplicate = false;
showPasswordFields = false;
newPassword = '';
confirmNewPassword = '';
newPasswordVisible = false;
confirmNewPasswordVisible = false;
get searchTerm(): string {
return this._searchTerm;
}
set searchTerm(val: string) {
this.pageIndex = 0;
this.allSelected = false;
this._searchTerm = val;
if (val != '') {
this.filterList = this.filter(val);
} else {
this.filterList = this.itemsList.slice(); // ให้กลับมาเป็นทั้งหมด
}
this.onSearchChange(); // ← อัปเดตเพจทุกครั้ง
}
_searchTerm = "";
constructor(
private permissionService: PermissionService,
private userService: UserService,
public translate: TranslateService,
private tokenService: TokenService
) {
// this.uploadConfig();
}
togglePasswordFields() {
this.showPasswordFields = !this.showPasswordFields;
if (!this.showPasswordFields) {
this.newPassword = '';
this.confirmNewPassword = '';
}
}
// uploadConfig() {
// this.uploaderProfile = new FileUploader({
// url: environment.baseUrl + "/files/upload-image",
// isHTML5: true,
// authToken: this.tokenService.getToken()!,
// });
// this.uploaderProfile.onAfterAddingFile = (fileItem: FileItem) => {
// fileItem.withCredentials = false;
// this.uploadErrorMsg = "";
// while (this.uploaderProfile!.queue.length > 1) {
// this.uploaderProfile!.queue[0].remove();
// }
// if (fileItem.file.size > 5000000) {
// this.uploadErrorMsg = "maximum file size 5mb.";
// swal("Opp!!", "ไม่สามารถอัพโหลดได้", "info");
// fileItem.isCancel = true;
// return;
// }
// if (fileItem.file.type!.indexOf("image") === -1) {
// this.uploadErrorMsg = "please upload image only.";
// swal("Opp!!", "ไม่สามารถอัพโหลดได้", "info");
// fileItem.isCancel = true;
// return;
// }
// fileItem.upload();
// };
// this.uploaderProfile.onCompleteItem = (
// item: FileItem,
// response: string,
// status: number,
// headers: ParsedResponseHeaders
// ) => {
// if (item.isSuccess) {
// const res = JSON.parse(response);
// console.log("res", res);
// // this.selectModel.photoGraph = res.resultObject;
// swal(res.message, "บันทึกสำเร็จ", "success");
// } else {
// this.uploadErrorMsg = "cannot upload file.";
// swal("Opp!!", "ไม่สามารถอัพโหลดได้", "info");
// }
// };
// }
getEmployeeList() {
// this.permissionService.getListEmpWorkingObserve(this.pageSize, this.pageIndex).subscribe(
// (response: PermissionModel2[]) => {
// this.itemsList = response; // Directly assign the response
// this.filterList = this.itemsList.slice();
// this.updatePagedItems();
// },
// error: (error) => {
// console.error('error cant get company', error);
// swal("ข้อผิดพลาด", "ไม่สามารถดึงข้อมูลพนักงานได้", "error");
// }
// );
}
ngOnInit(): void {
this.getEmployeeList();
}
// onEmailChange(email: string) {
// const lowerEmail = email.trim().toLowerCase();
// this.isEmailDuplicate = this.existingEmails.some(
// user => user.email && user.email.toLowerCase() === lowerEmail
// );
// }
filter(v: string) {
return this.itemsList?.filter(
(x) =>
x.employeeId?.toLowerCase().indexOf(v.toLowerCase()) !== -1 ||
x.fname?.toLowerCase().indexOf(v.toLowerCase()) !== -1 ||
x.lname?.toLowerCase().indexOf(v.toLowerCase()) !== -1 ||
x.position?.tdesc?.toLowerCase().indexOf(v.toLowerCase()) !== -1
);
}
// delete(item: PermissionModel2) {
// swal({
// title: "คุณแน่ใจหรือไม่?",
// text: "คุณจะไม่สามารถกู้คืนข้อมูลนี้ได้!",
// icon: "warning",
// dangerMode: true,
// buttons: ["ยกเลิก", "ใช่, ลบเลย!"],
// })
// .then((willDelete: any) => {
// if (willDelete) {
// this.permissionService.put(item).subscribe(result => {
// swal("ลบสำเร็จ!!", "ลบข้อมูลสำเร็จ", "success");
// this.ngOnInit();
// }, error => {
// console.error("เกิดข้อผิดพลาดในการลบ:", error);
// swal("ข้อผิดพลาด!!", "ไม่สามารถลบข้อมูลได้", "error");
// });
// }
// });
// }
new() {
this.action = 'add';
// this.selectModel = new PermissionModel();
this.selectModel.status = 1;
this.selectModel.position = "";
this.selectModel.latitude = "";
this.selectModel.longitude = "";
this.selectModel.photoGraph = "";
this.selectModel.fname = "";
this.selectModel.employeeId = "";
this.selectModel.lname = "";
this.selectModel.thFirstnameContact = "";
this.selectModel.updatedAt = new Date().toISOString();
this.password = '';
this.confirmPassword = '';
this.showPasswordFields = false;
this.newPassword = '';
this.confirmNewPassword = '';
}
view(item: PermissionModel2) {
this.action = 'edit';
// this.selectModel = new PermissionModel2(item);
this.showPasswordFields = false;
this.newPassword = '';
this.confirmNewPassword = '';
console.log(this.selectModel);
}
// save() {
// swal({
// title: "คุณแน่ใจหรือไม่?",
// text: "คุณต้องการบันทึกหรือไม่",
// icon: "warning",
// dangerMode: false,
// buttons: ["ยกเลิก", "ยืนยัน"],
// })
// .then((willSave: any) => {
// if (willSave) {
// if (this.action === 'add') {
// const body = new AuthModel();
// body.username = this.selectModel.email;
// body.password = this.password;
// body.role = new RoleModel({ roleId: 'employer' });
// const rawCompany = { ...this.selectModel };
// body.company = new PermissionModel(rawCompany);
// body.company.status = 1; // Fix status to 1 on creation
// this.userService.registerCompany(body).subscribe({
// next: res => {
// swal("Save Success!!", "บันทึกข้อมูลบริษัท", "success");
// // Optimistic UI Update
// const newCompany = new PermissionModel(this.selectModel, this.translate);
// newCompany.status = 1; // Ensure status is 1 in the UI as well
// this.itemsList.unshift(newCompany);
// this.filterList.unshift(newCompany);
// this.updatePagedItems();
// this.childModal?.nativeElement.click();
// },
// error: err => {
// console.error('Error response:', err);
// const errorMessage = err?.error?.message || err?.message || 'ไม่ทราบสาเหตุ';
// if (errorMessage.includes('email')) {
// swal("Save Failed", "อีเมลซ้ำหรือไม่ถูกต้อง", "warning");
// } else {
// swal("Error", errorMessage, "error");
// }
// }
// });
// } else if (this.action === 'edit') {
// const observables: Observable<any>[] = [];
// // Observable for updating company details
// // observables.push(this.permissionService.saveOrUpdateCompany(this.selectModel));
// // Check if password needs to be updated
// if (this.showPasswordFields && this.newPassword && this.newPassword.length >= 8 && this.newPassword === this.confirmNewPassword) {
// const authData = new AuthModel();
// authData.username = this.selectModel.email;
// authData.password = this.newPassword;
// authData.company = new PermissionModel2({ employeeId: this.selectModel.employeeId });
// // Observable for updating password
// observables.push(this.userService.editPasswordCompany(authData));
// } else if (this.showPasswordFields && (this.newPassword || this.confirmNewPassword)) {
// // If password fields are shown but validation fails, show an error and stop.
// swal("Invalid Password", "Please ensure passwords match and are at least 8 characters long.", "warning");
// return; // Stop the save process
// }
// forkJoin(observables).subscribe({
// next: results => {
// swal("Update Success!!", "บันทึกข้อมูลบริษัทเรียบร้อยแล้ว", "success");
// this.ngOnInit();
// this.childModal?.nativeElement.click();
// },
// error: err => {
// console.error('Update failed:', err);
// swal("Error", "เกิดข้อผิดพลาดในการอัปเดตข้อมูล", "error");
// }
// });
// }
// }
// });
// }
updatePagedItems() {
this.totalCount = this.filterList.length;
this.totalPages = Math.max(1, Math.ceil(this.totalCount / this.pageSize));
const startIndex = this.pageIndex * this.pageSize;
const endIndex = startIndex + this.pageSize;
this.pagedList = this.filterList.slice(startIndex, endIndex);
}
toggleAll(event: any) {
this.allSelected = event.target.checked;
this.selectedItems.clear();
this.itemsList.forEach(item => {
this.selectedItems.set(item.employeeId, this.allSelected);
});
this.someSelected = this.itemsList.some(item => this.selectedItems.get(item.employeeId));
}
onCheckboxChange(employeeId: string) {
const isSelected = this.selectedItems.get(employeeId) || false;
this.selectedItems.set(employeeId, !isSelected);
this.allSelected = this.itemsList.every(item => this.selectedItems.get(item.employeeId));
this.someSelected = this.itemsList.some(item => this.selectedItems.get(item.employeeId));
}
// deleteSelect() {
// let employerInfo = '';
// this.selectedItems.forEach((isSelected, employeeId) => {
// if (isSelected) {
// const com = this.itemsList.find(com => com.employeeId === employeeId);
// if (com) {
// employerInfo += `${this.translate.instant('Fullname')}: ${com.getName()}\n`;
// }
// }
// });
// swal({
// title: "Are you sure?",
// text: employerInfo,
// icon: "warning",
// dangerMode: true,
// buttons: ["Cancel", "Yes, Delete it!"],
// })
// .then((willDelete: any) => {
// if (willDelete) {
// this.selectedItems.forEach((isSelected, employeeId) => {
// if (isSelected) {
// const com = this.itemsList.find(com => com.employeeId === employeeId);
// if (com) {
// this.permissionService.put(com).subscribe(result => {
// swal("Save Success!!", "บันทึกข้อมูลสำเร็จ", "success");
// this.ngOnInit();
// });
// }
// }
// });
// }
// });
// }
// adjustSelect(status: number) {
// let title = "คุณแน่ใจหรือไม่?";
// let companyInfo = '';
// const selectedCompanies: PermissionModel2[] = [];
// this.selectedItems.forEach((isSelected, employeeId) => {
// if (isSelected) {
// const company = this.itemsList.find(c => c.employeeId === employeeId);
// if (company) {
// companyInfo += `${this.translate.instant('ชื่อบริษัท')}: ${company.fname}\n`;
// selectedCompanies.push(company);
// }
// }
// });
// if (selectedCompanies.length === 0) {
// swal("ข้อผิดพลาด", "กรุณาเลือกบริษัทที่ต้องการปรับสถานะ", "warning");
// return;
// }
// swal({
// title: title,
// text: companyInfo,
// icon: "warning",
// dangerMode: false,
// buttons: ["ยกเลิก", "ยืนยัน"],
// })
// .then((willAdjust: any) => {
// if (willAdjust) {
// const updatePromises = selectedCompanies.map(company => {
// company.status = status;
// console.log(company);
// const respone = new PermissionModel2(company);
// return this.permissionService.saveOrUpdateCompany(respone).toPromise()
// .then(() => true)
// .catch(error => {
// console.error(`Error updating status for company ${company.employeeId}:`, error);
// return false;
// });
// });
// Promise.all(updatePromises)
// .then(results => {
// const allSuccessful = results.every(success => success);
// if (allSuccessful) {
// swal("บันทึกสำเร็จ!!", "บันทึกข้อมูลสำเร็จ", "success");
// } else {
// swal("สำเร็จบางส่วน/ข้อผิดพลาด!!", "มีการอัปเดตสถานะบางส่วนไม่สำเร็จ หรือมีข้อผิดพลาด", "warning");
// }
// this.ngOnInit();
// this.selectedItems.clear();
// this.allSelected = false;
// this.someSelected = false;
// });
// }
// });
// }
triggerFileInput(): void {
if (this.profileChangeInputRef) {
this.profileChangeInputRef.nativeElement.click();
}
}
filterEngInput(event: any): void {
const input = event.target.value;
const filtered = input.replace(/[^a-zA-Z0-9 @\/.,!?()\-_:*%&$#"]/g, '');
event.target.value = filtered;
}
onSearchChange() {
this.pageIndex = 0;
this.updatePagedItems();
}
get pages(): number[] {
return Array.from({ length: this.totalPages }, (_, i) => i);
}
get showingEnd(): number {
return Math.min((this.pageIndex + 1) * this.pageSize, this.totalCount);
}
goPrev() {
if (this.pageIndex > 0) {
this.pageIndex--;
this.updatePagedItems();
}
}
goNext() {
if (this.pageIndex < this.totalPages - 1) {
this.pageIndex++;
this.updatePagedItems();
}
}
goTo(p: number) {
if (p >= 0 && p < this.totalPages && p !== this.pageIndex) {
this.pageIndex = p;
this.updatePagedItems();
}
}
}
<div class="container mx-auto p-4">
<h1 class="text-2xl font-bold mb-4">{{ 'ROLE_BASED_ACCESS_CONTROL' | translate }}</h1>
<div *ngIf="roles$ | async as roles" class="mat-elevation-z8 bg-white rounded-lg overflow-hidden">
<table mat-table [dataSource]="roles" class="w-full">
<!-- Name Column -->
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef class="p-4 text-left text-sm font-semibold text-gray-600 uppercase tracking-wider">{{ 'ROLE_NAME' | translate }}</th>
<td mat-cell *matCellDef="let role" class="p-4 whitespace-nowrap text-sm text-gray-800"> {{role.name}} </td>
</ng-container>
<!-- Description Column -->
<ng-container matColumnDef="description">
<th mat-header-cell *matHeaderCellDef class="p-4 text-left text-sm font-semibold text-gray-600 uppercase tracking-wider">{{ 'DESCRIPTION' | translate }}</th>
<td mat-cell *matCellDef="let role" class="p-4 text-sm text-gray-500"> {{role.description}} </td>
</ng-container>
<!-- Actions Column -->
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef class="p-4 text-left text-sm font-semibold text-gray-600 uppercase tracking-wider">{{ 'ACTIONS' | translate }}</th>
<td mat-cell *matCellDef="let role" class="p-4 whitespace-nowrap text-sm font-medium">
<button mat-icon-button color="primary" (click)="navigateToEdit(role.id)" [attr.aria-label]="'EDIT_PERMISSIONS' | translate">
<mat-icon>edit</mat-icon>
</button>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
</div>
</div>
\ No newline at end of file
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { Role } from '../permission.model';
import { PermissionService } from '../permission.service';
import { Router, RouterModule } from '@angular/router';
// Core Angular & Material imports
import { CommonModule } from '@angular/common';
import { MatTableModule } from '@angular/material/table';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
// Translation
import { TranslateModule } from '@ngx-translate/core';
@Component({
selector: 'app-permission-list',
standalone: true,
imports: [
CommonModule,
RouterModule,
MatTableModule,
MatButtonModule,
MatIconModule,
TranslateModule
],
templateUrl: './permission-list.component.html',
styleUrls: ['./permission-list.component.scss']
})
export class PermissionListComponent implements OnInit {
roles$!: Observable<Role[]>;
displayedColumns: string[] = ['name', 'description', 'actions'];
constructor(
private permissionService: PermissionService,
private router: Router
) { }
ngOnInit(): void {
this.roles$ = this.permissionService.getRoles();
}
navigateToEdit(roleId: string): void {
this.router.navigate(['/portal-manage/permission-management/edit', roleId]);
}
}
import { Routes } from '@angular/router'; import { Routes } from '@angular/router';
import { PermissionListComponent } from './permission-list/permission-list.component'; import { PermissionEmployeelistComponent } from './permission-employeelist/permission-employeelist.component';
import { PermissionEditComponent } from './permission-edit/permission-edit.component';
export const PERMISSION_ROUTES: Routes = [ export const PERMISSION_ROUTES: Routes = [
{ {
path: '', path: '',
component: PermissionListComponent, component: PermissionEmployeelistComponent,
pathMatch: 'full', children: [
data: { title: 'Permission Management' } {
}, path: 'permission-employeelist',
{ loadComponent: () =>
path: 'edit/:roleId', import('./permission-employeelist/permission-employeelist.component').then((m) => m.PermissionEmployeelistComponent),
component: PermissionEditComponent, },
data: { title: 'Edit Permissions' } ]
} }
]; ];
import { Injectable } from '@angular/core';
import * as CryptoJS from 'crypto-js';
@Injectable({
providedIn: 'root'
})
export class EncodeCyptoService {
tokenFromUI: string = "S3c5et@3$#m7H5MYHRPLUS@SERVICE$KEYPASS";
encrypted: any = "";
decrypted: any = "";
constructor() { }
encryptUsingAES256(plainText: string) {
// var salt = CryptoJS.lib.WordArray.random(128 / 8);
// var key = this.generateKey(salt, this.tokenFromUI);
// var iv = CryptoJS.lib.WordArray.random(128 / 8);
// var encrypted = CryptoJS.AES.encrypt(
// plainText,
// key, {
// iv: iv,
// padding: CryptoJS.pad.Pkcs7,
// mode: CryptoJS.mode.CBC
// });
// var swap_encrypted = encrypted.toString().replace(/\+/g, 'xMl3Jk').replace(/\//g, 'Por21Ld').replace(/\=/g, 'Ml32')
// this.encrypted = salt.toString() + iv.toString() + swap_encrypted;
return plainText
}
decryptUsingAES256(plainText: string) {
// var salt =CryptoJS.enc.Hex.parse(plainText.substr(0, 32));
// var iv = CryptoJS.enc.Hex.parse(plainText.substr(32, 32));
// var _encrypted = plainText.substring(64);
// var swap_encrypted=_encrypted.toString().replace(/\xMl3Jk/g,'+').replace(/\Por21Ld/g,'/').replace(/\Ml32/g,'=');
// var key = this.generateKey(salt, this.tokenFromUI);
// this.decrypted = CryptoJS.AES.decrypt(swap_encrypted, key, {
// iv: iv,
// padding: CryptoJS.pad.Pkcs7,
// mode: CryptoJS.mode.CBC
// }).toString(CryptoJS.enc.Utf8);
// console.log("decrpted",this.decrypted)
return plainText
}
generateKey(salt, passPhrase) {
let keySize = 256 / 32;
let iterationCount = 100;
var key = CryptoJS.PBKDF2(passPhrase, salt,
{ keySize: keySize, iterations: iterationCount });
return key;
}
}
import { Permission } from './../../models/user-role.model';
import { Injectable } from '@angular/core';
import { environment } from '../../../../environments/environment';
import { Observable, zip } from 'rxjs';
import { HttpClient } from '@angular/common/http';
import { Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { DatePipe } from '@angular/common';
import { map, tap } from 'rxjs/operators';
import {EncodeCyptoService} from './encode-cypto.service';
import {PermissionModel} from './../../models/permission/permission.model';
@Injectable({
providedIn: 'root'
})
export class PermissionService {
lang: string = "";
urlApiplus: string = "https://hrplus.myhr.co.th/plus";
private BASE_PATH: string = this.urlApiplus + '/dashboard';
private uprofile: Observable<PermissionModel> | undefined;
urlApi = this.urlApiplus
constructor(
private http: HttpClient,
private router: Router,
private translateService: TranslateService,
private datePipe: DatePipe,
private cyptoService: EncodeCyptoService
) { }
getListEmpWorkingObserve(sizePage: number, page: number): Observable<PermissionModel[]> {
return this.http
.get<PermissionModel[]>(
this.urlApi + '/employee/workings/mini?page=' + page + '&size=' + sizePage
)
}
}
...@@ -293,7 +293,7 @@ export class SidebarComponent { ...@@ -293,7 +293,7 @@ export class SidebarComponent {
} else if (this.isMenuPermissionManagementRoute){ } else if (this.isMenuPermissionManagementRoute){
this.menuItems = this.navServices.getSystemManagementMenu(); this.menuItems = this.navServices.getSystemManagementMenu();
} else if (this.isMeetingBookingRoute){ } else if (this.isMeetingBookingRoute){
this.menuItems = this.navServices.getSystemManagementMenu(); this.menuItems = this.navServices.getMeetingBookingMenu();
} else if (this.isWidgetWarehouseRoute || this.isWidgetLinkerRoute){ } else if (this.isWidgetWarehouseRoute || this.isWidgetLinkerRoute){
// สำหรับ widget-warehouse และ widget-linker ใช้เมนูตามแอปที่อยู่ใน URL // สำหรับ widget-warehouse และ widget-linker ใช้เมนูตามแอปที่อยู่ใน URL
const appName = this.extractAppNameFromUrl(this.currentUrl); const appName = this.extractAppNameFromUrl(this.currentUrl);
......
...@@ -36,6 +36,10 @@ export class HttpRequestInterceptor { ...@@ -36,6 +36,10 @@ export class HttpRequestInterceptor {
token = `Bearer ${this.tokenService.getAppToken()}`; token = `Bearer ${this.tokenService.getAppToken()}`;
} }
if (fullUrl.startsWith('https://hrplus.myhr.co.th')) {
token = `Bearer ${this.tokenService.getToken()}`;
}
let authReq = req.clone({ url: fullUrl }); let authReq = req.clone({ url: fullUrl });
if (token) { if (token) {
......
...@@ -464,44 +464,31 @@ export class NavService implements OnDestroy { ...@@ -464,44 +464,31 @@ export class NavService implements OnDestroy {
return [ return [
{ headTitle: 'การตั้งค่าระบบ' }, { headTitle: 'การตั้งค่าระบบ' },
{ {
title: 'my-Portal',
icon: 'upload-cloud',
path: '/portal-manage/my-portal',
type: 'link',
},
{
title: 'จัดการสิทธิ์', title: 'จัดการสิทธิ์',
icon: 'shield', icon: 'shield',
type: 'sub', type: 'sub',
active: false, active: false,
children: [ children: [
{ path: '/portal-manage/permission-management', title: 'จัดการสิทธิ์และบทบาท', type: 'link' }, { path: '/portal-manage/permission-management/permission-employeelist', title: 'จัดการสิทธิ์และบทบาท', type: 'link' },
{ path: '/portal-manage/menu-permission-management', title: 'จัดการสิทธิ์เมนู', type: 'link' }, // { path: '/portal-manage/menu-permission-management', title: 'จัดการสิทธิ์เมนู', type: 'link' },
{ path: '/portal-manage/user-role-management', title: 'จัดการผู้ใช้และบทบาท', type: 'link' }, // { path: '/portal-manage/user-role-management', title: 'จัดการผู้ใช้และบทบาท', type: 'link' },
],
},
{
title: 'จัดการแดชบอร์ดและวิดเจ็ต',
icon: 'dashboard',
type: 'sub',
active: false,
children: [
{ path: '/portal-manage/dashboard-management/dashboard-home', title: 'แดชบอร์ดหลัก', type: 'link' },
{ path: '/portal-manage/dashboard-management/widget-list', title: 'รายการวิดเจ็ต', type: 'link' },
{ path: '/portal-manage/dashboard-management/dataset-widget-linker', title: 'เชื่อมโยงข้อมูลกับวิดเจ็ต', type: 'link' },
{ path: '/portal-manage/dashboard-management/widget-config', title: 'ตั้งค่าวิดเจ็ต', type: 'link' },
{ path: '/portal-manage/dashboard-management/dashboard-viewer', title: 'ดูแดชบอร์ด', type: 'link' },
], ],
}, },
];
}
// เมนูสำหรับการจองห้องประชุม
getMeetingBookingMenu() {
return [
{ headTitle: 'ระบบจองห้องประชุม' },
{ {
title: 'การบริการ', title: 'ระบบจองห้องประชุม',
icon: 'service', icon: 'room-booking',
type: 'sub', type: 'sub',
active: false, active: false,
children: [ children: [
{ path: '/portal-manage/meeting-booking', title: 'จองห้องประชุม', type: 'link' }, { path: '/portal-manage/meeting-booking', title: 'จองห้องประชุม', type: 'link' },
], ],
} },
]; ];
} }
...@@ -595,11 +582,12 @@ export class NavService implements OnDestroy { ...@@ -595,11 +582,12 @@ export class NavService implements OnDestroy {
case 'dashboard-management': case 'dashboard-management':
return this.getDashboardManagementMenu(); return this.getDashboardManagementMenu();
case 'meeting-booking': case 'meeting-booking':
return this.getSystemManagementMenu(); return this.getMeetingBookingMenu();
case 'permission-management': case 'permission-management':
case 'menu-permission-management':
case 'user-role-management':
return this.getSystemManagementMenu(); return this.getSystemManagementMenu();
// case 'menu-permission-management':
// case 'user-role-management':
// return this.getSystemManagementMenu();
default: default:
return []; return [];
} }
...@@ -619,10 +607,10 @@ export class NavService implements OnDestroy { ...@@ -619,10 +607,10 @@ export class NavService implements OnDestroy {
'company-management': this.getCompanyMenu(), 'company-management': this.getCompanyMenu(),
'dashboard': this.getDashboardMenu(), 'dashboard': this.getDashboardMenu(),
'dashboard-management': this.getDashboardManagementMenu(), 'dashboard-management': this.getDashboardManagementMenu(),
'meeting-booking': this.getSystemManagementMenu(), 'meeting-booking': this.getMeetingBookingMenu(),
'permission-management': this.getSystemManagementMenu(), 'permission-management': this.getSystemManagementMenu(),
'menu-permission-management': this.getSystemManagementMenu(), // 'menu-permission-management': this.getSystemManagementMenu(),
'user-role-management': this.getSystemManagementMenu(), // 'user-role-management': this.getSystemManagementMenu(),
}; };
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment