Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
portal-apps-manage
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
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
angular
portal-apps-manage
Commits
126de83b
Commit
126de83b
authored
Sep 02, 2025
by
Ooh-Ao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
เอา popup ออก
parent
1d851225
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
dashboard-management.component.ts
...ge/dashboard-management/dashboard-management.component.ts
+18
-9
No files found.
src/app/portal-manage/dashboard-management/dashboard-management.component.ts
View file @
126de83b
...
...
@@ -225,7 +225,7 @@ export class DashboardManagementComponent implements OnInit {
if
(
dashboard
.
datasetId
)
{
this
.
dashboardStateService
.
selectDataset
(
dashboard
.
datasetId
);
}
this
.
notificationService
.
success
(
'Success'
,
'Dashboard loaded successfully!'
);
//
this.notificationService.success('Success', 'Dashboard loaded successfully!');
}
});
}
...
...
@@ -241,14 +241,23 @@ export class DashboardManagementComponent implements OnInit {
widgets
:
[]
});
this
.
dashboardDataService
.
saveDashboard
(
newDashboard
).
pipe
(
switchMap
(
addedDashboard
=>
{
// After saving, refetch the list of all dashboards
return
this
.
dashboardDataService
.
getDashboards
().
pipe
(
map
(
dashboards
=>
({
addedDashboard
,
dashboards
}))
);
}),
catchError
(
error
=>
{
this
.
notificationService
.
error
(
'Error'
,
'Failed to create new dashboard.'
);
return
throwError
(()
=>
error
);
})
).
subscribe
(
addedDashboard
=>
{
this
.
userDashboards
.
push
(
addedDashboard
);
this
.
selectedDashboardId
=
addedDashboard
;
this
.
loadSelectedDashboard
();
).
subscribe
(
({
addedDashboard
,
dashboards
})
=>
{
this
.
userDashboards
=
dashboards
;
// Update the local list with the fresh list
this
.
selectedDashboardId
=
addedDashboard
;
// Select the new dashboard
this
.
loadSelectedDashboard
();
// Load the new dashboard
this
.
notificationService
.
success
(
'Success'
,
'New dashboard created successfully!'
);
});
}
...
...
@@ -262,7 +271,7 @@ export class DashboardManagementComponent implements OnInit {
return
throwError
(()
=>
error
);
})
).
subscribe
(()
=>
{
this
.
notificationService
.
success
(
'Success'
,
'Dashboard name saved successfully!'
);
//
this.notificationService.success('Success', 'Dashboard name saved successfully!');
});
}
}
...
...
@@ -319,7 +328,7 @@ export class DashboardManagementComponent implements OnInit {
return
throwError
(()
=>
error
);
})
).
subscribe
(()
=>
{
this
.
notificationService
.
success
(
'Success'
,
'Dashboard layout saved successfully!'
);
//
this.notificationService.success('Success', 'Dashboard layout saved successfully!');
this
.
loadSelectedDashboard
();
});
}
...
...
@@ -347,7 +356,7 @@ export class DashboardManagementComponent implements OnInit {
this
.
dashboardData
!
.
widgets
.
push
(
newWidgetInstance
);
this
.
panels
=
this
.
mapWidgetsToPanels
(
this
.
dashboardData
!
.
widgets
);
this
.
notificationService
.
info
(
'Info'
,
`Added widget:
${
widget
.
thName
}
`
);
//
this.notificationService.info('Info', `Added widget: ${widget.thName}`);
});
}
...
...
@@ -371,7 +380,7 @@ export class DashboardManagementComponent implements OnInit {
const
updatedDashboard
=
{
...
this
.
dashboardData
,
widgets
:
this
.
dashboardData
.
widgets
.
filter
(
w
=>
w
.
widgetId
!==
panelId
)
};
this
.
dashboardData
=
updatedDashboard
;
this
.
panels
=
this
.
mapWidgetsToPanels
(
updatedDashboard
.
widgets
);
this
.
notificationService
.
info
(
'Info'
,
'Widget removed from dashboard.'
);
//
this.notificationService.info('Info', 'Widget removed from dashboard.');
}
}
...
...
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