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
03e89323
Commit
03e89323
authored
Sep 08, 2025
by
Ooh-Ao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dataset
parent
d7952bf7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
13 deletions
+22
-13
widget-config.component.ts
...board-management/widget-config/widget-config.component.ts
+14
-9
dataset-widget-linker.component.html
...ge/widget-management/dataset-widget-linker.component.html
+4
-4
dataset-widget-linker.component.ts
...nage/widget-management/dataset-widget-linker.component.ts
+4
-0
No files found.
src/app/portal-manage/dashboard-management/widget-config/widget-config.component.ts
View file @
03e89323
...
...
@@ -15,6 +15,7 @@ import { WidgetModel } from '../../models/widgets.model';
export
interface
WidgetConfigDialogData
{
widget
:
WidgetModel
;
availableColumns
:
string
[];
currentConfig
?:
any
;
// Add optional currentConfig for editing
}
@
Component
({
...
...
@@ -50,16 +51,20 @@ export class WidgetConfigComponent implements OnInit {
this
.
availableColumns
=
this
.
data
.
availableColumns
;
this
.
widgetType
=
this
.
data
.
widget
.
component
;
// Handle config whether it is a string or an object
try
{
if
(
typeof
this
.
data
.
widget
.
config
===
'string'
)
{
this
.
currentConfig
=
JSON
.
parse
(
this
.
data
.
widget
.
config
);
}
else
{
this
.
currentConfig
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
.
widget
.
config
||
{}));
// Prioritize the passed-in currentConfig for editing, otherwise use the widget's default config.
if
(
this
.
data
.
currentConfig
&&
Object
.
keys
(
this
.
data
.
currentConfig
).
length
>
0
)
{
this
.
currentConfig
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
.
currentConfig
));
// Deep copy to prevent modifying the original object
}
else
{
try
{
if
(
typeof
this
.
data
.
widget
.
config
===
'string'
)
{
this
.
currentConfig
=
JSON
.
parse
(
this
.
data
.
widget
.
config
||
'{}'
);
}
else
{
this
.
currentConfig
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
.
widget
.
config
||
{}));
}
}
catch
(
e
)
{
console
.
error
(
'Error parsing widget config:'
,
e
);
this
.
currentConfig
=
{};
}
}
catch
(
e
)
{
console
.
error
(
'Error parsing widget config:'
,
e
);
this
.
currentConfig
=
{};
}
const
gridLikeWidgets
=
[
'SyncfusionDatagridWidgetComponent'
,
'NewDataTableWidget'
,
'MatrixWidgetComponent'
];
...
...
src/app/portal-manage/widget-management/dataset-widget-linker.component.html
View file @
03e89323
...
...
@@ -35,13 +35,13 @@
<ul
*
ngIf=
"linkedWidgets.length > 0"
class=
"space-y-2"
>
<li
*
ngFor=
"let widget of linkedWidgets"
class=
"flex items-center justify-between p-2 rounded-md transition-colors cursor-pointer"
[
class
.
bg-sky-100
]="
widget
.
itemId =
==
widgetToPreview
?.
item
Id
"
[
class
.
hover:bg-gray-100
]="
widget
.
itemId
!==
widgetToPreview
?.
item
Id
"
[
class
.
bg-sky-100
]="
widget
.
widget
.
widgetId =
==
widgetToPreview
?.
widget
?.
widget
Id
"
[
class
.
hover:bg-gray-100
]="
widget
.
widget
.
widgetId
!==
widgetToPreview
?.
widget
?.
widget
Id
"
(
click
)="
viewWidget
(
widget
)"
>
<span
class=
"font-medium"
>
{{ widget.widget.thName }}
</span>
<div
class=
"flex items-center space-x-2"
>
<button
(
click
)="
removeWidget
(
widget
,
$
event
)"
class=
"text-red
-600
hover:text-red-800"
title=
"Remove"
>
<i
class=
"bi bi-trash-fill"
></i>
<button
(
click
)="
removeWidget
(
widget
,
$
event
)"
class=
"text-red hover:text-red-800"
title=
"Remove"
>
<i
class=
"bi bi-trash-fill
text-red
"
></i>
</button>
</div>
</li>
...
...
src/app/portal-manage/widget-management/dataset-widget-linker.component.ts
View file @
03e89323
...
...
@@ -209,6 +209,10 @@ 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
!
);
// Refresh the entire preview to reflect the changes
this
.
viewWidget
(
this
.
widgetToPreview
!
);
});
...
...
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