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
0b80a28c
Commit
0b80a28c
authored
Aug 27, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add complete track component
parent
58069c61
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
143 additions
and
3 deletions
+143
-3
complete-track-modal.component.css
...s/complete-track-modal/complete-track-modal.component.css
+0
-0
complete-track-modal.component.html
.../complete-track-modal/complete-track-modal.component.html
+31
-0
complete-track-modal.component.ts
...ls/complete-track-modal/complete-track-modal.component.ts
+82
-0
completeTrakRequest.ts
src/app/tracks/models/requests/completeTrakRequest.ts
+1
-1
track-details.component.ts
...app/tracks/pages/track-details/track-details.component.ts
+26
-1
tracks.module.ts
src/app/tracks/tracks.module.ts
+3
-1
No files found.
src/app/tracks/components/modals/complete-track-modal/complete-track-modal.component.css
0 → 100644
View file @
0b80a28c
src/app/tracks/components/modals/complete-track-modal/complete-track-modal.component.html
0 → 100644
View file @
0b80a28c
<div
class=
"modal-header"
>
<h5
class=
"modal-title"
id=
"moveToplanModalLabel"
>
اكمال المتابعة
</h5>
<button
type=
"button"
class=
"ml-4 mr-4 btn-close"
(
click
)="
onClose
()"
></button>
</div>
<div
class=
"modal-body"
>
<form
(
ngSubmit
)="
onSubmit
()"
#
projectForm=
"ngForm"
>
<div
*
ngIf=
"!canComplete"
class=
"row text-primary"
>
عذراَ, لاتتسطيع أكمال عملية متابعة هي بالأصل مكتملة
</div>
<div
*
ngIf=
"canComplete"
>
<p>
اكمال متابعة هل أنت حقا متأكد من أنك تابعت كل العاميلن ,
</p>
</div>
<div
class=
"row"
>
<button
type=
"submit"
[
disabled
]="
projectForm
.
invalid
||
!
canComplete
"
class=
"col m-4 btn btn-primary"
>
اكمال المتابعة
</button>
<button
class=
"col m-4 btn btn-seondary"
(
click
)="
onClose
()"
>
إغلاق
</button>
</div>
</form>
</div>
src/app/tracks/components/modals/complete-track-modal/complete-track-modal.component.ts
0 → 100644
View file @
0b80a28c
import
{
Component
,
Input
}
from
'@angular/core'
;
import
{
Track
}
from
'../../../models/responses/track'
;
import
{
CompleteTrackRequest
}
from
'../../../models/requests/completeTrakRequest'
;
import
{
NgbActiveModal
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
TrackService
}
from
'../../../services/track.service'
;
@
Component
({
selector
:
'complete-track-modal'
,
templateUrl
:
'./complete-track-modal.component.html'
,
styleUrl
:
'./complete-track-modal.component.css'
})
export
class
CompleteTrackModalComponent
{
@
Input
()
track
:
Track
request
=
new
CompleteTrackRequest
();
canComplete
:
boolean
constructor
(
private
trackServie
:
TrackService
,
private
toastr
:
ToastrService
,
private
activeModal
:
NgbActiveModal
){}
ngOnInit
():
void
{
this
.
_setCanMove
();
}
onClose
()
{
this
.
activeModal
.
close
();
}
onSubmit
(){
this
.
request
.
trackId
=
this
.
track
.
id
;
this
.
request
.
completionDate
=
new
Date
();
this
.
request
.
projectId
=
this
.
track
.
projectId
this
.
trackServie
.
completeTrack
(
this
.
request
)
.
subscribe
({
next
:
(
data
)
=>
{
this
.
toastr
.
success
(
'تم اكمال المتابعة بنجاح'
);
},
error
:(
err
)
=>
{
this
.
toastr
.
error
(
'تعذر اكمال المتابعة'
);
}
});
}
private
_setCanMove
(){
this
.
canComplete
=
this
.
track
.
trackInfo
.
isCompleted
}
}
src/app/tracks/models/requests/completeTrakRequest.ts
View file @
0b80a28c
export
class
CompleteTrackRequest
{
trackId
:
number
completionDate
:
number
completionDate
:
Date
projectId
:
number
}
src/app/tracks/pages/track-details/track-details.component.ts
View file @
0b80a28c
...
...
@@ -13,6 +13,8 @@ import { forkJoin } from 'rxjs';
import
{
AddEmployeeTrackRequest
}
from
'../../models/requests/AddEmployeeTrackRequest'
;
import
{
ProjectService
}
from
'../../../projects/services/project.service'
;
import
{
EmployeeParticipate
}
from
'../../../employees/models/responses/employeeParticipate'
;
import
{
NgbModal
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
CompleteTrackModalComponent
}
from
'../../components/modals/complete-track-modal/complete-track-modal.component'
;
@
Component
({
selector
:
'track-details'
,
...
...
@@ -34,6 +36,7 @@ export class TrackDetailsComponent implements OnInit {
private
route
:
ActivatedRoute
,
private
trackService
:
TrackService
,
private
stepService
:
StepService
,
private
modalService
:
NgbModal
,
private
projectService
:
ProjectService
){}
...
...
@@ -46,6 +49,7 @@ export class TrackDetailsComponent implements OnInit {
loadTrack
(){
forkJoin
({
track
:
this
.
trackService
.
getByTrackById
(
this
.
trackId
),
stepTracks
:
this
.
trackService
.
getStepsTrackById
(
this
.
trackId
),
...
...
@@ -74,6 +78,28 @@ export class TrackDetailsComponent implements OnInit {
});
}
openTrackComplete
(){
const
modalRef
=
this
.
modalService
.
open
(
CompleteTrackModalComponent
);
modalRef
.
componentInstance
.
track
=
this
.
track
;
modalRef
.
result
.
then
((
result
)
=>
{
if
(
result
)
{
// Add the new project to the list
this
.
loadTrack
();
}
},
(
reason
)
=>
{
});
}
loadSteps
(){
this
.
stepService
.
getStepsByProject
(
this
.
track
.
projectId
)
...
...
@@ -116,7 +142,6 @@ export class TrackDetailsComponent implements OnInit {
handleAddStepTrack
(
stepTrackRequest
:
AddStepTrackRequest
):
void
{
debugger
this
.
trackService
.
addStepTrack
(
stepTrackRequest
).
subscribe
({
next
:
(
data
)
=>
{
...
...
src/app/tracks/tracks.module.ts
View file @
0b80a28c
...
...
@@ -27,6 +27,7 @@ import { StepHistoryItemComponent } from './components/history/step-history-item
import
{
EmployeeHistoryItemComponent
}
from
'./components/history/employee-history-item/employee-history-item.component'
;
import
{
StateTranslatePipe
}
from
'../shared/pipes/stateTranslate/state-translate.pipe'
;
import
{
TracksUncompleteComponent
}
from
'./pages/tracks-uncomplete/tracks-uncomplete.component'
;
import
{
CompleteTrackModalComponent
}
from
'./components/modals/complete-track-modal/complete-track-modal.component'
;
@
NgModule
({
...
...
@@ -44,7 +45,8 @@ import { TracksUncompleteComponent } from './pages/tracks-uncomplete/tracks-unco
TrackItemComponent
,
StepHistoryItemComponent
,
EmployeeHistoryItemComponent
,
TracksUncompleteComponent
TracksUncompleteComponent
,
CompleteTrackModalComponent
],
imports
:
[
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