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
58069c61
Commit
58069c61
authored
Aug 27, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add comtroll modals
parent
6726cee3
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
252 additions
and
10 deletions
+252
-10
track-controll.component.html
...ect-controll/track-controll/track-controll.component.html
+2
-2
track-controll.component.ts
...oject-controll/track-controll/track-controll.component.ts
+13
-1
project-complete-modal.component.html
...ject-complete-modal/project-complete-modal.component.html
+46
-1
project-complete-modal.component.ts
...roject-complete-modal/project-complete-modal.component.ts
+62
-1
project-replan-modal.component.html
.../project-replan-modal/project-replan-modal.component.html
+18
-1
project-replan-modal.component.ts
...ls/project-replan-modal/project-replan-modal.component.ts
+60
-1
project-toprogress-modal.component.html
...-toprogress-modal/project-toprogress-modal.component.html
+3
-3
project-details.component.html
...ects/pages/project-details/project-details.component.html
+2
-0
project-details.component.ts
...ojects/pages/project-details/project-details.component.ts
+46
-0
No files found.
src/app/projects/components/project-controll/track-controll/track-controll.component.html
View file @
58069c61
...
...
@@ -18,7 +18,7 @@
</div>
<!-- .card-body -->
</div>
<!-- .card -->
</div>
<div
class=
"col-md-6 col-lg-4"
>
<div
class=
"col-md-6 col-lg-4"
(
click
)="
onComplete
()"
>
<div
class=
"card shadow mb-4"
>
<div
class=
"card-body file-list"
>
<div
class=
"d-flex align-items-center"
>
...
...
@@ -32,7 +32,7 @@
</div>
<!-- .card-body -->
</div>
<!-- .card -->
</div>
<div
class=
"col-md-6 col-lg-4"
[
routerLink
]="['/
projects
/',
project
.
id
,'/
steps
']
"
>
<div
class=
"col-md-6 col-lg-4"
(
click
)="
onReplan
()
"
>
<div
class=
"card shadow mb-4"
>
<div
class=
"card-body file-list"
>
<div
class=
"d-flex align-items-center"
>
...
...
src/app/projects/components/project-controll/track-controll/track-controll.component.ts
View file @
58069c61
import
{
Component
,
In
put
}
from
'@angular/core'
;
import
{
Component
,
EventEmitter
,
Input
,
Out
put
}
from
'@angular/core'
;
import
{
Project
}
from
'../../../models/responses/project'
;
@
Component
({
...
...
@@ -9,4 +9,16 @@ import { Project } from '../../../models/responses/project';
export
class
TrackControllComponent
{
@
Input
()
project
:
Project
@
Output
()
complete
=
new
EventEmitter
();
@
Output
()
replan
=
new
EventEmitter
();
onComplete
(){
this
.
complete
.
emit
();
}
onReplan
(){
this
.
replan
.
emit
();
}
}
src/app/projects/components/projectModals/project-complete-modal/project-complete-modal.component.html
View file @
58069c61
<p>
project-complete-modal works!
</p>
<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"
>
للأسف , لاتستطيع الانتقال إلى مرحلة الانجاز لأن مجموع نسب الانجاز للمراحل ليس مئة,قم بمتابعةالمشروع ومن ثم أعد المحاولة
</div>
<div
*
ngIf=
"canComplete"
>
<div
class=
"row"
>
<p>
استمارة انجاز مشروع
</p>
<div
class=
"mb-3 col-8 offset-1"
>
<label
for=
"stepName"
class=
"form-label"
>
ملاحظات الجهة الطارحة
</label>
<textarea
[
cols
]="
4
"
type=
"text"
name=
"stepName"
id=
"stepName"
class=
"form-control"
[(
ngModel
)]="
request
.
customerNotes
"
required
>
</textarea>
</div>
<div
class=
"mb-3 col-3 offset-1 "
>
<label
for=
"start"
class=
"form-label"
>
تاريخ الاكمال
</label>
<input
type=
"date"
id=
"start"
class=
"form-control"
[(
ngModel
)]="
request
.
completionDate
"
name=
"start"
required
>
</div>
<div
class=
"mb-3 col-3"
>
<label
for=
"worker"
class=
"form-label"
>
تقييم الجهة الطارحة
</label>
<input
id=
"worker"
class=
"form-control"
[(
ngModel
)]="
request
.
customerRate
"
name=
"worker"
required
>
</div>
</div>
</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/projects/components/projectModals/project-complete-modal/project-complete-modal.component.ts
View file @
58069c61
import
{
Component
}
from
'@angular/core'
;
import
{
Component
,
Input
}
from
'@angular/core'
;
import
{
NgbActiveModal
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
Project
}
from
'../../../models/responses/project'
;
import
{
ProjectService
}
from
'../../../services/project.service'
;
import
{
CompleteProjectRequest
}
from
'../../../models/requests/project-requests/completeProjectRequest'
;
@
Component
({
selector
:
'project-complete-modal'
,
...
...
@@ -6,5 +11,61 @@ import { Component } from '@angular/core';
styleUrl
:
'./project-complete-modal.component.css'
})
export
class
ProjectCompleteModalComponent
{
@
Input
()
project
:
Project
request
=
new
CompleteProjectRequest
();
canComplete
:
boolean
constructor
(
private
projectServie
:
ProjectService
,
private
toastr
:
ToastrService
,
private
activeModal
:
NgbActiveModal
){}
ngOnInit
():
void
{
this
.
_setCanMove
();
}
onClose
()
{
this
.
activeModal
.
close
();
}
onSubmit
(){
this
.
request
.
projectId
=
this
.
project
.
id
;
this
.
projectServie
.
completeProject
(
this
.
request
)
.
subscribe
({
next
:
(
data
)
=>
{
this
.
toastr
.
success
(
'تم انجاز المشروع بنجاح'
);
},
error
:(
err
)
=>
{
this
.
toastr
.
error
(
'تعذر الانتقال إلى مرحلة الانجاز'
);
}
});
}
private
_setCanMove
(){
this
.
canComplete
=
true
;
this
.
project
.
steps
.
forEach
(
e
=>
e
.
currentCompletionRatio
!=
100
?
this
.
canComplete
=
false
:
''
)
}
}
src/app/projects/components/projectModals/project-replan-modal/project-replan-modal.component.html
View file @
58069c61
<p>
project-replan-modal works!
</p>
<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"
>
<div
*
ngIf=
"!canRePlan"
>
للاسف لاتستطيع الانتقال إلى مرحلة التخطيط وأنت في مرحلة {{project.currentState | stateTranslate}}
</div>
<div
*
ngIf=
"canRePlan"
>
<p>
هل أنت متأكد من أنك تريد الانتقال إلى مرحلة التخطيط
</p>
</div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-secondary"
(
click
)="
onClose
()"
>
إلغاء
</button>
<button
type=
"button"
[
disabled
]="!
canRePlan
"
class=
"btn btn-danger"
(
click
)="
onSubmit
()"
>
الانتقال
</button>
</div>
src/app/projects/components/projectModals/project-replan-modal/project-replan-modal.component.ts
View file @
58069c61
import
{
Component
}
from
'@angular/core'
;
import
{
Component
,
Input
}
from
'@angular/core'
;
import
{
NgbActiveModal
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
CompleteProjectRequest
}
from
'../../../models/requests/project-requests/completeProjectRequest'
;
import
{
Project
}
from
'../../../models/responses/project'
;
import
{
ProjectService
}
from
'../../../services/project.service'
;
import
{
RePlanProjectRequest
}
from
'../../../models/requests/project-requests/RePlanProjectRequest'
;
@
Component
({
selector
:
'project-replan-modal'
,
...
...
@@ -6,5 +12,58 @@ import { Component } from '@angular/core';
styleUrl
:
'./project-replan-modal.component.css'
})
export
class
ProjectReplanModalComponent
{
@
Input
()
project
:
Project
canRePlan
:
boolean
request
:
RePlanProjectRequest
;
constructor
(
private
projectServie
:
ProjectService
,
private
toastr
:
ToastrService
,
private
activeModal
:
NgbActiveModal
){}
ngOnInit
():
void
{
this
.
_setCanMove
()
}
onClose
()
{
this
.
activeModal
.
close
();
}
onSubmit
(){
this
.
request
=
{
projectId
:
this
.
project
.
id
,
}
this
.
projectServie
.
rePlanProject
(
this
.
request
)
.
subscribe
({
next
:
(
data
)
=>
{
this
.
toastr
.
success
(
'تمت العودة إلى التخطيط بنجاح'
);
},
error
:(
err
)
=>
{
this
.
toastr
.
error
(
'تعذر الانتقال إلى مرحلة التخطيط'
);
}
});
}
private
_setCanMove
(){
this
.
project
.
currentState
.
toLowerCase
()
==
"inprogress"
?
true
:
false
;
}
}
src/app/projects/components/projectModals/project-toprogress-modal/project-toprogress-modal.component.html
View file @
58069c61
...
...
@@ -4,15 +4,15 @@
<button
type=
"button"
class=
"ml-4 mr-4 btn-close"
(
click
)="
onClose
()"
></button>
</div>
<div
class=
"modal-body"
>
<div
*
ngIf=
"canMoveToProgress"
>
<div
*
ngIf=
"
!
canMoveToProgress"
>
للأسف , لاتستطيع الانتقال إلى مرحلة التخطيط لأن مجموع الاوزان للمراحل ليس مئة,قم بالتعديل ومن ثم أعد المحاولة
</div>
<div
*
ngIf=
"
!
canMoveToProgress"
>
<div
*
ngIf=
"canMoveToProgress"
>
<p>
هل أنت متأكد من أنك تريد الانتقال إلى مرحلة التنفيذ
</p>
</div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-secondary"
(
click
)="
onClose
()"
>
إلغاء
</button>
<button
type=
"button"
class=
"btn btn-danger"
(
click
)="
onSubmit
()"
>
الانتقال
</button>
<button
[
disabled
]="!
canMoveToProgress
"
type=
"button"
class=
"btn btn-danger"
(
click
)="
onSubmit
()"
>
الانتقال
</button>
</div>
src/app/projects/pages/project-details/project-details.component.html
View file @
58069c61
...
...
@@ -78,6 +78,8 @@
<track-controll
[
project
]="
project
"
(
complete
)="
openProjectComplete
()"
(
replan
)="
openRepan
()"
>
</track-controll>
...
...
src/app/projects/pages/project-details/project-details.component.ts
View file @
58069c61
...
...
@@ -7,6 +7,8 @@ import { ProjectService } from '../../services/project.service';
import
{
ProjectToprogressModalComponent
}
from
'../../components/projectModals/project-toprogress-modal/project-toprogress-modal.component'
;
import
{
NgModel
}
from
'@angular/forms'
;
import
{
NgbModal
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
ProjectCompleteModalComponent
}
from
'../../components/projectModals/project-complete-modal/project-complete-modal.component'
;
import
{
ProjectReplanModalComponent
}
from
'../../components/projectModals/project-replan-modal/project-replan-modal.component'
;
@
Component
({
...
...
@@ -55,6 +57,50 @@ export class ProjectDetailsComponent implements OnInit {
});
}
openRepan
()
{
const
modalRef
=
this
.
modalService
.
open
(
ProjectReplanModalComponent
);
modalRef
.
componentInstance
.
project
=
this
.
project
;
modalRef
.
result
.
then
((
result
)
=>
{
if
(
result
)
{
// Add the new project to the list
this
.
loadProject
();
}
},
(
reason
)
=>
{
});
}
openProjectComplete
(){
const
modalRef
=
this
.
modalService
.
open
(
ProjectCompleteModalComponent
);
modalRef
.
componentInstance
.
project
=
this
.
project
;
modalRef
.
result
.
then
((
result
)
=>
{
if
(
result
)
{
// Add the new project to the list
this
.
loadProject
();
}
},
(
reason
)
=>
{
});
}
public
downloadAsPdf
():
void
{
this
.
pdfDownloader
.
downloadAsPdf
(
'pdfContent'
);
}
...
...
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