Commit f56ef00d by DESKTOP-E3GSHH7\myhr

module mylearn

parent 296dc2a1
/* 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({
selector: 'app-dashboard',
templateUrl: './dashboard.component.html',
styleUrls: ['./dashboard.component.css'],
standalone: true,
})
export class DashboardComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MylearnComponent } from './mylearn.component';
import { RouterModule, Routes } from '@angular/router';
export const mylearn: Routes = [
{
path: "mylearn", children:[
{
path: 'dashboard',
loadComponent: () =>
import('./dashboard/dashboard.component').then((m) => m.DashboardComponent),
}
]
}
]
@NgModule({
imports: [
CommonModule
CommonModule,
RouterModule.forChild(mylearn),
],
declarations: [MylearnComponent]
declarations: [MylearnComponent],
exports: [RouterModule],
})
export class MylearnModule { }
export class MylearnModule {
static routes = mylearn;
}
......@@ -343,7 +343,7 @@
</div>
<div class="">
<a routerLink="/admin"
<a routerLink="/mylearn/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/mylearn-logo.png" alt="miscrosoft"
class="leading-[1.75] text-2xl !h-[1.75rem] align-middle flex justify-center mx-auto">
......
......@@ -5,6 +5,7 @@
<a class="header-logo">
<img *ngIf="isCommonRoute" src="./assets/images/brand-logos/logo.png" alt="logo" width="100%">
<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%">
</a>
......
......@@ -70,6 +70,7 @@ export class SidebarComponent {
isCommonRoute: boolean = false;
isInstallerRoute: boolean = false;
isMyportalRoute: boolean = false;
isMylearnRoute: boolean = false;
previousUrl: string = '';
currentUrl: string = '';
......@@ -138,12 +139,15 @@ 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.checkUrlChanges()
// Log to console for verification
console.log('Initial URL:', this.currentUrl);
console.log('Is Common Route:', this.isCommonRoute);
console.log('Is Installer Route:', this.isInstallerRoute);
console.log('Is Myportal Route:', this.isMyportalRoute);
console.log('mylearn routes',this.isMylearnRoute);
}
checkUrlChanges(): void {
......@@ -160,7 +164,9 @@ export class SidebarComponent {
// Check if there's a change between /installer and /admin
if (
(this.previousUrl.includes('/company') && this.currentUrl.includes('/admin')) ||
(this.previousUrl.includes('/admin') && this.currentUrl.includes('/company'))
(this.previousUrl.includes('/admin') && this.currentUrl.includes('/company')) ||
(this.previousUrl.includes('/myprotal')&& this.currentUrl.includes('/myprotal')) ||
(this.previousUrl.includes('/mylearn')&& this.currentUrl.includes('/mylearn'))
) {
console.log('URL changed between /installer and /admin.');
// Implement any logic needed when changing between /installer and /admin
......@@ -170,6 +176,7 @@ 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')
// Log to console for verification
console.log('Current URL:', this.currentUrl);
......@@ -196,7 +203,9 @@ export class SidebarComponent {
this.menuItems = this.navServices.getCompanyMenu();
}else if (this.isMyportalRoute){
this.menuItems = this.navServices.getMyportalMenu();
} else {
} else if (this.isMylearnRoute){
this.menuItems = this.navServices.getMylearnMenu();
}else{
this.menuItems = this.navServices.getCommonMenu();
}
......
......@@ -29,6 +29,7 @@ import { tablesRoutingModule } from '../../components/tables/tables.routes';
import { CommonManageModule } from '../../DPU/common/common.module';
import { CompanyManagementModule } from '../../DPU/company-management/company-management.module';
import { MyskillXModule } from '../../DPU/myskill-x/myskill-x.module';
import { MylearnModule } from '../../DPU/mylearn/mylearn.module';
export const content: Routes = [
......@@ -63,7 +64,8 @@ export const content: Routes = [
...tablesRoutingModule.routes,
...CommonManageModule.routes,
...CompanyManagementModule.routes,
...MyskillXModule.routes
...MyskillXModule.routes,
...MylearnModule.routes
]
}
......
......@@ -272,5 +272,19 @@ export class NavService implements OnDestroy {
];
}
getMylearnMenu() {
return [
// Myportal
{ headTitle: 'Mylearn' },
{
icon: 'receipt',
path: '/mylearn/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