Skip to content

Commit dccc64b

Browse files
committed
STNDP-163 Enable users to customize the structure of the standup form
1 parent 3751bab commit dccc64b

5 files changed

Lines changed: 884 additions & 638 deletions

File tree

apps/web/app/routes.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ export default [
8080
"/boards/:boardId/collaborators/delete",
8181
"routes/delete-board-collaborator-route/delete-board-collaborator-route.tsx"
8282
),
83+
route(
84+
"/boards/:boardId/standup-forms/create",
85+
"routes/create-board-standup-form-route/create-board-standup-form-route.tsx"
86+
),
8387
route(
8488
"/accept-invitation",
8589
"routes/accept-invitation-route/accept-invitation-route.tsx"

apps/web/app/routes/board-route/dynamic-form.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ import { z } from "zod";
55
import { useImperativeHandle, useEffect, useRef, type Ref } from "react";
66
import type { ComponentProps } from "react";
77

8+
// TODO: rename everything in this file - use word standup-form instead of dynamic-form
9+
10+
export type StandupFormSchema = NonNullable<
11+
ReturnType<typeof validateDynamicFormSchema>
12+
>;
13+
export type StandupFormFields = StandupFormSchema["fields"];
14+
export type StandupFormField = StandupFormFields[number];
15+
816
export function AutoSizeTextArea({
917
...props
1018
}: ComponentProps<typeof TextArea>) {
@@ -157,7 +165,7 @@ function DynamicForm({
157165
{fields.map((field) => {
158166
return (
159167
<Flex key={field.name} direction="column" gap="2">
160-
<label>
168+
<label htmlFor={field.name}>
161169
<Flex align="center" gap="2">
162170
<Text size="2" className="font-semibold">
163171
{field.label}
@@ -175,6 +183,7 @@ function DynamicForm({
175183
control={control}
176184
render={({ field: { onChange, value } }) => (
177185
<AutoSizeTextArea
186+
id={field.name}
178187
variant="soft"
179188
className="w-full min-h-[72px]!"
180189
resize="none"

0 commit comments

Comments
 (0)