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
96142935
Commit
96142935
authored
Sep 03, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add project filter
parent
5fb13678
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
186 additions
and
9 deletions
+186
-9
filter-modal.component.css
...ojects/components/filter-modal/filter-modal.component.css
+0
-0
filter-modal.component.html
...jects/components/filter-modal/filter-modal.component.html
+49
-0
filter-modal.component.ts
...rojects/components/filter-modal/filter-modal.component.ts
+53
-0
getProjectAttachmentsRequest.ts
...requests/project-requests/getProjectAttachmentsRequest.ts
+8
-0
project-list.component.html
...p/projects/pages/project-list/project-list.component.html
+6
-4
project-list.component.ts
...app/projects/pages/project-list/project-list.component.ts
+58
-3
projects.module.ts
src/app/projects/projects.module.ts
+3
-1
project.service.ts
src/app/projects/services/project.service.ts
+8
-0
sidebar.component.html
src/app/shared/sharedLayout/sidebar/sidebar.component.html
+1
-1
No files found.
src/app/projects/components/filter-modal/filter-modal.component.css
0 → 100644
View file @
96142935
src/app/projects/components/filter-modal/filter-modal.component.html
0 → 100644
View file @
96142935
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"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-12 "
>
<label
for=
"stepName"
class=
"form-label"
>
اسم رئيس فريق العمل
</label>
<input
type=
"text"
name=
"tem"
id=
"tem"
class=
"form-control"
[(
ngModel
)]="
request
.
teamLeaderName
"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"mb-3 "
>
<label
for=
"fgdg"
class=
"form-label"
>
اسم الجهة الطارحة
</label>
<input
type=
"fgdg"
id=
"fgdg"
class=
"form-control"
[(
ngModel
)]="
request
.
proposerName
"
name=
"start"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"mb-3 col-12"
>
<label
for=
"worrker"
class=
"form-label"
>
اسم المشروع
</label>
<input
id=
"worrker"
class=
"form-control"
[(
ngModel
)]="
request
.
projectName
"
name=
"worker"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"mb-3 col-12"
>
<label
for=
"duration"
class=
"form-label"
>
القسم المنفذ
</label>
<select
id=
"duration"
class=
"form-control select "
[(
ngModel
)]="
request
.
departmentName
"
name=
"duration"
>
<option
*
ngFor=
"let dept of departments"
[
value
]="
dept
.
name
"
>
{{dept.name}}
</option>
</select>
</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>
\ No newline at end of file
src/app/projects/components/filter-modal/filter-modal.component.ts
0 → 100644
View file @
96142935
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Department
}
from
'../../models/responses/department'
;
import
{
EmployeesService
}
from
'../../../employees/services/employees.service'
;
import
{
NgbActiveModal
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
GetProjecByFilterRequest
}
from
'../../models/requests/project-requests/getProjectAttachmentsRequest'
;
@
Component
({
selector
:
'filter-modal'
,
templateUrl
:
'./filter-modal.component.html'
,
styleUrl
:
'./filter-modal.component.css'
})
export
class
FilterModalComponent
implements
OnInit
{
departments
:
Department
[]
request
:
GetProjecByFilterRequest
constructor
(
private
employeeService
:
EmployeesService
,
private
activeModal
:
NgbActiveModal
)
{
}
ngOnInit
():
void
{
this
.
request
=
{
projectName
:
''
,
proposerName
:
''
,
teamLeaderName
:
''
,
departmentName
:
''
}
this
.
employeeService
.
getDepartments
()
.
subscribe
({
next
:(
data
)
=>
{
this
.
departments
=
data
}
});
}
onSubmit
(){
this
.
activeModal
.
close
(
this
.
request
);
}
onClose
(){
this
.
activeModal
.
close
();
}
}
src/app/projects/models/requests/project-requests/getProjectAttachmentsRequest.ts
View file @
96142935
...
@@ -3,3 +3,11 @@ export interface GetProjectAttachmentsRequest {
...
@@ -3,3 +3,11 @@ export interface GetProjectAttachmentsRequest {
pageNumber
:
number
|
null
;
pageNumber
:
number
|
null
;
pageSize
:
number
|
null
;
pageSize
:
number
|
null
;
}
}
export
class
GetProjecByFilterRequest
{
projectName
:
string
teamLeaderName
:
string
departmentName
:
string
proposerName
:
string
}
src/app/projects/pages/project-list/project-list.component.html
View file @
96142935
...
@@ -6,17 +6,19 @@
...
@@ -6,17 +6,19 @@
<h2
class=
"h3 mb-0 page-title"
>
قائمة المشاريع
</h2>
<h2
class=
"h3 mb-0 page-title"
>
قائمة المشاريع
</h2>
</div>
</div>
<div
class=
"col-auto"
>
<div
class=
"col-auto"
>
<button
type=
"button"
(
click
)="
this
.
router
.
navigate
(['
projects
/
create
'])"
class=
"btn btn-primary"
><span
class=
"fe fe-file-plus fe-12 mr-2"
></span>
طرح مشروع
</button>
<button
(
click
)="
openFilter
()"
class=
"m-4 btn btn-primary"
>
فلترة
</button>
<button
type=
"button"
(
click
)="
this
.
router
.
navigate
(['
projects
/
create
'])"
class=
"m-4 btn btn-primary"
><span
class=
"fe fe-file-plus fe-12 mr-2"
></span>
طرح مشروع
</button>
</div>
</div>
</div>
</div>
<hr>
<hr>
<div
*
ngIf=
"projects"
>
<div
*
ngIf=
"projects"
>
<div
class=
"row"
*
ngIf=
"projects.length > 0"
>
<div
class=
"row"
*
ngIf=
"projects.length > 0"
>
<project-item
class=
"col
-4
"
*
ngFor=
"let project of projects"
[
project
]="
project
"
></project-item>
<project-item
class=
"col
col-4
"
*
ngFor=
"let project of projects"
[
project
]="
project
"
></project-item>
</div>
</div>
<div
class=
"row"
*
ngIf=
"projects.length == 0"
>
<div
class=
"row
text-center
"
*
ngIf=
"projects.length == 0"
>
لا يوجد أي مشروع
<strong>
لا يوجد أي مشروع
</strong>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
src/app/projects/pages/project-list/project-list.component.ts
View file @
96142935
...
@@ -6,6 +6,9 @@ import { Project } from '../../models/responses/project';
...
@@ -6,6 +6,9 @@ import { Project } from '../../models/responses/project';
import
{
ProjectService
}
from
'../../services/project.service'
;
import
{
ProjectService
}
from
'../../services/project.service'
;
import
{
GetProjectsByProjectManagerRequest
,
GetProjectsByTeamLeaderRequest
}
from
'../../models/requests/project-requests/GetProjectsByProjectManagerRequest'
;
import
{
GetProjectsByProjectManagerRequest
,
GetProjectsByTeamLeaderRequest
}
from
'../../models/requests/project-requests/GetProjectsByProjectManagerRequest'
;
import
{
UserService
}
from
'../../../core/services/authentication/user.service'
;
import
{
UserService
}
from
'../../../core/services/authentication/user.service'
;
import
{
NgbModal
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
FilterModalComponent
}
from
'../../components/filter-modal/filter-modal.component'
;
import
{
GetProjecByFilterRequest
}
from
'../../models/requests/project-requests/getProjectAttachmentsRequest'
;
@
Component
({
@
Component
({
selector
:
'project-list'
,
selector
:
'project-list'
,
...
@@ -15,7 +18,7 @@ import { UserService } from '../../../core/services/authentication/user.service'
...
@@ -15,7 +18,7 @@ import { UserService } from '../../../core/services/authentication/user.service'
export
class
ProjectListComponent
implements
OnInit
{
export
class
ProjectListComponent
implements
OnInit
{
projects
:
Project
[]
projects
:
Project
[]
request
:
GetProjecByFilterRequest
constructor
(
constructor
(
private
projectService
:
ProjectService
,
private
projectService
:
ProjectService
,
...
@@ -23,6 +26,7 @@ export class ProjectListComponent implements OnInit{
...
@@ -23,6 +26,7 @@ export class ProjectListComponent implements OnInit{
public
router
:
Router
,
public
router
:
Router
,
private
route
:
ActivatedRoute
,
private
route
:
ActivatedRoute
,
private
userService
:
UserService
,
private
userService
:
UserService
,
private
modalService
:
NgbModal
,
private
loadingService
:
LoadingService
private
loadingService
:
LoadingService
)
{
)
{
...
@@ -36,9 +40,16 @@ export class ProjectListComponent implements OnInit{
...
@@ -36,9 +40,16 @@ export class ProjectListComponent implements OnInit{
loadProjects
():
void
{
loadProjects
():
void
{
this
.
loadingService
.
show
()
this
.
loadingService
.
show
()
if
(
this
.
request
){
this
.
handleByFilter
();
}
else
{
this
.
handelAll
()
this
.
handelAll
()
}
}
}
handelAll
()
{
handelAll
()
{
this
.
projectService
.
getByFilter
()
this
.
projectService
.
getByFilter
()
...
@@ -60,5 +71,49 @@ export class ProjectListComponent implements OnInit{
...
@@ -60,5 +71,49 @@ export class ProjectListComponent implements OnInit{
handleByFilter
()
{
this
.
projectService
.
getByRequestFilter
(
this
.
request
)
.
subscribe
(
{
next
:
(
res
)
=>
{
this
.
projects
=
res
;
this
.
loadingService
.
hide
()
},
error
:
(
err
)
=>
{
this
.
toastr
.
error
(
"لقد حدث خظاء ما"
);
this
.
loadingService
.
hide
()
}
}
);
}
openFilter
()
{
const
modalRef
=
this
.
modalService
.
open
(
FilterModalComponent
);
modalRef
.
result
.
then
(
(
data
:
GetProjecByFilterRequest
)
=>
{
if
(
data
)
{
this
.
request
=
data
;
this
.
loadProjects
();
}
},
(
reason
)
=>
{
});
}
}
}
\ No newline at end of file
src/app/projects/projects.module.ts
View file @
96142935
...
@@ -46,6 +46,7 @@ import { ChangeLeaderModalComponent } from './components/projectModals/change-le
...
@@ -46,6 +46,7 @@ import { ChangeLeaderModalComponent } from './components/projectModals/change-le
import
{
EditStepModalComponent
}
from
'./components/step-modals/edit-step-modal/edit-step-modal.component'
;
import
{
EditStepModalComponent
}
from
'./components/step-modals/edit-step-modal/edit-step-modal.component'
;
import
{
EditWeightModalComponent
}
from
'./components/step-modals/edit-weight-modal/edit-weight-modal.component'
;
import
{
EditWeightModalComponent
}
from
'./components/step-modals/edit-weight-modal/edit-weight-modal.component'
;
import
{
ProjectBycreterionComponent
}
from
'./pages/project-bycreterion/project-bycreterion.component'
;
import
{
ProjectBycreterionComponent
}
from
'./pages/project-bycreterion/project-bycreterion.component'
;
import
{
FilterModalComponent
}
from
'./components/filter-modal/filter-modal.component'
;
@
NgModule
({
@
NgModule
({
declarations
:
[
declarations
:
[
...
@@ -82,7 +83,8 @@ import { ProjectBycreterionComponent } from './pages/project-bycreterion/project
...
@@ -82,7 +83,8 @@ import { ProjectBycreterionComponent } from './pages/project-bycreterion/project
ChangeLeaderModalComponent
,
ChangeLeaderModalComponent
,
EditStepModalComponent
,
EditStepModalComponent
,
EditWeightModalComponent
,
EditWeightModalComponent
,
ProjectBycreterionComponent
ProjectBycreterionComponent
,
FilterModalComponent
],
],
providers
:
[
providers
:
[
ProjectService
,
ProjectService
,
...
...
src/app/projects/services/project.service.ts
View file @
96142935
...
@@ -22,6 +22,7 @@ import { ChangeEmployeeParticipationRequest } from '../models/requests/project-r
...
@@ -22,6 +22,7 @@ import { ChangeEmployeeParticipationRequest } from '../models/requests/project-r
import
{
ParticipationChange
}
from
'../models/responses/participationChange'
;
import
{
ParticipationChange
}
from
'../models/responses/participationChange'
;
import
{
ProjectCompletion
}
from
'../models/responses/ProjectCompletion'
;
import
{
ProjectCompletion
}
from
'../models/responses/ProjectCompletion'
;
import
{
EmployeeContribution
}
from
'../models/responses/employeeContribution'
;
import
{
EmployeeContribution
}
from
'../models/responses/employeeContribution'
;
import
{
GetProjecByFilterRequest
}
from
'../models/requests/project-requests/getProjectAttachmentsRequest'
;
//#endregion Imports
//#endregion Imports
@
Injectable
({
@
Injectable
({
providedIn
:
'root'
providedIn
:
'root'
...
@@ -43,6 +44,13 @@ export class ProjectService {
...
@@ -43,6 +44,13 @@ export class ProjectService {
return
this
.
http
.
get
<
Project
[]
>
(
this
.
config
.
getServerUrl
()
+
"/Projects/ByFilter"
);
return
this
.
http
.
get
<
Project
[]
>
(
this
.
config
.
getServerUrl
()
+
"/Projects/ByFilter"
);
}
}
public
getByRequestFilter
(
request
:
GetProjecByFilterRequest
):
Observable
<
Project
[]
>
{
return
this
.
http
.
get
<
Project
[]
>
(
this
.
config
.
getServerUrl
()
+
"/Projects/ByFilter"
,{
params
:{...
request
}});
}
public
getParticipationChangeHistory
(
projectId
:
number
):
Observable
<
ParticipationChange
[]
>
{
public
getParticipationChangeHistory
(
projectId
:
number
):
Observable
<
ParticipationChange
[]
>
{
return
this
return
this
...
...
src/app/shared/sharedLayout/sidebar/sidebar.component.html
View file @
96142935
...
@@ -63,7 +63,7 @@
...
@@ -63,7 +63,7 @@
<li
class=
"nav-item"
*
ngIf=
"hasRole(alroles.SCIENTIFIC_DEPUTY)"
>
<li
class=
"nav-item"
*
ngIf=
"hasRole(alroles.SCIENTIFIC_DEPUTY)"
>
<a
<a
[
routerLink
]="['/
projects
']"
[
routerLink
]="['/
projects
']"
[
queryParams
]="{
listType:
'
all
'
}"
class=
"nav-link collapsed"
class=
"nav-link collapsed"
>
>
<i
class=
"fe fe-clipboard"
></i><span>
استعراض المشاريع
</span>
<i
class=
"fe fe-clipboard"
></i><span>
استعراض المشاريع
</span>
...
...
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