Skip to content

Commit 9db7d4c

Browse files
committed
bug(audit): Tweak chart dots for clarity, and fixed issue with stale data sometimes appearing in audit summary
1 parent bbeffd5 commit 9db7d4c

8 files changed

Lines changed: 40 additions & 119 deletions

File tree

apps/backend/utils/cm.ts

Lines changed: 0 additions & 101 deletions
This file was deleted.

apps/backend/utils/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ export * from './logEvent'
99
export * from './cognito'
1010
export * from './dynamodb'
1111
export * from './getAnalytics'
12-
export * from './cm'
1312
export * from './formatId'
1413
export * from './unformatId'
15-
export * from './slack'
1614
export * from './db'
17-
export * from './openai'
1815
export * from './validateUuid'
1916
export * from './validateUrl'
2017
export * from './formatId'

apps/backend/utils/openai.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

apps/backend/utils/slack.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

apps/frontend/src/components/BlockersTableSummary.module.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
@use "../global-styles/variables.module.scss";
22
@use "../global-styles/fonts.scss";
33

4+
@keyframes spin {
5+
from { transform: rotate(0deg); }
6+
to { transform: rotate(360deg); }
7+
}
8+
9+
.spinning {
10+
animation: spin 1s linear infinite;
11+
color: variables.$green;
12+
}
13+
414
.BlockersTableSummary {
515
.graph-card {
616
display: flex;

apps/frontend/src/components/BlockersTableSummary.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { DataRow } from "./DataRow";
66
import { Card } from "./Card";
77
import { Page } from "#src/routes/Audit.tsx";
88
import { Pie, PieChart, ResponsiveContainer } from "recharts";
9+
import { GrPowerCycle } from "react-icons/gr";
910

1011
import themeVariables from "../global-styles/variables.module.scss";
1112
import { SkeletonAuditHeader } from "./Skeleton";
@@ -39,9 +40,11 @@ export const BlockersTableSummary = ({ auditId, isShared, chartData, pages, scan
3940
const [mostCommonCategoriesLimit, setMostCommonCategoriesLimit] = useState(3);
4041
const [mostCommonTagsLimit, setMostCommonTagsLimit] = useState(3);
4142

42-
const { data, isLoading, error } = useQuery({
43+
const { data, isLoading, isFetching, error } = useQuery({
4344
queryKey: [
44-
"auditSummary", auditId
45+
"auditSummary", auditId,
46+
mostCommonUrlsLimit, mostCommonBlockersLimit,
47+
mostCommonCategoriesLimit, mostCommonTagsLimit
4548
],
4649
queryFn: async () => {
4750
const params: Record<string, string> = {
@@ -181,6 +184,11 @@ export const BlockersTableSummary = ({ auditId, isShared, chartData, pages, scan
181184

182185
</>
183186
) : (<><SkeletonAuditHeader /></>)}
187+
{isFetching && !isLoading && (
188+
<span role="img" aria-label="Refreshing">
189+
<GrPowerCycle className={style.spinning} />
190+
</span>
191+
)}
184192
</div >
185193
);
186194
};

apps/frontend/src/components/ChartCustomizedDot.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,25 @@ export const CustomizedDot = (props: any) => {
1212
r={4}
1313
stroke={themeVariables.white}
1414
fill={themeVariables.white}
15-
strokeWidth={3}
15+
strokeWidth={4}
1616
></Dot>
1717
);
1818
} else {
1919
return <div key={Math.random()}></div>; //this is a hack :/
2020
}
21-
};
21+
};
22+
23+
export const CustomizedActiveDot = (props: any) => {
24+
const { cx, cy, payload } = props;
25+
return (
26+
<Dot
27+
cx={cx}
28+
cy={cy}
29+
r={4}
30+
stroke={themeVariables.white}
31+
fill={payload.timestamp ? themeVariables.white : themeVariables.black}
32+
strokeWidth={payload.timestamp ? 4 : 2}/*
33+
opacity={payload.timestamp ? 1 : 0.5} */
34+
/>
35+
);
36+
};

apps/frontend/src/routes/Audit.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {
3333
EmailSubscriptionList,
3434
} from "#src/components/AuditEmailSubscriptionInput.tsx";
3535

36-
import { CustomizedDot } from "#src/components/ChartCustomizedDot.tsx";
36+
import { CustomizedDot, CustomizedActiveDot } from "#src/components/ChartCustomizedDot.tsx";
3737
import { ChartTooltipContent } from "#src/components/ChartTooltipContent.tsx";
3838

3939
import { AuditHeader } from "#src/components/AuditHeader.tsx";
@@ -552,7 +552,7 @@ export const Audit = () => {
552552
//margin={{ top: 5, right: 30, left: 20, bottom: 5 }}
553553
accessibilityLayer={true}
554554
margin={{
555-
top: 5,
555+
top: 10,
556556
right: 10,
557557
left: -20,
558558
bottom: 5,
@@ -605,6 +605,7 @@ export const Audit = () => {
605605
stroke={themeVariables.white}
606606
strokeWidth={4}
607607
dot={CustomizedDot}
608+
activeDot={CustomizedActiveDot}
608609
name="Blockers"
609610
isAnimationActive={false}
610611
/>

0 commit comments

Comments
 (0)