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
f32c313a
Commit
f32c313a
authored
Aug 30, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix side bar
parent
4e3b3a70
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
210 additions
and
22 deletions
+210
-22
nav-item.component.html
src/app/shared/componenets/nav-item/nav-item.component.html
+3
-4
nav-item.component.ts
src/app/shared/componenets/nav-item/nav-item.component.ts
+8
-3
sideBarItems.ts
src/app/shared/conastants/sideBarItems.ts
+172
-0
sidebar.component.html
src/app/shared/sharedLayout/sidebar/sidebar.component.html
+15
-15
sidebar.component.ts
src/app/shared/sharedLayout/sidebar/sidebar.component.ts
+12
-0
No files found.
src/app/shared/componenets/nav-item/nav-item.component.html
View file @
f32c313a
<li
class=
"nav-item"
>
<li
class=
"nav-item"
>
<a
class=
"nav-link "
[
class
.
collapsed
]="
item
.
haschild
"
data-bs-target=
"#components-nav"
data-bs-toggle=
"collapse"
href=
"#"
>
<a
class=
"nav-link "
[
class
.
collapsed
]="
true
"
[
routerLink
]="[
item
.
routing
]"
>
<i
class=
"fe fe-menu"
></i><span>
{{item.name}}
</span><i
class=
"bi bi-chevron-down ms-auto"
></i>
<i
class=
"fe fe-menu"
></i><span>
{{item.name}}
</span><i
class=
"bi bi-chevron-down ms-auto"
></i>
</a>
</a>
<ul
*
ngFor=
"let i of item.child"
>
<nav-item
[
item
]="
i
"
></nav-item>
</ul>
</li>
<!-- End Components Nav -->
</li>
<!-- End Components Nav -->
\ No newline at end of file
src/app/shared/componenets/nav-item/nav-item.component.ts
View file @
f32c313a
...
@@ -2,10 +2,15 @@ import { Component, Input } from '@angular/core';
...
@@ -2,10 +2,15 @@ import { Component, Input } from '@angular/core';
export
interface
NavItem
{
export
interface
NavItem
{
name
:
string
,
name
:
string
,
child
:
NavItem
[]
|
null
,
isCollapsed
:
boolean
haschild
:
boolean
requiredRole
:
string
,
icon
:
string
,
isBar
:
boolean
,
queryParams
:
string
routing
:
string
}
}
@
Component
({
@
Component
({
selector
:
'nav-item'
,
selector
:
'nav-item'
,
templateUrl
:
'./nav-item.component.html'
,
templateUrl
:
'./nav-item.component.html'
,
...
...
src/app/shared/conastants/sideBarItems.ts
0 → 100644
View file @
f32c313a
import
{
NavItem
}
from
"../componenets/nav-item/nav-item.component"
;
export
const
sideItems
:
NavItem
[]
=
[
{
name
:
'الصفحة الرئيسية'
,
icon
:
'fe fe-grid'
,
routing
:
'/'
,
isCollapsed
:
true
,
isBar
:
false
,
queryParams
:
''
,
requiredRole
:
'employee'
},
{
name
:
'المتابعة'
,
icon
:
''
,
routing
:
''
,
isCollapsed
:
true
,
isBar
:
true
,
requiredRole
:
'employee'
,
queryParams
:
''
,
},
{
name
:
'المتابعات غير المكتملة'
,
icon
:
'fe-menu'
,
routing
:
'/tracks/uncompleted'
,
isCollapsed
:
false
,
isBar
:
false
,
requiredRole
:
'employee'
,
queryParams
:
''
,
},
{
name
:
'عمليات المتابعة'
,
icon
:
'fe-flag'
,
routing
:
'/tracks'
,
isCollapsed
:
false
,
isBar
:
false
,
requiredRole
:
'employee'
,
queryParams
:
''
,
},
{
name
:
'أنواع المشاريع'
,
icon
:
''
,
routing
:
''
,
isCollapsed
:
false
,
isBar
:
true
,
requiredRole
:
'planner'
,
queryParams
:
''
,
},
{
name
:
'استعراض أنواع المشاريع'
,
icon
:
'fe-map'
,
routing
:
'/types'
,
isCollapsed
:
false
,
isBar
:
false
,
requiredRole
:
'employee'
,
queryParams
:
''
,
},
{
name
:
'إضافة نوع جديد'
,
icon
:
'fe-edit-2'
,
routing
:
'/types/create'
,
isCollapsed
:
false
,
isBar
:
false
,
requiredRole
:
'planner'
,
queryParams
:
''
,
},
{
name
:
'الجهات الطارحة'
,
icon
:
''
,
routing
:
''
,
isCollapsed
:
false
,
isBar
:
true
,
requiredRole
:
'planner'
,
queryParams
:
''
,
},
{
name
:
'استعراض الجهات الطارحة'
,
icon
:
'fe-map'
,
routing
:
'/customers'
,
isCollapsed
:
false
,
isBar
:
false
,
requiredRole
:
'employee'
,
queryParams
:
''
,
},
{
name
:
'إضافة جهة طارحة'
,
icon
:
'fe-edit-2'
,
routing
:
'/customers/create'
,
isCollapsed
:
false
,
isBar
:
false
,
requiredRole
:
'planner'
,
queryParams
:
''
,
},
{
name
:
'إدارة المشاريع'
,
icon
:
''
,
routing
:
''
,
isCollapsed
:
false
,
isBar
:
true
,
requiredRole
:
'employee'
,
queryParams
:
''
}
,
{
name
:
'طرح مشروع'
,
icon
:
'fe-plus'
,
routing
:
'/projects/create'
,
isCollapsed
:
false
,
isBar
:
false
,
queryParams
:
''
,
requiredRole
:
'employee'
},
{
name
:
'استعراض المشاريع'
,
icon
:
'fe-map'
,
routing
:
'/projects'
,
queryParams
:
"{ listType: 'all'}"
,
isCollapsed
:
false
,
isBar
:
false
,
requiredRole
:
'scientific-deputy'
},
{
name
:
'المشاريع التي أدريرها'
,
icon
:
'fe-edit-2'
,
routing
:
'/customers/create'
,
isCollapsed
:
false
,
isBar
:
false
,
queryParams
:
"{ listType: 'managed'}"
,
requiredRole
:
'planner'
},
{
name
:
'المشاريع التي أرأسها'
,
icon
:
'fe-edit-2'
,
routing
:
'/customers/create'
,
isCollapsed
:
false
,
isBar
:
false
,
queryParams
:
"{ listType: 'leaded'}"
,
requiredRole
:
'planner'
},
{
name
:
'العمل'
,
icon
:
''
,
routing
:
''
,
isCollapsed
:
false
,
isBar
:
true
,
requiredRole
:
'employee'
,
queryParams
:
''
}
,
{
name
:
'استعراض مساهماتي'
,
icon
:
'fe-plus'
,
routing
:
'/projects/create'
,
isCollapsed
:
false
,
isBar
:
false
,
queryParams
:
''
,
requiredRole
:
'employee'
},
{
name
:
'ملفي الشخصي'
,
icon
:
'fe-map'
,
routing
:
'/projects'
,
queryParams
:
"{ listType: 'all'}"
,
isCollapsed
:
false
,
isBar
:
false
,
requiredRole
:
'employee'
},
]
\ No newline at end of file
src/app/shared/sharedLayout/sidebar/sidebar.component.html
View file @
f32c313a
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
<aside
dir=
"rtl"
id=
"sidebar"
class=
"sidebar"
[
class
.
toggled
]="
isToggled
"
>
<aside
dir=
"rtl"
id=
"sidebar"
class=
"sidebar"
[
class
.
toggled
]="
isToggled
"
>
<ul
class=
"sidebar-nav"
id=
"sidebar-nav"
>
<ul
class=
"sidebar-nav"
id=
"sidebar-nav"
>
<li
class=
"nav-item"
>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
[
routerLink
]="['/']"
>
<a
class=
"nav-link"
[
routerLink
]="['/']"
>
<i
class=
"fe fe-grid"
></i>
<i
class=
"fe fe-grid"
></i>
...
@@ -11,18 +12,11 @@
...
@@ -11,18 +12,11 @@
<li
class=
"nav-heading"
>
المتابعة
</li>
<li
class=
"nav-heading"
>
المتابعة
</li>
<li
class=
"nav-item"
>
<li
class=
"nav-item"
>
<a
class=
"nav-link collapsed"
data-bs-target=
"#components-nav"
data-bs-toggle=
"collapse"
>
<a
class=
"nav-link collapsed"
<i
class=
"fe fe-menu"
></i><span>
إدارة المتابعة
</span><i
class=
"bi bi-chevron-down ms-auto"
></i>
[
routerLink
]="['/
tracks
/
uncompleted
']"
</a>
>
<ul
id=
"components-nav"
class=
"nav-content collapse "
data-bs-parent=
"#sidebar-nav"
>
<i
class=
"fe fe-airplay"
></i><span>
المتابعات غير المكتملة
</span>
<li>
</a>
<a
[
routerLink
]="['/
tracks
/
uncompleted
']"
>
<i
class=
"fe fe-circle"
></i><span>
المتابعات غير المكتملة
</span>
</a>
</li>
</ul>
</li>
<!-- End Components Nav -->
</li>
<!-- End Components Nav -->
<li
class=
"nav-item"
>
<li
class=
"nav-item"
>
...
@@ -37,8 +31,14 @@
...
@@ -37,8 +31,14 @@
<i
class=
"fe fe-map"
></i><span>
استعراض أنواع المشاريع
</span>
<i
class=
"fe fe-map"
></i><span>
استعراض أنواع المشاريع
</span>
</a>
</a>
</li>
</li>
<li
class=
"nav-item"
>
<li
class=
"nav-item"
<a
[
routerLink
]="['/
types
/
create
']"
class=
"nav-link collapsed "
>
*
ngIf=
"hasRole('Planner')"
>
<a
[
routerLink
]="['/
types
/
create
']"
class=
"nav-link collapsed "
>
<i
class=
"fe fe-edit-2"
></i><span>
إضافة نوع جديد
</span>
<i
class=
"fe fe-edit-2"
></i><span>
إضافة نوع جديد
</span>
</a>
</a>
</li>
</li>
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
<li
class=
"nav-item"
>
<li
class=
"nav-item"
>
<a
[
routerLink
]="['/
projects
/
create
']"
class=
"nav-link collapsed"
>
<a
[
routerLink
]="['/
projects
/
create
']"
class=
"nav-link collapsed"
>
<i
class=
"bi
bi-circle
"
></i><span>
طرح مشروع
</span>
<i
class=
"bi
fe-plus
"
></i><span>
طرح مشروع
</span>
</a>
</a>
</li>
</li>
<li
class=
"nav-item"
>
<li
class=
"nav-item"
>
...
...
src/app/shared/sharedLayout/sidebar/sidebar.component.ts
View file @
f32c313a
import
{
Component
,
Input
,
input
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
Input
,
input
,
OnInit
}
from
'@angular/core'
;
import
{
NavItem
}
from
'../../componenets/nav-item/nav-item.component'
;
import
{
NavItem
}
from
'../../componenets/nav-item/nav-item.component'
;
import
{
UserService
}
from
'../../../core/services/authentication/user.service'
;
import
{
UserService
}
from
'../../../core/services/authentication/user.service'
;
import
{
lastValueFrom
}
from
'rxjs'
;
@
Component
({
@
Component
({
selector
:
'app-sidebar'
,
selector
:
'app-sidebar'
,
...
@@ -10,12 +11,23 @@ import { UserService } from '../../../core/services/authentication/user.service'
...
@@ -10,12 +11,23 @@ import { UserService } from '../../../core/services/authentication/user.service'
export
class
SidebarComponent
implements
OnInit
{
export
class
SidebarComponent
implements
OnInit
{
id
:
number
id
:
number
roles
:
string
[]
constructor
(
private
userService
:
UserService
){}
constructor
(
private
userService
:
UserService
){}
@
Input
()
isToggled
:
Boolean
;
@
Input
()
isToggled
:
Boolean
;
ngOnInit
():
void
{
ngOnInit
():
void
{
this
.
roles
=
this
.
userService
.
getCurrentUser
().
roles
this
.
id
=
this
.
userService
.
getEmployeeId
();
this
.
id
=
this
.
userService
.
getEmployeeId
();
}
}
hasRole
(
roleName
:
string
):
boolean
{
return
this
.
roles
.
filter
(
e
=>
e
==
roleName
).
length
!=
0
}
}
}
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