This commit is contained in:
surendar.m@watermelon.us 2023-03-14 12:16:20 +05:30
parent 5e1a71546f
commit 67f88342c8
16 changed files with 303 additions and 136 deletions

View File

@ -37,6 +37,7 @@ import { MatFormFieldModule } from '@angular/material/form-field';
import { TokenInterceptor } from './_guard/token.interceptor';
import { SessionService } from './session-services/session.service';
import { AppointmentService } from './appoinment/appointment.service';
import { RoleMenuItemsPipe } from './layouts/role-menu-items.pipe';
export function HttpLoaderFactory(http: HttpClient) {
@ -56,7 +57,8 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
AppComponent,
AdminLayoutComponent,
AuthLayoutComponent,
ProgressSpineerDialogComponent
ProgressSpineerDialogComponent,
RoleMenuItemsPipe
],
imports: [
DemoMaterialModule,

View File

@ -15,8 +15,28 @@ export const AppRoutes: Routes = [{
loadChildren: () => import('./dashboard/dashboard.module').then(m => m.DashboardModule)
},
{
path: 'appoinment',
loadChildren: () => import('./appoinment/appoinment.module').then(m => m.AppoinmentModule)
path: 'appoinments',
loadChildren: () => import('./appoinment/appoinments/appoinments.module').then(m => m.AppoinmentsModule)
},
{
path: 'service',
loadChildren: () => import('./appoinment/service-list-details/service-list.module').then(m => m.ServiceListModule)
},
{
path: 'users',
loadChildren: () => import('./appoinment/user/user.module').then(m => m.UserModule)
},
{
path: 'consultants',
loadChildren: () => import('./appoinment/consultants/consultants.module').then(m => m.ConsultantsModule)
},
{
path: 'customers',
loadChildren: () => import('./appoinment/customers/customers.module').then(m => m.CustomersModule)
},
{
path: 'business',
loadChildren: () => import('./appoinment/business/business.module').then(m => m.BusinessModule)
},
]
}, {

View File

@ -12,46 +12,51 @@ import { } from './service-list-details/service-list/service-list.component'
import { ConsultantsListComponent } from './consultants/consultants-list/consultants-list.component';
const routes: Routes = [{
path: 'add-business-list',
component: AddBusinessListComponent
},
{
path: 'business-list',
component: BusinessListComponent
},
{
path: 'add-user-list',
component: AddUserListComponent
},
{
path: 'user-list',
component: UserListComponent
},
{
path: 'appoinments-list',
component: AppoinmentsListComponent
},
{
path: 'customers-list',
component: CustomersListComponent
},
const routes: Routes = [
// {
// path:'',
// redirectTo:'',
// pathMatch:'full'
// },{
// path: 'add-business-list',
// component: AddBusinessListComponent
// },
// {
// path: 'business-list',
// component: BusinessListComponent
// },
// {
// path: 'add-user-list',
// component: AddUserListComponent
// },
// {
// path: 'user-list',
// component: UserListComponent
// },
// {
// path: 'appoinments-list',
// component: AppoinmentsListComponent
// },
// {
// path: 'customers-list',
// component: CustomersListComponent
// },
// // {
// // path: 'calendar-list',
// // component: CalendarListComponent
// // },
// {
// path: 'calendar-list',
// component: CalendarListComponent
// },
{
path: 'calendar-list',
component: CalendarListComponent
},
{
path: 'services-list',
component: ServiceListComponent
},
{
path: 'consultants-list',
component: ConsultantsListComponent
}
// {
// path: 'services-list',
// component: ServiceListComponent
// },
// {
// path: 'consultants-list',
// component: ConsultantsListComponent
// }
];

View File

@ -1,7 +1,18 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AppoinmentsListComponent } from './appoinments-list/appoinments-list.component';
const routes: Routes = [];
const routes: Routes = [
{
path:'',
redirectTo:'appoinment/appoinments',
pathMatch:'full'
},
{
path:'appoinment/appoinments',
component:AppoinmentsListComponent
},
];
@NgModule({
imports: [RouterModule.forChild(routes)],

View File

@ -67,9 +67,9 @@ export class BusinessListComponent implements OnInit {
})
}
ngAfterViewInit() {
this.businessList.paginator = this.paginator;
}
// ngAfterViewInit() {
// this.businessList.paginator = this.paginator;
// }
applyFilter(event: Event) {
const filterValue = (event.target as HTMLInputElement).value;
this.businessList.filter = filterValue.trim().toLowerCase();

View File

@ -1,7 +1,18 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { BusinessListComponent } from './business-list/business-list.component';
const routes: Routes = [];
const routes: Routes = [
{
path:'',
redirectTo:'appoinment/business',
pathMatch:'full'
},
{
path:'appoinment/business',
component:BusinessListComponent
},
];
@NgModule({
imports: [RouterModule.forChild(routes)],

View File

@ -1,7 +1,18 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ConsultantsListComponent } from './consultants-list/consultants-list.component';
const routes: Routes = [];
const routes: Routes = [
{
path:'',
redirectTo:'appoinment/consultants',
pathMatch:'full'
},
{
path:'appoinment/consultants',
component:ConsultantsListComponent
},
];
@NgModule({
imports: [RouterModule.forChild(routes)],

View File

@ -1,7 +1,18 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CustomersListComponent } from './customers-list/customers-list.component';
const routes: Routes = [];
const routes: Routes = [
{
path:'',
redirectTo:'appoinment/customers',
pathMatch:'full'
},
{
path:'appoinment/customers',
component:CustomersListComponent
},
];
@NgModule({
imports: [RouterModule.forChild(routes)],

View File

@ -1,7 +1,18 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ServiceListComponent } from './service-list/service-list.component';
const routes: Routes = [];
const routes: Routes = [
{
path:'',
redirectTo:'appoinment/service',
pathMatch:'full'
},
{
path:'appoinment/service',
component:ServiceListComponent
},
];
@NgModule({
imports: [RouterModule.forChild(routes)],

View File

@ -1,7 +1,19 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { UserListComponent } from './user-list/user-list.component';
import { UserModule } from './user.module';
const routes: Routes = [];
const routes: Routes = [
{
path:'',
redirectTo:'appoinment/users',
pathMatch:'full'
},
{
path:'appoinment/users',
component:UserListComponent
},
];
@NgModule({
imports: [RouterModule.forChild(routes)],

View File

@ -1,7 +0,0 @@
<mat-card class="mb-2 example-card">
<mat-card-title-group>
<img width="60" src="assets/images/curve.jpg">
<mat-card-title></mat-card-title>
<mat-card-subtitle>Dr. Saravanan</mat-card-subtitle>
</mat-card-title-group>
</mat-card>

View File

@ -10,10 +10,12 @@ import {TranslateService} from '@ngx-translate/core';
import PerfectScrollbar from 'perfect-scrollbar';
import { PerfectScrollbarConfigInterface,
PerfectScrollbarComponent, PerfectScrollbarDirective } from 'ngx-perfect-scrollbar';
import { RoleMenuItemsPipe } from '../role-menu-items.pipe';
@Component({
selector: 'app-layout',
templateUrl: './admin-layout.component.html'
templateUrl: './admin-layout.component.html',
providers: [RoleMenuItemsPipe],
})
export class AdminLayoutComponent implements OnInit, OnDestroy {
@ -219,7 +221,7 @@ users() {
}
logout() {
localStorage.clear();
this.router.navigate(['/']);
this.router.navigate(['/authentication/login']);
}
}

View File

@ -0,0 +1,8 @@
import { RoleMenuItemsPipe } from './role-menu-items.pipe';
describe('RoleMenuItemsPipe', () => {
it('create an instance', () => {
const pipe = new RoleMenuItemsPipe();
expect(pipe).toBeTruthy();
});
});

View File

@ -0,0 +1,52 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'roleMenuItems'
})
export class RoleMenuItemsPipe implements PipeTransform {
transform(value: any, type: any): any {
console.log(value,type)
// // this is for horizontal menu filter
// if(type=="1"){
// switch(localStorage.getItem('user_role')){
// case '1': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion" && val.state!="sales-pd-list");
// case '2': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion" && val.state!="sales-pd-list");
// case '3': return value.filter(val=>val.state!="settings");
// case '4': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion" && val.state!="reports" && val.state!="sales-pd-list");
// case '5': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion" && val.state!="reports" && val.state!="sales-pd-list");
// case '6': return value.filter(val=>val.state!="settings" && val.state!="personal_discussion" && val.state!="reports" && val.state!="sales-pd-list");
// case '7': return value.filter(val=>val.state!="settings" && val.state!="personal_discussion" && val.state!="reports" && val.state!="sales-pd-list");
// case '8': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion" && val.state!="sales-pd-list");
// case '9': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion" && val.state!="sales-pd-list");
// case '10': return value;
// // case '3': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion");
// // case '4': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion" && val.state!="reports");
// // case '6': return value.filter(val=>val.state!="settings" && val.state!="personal_discussion" && val.state!="reports");
// // default: return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion");
// }
// }
// // this is for vertical menu filter
// else if(type=="2"){
// switch(localStorage.getItem('user_role')){
// case '1': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion" && val.state!="sales-pd-list");
// case '2': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion" && val.state!="sales-pd-list");
// case '3': return value.filter(val=>val.state!="settings");
// case '4': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion" && val.state!="reports" && val.state!="sales-pd-list");
// case '5': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion" && val.state!="reports" && val.state!="sales-pd-list");
// case '6': return value.filter(val=>val.state!="settings" && val.state!="personal_discussion" && val.state!="reports" && val.state!="sales-pd-list");
// case '7': return value.filter(val=>val.state!="settings" && val.state!="personal_discussion" && val.state!="reports" && val.state!="sales-pd-list");
// case '8': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion" && val.state!="sales-pd-list");
// case '9': return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion" && val.state!="sales-pd-list");
// case '10': return value;
// // default: return value.filter(val=>val.state!="settings" && val.state!="quality_check_discussion");
// }
// }
// else{
// return [];
// }
}
}

View File

@ -26,29 +26,73 @@ const HORIZONTALMENUITEMS = [
state: 'home',
name: 'HOME',
type: 'link',
icon: 'home'
icon: 'explore'
},
{
state: 'authentication',
name: 'AUTHENTICATION',
type: 'sub',
state: 'appoinments',
name: 'Appoinments',
type: 'link',
icon: 'security',
children: [
{state: 'authentication/login', name: 'LOGIN'},
{state: 'authentication/register', name: 'REGISTER'},
{state: 'authentication/forgot-password', name: 'FORGOT'},
{state: 'authentication/lockscreen', name: 'LOCKSCREEN'},
{
state: 'error',
name: 'ERROR',
type: 'super-sub',
icon: 'error_outline',
subchildren: [
{state: 'error/404', name: '404'},
{state: 'error/503', name: '503'}
]
}
]
// children: [
// {state: 'appoinments-list', name: 'Appoinments List'},
// ]
},
{
state: 'business',
name: 'Business',
type: 'link',
icon: 'security',
// children: [
// {state: 'business-list', name: 'Business List'},
// // {state: 'add-business-list', name: 'Add Business '},
// ]
},
// {
// state: 'appoinment',
// name: 'Calendar',
// type: 'sub',
// icon: 'security',
// children: [
// {state: 'calendar-list', name: 'Calendar List'},
// ]
// },
{
state: 'customers',
name: 'Customers',
type: 'link',
icon: 'security',
// children: [
// {state: 'customers-list', name: 'Customers List'},
// ]
},
{
state: 'consultants',
name: 'Consultants',
type: 'link',
icon: 'security',
// children: [
// {state: 'consultants-list', name: 'Consultants List'},
// ]
},
{
state: 'users',
name: 'Users',
type: 'link',
icon: 'security',
// children: [
// {state: 'user-list', name: 'Users List'},
// // {state: 'add-user-list', name: 'Add Users '},
// ]
},
{
state: 'service',
name: 'Services List',
type: 'link',
icon: 'security',
// children: [
// {state: 'services-list', name: 'Services List'},
// // {state: 'add-user-list', name: 'Add Users '},
// ]
}
];

View File

@ -28,23 +28,23 @@ const MENUITEMS : Menu[] = [
icon: 'explore'
},
{
state: 'appoinment',
state: 'appoinments',
name: 'Appoinments',
type: 'sub',
type: 'link',
icon: 'security',
children: [
{state: 'appoinments-list', name: 'Appoinments List'},
]
// children: [
// {state: 'appoinments-list', name: 'Appoinments List'},
// ]
},
{
state: 'appoinment',
state: 'business',
name: 'Business',
type: 'sub',
type: 'link',
icon: 'security',
children: [
{state: 'business-list', name: 'Business List'},
// {state: 'add-business-list', name: 'Add Business '},
]
// children: [
// {state: 'business-list', name: 'Business List'},
// // {state: 'add-business-list', name: 'Add Business '},
// ]
},
// {
// state: 'appoinment',
@ -56,70 +56,44 @@ const MENUITEMS : Menu[] = [
// ]
// },
{
state: 'appoinment',
state: 'customers',
name: 'Customers',
type: 'sub',
type: 'link',
icon: 'security',
children: [
{state: 'customers-list', name: 'Customers List'},
]
// children: [
// {state: 'customers-list', name: 'Customers List'},
// ]
},
{
state: 'appoinment',
state: 'consultants',
name: 'Consultants',
type: 'sub',
type: 'link',
icon: 'security',
children: [
{state: 'consultants-list', name: 'Consultants List'},
]
// children: [
// {state: 'consultants-list', name: 'Consultants List'},
// ]
},
{
state: 'appoinment',
state: 'users',
name: 'Users',
type: 'sub',
type: 'link',
icon: 'security',
children: [
{state: 'user-list', name: 'Users List'},
// {state: 'add-user-list', name: 'Add Users '},
]
// children: [
// {state: 'user-list', name: 'Users List'},
// // {state: 'add-user-list', name: 'Add Users '},
// ]
},
{
state: 'appoinment',
state: 'service',
name: 'Services List',
type: 'sub',
type: 'link',
icon: 'security',
children: [
{state: 'services-list', name: 'Services List'},
// {state: 'add-user-list', name: 'Add Users '},
]
// children: [
// {state: 'services-list', name: 'Services List'},
// // {state: 'add-user-list', name: 'Add Users '},
// ]
}
// {
// state: 'authentication',
// name: 'AUTHENTICATIONs',
// type: 'sub',
// icon: 'security',
// children: [
// {state: 'login', name: 'LOGIN'},
// {state: 'register', name: 'REGISTER'},
// {state: 'forgot-password', name: 'FORGOT'},
// {state: 'lockscreen', name: 'LOCKSCREEN'}
// ]
// },
// {
// state: 'error',
// name: 'ERROR',
// type: 'sub',
// icon: 'error_outline',
// children: [
// {state: '404', name: '404'},
// {state: '503', name: '503'}
// ]
// }
];
@Injectable()