Commit 1e89f66d authored by Almouhannad's avatar Almouhannad

(F) Add routing

parent 258f5445
......@@ -19,6 +19,8 @@ import { CreateWitingListItemAccordionComponent } from './components/receptionis
import { CreateEmployeeFormComponent } from './components/receptionist/create-employee-form/create-employee-form.component';
import { EmployeeComponent } from './components/receptionist/employee/employee.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 = [
{
......@@ -90,6 +92,14 @@ const routes: Routes = [
path: 'waitinglist',
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-
import { AskForSerialNumberComponent } from './components/doctor/ask-for-serial-number/ask-for-serial-number.component';
import { HistoryComponent } from './components/doctor/history/history.component';
import { VisitComponent } from './components/doctor/visit/visit.component';
import { CreateVisitComponent } from './components/doctor/create-visit/create-visit.component';
@NgModule({
......@@ -118,6 +119,7 @@ import { VisitComponent } from './components/doctor/visit/visit.component';
AskForSerialNumberComponent,
HistoryComponent,
VisitComponent,
CreateVisitComponent,
],
// identifies the root component that Angular should
......
import { Component, Input } from '@angular/core';
import { EmployeesDataService } from '../../../services/employees/employees-data.service';
import { Router } from '@angular/router';
@Component({
selector: 'app-ask-for-serial-number',
......@@ -7,7 +9,9 @@ import { Component, Input } from '@angular/core';
})
export class AskForSerialNumberComponent {
constructor(){}
constructor(private employeeDataService: EmployeesDataService,
private router: Router
){}
@Input("parentModal") parentModal: any;
@Input("type") type: 'query' | 'command';
......@@ -18,7 +22,24 @@ export class AskForSerialNumberComponent {
serialNumber: string;
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 @@
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 */
......
......@@ -76,7 +76,7 @@
(click)="showDropdown = !showDropdown">خيارات <i
class="bi bi-chevron-down toggle-dropdown"></i></button>
<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>
</ul>
</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