From 204179f046328c96d5a80584a59e5df8c17af25b Mon Sep 17 00:00:00 2001 From: vmangalr Date: Thu, 15 Jan 2026 14:03:28 +0530 Subject: [PATCH 1/4] [DI-29167] - Time range preferences bug fix --- .../Dashboard/CloudPulseDashboardLanding.tsx | 14 ++++++++------ .../features/CloudPulse/Overview/GlobalFilters.tsx | 10 ++++++++-- .../shared/CloudPulseDashboardSelect.tsx | 1 + 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/packages/manager/src/features/CloudPulse/Dashboard/CloudPulseDashboardLanding.tsx b/packages/manager/src/features/CloudPulse/Dashboard/CloudPulseDashboardLanding.tsx index a6bb489a610..3789dcd7797 100644 --- a/packages/manager/src/features/CloudPulse/Dashboard/CloudPulseDashboardLanding.tsx +++ b/packages/manager/src/features/CloudPulse/Dashboard/CloudPulseDashboardLanding.tsx @@ -83,13 +83,15 @@ export const CloudPulseDashboardLanding = () => { ); const onDashboardChange = React.useCallback( - (dashboardObj: Dashboard) => { + (dashboardObj: Dashboard, sameAsPreferences: boolean = false) => { setDashboard(dashboardObj); - setFilterData({ - id: {}, - label: {}, - }); // clear the filter values on dashboard change - setTimeDuration(defaultTimeDuration(timezone)); // clear time duration on dashboard change + if (!sameAsPreferences) { + setFilterData({ + id: {}, + label: {}, + }); // clear the filter values on dashboard change + setTimeDuration(defaultTimeDuration(timezone)); // clear time duration on dashboard change + } }, [timezone] ); diff --git a/packages/manager/src/features/CloudPulse/Overview/GlobalFilters.tsx b/packages/manager/src/features/CloudPulse/Overview/GlobalFilters.tsx index fdbd89ecf4f..6234fe451c9 100644 --- a/packages/manager/src/features/CloudPulse/Overview/GlobalFilters.tsx +++ b/packages/manager/src/features/CloudPulse/Overview/GlobalFilters.tsx @@ -30,7 +30,10 @@ export interface GlobalFilterProperties { filterValue: FilterValueType, labels: string[] ): void; - handleDashboardChange(dashboard: Dashboard | undefined): void; + handleDashboardChange( + dashboard: Dashboard | undefined, + sameAsPreferences?: boolean + ): void; handleGroupByChange: (selectedValues: string[]) => void; handleTimeDurationChange(timeDuration: DateTimeWithPreset): void; handleToggleAppliedFilter(isVisible: boolean): void; @@ -73,7 +76,10 @@ export const GlobalFilters = React.memo((props: GlobalFilterProperties) => { }); } setSelectedDashboard(dashboard); - handleDashboardChange(dashboard); + handleDashboardChange( + dashboard, + preferences?.[DASHBOARD_ID] === dashboard?.id + ); }, [] ); diff --git a/packages/manager/src/features/CloudPulse/shared/CloudPulseDashboardSelect.tsx b/packages/manager/src/features/CloudPulse/shared/CloudPulseDashboardSelect.tsx index 3bb9537f959..a03d9599c85 100644 --- a/packages/manager/src/features/CloudPulse/shared/CloudPulseDashboardSelect.tsx +++ b/packages/manager/src/features/CloudPulse/shared/CloudPulseDashboardSelect.tsx @@ -115,6 +115,7 @@ export const CloudPulseDashboardSelect = React.memo( // only call this code when the component is rendered initially if ( (savePreferences || !!serviceType) && + !dashboardsLoading && dashboardsList.length > 0 && selectedDashboard === undefined ) { From 27fe561e2d0d29bd39f7465294efd85c59bfc052 Mon Sep 17 00:00:00 2001 From: venkatmano-akamai Date: Fri, 16 Jan 2026 12:18:56 +0530 Subject: [PATCH 2/4] Update dependencies in GlobalFilters component --- .../manager/src/features/CloudPulse/Overview/GlobalFilters.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/manager/src/features/CloudPulse/Overview/GlobalFilters.tsx b/packages/manager/src/features/CloudPulse/Overview/GlobalFilters.tsx index 6234fe451c9..e930adae5dd 100644 --- a/packages/manager/src/features/CloudPulse/Overview/GlobalFilters.tsx +++ b/packages/manager/src/features/CloudPulse/Overview/GlobalFilters.tsx @@ -81,7 +81,7 @@ export const GlobalFilters = React.memo((props: GlobalFilterProperties) => { preferences?.[DASHBOARD_ID] === dashboard?.id ); }, - [] + [preferences] ); const emitFilterChange = React.useCallback( From 97d1d43dfb0d18774738f50ba480bf21261fba1f Mon Sep 17 00:00:00 2001 From: vmangalr Date: Fri, 16 Jan 2026 16:44:41 +0530 Subject: [PATCH 3/4] fix: [DI-29314] - changeset and code refactoring --- packages/manager/.changeset/pr-13287-fixed-1768562046475.md | 5 +++++ .../CloudPulse/Dashboard/CloudPulseDashboardLanding.tsx | 4 ++-- .../src/features/CloudPulse/Overview/GlobalFilters.tsx | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 packages/manager/.changeset/pr-13287-fixed-1768562046475.md diff --git a/packages/manager/.changeset/pr-13287-fixed-1768562046475.md b/packages/manager/.changeset/pr-13287-fixed-1768562046475.md new file mode 100644 index 00000000000..de88793d181 --- /dev/null +++ b/packages/manager/.changeset/pr-13287-fixed-1768562046475.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Fixed +--- + +Wrong time range sent in metrics payload on preference reload in `CloudPulse metrics` ([#13287](https://github.com/linode/manager/pull/13287)) diff --git a/packages/manager/src/features/CloudPulse/Dashboard/CloudPulseDashboardLanding.tsx b/packages/manager/src/features/CloudPulse/Dashboard/CloudPulseDashboardLanding.tsx index 3789dcd7797..5ebaf08e621 100644 --- a/packages/manager/src/features/CloudPulse/Dashboard/CloudPulseDashboardLanding.tsx +++ b/packages/manager/src/features/CloudPulse/Dashboard/CloudPulseDashboardLanding.tsx @@ -83,9 +83,9 @@ export const CloudPulseDashboardLanding = () => { ); const onDashboardChange = React.useCallback( - (dashboardObj: Dashboard, sameAsPreferences: boolean = false) => { + (dashboardObj: Dashboard, resetFiltersAndTimeDuration: boolean = false) => { setDashboard(dashboardObj); - if (!sameAsPreferences) { + if (!resetFiltersAndTimeDuration) { setFilterData({ id: {}, label: {}, diff --git a/packages/manager/src/features/CloudPulse/Overview/GlobalFilters.tsx b/packages/manager/src/features/CloudPulse/Overview/GlobalFilters.tsx index e930adae5dd..8f5011b2dfd 100644 --- a/packages/manager/src/features/CloudPulse/Overview/GlobalFilters.tsx +++ b/packages/manager/src/features/CloudPulse/Overview/GlobalFilters.tsx @@ -32,7 +32,7 @@ export interface GlobalFilterProperties { ): void; handleDashboardChange( dashboard: Dashboard | undefined, - sameAsPreferences?: boolean + resetFiltersAndTimeDuration?: boolean ): void; handleGroupByChange: (selectedValues: string[]) => void; handleTimeDurationChange(timeDuration: DateTimeWithPreset): void; From f0bf72a92e65c15b76fef03a689bfaed11b6056e Mon Sep 17 00:00:00 2001 From: vmangalr Date: Sat, 17 Jan 2026 10:59:44 +0530 Subject: [PATCH 4/4] fix: [DI-29314] - code refactoring --- .../CloudPulse/Dashboard/CloudPulseDashboardLanding.tsx | 4 ++-- .../src/features/CloudPulse/Overview/GlobalFilters.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/manager/src/features/CloudPulse/Dashboard/CloudPulseDashboardLanding.tsx b/packages/manager/src/features/CloudPulse/Dashboard/CloudPulseDashboardLanding.tsx index 5ebaf08e621..033d688a989 100644 --- a/packages/manager/src/features/CloudPulse/Dashboard/CloudPulseDashboardLanding.tsx +++ b/packages/manager/src/features/CloudPulse/Dashboard/CloudPulseDashboardLanding.tsx @@ -83,9 +83,9 @@ export const CloudPulseDashboardLanding = () => { ); const onDashboardChange = React.useCallback( - (dashboardObj: Dashboard, resetFiltersAndTimeDuration: boolean = false) => { + (dashboardObj: Dashboard, skipReset: boolean = false) => { setDashboard(dashboardObj); - if (!resetFiltersAndTimeDuration) { + if (!skipReset) { setFilterData({ id: {}, label: {}, diff --git a/packages/manager/src/features/CloudPulse/Overview/GlobalFilters.tsx b/packages/manager/src/features/CloudPulse/Overview/GlobalFilters.tsx index 8f5011b2dfd..030aea8c122 100644 --- a/packages/manager/src/features/CloudPulse/Overview/GlobalFilters.tsx +++ b/packages/manager/src/features/CloudPulse/Overview/GlobalFilters.tsx @@ -32,7 +32,7 @@ export interface GlobalFilterProperties { ): void; handleDashboardChange( dashboard: Dashboard | undefined, - resetFiltersAndTimeDuration?: boolean + skipReset?: boolean ): void; handleGroupByChange: (selectedValues: string[]) => void; handleTimeDurationChange(timeDuration: DateTimeWithPreset): void; @@ -81,7 +81,7 @@ export const GlobalFilters = React.memo((props: GlobalFilterProperties) => { preferences?.[DASHBOARD_ID] === dashboard?.id ); }, - [preferences] + [preferences, handleDashboardChange] ); const emitFilterChange = React.useCallback(