Commit 1e89f66d authored by Almouhannad's avatar Almouhannad

(F) Add routing

parent 258f5445
...@@ -19,6 +19,8 @@ import { CreateWitingListItemAccordionComponent } from './components/receptionis ...@@ -19,6 +19,8 @@ import { CreateWitingListItemAccordionComponent } from './components/receptionis
import { CreateEmployeeFormComponent } from './components/receptionist/create-employee-form/create-employee-form.component'; import { CreateEmployeeFormComponent } from './components/receptionist/create-employee-form/create-employee-form.component';
import { EmployeeComponent } from './components/receptionist/employee/employee.component'; import { EmployeeComponent } from './components/receptionist/employee/employee.component';
import { DoctorDashboardComponent } from './components/doctor/doctor-dashboard/doctor-dashboard.component'; import { DoctorDashboardComponent } from './components/doctor/doctor-dashboard/doctor-dashboard.component';
import { HistoryComponent } from './components/doctor/history/history.component';
import { CreateVisitComponent } from './components/doctor/create-visit/create-visit.component';
const routes: Routes = [ const routes: Routes = [
{ {
...@@ -90,6 +92,14 @@ const routes: Routes = [ ...@@ -90,6 +92,14 @@ const routes: Routes = [
path: 'waitinglist', path: 'waitinglist',
component: WaitingListComponent component: WaitingListComponent
}, },
{
path: 'history/:id',
component: HistoryComponent
},
{
path: 'visits/create/:id',
component: CreateVisitComponent
},
] ]
}, },
......
...@@ -50,6 +50,7 @@ import { DoctorStatusComponent } from './components/doctor/doctor-status/doctor- ...@@ -50,6 +50,7 @@ import { DoctorStatusComponent } from './components/doctor/doctor-status/doctor-
import { AskForSerialNumberComponent } from './components/doctor/ask-for-serial-number/ask-for-serial-number.component'; import { AskForSerialNumberComponent } from './components/doctor/ask-for-serial-number/ask-for-serial-number.component';
import { HistoryComponent } from './components/doctor/history/history.component'; import { HistoryComponent } from './components/doctor/history/history.component';
import { VisitComponent } from './components/doctor/visit/visit.component'; import { VisitComponent } from './components/doctor/visit/visit.component';
import { CreateVisitComponent } from './components/doctor/create-visit/create-visit.component';
@NgModule({ @NgModule({
...@@ -118,6 +119,7 @@ import { VisitComponent } from './components/doctor/visit/visit.component'; ...@@ -118,6 +119,7 @@ import { VisitComponent } from './components/doctor/visit/visit.component';
AskForSerialNumberComponent, AskForSerialNumberComponent,
HistoryComponent, HistoryComponent,
VisitComponent, VisitComponent,
CreateVisitComponent,
], ],
// identifies the root component that Angular should // identifies the root component that Angular should
......
import { Component, Input } from '@angular/core'; import { Component, Input } from '@angular/core';
import { EmployeesDataService } from '../../../services/employees/employees-data.service';
import { Router } from '@angular/router';
@Component({ @Component({
selector: 'app-ask-for-serial-number', selector: 'app-ask-for-serial-number',
...@@ -7,7 +9,9 @@ import { Component, Input } from '@angular/core'; ...@@ -7,7 +9,9 @@ import { Component, Input } from '@angular/core';
}) })
export class AskForSerialNumberComponent { export class AskForSerialNumberComponent {
constructor(){} constructor(private employeeDataService: EmployeesDataService,
private router: Router
){}
@Input("parentModal") parentModal: any; @Input("parentModal") parentModal: any;
@Input("type") type: 'query' | 'command'; @Input("type") type: 'query' | 'command';
...@@ -18,7 +22,24 @@ export class AskForSerialNumberComponent { ...@@ -18,7 +22,24 @@ export class AskForSerialNumberComponent {
serialNumber: string; serialNumber: string;
onSubmit(): void { onSubmit(): void {
var id: number;
this.employeeDataService.getBySerialNumber(this.serialNumber)
.subscribe(result => {
if (result.status === false) {
this.isFailure = true;
this.errorMessage = result.errorMessage!;
}
else {
id = result.employeeData!.id;
if (this.type === 'query') {
this.router.navigateByUrl(`doctor/history/${id}`)
}
else {
this.router.navigateByUrl(`doctor/visits/create/${id}`)
}
this.parentModal.dismiss();
}
})
} }
} }
import { Component } from '@angular/core';
@Component({
selector: 'app-create-visit',
templateUrl: './create-visit.component.html',
styleUrl: './create-visit.component.css'
})
export class CreateVisitComponent {
}
...@@ -53,6 +53,23 @@ ...@@ -53,6 +53,23 @@
text-align: center; /* or any other alignment you prefer */ text-align: center; /* or any other alignment you prefer */
} }
::ng-deep .btn:focus {
background-color: inherit;
box-shadow: none;
}
::ng-deep .btn:active {
background-color: inherit;
box-shadow: none;
}
::ng-deep .btn:visited {
background-color: inherit;
box-shadow: none;
}
::ng-deep .btn:link {
background-color: inherit;
box-shadow: none;
}
/* #endregion */ /* #endregion */
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
(click)="showDropdown = !showDropdown">خيارات <i (click)="showDropdown = !showDropdown">خيارات <i
class="bi bi-chevron-down toggle-dropdown"></i></button> class="bi bi-chevron-down toggle-dropdown"></i></button>
<ul [ngClass]="{'show': showDropdown}"> <ul [ngClass]="{'show': showDropdown}">
<li (click)="openPopUp(doctorAskForSerialNumberQuery);"><a>الاستعلام عن موظف</a></li> <li (click)="showDropdown=false; openPopUp(doctorAskForSerialNumberQuery);"><a>الاستعلام عن موظف</a></li>
<li (click)="onLogout();"><a>تسجيل الخروج</a></li> <li (click)="onLogout();"><a>تسجيل الخروج</a></li>
</ul> </ul>
</li> </li>
......
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