Skip to content

Commit

Permalink
Add dashboardStartAndEndDate prop to DashboardCanvas and DashboardVie…
Browse files Browse the repository at this point in the history
…wer components
  • Loading branch information
simlarsen committed Nov 29, 2024
1 parent c4256a0 commit d53b2d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dashboard/src/Components/Dashboard/Canvas/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import ObjectID from "Common/Types/ObjectID";
import ComponentSettingsSideOver from "./ComponentSettingsSideOver";
import JSONFunctions from "Common/Types/JSONFunctions";
import MetricNameAndUnit from "../../Metrics/Types/MetricNameAndUnit";
import DashboardStartAndEndDate from "../Types/DashboardStartAndEndDate";

export interface ComponentProps {
dashboardViewConfig: DashboardViewConfig;
Expand All @@ -23,6 +24,7 @@ export interface ComponentProps {
metricNameAndUnits: Array<MetricNameAndUnit>;
telemetryAttributes: string[];
};
dashboardStartAndEndDate: DashboardStartAndEndDate;
}

const DashboardCanvas: FunctionComponent<ComponentProps> = (
Expand Down Expand Up @@ -191,6 +193,8 @@ const DashboardCanvas: FunctionComponent<ComponentProps> = (
dashboardCanvasHeightInPx={
dashboardCanvasRef.current?.clientHeight || 0
}
metricNameAndUnits={props.metrics.metricNameAndUnits}
dashboardStartAndEndDate={props.dashboardStartAndEndDate}
dashboardCanvasWidthInPx={dashboardCanvasRef.current?.clientWidth || 0}
dashboardCanvasTopInPx={dashboardCanvasRef.current?.clientTop || 0}
dashboardCanvasLeftInPx={dashboardCanvasRef.current?.clientLeft || 0}
Expand Down
1 change: 1 addition & 0 deletions Dashboard/src/Components/Dashboard/DashboardView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ const DashboardViewer: FunctionComponent<ComponentProps> = (
onComponentUnselected={() => {
setSelectedComponentId(null);
}}
dashboardStartAndEndDate={startAndEndDate}
selectedComponentId={selectedComponentId}
isEditMode={isEditMode}
currentTotalDashboardWidthInPx={dashboardTotalWidth}
Expand Down

0 comments on commit d53b2d0

Please sign in to comment.