Skip to content

Commit 3f29cfe

Browse files
authored
update the integration with actual params objects (#236)
* update the integration with actual params objects * lint
1 parent f1b69b3 commit 3f29cfe

17 files changed

Lines changed: 155 additions & 87 deletions

‎src/components/routes/china-restrictions/ChinaRestrictionsPage.tsx‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,11 @@ import { format } from "date-fns";
66
import { Navigate } from "react-router-dom";
77
import { Pecha } from "@/components/ui/shadimport";
88
import { Button } from "@/components/ui/atoms/button";
9-
import {
10-
DialogDescription,
11-
DialogFooter,
12-
} from "@/components/ui/atoms/dialog";
9+
import { DialogDescription, DialogFooter } from "@/components/ui/atoms/dialog";
1310
import { Pagination } from "@/components/ui/molecules/pagination/Pagination";
1411
import { getApiErrorMessage } from "@/lib/apiErrors";
1512
import { useUserInfo } from "@/hooks/useUserInfo";
16-
import {
17-
canAccessAdminAuthors,
18-
isSuperAdmin,
19-
} from "@/lib/platformAccess";
13+
import { canAccessAdminAuthors, isSuperAdmin } from "@/lib/platformAccess";
2014
import { ROUTES } from "@/routes/paths";
2115
import {
2216
createChinaRestrictedItem,

‎src/components/routes/dashboard/dashboardTableUi.tsx‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,5 @@ export function statusChip(status: string) {
7070
}
7171

7272
export function languageChip(code: DashboardLanguageCode) {
73-
return (
74-
<span className={LANGUAGE_CHIP_CLASS}>{languageChipLabel(code)}</span>
75-
);
73+
return <span className={LANGUAGE_CHIP_CLASS}>{languageChipLabel(code)}</span>;
7674
}

‎src/components/routes/groups/GroupAboutEditPage.tsx‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,8 @@ type AssociationBaselines = {
4040
};
4141

4242
const GroupAboutEditPage = () => {
43-
const {
44-
group,
45-
groupId,
46-
myRole,
47-
readOnlyPlatform,
48-
} = useOutletContext<GroupOutletContext>();
43+
const { group, groupId, myRole, readOnlyPlatform } =
44+
useOutletContext<GroupOutletContext>();
4945
const queryClient = useQueryClient();
5046
const hydratedRef = useRef<string | null>(null);
5147

‎src/components/routes/groups/GroupAboutPage.tsx‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ import { Pecha } from "@/components/ui/shadimport";
44
import { Button } from "@/components/ui/atoms/button";
55
import type { LanguageCode } from "@/schema/SeriesSchema";
66
import { ROUTES } from "@/routes/paths";
7-
import {
8-
languageLabelForCode,
9-
resolveGroupBannerUrl,
10-
} from "./api/groupsApi";
7+
import { languageLabelForCode, resolveGroupBannerUrl } from "./api/groupsApi";
118
import { canEditGroupSettings } from "./lib/groupPermissions";
129
import { GroupDetailCard } from "./components/GroupSection";
1310
import type { GroupOutletContext } from "./GroupLayout";

‎src/components/routes/groups/GroupLayout.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,10 @@ const GroupLayout = () => {
216216
</div>
217217
</GroupPageShell>
218218

219-
<Pecha.AlertDialog open={deleteOpen} onOpenChange={handleDeleteOpenChange}>
219+
<Pecha.AlertDialog
220+
open={deleteOpen}
221+
onOpenChange={handleDeleteOpenChange}
222+
>
220223
<Pecha.AlertDialogContent>
221224
<Pecha.AlertDialogHeader>
222225
<Pecha.AlertDialogTitle>Delete group?</Pecha.AlertDialogTitle>

‎src/components/routes/groups/GroupMembersPage.tsx‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import type { GroupOutletContext } from "./GroupLayout";
55
const GroupMembersPage = () => {
66
const { group, groupId } = useOutletContext<GroupOutletContext>();
77

8-
return (
9-
<GroupMembersPanel groupId={groupId} members={group.members ?? []} />
10-
);
8+
return <GroupMembersPanel groupId={groupId} members={group.members ?? []} />;
119
};
1210

1311
export default GroupMembersPage;

‎src/components/routes/groups/GroupsList.tsx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { useNavigate } from "react-router-dom";
2-
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/atoms/avatar";
2+
import {
3+
Avatar,
4+
AvatarFallback,
5+
AvatarImage,
6+
} from "@/components/ui/atoms/avatar";
37
import { ROUTES } from "@/routes/paths";
48
import {
59
groupTypeLabel,

‎src/components/routes/groups/components/GroupAccumulatorsPanel.tsx‎

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,9 @@ const GroupAccumulatorsPanel = ({
8787
const platformReadOnly = isReviewer(userInfo?.platform_role);
8888
const canCreate =
8989
!platformReadOnly && groupRole != null && groupRole !== "VIEWER";
90-
const canManage = !platformReadOnly && canChangeContentStatus(
91-
groupRole,
92-
userInfo?.platform_role,
93-
);
90+
const canManage =
91+
!platformReadOnly &&
92+
canChangeContentStatus(groupRole, userInfo?.platform_role);
9493

9594
const [dialogOpen, setDialogOpen] = useState(false);
9695
const [editing, setEditing] = useState<GroupAccumulatorDTO | null>(null);
@@ -122,7 +121,9 @@ const GroupAccumulatorsPanel = ({
122121
let cancelled = false;
123122
searchAccumulatorPresets({ limit: 100 }).then((result) => {
124123
if (cancelled) return;
125-
const match = result.items.find((preset) => preset.id === form.preset?.id);
124+
const match = result.items.find(
125+
(preset) => preset.id === form.preset?.id,
126+
);
126127
if (match) {
127128
setForm((prev) => ({ ...prev, preset: match }));
128129
}
@@ -318,8 +319,12 @@ const GroupAccumulatorsPanel = ({
318319
? accumulator.target_count.toLocaleString()
319320
: "—"}
320321
</span>
321-
<span>Start: {formatAccumulatorDate(accumulator.start_date)}</span>
322-
<span>End: {formatAccumulatorDate(accumulator.end_date)}</span>
322+
<span>
323+
Start: {formatAccumulatorDate(accumulator.start_date)}
324+
</span>
325+
<span>
326+
End: {formatAccumulatorDate(accumulator.end_date)}
327+
</span>
323328
<span>
324329
Joined:{" "}
325330
{accumulator.member_count != null
@@ -401,7 +406,10 @@ const GroupAccumulatorsPanel = ({
401406
<div className="grid sm:grid-cols-2 gap-4">
402407
<div className="space-y-2">
403408
<p className="text-sm font-bold">Start date</p>
404-
<Pecha.Popover open={startDateOpen} onOpenChange={setStartDateOpen}>
409+
<Pecha.Popover
410+
open={startDateOpen}
411+
onOpenChange={setStartDateOpen}
412+
>
405413
<Pecha.PopoverTrigger asChild>
406414
<Button
407415
type="button"
@@ -469,7 +477,9 @@ const GroupAccumulatorsPanel = ({
469477
<Pecha.Calendar
470478
mode="single"
471479
selected={
472-
form.end_date ? fromBackendISO(form.end_date) : undefined
480+
form.end_date
481+
? fromBackendISO(form.end_date)
482+
: undefined
473483
}
474484
onSelect={(d) => {
475485
setEndDateOpen(false);
@@ -501,14 +511,19 @@ const GroupAccumulatorsPanel = ({
501511
>
502512
<span
503513
className={
504-
form.preset ? "text-foreground" : "text-muted-foreground"
514+
form.preset
515+
? "text-foreground"
516+
: "text-muted-foreground"
505517
}
506518
>
507519
{presetTriggerLabel}
508520
</span>
509521
</Button>
510522
</Pecha.PopoverTrigger>
511-
<Pecha.PopoverContent className="w-[--radix-popover-trigger-width] p-0" align="start">
523+
<Pecha.PopoverContent
524+
className="w-[--radix-popover-trigger-width] p-0"
525+
align="start"
526+
>
512527
<Pecha.Command shouldFilter={false}>
513528
<Pecha.CommandInput
514529
placeholder="Search presets…"
@@ -601,8 +616,8 @@ const GroupAccumulatorsPanel = ({
601616
<Pecha.AlertDialogTitle>Delete accumulator?</Pecha.AlertDialogTitle>
602617
<Pecha.AlertDialogDescription>
603618
This will remove &ldquo;
604-
{deleteTarget?.title?.trim() || "Untitled accumulator"}&rdquo; from
605-
the group. This action cannot be undone.
619+
{deleteTarget?.title?.trim() || "Untitled accumulator"}&rdquo;
620+
from the group. This action cannot be undone.
606621
</Pecha.AlertDialogDescription>
607622
</Pecha.AlertDialogHeader>
608623
<Pecha.AlertDialogFooter>

‎src/components/routes/groups/components/GroupTitleWithAvatar.tsx‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/atoms/avatar";
1+
import {
2+
Avatar,
3+
AvatarFallback,
4+
AvatarImage,
5+
} from "@/components/ui/atoms/avatar";
26
import { cn } from "@/lib/utils";
37

48
type GroupTitleWithAvatarProps = {
@@ -23,12 +27,9 @@ const GroupTitleWithAvatar = ({
2327
}: GroupTitleWithAvatarProps) => {
2428
return (
2529
<div className={cn("flex items-center gap-3 min-w-0", className)}>
26-
2730
<Avatar className={cn(sizeClasses[size], "shrink-0")}>
2831
<AvatarImage src={avatarUrl ?? undefined} />
29-
<AvatarFallback>
30-
{title.charAt(0)}
31-
</AvatarFallback>
32+
<AvatarFallback>{title.charAt(0)}</AvatarFallback>
3233
</Avatar>
3334
<span className={cn("truncate", titleClassName)}>{title}</span>
3435
</div>

‎src/components/routes/series-details/SeriesDetailsPage.test.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,10 @@ describe("SeriesDetailsPage", () => {
167167

168168
it("updates URL params when selecting a language tab", async () => {
169169
const queryClient = new QueryClient({
170-
defaultOptions: { queries: { retry: false }, mutations: { retry: false } },
170+
defaultOptions: {
171+
queries: { retry: false },
172+
mutations: { retry: false },
173+
},
171174
});
172175

173176
render(

0 commit comments

Comments
 (0)