Skip to content

Commit

Permalink
Remove revenue graph (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnida authored Oct 21, 2022
1 parent bb5ef30 commit eaf1c97
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 22 deletions.
4 changes: 2 additions & 2 deletions frontend/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
PlanType,
CreatePlanType,
UpdatePlanType,
PlansByCustomer,
PlansByCustomerArray,
} from "../types/plan-type";
import { RevenueType } from "../types/revenue-type";
import {
Expand Down Expand Up @@ -166,7 +166,7 @@ export const GetSubscriptions = {
};

export const PlansByCustomer = {
getPlansByCustomer: (): Promise<PlansByCustomer> =>
getPlansByCustomer: (): Promise<PlansByCustomerArray> =>
requests.get("api/plans_by_customer/"),
};

Expand Down
8 changes: 1 addition & 7 deletions frontend/src/components/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ const Dashboard: FC = () => {
<Col span="24">
<div className="grid grid-cols-12 justify-center space-x-4">
<div className="col-span-8">
<RevenueBarGraph
data={data?.daily_usage_revenue_period_1}
isLoading={isLoading}
/>
<MetricBarGraph range={dateRange} />
</div>
<div className="col-span-4">
<CustomerByPlanPie
Expand All @@ -79,9 +76,6 @@ const Dashboard: FC = () => {
</div>
</div>
</Col>
<Col span="24">
<MetricBarGraph range={dateRange} />
</Col>
</Row>
</PageLayout>
);
Expand Down
29 changes: 16 additions & 13 deletions frontend/src/components/Dashboard/MetricBarGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,22 @@ function MetricBarGraph(props: { range: any }) {

return (
<Paper>
<h2>Metric Usage By Customer</h2>
<Select
defaultValue="Select Metric"
onChange={changeMetric}
value={selectedMetric}
className="my-5"
>
{metricList.map((metric_name) => (
<Option value={metric_name} loading={isLoading}>
{metric_name}
</Option>
))}
</Select>
<div className="flex flex-row items-center mb-5 space-x-4">
<h2>Metric Usage By Customer</h2>
<Select
defaultValue="Select Metric"
onChange={changeMetric}
value={selectedMetric}
className="w-4/12 self-center"
>
{metricList.map((metric_name) => (
<Option value={metric_name} loading={isLoading}>
{metric_name}
</Option>
))}
</Select>
</div>

<div className="mt-5">
<Column {...config} />
</div>
Expand Down

0 comments on commit eaf1c97

Please sign in to comment.