Commit 490595c0 by sawit

module myhr-lite

parent a728aeef
/* 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 { DashboardComponent } from './dashboard.component';
describe('DashboardComponent', () => {
let component: DashboardComponent;
let fixture: ComponentFixture<DashboardComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ DashboardComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(DashboardComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
standalone: true,
selector: 'app-dashboard',
templateUrl: './dashboard.component.html',
styleUrls: ['./dashboard.component.css']
})
export class DashboardComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MyhrLiteComponent } from './myhr-lite.component';
import { RouterModule, Routes } from '@angular/router';
export const myhrlite: Routes = [
{
path: "myhr-lite", children:[
{
path: 'dashboard',
loadComponent: () =>
import('./dashboard/dashboard.component').then((m) => m.DashboardComponent),
},
]
}
]
@NgModule({
imports: [
CommonModule
CommonModule,
RouterModule.forChild(myhrlite),
],
declarations: [MyhrLiteComponent]
declarations: [MyhrLiteComponent],
exports: [RouterModule],
})
export class MyhrLiteModule { }
export class MyhrLiteModule {
static routes = myhrlite;
}
......@@ -313,7 +313,7 @@
</div>
<div class="">
<a routerLink="/admin"
<a routerLink="/myhr-lite/dashboard"
class="p-4 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20">
<img src="./assets/images/logoallHR/myHR-Lite-logo-new.png" alt="miscrosoft"
class="leading-[1.75] text-2xl !h-[1.75rem] align-middle flex justify-center mx-auto">
......
......@@ -7,6 +7,7 @@
<img *ngIf="isMyportalRoute" src="./assets/images/logoallHR/mySkill-x.png" alt="logo" width="100%">
<img *ngIf="isMylearnRoute" src="./assets/images/logoallHR/mylearn-logo.png" alt="logo" width="100%">
<img *ngIf="isMyJobRoute" src="./assets/images/brand-logos/logo.png" alt="logo" width="100%">
<img *ngIf="isMyhrLiteRoute" src="./assets/images/logoallHR/myHR-Lite-logo-new.png" alt="logo" width="100%">
</a>
......
......@@ -72,6 +72,7 @@ export class SidebarComponent {
isMyportalRoute: boolean = false;
isMylearnRoute: boolean = false;
isMyJobRoute: boolean = false;
isMyhrLiteRoute: boolean = false;
previousUrl: string = '';
currentUrl: string = '';
......@@ -113,6 +114,7 @@ export class SidebarComponent {
this.isMyportalRoute = this.currentUrl.includes('/myportal');
this.isMylearnRoute = this.currentUrl.includes('/mylearn');
this.isMyJobRoute = this.currentUrl.includes('/myjob');
this.isMyhrLiteRoute = this.currentUrl.includes('/myhr-lite');
this.menuitemsSubscribe$ = this.navServices.items.subscribe((items) => {
this.changeMenu()
});
......@@ -142,8 +144,9 @@ export class SidebarComponent {
this.isCommonRoute = this.currentUrl.includes('/admin');
this.isInstallerRoute = this.currentUrl.includes('/company');
this.isMyportalRoute = this.currentUrl.includes('/myportal');
this.isMylearnRoute = this.currentUrl.includes('/mylearn')
this.isMyJobRoute = this.currentUrl.includes('/myjob')
this.isMylearnRoute = this.currentUrl.includes('/mylearn');
this.isMyJobRoute = this.currentUrl.includes('/myjob');
this.isMyhrLiteRoute = this.currentUrl.includes('/myhr-lite');
this.checkUrlChanges()
// Log to console for verification
console.log('Initial URL:', this.currentUrl);
......@@ -151,6 +154,7 @@ export class SidebarComponent {
console.log('Is Installer Route:', this.isInstallerRoute);
console.log('Is Myportal Route:', this.isMyportalRoute);
console.log('mylearn routes',this.isMylearnRoute);
console.log('myhrlite routes',this.isMyhrLiteRoute);
}
......@@ -171,7 +175,8 @@ export class SidebarComponent {
(this.previousUrl.includes('/admin') && this.currentUrl.includes('/company')) ||
(this.previousUrl.includes('/myprotal')&& this.currentUrl.includes('/myprotal')) ||
(this.previousUrl.includes('/mylearn')&& this.currentUrl.includes('/mylearn')) ||
(this.previousUrl.includes('/myjob')&& this.currentUrl.includes('/myjob'))
(this.previousUrl.includes('/myjob')&& this.currentUrl.includes('/myjob')) ||
(this.previousUrl.includes('/myhr-lite')&& this.currentUrl.includes('/myhr-lite'))
) {
console.log('URL changed between /installer and /admin.');
// Implement any logic needed when changing between /installer and /admin
......@@ -183,6 +188,7 @@ export class SidebarComponent {
this.isMyportalRoute = this.currentUrl.includes('/myportal');
this.isMylearnRoute = this.currentUrl.includes('/mylearn');
this.isMyJobRoute = this.currentUrl.includes('/myjob');
this.isMyhrLiteRoute = this.currentUrl.includes('/myhr-lite');
// Log to console for verification
console.log('Current URL:', this.currentUrl);
......@@ -213,6 +219,8 @@ export class SidebarComponent {
this.menuItems = this.navServices.getMylearnMenu();
} else if (this.isMyJobRoute){
this.menuItems = this.navServices.getMyJobMenu();
} else if (this.isMyhrLiteRoute){
this.menuItems = this.navServices.getMyhrLiteMenu();
}else{
this.menuItems = this.navServices.getCommonMenu()
}
......
......@@ -31,6 +31,7 @@ import { CompanyManagementModule } from '../../DPU/company-management/company-ma
import { MyskillXModule } from '../../DPU/myskill-x/myskill-x.module';
import { MylearnModule } from '../../DPU/mylearn/mylearn.module';
import { MyjobModule } from '../../DPU/myjob/myjob.module';
import { MyhrLiteModule } from '../../DPU/myhr-lite/myhr-lite.module';
export const content: Routes = [
......@@ -68,6 +69,7 @@ export const content: Routes = [
...MyskillXModule.routes,
...MylearnModule.routes,
...MyjobModule.routes,
...MyhrLiteModule.routes,
]
}
......
......@@ -340,5 +340,18 @@ export class NavService implements OnDestroy {
];
}
getMyhrLiteMenu() {
return [
// myHR-Lite
{ headTitle: 'Myhr-lite' },
{
icon: 'receipt',
path: '/myhr-lite/dashboard',
title: 'dashboard',
type: 'link',
},
];
}
items = new BehaviorSubject<Menu[]>(this.MENUITEMS);
}
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