Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
Lamarts mobile app angular
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Arko Dey Bhowmick
Lamarts mobile app angular
Commits
f2cec643
Commit
f2cec643
authored
Mar 31, 2025
by
Arko Dey Bhowmick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: handle auth based ellement show hide
parent
ead309b5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
9 deletions
+20
-9
src/app/auth/service/auth.service.ts
src/app/auth/service/auth.service.ts
+5
-1
src/app/component-library/custom-table/custom-table.component.html
...omponent-library/custom-table/custom-table.component.html
+1
-1
src/app/component-library/custom-table/custom-table.component.ts
.../component-library/custom-table/custom-table.component.ts
+4
-1
src/app/portal/assignment/assignment/assignment.component.html
...pp/portal/assignment/assignment/assignment.component.html
+1
-1
src/app/portal/assignment/assignment/assignment.component.ts
src/app/portal/assignment/assignment/assignment.component.ts
+9
-5
No files found.
src/app/auth/service/auth.service.ts
View file @
f2cec643
...
...
@@ -49,8 +49,12 @@ export class AuthService {
const
localStorageItem
=
JSON
.
parse
(
localStorage
.
getItem
(
'
userProfile
'
)
!
);
return
localStorageItem
[
key
];
return
localStorageItem
[
key
]
||
''
;
}
public
getUserRole
():
string
{
return
this
.
localStorageGetItemByKey
(
'
role
'
);
}
}
src/app/component-library/custom-table/custom-table.component.html
View file @
f2cec643
...
...
@@ -16,7 +16,7 @@
</button>
</ng-container>
<ng-container
*ngIf=
"item =='edit'"
>
<ng-container
*ngIf=
"item =='edit'
&& authService.getUserRole() !== 'student'
"
>
<button
class=
"view_button d_inline_block width_auto "
(click)=
"edit(element)"
>
<span
class=
"material-symbols-outlined"
>
edit
</span>
</button>
...
...
src/app/component-library/custom-table/custom-table.component.ts
View file @
f2cec643
import
{
CommonModule
}
from
'
@angular/common
'
;
import
{
Component
,
EventEmitter
,
Input
,
Output
}
from
'
@angular/core
'
;
import
{
Component
,
EventEmitter
,
inject
,
Input
,
Output
}
from
'
@angular/core
'
;
import
{
MatTableModule
}
from
'
@angular/material/table
'
;
import
{
MatPaginator
}
from
'
@angular/material/paginator
'
;
import
{
AuthService
}
from
'
../../auth/service/auth.service
'
;
@
Component
({
selector
:
'
app-custom-table
'
,
...
...
@@ -28,6 +29,8 @@ export class CustomTableComponent {
@
Output
()
emitEdit
:
EventEmitter
<
string
>
=
new
EventEmitter
<
string
>
();
public
authService
=
inject
(
AuthService
);
// totalRecords: number = 3400;
// pageSize: number = 50;
...
...
src/app/portal/assignment/assignment/assignment.component.html
View file @
f2cec643
...
...
@@ -7,7 +7,7 @@
/>
</div>
<div
class=
"add_btn"
>
<div
class=
"add_btn"
*ngIf=
"authService.getUserRole() !== 'student'"
>
<app-square-button
[buttonIcon]=
"'add'"
(emitSquareButtonClick)=
"addAssignment()"
...
...
src/app/portal/assignment/assignment/assignment.component.ts
View file @
f2cec643
import
{
Component
}
from
'
@angular/core
'
;
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
CustomTableComponent
}
from
'
../../../component-library/custom-table/custom-table.component
'
;
import
{
MatDialog
}
from
'
@angular/material/dialog
'
;
import
{
ManageComponent
}
from
'
../manage/manage.component
'
;
...
...
@@ -10,23 +10,27 @@ import { UrlConfigService } from '../../service/url-config.service';
import
{
Assignment
}
from
'
../interface/assignment
'
;
import
{
PrepareAssignmentTableDataService
}
from
'
../service/prepare-assignment-table-data.service
'
;
import
{
DataSourceService
}
from
'
../../service/data-source.service
'
;
import
{
AuthService
}
from
'
../../../auth/service/auth.service
'
;
import
{
CommonModule
}
from
'
@angular/common
'
;
@
Component
({
selector
:
'
app-assignment
'
,
imports
:
[
CustomTableComponent
,
CommonModule
,
SquareButtonComponent
],
templateUrl
:
'
./assignment.component.html
'
,
styleUrl
:
'
./assignment.component.scss
'
})
export
class
AssignmentComponent
{
export
class
AssignmentComponent
implements
OnInit
{
constructor
(
private
_dialog
:
MatDialog
,
private
_assignmentTransmission
:
AssignmentTransmissionService
,
private
_urlConfig
:
UrlConfigService
,
private
_prepareAssignmentTableData
:
PrepareAssignmentTableDataService
private
_prepareAssignmentTableData
:
PrepareAssignmentTableDataService
,
public
authService
:
AuthService
)
{
}
public
columns
=
[
...
...
@@ -38,7 +42,7 @@ export class AssignmentComponent {
public
data
:
any
[]
=
[];
ngOnInit
():
void
{
public
ngOnInit
():
void
{
this
.
columns
=
this
.
_prepareAssignmentTableData
.
prepareMatTableColumn
();
this
.
_getAssignments
();
...
...
@@ -74,7 +78,7 @@ export class AssignmentComponent {
)
}
public
emitViewFromTable
(
clickedData
:
string
)
{
public
emitViewFromTable
(
clickedData
:
string
)
:
void
{
alert
(
"
Have to view the doc in another page
"
);
}
...
...
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