Skip to content
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

Activity indicator for alerts/detections count when loading #11914

Merged
merged 2 commits into from
Jun 12, 2024
Merged
Changes from all commits
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
21 changes: 15 additions & 6 deletions web/src/views/events/EventView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default function EventView({

const reviewCounts = useMemo(() => {
if (!reviewSummary) {
return { alert: 0, detection: 0, significant_motion: 0 };
return { alert: -1, detection: -1, significant_motion: -1 };
}

let summary;
Expand All @@ -103,7 +103,7 @@ export default function EventView({
}

if (!summary) {
return { alert: -1, detection: -1, significant_motion: -1 };
return { alert: 0, detection: 0, significant_motion: 0 };
}

if (filter?.showReviewed == 1) {
Expand Down Expand Up @@ -248,8 +248,13 @@ export default function EventView({
aria-label="Select alerts"
>
<MdCircle className="size-2 text-severity_alert md:mr-[10px]" />
<div className="hidden md:block">
Alerts{` ∙ ${reviewCounts.alert > -1 ? reviewCounts.alert : ""}`}
<div className="hidden md:flex md:flex-row md:items-center">
Alerts
{reviewCounts.alert > -1 ? (
` ∙ ${reviewCounts.alert}`
) : (
<ActivityIndicator className="ml-2 size-4" />
)}
</div>
</ToggleGroupItem>
<ToggleGroupItem
Expand All @@ -258,9 +263,13 @@ export default function EventView({
aria-label="Select detections"
>
<MdCircle className="size-2 text-severity_detection md:mr-[10px]" />
<div className="hidden md:block">
<div className="hidden md:flex md:flex-row md:items-center">
Detections
{` ∙ ${reviewCounts.detection > -1 ? reviewCounts.detection : ""}`}
{reviewCounts.detection > -1 ? (
` ∙ ${reviewCounts.detection}`
) : (
<ActivityIndicator className="ml-2 size-4" />
)}
</div>
</ToggleGroupItem>
<ToggleGroupItem
Expand Down
Loading