diff --git a/src/actions.ts b/src/actions.ts index 09f6c9df0..a07962c95 100644 --- a/src/actions.ts +++ b/src/actions.ts @@ -27,7 +27,7 @@ import { DiagnosticsData, FeatureFlags, SitewideAnnouncementsData, - StatisticsData, + StatisticsData, DashboardURIData, } from "./interfaces"; import { CollectionData } from "@thepalaceproject/web-opds-client/lib/interfaces"; import DataFetcher from "@thepalaceproject/web-opds-client/lib/DataFetcher"; @@ -195,6 +195,8 @@ export default class ActionCreator extends BaseActionCreator { static readonly DIAGNOSTICS = "DIAGNOSTICS"; + static readonly DASHBOARD_URI : "DASHBOARD_URI" + csrfToken: string; constructor(fetcher?: DataFetcher, csrfToken?: string) { @@ -1095,4 +1097,14 @@ export default class ActionCreator extends BaseActionCreator { value, }; } + + fetchDashboardUri(dashboardId: string) { + const url = "/admin/quicksight_embed/" + dashboardId; + return this.fetchJSON( + ActionCreator.DASHBOARD_URI, + url + ).bind(this); + } + } + diff --git a/src/components/DashboardPage.tsx b/src/components/DashboardPage.tsx index 7293e617f..79a350478 100644 --- a/src/components/DashboardPage.tsx +++ b/src/components/DashboardPage.tsx @@ -7,6 +7,7 @@ import Footer from "./Footer"; import Stats from "./Stats"; import CirculationEvents from "./CirculationEvents"; import title from "../utils/title"; +import QuicksightDashboard from "./QuicksightDashboard"; export interface DashboardPageProps extends React.Props { params: { @@ -48,6 +49,7 @@ export default class DashboardPage extends React.Component { store={this.context.editorStore} library={library} /> +