Joaquim Grilo
08/06/2025, 1:12 PMIsmail Karafakioglu
08/06/2025, 1:26 PMJoaquim Grilo
08/06/2025, 1:57 PMJoaquim Grilo
08/06/2025, 1:59 PMonDashboardLoaded(e: Event) {
const detail = (e as CustomEvent).detail;
const filters = detail?.dashboard?.filterContext?.filters;
if (Array.isArray(filters)) {
this.dashboardFilters.push(...filters);
}
}
onDashboardFilterChange(e: Event) {
const detail = (e as CustomEvent).detail;
const filters = detail?.dashboard?.filterContext?.filters;
if (Array.isArray(filters)) {
this.dashboardFilters.push(...filters);
}
}
ngOnInit(): void {
this.globalDashboardSvc.activeDashboardSubject$
.pipe(
distinctUntilChanged((prevDashboard, currDashboard) => JSON.stringify(prevDashboard) === JSON.stringify(currDashboard)),
tap(dashboard => {
if(!dashboard) {
this.dashboardConfigured.set(false);
this.gdDashboardLoading$.next(false);
}
}),
filter(dashboard => !!dashboard),
untilDestroyed(this),
)
.subscribe(dashboard => {
this.dashboardId = dashboard?.dashId;
this.authenticateAndInjectGdScript(dashboard?.workspaceId);
})
this.globalDashboardSvc.activeCustomer$.pipe(
filter(customer => !!customer),
untilDestroyed(this),
).subscribe(customer => {
if(customer?.enableLegacyDashboard) {
this.gdDashboardLoading$.next(false);
this.dashboardConfigured.set(false);
}
})
}
cleanUpGdElements() {
// Clean up existing elements
document.getElementById('customDashScript')?.remove();
document.getElementById('gdElement')?.remove();
}
Ismail Karafakioglu
08/06/2025, 2:27 PMIsmail Karafakioglu
08/07/2025, 11:46 AMauto-save last state
which saves the filter configuration in the browser’s local storage. But this feature is unfortunately not available in the component embedding.
Please let me know if you have further questions. Thank youJoaquim Grilo
08/07/2025, 11:59 AMIsmail Karafakioglu
08/07/2025, 12:36 PMJoaquim Grilo
08/07/2025, 12:36 PMIsmail Karafakioglu
08/07/2025, 12:36 PMJoaquim Grilo
08/07/2025, 12:39 PMJoaquim Grilo
08/07/2025, 1:46 PM