@allurereport/web-dashboard 3.0.0-beta.13 → 3.0.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/multi/app-c035074b.js +2 -0
- package/dist/multi/manifest.json +20 -20
- package/dist/multi/{styles-d1c5e4d9.css → styles-c035074b.css} +1 -2
- package/dist/single/app-6589e136.js +2 -0
- package/dist/single/manifest.json +1 -1
- package/package.json +4 -4
- package/src/components/Dashboard/index.tsx +16 -6
- package/src/stores/dashboard.ts +1 -1
- package/dist/multi/app-d1c5e4d9.js +0 -2
- package/dist/single/app-73d84c66.js +0 -2
- package/src/components/Dashboard/components/TrendChartWidget/index.tsx +0 -69
- package/src/components/Dashboard/components/Widget/index.tsx +0 -19
- package/src/components/Dashboard/components/Widget/styles.scss +0 -31
- /package/dist/multi/{173.app-d1c5e4d9.js → 173.app-c035074b.js} +0 -0
- /package/dist/multi/{174.app-d1c5e4d9.js → 174.app-c035074b.js} +0 -0
- /package/dist/multi/{252.app-d1c5e4d9.js → 252.app-c035074b.js} +0 -0
- /package/dist/multi/{282.app-d1c5e4d9.js → 282.app-c035074b.js} +0 -0
- /package/dist/multi/{29.app-d1c5e4d9.js → 29.app-c035074b.js} +0 -0
- /package/dist/multi/{416.app-d1c5e4d9.js → 416.app-c035074b.js} +0 -0
- /package/dist/multi/{527.app-d1c5e4d9.js → 527.app-c035074b.js} +0 -0
- /package/dist/multi/{600.app-d1c5e4d9.js → 600.app-c035074b.js} +0 -0
- /package/dist/multi/{605.app-d1c5e4d9.js → 605.app-c035074b.js} +0 -0
- /package/dist/multi/{638.app-d1c5e4d9.js → 638.app-c035074b.js} +0 -0
- /package/dist/multi/{672.app-d1c5e4d9.js → 672.app-c035074b.js} +0 -0
- /package/dist/multi/{686.app-d1c5e4d9.js → 686.app-c035074b.js} +0 -0
- /package/dist/multi/{725.app-d1c5e4d9.js → 725.app-c035074b.js} +0 -0
- /package/dist/multi/{741.app-d1c5e4d9.js → 741.app-c035074b.js} +0 -0
- /package/dist/multi/{755.app-d1c5e4d9.js → 755.app-c035074b.js} +0 -0
- /package/dist/multi/{894.app-d1c5e4d9.js → 894.app-c035074b.js} +0 -0
- /package/dist/multi/{943.app-d1c5e4d9.js → 943.app-c035074b.js} +0 -0
- /package/dist/multi/{980.app-d1c5e4d9.js → 980.app-c035074b.js} +0 -0
- /package/dist/multi/{app-d1c5e4d9.js.LICENSE.txt → app-c035074b.js.LICENSE.txt} +0 -0
- /package/dist/single/{app-73d84c66.js.LICENSE.txt → app-6589e136.js.LICENSE.txt} +0 -0
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { TrendChart, TrendChartKind, makeSymlogScale } from "@allurereport/web-components";
|
|
2
|
-
import type { Serie, Slice } from "@allurereport/web-components";
|
|
3
|
-
import type { CSSProperties } from "preact/compat";
|
|
4
|
-
import { useCallback, useMemo, useState } from "preact/hooks";
|
|
5
|
-
import { useI18n } from "@/stores/locale";
|
|
6
|
-
import { Widget } from "../Widget";
|
|
7
|
-
|
|
8
|
-
interface TrendChartWidgetProps<TSlice = { metadata: { executionId: string } }> {
|
|
9
|
-
title: string;
|
|
10
|
-
items: readonly Serie[];
|
|
11
|
-
slices: readonly TSlice[];
|
|
12
|
-
min: number;
|
|
13
|
-
max: number;
|
|
14
|
-
height?: CSSProperties["height"];
|
|
15
|
-
width?: CSSProperties["width"];
|
|
16
|
-
rootAriaLabel?: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const TrendChartWidget = ({
|
|
20
|
-
title,
|
|
21
|
-
items,
|
|
22
|
-
slices,
|
|
23
|
-
min,
|
|
24
|
-
max,
|
|
25
|
-
height = 400,
|
|
26
|
-
width = "100%",
|
|
27
|
-
rootAriaLabel,
|
|
28
|
-
}: TrendChartWidgetProps) => {
|
|
29
|
-
const { t } = useI18n("empty");
|
|
30
|
-
const [selectedSliceIds, setSelectedSliceIds] = useState<string[]>([]);
|
|
31
|
-
|
|
32
|
-
const emptyLabel = t("no-results");
|
|
33
|
-
|
|
34
|
-
const yScale = useMemo(() => makeSymlogScale(min, max, { constant: 8 }), [max, min]);
|
|
35
|
-
|
|
36
|
-
const handleSliceClick = useCallback((slice: Slice) => {
|
|
37
|
-
const executionIds = slice.points.reduce((acc, point) => {
|
|
38
|
-
acc.push(point.data.x as string);
|
|
39
|
-
|
|
40
|
-
return acc;
|
|
41
|
-
}, [] as string[]);
|
|
42
|
-
|
|
43
|
-
setSelectedSliceIds(() => executionIds);
|
|
44
|
-
}, []);
|
|
45
|
-
|
|
46
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
47
|
-
const selectedSlices = useMemo(
|
|
48
|
-
() => slices.filter((slice) => selectedSliceIds.includes(slice.metadata.executionId)),
|
|
49
|
-
[slices, selectedSliceIds],
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<Widget title={title}>
|
|
54
|
-
<TrendChart
|
|
55
|
-
kind={TrendChartKind.SlicesX}
|
|
56
|
-
data={items}
|
|
57
|
-
height={height}
|
|
58
|
-
width={width}
|
|
59
|
-
emptyLabel={emptyLabel}
|
|
60
|
-
emptyAriaLabel={emptyLabel}
|
|
61
|
-
rootAriaLabel={rootAriaLabel}
|
|
62
|
-
colors={({ color }) => color}
|
|
63
|
-
yScale={yScale}
|
|
64
|
-
onSliceClick={handleSliceClick}
|
|
65
|
-
onSliceTouchEnd={handleSliceClick}
|
|
66
|
-
/>
|
|
67
|
-
</Widget>
|
|
68
|
-
);
|
|
69
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Heading } from "@allurereport/web-components";
|
|
2
|
-
import type { FunctionalComponent } from "preact";
|
|
3
|
-
import * as styles from "./styles.scss";
|
|
4
|
-
|
|
5
|
-
interface WidgetProps {
|
|
6
|
-
title: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const Widget: FunctionalComponent<WidgetProps> = ({ children, title }) => {
|
|
10
|
-
return (
|
|
11
|
-
<div className={styles.widget}>
|
|
12
|
-
<div className={styles.header}>
|
|
13
|
-
<div className={styles.dragArea} />
|
|
14
|
-
<Heading size="s">{title}</Heading>
|
|
15
|
-
</div>
|
|
16
|
-
<div className={styles.content}>{children}</div>
|
|
17
|
-
</div>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
.widget {
|
|
2
|
-
border-radius: 8px;
|
|
3
|
-
box-shadow: var(--shadow-small);
|
|
4
|
-
overflow: hidden;
|
|
5
|
-
height: 100%;
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.header {
|
|
11
|
-
padding: 16px 20px;
|
|
12
|
-
border-bottom: 1px solid var(--on-border-primary);
|
|
13
|
-
display: flex;
|
|
14
|
-
align-items: center;
|
|
15
|
-
gap: 12px;
|
|
16
|
-
flex: 0 0 auto;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.dragArea {
|
|
20
|
-
width: 24px;
|
|
21
|
-
height: 24px;
|
|
22
|
-
margin-left: -8px;
|
|
23
|
-
flex: 0 0 auto;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.content {
|
|
27
|
-
padding: 16px;
|
|
28
|
-
display: flex;
|
|
29
|
-
flex-direction: column;
|
|
30
|
-
flex: 1 1 auto;
|
|
31
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|