Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Meu-Template-Angular-CSR
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
Trần Anh Phú
Meu-Template-Angular-CSR
Commits
c5eb854f
Commit
c5eb854f
authored
Jul 09, 2025
by
Nguyễn Thị Thanh Trúc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update dashboard
parent
0db63e9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
dashboard.component.ts
src/app/+admin/pages/dashboard/dashboard.component.ts
+10
-2
No files found.
src/app/+admin/pages/dashboard/dashboard.component.ts
View file @
c5eb854f
import
{
Component
,
ChangeDetectionStrategy
,
inject
,
OnInit
,
signal
}
from
'@angular/core'
;
import
{
Component
,
ChangeDetectionStrategy
,
inject
,
OnInit
,
signal
,
ChangeDetectorRef
}
from
'@angular/core'
;
import
{
CommonModule
}
from
'@angular/common'
;
import
{
NzTableModule
}
from
'ng-zorro-antd/table'
;
import
{
NzButtonModule
}
from
'ng-zorro-antd/button'
;
...
...
@@ -263,9 +263,10 @@ import { JobFormComponent } from '../../components/job-form/job-form.component';
</nz-modal>
}
`
,
changeDetection
:
ChangeDetectionStrategy
.
Default
,
changeDetection
:
ChangeDetectionStrategy
.
OnPush
,
})
export
class
DashboardComponent
implements
OnInit
{
private
readonly
cdr
=
inject
(
ChangeDetectorRef
);
readonly
jobStateService
=
inject
(
JobStateService
);
private
readonly
jobApiService
=
inject
(
JobApiService
);
private
readonly
messageService
=
inject
(
NzMessageService
);
...
...
@@ -306,18 +307,21 @@ export class DashboardComponent implements OnInit {
this
.
isEditMode
=
false
;
this
.
selectedJob
=
null
;
this
.
showJobFormModal
=
true
;
this
.
cdr
.
markForCheck
();
}
editJob
(
job
:
Job
):
void
{
this
.
isEditMode
=
true
;
this
.
selectedJob
=
job
;
this
.
showJobFormModal
=
true
;
this
.
cdr
.
markForCheck
();
}
viewJobDetail
(
job
:
Job
):
void
{
this
.
selectedJob
=
job
;
this
.
showDetailModal
=
true
;
console
.
log
(
'Opening job detail for:'
,
job
.
title
);
this
.
cdr
.
markForCheck
();
}
confirmDeleteJob
(
job
:
Job
):
void
{
...
...
@@ -337,9 +341,11 @@ export class DashboardComponent implements OnInit {
next
:
()
=>
{
this
.
jobStateService
.
removeJob
(
job
.
id
);
this
.
messageService
.
success
(
`Job "
${
job
.
title
}
" deleted successfully`
);
this
.
cdr
.
markForCheck
();
},
error
:
(
error
)
=>
{
this
.
messageService
.
error
(
`Failed to delete job:
${
error
.
message
}
`
);
this
.
cdr
.
markForCheck
();
}
});
}
...
...
@@ -361,6 +367,7 @@ export class DashboardComponent implements OnInit {
this
.
selectedJob
=
null
;
this
.
isEditMode
=
false
;
this
.
jobFormLoading
.
set
(
false
);
this
.
cdr
.
markForCheck
();
}
closeDetailModal
():
void
{
...
...
@@ -368,6 +375,7 @@ export class DashboardComponent implements OnInit {
this
.
showDetailModal
=
false
;
this
.
selectedJob
=
null
;
console
.
log
(
'Detail modal closed, state reset'
);
this
.
cdr
.
markForCheck
();
}
onEditJobFromDetail
(
job
:
Job
):
void
{
...
...
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