This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch chore/ts-migration-dashboard
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/chore/ts-migration-dashboard 
by this push:
     new 7265f63d4a6 refactor(dashboard): add missing properties to 
DashboardState and DashboardInfo types
7265f63d4a6 is described below

commit 7265f63d4a666ef9f7f15ce79078edf16ffabfc0
Author: Evan Rusackas <[email protected]>
AuthorDate: Thu Feb 5 13:15:22 2026 -0800

    refactor(dashboard): add missing properties to DashboardState and 
DashboardInfo types
    
    - Add lastRefreshTime and tabActivationTimes to DashboardState
    - Add filter_scopes to DashboardInfo.metadata
    - Remove inline type extensions in Tab.tsx selectors
    - Remove Record<string, unknown> casts in useHeaderActionsDropdownMenu.tsx
    
    Co-Authored-By: Claude Opus 4.5 <[email protected]>
---
 .../components/Header/useHeaderActionsDropdownMenu.tsx      | 12 ++----------
 .../src/dashboard/components/gridComponents/Tab/Tab.tsx     | 13 ++-----------
 superset-frontend/src/dashboard/types.ts                    |  3 +++
 3 files changed, 7 insertions(+), 21 deletions(-)

diff --git 
a/superset-frontend/src/dashboard/components/Header/useHeaderActionsDropdownMenu.tsx
 
b/superset-frontend/src/dashboard/components/Header/useHeaderActionsDropdownMenu.tsx
index f96638772d7..4f4691a5990 100644
--- 
a/superset-frontend/src/dashboard/components/Header/useHeaderActionsDropdownMenu.tsx
+++ 
b/superset-frontend/src/dashboard/components/Header/useHeaderActionsDropdownMenu.tsx
@@ -273,10 +273,7 @@ export const useHeaderActionsMenu = ({
     // Only add divider if there are items after it
     const hasItemsAfterDivider =
       (!editMode && reportMenuItem) ||
-      (editMode &&
-        !isEmpty(
-          (dashboardInfo?.metadata as Record<string, unknown>)?.filter_scopes,
-        ));
+      (editMode && !isEmpty(dashboardInfo?.metadata?.filter_scopes));
 
     if (hasItemsAfterDivider) {
       menuItems.push({ type: 'divider' });
@@ -288,12 +285,7 @@ export const useHeaderActionsMenu = ({
     }
 
     // Set filter mapping
-    if (
-      editMode &&
-      !isEmpty(
-        (dashboardInfo?.metadata as Record<string, unknown>)?.filter_scopes,
-      )
-    ) {
+    if (editMode && !isEmpty(dashboardInfo?.metadata?.filter_scopes)) {
       menuItems.push(
         createModalMenuItem(
           MenuKeys.SetFilterMapping,
diff --git 
a/superset-frontend/src/dashboard/components/gridComponents/Tab/Tab.tsx 
b/superset-frontend/src/dashboard/components/gridComponents/Tab/Tab.tsx
index 323acb6c5ce..404f7466627 100644
--- a/superset-frontend/src/dashboard/components/gridComponents/Tab/Tab.tsx
+++ b/superset-frontend/src/dashboard/components/gridComponents/Tab/Tab.tsx
@@ -153,20 +153,11 @@ const Tab = (props: TabProps): ReactElement => {
     (state: RootState) => state.dashboardLayout.present,
   );
   const lastRefreshTime = useSelector(
-    (state: RootState) =>
-      (
-        state.dashboardState as RootState['dashboardState'] & {
-          lastRefreshTime?: number;
-        }
-      ).lastRefreshTime,
+    (state: RootState) => state.dashboardState.lastRefreshTime,
   );
   const tabActivationTime = useSelector(
     (state: RootState) =>
-      (
-        state.dashboardState as RootState['dashboardState'] & {
-          tabActivationTimes?: Record<string, number>;
-        }
-      ).tabActivationTimes?.[props.id] || 0,
+      state.dashboardState.tabActivationTimes?.[props.id] || 0,
   );
   const dashboardInfo = useSelector((state: RootState) => state.dashboardInfo);
 
diff --git a/superset-frontend/src/dashboard/types.ts 
b/superset-frontend/src/dashboard/types.ts
index e2475ebf124..3e973a8b34b 100644
--- a/superset-frontend/src/dashboard/types.ts
+++ b/superset-frontend/src/dashboard/types.ts
@@ -143,6 +143,8 @@ export type DashboardState = {
   shouldPersistRefreshFrequency?: boolean;
   colorNamespace?: string;
   isStarred?: boolean;
+  lastRefreshTime?: number;
+  tabActivationTimes?: Record<string, number>;
 };
 export type DashboardInfo = {
   id: number;
@@ -170,6 +172,7 @@ export type DashboardInfo = {
     timed_refresh_immune_slices?: number[];
     refresh_frequency?: number;
     positions?: JsonObject;
+    filter_scopes?: JsonObject;
   };
   crossFiltersEnabled: boolean;
   filterBarOrientation: FilterBarOrientation;

Reply via email to