Skip to content

Commit b052935

Browse files
refactor(site): remove template parameters insights out of experimental (#9126)
1 parent 8646f7c commit b052935

File tree

7 files changed

+32
-45
lines changed

7 files changed

+32
-45
lines changed

coderd/apidoc/docs.go

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codersdk/deployment.go

-4
Original file line numberDiff line numberDiff line change
@@ -1928,9 +1928,6 @@ const (
19281928
// Deployment health page
19291929
ExperimentDeploymentHealthPage Experiment = "deployment_health_page"
19301930

1931-
// Template parameters insights
1932-
ExperimentTemplateParametersInsights Experiment = "template_parameters_insights"
1933-
19341931
// Workspaces batch actions
19351932
ExperimentWorkspacesBatchActions Experiment = "workspaces_batch_actions"
19361933

@@ -1944,7 +1941,6 @@ const (
19441941
// not be included here and will be essentially hidden.
19451942
var ExperimentsAll = Experiments{
19461943
ExperimentDeploymentHealthPage,
1947-
ExperimentTemplateParametersInsights,
19481944
ExperimentWorkspacesBatchActions,
19491945
}
19501946

docs/api/schemas.md

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/api/typesGenerated.ts

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/pages/DeploySettingsPage/GeneralSettingsPage/GeneralSettingsPageView.stories.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ const meta: Meta<typeof GeneralSettingsPageView> = {
3636
"workspace_actions",
3737
"single_tailnet",
3838
"deployment_health_page",
39-
"template_parameters_insights",
4039
],
4140
flag_shorthand: "",
4241
hidden: false,

site/src/pages/TemplatePage/TemplateInsightsPage/TemplateInsightsPage.tsx

+32-33
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ import { subDays, isToday } from "date-fns"
3030
import "react-date-range/dist/styles.css"
3131
import "react-date-range/dist/theme/default.css"
3232
import { DateRange, DateRangeValue } from "./DateRange"
33-
import { useDashboard } from "components/Dashboard/DashboardProvider"
3433
import OpenInNewOutlined from "@mui/icons-material/OpenInNewOutlined"
3534
import Link from "@mui/material/Link"
3635
import CheckCircleOutlined from "@mui/icons-material/CheckCircleOutlined"
3736
import CancelOutlined from "@mui/icons-material/CancelOutlined"
3837
import { getDateRangeFilter } from "./utils"
38+
import Tooltip from "@mui/material/Tooltip"
3939

4040
export default function TemplateInsightsPage() {
4141
const now = new Date()
@@ -61,10 +61,6 @@ export default function TemplateInsightsPage() {
6161
queryKey: ["templates", template.id, "user-latency", insightsFilter],
6262
queryFn: () => getInsightsUserLatency(insightsFilter),
6363
})
64-
const dashboard = useDashboard()
65-
const shouldDisplayParameters =
66-
dashboard.experiments.includes("template_parameters_insights") ||
67-
process.env.NODE_ENV === "development"
6864

6965
return (
7066
<>
@@ -77,7 +73,6 @@ export default function TemplateInsightsPage() {
7773
}
7874
templateInsights={templateInsights}
7975
userLatency={userLatency}
80-
shouldDisplayParameters={shouldDisplayParameters}
8176
/>
8277
</>
8378
)
@@ -86,12 +81,10 @@ export default function TemplateInsightsPage() {
8681
export const TemplateInsightsPageView = ({
8782
templateInsights,
8883
userLatency,
89-
shouldDisplayParameters,
9084
dateRange,
9185
}: {
9286
templateInsights: TemplateInsightsResponse | undefined
9387
userLatency: UserLatencyInsightsResponse | undefined
94-
shouldDisplayParameters: boolean
9588
dateRange: ReactNode
9689
}) => {
9790
return (
@@ -114,12 +107,10 @@ export const TemplateInsightsPageView = ({
114107
sx={{ gridColumn: "span 3" }}
115108
data={templateInsights?.report.apps_usage}
116109
/>
117-
{shouldDisplayParameters && (
118-
<TemplateParametersUsagePanel
119-
sx={{ gridColumn: "span 3" }}
120-
data={templateInsights?.report.parameters_usage}
121-
/>
122-
)}
110+
<TemplateParametersUsagePanel
111+
sx={{ gridColumn: "span 3" }}
112+
data={templateInsights?.report.parameters_usage}
113+
/>
123114
</Box>
124115
</>
125116
)
@@ -349,25 +340,34 @@ const TemplateParametersUsagePanel = ({
349340
</Box>
350341
</Box>
351342
<Box sx={{ flex: 1, fontSize: 14 }}>
343+
<ParameterUsageRow
344+
sx={{
345+
color: (theme) => theme.palette.text.secondary,
346+
fontWeight: 500,
347+
fontSize: 13,
348+
cursor: "default",
349+
}}
350+
>
351+
<Box>Value</Box>
352+
<Tooltip
353+
title="The number of workspaces using this value"
354+
placement="top"
355+
>
356+
<Box>Count</Box>
357+
</Tooltip>
358+
</ParameterUsageRow>
352359
{parameter.values
353360
.sort((a, b) => b.count - a.count)
354361
.map((usage, usageIndex) => (
355-
<Box
362+
<ParameterUsageRow
356363
key={`${parameterIndex}-${usageIndex}`}
357-
sx={{
358-
display: "flex",
359-
alignItems: "baseline",
360-
justifyContent: "space-between",
361-
py: 0.5,
362-
gap: 5,
363-
}}
364364
>
365365
<ParameterUsageLabel
366366
usage={usage}
367367
parameter={parameter}
368368
/>
369369
<Box sx={{ textAlign: "right" }}>{usage.count}</Box>
370-
</Box>
370+
</ParameterUsageRow>
371371
))}
372372
</Box>
373373
</Box>
@@ -378,6 +378,14 @@ const TemplateParametersUsagePanel = ({
378378
)
379379
}
380380

381+
const ParameterUsageRow = styled(Box)(({ theme }) => ({
382+
display: "flex",
383+
alignItems: "baseline",
384+
justifyContent: "space-between",
385+
padding: theme.spacing(0.5, 0),
386+
gap: theme.spacing(5),
387+
}))
388+
381389
const ParameterUsageLabel = ({
382390
usage,
383391
parameter,
@@ -386,16 +394,7 @@ const ParameterUsageLabel = ({
386394
parameter: TemplateParameterUsage
387395
}) => {
388396
if (usage.value.trim() === "") {
389-
return (
390-
<Box
391-
component="span"
392-
sx={{
393-
color: (theme) => theme.palette.text.secondary,
394-
}}
395-
>
396-
Not set
397-
</Box>
398-
)
397+
return <Box component="span">Not set</Box>
399398
}
400399

401400
if (parameter.options) {

0 commit comments

Comments
 (0)