diff --git a/superset-frontend/src/embedded/api.tsx b/superset-frontend/src/embedded/api.tsx index 484c281f2c509..7e3fe705d30d4 100644 --- a/superset-frontend/src/embedded/api.tsx +++ b/superset-frontend/src/embedded/api.tsx @@ -1,29 +1,30 @@ import { store } from '../views/store'; import { bootstrapData } from '../preamble'; -import { getDashboardPermalink as getDashboardPermalinkUtil } from "../utils/urlUtils"; +import { getDashboardPermalink as getDashboardPermalinkUtil } from '../utils/urlUtils'; type Size = { - width: number, height: number -} + width: number; + height: number; +}; type EmbeddedSupersetApi = { getScrollSize: () => Size; getDashboardPermalink: ({ anchor }: { anchor: string }) => Promise; getActiveTabs: () => string[]; -} +}; const getScrollSize = (): Size => ({ width: document.body.scrollWidth, height: document.body.scrollHeight, -}) +}); -const getDashboardPermalink = async ({anchor}: {anchor: string}): Promise => { +const getDashboardPermalink = async ({ anchor }: { anchor: string }): Promise => { const state = store?.getState(); const { dashboardId, dataMask, activeTabs } = { dashboardId: state?.dashboardInfo?.id || bootstrapData?.embedded!.dashboard_id, dataMask: state?.dataMask, activeTabs: state.dashboardState?.activeTabs, - } + }; return getDashboardPermalinkUtil({ dashboardId, @@ -31,12 +32,12 @@ const getDashboardPermalink = async ({anchor}: {anchor: string}): Promise store?.getState()?.dashboardState?.activeTabs || []; export const embeddedApi: EmbeddedSupersetApi = { getScrollSize, getDashboardPermalink, - getActiveTabs + getActiveTabs, };