mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-11 13:52:20 +00:00
style: apply prettier across the tree
One-shot prettier pass so the new format:check gate starts from a clean baseline. Formatting only — no behaviour change. Generator-owned and vendored artifacts stay untouched via .prettierignore.
This commit is contained in:
1 parent
b3fea2ef59
commit
1f4ba5939d
1000 files changed
+12130
-8385
No files matched your search
@@ -106,7 +106,11 @@ export function parseOAuthOutcome(search: string): OAuthOutcome | null {
|
||||
const v = params.get(provider);
|
||||
if (v === "connected") return { provider, kind: "connected" };
|
||||
if (v === "error") {
|
||||
return { provider, kind: "error", reason: params.get("reason") ?? "unknown" };
|
||||
return {
|
||||
provider,
|
||||
kind: "error",
|
||||
reason: params.get("reason") ?? "unknown",
|
||||
};
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -218,7 +222,9 @@ export function ConnectionsPanel() {
|
||||
toast.success(t(`settings.${provider}OauthConnected`));
|
||||
// Polar/Oura own a per-card status query; WHOOP/Fitbit read off the
|
||||
// consolidated envelope — invalidate both so the card repaints either way.
|
||||
queryClient.invalidateQueries({ queryKey: OAUTH_OUTCOME_KEYS[provider]() });
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: OAUTH_OUTCOME_KEYS[provider](),
|
||||
});
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: queryKeys.integrationsStatus(),
|
||||
});
|
||||
|
||||
@@ -189,9 +189,7 @@ export function FitbitCard({
|
||||
: null;
|
||||
|
||||
return (
|
||||
<SettingsCard
|
||||
data-testid="fitbit-card"
|
||||
>
|
||||
<SettingsCard data-testid="fitbit-card">
|
||||
<SettingsCardHeader
|
||||
icon={HeartPulse}
|
||||
title={t("settings.fitbit")}
|
||||
|
||||
@@ -10,7 +10,14 @@
|
||||
import { useRef, useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { ArrowRight, Droplet, Link2, Loader2, Save, Unlink } from "lucide-react";
|
||||
import {
|
||||
ArrowRight,
|
||||
Droplet,
|
||||
Link2,
|
||||
Loader2,
|
||||
Save,
|
||||
Unlink,
|
||||
} from "lucide-react";
|
||||
|
||||
import {
|
||||
AlertDialog,
|
||||
@@ -37,7 +44,11 @@ import {
|
||||
import { TestConnectionButton } from "@/components/settings/test-connection-button";
|
||||
import { apiFetchRaw, apiGet, apiPost } from "@/lib/api/api-fetch";
|
||||
import { useTranslations } from "@/lib/i18n/context";
|
||||
import { invalidateKeys, measurementDependentKeys, queryKeys } from "@/lib/query-keys";
|
||||
import {
|
||||
invalidateKeys,
|
||||
measurementDependentKeys,
|
||||
queryKeys,
|
||||
} from "@/lib/query-keys";
|
||||
|
||||
import { IntegrationErrorMessage } from "./shared";
|
||||
import { IntegrationCardDescription } from "./setup-guide-link";
|
||||
@@ -47,14 +58,21 @@ interface NightscoutStatus {
|
||||
configured: boolean;
|
||||
hasToken?: boolean;
|
||||
allowPrivateHost?: boolean;
|
||||
state?: "connected" | "error_transient" | "error_reauth" | "disconnected" | "parked";
|
||||
state?:
|
||||
| "connected"
|
||||
| "error_transient"
|
||||
| "error_reauth"
|
||||
| "disconnected"
|
||||
| "parked";
|
||||
lastSuccessAt?: string | null;
|
||||
lastAttemptAt?: string | null;
|
||||
lastError?: string | null;
|
||||
}
|
||||
|
||||
/** Map the shared ledger state onto the pill's display state. */
|
||||
function pillStateFor(status: NightscoutStatus | undefined): IntegrationPillState {
|
||||
function pillStateFor(
|
||||
status: NightscoutStatus | undefined,
|
||||
): IntegrationPillState {
|
||||
if (!status?.connected) return "disconnected";
|
||||
switch (status.state) {
|
||||
case "parked":
|
||||
@@ -159,9 +177,7 @@ export function NightscoutCard({ enabled = true }: { enabled?: boolean }) {
|
||||
: null;
|
||||
|
||||
return (
|
||||
<SettingsCard
|
||||
data-testid="nightscout-card"
|
||||
>
|
||||
<SettingsCard data-testid="nightscout-card">
|
||||
<SettingsCardHeader
|
||||
icon={Droplet}
|
||||
title={t("settings.nightscout")}
|
||||
@@ -226,7 +242,9 @@ export function NightscoutCard({ enabled = true }: { enabled?: boolean }) {
|
||||
|
||||
<form ref={formRef} onSubmit={handleConnect} className="space-y-3">
|
||||
<div className="space-y-1.5">
|
||||
<Label htmlFor="nightscout-url">{t("settings.nightscoutUrl")}</Label>
|
||||
<Label htmlFor="nightscout-url">
|
||||
{t("settings.nightscoutUrl")}
|
||||
</Label>
|
||||
<Input
|
||||
id="nightscout-url"
|
||||
type="url"
|
||||
|
||||
@@ -11,7 +11,14 @@
|
||||
import { useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { ArrowRight, Link2, Loader2, Save, Unlink, type LucideIcon } from "lucide-react";
|
||||
import {
|
||||
ArrowRight,
|
||||
Link2,
|
||||
Loader2,
|
||||
Save,
|
||||
Unlink,
|
||||
type LucideIcon,
|
||||
} from "lucide-react";
|
||||
|
||||
import {
|
||||
AlertDialog,
|
||||
@@ -64,7 +71,9 @@ export interface OAuthProviderStatus {
|
||||
lastError?: string | null;
|
||||
}
|
||||
|
||||
function pillStateFor(status: OAuthProviderStatus | undefined): IntegrationPillState {
|
||||
function pillStateFor(
|
||||
status: OAuthProviderStatus | undefined,
|
||||
): IntegrationPillState {
|
||||
if (!status?.connected) return "disconnected";
|
||||
switch (status.state) {
|
||||
case "parked":
|
||||
@@ -202,9 +211,7 @@ export function OAuthProviderCard({
|
||||
}
|
||||
|
||||
return (
|
||||
<SettingsCard
|
||||
data-testid={`${provider}-card`}
|
||||
>
|
||||
<SettingsCard data-testid={`${provider}-card`}>
|
||||
<SettingsCardHeader
|
||||
icon={icon}
|
||||
title={t(`${i18nPrefix}`)}
|
||||
|
||||
@@ -20,8 +20,7 @@ import { useTranslations } from "@/lib/i18n/context";
|
||||
* path segment, e.g. `https://docs.healthlog.dev/integrations/whoop`. Kept as
|
||||
* a single constant so the host never drifts across cards.
|
||||
*/
|
||||
export const INTEGRATION_DOCS_BASE =
|
||||
"https://docs.healthlog.dev/integrations";
|
||||
export const INTEGRATION_DOCS_BASE = "https://docs.healthlog.dev/integrations";
|
||||
|
||||
export type IntegrationDocsProvider =
|
||||
| "whoop"
|
||||
|
||||
Reference in new issue
Block a user