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
bc8376ab
Commit
bc8376ab
authored
Sep 08, 2025
by
Ooh-Ao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
linker success
parent
03e89323
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
m-menuitems-widget.service.ts
src/app/portal-manage/services/m-menuitems-widget.service.ts
+9
-4
dataset-widget-linker.component.ts
...nage/widget-management/dataset-widget-linker.component.ts
+3
-3
No files found.
src/app/portal-manage/services/m-menuitems-widget.service.ts
View file @
bc8376ab
import
{
Injectable
}
from
'@angular/core'
;
import
{
HttpClient
}
from
'@angular/common/http'
;
import
{
HttpClient
,
HttpHeaders
}
from
'@angular/common/http'
;
import
{
Observable
,
of
}
from
'rxjs'
;
import
{
map
,
catchError
}
from
'rxjs/operators'
;
// Removed tap
import
{
MenuItemsWidget
}
from
'../models/m-menuitems-widget.model'
;
...
...
@@ -55,9 +55,14 @@ export class MMenuitemsWidgetService {
* @param itemId The itemId of the MenuItemsWidget to delete.
* @returns An Observable indicating success.
*/
deleteLinkedWidget
(
itemId
:
string
):
Observable
<
any
>
{
// Assuming DELETE /mmenuitems-widget expects itemId as a query parameter
return
this
.
http
.
delete
<
any
>
(
this
.
baseUrl
,
{
params
:
{
itemId
}
}).
pipe
(
deleteLinkedWidget
(
menuItem
:
MenuItemsWidget
):
Observable
<
any
>
{
const
options
=
{
headers
:
new
HttpHeaders
({
"Content-Type"
:
"application/json"
,
}),
body
:
menuItem
};
return
this
.
http
.
delete
<
any
>
(
this
.
baseUrl
,
options
).
pipe
(
catchError
(
error
=>
{
console
.
error
(
'Error deleting linked widget:'
,
error
);
throw
error
;
// Re-throw to propagate error
...
...
src/app/portal-manage/widget-management/dataset-widget-linker.component.ts
View file @
bc8376ab
...
...
@@ -147,7 +147,7 @@ export class DatasetWidgetLinkerComponent implements OnInit {
}
this
.
selectedDatasetId
=
event
.
value
;
console
.
log
(
'Dataset selection changed. New ID:'
,
this
.
selectedDatasetId
);
this
.
clearPreview
();
if
(
this
.
selectedDatasetId
)
{
this
.
loadLinkedWidgetsForDataset
(
this
.
selectedDatasetId
);
...
...
@@ -209,7 +209,7 @@ export class DatasetWidgetLinkerComponent implements OnInit {
// Persist the changes to the backend
this
.
mMenuitemsWidgetService
.
saveLinkedWidget
(
this
.
widgetToPreview
!
).
subscribe
(()
=>
{
this
.
notificationService
.
success
(
'Success'
,
'Configuration saved successfully!'
);
// Re-trigger the data fetch in the state service to get fresh data
this
.
dashboardStateService
.
selectDataset
(
this
.
selectedDatasetId
!
);
...
...
@@ -224,7 +224,7 @@ export class DatasetWidgetLinkerComponent implements OnInit {
removeWidget
(
widget
:
MenuItemsWidget
,
event
:
MouseEvent
):
void
{
event
.
stopPropagation
();
if
(
confirm
(
'Are you sure you want to unlink this widget?'
))
{
this
.
mMenuitemsWidgetService
.
deleteLinkedWidget
(
widget
.
itemId
).
subscribe
(()
=>
{
this
.
mMenuitemsWidgetService
.
deleteLinkedWidget
(
widget
).
subscribe
(()
=>
{
this
.
notificationService
.
success
(
'Success'
,
'Widget unlinked successfully!'
);
if
(
this
.
widgetToPreview
?.
itemId
===
widget
.
itemId
)
{
this
.
clearPreview
();
...
...
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