Commit f7030244 authored by hasan khaddour's avatar hasan khaddour

refactor to reports based

parent 4b5029cb
......@@ -44,6 +44,10 @@ export const routes: Routes = [
, {
path: 'employees',
loadChildren: () => import('./employees/employees.module').then(m => m.EmployeesModule)
}
, {
path: 'reports',
loadChildren: () => import('./reports/reports.module').then(m => m.ReportsModule)
}
]
......@@ -58,7 +62,7 @@ export const routes: Routes = [
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
imports: [RouterModule.forRoot(routes,{ onSameUrlNavigation: 'reload' })],
exports: [RouterModule]
})
export class AppRoutingModule { }
import { Injectable } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { AddStepModalComponent } from '../../../projects/components/modals/add-step-modal/add-step-modal.component';
@Injectable({
providedIn: 'root'
})
export class ModalService {
constructor(private dialog: MatDialog) {}
openModal(data: any,componenet : any): Promise<any> {
const dialogRef = this.dialog.open(componenet, {
width: '400px',
data: data
});
return dialogRef.afterClosed().toPromise();
}
}
import { Component } from '@angular/core';
@Component({
selector: 'add-attachment-modal',
templateUrl: './add-attachment-modal.component.html',
styleUrl: './add-attachment-modal.component.css'
})
export class AddAttachmentModalComponent {
}
import { Component } from '@angular/core';
@Component({
selector: 'add-financial-spend-modal',
templateUrl: './add-financial-spend-modal.component.html',
styleUrl: './add-financial-spend-modal.component.css'
})
export class AddFinancialSpendModalComponent {
}
<h1 mat-dialog-title>Add Step</h1>
<div mat-dialog-content>
<form [formGroup]="stepForm">
<mat-form-field>
<mat-label>Name</mat-label>
<input matInput formControlName="name">
<mat-error *ngIf="stepForm.get('name')!.hasError('required')">Name is required</mat-error>
</mat-form-field>
<mat-form-field>
<mat-label>Description</mat-label>
<textarea matInput formControlName="description"></textarea>
<mat-error *ngIf="stepForm.get('description')!.hasError('required')">Description is required</mat-error>
</mat-form-field>
<mat-form-field>
<mat-label>Weight</mat-label>
<input matInput type="number" formControlName="weight">
<mat-error *ngIf="stepForm.get('weight')!.hasError('required')">Weight is required</mat-error>
<mat-error *ngIf="stepForm.get('weight')!.hasError('min') || stepForm.get('weight')!.hasError('max')">
Weight must be between 1 and 100
</mat-error>
</mat-form-field>
</form>
</div>
<div mat-dialog-actions>
<button mat-button (click)="onCancel()">Cancel</button>
<button mat-button color="primary" (click)="onSubmit()" [disabled]="stepForm.invalid">Add Step</button>
</div>
import { Component, Inject } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
@Component({
selector: 'add-step-modal',
templateUrl: './add-step-modal.component.html',
styleUrl: './add-step-modal.component.css'
})
export class AddStepModalComponent {
stepForm: FormGroup;
constructor(
private fb: FormBuilder,
public dialogRef: MatDialogRef<AddStepModalComponent>,
@Inject(MAT_DIALOG_DATA) public data: any
) {
this.stepForm = this.fb.group({
name: ['', Validators.required],
description: ['', Validators.required],
weight: [0, [Validators.required, Validators.min(1), Validators.max(100)]]
});
}
onSubmit() {
if (this.stepForm.valid) {
this.dialogRef.close(this.stepForm.value);
}
}
onCancel(): void {
this.dialogRef.close();
}
}
<div class="card shadow mb-4">
<div class="card shadow mb-4" style="min-height: 200px;">
<div class="card-body text-center">
<div class="avatar avatar-lg mt-4">
<a href="">
......@@ -10,6 +10,7 @@
<strong class="card-title my-0">{{project.projectInfo.name}} </strong>
<p class="small">{{project.projectInfo.description}}</p>
<p class="small">ينفذ من قبل {{project.executer.name}}</p>
<p class="small">الطور {{project.currentState }}</p>
<p class="small text-muted mb-0"> <span class="badge badge-light text-muted"> رمز المشروع {{project.projectInfo.code}} </span>, <span class="badge badge-light text-muted"> تاريخ البدء {{project.projectInfo.startDate | date}} </span></p>
......@@ -17,13 +18,12 @@
</div> <!-- ./card-text -->
<div class="card-footer">
<div class="row align-items-center justify-content-between">
<div class="col-auto">
<small>
<span class=" mr-1"></span> </small>
</div>
<div class="col-auto">
<div class="file-action">
{{project.currentState}}
<div class="col">
<div class="file-action d-flex justify-content-around">
<a type="button" [routerLink]="['/projects/detail',project.id]" class="btn btn-primary m-1">لوحة التحكم</a>
<a type="button" [routerLink]="['/reports/definition',project.id]" class="btn btn-primary m-1">بطاقة المشروع</a>
<!-- [routerLink]="['/projects/detail',project.id]" -->
</div>
</div>
</div>
......
<div class="container-fluid" *ngIf="project">
<div class="row justify-content-center">
<div class="col-12 ">
<div class="row align-items-center mb-4">
<div class="col">
<h2 class="h5 page-title"><small class="text-muted text-uppercase">بطاقة معلومات مشروع</small></h2>
</div>
<div class="col-auto">
<button type="button" (click)="downloadAsPdf()" class="btn btn-secondary m-1">Print</button>
</div>
</div>
<div class="card shadow" id="pdfContent">
<div class="card-body p-5">
<project-header [projectInfo]="project.projectInfo"></project-header>
<div class="row mb-5">
<div class="col-md-4">
<p class="mb-4">
<strong>ذاتية المشروع</strong>
<br /> رمز المشروع: <small>{{project.projectInfo.code}}</small>
<br /> كتاب الطرح : <small>{{project.proposalInfo.proposingBookNumber}} / {{project.proposalInfo.proposingBookDate | date}}</small>
<br />كتاب الموافقة : <small>{{project.projectAggreement.aggreementNumber}} / {{project.projectAggreement.aggreementDate |date}}</small>
<br />التمويل : <small> {{project.financialFund.financialStatus}} / {{project.financialFund.source}} </small>
</p>
</div>
<div class="col-md-4 text-center">
<p class="mb-4">
<strong>المعلومات التنفيذية</strong>
<br /> الجهة المنفذة: <small>{{project.executer.name}}</small>
<br /> رئيس فريق العمل: <small>{{project.teamLeader.personalInfo | fullname}}</small>
<br /> مدير المشروع : <small>{{project.projectManager.personalInfo | fullname}}</small>
<br />ينفذ لصالح : <small> {{project.proposer.customerName}} </small>
</p>
</div>
<div class="col-md-4">
<p class="mb-4">
<strong>معلومات حالة المشروع </strong>
<br /> المرحلة التطويرير : <small>{{project.currentState}} </small>
<br />نوع المشروع : <small>{{project.projectClassification.projectType}} </small>
<br /> طبيعة المشروع : <small>{{project.projectClassification.projectNature}} </small>
</p>
</div>
</div> <!-- /.row -->
<hr>
<p><strong>مراحل المشروع</strong></p>
<step-table [steps]="project.steps"></step-table>
<hr>
<participants-table [employeeParticipates]="project.employeeParticipates"></participants-table>
<p><strong>خطة الانفاق</strong></p>
<financial-spend-table [financialSpending]="project.financialSpending"></financial-spend-table>
<project-footer [proposer]="project.proposer"
[executer]="project.executer"
[projectManager]="project.projectManager"
[teamLeader]="project.teamLeader"
>
</project-footer>
</div> <!-- /.card-body -->
</div> <!-- /.card -->
</div> <!-- /.col-12 -->
</div> <!-- .row -->
<div class="row justify-content-center">
<div class="col-12 ">
<div class="row align-items-center mb-4">
......
......@@ -12,7 +12,7 @@
<hr>
<div *ngIf="projects">
<div class="row" *ngIf="projects.length > 0">
<project-item class="col-md-4" (click)="this.router.navigate(['projects/detail',project.id])" *ngFor="let project of projects" [project]="project"></project-item>
<project-item class="col-4" (click)="this.router.navigate(['projects/detail',project.id])" *ngFor="let project of projects" [project]="project"></project-item>
</div>
<div class="row" *ngIf="projects.length == 0">
لا يوجد أي مشروع
......
......@@ -6,7 +6,7 @@
<h2 class="h3 mb-0 page-title"> قائمة مراحل المشروع </h2>
</div>
<div class="col-auto">
<button type="button" (click)="this.router.navigate(['projects/create'])" class="btn btn-primary"><span class="fe fe-file-plus fe-12 mr-2"></span>إضافة مرحلة </button>
<button type="button" mat-raised-button color="primary" (click)="addStep()"class="btn btn-primary"><span class="fe fe-file-plus fe-12 mr-2"></span>إضافة مرحلة </button>
</div>
</div>
<hr>
......
......@@ -4,6 +4,8 @@ import { ProjectService } from '../../services/project.service';
import { ToastrService } from 'ngx-toastr';
import { ActivatedRoute, Route, Router } from '@angular/router';
import { StepService } from '../../services/step.service';
import { ModalService } from '../../../core/services/modals/modal.service';
import { AddStepModalComponent } from '../../components/modals/add-step-modal/add-step-modal.component';
@Component({
selector: 'step-list',
......@@ -17,8 +19,8 @@ export class StepListComponent {
private stepService :StepService,
private toastr : ToastrService,
private route: ActivatedRoute,
public router :Router
public router :Router,
private modalService: ModalService
) {
}
......@@ -26,7 +28,9 @@ export class StepListComponent {
this.loadParticipations();
}
loadParticipations(): void{
loadParticipations(): void{
this.stepService.getStepsByProject(this.projectId).subscribe({
next: (data)=> {
......@@ -42,4 +46,12 @@ export class StepListComponent {
})
}
addStep() {
this.modalService.openModal({},AddStepModalComponent).then(result => {
if (result) {
// Logic to handle the step after it's been added, such as updating the project steps
console.log('New Step:', result);
}
});
}
}
......@@ -4,14 +4,12 @@ import { ProjectItemComponent } from './components/project-item/project-item.com
import { AttachmentComponent } from './components/attachment/attachment.component';
import { ProjectListComponent } from './pages/project-list/project-list.component';
import { ProjectDetailsComponent } from './pages/project-details/project-details.component';
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { SharedModule } from '../shared/shared.module';
import { ProjectRoutingModule } from './project-routing.module';
import { StepRowItemComponent } from './components/step-row-item/step-row-item.component';
import { ProjectHeaderComponent } from './components/project-header/project-header.component';
import { ProjectCreateComponent } from './pages/project-create/project-create.component';
import { MatCommonModule, MatOption, MatOptionModule } from '@angular/material/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MatFormFieldModule } from '@angular/material/form-field';
import {MatAutocompleteModule} from '@angular/material/autocomplete';
import { MatInputModule } from '@angular/material/input';
......@@ -20,16 +18,16 @@ import {MatSelectModule} from '@angular/material/select';
import {MatDatepickerModule} from '@angular/material/datepicker';
import {provideNativeDateAdapter} from '@angular/material/core';
import { ProjectAttachmentsComponent } from './pages/project-attachments/project-attachments.component';
import { StepTableComponent } from './components/step-table/step-table.component';
import { ParticipantsTableComponent } from './components/participants-table/participants-table.component';
import { FinancialSpendTableComponent } from './components/financial-spend-table/financial-spend-table.component';
import { ProjectFooterComponent } from './components/project-footer/project-footer.component';
import { StepListComponent } from './pages/step-list/step-list.component';
import { ParticipantsListComponent } from './pages/participants-list/participants-list.component';
import { ParticipantItemComponent } from './components/participant-item/participant-item.component';
import { PlanControllComponent } from './components/project-controll/plan-controll/plan-controll.component';
import { TrackControllComponent } from './components/project-controll/track-controll/track-controll.component';
import { InfoControllComponent } from './components/project-controll/info-controll/info-controll.component';
import { RouterModule } from '@angular/router';
import { AddStepModalComponent } from './components/modals/add-step-modal/add-step-modal.component';
import { AddFinancialSpendModalComponent } from './components/modals/add-financial-spend-modal/add-financial-spend-modal.component';
import { AddAttachmentModalComponent } from './components/modals/add-attachment-modal/add-attachment-modal.component';
@NgModule({
declarations: [
......@@ -38,19 +36,17 @@ import { InfoControllComponent } from './components/project-controll/info-contro
ProjectListComponent,
ProjectDetailsComponent,
StepRowItemComponent,
ProjectHeaderComponent,
ProjectCreateComponent,
ProjectAttachmentsComponent,
StepTableComponent,
ParticipantsTableComponent,
FinancialSpendTableComponent,
ProjectFooterComponent,
StepListComponent,
ParticipantsListComponent,
ParticipantItemComponent,
PlanControllComponent,
TrackControllComponent,
InfoControllComponent
InfoControllComponent,
AddStepModalComponent,
AddFinancialSpendModalComponent,
AddAttachmentModalComponent
],
providers: [
ProjectService,
......@@ -68,7 +64,7 @@ import { InfoControllComponent } from './components/project-controll/info-contro
MatOptionModule,
MatAutocompleteModule,
MatDatepickerModule,
RouterModule ,
MatInputModule,
ReactiveFormsModule ,
SharedModule
......
......@@ -12,8 +12,8 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let spend of financialSpending" >
<th scope="row"></th>
<tr *ngFor="let spend of financialSpending ;index as i " >
<th scope="row">{{i +1 }}</th>
<td class="text-center"> {{spend.costType}}
</td>
<td class="text-center">{{spend.description }}</td>
......@@ -24,5 +24,14 @@
<td class="text-center">{{spend.expectedSpendingDate | date}}</td>
</tr>
<tr *ngIf="financialSpending.length==0" >
<th scope="row"></th>
<td class="text-center"> </td>
<td class="text-center"></td>
<td class="text-center"></td>
<td class="text-center"></td>
<td class="text-center"></td>
<td class="text-center"></td>
</tr>
</tbody>
</table>
import { Component, Input } from '@angular/core';
import { FinancialSpending } from '../../models/responses/FinancialSpending';
import { FinancialSpending } from '../../../projects/models/responses/FinancialSpending';
@Component({
selector: 'financial-spend-table',
......
......@@ -13,8 +13,8 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let participant of employeeParticipates" >
<th scope="row"></th>
<tr *ngFor="let participant of employeeParticipates ; index as i " >
<th scope="row">{{i+1}}</th>
<td class="text-center"> {{participant.employee.hiastId}}
</td>
<td class="text-center">{{participant.employee.personalInfo | fullname }}</td> <td class="text-center">{{participant.employee.workInfo.workJob}}</td>
......@@ -23,5 +23,15 @@
<td class="text-center">{{participant.role}}</td>
</tr>
<tr *ngIf="employeeParticipates.length==0" >
<th scope="row"></th>
<td class="text-center"> </td>
<td class="text-center"></td>
<td class="text-center"></td>
<td class="text-center"></td>
<td class="text-center"></td>
<td class="text-center"></td>
</tr>
</tbody>
</table>
import { Component, Input } from '@angular/core';
import { Customer } from '../../../customers/models/customer';
import { Employee } from '../../../employees/models/responses/employee';
import { Department } from '../../models/responses/Department';
import { Department } from '../../../projects/models/responses/Department';
@Component({
selector: 'project-footer',
......
import { Component, Input } from '@angular/core';
import { ProjectInfo } from '../../models/valueObjects/ProjectInfo';
import { ProposalInfo } from '../../models/valueObjects/proposalInfo';
import { ProjectInfo } from '../../../projects/models/valueObjects/ProjectInfo';
import { ProposalInfo } from '../../../projects/models/valueObjects/proposalInfo';
import { Employee } from '../../../employees/models/responses/employee';
@Component({
......
......@@ -23,5 +23,14 @@
<td class="text-left">{{step.stepInfo.startDate | date}}</td>
<td class="text-left">{{step.stepInfo.duration}}</td>
</tr>
<tr *ngIf="steps.length==0" >
<th scope="row"></th>
<td class="text-center"> </td>
<td class="text-center"></td>
<td class="text-center"></td>
<td class="text-center"></td>
<td class="text-center"></td>
<td class="text-center"></td>
</tr>
</tbody>
</table>
\ No newline at end of file
import { Component, Input } from '@angular/core';
import { Step } from '../../models/responses/Step';
import { Step } from '../../../projects/models/responses/Step';
@Component({
selector: 'step-table',
......
import { Component } from '@angular/core';
@Component({
selector: 'employees-track-report',
templateUrl: './employees-track-report.component.html',
styleUrl: './employees-track-report.component.css'
})
export class EmployeesTrackReportComponent {
}
import { Component } from '@angular/core';
@Component({
selector: 'project-completion',
templateUrl: './project-completion.component.html',
styleUrl: './project-completion.component.css'
})
export class ProjectCompletionComponent {
}
<div class="container-fluid" *ngIf="project">
<div class="row justify-content-center">
<div class="col-12 ">
<div class="row align-items-center mb-4">
<div class="col">
<h2 class="h5 page-title"><small class="text-muted text-uppercase">بطاقة معلومات مشروع</small></h2>
</div>
<div class="col-auto">
<button type="button" (click)="downloadAsPdf()" class="btn mr-1 btn-secondary m-1">طباعة</button>
<button type="button" class="btn mr-1 btn-secondary m-1">تقرير متابعة المراحل</button>
<button type="button" class="btn mr-1 btn-secondary m-1">تقرير انشغالية</button>
<button type="button" class="btn mr-1 btn-secondary m-1">تقرير خطة زمنية</button>
</div>
</div>
<div class="card shadow" id="pdfContent">
<div class="card-body p-5">
<project-header [projectInfo]="project.projectInfo"></project-header>
<div class="row mb-5">
<div class="col-md-4">
<p class="mb-4">
<strong>ذاتية المشروع</strong>
<br /> رمز المشروع: <small>{{project.projectInfo.code}}</small>
<br /> كتاب الطرح : <small>{{project.proposalInfo.proposingBookNumber}} / {{project.proposalInfo.proposingBookDate | date}}</small>
<br />كتاب الموافقة : <small>{{project.projectAggreement.aggreementNumber}} / {{project.projectAggreement.aggreementDate |date}}</small>
<br />التمويل : <small> {{project.financialFund.financialStatus}} / {{project.financialFund.source}} </small>
</p>
</div>
<div class="col-md-4 text-center">
<p class="mb-4">
<strong>المعلومات التنفيذية</strong>
<br /> الجهة المنفذة: <small>{{project.executer.name}}</small>
<br /> رئيس فريق العمل: <small>{{project.teamLeader.personalInfo | fullname}}</small>
<br /> مدير المشروع : <small>{{project.projectManager.personalInfo | fullname}}</small>
<br />ينفذ لصالح : <small> {{project.proposer.customerName}} </small>
</p>
</div>
<div class="col-md-4">
<p class="mb-4">
<strong>معلومات حالة المشروع </strong>
<br /> المرحلة التطويرير : <small>{{project.currentState }} </small>
<br />نوع المشروع : <small>{{project.projectClassification.projectType}} </small>
<br /> طبيعة المشروع : <small>{{project.projectClassification.projectNature}} </small>
</p>
</div>
</div> <!-- /.row -->
<hr>
<p><strong>مراحل المشروع</strong></p>
<step-table [steps]="project.steps"></step-table>
<hr>
<participants-table [employeeParticipates]="project.employeeParticipates"></participants-table>
<p><strong>خطة الانفاق</strong></p>
<financial-spend-table [financialSpending]="project.financialSpending"></financial-spend-table>
<project-footer [proposer]="project.proposer"
[executer]="project.executer"
[projectManager]="project.projectManager"
[teamLeader]="project.teamLeader"
>
</project-footer>
</div> <!-- /.card-body -->
</div> <!-- /.card -->
</div> <!-- /.col-12 -->
</div>
</div>
\ No newline at end of file
import { Component, OnInit } from '@angular/core';
import { ReportsService } from '../../services/reports.service';
import { ActivatedRoute } from '@angular/router';
import { Project } from '../../../projects/models/responses/project';
import { PdfDownloaderService } from '../../../core/services/pdfDownloader/pdf-downloader.service';
@Component({
selector: 'project-definition',
templateUrl: './project-definition.component.html',
styleUrl: './project-definition.component.css'
})
export class ProjectDefinitionComponent implements OnInit{
project : Project
constructor(
private reportsService : ReportsService,
private route :ActivatedRoute,
private pdfDownloader : PdfDownloaderService
){}
ngOnInit(): void {
const id = Number(this.route.snapshot.paramMap.get('id'));
this.reportsService.getProjectById(id).subscribe({
next :(data) => {
this.project = data;
},
error : (err)=>{ console.log(err)}
});
}
public downloadAsPdf(): void {
this.pdfDownloader.downloadAsPdf('pdfContent');
}
}
import { Component } from '@angular/core';
@Component({
selector: 'project-time-line',
templateUrl: './project-time-line.component.html',
styleUrl: './project-time-line.component.css'
})
export class ProjectTimeLineComponent {
}
import { Component } from '@angular/core';
@Component({
selector: 'project-track-history',
templateUrl: './project-track-history.component.html',
styleUrl: './project-track-history.component.css'
})
export class ProjectTrackHistoryComponent {
}
import { Component } from '@angular/core';
@Component({
selector: 'steps-track-report',
templateUrl: './steps-track-report.component.html',
styleUrl: './steps-track-report.component.css'
})
export class StepsTrackReportComponent {
}
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ProjectDefinitionComponent } from './pages/project-definition/project-definition.component';
const routes: Routes = [
{path: 'definition/:id',component:ProjectDefinitionComponent}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class ReportsRoutingModule { }
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ReportsRoutingModule } from './reports-routing.module';
import { ProjectDefinitionComponent } from './pages/project-definition/project-definition.component';
import { ProjectCompletionComponent } from './pages/project-completion/project-completion.component';
import { EmployeesTrackReportComponent } from './pages/employees-track-report/employees-track-report.component';
import { StepsTrackReportComponent } from './pages/steps-track-report/steps-track-report.component';
import { ProjectTrackHistoryComponent } from './pages/project-track-history/project-track-history.component';
import { ProjectTimeLineComponent } from './pages/project-time-line/project-time-line.component';
import { ProjectHeaderComponent } from './componenets/project-header/project-header.component';
import { FinancialSpendTableComponent } from './componenets/financial-spend-table/financial-spend-table.component';
import { ParticipantsTableComponent } from './componenets/participants-table/participants-table.component';
import { ProjectFooterComponent } from './componenets/project-footer/project-footer.component';
import { StepTableComponent } from './componenets/step-table/step-table.component';
import { SharedModule } from '../shared/shared.module';
@NgModule({
declarations: [
ProjectDefinitionComponent,
ProjectCompletionComponent,
EmployeesTrackReportComponent,
StepsTrackReportComponent,
ProjectTrackHistoryComponent,
StepTableComponent,
ParticipantsTableComponent,
FinancialSpendTableComponent,
ProjectFooterComponent,
ProjectHeaderComponent,
ProjectTimeLineComponent
],
imports: [
CommonModule,
SharedModule,
ReportsRoutingModule
]
})
export class ReportsModule { }
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { Project } from '../../projects/models/responses/project';
import { ConfigurationService } from '../../core/services/configuration/configuration.service';
@Injectable({
providedIn: 'root'
})
export class ReportsService {
constructor(private http : HttpClient,private config : ConfigurationService) { }
// this method reponsible for geting the specificed projet by its id
//
public getProjectById(id : number ):Observable<Project>{
return this.http.get<Project>(this.config.getServerUrl()+ "/Projects/"+id);
}
}
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'stateTranslate'
})
export class StateTranslatePipe implements PipeTransform {
transform(state : string ): string {
switch (state){
case "InPlan":
return "يخطط";
case "Complete":
return "مكتمل";
case "InProgress" :
return "التنفيذ";
case "Proposed" :
return "مطروح";
case "CancledState":
return "ملغى";
default :
return "غير معروف"
}
}
}
......@@ -10,6 +10,7 @@ import { NavItemComponent } from './componenets/nav-item/nav-item.component';
import { LoadingSpinnerComponent } from './componenets/loading-spinner/loading-spinner.component';
import { FullnamePipe } from './pipes/fullName/fullname.pipe';
import { CardItemComponent } from './componenets/card-item/card-item.component';
import { StateTranslatePipe } from './pipes/stateTranslate/state-translate.pipe';
@NgModule({
......@@ -22,6 +23,7 @@ import { CardItemComponent } from './componenets/card-item/card-item.component';
NavItemComponent,
LoadingSpinnerComponent,
FullnamePipe,
StateTranslatePipe,
CardItemComponent
],
......
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