8000 feat: improve metrics and UI for user engagement on the platform by BrunoQuaresma · Pull Request #16134 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat: improve metrics and UI for user engagement on the platform #16134

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 18 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
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
Add storybook for license chart
  • Loading branch information
BrunoQuaresma committed Jan 16, 2025
commit 372649b2138db0560e83f6141d80436a902ead1a
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import type { Meta, StoryObj } from "@storybook/react";
import { LicenseSeatConsumptionChart } from "./LicenseSeatConsumptionChart";

const meta: Meta<typeof LicenseSeatConsumptionChart> = {
title:
"pages/DeploymentSettingsPage/LicensesSettingsPage/LicenseSeatConsumptionChart",
component: LicenseSeatConsumptionChart,
args: {
limit: 220,
data: [
{ date: "1/1/2024", users: 150 },
{ date: "1/2/2024", users: 165 },
{ date: "1/3/2024", users: 180 },
{ date: "1/4/2024", users: 155 },
{ date: "1/5/2024", users: 190 },
{ date: "1/6/2024", users: 200 },
{ date: "1/7/2024", users: 210 },
],
},
};

export default meta;
type Story = StoryObj<typeof LicenseSeatConsumptionChart>;

export const Loaded: Story = {};

export const Empty: Story = {
args: {
data: [],
},
};

export const Loading: Story = {
args: {
data: undefined,
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ export const LicenseSeatConsumptionChart: FC<
}
/>
<YAxis
// Adds space on Y to show always show the reference line without overflowing it.
domain={[0, limit ? "dataMax + 10" : "auto"]}
dataKey="users"
tickLine={false}
axisLine={false}
Expand Down Expand Up @@ -199,8 +201,9 @@ export const LicenseSeatConsumptionChart: FC<
/>
{limit && (
<ReferenceLine
isFront
ifOverflow="extendDomain"
y={70}
y={limit}
label={{
value: "license seat limit",
position: "insideBottomRight",
Expand Down
0