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