Run prettier and lint
This commit is contained in:
@@ -2,7 +2,7 @@ name: CI Pipeline
|
||||
run-name: "${{ gitea.actor }} triggered CI pipeline"
|
||||
|
||||
on:
|
||||
workflow_dispatch: {} # Manual trigger only - run tests locally before merging
|
||||
workflow_dispatch: {} # Manual trigger only - run tests locally before merging
|
||||
# Auto-runs disabled for solo development
|
||||
# Re-enable when ready for collaborators:
|
||||
# pull_request:
|
||||
|
||||
@@ -41,23 +41,24 @@ const WebVitalsDashboardContainer = memo(() => {
|
||||
if (typeof window !== "undefined") {
|
||||
import("web-vitals").then((webVitals) => {
|
||||
// web-vitals v4 typings don't expose legacy get* names the same way; runtime bundle still provides them for this dashboard.
|
||||
const { getCLS, getFID, getFCP, getLCP, getTTFB } = webVitals as unknown as {
|
||||
getCLS: (
|
||||
_fn: (_m: { value: number; rating: string }) => void,
|
||||
) => void;
|
||||
getFID: (
|
||||
_fn: (_m: { value: number; rating: string }) => void,
|
||||
) => void;
|
||||
getFCP: (
|
||||
_fn: (_m: { value: number; rating: string }) => void,
|
||||
) => void;
|
||||
getLCP: (
|
||||
_fn: (_m: { value: number; rating: string }) => void,
|
||||
) => void;
|
||||
getTTFB: (
|
||||
_fn: (_m: { value: number; rating: string }) => void,
|
||||
) => void;
|
||||
};
|
||||
const { getCLS, getFID, getFCP, getLCP, getTTFB } =
|
||||
webVitals as unknown as {
|
||||
getCLS: (
|
||||
_fn: (_m: { value: number; rating: string }) => void,
|
||||
) => void;
|
||||
getFID: (
|
||||
_fn: (_m: { value: number; rating: string }) => void,
|
||||
) => void;
|
||||
getFCP: (
|
||||
_fn: (_m: { value: number; rating: string }) => void,
|
||||
) => void;
|
||||
getLCP: (
|
||||
_fn: (_m: { value: number; rating: string }) => void,
|
||||
) => void;
|
||||
getTTFB: (
|
||||
_fn: (_m: { value: number; rating: string }) => void,
|
||||
) => void;
|
||||
};
|
||||
|
||||
getLCP((metric: { value: number; rating: VitalData["rating"] }) => {
|
||||
setVitals((prev) => ({
|
||||
|
||||
@@ -13,8 +13,7 @@ const TITLE =
|
||||
const DESCRIPTION =
|
||||
"Adding people at this step will invite them to see your proposed CommunityRule and make their own proposals.";
|
||||
|
||||
const DRAFT_TOAST_TITLE =
|
||||
"Congratulations! You've drafted your CommunityRule!";
|
||||
const DRAFT_TOAST_TITLE = "Congratulations! You've drafted your CommunityRule!";
|
||||
|
||||
/**
|
||||
* Confirm stakeholders step — stacked lockup + MultiSelect (not split columns).
|
||||
@@ -23,7 +22,9 @@ const DRAFT_TOAST_TITLE =
|
||||
export default function ConfirmStakeholdersPage() {
|
||||
const [isMounted, setIsMounted] = useState(false);
|
||||
const [toastDismissed, setToastDismissed] = useState(false);
|
||||
const [stakeholderOptions, setStakeholderOptions] = useState<ChipOption[]>([]);
|
||||
const [stakeholderOptions, setStakeholderOptions] = useState<ChipOption[]>(
|
||||
[],
|
||||
);
|
||||
const isMdOrLarger = useMediaQuery("(min-width: 640px)");
|
||||
|
||||
useEffect(() => {
|
||||
@@ -43,9 +44,7 @@ export default function ConfirmStakeholdersPage() {
|
||||
const handleCustomChipConfirm = (chipId: string, value: string) => {
|
||||
setStakeholderOptions((prev) =>
|
||||
prev.map((opt) =>
|
||||
opt.id === chipId
|
||||
? { ...opt, label: value, state: "Selected" }
|
||||
: opt,
|
||||
opt.id === chipId ? { ...opt, label: value, state: "Selected" } : opt,
|
||||
),
|
||||
);
|
||||
};
|
||||
|
||||
+18
-12
@@ -1,6 +1,12 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect, useMemo, type Dispatch, type SetStateAction } from "react";
|
||||
import {
|
||||
useState,
|
||||
useEffect,
|
||||
useMemo,
|
||||
type Dispatch,
|
||||
type SetStateAction,
|
||||
} from "react";
|
||||
import { useMediaQuery } from "../../hooks/useMediaQuery";
|
||||
import HeaderLockup from "../../components/type/HeaderLockup";
|
||||
import MultiSelect from "../../components/controls/MultiSelect";
|
||||
@@ -48,17 +54,17 @@ export default function SelectPage() {
|
||||
|
||||
const effectiveMdOrLarger = !isMounted || isMdOrLarger;
|
||||
|
||||
const [communitySizeOptions, setCommunitySizeOptions] = useState<ChipOption[]>(
|
||||
[
|
||||
{ id: "1", label: "1 member", state: "Unselected" },
|
||||
{ id: "2", label: "2-10 members", state: "Unselected" },
|
||||
{ id: "3", label: "10-24 members", state: "Unselected" },
|
||||
{ id: "4", label: "24-64 members", state: "Unselected" },
|
||||
{ id: "5", label: "64-128 members", state: "Unselected" },
|
||||
{ id: "6", label: "125-1000 members", state: "Unselected" },
|
||||
{ id: "7", label: "1000+ members", state: "Unselected" },
|
||||
],
|
||||
);
|
||||
const [communitySizeOptions, setCommunitySizeOptions] = useState<
|
||||
ChipOption[]
|
||||
>([
|
||||
{ id: "1", label: "1 member", state: "Unselected" },
|
||||
{ id: "2", label: "2-10 members", state: "Unselected" },
|
||||
{ id: "3", label: "10-24 members", state: "Unselected" },
|
||||
{ id: "4", label: "24-64 members", state: "Unselected" },
|
||||
{ id: "5", label: "64-128 members", state: "Unselected" },
|
||||
{ id: "6", label: "125-1000 members", state: "Unselected" },
|
||||
{ id: "7", label: "1000+ members", state: "Unselected" },
|
||||
]);
|
||||
|
||||
const [organizationTypeOptions, setOrganizationTypeOptions] = useState<
|
||||
ChipOption[]
|
||||
|
||||
@@ -34,7 +34,9 @@ describe("ConfirmStakeholdersPage", () => {
|
||||
).toBeInTheDocument();
|
||||
await user.click(screen.getByRole("button", { name: "Close alert" }));
|
||||
expect(
|
||||
screen.queryByText(/Congratulations! You've drafted your CommunityRule!/i),
|
||||
screen.queryByText(
|
||||
/Congratulations! You've drafted your CommunityRule!/i,
|
||||
),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -11,10 +11,10 @@ describe("InfoMessageBox", () => {
|
||||
];
|
||||
|
||||
it("renders title and item labels", () => {
|
||||
render(
|
||||
<InfoMessageBox title="Important" items={items} />,
|
||||
);
|
||||
expect(screen.getByRole("region", { name: "Important" })).toBeInTheDocument();
|
||||
render(<InfoMessageBox title="Important" items={items} />);
|
||||
expect(
|
||||
screen.getByRole("region", { name: "Important" }),
|
||||
).toBeInTheDocument();
|
||||
expect(screen.getByText("Important")).toBeInTheDocument();
|
||||
expect(screen.getByText("Option A")).toBeInTheDocument();
|
||||
expect(screen.getByText("Option B")).toBeInTheDocument();
|
||||
|
||||
Reference in New Issue
Block a user