Skip to content

Commit

Permalink
report_card
Browse files Browse the repository at this point in the history
  • Loading branch information
epompeii committed Sep 11, 2024
1 parent 8f05be5 commit 8c07f10
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Card } from "../../../../../config/types";
import { fmtNestedValue } from "../../../../../util/resource";
import type CardConfig from "./CardConfig";
import type { Params } from "astro";
import TableCard from "./TableCard";
import ReportCard from "./ReportCard";

export interface Props {
isConsole: boolean;
Expand Down Expand Up @@ -49,8 +49,8 @@ const DeckCard = (props: Props) => {
handleLoopback={props.handleLoopback}
/>
</Match>
<Match when={props.card?.kind === Card.TABLE}>
<TableCard
<Match when={props.card?.kind === Card.REPORT}>
<ReportCard
isConsole={props.isConsole}
apiUrl={props.apiUrl}
params={props.params}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface Props {
value: Resource<JsonReport>;
}

const TableCard = (props: Props) => {
const ReportCard = (props: Props) => {
const multipleIterations = createMemo(
() => (props.value()?.results?.length ?? 0) > 1,
);
Expand Down Expand Up @@ -606,4 +606,4 @@ const formatNumber = (number: number): string => {
return numberStr;
};

export default TableCard;
export default ReportCard;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Params } from "astro";
import { createMemo, type Resource } from "solid-js";
import type { JsonAlert } from "../../../../types/bencher";
import { alertPerfUrl } from "../hand/card/TableCard";
import { alertPerfUrl } from "../hand/card/ReportCard";

export interface Props {
isConsole: boolean;
Expand Down
2 changes: 1 addition & 1 deletion services/console/src/config/project/reports.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const reportsConfig = {
display: Display.ADAPTER,
},
{
kind: Card.TABLE,
kind: Card.REPORT,
},
],
buttons: [
Expand Down
3 changes: 3 additions & 0 deletions services/console/src/config/project/reports_pub.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ const reportsPubConfig = {
key: "adapter",
display: Display.ADAPTER,
},
{
kind: Card.REPORT,
},
],
},
};
Expand Down
2 changes: 1 addition & 1 deletion services/console/src/config/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export enum Row {
export enum Card {
FIELD = "field",
NESTED_FIELD = "nested_field",
TABLE = "table",
REPORT = "report",
}

export enum Display {
Expand Down

0 comments on commit 8c07f10

Please sign in to comment.