Commit 452aa9c3 authored by hasan khaddour's avatar hasan khaddour

final commit

parent b294e671
......@@ -36,8 +36,8 @@
</div>
<div class="col-auto">
<button type="button" [disabled]="canSee()" (click)="onEdit()" class="btn m-2 btn-sm btn-secondary">تعديل المعلومات</button>
<button type="button" [disabled]="canSee()" (click)="onDelete()"class="btn m-2 btn-sm btn-danger">إزالة</button>
<button type="button" [disabled]="!canEdit()" (click)="onEdit()" class="btn m-2 btn-sm btn-secondary">تعديل المعلومات</button>
<button type="button" [disabled]="!canEdit()" (click)="onDelete()"class="btn m-2 btn-sm btn-danger">إزالة</button>
</div>
</div>
......
......@@ -20,13 +20,15 @@ export class TypeItemComponent {
private ser : UserService
){}
canSee(){
return this.ser.hasRole(ROLES.CUSTOMERS_PLANER)
}
onEdit() {
this.edit.emit();
}
canEdit(): boolean {
return this.ser.hasRole(ROLES.PROJECTS_PLANNER);
}
onDelete() {
this.delete.emit();
}
......
......@@ -63,7 +63,7 @@ export class ProjectReplanModalComponent {
private _setCanMove(){
this.project.currentState.toLowerCase() =="inprogress" ? true : false ;
this.canRePlan=this.project.currentState.toLowerCase() =="inprogress" ? true : false ;
}
}
......@@ -151,8 +151,7 @@ export class ProjectCreateComponent {
// Autocomplete for Customer
this.filteredCustomers = this.projectForm.get('customer')!.valueChanges.pipe(
debounceTime(300),
switchMap(value => this.customersService.getCustomersByFilter(value))
switchMap(value => this.customersService.getCustomersByFilter(value).pipe( map ( e => e.filter(s => s.customerName.toLocaleLowerCase().includes(value)))))
);
}
......
......@@ -47,7 +47,7 @@ export class StepListComponent {
this.projectService.getProjectById(this.projectId).subscribe({
next: (data)=> {
this.steps= data.steps
this.steps= data.steps.sort( (e,p)=> Number(new Date (e.stepInfo.startDate)) - Number(new Date(p.stepInfo.startDate)) )
this.project=data;
this.toastr.success("تم تحميل المراحل بنجاح");
}
......
......@@ -15,11 +15,19 @@
طباعة
</button>
<button
[routerLink]="['/reports/definition',projectId]"
type="button" class="btn mr-1 btn-secondary m-1">
بطاقة التعريف
</button>
<button
[routerLink]="['/reports',projectId,'steptracks',trackId]"
type="button" class="btn mr-1 btn-secondary m-1">
تقرير متابعة العمالين
</button>
<button *ngIf="project.currentState.toLowerCase()=='completed'" type="button" class="btn mr-1 btn-secondary m-1">
<button
[routerLink]="['/reports/completion',project.id]"
*ngIf="project.currentState.toLowerCase()=='completed'" type="button" class="btn mr-1 btn-secondary m-1">
تقرير انجاز
</button>
<button
......
......@@ -7,7 +7,11 @@
<div class="mb-3">
<label for="stepName" class="form-label">اسم المرحلة</label>
<input type="text" id="stepName" formControlName="stepName" class="form-control"
[ngbTypeahead]="search" (selectItem)="onStepSelected($event.item)">
[ngbTypeahead]="search"
[resultFormatter]="resultFormatter"
[inputFormatter]="inputFormatter"
(selectItem)="onStepSelected($event)"
>
</div>
<input type="number" hidden id="id" formControlName="id" class="form-control" >
......
......@@ -65,11 +65,24 @@ export class AddStepTrackModalComponent {
search = (text$: Observable<string>) =>
text$.pipe(
map(term => term.length < 2 ? [] :
this.filteredSteps.filter(v => v.stepInfo.stepName.toLowerCase().includes(term.toLowerCase())).slice(0, 10).map( e =>{ this.stepTrackForm.patchValue({ id: e.id });return e.stepInfo.stepName +" % "+ e.currentCompletionRatio}))
);
this
.filteredSteps
.filter(v => v.stepInfo.stepName.toLowerCase().includes(term.toLowerCase()))
.slice(0, 10)
));
onStepSelected(step: Step): void {
resultFormatter = (step: Step) => `${step.stepInfo.stepName} - ${step.currentCompletionRatio} %`;
inputFormatter = (step: Step) => step.stepInfo.stepName;
onStepSelected(event: any): void {
const selectedStep = event.item;
this.stepTrackForm.patchValue({
stepName: this.resultFormatter(selectedStep),
id: selectedStep.id
});
debugger
// this.stepTrackForm.patchValue({ stepName1: step.stepInfo?.stepName });
......
<section *ngIf="tracks" class="row">
<section class="row">
<div class="row justify-content-center">
<div class="col-12">
<div class="row align-items-center my-4">
......@@ -9,6 +9,11 @@
</div>
<hr />
<card-skeleton *ngIf="!tracks">
</card-skeleton>
<div *ngIf="tracks">
<div class="card shadow mb-4 col-8 offset-2" *ngFor="let track of tracks">
<div class="card-header py-3">
<div class="row align-items-center">
......@@ -68,4 +73,6 @@
<div *ngIf="tracks.length == 0">لا يوجد أي عمليات متابعة غير مكتملة</div>
</div>
</div>
</div>
</section>
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