Commit 67b886e0 authored by hasan khaddour's avatar hasan khaddour

add employee participation

parent e007a8a7
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
} }
], ],
"styles": [ "styles": [
"@angular/material/prebuilt-themes/deeppurple-amber.css", "@angular/material/prebuilt-themes/azure-blue.css",
"src/styles.css", "src/styles.css",
"src/assets/css/app-light.css", "src/assets/css/app-light.css",
"./node_modules/@fortawesome/fontawesome-free/css/all.min.css", "./node_modules/@fortawesome/fontawesome-free/css/all.min.css",
......
...@@ -6,9 +6,13 @@ import { Observable } from 'rxjs'; ...@@ -6,9 +6,13 @@ import { Observable } from 'rxjs';
import { Result } from '../core/models/result'; import { Result } from '../core/models/result';
import { Employee } from './models/responses/employee'; import { Employee } from './models/responses/employee';
import { EmployeeProfileComponent } from './pages/employee-profile/employee-profile.component'; import { EmployeeProfileComponent } from './pages/employee-profile/employee-profile.component';
import { EmployeeParticipateComponent } from './pages/employee-participate/employee-participate.component';
import { EmployeeParticipatesComponent } from './pages/employee-participates/employee-participates.component';
const routes: Routes = [ const routes: Routes = [
{path:"profile", component:EmployeeProfileComponent} {path:"profile", component:EmployeeProfileComponent},
{path:"participates/:id", component:EmployeeParticipatesComponent}
]; ];
@NgModule({ @NgModule({
......
...@@ -6,6 +6,7 @@ import { EmployeeProfileComponent } from './pages/employee-profile/employee-prof ...@@ -6,6 +6,7 @@ import { EmployeeProfileComponent } from './pages/employee-profile/employee-prof
import { EmployeeParticipatesComponent } from './pages/employee-participates/employee-participates.component'; import { EmployeeParticipatesComponent } from './pages/employee-participates/employee-participates.component';
import { EmployeeParticipateComponent } from './pages/employee-participate/employee-participate.component'; import { EmployeeParticipateComponent } from './pages/employee-participate/employee-participate.component';
import { ParticipateItemComponent } from './components/participate-item/participate-item.component'; import { ParticipateItemComponent } from './components/participate-item/participate-item.component';
import { SharedModule } from '../shared/shared.module';
@NgModule({ @NgModule({
...@@ -17,6 +18,7 @@ import { ParticipateItemComponent } from './components/participate-item/particip ...@@ -17,6 +18,7 @@ import { ParticipateItemComponent } from './components/participate-item/particip
], ],
imports: [ imports: [
CommonModule, CommonModule,
SharedModule,
EmployeesRoutingModule EmployeesRoutingModule
] ]
}) })
......
<p>employee-participate works!</p> <div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row align-items-center">
<div class="col-auto">
<a href="profile-posts.html" class="avatar avatar-md">
<img src="./assets/images/users/4.jpg" alt="..." class="avatar-img rounded-circle">
</a>
</div>
<div class="col ml-n2">
<strong class="mb-1">{{employeeParticipate.partialTimeRatio}}</strong><span class="dot dot-lg bg-success ml-1"></span>
<p class="small text-muted mb-1">Fringilla Ornare Placerat Consulting</p>
</div>
<div class="col-auto">
<span class="m-1"><i class="fe fe-facebook fe-12 text-muted"></i></span>
<span class="m-1"><i class="fe fe-twitter fe-12 text-muted"></i></span>
</div>
</div>
</div>
<div class="card-body">
<div class="row align-items-center">
<div class="col">
<div class="small mb-2 d-flex">
<span class="text-muted flex-fill">Progress</span>
<span class="text-muted">68</span>
</div>
<div class="progress" style="height: 2px;">
<div class="progress-bar" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
<div class="col-auto">
<button type="button" class="btn btn-sm btn-primary">Message</button>
<button type="button" class="btn btn-sm btn-secondary">Profile</button>
</div>
</div>
</div> <!-- / .card-body -->
</div>
\ No newline at end of file
import { Component } from '@angular/core'; import { Component, Input } from '@angular/core';
import { EmployeeParticipate } from '../../models/responses/employeeParticipate';
@Component({ @Component({
selector: 'employee-participate', selector: 'employee-participate',
...@@ -7,4 +8,9 @@ import { Component } from '@angular/core'; ...@@ -7,4 +8,9 @@ import { Component } from '@angular/core';
}) })
export class EmployeeParticipateComponent { export class EmployeeParticipateComponent {
@Input() employeeParticipate :EmployeeParticipate
constructor(){}
} }
<p>employee-participates works!</p> <section *ngIf="employeeParticipates" class="row">
<employee-participate class="col-8 offset-2" *ngFor="let participate of employeeParticipates" [employeeParticipate]="participate"></employee-participate>
<div *ngIf="employeeParticipates.length==0">
للأسف أنت لم تشارك حتى الآن بأي مشروع
</div>
</section>
\ No newline at end of file
import { Component } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { EmployeeParticipate } from '../../models/responses/employeeParticipate';
import { EmployeesService } from '../../services/employees.service';
import { ToastrService } from 'ngx-toastr';
import { ActivatedRoute } from '@angular/router';
@Component({ @Component({
selector: 'employee-participates', selector: 'employee-participates',
templateUrl: './employee-participates.component.html', templateUrl: './employee-participates.component.html',
styleUrl: './employee-participates.component.css' styleUrl: './employee-participates.component.css'
}) })
export class EmployeeParticipatesComponent { export class EmployeeParticipatesComponent implements OnInit {
employeeParticipates : EmployeeParticipate[]
employeeId = Number(this.route.snapshot.paramMap.get('id'));
constructor(
private emploeesService :EmployeesService,
private toastr : ToastrService,
private route: ActivatedRoute
) {
}
ngOnInit(): void {
this.loadParticipations();
}
loadParticipations(): void{
this.emploeesService.getEmployeeParticipations(this.employeeId).subscribe({
next: (data)=> {
this.employeeParticipates= data
this.toastr.success("تم تحميل مساهماتك بنجاح");
}
,
error:(err)=>{
console.log(err)
this.toastr.error("لقد حدث خطاء ما")
}
})
}
} }
<section dir="lrt" class="vh-100" style="background-color: #f4f5f7;"> <div class="card profile shadow">
<div class="container py-5 h-100"> <div class="card-body my-4">
<div class="row d-flex justify-content-center align-items-center h-100"> <div class="row align-items-center">
<div class="col col-lg-6 mb-4 mb-lg-0"> <div class="col-md-3 text-center mb-5">
<div class="card mb-3" style="border-radius: .5rem;"> <a href="#!" class="avatar avatar-xl">
<div class="row g-0"> <img src="./assets/images/users/3.jpg" alt="..." class="avatar-img rounded-circle">
<div class="col-md-4 gradient-custom text-center text-white" </a>
style="border-top-left-radius: .5rem; border-bottom-left-radius: .5rem;"> </div>
<img src="https://mdbcdn.b-cdn.net/img/Photos/new-templates/bootstrap-chat/ava1-bg.webp" <div class="col">
alt="Avatar" class="img-fluid my-5" style="width: 80px;" /> <div class="row align-items-center">
<h5>Marie Horwitz</h5> <div class="col-md-7">
<p>Web Designer</p> <h4 class="mb-1 text-bold text-black">{{employee.personalInfo| fullname}}</h4>
<i class="far fa-edit mb-5"></i> <p class="small mb-3"><span class="text-primary">{{employee.email}}</span></p>
</div> </div>
<div class="col-md-8"> <div class="col">
<div class="card-body p-4"> </div>
<h6>Information</h6> </div>
<hr class="mt-0 mb-4"> <div class="row mb-4">
<div class="row pt-1"> <div class="col-md-7">
<div class="col-6 mb-3"> <p class="text-muted">الوظيفة {{employee.workInfo.workJob}} , صفة العمل {{employee.workInfo.workType}} </p>
<h6>Email</h6> </div>
<p class="text-muted">infoexample.com</p> <div class="col">
</div> <p class="small mb-0 text-muted">ساعات عملي {{employee.availability.currentWorkingHours}}</p>
<div class="col-6 mb-3"> <p class="small mb-0 text-muted">يعمل لدى {{employee.departmentName}}</p>
<h6>Phone</h6> </div>
<p class="text-muted">123 456 789</p> </div>
</div> <div class="row align-items-center">
</div> <div class="col mb-2">
<h6>Projects</h6> <button type="button" [routerLink]="['/employees/participates',id]" class="btn m-3 btn-primary">استعراض مساهماتي</button>
<hr class="mt-0 mb-4"> <button type="button" class="btn m-3 btn-secondary">إصدار تقرير بعملي</button>
<div class="row pt-1">
<div class="col-6 mb-3">
<h6>Recent</h6>
<p class="text-muted">Lorem ipsum</p>
</div>
<div class="col-6 mb-3">
<h6>Most Viewed</h6>
<p class="text-muted">Dolor sit amet</p>
</div>
</div>
<div class="d-flex justify-content-start">
<a href="#!"><i class="fab fa-facebook-f fa-lg me-3"></i></a>
<a href="#!"><i class="fab fa-twitter fa-lg me-3"></i></a>
<a href="#!"><i class="fab fa-instagram fa-lg"></i></a>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div> <!-- / .row- -->
</section> </div> <!-- / .card-body - -->
\ No newline at end of file </div>
\ No newline at end of file
import { Component } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Employee } from '../../models/responses/employee';
import { EmployeesService } from '../../services/employees.service';
import { ToastrService } from 'ngx-toastr';
import { UserService } from '../../../core/services/authentication/user.service';
@Component({ @Component({
selector: 'employee-profile', selector: 'employee-profile',
templateUrl: './employee-profile.component.html', templateUrl: './employee-profile.component.html',
styleUrl: './employee-profile.component.css' styleUrl: './employee-profile.component.css'
}) })
export class EmployeeProfileComponent { export class EmployeeProfileComponent implements OnInit{
employee : Employee
id : number
constructor(
private employeeSerivce : EmployeesService,
private userSerivce : UserService,
private toastr : ToastrService ){}
ngOnInit(): void {
this.id =this.userSerivce.getEmployeeId()
this.employeeSerivce.getCurrentEmployee().subscribe({
next:(data)=>this.employee=data,
error :(err)=>this.toastr.error("لقد حدث خطاء ما")
});
}
} }
...@@ -42,13 +42,13 @@ export class EmployeesService { ...@@ -42,13 +42,13 @@ export class EmployeesService {
public getAvailableEmployees( ):Observable<Employee[]>{ public getAvailableEmployees( ):Observable<Employee[]>{
//this api endpoint take a pagination , i'll use i later //this api endpoint take a pagination , i'll use it later
return this.http.get<Employee[]>(this.config.getServerUrl() + "/Employees/Available"); return this.http.get<Employee[]>(this.config.getServerUrl() + "/Employees/Available");
} }
public getEmployeeParticipations(id :number ):Observable<EmployeeParticipate[]>{ public getEmployeeParticipations(id :number ):Observable<EmployeeParticipate[]>{
return this.http.get<EmployeeParticipate[]>(`${this.config.getServerUrl}/Employees/EmployeeParticipations/employeeId=${id}`); return this.http.get<EmployeeParticipate[]>(`${this.config.getServerUrl()}/Employees/EmployeeParticipations/?employeeId=${id}`);
} }
public getMyParticipation( ):Observable<EmployeeParticipate[]>{ public getMyParticipation( ):Observable<EmployeeParticipate[]>{
......
import { Aggreement } from "../valueObjects/Aggreement" import { Aggreement } from "../../valueObjects/Aggreement"
import { FinancialFund } from "../valueObjects/FinancialFund" import { FinancialFund } from "../../valueObjects/FinancialFund"
import { ProjectClassification } from "../valueObjects/ProjectClassification" import { ProjectClassification } from "../../valueObjects/ProjectClassification"
import { ProjectInfo } from "../valueObjects/ProjectInfo" import { ProjectInfo } from "../../valueObjects/ProjectInfo"
import { ProposalInfo } from "../valueObjects/proposalInfo" import { ProposalInfo } from "../../valueObjects/proposalInfo"
export class CreateProjectRequest { export class CreateProjectRequest {
projectInfo :ProjectInfo projectInfo :ProjectInfo
......
export interface FinancialFund { export interface FinancialFund {
financialStatus: string; financialStatus: string;
source: string; source: string;
} }
......
import { Component } from '@angular/core';
@Component({
selector: 'project-attachments',
templateUrl: './project-attachments.component.html',
styleUrl: './project-attachments.component.css'
})
export class ProjectAttachmentsComponent {
}
...@@ -120,10 +120,10 @@ ...@@ -120,10 +120,10 @@
</div> </div>
<div class="col-4" formGroupName="executerId"> <div class="col-4">
<mat-form-field> <mat-form-field>
<mat-label>الفعالية المنفذة </mat-label> <mat-label>الفعالية المنفذة </mat-label>
<mat-select> <mat-select formControlName="executerId">
<mat-option value="1">قسم المعلوميات</mat-option> <mat-option value="1">قسم المعلوميات</mat-option>
<mat-option value="2">قسم النظم الاكترونية</mat-option> <mat-option value="2">قسم النظم الاكترونية</mat-option>
</mat-select> </mat-select>
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
<div class="row mb-4" formGroupName="projectClassification"> <div class="row mb-4" formGroupName="projectClassification">
<mat-form-field class="col-4"> <mat-form-field class="col-4">
<mat-label for="projectStatus" class="form-label" >وضع النشاط</mat-label> <mat-label for="projectStatus" class="form-label" >حالة النشاط</mat-label>
<input formControlName="projectStatus" class="form-control" id="projectStatus" matInput /> <input formControlName="projectStatus" class="form-control" id="projectStatus" matInput />
</mat-form-field> </mat-form-field>
......
...@@ -7,8 +7,8 @@ import { Result } from '../../../core/models/result'; ...@@ -7,8 +7,8 @@ import { Result } from '../../../core/models/result';
import { Project } from '../../models/responses/project'; import { Project } from '../../models/responses/project';
import { Customer } from '../../../customers/models/customer'; import { Customer } from '../../../customers/models/customer';
import { CustomerService } from '../../../customers/services/customer.service'; import { CustomerService } from '../../../customers/services/customer.service';
import { CreateProjectRequest } from '../../models/requests/createProjectRequest';
import { ProjectService } from '../../services/project.service'; import { ProjectService } from '../../services/project.service';
import { CreateProjectRequest } from '../../models/requests/project-requests/createProjectRequest';
@Component({ @Component({
selector: 'project-create', selector: 'project-create',
...@@ -117,8 +117,12 @@ export class ProjectCreateComponent { ...@@ -117,8 +117,12 @@ export class ProjectCreateComponent {
onSubmit(request : CreateProjectRequest){ onSubmit(request : CreateProjectRequest){
console.log(request)
console.log(this.projectForm.errors)
if(this.projectForm.valid){ if(this.projectForm.valid){
console.log(true) console.log(request);
this.projectService.createProject(request);
} }
......
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
<p class="mb-4"> <p class="mb-4">
<strong>مدير المشروع </strong> <strong>مدير المشروع </strong>
<br/><small>{{project.projectManager.personalInfo.firstName}}</small> <br/><small>{{project.projectManager.personalInfo | fullname}}</small>
</p> </p>
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
<p class="mb-4"> <p class="mb-4">
<strong>رئيس فريق العمل </strong> <strong>رئيس فريق العمل </strong>
<br/><small>{{project.projectManager.personalInfo.firstName}}</small> <br/><small>{{project.projectManager.personalInfo | fullname }}</small>
</p> </p>
...@@ -203,32 +203,118 @@ ...@@ -203,32 +203,118 @@
<img src="/assets/images/users/4.jpg" class="navbar-brand-img brand-sm mx-auto my-4" alt="..."> <img src="/assets/images/users/4.jpg" class="navbar-brand-img brand-sm mx-auto my-4" alt="...">
</div> </div>
</div> <!-- /.row --> </div> <!-- /.row -->
<hr>
<hr> <div class="row align-items-center mb-4">
<div class="row mt-5"> <div class="col-auto">
<button class="btn btn-primary">لاطلاع على خطة الانفاق</button> <strong>تخطيط المشروع</strong>
<button class="btn btn-primary">الاطلاع على المرفقات </button> </div>
<button class="btn btn-primary">الاطلاع على عمليات المتابعة</button>
<div class="row">
<div class="col-md-6 col-lg-4">
<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 class="fe fe-credit-card fe-16 text-white"></span>
</div>
<div class="flex-fill ml-4 fname">
<strong>إارة خطة الانفاق</strong><br />
</div>
</div>
</div> <!-- .card-body -->
</div> <!-- .card -->
</div> <!-- .col -->
<div class="col-md-6 col-lg-4">
<div class="card shadow mb-4">
<div class="card-body file-list">
<div class="d-flex align-items-center">
<div class="text-center">
<div class="circle circle-md bg-secondary">
<span class="fe fe-users fe-16 text-white"></span>
</div>
</div>
<div class="flex-fill ml-4 fname">
<strong>إضافة معلومات المشروع</strong><br />
</div>
</div>
</div> <!-- .card-body -->
</div> <!-- .card -->
</div> <!-- .col -->
<div class="col-md-6 col-lg-4">
<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 class="fe fe-map fe-16 text-white"></span>
</div>
<div class="flex-fill ml-4 fname">
<strong>إدارة الخطة</strong><br />
</div>
</div>
</div> <!-- .card-body -->
</div> <!-- .card -->
</div> <!-- .row -->
</div> </div>
<div class="row mt-5 d-flex align-items-around">
<button class=" btn btn-primary">إضافة مرفقات</button> <hr>
<button class=" btn btn-primary">إضافة دراسة جدوى </button> <div class="row align-items-center mb-4">
<button class=" btn btn-primary">إضافة تصنيف مشروع</button> <div class="col-auto ">
<strong>معلومات المشروع</strong>
</div>
<div class="row">
<div class="col-md-6 col-lg-4">
<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 class="fe fe-credit-card fe-16 text-white"></span>
</div>
<div class="flex-fill ml-4 fname">
<strong>المراحل</strong><br />
</div>
</div> </div>
</div> <!-- .card-body -->
<div class="row mt-5"> </div> <!-- .card -->
<button class="btn btn-primary">إضافة مرحلة</button> </div> <!-- .col -->
<button class="btn btn-primary">إضافة مشارك</button> <div class="col-md-6 col-lg-4">
</div> <div class="card shadow mb-4">
<div class="row mt-5"> <div class="card-body file-list">
<button class="btn btn-primary">إضافة عملية متابعة</button> <div class="d-flex align-items-center">
<div class="text-center">
<div class="circle circle-md bg-secondary">
</div> <span class="fe fe-users fe-16 text-white"></span>
<hr> </div>
</div>
<div class="flex-fill ml-4 fname">
<strong>إضافة المرفقات</strong><br />
</div>
</div>
</div> <!-- .card-body -->
</div> <!-- .card -->
</div> <!-- .col -->
<div class="col-md-6 col-lg-4">
<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 class="fe fe-map fe-16 text-white"></span>
</div>
<div class="flex-fill ml-4 fname">
<strong>إدارة المشاركين</strong><br />
</div>
</div>
</div> <!-- .card-body -->
</div> <!-- .card -->
</div> <!-- .row -->
</div>
<hr>
<div class="row mt-5"> <div class="row mt-5">
<div class="col-2 text-center"> <div class="col-2 text-center">
<img src="/assets/images/users/4.jpg" class="navbar-brand-img brand-sm mx-auto my-4" alt="..."> <img src="/assets/images/users/4.jpg" class="navbar-brand-img brand-sm mx-auto my-4" alt="...">
......
...@@ -19,6 +19,7 @@ import { ProjectService } from './services/project.service'; ...@@ -19,6 +19,7 @@ import { ProjectService } from './services/project.service';
import {MatSelectModule} from '@angular/material/select'; import {MatSelectModule} from '@angular/material/select';
import {MatDatepickerModule} from '@angular/material/datepicker'; import {MatDatepickerModule} from '@angular/material/datepicker';
import {provideNativeDateAdapter} from '@angular/material/core'; import {provideNativeDateAdapter} from '@angular/material/core';
import { ProjectAttachmentsComponent } from './pages/project-attachments/project-attachments.component';
@NgModule({ @NgModule({
declarations: [ declarations: [
...@@ -28,7 +29,8 @@ import {provideNativeDateAdapter} from '@angular/material/core'; ...@@ -28,7 +29,8 @@ import {provideNativeDateAdapter} from '@angular/material/core';
ProjectDetailsComponent, ProjectDetailsComponent,
StepRowItemComponent, StepRowItemComponent,
ProjectHeaderComponent, ProjectHeaderComponent,
ProjectCreateComponent ProjectCreateComponent,
ProjectAttachmentsComponent
], ],
providers: [ providers: [
ProjectService, ProjectService,
......
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