fix(ui): format code

This commit is contained in:
Łukasz Mierzwa
2023-11-13 10:03:40 +00:00
committed by Łukasz Mierzwa
parent fff657373b
commit 49be79d675
11 changed files with 43 additions and 43 deletions

View File

@@ -100,9 +100,9 @@ const App: FC<AppProps> = observer(({ defaultFilters, uiDefaults }) => {
? ReactSelectStyles(ReactSelectColors.Dark)
: ReactSelectStyles(ReactSelectColors.Light)
: settingsStore.themeConfig.config.theme ===
settingsStore.themeConfig.options.dark.value
? ReactSelectStyles(ReactSelectColors.Dark)
: ReactSelectStyles(ReactSelectColors.Light),
settingsStore.themeConfig.options.dark.value
? ReactSelectStyles(ReactSelectColors.Dark)
: ReactSelectStyles(ReactSelectColors.Light),
animations: {
duration: settingsStore.themeConfig.config.animations ? 500 : 0,
},

View File

@@ -161,8 +161,8 @@ const AlertAck: FC<{
!isAcking && error
? "bg-warning"
: !isAcking && response
? "bg-success"
: "bg-secondary"
? "bg-success"
: "bg-secondary"
}`}
onClick={() => {
if (!isAcking && !(response || error)) {

View File

@@ -115,14 +115,14 @@ export const AlertHistory: FC<{ group: APIAlertGroupT; grid: APIGridT }> = ({
cachedResponse === null
? "fetching"
: sample.value > 0
? `firing firing-${
minMaxValue.minValue === minMaxValue.maxValue
? Math.min(minMaxValue.maxValue, 5)
: Math.round(
(sample.value / minMaxValue.maxValue) * 5,
)
}`
: "inactive"
? `firing firing-${
minMaxValue.minValue === minMaxValue.maxValue
? Math.min(minMaxValue.maxValue, 5)
: Math.round(
(sample.value / minMaxValue.maxValue) * 5,
)
}`
: "inactive"
}
></rect>
</svg>

View File

@@ -25,8 +25,8 @@ const FaviconBadge: FC<{
alertStore.data.upstreamsWithErrors.length > 0
? "!"
: alertStore.status.error === null
? alertStore.info.totalAlerts
: "?",
? alertStore.info.totalAlerts
: "?",
);
}),
[], // eslint-disable-line react-hooks/exhaustive-deps

View File

@@ -106,8 +106,8 @@ const ManagedSilence: FC<{
progress > 90
? "progress-bar bg-danger"
: progress > 75
? "progress-bar bg-warning"
: "progress-bar bg-success"
? "progress-bar bg-warning"
: "progress-bar bg-success"
}
role="progressbar"
style={{ width: progress + "%" }}

View File

@@ -11,8 +11,8 @@ const MatcherToFilter = (matcher: MatcherT): string => {
v.wasCreated
? v
: matcher.isRegex
? { ...v, value: EscapeRegex(v.value) }
: v,
? { ...v, value: EscapeRegex(v.value) }
: v,
);
const value =
values.length > 1

View File

@@ -50,8 +50,8 @@ const SilenceModalContent: FC<{
? "New silence"
: "Editing silence"
: silenceFormStore.data.currentStage === "preview"
? "Preview silenced alerts"
: "Silence submitted"
? "Preview silenced alerts"
: "Silence submitted"
}
active={silenceFormStore.tab.current === "editor"}
onClick={() => silenceFormStore.tab.setTab("editor")}

View File

@@ -232,10 +232,10 @@ const GenerateAlertmanagerSilenceData = (
)
.join("|")})`
: m.values.length === 1
? m.values[0].wasCreated || !m.isRegex
? m.values[0].value
: EscapeRegex(m.values[0].value)
: "",
? m.values[0].wasCreated || !m.isRegex
? m.values[0].value
: EscapeRegex(m.values[0].value)
: "",
isRegex: m.isRegex,
isEqual: m.isEqual,
})),

View File

@@ -26,10 +26,10 @@ it("renders without crashing with missing defaults div", () => {
return name === "settings"
? (settingsElement as any)
: name === "defaults"
? null
: name === "root"
? root
: null;
? null
: name === "root"
? root
: null;
});
const response = EmptyAPIResponse();
response.filters = [];
@@ -52,12 +52,12 @@ it("renders without crashing with defaults present", () => {
return name === "settings"
? (settingsElement as any)
: name === "defaults"
? {
innerHTML: DefaultsBase64,
}
: name === "root"
? root
: null;
? {
innerHTML: DefaultsBase64,
}
: name === "root"
? root
: null;
});
const response = EmptyAPIResponse();
response.filters = [];

View File

@@ -29,10 +29,10 @@ it("loads ResizeObserver polyfill if needed", () => {
return name === "settings"
? settingsElement
: name === "defaults"
? null
: name === "root"
? root
: null;
? null
: name === "root"
? root
: null;
});
const response = EmptyAPIResponse();
response.filters = [];

View File

@@ -38,10 +38,10 @@ it("doesn't load ResizeObserver polyfill if not needed", () => {
return name === "settings"
? settingsElement
: name === "defaults"
? null
: name === "root"
? root
: null;
? null
: name === "root"
? root
: null;
});
const response = EmptyAPIResponse();
response.filters = [];