Commit 4e505962 authored by hasan khaddour's avatar hasan khaddour

add project attachments

parent d4e57933
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</div> </div>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<button type="button" [routerLink]="['/tracks/project/',employeeParticipate.projectId,'employee',employeeParticipate.employeeId]" class="btn m-4 btn-sm btn-primary">استعراض متابعاتي به</button> <button type="button" [routerLink]="['/tracks/detail/',employeeParticipate.projectId,'employee',employeeParticipate.employeeId]" class="btn m-4 btn-sm btn-primary">استعراض متابعاتي به</button>
<button type="button" class="btn m-4 btn-sm btn-secondary">تقرير بمشاركتي</button> <button type="button" class="btn m-4 btn-sm btn-secondary">تقرير بمشاركتي</button>
</div> </div>
</div> </div>
......
import { Component } from '@angular/core';
@Component({
selector: 'attachment',
templateUrl: './attachment.component.html',
styleUrl: './attachment.component.css'
})
export class AttachmentComponent {
}
<div class="card shadow mb-4">
<div class="card-body text-center">
<div class="circle circle-lg bg-light my-4">
<span class="fe fe-file-text fe-24 text-success"
style="color: #3ad29f !important;"></span>
</div>
<div class="card-text my-2">
<strong class="card-title my-0">{{attachment.attachmentName}}</strong>
<p class="small text-muted mb-0">{{attachment.attachmentDescription}}</p>
</div>
</div> <!-- ./card-text -->
<div class="card-footer">
<div class="row align-items-center justify-content-between">
<div class="col text-center">
<small>
<a [routerLink]="['/uploads',attachment.attachmentUrl]" class="btn btn-primary">تنزيل </a>
</small>
</div>
<div class="col text-center">
<small>
<button data-bs-toggle="modal"
data-bs-target="#removeAttachmentModal" class="btn btn-secondary">إزالة</button>
</small>
</div>
</div>
</div> <!-- /.card-footer -->
</div>
\ No newline at end of file
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { Attachment } from '../../models/responses/attachment';
@Component({
selector: 'attahment-item',
templateUrl: './attahment-item.component.html',
styleUrl: './attahment-item.component.css'
})
export class AttahmentItemComponent {
@Input() attachment : Attachment
@Output() selected = new EventEmitter<Attachment>()
onSelected() {
this.selected.emit(this.attachment)
}
}
<p>add-attachment-modal works!</p> <div class="modal-header">
<button type="button" class="mr-4 ml-4 btn-close" (click)="onClose()"></button>
<h5 class="modal-title text-center">إضافة مرفق</h5>
</div>
<div class="modal-body">
<form #form="ngForm" (ngSubmit)="onSubmit()" #projectForm="ngForm">
<div class="row">
<div class="mb-3 col-3 offset-1">
<label for="attachmentName" class="form-label">اسم المرفق</label>
<input
type="text"
name="attachmentName"
id="attachmentName"
class="form-control"
placeholder="اسم المرفق"
[(ngModel)]="item.attachmentName"
required
/>
</div>
<div class="mb-3 col-8 offset-1">
<label for="attachmentDescription" class="form-label">الوصف</label>
<textarea
[cols]="4"
id="attachmentDescription"
class="form-control"
[(ngModel)]="item.attachmentDescription"
name="attachmentDescription"
placeholder="الوصف"
required
>
</textarea>
</div>
<div class="col-8 offset-1">
<input type="file" name="file"
(change)="onFileSelected($event)"
[(ngModel)]="item.file" required />
</div>
</div>
<div class="row">
<button
[disabled]="form.invalid"
type="submit"
class="m-4 col-3 btn btn-primary"
>
إضافة
</button>
<div class="btn m-4 btn-secondary col-3" (click)="onClose()">إغلاق</div>
</div>
</form>
</div>
import { Component } from '@angular/core'; import { Component, EventEmitter, Input, input, Output, output } from '@angular/core';
import { AddAttachmentRequest } from '../../../models/requests/project-requests/AddAttachmentRequest';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { ToastrService } from 'ngx-toastr';
import { CreateFinancialSpendItemRequest } from '../../../models/requests/financial-reuqests/CreateFinancialSpendItemRequest';
import { FinancialSpendingService } from '../../../services/financial-spending.service';
import { ProjectService } from '../../../services/project.service';
@Component({ @Component({
selector: 'add-attachment-modal', selector: 'add-attachment-modal',
...@@ -6,5 +12,56 @@ import { Component } from '@angular/core'; ...@@ -6,5 +12,56 @@ import { Component } from '@angular/core';
styleUrl: './add-attachment-modal.component.css' styleUrl: './add-attachment-modal.component.css'
}) })
export class AddAttachmentModalComponent { export class AddAttachmentModalComponent {
@Input() projectId :number
@Output() itemAdded= new EventEmitter<void>();
item : AddAttachmentRequest
selectedFile :File |null
constructor(
private toastr :ToastrService,
public activeModal: NgbActiveModal,
private projectService :ProjectService
) {}
ngOnInit(): void {
this.item ={
attachmentName:'اسم المرفق',
attachmentDescription:'وصف المرفق',
file:null,
projectId:this.projectId
}
}
onSubmit(): void {
// Emit the project data or handle it as needed
console.log('Project data submitted:', this.item);
this.item.file=this.selectedFile
this.projectService.addAttachment(this.item).subscribe({
next: (data)=>{
this.itemAdded.emit();
this.activeModal.close(data); // Close modal and pass data
},
error: (err )=> this.toastr.error("لقد حدث خطاء ما")
})
}
onFileSelected(event: Event): void {
const input = event.target as HTMLInputElement;
if (input.files?.length) {
this.selectedFile = input.files[0];
}
}
onClose():void {
this.activeModal.close();
}
} }
<!-- remove-participant-modal.component.html -->
<div class="modal fade" id="removeAttachmentModal" tabindex="-1" aria-labelledby="removeParticipantModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="removeParticipantModalLabel">إزالة مرفق من المشروع</h5>
<button type="button" class="ml-4 mr-4 btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>هل أنت متأكد من أنك تريد إزالة المرفق {{attachment.attachmentName}}</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">إلغاء</button>
<button type="button" class="btn btn-danger" (click)="onConfirmRemove()">إزالة</button>
</div>
</div>
</div>
</div>
\ No newline at end of file
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { Attachment } from '../../../models/responses/attachment';
import { RemoveParticipantRequest } from '../../../models/requests/project-requests/RemoveParticipant';
import { ProjectService } from '../../../services/project.service';
@Component({
selector: 'remove-attachment-modal',
templateUrl: './remove-attachment-modal.component.html',
styleUrl: './remove-attachment-modal.component.css'
})
export class RemoveAttachmentModalComponent {
@Input() attachment: Attachment;
@Output() attachmentRemoved = new EventEmitter<void>();
constructor(private projectService: ProjectService) {}
onConfirmRemove() {
}
}
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<div class="col text-center"> <div class="col text-center">
<small> <small>
<button [routerLink]="['/projects',participant.projectId,'/history/participationChange',participant.employeeId]" class="btn btn-secondary">التبدلات</button> <button [routerLink]="['/projects',participant.projectId,'history','participationChange',participant.employeeId]" class="btn btn-secondary">التبدلات</button>
</small> </small>
</div> </div>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</div> </div>
<!-- .col --> <!-- .col -->
<div class="col-md-6 col-lg-4"> <div class="col-md-6 col-lg-4">
<div class="card shadow mb-4"> <div class="card shadow mb-4" [routerLink]="['/projects',project.id,'attachments']">
<div class="card-body file-list"> <div class="card-body file-list">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="text-center"> <div class="text-center">
...@@ -32,8 +32,9 @@ ...@@ -32,8 +32,9 @@
<span class="fe fe-users fe-16 text-white"></span> <span class="fe fe-users fe-16 text-white"></span>
</div> </div>
</div> </div>
<div class="flex-fill ml-4 fname"> <div class="flex-fill ml-4 fname">
<strong>إضافة المرفقات</strong><br /> <strong> المرفقات</strong><br />
</div> </div>
</div> </div>
</div> </div>
...@@ -77,5 +78,19 @@ ...@@ -77,5 +78,19 @@
</div> <!-- .card-body --> </div> <!-- .card-body -->
</div> <!-- .card --> </div> <!-- .card -->
</div> </div>
<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>
</div> </div>
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<span class="fe fe-map fe-16 text-white"></span> <span class="fe fe-map fe-16 text-white"></span>
</div> </div>
<div class="flex-fill ml-4 fname"> <div class="flex-fill ml-4 fname">
<strong>بطاقة انشغالية العاملين</strong><br /> <strong>بطاقة الانشغالية </strong><br />
</div> </div>
</div> </div>
</div> <!-- .card-body --> </div> <!-- .card-body -->
......
...@@ -18,8 +18,10 @@ ...@@ -18,8 +18,10 @@
<div class="row align-items-center"> <div class="row align-items-center">
<div class="col-8 "> <div class="col-8 ">
<div class="small mb-2 d-flex"> <div class="small mb-2 d-flex">
<span class="text-muted flex-fill">نسبة الانجاز {{step.currentCompletionRatio}}</span> <span class="text-muted mr-4 ">نسبة الانجاز {{step.currentCompletionRatio}}</span>
<span class="text-muted">الثقل {{step.weight}}</span> <span class="text-muted mr-4 ">الثقل {{step.weight}}</span>
<span class="text-muted mr-4 ">عدد العمال المطلوب {{step.stepInfo.NumberOfWorker}}</span>
</div> </div>
</div> </div>
...@@ -33,9 +35,11 @@ ...@@ -33,9 +35,11 @@
</div> </div>
<div class="col-auto"> <div class="col-auto">
<button type="button" [routerLink]="['/tracks/history/step/',step.id]" class="btn m-2 btn-sm btn-primary">استعراض تاريخ متابعتها </button> <button type="button" [routerLink]="['/tracks/history/step/',step.id]" class="btn mr-2 btn-sm btn-primary">استعراض تاريخ متابعتها </button>
<button type="button" class="btn m-2 btn-sm btn-secondary">تعديل المعلومات</button> <button type="button" class="btn mr-2 btn-sm btn-secondary">تعديل الثقل</button>
<button type="button" (click)="onDelete()" class="btn m-2 btn-sm btn-danger">إزالة</button> <button type="button" class="btn mr-2 btn-sm btn-secondary">تعديل المعلومات</button>
<button type="button" (click)="onDelete()" class="btn mr2 btn-sm btn-danger">إزالة</button>
</div> </div>
</div> </div>
......
...@@ -2,5 +2,5 @@ export interface AddAttachmentRequest { ...@@ -2,5 +2,5 @@ export interface AddAttachmentRequest {
projectId: number; projectId: number;
attachmentDescription: string; attachmentDescription: string;
attachmentName: string; attachmentName: string;
file: File; file: File |null;
} }
<div class="container-fluid " *ngIf="history && 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">
</div>
</div>
<div class="row justify-content-center">
<div class="col-12">
<h2 class="h3 mb-4 page-title">قائمة تبدلات</h2>
<div class="row mt-5 align-items-center">
<div class="col-md-3 text-center mb-5">
<div class="avatar avatar-xl">
<img src="./assets/images/users/4.jpg" alt="..." class="avatar-img ">
</div>
</div>
<div class="col">
<div class="row align-items-center">
<div class="col-md-7">
<h4 class="mb-1">{{project.projectInfo.name}}</h4>
<p class="small mb-3"><span class="badge badge-dark">{{project.currentState | stateTranslate}}</span></p>
</div>
</div>
<div class="row mb-4">
<div class="col-md-7">
<p class="text-muted"> قائمة تبدلات أعمال السيد {{participant.personalInfo | fullname }} </p>
</div>
</div>
</div>
</div>
<div class="row mt-5 align-items-center">
<p>
إن السيد <b>{{participant.personalInfo | fullname}}</b>
يعمل حاليا في المشروع بصفة <b>{{currentParticipation.role}}</b> وبنسبة تفرغ قدرها <b>{{currentParticipation.partialTimeRatio}}</b> ويبين الجدول التالي تبدلات عمله اثناء عمله في المشروع
</p>
</div>
<div class="row mt-5 align-items-center">
<table class="table table-borderless table-striped">
<thead>
<tr>
<th scope="col" class=" text-center">#</th>
<th scope="col" class="text-center">تاريخ التبديل</th>
<th scope="col" class="text-center">صفة العمل قبل</th>
<th scope="col" class="text-center">صفة العمل بعد</th>
<th scope="col" class="text-center">نسبة التفرغ قبل </th>
<th scope="col" class="text-center">نسبة التفرغ بعد</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let spend of history ;index as i " >
<td scope="row" class="text-center">{{i +1 }}</td>
<td class="text-center"> {{spend.changeDate | date}}
</td>
<td class="text-center">{{spend.roleBefore }}</td>
<td class="text-center">{{spend.roleAfter}}</td>
<td class="text-center">{{spend.partialTimeBefore}}</td>
<td class="text-center">{{spend.partialTimeAfter}}</td>
</tr>
<tr *ngIf="history.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>
</tr>
<tr >
<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>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
import { Component, OnInit } from '@angular/core';
import { Project } from '../../models/responses/project';
import { Employee } from '../../../employees/models/responses/employee';
import { ParticipationChange } from '../../models/responses/participationChange';
import { ProjectService } from '../../services/project.service';
import { ActivatedRoute } from '@angular/router';
import { ToastrService } from 'ngx-toastr';
import { EmployeesService } from '../../../employees/services/employees.service';
import { EmployeeParticipate } from '../../../employees/models/responses/employeeParticipate';
@Component({
selector: 'participant-changes',
templateUrl: './participant-changes.component.html',
styleUrl: './participant-changes.component.css'
})
export class ParticipantChangesComponent implements OnInit{
projectId : number
participantId : number
project : Project
participant : Employee
history : ParticipationChange[]
currentParticipation :EmployeeParticipate
constructor(
private projectService :ProjectService,
private employeeServie :EmployeesService,
private route :ActivatedRoute,
private toastr :ToastrService
){}
ngOnInit(): void {
this
.projectId = Number(this.route.snapshot.paramMap.get('id'));
this
.participantId = Number(this.route.snapshot.paramMap.get('participantId'));
this
.employeeServie
.getEmployeeById(this.participantId)
.subscribe({
next:(data)=>{
this.participant=data
}
});
this
.projectService
.getProjectById(this.projectId)
.subscribe({
next:(data)=>{
this.project=data
this.currentParticipation=this.project.employeeParticipates.filter(e => e.employeeId == this.participantId)[0]
}
});
this
.projectService
.getParticipationChangeHistory(this.projectId)
.subscribe({
next: (data)=>{
this
.history=data.filter(e=> e.employeeId==this.participantId);
this
.toastr
.success('لقد تم تحميل تاريخ التبدلات بنجاح');
},
error:(err)=>{
this
.toastr
.error('لقد حدث خطاء ما');
}
});
}
}
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
[participant]="selectedParticipant" [participant]="selectedParticipant"
(participantEdited)="onParticipantUpdated()" (participantEdited)="onParticipantUpdated()"
></edit-participant-modal> ></edit-participant-modal>
<remove-participant-modal <remove-participant-modal *ngIf="selectedParticipant"
[participant]="selectedParticipant" [participant]="selectedParticipant"
(participantRemoved)="onParticipantRemoved()" (participantRemoved)="onParticipantRemoved()"
> >
......
<p>project-attachments works!</p> <section *ngIf="attachments" class="row">
<div class="row justify-content-center" >
<div class="col-12">
<div class="row align-items-center my-4">
<div class="col">
<h2 class="h4 mb-0 page-title">قائمة مرفقات المشروع</h2>
</div>
<div class="col-auto">
<button
type="button"
(click)="openAddModal()"
data-bs-toggle="modal"
data-bs-target="#addِAttachmentModal"
class="btn btn-primary"
>
<span class="fe fe-file-plus fe-12 mr-2"></span>إضافة مرفق
</button>
</div>
</div>
<hr />
<div class="row">
<attahment-item
class="col-3"
*ngFor="let attachment of attachments"
(selected)="setSelectedAttachment(attachment)"
[attachment]="attachment"
></attahment-item>
</div>
<div *ngIf="attachments.length == 0">
للأسف هذا المشروع لايحوي على أية مرفقات
</div>
</div>
</div>
<remove-attachment-modal *ngIf="selectedAtttachment"
[attachment]="attachments[0]"
(attachmentRemoved)="onAttahmentRemoved()"
>
</remove-attachment-modal>
</section>
\ No newline at end of file
import { Component } from '@angular/core'; import { Component, input, OnInit } from '@angular/core';
import { Attachment } from '../../models/responses/attachment';
import { ProjectService } from '../../services/project.service';
import { ToastrService } from 'ngx-toastr';
import { ActivatedRoute } from '@angular/router';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { AddAttachmentModalComponent } from '../../components/modals/add-attachment-modal/add-attachment-modal.component';
@Component({ @Component({
selector: 'project-attachments', selector: 'project-attachments',
templateUrl: './project-attachments.component.html', templateUrl: './project-attachments.component.html',
styleUrl: './project-attachments.component.css' styleUrl: './project-attachments.component.css'
}) })
export class ProjectAttachmentsComponent { export class ProjectAttachmentsComponent implements OnInit{
attachments : Attachment[]
projectId : number
selectedAtttachment : Attachment
constructor(
private projetService : ProjectService,
private toastr : ToastrService ,
private route : ActivatedRoute,
private modalService: NgbModal
){}
ngOnInit(): void {
this
.projectId = Number(this.route.snapshot.paramMap.get('id'));
this
.loadAttachment();
}
loadAttachment(){
this
.projetService
.getAttachment(this.projectId)
.subscribe({
next : (data)=>{
if(!this.attachments){
this.toastr.success('تم تحميل المرفقات بنجاح')
}
this.attachments=data
}
,
error:(err)=>{
this.toastr.error('لقد حدث خطاء ما')
}
});
}
setSelectedAttachment(selected : Attachment ): void {
this.selectedAtttachment = selected;
}
openAddModal(): void {
const modalRef = this.modalService.open(AddAttachmentModalComponent);
modalRef.componentInstance.projectId = this.projectId;
modalRef.componentInstance.itemAdded.subscribe(
{
next : ()=>{
this.loadAttachment()
}
}
);
modalRef.result.then((result) => {
if (result) {
// Add the new project to the list
this.loadAttachment();
}
}, (reason) => {
});
}
onAttahmentRemoved(): void {
this.loadAttachment();
}
} }
...@@ -6,6 +6,8 @@ import { ProjectCreateComponent } from './pages/project-create/project-create.co ...@@ -6,6 +6,8 @@ import { ProjectCreateComponent } from './pages/project-create/project-create.co
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 { FinancialSpendingComponent } from './pages/financial-spending/financial-spending.component'; import { FinancialSpendingComponent } from './pages/financial-spending/financial-spending.component';
import { ParticipantChangesComponent } from './pages/participant-changes/participant-changes.component';
import { ProjectAttachmentsComponent } from './pages/project-attachments/project-attachments.component';
const routes: Routes = [ const routes: Routes = [
...@@ -14,7 +16,10 @@ const routes: Routes = [ ...@@ -14,7 +16,10 @@ const routes: Routes = [
{ path: 'create', component: ProjectCreateComponent }, { path: 'create', component: ProjectCreateComponent },
{ path: ':id/steps', component: StepListComponent }, { path: ':id/steps', component: StepListComponent },
{ path: ':id/participants', component: ParticipantsListComponent }, { path: ':id/participants', component: ParticipantsListComponent },
{ path: ':id/spending', component: FinancialSpendingComponent } { path: ':id/spending', component: FinancialSpendingComponent },
{ path: ':id/history/participationChange/:participantId',component:ParticipantChangesComponent},
{ path: ':id/attachments',component:ProjectAttachmentsComponent}
......
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { ProjectItemComponent } from './components/project-item/project-item.component'; import { ProjectItemComponent } from './components/project-item/project-item.component';
import { AttachmentComponent } from './components/attachment/attachment.component';
import { ProjectListComponent } from './pages/project-list/project-list.component'; import { ProjectListComponent } from './pages/project-list/project-list.component';
import { ProjectDetailsComponent } from './pages/project-details/project-details.component'; import { ProjectDetailsComponent } from './pages/project-details/project-details.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
...@@ -35,11 +34,13 @@ import { AddParticipantModalComponent } from './components/modals/add-participan ...@@ -35,11 +34,13 @@ import { AddParticipantModalComponent } from './components/modals/add-participan
import { NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap'; import { NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap';
import { EditParticipantModalComponent } from './components/modals/edit-participant-modal/edit-participant-modal.component'; import { EditParticipantModalComponent } from './components/modals/edit-participant-modal/edit-participant-modal.component';
import { RemoveParticipantModalComponent } from './components/modals/remove-participant-modal/remove-participant-modal.component'; import { RemoveParticipantModalComponent } from './components/modals/remove-participant-modal/remove-participant-modal.component';
import { ParticipantChangesComponent } from './pages/participant-changes/participant-changes.component';
import { AttahmentItemComponent } from './components/attahment-item/attahment-item.component';
import { RemoveAttachmentModalComponent } from './components/modals/remove-attachment-modal/remove-attachment-modal.component';
@NgModule({ @NgModule({
declarations: [ declarations: [
ProjectItemComponent, ProjectItemComponent,
AttachmentComponent,
ProjectListComponent, ProjectListComponent,
ProjectDetailsComponent, ProjectDetailsComponent,
StepRowItemComponent, StepRowItemComponent,
...@@ -59,7 +60,10 @@ import { RemoveParticipantModalComponent } from './components/modals/remove-part ...@@ -59,7 +60,10 @@ import { RemoveParticipantModalComponent } from './components/modals/remove-part
ReportControllComponent, ReportControllComponent,
AddParticipantModalComponent, AddParticipantModalComponent,
EditParticipantModalComponent, EditParticipantModalComponent,
RemoveParticipantModalComponent RemoveParticipantModalComponent,
ParticipantChangesComponent,
AttahmentItemComponent,
RemoveAttachmentModalComponent
], ],
providers: [ providers: [
ProjectService, ProjectService,
......
...@@ -44,7 +44,7 @@ export class ProjectService { ...@@ -44,7 +44,7 @@ export class ProjectService {
return this return this
.http .http
.get<ParticipationChange[]>(this.config.getServerUrl()+'/projets/ParticipationChangeHistory/'+projectId) .get<ParticipationChange[]>(this.config.getServerUrl()+'/Projects/ParticipationChangeHistory/'+projectId)
} }
public getAll(pageSize : number | null , pageNumber :number |null):Observable<Project[]>{ public getAll(pageSize : number | null , pageNumber :number |null):Observable<Project[]>{
...@@ -192,14 +192,22 @@ export class ProjectService { ...@@ -192,14 +192,22 @@ export class ProjectService {
// //
public addAttachment(request : AddAttachmentRequest ):Observable<number>{ public addAttachment(request : AddAttachmentRequest ):Observable<number>{
return this.http.post<number>(this.config.getServerUrl()+ "/Projects/AddAttachment",request); const formData = new FormData();
formData.append('projectId', request.projectId.toString());
formData.append('attachmentName', request.attachmentName);
formData.append('attachmentDescription', request.attachmentDescription);
if (request.file) {
formData.append('file', request.file);
}
return this.http.post<number>(this.config.getServerUrl()+ "/Projects/AddAttachment",formData);
} }
//tihs method responsible for getting the attachments of a project //tihs method responsible for getting the attachments of a project
// //
public getAttachment(projectId : number ):Observable<Attachment[]>{ public getAttachment(projectId : number ):Observable<Attachment[]>{
return this.http.get<Attachment[]>(this.config.getServerUrl()+ "/Projects/Attachmetns/"+projectId); return this.http.get<Attachment[]>(this.config.getServerUrl()+ "/Projects/Attachments/?projectId="+projectId);
} }
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<div class="col-md-4"> <div class="col-md-4">
<p class="mb-4"> <p class="mb-4">
<strong>معلومات حالة المشروع </strong> <strong>معلومات حالة المشروع </strong>
<br /> المرحلة التطويرير : <small>{{project.currentState }} </small> <br /> المرحلة التطويرير : <small>{{project.currentState | stateTranslate}} </small>
<br />نوع المشروع : <small>{{project.projectType.typeName}} </small> <br />نوع المشروع : <small>{{project.projectType.typeName}} </small>
<br /> طبيعة المشروع : <small>{{project.projectClassification.projectNature}} </small> <br /> طبيعة المشروع : <small>{{project.projectClassification.projectNature}} </small>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="col-12"> <div class="col-12">
<div class="row align-items-center my-4"> <div class="row align-items-center my-4">
<div class="col"> <div class="col">
<h2 class="h3 mb-0 page-title"> قائمة عمليات المتابعة للمرحالة : {{step.stepInfo.stepName}} </h2> <h3 class="h3 mb-0 page-title"> قائمة عمليات المتابعة للمرحلة : {{step.stepInfo.stepName}} </h3>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<button type="button" class="btn btn-secondary"><span class="fe fe-file-plus fe-12 mr-2"></span>تقرير تاريخ متابعة </button> <button type="button" class="btn btn-secondary"><span class="fe fe-file-plus fe-12 mr-2"></span>تقرير تاريخ متابعة </button>
......
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