Commit 503af17c authored by hasan khaddour's avatar hasan khaddour

fixed s .

parent 39eaf4f3
import { Component } from '@angular/core';
@Component({
selector: 'info-controll',
templateUrl: './info-controll.component.html',
styleUrl: './info-controll.component.css'
})
export class InfoControllComponent {
}
import { Component } from '@angular/core';
@Component({
selector: 'plan-controll',
templateUrl: './plan-controll.component.html',
styleUrl: './plan-controll.component.css'
})
export class PlanControllComponent {
}
import { Component } from '@angular/core';
@Component({
selector: 'track-controll',
templateUrl: './track-controll.component.html',
styleUrl: './track-controll.component.css'
})
export class TrackControllComponent {
}
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let step of steps " > <tr *ngFor="let step of steps ; index as i " >
<th scope="row"></th> <th scope="row">{{i+1}}</th>
<td> {{step.stepInfo.stepName}} <td> {{step.stepInfo.stepName}}
</td> </td>
<td class="text-left">{{step.stepInfo.description}}</td> <td class="text-left">{{step.stepInfo.description}}</td>
......
...@@ -3,3 +3,8 @@ export interface GetProjectsByProjectManagerRequest { ...@@ -3,3 +3,8 @@ export interface GetProjectsByProjectManagerRequest {
pageNumber: number | null; pageNumber: number | null;
pageSize: number | null; pageSize: number | null;
} }
export interface GetProjectsByTeamLeaderRequest {
teamLeaderrId: number;
pageNumber: number | null;
pageSize: number | null;
}
...@@ -4,6 +4,8 @@ import { ToastrService } from 'ngx-toastr'; ...@@ -4,6 +4,8 @@ import { ToastrService } from 'ngx-toastr';
import { Project } from '../../models/responses/project'; import { Project } from '../../models/responses/project';
import { PdfDownloaderService } from '../../../core/services/pdfDownloader/pdf-downloader.service'; import { PdfDownloaderService } from '../../../core/services/pdfDownloader/pdf-downloader.service';
import { ProjectService } from '../../services/project.service'; import { ProjectService } from '../../services/project.service';
import { icons } from 'feather-icons/generated/feather-icons';
import { param } from 'jquery';
@Component({ @Component({
selector: 'project-details', selector: 'project-details',
...@@ -12,7 +14,7 @@ import { ProjectService } from '../../services/project.service'; ...@@ -12,7 +14,7 @@ import { ProjectService } from '../../services/project.service';
}) })
export class ProjectDetailsComponent implements OnInit { export class ProjectDetailsComponent implements OnInit {
project : Project project : Project
@ViewChild('dataToExport', { static: false }) public dataToExport: ElementRef;
constructor( constructor(
public router : Router, public router : Router,
private route: ActivatedRoute, private route: ActivatedRoute,
......
...@@ -10,9 +10,13 @@ ...@@ -10,9 +10,13 @@
</div> </div>
</div> </div>
<hr> <hr>
<div class="row"> <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-md-4" (click)="this.router.navigate(['projects/detail',project.id])" *ngFor="let project of projects" [project]="project"></project-item>
</div> </div>
<div class="row" *ngIf="projects.length == 0">
لا يوجد أي مشروع
</div>
</div> </div>
</div> </div>
</div>
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { ToastrService } from 'ngx-toastr'; import { ToastrService } from 'ngx-toastr';
import { LoadingService } from '../../../core/services/loading/loading-service.service'; import { LoadingService } from '../../../core/services/loading/loading-service.service';
import { Project } from '../../models/responses/project'; import { Project } from '../../models/responses/project';
import { ProjectService } from '../../services/project.service'; import { ProjectService } from '../../services/project.service';
import { GetProjectsByProjectManagerRequest, GetProjectsByTeamLeaderRequest } from '../../models/requests/project-requests/GetProjectsByProjectManagerRequest';
import { UserService } from '../../../core/services/authentication/user.service';
@Component({ @Component({
selector: 'project-list', selector: 'project-list',
...@@ -12,24 +14,53 @@ import { ProjectService } from '../../services/project.service'; ...@@ -12,24 +14,53 @@ import { ProjectService } from '../../services/project.service';
}) })
export class ProjectListComponent implements OnInit{ export class ProjectListComponent implements OnInit{
listType : string
projects : Project[] projects : Project[]
constructor( constructor(
private projectService : ProjectService, private projectService : ProjectService,
private toastr: ToastrService, private toastr: ToastrService,
public router: Router, public router: Router,
private route :ActivatedRoute,
private userService : UserService,
private loadingService: LoadingService private loadingService: LoadingService
) { ) {
} }
ngOnInit(): void { ngOnInit(): void {
this.loadProjects();
this.route.queryParams.subscribe(params => {
this.listType = params['listType'];
}
);
this.loadProjects();
} }
loadProjects():void{ loadProjects():void{
this.loadingService.show() this.loadingService.show()
switch (this.listType) {
case 'all':
this.handelAll()
break;
case 'managed':
this.handelByManager()
break;
case 'leaded':
this.handelByLeader()
break;
default :
this.router.navigate(['/home'])
this.toastr.error('لقد طلبت صفحة غير موجودة ')
break ;
}
}
handelAll() {
this.projectService.getByFilter() this.projectService.getByFilter()
.subscribe( .subscribe(
{ {
...@@ -46,5 +77,59 @@ export class ProjectListComponent implements OnInit{ ...@@ -46,5 +77,59 @@ export class ProjectListComponent implements OnInit{
} }
); );
} }
handelByManager(){
let request :GetProjectsByProjectManagerRequest = {
projectMangerId : this.userService.getEmployeeId(),
pageNumber: null ,
pageSize:null
}
this.projectService.getByProjectManger(request)
.subscribe(
{
next: (res)=>{
this.projects = res;
this.toastr.success("تم تحميل المشاريع بنجاح");
this.loadingService.hide()
},
error: (err)=>{
this.toastr.error("لقد حدث خظاء ما");
this.loadingService.hide()
}
}
);
}
handelByLeader(){
let request :GetProjectsByTeamLeaderRequest ={
teamLeaderrId : this.userService.getEmployeeId(),
pageNumber: null ,
pageSize:null
}
this.projectService.getByTeamLeader(request)
.subscribe(
{
next: (res)=>{
this.projects = res;
this.toastr.success("تم تحميل المشاريع بنجاح");
this.loadingService.hide()
},
error: (err)=>{
this.toastr.error("لقد حدث خظاء ما");
this.loadingService.hide()
}
}
);
}
} }
\ No newline at end of file
...@@ -27,6 +27,9 @@ import { ProjectFooterComponent } from './components/project-footer/project-foot ...@@ -27,6 +27,9 @@ import { ProjectFooterComponent } from './components/project-footer/project-foot
import { StepListComponent } from './pages/step-list/step-list.component'; import { StepListComponent } from './pages/step-list/step-list.component';
import { ParticipantsListComponent } from './pages/participants-list/participants-list.component'; import { ParticipantsListComponent } from './pages/participants-list/participants-list.component';
import { ParticipantItemComponent } from './components/participant-item/participant-item.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';
@NgModule({ @NgModule({
declarations: [ declarations: [
...@@ -44,7 +47,10 @@ import { ParticipantItemComponent } from './components/participant-item/particip ...@@ -44,7 +47,10 @@ import { ParticipantItemComponent } from './components/participant-item/particip
ProjectFooterComponent, ProjectFooterComponent,
StepListComponent, StepListComponent,
ParticipantsListComponent, ParticipantsListComponent,
ParticipantItemComponent ParticipantItemComponent,
PlanControllComponent,
TrackControllComponent,
InfoControllComponent
], ],
providers: [ providers: [
ProjectService, ProjectService,
......
...@@ -4,7 +4,7 @@ import { ConfigurationService } from '../../core/services/configuration/configur ...@@ -4,7 +4,7 @@ import { ConfigurationService } from '../../core/services/configuration/configur
import { Project } from '../models/responses/project'; import { Project } from '../models/responses/project';
import { Result } from '../../core/models/result'; import { Result } from '../../core/models/result';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { GetProjectsByProjectManagerRequest } from '../models/requests/project-requests/GetProjectsByProjectManagerRequest'; import { GetProjectsByProjectManagerRequest, GetProjectsByTeamLeaderRequest } from '../models/requests/project-requests/GetProjectsByProjectManagerRequest';
import { EmployeeParticipate } from '../../employees/models/responses/employeeParticipate'; import { EmployeeParticipate } from '../../employees/models/responses/employeeParticipate';
import { ChangeProjectTeamLeaderRequest } from '../models/requests/project-requests/ChangeProjectTeamLeaderRequest'; import { ChangeProjectTeamLeaderRequest } from '../models/requests/project-requests/ChangeProjectTeamLeaderRequest';
import { ChangeProjectManagerRequest } from '../models/requests/project-requests/ChangeProjectManagerRequest'; import { ChangeProjectManagerRequest } from '../models/requests/project-requests/ChangeProjectManagerRequest';
...@@ -59,10 +59,17 @@ export class ProjectService { ...@@ -59,10 +59,17 @@ export class ProjectService {
let pagination =this.getPagination(request.pageSize,request.pageNumber); let pagination =this.getPagination(request.pageSize,request.pageNumber);
return this return this
.http .http
.get<Project[]>(` .get<Project[]>(`${this.config.getServerUrl()}/Projects/ByProjectManager/?projectManagerId=${request.projectMangerId}${pagination}`);
${this.config.getServerUrl()}
/Projects/ByProjectManager/?projectManagerId=${request.projectMangerId}${pagination}`);
} }
// this method retreive the projects by its manager
public getByTeamLeader(request : GetProjectsByTeamLeaderRequest ):Observable<Project[]>{
let pagination =this.getPagination(request.pageSize,request.pageNumber);
return this
.http
.get<Project[]>(`${this.config.getServerUrl()}/Projects/ByFilter/?teamLeaderId=${request.teamLeaderrId}${pagination}`);
}
//#endregion queries //#endregion queries
//#region planning managment //#region planning managment
......
<div class="col-md-6 col-lg-4" [routerLink]="[item.navigate,item.params]">
<div class="card shadow mb-4">
<div class="card-body file-list">
<div class="d-flex align-items-center">
<div class="circle circle-md bg-secondary">
<span [classList]="['fe', 'fe-16', 'text-white',item.icon]" ></span>
</div>
<div class="flex-fill ml-4 fname">
<strong>{{item.name}}</strong><br />
</div>
</div>
</div> <!-- .card-body -->
</div> <!-- .card -->
</div> <!-- .row -->
import { Component, Input } from '@angular/core';
@Component({
selector: 'card-item',
templateUrl: './card-item.component.html',
styleUrl: './card-item.component.css'
})
export class CardItemComponent {
@Input() item : {
navigate : string ,
icon :String ,
name :string ,
params : any []
}
}
...@@ -9,6 +9,7 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; ...@@ -9,6 +9,7 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { NavItemComponent } from './componenets/nav-item/nav-item.component'; import { NavItemComponent } from './componenets/nav-item/nav-item.component';
import { LoadingSpinnerComponent } from './componenets/loading-spinner/loading-spinner.component'; import { LoadingSpinnerComponent } from './componenets/loading-spinner/loading-spinner.component';
import { FullnamePipe } from './pipes/fullName/fullname.pipe'; import { FullnamePipe } from './pipes/fullName/fullname.pipe';
import { CardItemComponent } from './componenets/card-item/card-item.component';
@NgModule({ @NgModule({
...@@ -20,7 +21,8 @@ import { FullnamePipe } from './pipes/fullName/fullname.pipe'; ...@@ -20,7 +21,8 @@ import { FullnamePipe } from './pipes/fullName/fullname.pipe';
LayoutComponent, LayoutComponent,
NavItemComponent, NavItemComponent,
LoadingSpinnerComponent, LoadingSpinnerComponent,
FullnamePipe FullnamePipe,
CardItemComponent
], ],
imports: [ imports: [
...@@ -33,6 +35,7 @@ import { FullnamePipe } from './pipes/fullName/fullname.pipe'; ...@@ -33,6 +35,7 @@ import { FullnamePipe } from './pipes/fullName/fullname.pipe';
SidebarComponent, SidebarComponent,
LayoutComponent, LayoutComponent,
FullnamePipe, FullnamePipe,
CardItemComponent,
LoadingSpinnerComponent LoadingSpinnerComponent
],schemas: [CUSTOM_ELEMENTS_SCHEMA] ],schemas: [CUSTOM_ELEMENTS_SCHEMA]
}) })
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</li> </li>
<li> <li>
<a class="dropdown-item d-flex align-items-center" [routerLink]="['/employees/profile']"> <a class="dropdown-item text-center d-flex align-items-center" [routerLink]="['/employees/profile']">
<i class="fe fe-user"></i> <i class="fe fe-user"></i>
<span>ملفي الشخصي</span> <span>ملفي الشخصي</span>
</a> </a>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</li> </li>
<li> <li>
<button class="dropdown-item d-flex align-items-center" (click)="logout()"> <button class="text-center dropdown-item d-flex align-items-center" (click)="logout()">
<i class="fe fe-log-out"></i> <i class="fe fe-log-out"></i>
<span>تسجيل الخروج</span> <span>تسجيل الخروج</span>
</button> </button>
......
...@@ -24,7 +24,9 @@ ...@@ -24,7 +24,9 @@
<a href="components-alerts.html"> <a href="components-alerts.html">
<i class="fe fe-circle"></i><span>اتمام عملية متابعة</span> <i class="fe fe-circle"></i><span>اتمام عملية متابعة</span>
</a> </a>
</li> </li>
</ul> </ul>
</li><!-- End Components Nav --> </li><!-- End Components Nav -->
...@@ -33,6 +35,7 @@ ...@@ -33,6 +35,7 @@
<i class="fe fe-flag"></i><span> عمليات المتابعة</span> <i class="fe fe-flag"></i><span> عمليات المتابعة</span>
</a> </a>
</li> </li>
<li class="nav-heading">التقارير</li> <li class="nav-heading">التقارير</li>
<li class="nav-item"> <li class="nav-item">
...@@ -69,6 +72,7 @@ ...@@ -69,6 +72,7 @@
<i class="fe fe-edit-2"></i><span>إضافة جهة طارحة</span> <i class="fe fe-edit-2"></i><span>إضافة جهة طارحة</span>
</a> </a>
</li> </li>
<li class="nav-heading">إدارة المشاريع</li> <li class="nav-heading">إدارة المشاريع</li>
<li class="nav-item"> <li class="nav-item">
...@@ -77,20 +81,37 @@ ...@@ -77,20 +81,37 @@
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a [routerLink]="['/projects']" class="nav-link collapsed"> <a
[routerLink]="['/projects']"
[queryParams]="{ listType: 'all'}"
class="nav-link collapsed">
<i class="bi bi-circle"></i><span>استعراض المشاريع</span> <i class="bi bi-circle"></i><span>استعراض المشاريع</span>
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link collapsed" href="forms-editors.html"> <a
[routerLink]="['/projects']"
[queryParams]="{ listType: 'managed'}"
class="nav-link collapsed"
>
<i class="bi bi-circle"></i><span>المشاريع التي أديرها</span> <i class="bi bi-circle"></i><span>المشاريع التي أديرها</span>
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link collapsed"> <a
[routerLink]="['/projects']"
[queryParams]="{ listType: 'leaded'}"
class="nav-link collapsed"
>
<i class="bi bi-circle"></i><span>المشاريع التي أرأسها</span> <i class="bi bi-circle"></i><span>المشاريع التي أرأسها</span>
</a> </a>
</li> </li>
<li class="nav-item">
<a class="nav-link collapsed">
<i class="bi bi-circle"></i><span>تخطيط مشروع</span>
</a>
</li>
<li class="nav-heading">العمل</li> <li class="nav-heading">العمل</li>
<li [routerLink]="['/employees/participates',id]" class="nav-item"> <li [routerLink]="['/employees/participates',id]" class="nav-item">
...@@ -116,6 +137,13 @@ ...@@ -116,6 +137,13 @@
<i class="bi bi-layout-text-window-reverse"></i><span>ملامح المشروع</span><i class="bi bi-chevron-down ms-auto"></i> <i class="bi bi-layout-text-window-reverse"></i><span>ملامح المشروع</span><i class="bi bi-chevron-down ms-auto"></i>
</a> </a>
</li> </li>
<li class="nav-item">
<a [routerLink]="['/Help']" class="nav-link collapsed" >
<i class="bi bi-layout-text-window-reverse"></i><span>مساعدة</span><i class="bi bi-chevron-down ms-auto"></i>
</a>
</li>
</ul> </ul>
</aside><!-- End Sidebar--> </aside><!-- End Sidebar-->
\ No newline at end of file
import { Component } from '@angular/core';
@Component({
selector: 'step-track-history',
templateUrl: './step-track-history.component.html',
styleUrl: './step-track-history.component.css'
})
export class StepTrackHistoryComponent {
}
...@@ -9,6 +9,7 @@ import { StepTrackComponent } from './components/step-track/step-track.component ...@@ -9,6 +9,7 @@ import { StepTrackComponent } from './components/step-track/step-track.component
import { EmployeeTrackComponent } from './components/employee-track/employee-track.component'; import { EmployeeTrackComponent } from './components/employee-track/employee-track.component';
import { StepTrackDetailsComponent } from './pages/step-track-details/step-track-details.component'; import { StepTrackDetailsComponent } from './pages/step-track-details/step-track-details.component';
import { ProjectTrackHistoryComponent } from './pages/project-track-history/project-track-history.component'; import { ProjectTrackHistoryComponent } from './pages/project-track-history/project-track-history.component';
import { StepTrackHistoryComponent } from './pages/step-track-history/step-track-history.component';
@NgModule({ @NgModule({
...@@ -19,7 +20,8 @@ import { ProjectTrackHistoryComponent } from './pages/project-track-history/proj ...@@ -19,7 +20,8 @@ import { ProjectTrackHistoryComponent } from './pages/project-track-history/proj
StepTrackComponent, StepTrackComponent,
EmployeeTrackComponent, EmployeeTrackComponent,
StepTrackDetailsComponent, StepTrackDetailsComponent,
ProjectTrackHistoryComponent ProjectTrackHistoryComponent,
StepTrackHistoryComponent
], ],
imports: [ imports: [
CommonModule, CommonModule,
......
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