Skip to content

feat(site): add date range picker for the template insights #8976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 8, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' of https://github.com/coder/coder into bq/add-dat…
…epicker-range
  • Loading branch information
BrunoQuaresma committed Aug 8, 2023
commit 96cfa715dc676b091155a75e2cfb46431c8194cd
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ import {
import "react-date-range/dist/styles.css"
import "react-date-range/dist/theme/default.css"
import { DateRange, DateRangeValue } from "./DateRange"
import { useDashboard } from "components/Dashboard/DashboardProvider"
import OpenInNewOutlined from "@mui/icons-material/OpenInNewOutlined"
import Link from "@mui/material/Link"
import CheckCircleOutlined from "@mui/icons-material/CheckCircleOutlined"
import CancelOutlined from "@mui/icons-material/CancelOutlined"

export default function TemplateInsightsPage() {
const now = new Date()
Expand Down Expand Up @@ -74,7 +79,7 @@ export default function TemplateInsightsPage() {
<title>{getTemplatePageTitle("Insights", template)}</title>
</Helmet>
<TemplateInsightsPageView
dateRangePicker={
dateRange={
<DateRange value={dateRangeValue} onChange={setDateRangeValue} />
}
templateInsights={templateInsights}
Expand All @@ -88,15 +93,17 @@ export default function TemplateInsightsPage() {
export const TemplateInsightsPageView = ({
templateInsights,
userLatency,
dateRangePicker,
shouldDisplayParameters,
dateRange,
}: {
templateInsights: TemplateInsightsResponse | undefined
userLatency: UserLatencyInsightsResponse | undefined
dateRangePicker: ReactNode
shouldDisplayParameters: boolean
dateRange: ReactNode
}) => {
return (
<>
<Box sx={{ mb: 4 }}>{dateRangePicker}</Box>
<Box sx={{ mb: 4 }}>{dateRange}</Box>
<Box
sx={{
display: "grid",
Expand All @@ -114,6 +121,12 @@ export const TemplateInsightsPageView = ({
sx={{ gridColumn: "span 3" }}
data={templateInsights?.report.apps_usage}
/>
{shouldDisplayParameters && (
<TemplateParametersUsagePanel
sx={{ gridColumn: "span 3" }}
data={templateInsights?.report.parameters_usage}
/>
)}
</Box>
</>
)
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.