Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
PSManagementUI
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hasan.bahjat
PSManagementUI
Commits
4e3b3a70
You need to sign in or sign up before continuing.
Commit
4e3b3a70
authored
Aug 29, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add step update
parent
edffc18a
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
329 additions
and
74 deletions
+329
-74
edit-step-modal.component.html
...tep-modals/edit-step-modal/edit-step-modal.component.html
+77
-45
edit-step-modal.component.ts
.../step-modals/edit-step-modal/edit-step-modal.component.ts
+1
-1
employee-track.component.html
...s/components/employee-track/employee-track.component.html
+2
-2
employee-track.component.ts
...cks/components/employee-track/employee-track.component.ts
+35
-0
add-employee-track-modal.component.html
...loyee-track-modal/add-employee-track-modal.component.html
+1
-1
add-employee-track-modal.component.ts
...mployee-track-modal/add-employee-track-modal.component.ts
+1
-1
add-step-track-modal.component.ts
...ls/add-step-track-modal/add-step-track-modal.component.ts
+9
-2
complete-track-modal.component.html
.../complete-track-modal/complete-track-modal.component.html
+3
-3
complete-track-modal.component.ts
...ls/complete-track-modal/complete-track-modal.component.ts
+31
-1
update-step-track-modal.component.css
...te-step-track-modal/update-step-track-modal.component.css
+0
-0
update-step-track-modal.component.html
...e-step-track-modal/update-step-track-modal.component.html
+1
-0
update-step-track-modal.component.ts
...ate-step-track-modal/update-step-track-modal.component.ts
+10
-0
update-work-modal.component.css
.../modals/update-work-modal/update-work-modal.component.css
+0
-0
update-work-modal.component.html
...modals/update-work-modal/update-work-modal.component.html
+58
-0
update-work-modal.component.ts
...s/modals/update-work-modal/update-work-modal.component.ts
+64
-0
employeeTrack.ts
src/app/tracks/models/responses/employeeTrack.ts
+1
-1
employee-track-history.component.html
...loyee-track-history/employee-track-history.component.html
+1
-1
track-details.component.html
...p/tracks/pages/track-details/track-details.component.html
+8
-4
track-details.component.ts
...app/tracks/pages/track-details/track-details.component.ts
+21
-11
tracks.module.ts
src/app/tracks/tracks.module.ts
+5
-1
No files found.
src/app/projects/components/step-modals/edit-step-modal/edit-step-modal.component.html
View file @
4e3b3a70
<div
class=
"modal-header"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"btn-close"
(
click
)="
onClose
()"
></button>
<button
type=
"button"
class=
"btn-close"
(
click
)="
onClose
()"
></button>
<h5
class=
"modal-title text-center"
>
تعديل مرحلة
</h5>
<h5
class=
"modal-title text-center"
>
تعديل مرحلة
</h5>
</div>
</div>
<div
class=
"modal-body"
>
<div
class=
"modal-body"
>
<form
(
ngSubmit
)="
onSubmit
()"
#
projectForm=
"ngForm"
>
<form
(
ngSubmit
)="
onSubmit
()"
#
projectForm=
"ngForm"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"mb-3 col-4 offset-1"
>
<div
class=
"mb-3 col-4 offset-1"
>
<label
for=
"stepName"
class=
"form-label"
>
اسم المرحلة
</label>
<label
for=
"stepName"
class=
"form-label"
>
اسم المرحلة
</label>
<input
<input
disabled=
"true"
type=
"text"
name=
"stepName"
id=
"stepName"
class=
"form-control"
[(
ngModel
)]="
request
.
stepInfo
.
stepName
"
required
>
disabled=
"true"
</div>
type=
"text"
name=
"stepName"
<div
class=
"mb-3 col-4"
>
id=
"stepName"
<label
for=
"start"
class=
"form-label"
>
تاريخ البدء
</label>
class=
"form-control"
<input
type=
"date"
disabled=
"true"
id=
"start"
class=
"form-control"
[(
ngModel
)]="
request
.
stepInfo
.
startDate
"
name=
"start"
required
>
[(
ngModel
)]="
request
.
stepInfo
.
stepName
"
</div>
required
/>
</div>
<div
class=
"mb-3 col-4"
>
<label
for=
"start"
class=
"form-label"
>
تاريخ البدء
</label>
<input
type=
"datetime"
disabled=
"true"
id=
"start"
class=
"form-control"
[(
ngModel
)]="
request
.
stepInfo
.
startDate
"
name=
"start"
required
/>
</div>
</div>
<div
class=
"row"
>
<div
class=
"mb-3 col-4 offset-1"
>
<label
for=
"worker"
class=
"form-label"
>
عدد العمال المطلوب
</label>
<input
id=
"worker"
class=
"form-control"
[(
ngModel
)]="
request
.
stepInfo
.
numberOfWorker
"
name=
"worker"
required
/>
</div>
<div
class=
"mb-3 col-3"
>
<label
for=
"duration"
class=
"form-label"
>
المدة (أسبوع)
</label>
<input
id=
"duration"
class=
"form-control"
[(
ngModel
)]="
request
.
stepInfo
.
duration
"
name=
"duration"
required
/>
</div>
</div>
<div
class=
"row"
>
<div
class=
"mb-3 col-8 offset-1"
>
<div
class=
"mb-3 col-4 offset-1"
>
<label
for=
"decription"
class=
"form-label"
>
الوصف
</label>
<label
for=
"worker"
class=
"form-label"
>
عدد العمال المطلوب
</label>
<textarea
<input
id=
"worker"
class=
"form-control"
[(
ngModel
)]="
request
.
stepInfo
.
numberOfWorker
"
name=
"worker"
required
>
col=
"3"
</div>
name=
"decription"
id=
"decription"
<div
class=
"mb-3 col-3"
>
class=
"form-control"
<label
for=
"duration"
class=
"form-label"
>
المدة (أسبوع)
</label>
[(
ngModel
)]="
request
.
stepInfo
.
description
"
<input
id=
"duration"
class=
"form-control"
[(
ngModel
)]="
request
.
stepInfo
.
duration
"
name=
"duration"
required
>
required
</div>
>
<div
class=
"mb-3 col-8 offset-1"
>
</textarea>
<label
for=
"decription"
class=
"form-label"
>
الوصف
</label>
<textarea
col=
"3"
name=
"decription"
id=
"decription"
class=
"form-control"
[(
ngModel
)]="
request
.
stepInfo
.
description
"
required
>
</textarea>
</div>
</div>
<div
class=
"row"
>
</div>
<div
class=
"row "
>
<button
type=
"submit"
[
disabled
]="
projectForm
.
invalid
"
class=
"col-5 m-4 btn btn-primary"
>
إضافة
</button>
<div
class=
"col-5 m-4 btn btn-secondary"
(
click
)="
onClose
()"
>
إغلاق
</div>
</div>
</div>
</form>
</div>
</div>
<div
class=
"row"
></div>
<div
class=
"row"
>
\ No newline at end of file
<button
type=
"submit"
[
disabled
]="
projectForm
.
invalid
"
class=
"col-5 m-4 btn btn-primary"
>
إضافة
</button>
<div
class=
"col-5 m-4 btn btn-secondary"
(
click
)="
onClose
()"
>
إغلاق
</div>
</div>
</form>
</div>
src/app/projects/components/step-modals/edit-step-modal/edit-step-modal.component.ts
View file @
4e3b3a70
...
@@ -54,7 +54,7 @@ export class EditStepModalComponent {
...
@@ -54,7 +54,7 @@ export class EditStepModalComponent {
})
})
}
}
onClose
():
void
{
onClose
(
):
void
{
this
.
activeModal
.
close
();
this
.
activeModal
.
close
();
}
}
...
...
src/app/tracks/components/employee-track/employee-track.component.html
View file @
4e3b3a70
...
@@ -33,8 +33,8 @@
...
@@ -33,8 +33,8 @@
<div
class=
"col-auto"
>
<div
class=
"col-auto"
>
<button
type=
"button"
class=
"btn m-2 btn-sm btn-secondary"
>
المساهم
ات
</button>
<button
type=
"button"
[
routerLink
]="['/
tracks
/
project
',
projectId
,'
employee
',
employeeTrack
.
employeeId
]"
class=
"btn m-2 btn-sm btn-secondary"
>
المتابع
ات
</button>
<button
type=
"button"
class=
"btn m-2 btn-sm btn-secondary"
>
تعديل
</button>
<button
type=
"button"
*
ngIf=
"!employeeTrack.trackInfo.isCompleted"
(
click
)="
openEditModal
()"
class=
"btn m-2 btn-sm btn-secondary"
>
تعديل
</button>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
src/app/tracks/components/employee-track/employee-track.component.ts
View file @
4e3b3a70
import
{
Component
,
Input
}
from
'@angular/core'
;
import
{
Component
,
Input
}
from
'@angular/core'
;
import
{
EmployeeTrack
}
from
'../../models/responses/employeeTrack'
;
import
{
EmployeeTrack
}
from
'../../models/responses/employeeTrack'
;
import
{
NgbActiveModal
,
NgbModal
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
NgModel
}
from
'@angular/forms'
;
import
{
UpdateWorkModalComponent
}
from
'../modals/update-work-modal/update-work-modal.component'
;
import
{
UpdateEmployeeWorkTrackRequest
}
from
'../../models/requests/UpdateEmployeeWorkTrackRequest'
;
@
Component
({
@
Component
({
selector
:
'employee-track'
,
selector
:
'employee-track'
,
...
@@ -9,4 +13,35 @@ import { EmployeeTrack } from '../../models/responses/employeeTrack';
...
@@ -9,4 +13,35 @@ import { EmployeeTrack } from '../../models/responses/employeeTrack';
export
class
EmployeeTrackComponent
{
export
class
EmployeeTrackComponent
{
@
Input
()
employeeTrack
:
EmployeeTrack
@
Input
()
employeeTrack
:
EmployeeTrack
@
Input
()
projectId
:
number
constructor
(
private
modalService
:
NgbModal
){}
openEditModal
():
void
{
console
.
log
(
this
.
employeeTrack
)
const
modalRef
=
this
.
modalService
.
open
(
UpdateWorkModalComponent
,{
size
:
'lg'
});
modalRef
.
componentInstance
.
employeeTrack
=
this
.
employeeTrack
;
modalRef
.
componentInstance
.
employee
=
this
.
employeeTrack
.
employee
;
modalRef
.
result
.
then
((
result
:
UpdateEmployeeWorkTrackRequest
)
=>
{
if
(
result
)
{
this
.
employeeTrack
.
employeeWork
=
{...
result
.
employeeWork
}
this
.
employeeTrack
.
employeeWorkInfo
=
{...
result
.
employeeWorkInfo
}
this
.
employeeTrack
.
notes
=
result
.
notes
}
},
(
reason
)
=>
{
});
}
}
}
src/app/tracks/components/modals/add-employee-track-modal/add-employee-track-modal.component.html
View file @
4e3b3a70
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
</div>
</div>
<button
type=
"submit"
class=
"btn mr-4 ml-4 btn-primary"
[
disabled
]="!
stepTrackForm
.
valid
"
>
إضافة
</button>
<button
type=
"submit"
class=
"btn mr-4 ml-4 btn-primary"
[
disabled
]="!
stepTrackForm
.
valid
"
>
إضافة
</button>
<
button
data-bs-dismiss=
"modal"
aria-label=
"Close"
class=
" mr-4 ml-4 btn btn-primary"
>
إلغاء
</button
>
<
div
data-bs-dismiss=
"modal"
aria-label=
"Close"
class=
" mr-4 ml-4 btn btn-primary"
>
إلغاء
</div
>
</form>
</form>
</div>
</div>
...
...
src/app/tracks/components/modals/add-employee-track-modal/add-employee-track-modal.component.ts
View file @
4e3b3a70
...
@@ -59,7 +59,7 @@ export class AddEmployeeTrackModalComponent {
...
@@ -59,7 +59,7 @@ export class AddEmployeeTrackModalComponent {
this
.
participants
=
data
this
.
participants
=
data
this
.
filteredParticipants
=
this
.
participants
.
filter
(
track
=>
this
.
filteredParticipants
=
this
.
participants
.
filter
(
track
=>
!
this
.
trackedParticipants
.
some
(
participate
=>
participate
.
emloyeeId
===
track
.
employeeId
)
!
this
.
trackedParticipants
.
some
(
participate
=>
participate
.
em
p
loyeeId
===
track
.
employeeId
)
).
map
(
e
=>
e
.
employee
);
).
map
(
e
=>
e
.
employee
);
...
...
src/app/tracks/components/modals/add-step-track-modal/add-step-track-modal.component.ts
View file @
4e3b3a70
...
@@ -29,7 +29,8 @@ export class AddStepTrackModalComponent {
...
@@ -29,7 +29,8 @@ export class AddStepTrackModalComponent {
filteredSteps
:
Step
[]
=
[];
filteredSteps
:
Step
[]
=
[];
constructor
(
private
fb
:
FormBuilder
,
constructor
(
private
fb
:
FormBuilder
,
private
stepService
:
StepService
private
stepService
:
StepService
,
private
toastr
:
ToastrService
)
{
)
{
this
.
stepTrackForm
=
this
.
fb
.
group
({
this
.
stepTrackForm
=
this
.
fb
.
group
({
id
:
[],
id
:
[],
...
@@ -65,7 +66,7 @@ export class AddStepTrackModalComponent {
...
@@ -65,7 +66,7 @@ export class AddStepTrackModalComponent {
onStepSelected
(
step
:
Step
):
void
{
onStepSelected
(
step
:
Step
):
void
{
this
.
stepTrackForm
.
patchValue
({
stepName
:
step
.
stepInfo
?.
stepName
});
this
.
stepTrackForm
.
patchValue
({
stepName
:
step
.
stepInfo
?.
stepName
});
//this.stepTrackForm.patchValue({id: step.id});
//this.stepTrackForm.patchValue({id: step.id});
...
@@ -77,6 +78,12 @@ export class AddStepTrackModalComponent {
...
@@ -77,6 +78,12 @@ export class AddStepTrackModalComponent {
const
selectedStep
=
this
.
filteredSteps
.
find
(
step
=>
step
.
stepInfo
.
stepName
==
this
.
stepTrackForm
.
value
.
stepName
);
const
selectedStep
=
this
.
filteredSteps
.
find
(
step
=>
step
.
stepInfo
.
stepName
==
this
.
stepTrackForm
.
value
.
stepName
);
if
(
selectedStep
)
{
if
(
selectedStep
)
{
if
(
selectedStep
.
currentCompletionRatio
+
this
.
stepTrackForm
.
value
.
trackExecutionRatio
>
100
){
this
.
toastr
.
error
(
'نسبة التنفيذ غير صحيحة '
)
return
;
}
const
newStepTrack
:
AddStepTrackRequest
=
{
const
newStepTrack
:
AddStepTrackRequest
=
{
stepId
:
selectedStep
.
id
,
stepId
:
selectedStep
.
id
,
trackId
:
this
.
trackId
,
trackId
:
this
.
trackId
,
...
...
src/app/tracks/components/modals/complete-track-modal/complete-track-modal.component.html
View file @
4e3b3a70
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<div
class=
"modal-body"
>
<div
class=
"modal-body"
>
<form
(
ngSubmit
)="
onSubmit
()"
#
projectForm=
"ngForm"
>
<form
(
ngSubmit
)="
onSubmit
()"
#
projectForm=
"ngForm"
>
<div
*
ngIf=
"!canComplete"
class=
"row text-primary"
>
<div
*
ngIf=
"!canComplete"
class=
"row text-primary"
>
عذراَ, لاتتسطيع أكمال عملية متابعة هي بالأصل مكتملة
{{errorMessage}}
</div>
</div>
<div
*
ngIf=
"canComplete"
>
<div
*
ngIf=
"canComplete"
>
...
@@ -23,9 +23,9 @@
...
@@ -23,9 +23,9 @@
>
>
اكمال المتابعة
اكمال المتابعة
</button>
</button>
<
button
class=
"col m-4 btn btn-seondary"
(
click
)="
onClose
()"
>
<
div
class=
"col m-4 btn btn-seondary"
(
click
)="
onClose
()"
>
إغلاق
إغلاق
</
button
>
</
div
>
</div>
</div>
</form>
</form>
</div>
</div>
src/app/tracks/components/modals/complete-track-modal/complete-track-modal.component.ts
View file @
4e3b3a70
...
@@ -4,6 +4,8 @@ import { CompleteTrackRequest } from '../../../models/requests/completeTrakReque
...
@@ -4,6 +4,8 @@ import { CompleteTrackRequest } from '../../../models/requests/completeTrakReque
import
{
NgbActiveModal
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
NgbActiveModal
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
TrackService
}
from
'../../../services/track.service'
;
import
{
TrackService
}
from
'../../../services/track.service'
;
import
{
Employee
}
from
'../../../../employees/models/responses/employee'
;
import
{
EmployeeTrack
}
from
'../../../models/responses/employeeTrack'
;
@
Component
({
@
Component
({
selector
:
'complete-track-modal'
,
selector
:
'complete-track-modal'
,
...
@@ -13,6 +15,8 @@ import { TrackService } from '../../../services/track.service';
...
@@ -13,6 +15,8 @@ import { TrackService } from '../../../services/track.service';
export
class
CompleteTrackModalComponent
{
export
class
CompleteTrackModalComponent
{
@
Input
()
track
:
Track
@
Input
()
track
:
Track
@
Input
()
employeeTrack
:
EmployeeTrack
[]
errorMessage
=
''
request
=
new
CompleteTrackRequest
();
request
=
new
CompleteTrackRequest
();
canComplete
:
boolean
canComplete
:
boolean
...
@@ -25,7 +29,8 @@ export class CompleteTrackModalComponent {
...
@@ -25,7 +29,8 @@ export class CompleteTrackModalComponent {
ngOnInit
():
void
{
ngOnInit
():
void
{
console
.
log
(
this
.
employeeTrack
)
this
.
_setCanMove
();
this
.
_setCanMove
();
}
}
...
@@ -58,6 +63,8 @@ export class CompleteTrackModalComponent {
...
@@ -58,6 +63,8 @@ export class CompleteTrackModalComponent {
.
toastr
.
toastr
.
success
(
'تم اكمال المتابعة بنجاح'
);
.
success
(
'تم اكمال المتابعة بنجاح'
);
this
.
activeModal
.
close
(
true
)
},
},
error
:(
err
)
=>
{
error
:(
err
)
=>
{
this
this
...
@@ -76,6 +83,29 @@ export class CompleteTrackModalComponent {
...
@@ -76,6 +83,29 @@ export class CompleteTrackModalComponent {
.
track
.
track
.
trackInfo
.
trackInfo
.
isCompleted
.
isCompleted
if
(
!
this
.
canComplete
){
this
.
errorMessage
=
'عذرا لاتستطيع اكمال عملية متابعة مكتملة بالفعل'
}
debugger
let
contribution
=
0
;
if
(
this
.
employeeTrack
){
this
.
employeeTrack
.
forEach
(
e
=>
contribution
+=
e
.
employeeWork
.
contributingRatio
)
}
if
(
contribution
!=
100
){
this
.
errorMessage
=
'عذرا يجب أن يكون مجموع مساهمات العاملين مئة'
}
// this.canComplete = contribution == 100
console
.
log
(
this
.
track
)
console
.
log
(
this
.
track
)
}
}
...
...
src/app/tracks/components/modals/update-step-track-modal/update-step-track-modal.component.css
0 → 100644
View file @
4e3b3a70
src/app/tracks/components/modals/update-step-track-modal/update-step-track-modal.component.html
0 → 100644
View file @
4e3b3a70
<p>
update-step-track-modal works!
</p>
src/app/tracks/components/modals/update-step-track-modal/update-step-track-modal.component.ts
0 → 100644
View file @
4e3b3a70
import
{
Component
}
from
'@angular/core'
;
@
Component
({
selector
:
'update-step-track-modal'
,
templateUrl
:
'./update-step-track-modal.component.html'
,
styleUrl
:
'./update-step-track-modal.component.css'
})
export
class
UpdateStepTrackModalComponent
{
}
src/app/tracks/components/modals/update-work-modal/update-work-modal.component.css
0 → 100644
View file @
4e3b3a70
src/app/tracks/components/modals/update-work-modal/update-work-modal.component.html
0 → 100644
View file @
4e3b3a70
<div
class=
"modal-header"
>
<h5
class=
"modal-title"
>
تعديل متابعة مشارك
</h5>
<button
type=
"button"
class=
"mr-4 ml-4 btn-close"
(
click
)="
onClose
()"
></button>
</div>
<div
class=
"modal-body"
>
<form
(
ngSubmit
)="
onSubmit
()"#
projectForm=
"ngForm"
>
<div
class=
"row "
>
<div
class=
"mb-3 col-4"
>
<label
for=
"hiastId"
class=
"form-label"
>
المشارك
</label>
<label>
{{employee.personalInfo | fullname}}
</label>
</div>
<div
class=
"mb-3 col-6"
>
<label
for=
"notes"
class=
"form-label"
>
الملاحظات
</label>
<input
type=
"text"
id=
"notes"
[(
ngModel
)]="
request
.
notes
"
class=
"form-control"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"mb-3 col-4"
>
<label
for=
"assignedWork"
class=
"form-label"
>
العمل المسند
</label>
<input
id=
"assignedWork"
[(
ngModel
)]="
request
.
employeeWorkInfo
.
assignedWork
"
class=
"form-control"
>
</div>
<div
class=
"mb-3 col-4"
>
<label
for=
"performedWork"
class=
"form-label"
>
العمل المنجز
</label>
<input
id=
"performedWork"
formControlName=
"performedWork"
[(
ngModel
)]="
request
.
employeeWorkInfo
.
performedWork
"
class=
"form-control"
>
</div>
<div
class=
"mb-3 col-4"
>
<label
for=
"assignedWorkEnd"
class=
"form-label"
>
تاريخ تنفيذ العمل المسند
</label>
<input
type=
"date"
id=
"assignedWorkEnd"
formControlName=
"assignedWorkEnd"
[(
ngModel
)]="
request
.
employeeWorkInfo
.
assignedWorkEnd
"
class=
"form-control"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"mb-3 col-4"
>
<label
for=
"assignedWorkingHours"
class=
"form-label"
>
ساعات العمل المسندة
</label>
<input
type=
"number"
id=
"assignedWorkingHours"
formControlName=
"contributingR"
[(
ngModel
)]="
request
.
employeeWork
.
assignedWorkingHours
"
class=
"form-control"
>
</div>
<div
class=
"mb-3 col-4"
>
<label
for=
"workedHours"
class=
"form-label"
>
ساعات العمل الفعلية
</label>
<input
type=
"number"
id=
"workedHours"
[(
ngModel
)]="
request
.
employeeWork
.
workedHours
"
formControlName=
"workedHours"
class=
"form-control"
>
</div>
<div
class=
"mb-3 col-4"
>
<label
for=
"contributingRatio"
class=
"form-label"
>
نسبة المساهمة في العمل
</label>
<input
type=
"number"
id=
"contributingRatio"
[(
ngModel
)]="
request
.
employeeWork
.
contributingRatio
"
formControlName=
"contributingRatio"
class=
"form-control"
>
</div>
</div>
<button
type=
"submit"
class=
"btn mr-4 ml-4 btn-primary"
[
disabled
]="
projectForm
.
invalid
"
>
إضافة
</button>
<div
(
click
)="
onClose
()"
class=
" mr-4 ml-4 btn btn-primary"
>
إلغاء
</div>
</form>
</div>
\ No newline at end of file
src/app/tracks/components/modals/update-work-modal/update-work-modal.component.ts
0 → 100644
View file @
4e3b3a70
import
{
Component
,
Input
,
OnInit
}
from
'@angular/core'
;
import
{
EmployeeWork
}
from
'../../../models/valueObjects/EmployeeWork'
;
import
{
Employee
}
from
'../../../../employees/models/responses/employee'
;
import
{
ProjectService
}
from
'../../../../projects/services/project.service'
;
import
{
UpdateEmployeeWorkTrackRequest
}
from
'../../../models/requests/UpdateEmployeeWorkTrackRequest'
;
import
{
EmployeeTrack
}
from
'../../../models/responses/employeeTrack'
;
import
{
TrackService
}
from
'../../../services/track.service'
;
import
{
NgbActiveModal
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
@
Component
({
selector
:
'update-work-modal'
,
templateUrl
:
'./update-work-modal.component.html'
,
styleUrl
:
'./update-work-modal.component.css'
})
export
class
UpdateWorkModalComponent
implements
OnInit
{
@
Input
()
employeeTrack
:
EmployeeTrack
@
Input
()
employee
:
Employee
request
:
UpdateEmployeeWorkTrackRequest
constructor
(
private
toastr
:
ToastrService
,
public
activeModal
:
NgbActiveModal
,
private
trackService
:
TrackService
){}
ngOnInit
():
void
{
this
.
request
=
{
employeeId
:
this
.
employee
.
id
,
employeeTrackId
:
this
.
employeeTrack
.
trackId
,
employeeWork
:{...
this
.
employeeTrack
.
employeeWork
},
employeeWorkInfo
:{...
this
.
employeeTrack
.
employeeWorkInfo
},
notes
:
this
.
employeeTrack
.
notes
,
trackId
:
this
.
employeeTrack
.
trackId
}
}
onSubmit
(){
this
.
trackService
.
updateEmployeeWorkTrack
(
this
.
request
)
.
subscribe
({
next
:()
=>
{
this
.
activeModal
.
close
(
this
.
request
);
}
,
error
:(
err
)
=>
{
this
.
toastr
.
error
(
'لقد حدث خطاء ما'
)
}
});
}
onClose
(){
this
.
activeModal
.
close
();
}
}
src/app/tracks/models/responses/employeeTrack.ts
View file @
4e3b3a70
...
@@ -4,7 +4,7 @@ import { EmployeeWorkInfo } from "../valueObjects/EmployeeWorkInfo"
...
@@ -4,7 +4,7 @@ import { EmployeeWorkInfo } from "../valueObjects/EmployeeWorkInfo"
import
{
TrackInfo
}
from
"../valueObjects/trackInfo"
import
{
TrackInfo
}
from
"../valueObjects/trackInfo"
export
class
EmployeeTrack
{
export
class
EmployeeTrack
{
emloyeeId
:
number
em
p
loyeeId
:
number
trackId
:
number
trackId
:
number
employee
:
Employee
employee
:
Employee
trackInfo
:
TrackInfo
trackInfo
:
TrackInfo
...
...
src/app/tracks/pages/employee-track-history/employee-track-history.component.html
View file @
4e3b3a70
<section
*
ngIf=
"employeeTrackHistory"
class=
"row"
>
<section
*
ngIf=
"employeeTrackHistory
&& projectInfo
"
class=
"row"
>
<div
class=
"row justify-content-center"
>
<div
class=
"row justify-content-center"
>
<div
class=
"col-12"
>
<div
class=
"col-12"
>
<div
class=
"row align-items-center my-4"
>
<div
class=
"row align-items-center my-4"
>
...
...
src/app/tracks/pages/track-details/track-details.component.html
View file @
4e3b3a70
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-6 label "
>
تاريخ عملية المتابعة {{track.trackInfo.trackDate | date}}
</div>
<div
class=
"col-6 label "
>
تاريخ عملية المتابعة {{track.trackInfo.trackDate | date}}
</div>
<button
(
click
)="
openComplete
()"
class=
"col-2 mr-1 btn btn-primary"
*
ngIf=
"!track.trackInfo.isCompleted"
>
اكمال المتابعة
</button>
<button
[
disabled
]="!
canComplete
"
(
click
)="
openComplete
()"
class=
"col-2 mr-1 btn btn-primary"
*
ngIf=
"!track.trackInfo.isCompleted"
>
اكمال المتابعة
</button>
<div
class=
"col-2 btn disabled btn-success "
>
{{track.trackInfo.isCompleted ? 'مكتملة':'غير مكتملة'}}
</div>
<div
class=
"col-2 btn disabled btn-success "
>
{{track.trackInfo.isCompleted ? 'مكتملة':'غير مكتملة'}}
</div>
</div>
</div>
...
@@ -74,7 +74,11 @@
...
@@ -74,7 +74,11 @@
<div
class=
"tab-pane fade pt-3"
id=
"profile-settings"
role=
"tabpanel"
>
<div
class=
"tab-pane fade pt-3"
id=
"profile-settings"
role=
"tabpanel"
>
<employee-track
*
ngFor=
"let employeeTrack of employeesTracks"
[
employeeTrack
]="
employeeTrack
"
></employee-track>
<employee-track
*
ngFor=
"let employeeTrack of employeesTracks"
[
employeeTrack
]="
employeeTrack
"
[
projectId
]="
track
.
projectId
"
></employee-track>
<div
class=
"row"
*
ngIf=
"employeesTracks.length ==0 "
>
<div
class=
"row"
*
ngIf=
"employeesTracks.length ==0 "
>
لم تقم بمتابعة اي مشارك
لم تقم بمتابعة اي مشارك
</div>
</div>
...
@@ -97,10 +101,10 @@
...
@@ -97,10 +101,10 @@
</div>
</div>
</div>
</div>
<button
type=
"button"
class=
"btn mr-4 ml-4 btn-primary"
data-bs-toggle=
"modal"
data-bs-target=
"#addStepTrackModal"
>
<button
[
disabled
]="
track
.
trackInfo
.
isCompleted
"
type=
"button"
class=
"btn mr-4 ml-4 btn-primary"
data-bs-toggle=
"modal"
data-bs-target=
"#addStepTrackModal"
>
إضافة متابعة مرحلة
إضافة متابعة مرحلة
</button>
</button>
<button
type=
"button"
class=
"btn mr-4 ml-4 btn-primary"
data-bs-toggle=
"modal"
data-bs-target=
"#addEmployeeTrackModal"
>
<button
[
disabled
]="
track
.
trackInfo
.
isCompleted
"
type=
"button"
class=
"btn mr-4 ml-4 btn-primary"
data-bs-toggle=
"modal"
data-bs-target=
"#addEmployeeTrackModal"
>
إضافة متابعة مشارك
إضافة متابعة مشارك
</button>
</button>
...
...
src/app/tracks/pages/track-details/track-details.component.ts
View file @
4e3b3a70
...
@@ -25,6 +25,7 @@ export class TrackDetailsComponent implements OnInit {
...
@@ -25,6 +25,7 @@ export class TrackDetailsComponent implements OnInit {
isAddStepTrackModalVisible
=
false
;
isAddStepTrackModalVisible
=
false
;
trackId
:
number
trackId
:
number
track
:
Track
track
:
Track
canComplete
=
false
stepTracks
:
StepTrack
[]
stepTracks
:
StepTrack
[]
employeesTracks
:
EmployeeTrack
[]
employeesTracks
:
EmployeeTrack
[]
steps
:
Step
[]
=
[];
// Load steps from service or store
steps
:
Step
[]
=
[];
// Load steps from service or store
...
@@ -45,6 +46,7 @@ export class TrackDetailsComponent implements OnInit {
...
@@ -45,6 +46,7 @@ export class TrackDetailsComponent implements OnInit {
this
.
trackId
=
Number
(
this
.
route
.
snapshot
.
paramMap
.
get
(
'id'
));
this
.
trackId
=
Number
(
this
.
route
.
snapshot
.
paramMap
.
get
(
'id'
));
this
.
loadTrack
();
this
.
loadTrack
();
}
}
loadTrack
(){
loadTrack
(){
...
@@ -61,6 +63,7 @@ export class TrackDetailsComponent implements OnInit {
...
@@ -61,6 +63,7 @@ export class TrackDetailsComponent implements OnInit {
this
.
stepTracks
=
stepTracks
;
this
.
stepTracks
=
stepTracks
;
this
.
employeesTracks
=
employeesTracks
;
this
.
employeesTracks
=
employeesTracks
;
this
.
loadParticipants
();
this
.
loadParticipants
();
this
.
_canComplete
();
this
.
loadSteps
();
this
.
loadSteps
();
})
})
...
@@ -78,21 +81,19 @@ export class TrackDetailsComponent implements OnInit {
...
@@ -78,21 +81,19 @@ export class TrackDetailsComponent implements OnInit {
});
});
}
}
openTrackComplete
(){
openTrackComplete
(){
const
modalRef
=
this
.
modalService
.
open
(
CompleteTrackModalComponent
);
const
modalRef
=
this
.
modalService
.
open
(
CompleteTrackModalComponent
);
modalRef
.
componentInstance
.
track
=
this
.
track
;
modalRef
.
componentInstance
.
track
=
this
.
track
;
modalRef
.
componentInstance
.
employeeTrack
=
this
.
employeesTracks
modalRef
.
result
.
then
((
result
)
=>
{
modalRef
.
result
.
then
((
result
)
=>
{
if
(
result
){
if
(
result
)
{
// Add the new project to the list
this
.
loadTrack
();
this
.
loadTrack
();
}
}
},
(
reason
)
=>
{
},
(
reason
)
=>
{
...
@@ -198,7 +199,7 @@ export class TrackDetailsComponent implements OnInit {
...
@@ -198,7 +199,7 @@ export class TrackDetailsComponent implements OnInit {
stepWeight
:
s
?.
weight
??
0
stepWeight
:
s
?.
weight
??
0
}
}
this
.
_canComplete
();
this
.
stepTracks
.
push
(
st
)
this
.
stepTracks
.
push
(
st
)
this
.
steps
=
this
.
steps
.
filter
(
e
=>
e
.
id
==
s
?.
id
)
this
.
steps
=
this
.
steps
.
filter
(
e
=>
e
.
id
==
s
?.
id
)
this
.
trackedSteps
.
push
(
s
!
);
this
.
trackedSteps
.
push
(
s
!
);
...
@@ -214,7 +215,7 @@ export class TrackDetailsComponent implements OnInit {
...
@@ -214,7 +215,7 @@ export class TrackDetailsComponent implements OnInit {
this
.
loadTheNewParticipant
(
data
,
request
);
this
.
loadTheNewParticipant
(
data
,
request
);
this
.
toastr
.
success
(
'تمت إضافة متالعة المرحلة '
)
this
.
toastr
.
success
(
'تمت إضافة متالعة المرحلة '
)
this
.
_canComplete
();
}
}
,
,
error
:(
err
)
=>
{
error
:(
err
)
=>
{
...
@@ -228,13 +229,14 @@ export class TrackDetailsComponent implements OnInit {
...
@@ -228,13 +229,14 @@ export class TrackDetailsComponent implements OnInit {
let
st
:
EmployeeTrack
=
{
let
st
:
EmployeeTrack
=
{
trackId
:
this
.
trackId
,
trackId
:
this
.
trackId
,
trackInfo
:
this
.
track
.
trackInfo
,
trackInfo
:
this
.
track
.
trackInfo
,
emloyeeId
:
request
.
employeeId
,
em
p
loyeeId
:
request
.
employeeId
,
employeeWork
:
request
.
employeeWork
,
employeeWork
:
request
.
employeeWork
,
employeeWorkInfo
:
request
.
employeeWorkInfo
,
employeeWorkInfo
:
request
.
employeeWorkInfo
,
employee
:
s
!
.
employee
,
employee
:
s
!
.
employee
,
notes
:
request
.
notes
notes
:
request
.
notes
}
}
this
.
_canComplete
();
this
.
employeesTracks
.
push
(
st
)
this
.
employeesTracks
.
push
(
st
)
this
.
participants
=
this
.
participants
.
filter
(
e
=>
e
.
employeeId
==
s
?.
employeeId
)
this
.
participants
=
this
.
participants
.
filter
(
e
=>
e
.
employeeId
==
s
?.
employeeId
)
...
@@ -242,4 +244,12 @@ export class TrackDetailsComponent implements OnInit {
...
@@ -242,4 +244,12 @@ export class TrackDetailsComponent implements OnInit {
}
}
}
private
_canComplete
(){
let
contribution
=
0
;
this
.
employeesTracks
.
forEach
(
e
=>
contribution
+=
e
.
employeeWork
.
contributingRatio
);
this
.
canComplete
=
100
==
contribution
}
}
src/app/tracks/tracks.module.ts
View file @
4e3b3a70
...
@@ -28,6 +28,8 @@ import { EmployeeHistoryItemComponent } from './components/history/employee-hist
...
@@ -28,6 +28,8 @@ import { EmployeeHistoryItemComponent } from './components/history/employee-hist
import
{
StateTranslatePipe
}
from
'../shared/pipes/stateTranslate/state-translate.pipe'
;
import
{
StateTranslatePipe
}
from
'../shared/pipes/stateTranslate/state-translate.pipe'
;
import
{
TracksUncompleteComponent
}
from
'./pages/tracks-uncomplete/tracks-uncomplete.component'
;
import
{
TracksUncompleteComponent
}
from
'./pages/tracks-uncomplete/tracks-uncomplete.component'
;
import
{
CompleteTrackModalComponent
}
from
'./components/modals/complete-track-modal/complete-track-modal.component'
;
import
{
CompleteTrackModalComponent
}
from
'./components/modals/complete-track-modal/complete-track-modal.component'
;
import
{
UpdateWorkModalComponent
}
from
'./components/modals/update-work-modal/update-work-modal.component'
;
import
{
UpdateStepTrackModalComponent
}
from
'./components/modals/update-step-track-modal/update-step-track-modal.component'
;
@
NgModule
({
@
NgModule
({
...
@@ -46,7 +48,9 @@ import { CompleteTrackModalComponent } from './components/modals/complete-track-
...
@@ -46,7 +48,9 @@ import { CompleteTrackModalComponent } from './components/modals/complete-track-
StepHistoryItemComponent
,
StepHistoryItemComponent
,
EmployeeHistoryItemComponent
,
EmployeeHistoryItemComponent
,
TracksUncompleteComponent
,
TracksUncompleteComponent
,
CompleteTrackModalComponent
CompleteTrackModalComponent
,
UpdateWorkModalComponent
,
UpdateStepTrackModalComponent
],
],
imports
:
[
imports
:
[
CommonModule
,
CommonModule
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment