Skip to content

Commit f3cd7be

Browse files
committed
refactor: Clean up code formatting and improve readability across multiple components
1 parent f324a4e commit f3cd7be

22 files changed

+157
-154
lines changed

APIReference/Service/DataTypeDetail.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3172,8 +3172,7 @@ const dataTypeDetails: Dictionary<DataTypePageData> = {
31723172
name: "queryName",
31733173
type: "string",
31743174
required: true,
3175-
description:
3176-
"The domain name to query (e.g., 'example.com').",
3175+
description: "The domain name to query (e.g., 'example.com').",
31773176
},
31783177
{
31793178
name: "recordType",

Common/Server/Utils/Monitor/Criteria/DnsMonitorCriteria.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import {
55
CriteriaFilter,
66
FilterType,
77
} from "../../../../Types/Monitor/CriteriaFilter";
8-
import DnsMonitorResponse, {
9-
DnsRecordResponse,
10-
} from "../../../../Types/Monitor/DnsMonitor/DnsMonitorResponse";
8+
import DnsMonitorResponse from "../../../../Types/Monitor/DnsMonitor/DnsMonitorResponse";
119
import ProbeMonitorResponse from "../../../../Types/Probe/ProbeMonitorResponse";
1210
import EvaluateOverTime from "./EvaluateOverTime";
1311
import CaptureSpan from "../../Telemetry/CaptureSpan";
@@ -154,13 +152,12 @@ export default class DnsMonitorCriteria {
154152
CompareCriteria.convertToNumber(threshold);
155153

156154
if (numericThreshold !== null && !isNaN(Number(recordValue))) {
157-
const result: string | null = CompareCriteria.compareCriteriaNumbers(
158-
{
155+
const result: string | null =
156+
CompareCriteria.compareCriteriaNumbers({
159157
value: Number(recordValue),
160158
threshold: numericThreshold,
161159
criteriaFilter: input.criteriaFilter,
162-
},
163-
);
160+
});
164161

165162
if (result) {
166163
return `DNS record (${record.type}): ${result}`;

Dashboard/src/Components/Monitor/SummaryView/DnsMonitorView.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ const DnsMonitorView: FunctionComponent<ComponentProps> = (
2323
responseTimeInMs = Math.round(responseTimeInMs);
2424
}
2525

26-
const getDnssecStatusText = (): string => {
26+
type GetDnssecStatusText = () => string;
27+
28+
const getDnssecStatusText: GetDnssecStatusText = (): string => {
2729
if (dnsResponse?.isDnssecValid === undefined) {
2830
return "Unknown";
2931
}

MobileApp/nativewind-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
/// <reference types="nativewind/types" />
22

3-
// NOTE: This file should not be edited and should be committed with your source code. It is generated by NativeWind.
3+
// NOTE: This file should not be edited and should be committed with your source code. It is generated by NativeWind.

MobileApp/src/components/AlertCard.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ export default function AlertCard({
4949
accessibilityLabel={`Alert ${alert.alertNumberWithPrefix || alert.alertNumber}, ${alert.title}. State: ${alert.currentAlertState?.name ?? "unknown"}. Severity: ${alert.alertSeverity?.name ?? "unknown"}.`}
5050
>
5151
<View className="flex-row">
52-
<View
53-
className="w-1"
54-
style={{ backgroundColor: stateColor }}
55-
/>
52+
<View className="w-1" style={{ backgroundColor: stateColor }} />
5653
<View className="flex-1 p-4">
5754
{projectName ? (
5855
<View className="mb-1.5">

MobileApp/src/components/EpisodeCard.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,7 @@ export default function EpisodeCard(
7474
activeOpacity={0.7}
7575
>
7676
<View className="flex-row">
77-
<View
78-
className="w-1"
79-
style={{ backgroundColor: stateColor }}
80-
/>
77+
<View className="w-1" style={{ backgroundColor: stateColor }} />
8178
<View className="flex-1 p-4">
8279
{projectName ? (
8380
<View className="mb-1.5">

MobileApp/src/components/IncidentCard.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ export default function IncidentCard({
5252
accessibilityLabel={`Incident ${incident.incidentNumberWithPrefix || incident.incidentNumber}, ${incident.title}. State: ${incident.currentIncidentState?.name ?? "unknown"}. Severity: ${incident.incidentSeverity?.name ?? "unknown"}.`}
5353
>
5454
<View className="flex-row">
55-
<View
56-
className="w-1"
57-
style={{ backgroundColor: stateColor }}
58-
/>
55+
<View className="w-1" style={{ backgroundColor: stateColor }} />
5956
<View className="flex-1 p-4">
6057
{projectName ? (
6158
<View className="mb-1.5">
@@ -68,7 +65,8 @@ export default function IncidentCard({
6865
style={{ backgroundColor: theme.colors.backgroundTertiary }}
6966
>
7067
<Text className="text-[12px] font-semibold text-text-tertiary">
71-
{incident.incidentNumberWithPrefix || `#${incident.incidentNumber}`}
68+
{incident.incidentNumberWithPrefix ||
69+
`#${incident.incidentNumber}`}
7270
</Text>
7371
</View>
7472
<Text className="text-[12px] text-text-tertiary">{timeString}</Text>

MobileApp/src/components/SkeletonCard.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import React, { useEffect, useRef } from "react";
2-
import { View, Animated, DimensionValue, AccessibilityInfo } from "react-native";
2+
import {
3+
View,
4+
Animated,
5+
DimensionValue,
6+
AccessibilityInfo,
7+
} from "react-native";
38
import { useTheme } from "../theme";
49

510
interface SkeletonCardProps {

MobileApp/src/hooks/useAllProjectAlertEpisodes.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ interface UseAllProjectAlertEpisodesResult {
2121
export function useAllProjectAlertEpisodes(): UseAllProjectAlertEpisodesResult {
2222
const { projectList } = useProject();
2323

24-
const query: UseQueryResult<ListResponse<AlertEpisodeItem>, Error> =
25-
useQuery({
24+
const query: UseQueryResult<ListResponse<AlertEpisodeItem>, Error> = useQuery(
25+
{
2626
queryKey: ["alert-episodes", "all-projects"],
2727
queryFn: () => {
2828
return fetchAllAlertEpisodes({ skip: 0, limit: FETCH_LIMIT });
2929
},
3030
enabled: projectList.length > 0,
31-
});
31+
},
32+
);
3233

3334
const projectMap: Map<string, string> = useMemo(() => {
3435
const map: Map<string, string> = new Map();

MobileApp/src/hooks/useAllProjectCounts.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,20 @@ export function useAllProjectCounts(): UseAllProjectCountsResult {
2525
const { projectList } = useProject();
2626
const enabled: boolean = projectList.length > 0;
2727

28-
const incidentQuery: UseQueryResult<ListResponse<IncidentItem>, Error> =
29-
useQuery({
30-
queryKey: ["incidents", "unresolved-count", "all-projects"],
31-
queryFn: () => {
32-
return fetchAllIncidents({
33-
skip: 0,
34-
limit: 1,
35-
unresolvedOnly: true,
36-
});
37-
},
38-
enabled,
39-
});
28+
const incidentQuery: UseQueryResult<
29+
ListResponse<IncidentItem>,
30+
Error
31+
> = useQuery({
32+
queryKey: ["incidents", "unresolved-count", "all-projects"],
33+
queryFn: () => {
34+
return fetchAllIncidents({
35+
skip: 0,
36+
limit: 1,
37+
unresolvedOnly: true,
38+
});
39+
},
40+
enabled,
41+
});
4042

4143
const alertQuery: UseQueryResult<ListResponse<AlertItem>, Error> = useQuery({
4244
queryKey: ["alerts", "unresolved-count", "all-projects"],

0 commit comments

Comments
 (0)