@burdenoff/microfe-healthybowl 2026.704.1 → 2026.704.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/healthybowl/components/CreateFarmTaskButton.js +46 -45
- package/dist/healthybowl/components/CreateFarmTaskButton.js.map +1 -1
- package/dist/healthybowl/pages/tasks/TasksPage.js +49 -26
- package/dist/healthybowl/pages/tasks/TasksPage.js.map +1 -1
- package/dist/healthybowl/pages/tasks/useCanManageTasks.js +44 -0
- package/dist/healthybowl/pages/tasks/useCanManageTasks.js.map +1 -0
- package/dist/healthybowl/pages/tasks/useFarmTaskLabels.js +100 -0
- package/dist/healthybowl/pages/tasks/useFarmTaskLabels.js.map +1 -0
- package/dist/node_modules/@burdenoff/planmagnet-fe-sdk/dist/index.js +1297 -940
- package/dist/node_modules/@burdenoff/planmagnet-fe-sdk/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -2,57 +2,58 @@ import { useHealthyBowl as e } from "../context/HealthyBowlContext.js";
|
|
|
2
2
|
import { Modal as t } from "./Modal.js";
|
|
3
3
|
import { CreateTaskCore as n } from "../../node_modules/@burdenoff/planmagnet-fe-sdk/dist/index.js";
|
|
4
4
|
import { useDefaultTaskProject as r } from "../pages/tasks/useDefaultTaskProject.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
5
|
+
import { useCanManageTasks as i } from "../pages/tasks/useCanManageTasks.js";
|
|
6
|
+
import { useToast as a } from "../hooks/useToast.js";
|
|
7
|
+
import { useCallback as o, useState as s } from "react";
|
|
8
|
+
import { ClipboardList as c } from "lucide-react";
|
|
9
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
10
|
+
import { Button as f } from "@burdenoff/fe-libs/ui";
|
|
11
|
+
import { gql as p } from "@apollo/client";
|
|
12
|
+
import { ApolloProvider as m, useMutation as h } from "@apollo/client/react";
|
|
13
|
+
import { useSafeGatewayClient as g } from "@burdenoff/fe-libs/shared/graphql";
|
|
13
14
|
//#region src/healthybowl/components/CreateFarmTaskButton.tsx
|
|
14
|
-
var
|
|
15
|
+
var _ = p`
|
|
15
16
|
mutation HealthyBowlLinkWorkItem($input: PlanmagnetCreateWorkItemLinkInput!) {
|
|
16
17
|
planmagnetLinkWorkItem(input: $input) {
|
|
17
18
|
id
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
|
-
`,
|
|
21
|
-
let
|
|
22
|
-
return
|
|
23
|
-
variant:
|
|
24
|
-
size:
|
|
25
|
-
onClick: () =>
|
|
26
|
-
className:
|
|
27
|
-
title:
|
|
28
|
-
"aria-label":
|
|
29
|
-
children: [
|
|
21
|
+
`, v = ({ entityType: n, entityId: r, entityLabel: a, label: o = "Create Task", variant: p = "outline", size: h, iconOnly: _, title: v, className: b, icon: x }) => {
|
|
22
|
+
let S = g("workspace"), { workspaceId: C } = e(), { canManage: w } = i(C), [T, E] = s(!1);
|
|
23
|
+
return !S || !w ? null : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d(f, {
|
|
24
|
+
variant: p,
|
|
25
|
+
size: h,
|
|
26
|
+
onClick: () => E(!0),
|
|
27
|
+
className: b,
|
|
28
|
+
title: v ?? (_ ? o : void 0),
|
|
29
|
+
"aria-label": _ ? v ?? o : void 0,
|
|
30
|
+
children: [x ?? /* @__PURE__ */ u(c, {
|
|
30
31
|
className: "size-4",
|
|
31
32
|
"aria-hidden": "true"
|
|
32
|
-
}), !
|
|
33
|
-
}), /* @__PURE__ */
|
|
34
|
-
open:
|
|
35
|
-
onClose: () =>
|
|
33
|
+
}), !_ && o]
|
|
34
|
+
}), /* @__PURE__ */ u(t, {
|
|
35
|
+
open: T,
|
|
36
|
+
onClose: () => E(!1),
|
|
36
37
|
title: "Create Farm Task",
|
|
37
|
-
description: `Create a task linked to ${
|
|
38
|
-
children: /* @__PURE__ */
|
|
39
|
-
client:
|
|
40
|
-
children: /* @__PURE__ */
|
|
41
|
-
client:
|
|
42
|
-
entityType:
|
|
43
|
-
entityId:
|
|
44
|
-
entityLabel:
|
|
45
|
-
onDone: () =>
|
|
38
|
+
description: `Create a task linked to ${a}.`,
|
|
39
|
+
children: /* @__PURE__ */ u(m, {
|
|
40
|
+
client: S,
|
|
41
|
+
children: /* @__PURE__ */ u(y, {
|
|
42
|
+
client: S,
|
|
43
|
+
entityType: n,
|
|
44
|
+
entityId: r,
|
|
45
|
+
entityLabel: a,
|
|
46
|
+
onDone: () => E(!1)
|
|
46
47
|
})
|
|
47
48
|
})
|
|
48
|
-
})] })
|
|
49
|
-
},
|
|
50
|
-
let { workspaceId: f, currentUser: p } = e(), { projectId:
|
|
49
|
+
})] });
|
|
50
|
+
}, y = ({ client: t, entityType: i, entityId: s, entityLabel: c, onDone: l }) => {
|
|
51
|
+
let { workspaceId: f, currentUser: p } = e(), { projectId: m, loading: g, error: v } = r(t, f, p?.id), [y] = h(_), { toast: b } = a(), x = o(async (e) => {
|
|
51
52
|
try {
|
|
52
53
|
await y({ variables: { input: {
|
|
53
54
|
workItemId: e.id,
|
|
54
55
|
sourceProduct: "healthybowl",
|
|
55
|
-
entityType:
|
|
56
|
+
entityType: i,
|
|
56
57
|
entityId: s,
|
|
57
58
|
displayNameSnapshot: c,
|
|
58
59
|
deepLinkSnapshot: window.location.pathname + window.location.search
|
|
@@ -68,24 +69,24 @@ var g = f`
|
|
|
68
69
|
variant: "warning"
|
|
69
70
|
});
|
|
70
71
|
}
|
|
71
|
-
|
|
72
|
+
l();
|
|
72
73
|
}, [
|
|
73
74
|
y,
|
|
74
|
-
|
|
75
|
+
i,
|
|
75
76
|
s,
|
|
76
77
|
c,
|
|
77
78
|
b,
|
|
78
|
-
|
|
79
|
+
l
|
|
79
80
|
]);
|
|
80
|
-
return v ? /* @__PURE__ */
|
|
81
|
+
return v ? /* @__PURE__ */ d("p", {
|
|
81
82
|
className: "text-sm text-destructive",
|
|
82
83
|
children: ["Couldn't prepare the task project: ", v.message]
|
|
83
|
-
}) :
|
|
84
|
+
}) : g || !m ? /* @__PURE__ */ u("p", {
|
|
84
85
|
className: "text-sm text-muted-foreground",
|
|
85
86
|
children: "Preparing…"
|
|
86
|
-
}) : /* @__PURE__ */
|
|
87
|
+
}) : /* @__PURE__ */ u(n, {
|
|
87
88
|
workspaceId: f,
|
|
88
|
-
projectId:
|
|
89
|
+
projectId: m,
|
|
89
90
|
hideHeader: !0,
|
|
90
91
|
defaultValues: { title: `${c}: ` },
|
|
91
92
|
hiddenFields: [
|
|
@@ -95,10 +96,10 @@ var g = f`
|
|
|
95
96
|
],
|
|
96
97
|
submitLabel: "Create & link",
|
|
97
98
|
onCreated: x,
|
|
98
|
-
onCancel:
|
|
99
|
+
onCancel: l
|
|
99
100
|
});
|
|
100
101
|
};
|
|
101
102
|
//#endregion
|
|
102
|
-
export {
|
|
103
|
+
export { v as CreateFarmTaskButton };
|
|
103
104
|
|
|
104
105
|
//# sourceMappingURL=CreateFarmTaskButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateFarmTaskButton.js","names":[],"sources":["../../../src/healthybowl/components/CreateFarmTaskButton.tsx"],"sourcesContent":["/**\n * CreateFarmTaskButton — a \"Create Task\" action for a HealthyBowl entity detail\n * page (Field / Crop / Animal / Pest).\n *\n * Opens the shared PlanMagnet create form (`CreateTaskCore` from\n * `@burdenoff/planmagnet-fe-sdk`) pre-filled with the entity's name, and on save\n * pins the new task to this record via a `WorkItemLink`\n * (`sourceProduct: \"healthybowl\"`, `entityType`, `entityId`, snapshotted label +\n * deep link) — so the task shows a green linked-record chip on the Farm Tasks\n * board and the \"Linked Record\" list column. This is the TM-06 / AC-03 flow.\n *\n * BYO-Apollo: binds the create form + link mutation to the workspace gateway\n * client (the same one Farm Tasks uses). The project is get-or-created lazily\n * (only when the modal is open) via the shared `useDefaultTaskProject` hook.\n *\n * @module healthybowl\n */\n\nimport { useCallback, useState, type ComponentProps, type FC, type ReactNode } from 'react';\nimport { ApolloProvider, useMutation } from '@apollo/client/react';\nimport { gql, type ApolloClient } from '@apollo/client';\nimport { useSafeGatewayClient } from '@burdenoff/fe-libs/shared/graphql';\nimport { CreateTaskCore, type WorkItemDetail } from '@burdenoff/planmagnet-fe-sdk';\nimport { ClipboardList } from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\n\n// Defined locally (with the host's own `gql`) rather than imported from the SDK\n// to avoid a cross-instance `graphql` DocumentNode type mismatch — same pattern\n// as useDefaultTaskProject. Uses the exact Planmagnet-prefixed input type name.\nconst CREATE_WORK_ITEM_LINK = gql`\n mutation HealthyBowlLinkWorkItem($input: PlanmagnetCreateWorkItemLinkInput!) {\n planmagnetLinkWorkItem(input: $input) {\n id\n }\n }\n`;\nimport { Modal } from './Modal';\nimport { useHealthyBowl } from '../context/HealthyBowlContext';\nimport { useDefaultTaskProject } from '../pages/tasks/useDefaultTaskProject';\nimport { useToast } from '../hooks/useToast';\n\n/** HealthyBowl entity kinds a task can be pinned to (WorkItemLink.entityType). */\nexport type FarmEntityType = 'FIELD' | 'CROP' | 'ANIMAL' | 'PEST';\n\nexport interface CreateFarmTaskButtonProps {\n entityType: FarmEntityType;\n entityId: string;\n /** Human label snapshotted onto the link + used to pre-fill the task title. */\n entityLabel: string;\n /** Button label. Defaults to \"Create Task\". */\n label?: string;\n variant?: ComponentProps<typeof Button>['variant'];\n size?: ComponentProps<typeof Button>['size'];\n /** Render only the icon (compact, e.g. in a table row). Uses `title` for a11y. */\n iconOnly?: boolean;\n /** Tooltip / accessible label (required for a good iconOnly experience). */\n title?: string;\n className?: string;\n icon?: ReactNode;\n}\n\nexport const CreateFarmTaskButton: FC<CreateFarmTaskButtonProps> = ({\n entityType,\n entityId,\n entityLabel,\n label = 'Create Task',\n variant = 'outline',\n size,\n iconOnly,\n title,\n className,\n icon,\n}) => {\n const workspaceClient = useSafeGatewayClient('workspace');\n const [open, setOpen] = useState(false);\n\n // No workspace connection → the whole flow is unavailable; hide the action.\n if (!workspaceClient) return null;\n\n return (\n <>\n <Button\n variant={variant}\n size={size}\n onClick={() => setOpen(true)}\n className={className}\n title={title ?? (iconOnly ? label : undefined)}\n aria-label={iconOnly ? (title ?? label) : undefined}\n >\n {icon ?? <ClipboardList className=\"size-4\" aria-hidden=\"true\" />}\n {!iconOnly && label}\n </Button>\n <Modal\n open={open}\n onClose={() => setOpen(false)}\n title=\"Create Farm Task\"\n description={`Create a task linked to ${entityLabel}.`}\n >\n <ApolloProvider client={workspaceClient}>\n <FarmTaskForm\n client={workspaceClient}\n entityType={entityType}\n entityId={entityId}\n entityLabel={entityLabel}\n onDone={() => setOpen(false)}\n />\n </ApolloProvider>\n </Modal>\n </>\n );\n};\n\nconst FarmTaskForm: FC<{\n client: ApolloClient;\n entityType: FarmEntityType;\n entityId: string;\n entityLabel: string;\n onDone: () => void;\n}> = ({ client, entityType, entityId, entityLabel, onDone }) => {\n const { workspaceId, currentUser } = useHealthyBowl();\n const { projectId, loading, error } = useDefaultTaskProject(client, workspaceId, currentUser?.id);\n const [linkWorkItem] = useMutation(CREATE_WORK_ITEM_LINK);\n const { toast } = useToast();\n\n const handleCreated = useCallback(\n async (workItem: WorkItemDetail) => {\n try {\n await linkWorkItem({\n variables: {\n input: {\n workItemId: workItem.id,\n sourceProduct: 'healthybowl',\n entityType,\n entityId,\n displayNameSnapshot: entityLabel,\n deepLinkSnapshot: window.location.pathname + window.location.search,\n },\n },\n });\n toast({\n title: 'Task created',\n description: `Linked to ${entityLabel}.`,\n variant: 'success',\n });\n } catch {\n // The task WAS created; only the link failed — never lose the task.\n toast({\n title: 'Task created',\n description: 'Saved, but it could not be linked to this record.',\n variant: 'warning',\n });\n }\n onDone();\n },\n [linkWorkItem, entityType, entityId, entityLabel, toast, onDone]\n );\n\n if (error) {\n return <p className=\"text-sm text-destructive\">Couldn't prepare the task project: {error.message}</p>;\n }\n if (loading || !projectId) {\n return <p className=\"text-sm text-muted-foreground\">Preparing…</p>;\n }\n\n return (\n <CreateTaskCore\n workspaceId={workspaceId}\n projectId={projectId}\n hideHeader\n defaultValues={{ title: `${entityLabel}: ` }}\n hiddenFields={['type', 'storyPoints', 'labels']}\n submitLabel=\"Create & link\"\n onCreated={handleCreated}\n onCancel={onDone}\n />\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CreateFarmTaskButton.js","names":[],"sources":["../../../src/healthybowl/components/CreateFarmTaskButton.tsx"],"sourcesContent":["/**\n * CreateFarmTaskButton — a \"Create Task\" action for a HealthyBowl entity detail\n * page (Field / Crop / Animal / Pest).\n *\n * Opens the shared PlanMagnet create form (`CreateTaskCore` from\n * `@burdenoff/planmagnet-fe-sdk`) pre-filled with the entity's name, and on save\n * pins the new task to this record via a `WorkItemLink`\n * (`sourceProduct: \"healthybowl\"`, `entityType`, `entityId`, snapshotted label +\n * deep link) — so the task shows a green linked-record chip on the Farm Tasks\n * board and the \"Linked Record\" list column. This is the TM-06 / AC-03 flow.\n *\n * BYO-Apollo: binds the create form + link mutation to the workspace gateway\n * client (the same one Farm Tasks uses). The project is get-or-created lazily\n * (only when the modal is open) via the shared `useDefaultTaskProject` hook.\n *\n * @module healthybowl\n */\n\nimport { useCallback, useState, type ComponentProps, type FC, type ReactNode } from 'react';\nimport { ApolloProvider, useMutation } from '@apollo/client/react';\nimport { gql, type ApolloClient } from '@apollo/client';\nimport { useSafeGatewayClient } from '@burdenoff/fe-libs/shared/graphql';\nimport { CreateTaskCore, type WorkItemDetail } from '@burdenoff/planmagnet-fe-sdk';\nimport { ClipboardList } from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\n\n// Defined locally (with the host's own `gql`) rather than imported from the SDK\n// to avoid a cross-instance `graphql` DocumentNode type mismatch — same pattern\n// as useDefaultTaskProject. Uses the exact Planmagnet-prefixed input type name.\nconst CREATE_WORK_ITEM_LINK = gql`\n mutation HealthyBowlLinkWorkItem($input: PlanmagnetCreateWorkItemLinkInput!) {\n planmagnetLinkWorkItem(input: $input) {\n id\n }\n }\n`;\nimport { Modal } from './Modal';\nimport { useHealthyBowl } from '../context/HealthyBowlContext';\nimport { useDefaultTaskProject } from '../pages/tasks/useDefaultTaskProject';\nimport { useCanManageTasks } from '../pages/tasks/useCanManageTasks';\nimport { useToast } from '../hooks/useToast';\n\n/** HealthyBowl entity kinds a task can be pinned to (WorkItemLink.entityType). */\nexport type FarmEntityType = 'FIELD' | 'CROP' | 'ANIMAL' | 'PEST';\n\nexport interface CreateFarmTaskButtonProps {\n entityType: FarmEntityType;\n entityId: string;\n /** Human label snapshotted onto the link + used to pre-fill the task title. */\n entityLabel: string;\n /** Button label. Defaults to \"Create Task\". */\n label?: string;\n variant?: ComponentProps<typeof Button>['variant'];\n size?: ComponentProps<typeof Button>['size'];\n /** Render only the icon (compact, e.g. in a table row). Uses `title` for a11y. */\n iconOnly?: boolean;\n /** Tooltip / accessible label (required for a good iconOnly experience). */\n title?: string;\n className?: string;\n icon?: ReactNode;\n}\n\nexport const CreateFarmTaskButton: FC<CreateFarmTaskButtonProps> = ({\n entityType,\n entityId,\n entityLabel,\n label = 'Create Task',\n variant = 'outline',\n size,\n iconOnly,\n title,\n className,\n icon,\n}) => {\n const workspaceClient = useSafeGatewayClient('workspace');\n const { workspaceId } = useHealthyBowl();\n const { canManage } = useCanManageTasks(workspaceId);\n const [open, setOpen] = useState(false);\n\n // No workspace connection → the whole flow is unavailable; hide the action.\n // Read-only members (Viewer/Member) can't create tasks → hide it for them\n // rather than surface a button that would 403 on submit.\n if (!workspaceClient || !canManage) return null;\n\n return (\n <>\n <Button\n variant={variant}\n size={size}\n onClick={() => setOpen(true)}\n className={className}\n title={title ?? (iconOnly ? label : undefined)}\n aria-label={iconOnly ? (title ?? label) : undefined}\n >\n {icon ?? <ClipboardList className=\"size-4\" aria-hidden=\"true\" />}\n {!iconOnly && label}\n </Button>\n <Modal\n open={open}\n onClose={() => setOpen(false)}\n title=\"Create Farm Task\"\n description={`Create a task linked to ${entityLabel}.`}\n >\n <ApolloProvider client={workspaceClient}>\n <FarmTaskForm\n client={workspaceClient}\n entityType={entityType}\n entityId={entityId}\n entityLabel={entityLabel}\n onDone={() => setOpen(false)}\n />\n </ApolloProvider>\n </Modal>\n </>\n );\n};\n\nconst FarmTaskForm: FC<{\n client: ApolloClient;\n entityType: FarmEntityType;\n entityId: string;\n entityLabel: string;\n onDone: () => void;\n}> = ({ client, entityType, entityId, entityLabel, onDone }) => {\n const { workspaceId, currentUser } = useHealthyBowl();\n const { projectId, loading, error } = useDefaultTaskProject(client, workspaceId, currentUser?.id);\n const [linkWorkItem] = useMutation(CREATE_WORK_ITEM_LINK);\n const { toast } = useToast();\n\n const handleCreated = useCallback(\n async (workItem: WorkItemDetail) => {\n try {\n await linkWorkItem({\n variables: {\n input: {\n workItemId: workItem.id,\n sourceProduct: 'healthybowl',\n entityType,\n entityId,\n displayNameSnapshot: entityLabel,\n deepLinkSnapshot: window.location.pathname + window.location.search,\n },\n },\n });\n toast({\n title: 'Task created',\n description: `Linked to ${entityLabel}.`,\n variant: 'success',\n });\n } catch {\n // The task WAS created; only the link failed — never lose the task.\n toast({\n title: 'Task created',\n description: 'Saved, but it could not be linked to this record.',\n variant: 'warning',\n });\n }\n onDone();\n },\n [linkWorkItem, entityType, entityId, entityLabel, toast, onDone]\n );\n\n if (error) {\n return <p className=\"text-sm text-destructive\">Couldn't prepare the task project: {error.message}</p>;\n }\n if (loading || !projectId) {\n return <p className=\"text-sm text-muted-foreground\">Preparing…</p>;\n }\n\n return (\n <CreateTaskCore\n workspaceId={workspaceId}\n projectId={projectId}\n hideHeader\n defaultValues={{ title: `${entityLabel}: ` }}\n hiddenFields={['type', 'storyPoints', 'labels']}\n submitLabel=\"Create & link\"\n onCreated={handleCreated}\n onCancel={onDone}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;AA6BA,IAAM,IAAwB,CAAG;;;;;;GAiCpB,KAAuD,EAClE,eACA,aAC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AM;IACJ,OAAO;IACP,aAAa;IACb,SAAS;IACV,CAAC;;AAEJ,KAAQ;IAEV;EAAC;EAAc;EAAY;EAAU;EAAa;EAAO;EAAO,CACjE;AASD,QAPI,IACK,kBAAC,KAAD;EAAG,WAAU;YAAb,CAAwC,uCAAyC,EAAM,QAAY;MAExG,KAAW,CAAC,IACP,kBAAC,KAAD;EAAG,WAAU;YAAgC;EAAc,CAAA,GAIlE,kBAAC,GAAD;EACe;EACF;EACX,YAAA;EACA,eAAe,EAAE,OAAO,GAAG,EAAY,KAAK;EAC5C,cAAc;GAAC;GAAQ;GAAe;GAAS;EAC/C,aAAY;EACZ,WAAW;EACX,UAAU;EACV,CAAA"}
|
|
@@ -4,69 +4,92 @@ import { ErrorState as n } from "../../components/ErrorState.js";
|
|
|
4
4
|
import { PageLoader as r } from "../../components/PageLoader.js";
|
|
5
5
|
import { TasksPageCore as i } from "../../../node_modules/@burdenoff/planmagnet-fe-sdk/dist/index.js";
|
|
6
6
|
import { useDefaultTaskProject as a } from "./useDefaultTaskProject.js";
|
|
7
|
+
import { useCanManageTasks as o } from "./useCanManageTasks.js";
|
|
7
8
|
import "../../components/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
9
|
+
import { useFarmTaskLabels as s } from "./useFarmTaskLabels.js";
|
|
10
|
+
import { useCallback as c, useMemo as l } from "react";
|
|
11
|
+
import { Bug as u, ListChecks as d, MapPin as f, PawPrint as p, Sprout as m } from "lucide-react";
|
|
12
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
13
|
+
import { ApolloProvider as g } from "@apollo/client/react";
|
|
14
|
+
import { useSafeGatewayClient as _ } from "@burdenoff/fe-libs/shared/graphql";
|
|
15
|
+
import { useWorkspaceDirectory as v } from "@burdenoff/fe-libs/sharing";
|
|
13
16
|
//#region src/healthybowl/pages/tasks/TasksPage.tsx
|
|
14
|
-
var
|
|
17
|
+
var y = (e) => {
|
|
15
18
|
switch (e) {
|
|
16
|
-
case "FIELD": return /* @__PURE__ */ f
|
|
19
|
+
case "FIELD": return /* @__PURE__ */ h(f, {
|
|
17
20
|
className: "h-3 w-3",
|
|
18
21
|
"aria-hidden": "true"
|
|
19
22
|
});
|
|
20
|
-
case "CROP": return /* @__PURE__ */
|
|
23
|
+
case "CROP": return /* @__PURE__ */ h(m, {
|
|
21
24
|
className: "h-3 w-3",
|
|
22
25
|
"aria-hidden": "true"
|
|
23
26
|
});
|
|
24
|
-
case "ANIMAL": return /* @__PURE__ */
|
|
27
|
+
case "ANIMAL": return /* @__PURE__ */ h(p, {
|
|
25
28
|
className: "h-3 w-3",
|
|
26
29
|
"aria-hidden": "true"
|
|
27
30
|
});
|
|
28
|
-
case "PEST": return /* @__PURE__ */
|
|
31
|
+
case "PEST": return /* @__PURE__ */ h(u, {
|
|
29
32
|
className: "h-3 w-3",
|
|
30
33
|
"aria-hidden": "true"
|
|
31
34
|
});
|
|
32
35
|
default: return null;
|
|
33
36
|
}
|
|
34
|
-
},
|
|
35
|
-
let { workspaceId:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
}, b = () => {
|
|
38
|
+
let { workspaceId: u, currentUser: f, authToken: p, apiGatewayUrl: m } = e(), b = _("workspace"), x = f?.id, { projectId: S, loading: C, error: w, retry: T } = a(b, u, x), { members: E } = v({
|
|
39
|
+
workspaceId: u,
|
|
40
|
+
authToken: p,
|
|
41
|
+
apiGatewayUrl: m
|
|
42
|
+
}), D = l(() => E.map((e) => ({
|
|
43
|
+
id: e.id,
|
|
44
|
+
name: e.name
|
|
45
|
+
})), [E]), O = l(() => new Map(E.map((e) => [e.id, e.name])), [E]), k = c((e) => {
|
|
46
|
+
let t = O.get(e);
|
|
47
|
+
return t ? { name: t } : null;
|
|
48
|
+
}, [O]), A = s(), { canManage: j } = o(u), M = l(() => b ? /* @__PURE__ */ h(g, {
|
|
49
|
+
client: b,
|
|
50
|
+
children: /* @__PURE__ */ h(i, {
|
|
51
|
+
workspaceId: u,
|
|
52
|
+
projectId: S ?? void 0,
|
|
53
|
+
readonly: !j,
|
|
54
|
+
currentActorId: x,
|
|
55
|
+
labels: A,
|
|
56
|
+
assigneeOptions: D,
|
|
57
|
+
resolveAssignee: k,
|
|
40
58
|
linkSourceProduct: "healthybowl",
|
|
41
|
-
renderLinkIcon:
|
|
59
|
+
renderLinkIcon: y,
|
|
42
60
|
onTaskSaved: () => {}
|
|
43
61
|
})
|
|
44
62
|
}) : null, [
|
|
63
|
+
b,
|
|
45
64
|
u,
|
|
46
|
-
|
|
47
|
-
|
|
65
|
+
S,
|
|
66
|
+
j,
|
|
67
|
+
x,
|
|
68
|
+
A,
|
|
69
|
+
D,
|
|
70
|
+
k
|
|
48
71
|
]);
|
|
49
|
-
return /* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ h(t, {
|
|
50
73
|
title: "Farm Tasks",
|
|
51
74
|
titleAccent: "Tasks",
|
|
52
75
|
description: "Plan and track farm work — planting, harvesting, maintenance, and more — on a shared board.",
|
|
53
76
|
helpPrompt: "How do I use Farm Tasks to plan and track work on my farm?",
|
|
54
77
|
purpose: "Farm Tasks is your team's shared to-do board. Create tasks, set priority and due dates, drag them across columns as work progresses, and open any task for details.",
|
|
55
|
-
purposeIcon: /* @__PURE__ */
|
|
78
|
+
purposeIcon: /* @__PURE__ */ h(d, {
|
|
56
79
|
className: "size-5",
|
|
57
80
|
"aria-hidden": "true"
|
|
58
81
|
}),
|
|
59
|
-
children:
|
|
82
|
+
children: b ? w ? /* @__PURE__ */ h(n, {
|
|
60
83
|
title: "Couldn't open Farm Tasks",
|
|
61
|
-
description:
|
|
62
|
-
onRetry:
|
|
63
|
-
}) :
|
|
84
|
+
description: w.message,
|
|
85
|
+
onRetry: T
|
|
86
|
+
}) : C || !S ? /* @__PURE__ */ h(r, {}) : M : /* @__PURE__ */ h(n, {
|
|
64
87
|
title: "Tasks unavailable",
|
|
65
88
|
description: "The workspace connection isn't ready. Reload the page or reselect your workspace."
|
|
66
89
|
})
|
|
67
90
|
});
|
|
68
91
|
};
|
|
69
92
|
//#endregion
|
|
70
|
-
export {
|
|
93
|
+
export { b as TasksPage };
|
|
71
94
|
|
|
72
95
|
//# sourceMappingURL=TasksPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TasksPage.js","names":[],"sources":["../../../../src/healthybowl/pages/tasks/TasksPage.tsx"],"sourcesContent":["/**\n * TasksPage — HealthyBowl \"Farm Tasks\".\n *\n * Embeds the composed `<TasksPageCore/>` from `@burdenoff/planmagnet-fe-sdk`\n * (kanban board + create flow + click-to-open detail with inline edit) so farm\n * teams can plan and track work items backed by `wspace-planmagnet-svc`.\n *\n * Wiring:\n * - workspaceId — from the HealthyBowl workspace context (`useHealthyBowl`).\n * - Apollo — the app shell's WORKSPACE gateway client (`useSafeGatewayClient\n * ('workspace')`), the same authed client every other HB page uses. The SDK\n * core is BYO-Apollo, so we wrap it in an `<ApolloProvider>` bound to that\n * client (rather than relying on the ambient default) to be explicit.\n * - projectId — a per-workspace \"Farm Tasks\" project, get-or-created via\n * `useDefaultTaskProject`. Farmers never see PlanMagnet's project concept.\n *\n * Theming: the SDK renders with semantic tokens (`bg-primary`, `text-foreground`,\n * `text-destructive`, `border-border`, …) which resolve against fe-libs' shipped\n * tokens, so the forest theme is inherited — no SDK stylesheet import and no raw\n * colors.\n *\n *
|
|
1
|
+
{"version":3,"file":"TasksPage.js","names":[],"sources":["../../../../src/healthybowl/pages/tasks/TasksPage.tsx"],"sourcesContent":["/**\n * TasksPage — HealthyBowl \"Farm Tasks\".\n *\n * Embeds the composed `<TasksPageCore/>` from `@burdenoff/planmagnet-fe-sdk`\n * (kanban board + create flow + click-to-open detail with inline edit) so farm\n * teams can plan and track work items backed by `wspace-planmagnet-svc`.\n *\n * Wiring:\n * - workspaceId — from the HealthyBowl workspace context (`useHealthyBowl`).\n * - Apollo — the app shell's WORKSPACE gateway client (`useSafeGatewayClient\n * ('workspace')`), the same authed client every other HB page uses. The SDK\n * core is BYO-Apollo, so we wrap it in an `<ApolloProvider>` bound to that\n * client (rather than relying on the ambient default) to be explicit.\n * - projectId — a per-workspace \"Farm Tasks\" project, get-or-created via\n * `useDefaultTaskProject`. Farmers never see PlanMagnet's project concept.\n *\n * Theming: the SDK renders with semantic tokens (`bg-primary`, `text-foreground`,\n * `text-destructive`, `border-border`, …) which resolve against fe-libs' shipped\n * tokens, so the forest theme is inherited — no SDK stylesheet import and no raw\n * colors.\n *\n * Host wiring beyond Apollo + project:\n * - labels — HB's i18n catalog via `useFarmTaskLabels` (6 languages).\n * - assignee picker — the real workspace member directory\n * (`useWorkspaceDirectory`), so tasks show names/avatars and the create/edit\n * forms offer a member dropdown instead of a raw actor-id field.\n * - readonly — Viewers/Members (read-only on `planmagnet-workitem`) get\n * a read-only board via `useCanManageTasks` (fails open; server enforces).\n * - currentActorId — enables the toolbar \"My tasks\" filter.\n * - entity-linked create — shipped as `CreateFarmTaskButton` on Field/Crop/\n * Animal detail pages (WorkItemLink); no longer a TODO.\n *\n * @module healthybowl\n */\n\nimport { useCallback, useMemo, type FC, type ReactNode } from 'react';\nimport { ApolloProvider } from '@apollo/client/react';\nimport { useSafeGatewayClient } from '@burdenoff/fe-libs/shared/graphql';\nimport { useWorkspaceDirectory } from '@burdenoff/fe-libs/sharing';\nimport { TasksPageCore, type AssigneeOption } from '@burdenoff/planmagnet-fe-sdk';\nimport { Bug, ListChecks, MapPin, PawPrint, Sprout } from 'lucide-react';\nimport { PageLayout, ErrorState, PageLoader } from '../../components';\nimport { useHealthyBowl } from '../../context/HealthyBowlContext';\nimport { useDefaultTaskProject } from './useDefaultTaskProject';\nimport { useFarmTaskLabels } from './useFarmTaskLabels';\nimport { useCanManageTasks } from './useCanManageTasks';\n\n/**\n * Farm icon per linked-entity type, so a task's linked-record chip shows a\n * leaf / field / animal / pest glyph (the SDK falls back to a generic link\n * glyph for anything unmapped). Module-level so it's referentially stable.\n */\nconst renderFarmLinkIcon = (entityType: string): ReactNode => {\n switch (entityType) {\n case 'FIELD':\n return <MapPin className=\"h-3 w-3\" aria-hidden=\"true\" />;\n case 'CROP':\n return <Sprout className=\"h-3 w-3\" aria-hidden=\"true\" />;\n case 'ANIMAL':\n return <PawPrint className=\"h-3 w-3\" aria-hidden=\"true\" />;\n case 'PEST':\n return <Bug className=\"h-3 w-3\" aria-hidden=\"true\" />;\n default:\n return null;\n }\n};\n\nexport const TasksPage: FC = () => {\n const { workspaceId, currentUser, authToken, apiGatewayUrl } = useHealthyBowl();\n // The workspace gateway client the whole app already uses (dual-token auth +\n // x-workspace-id). Null only if the shell's GatewayProvider isn't mounted.\n const workspaceClient = useSafeGatewayClient('workspace');\n const ownerId = currentUser?.id;\n\n const {\n projectId,\n loading: projectLoading,\n error: projectError,\n retry,\n } = useDefaultTaskProject(workspaceClient, workspaceId, ownerId);\n\n // Farm-team member directory → real assignee names/avatars + a picker.\n const { members } = useWorkspaceDirectory({ workspaceId, authToken, apiGatewayUrl });\n const assigneeOptions = useMemo<AssigneeOption[]>(() => members.map((m) => ({ id: m.id, name: m.name })), [members]);\n const memberNameById = useMemo(() => new Map(members.map((m) => [m.id, m.name])), [members]);\n const resolveAssignee = useCallback(\n (id: string) => {\n const name = memberNameById.get(id);\n return name ? { name } : null;\n },\n [memberNameById]\n );\n\n // HB i18n → SDK label contract (6 languages, English fallback).\n const labels = useFarmTaskLabels();\n // Read-only for Viewers/Members (fails open; server still enforces RBAC).\n const { canManage } = useCanManageTasks(workspaceId);\n\n // The SDK core is BYO-Apollo: give it an ApolloProvider explicitly bound to\n // the workspace client so it never depends on the ambient default gateway.\n const board = useMemo(() => {\n if (!workspaceClient) return null;\n return (\n <ApolloProvider client={workspaceClient}>\n <TasksPageCore\n workspaceId={workspaceId}\n projectId={projectId ?? undefined}\n readonly={!canManage}\n currentActorId={ownerId}\n labels={labels}\n assigneeOptions={assigneeOptions}\n resolveAssignee={resolveAssignee}\n linkSourceProduct=\"healthybowl\"\n renderLinkIcon={renderFarmLinkIcon}\n onTaskSaved={() => {\n // The SDK already refetches its own board list after a save; nothing\n // else in HB depends on this data yet, so this is a deliberate no-op.\n }}\n />\n </ApolloProvider>\n );\n }, [workspaceClient, workspaceId, projectId, canManage, ownerId, labels, assigneeOptions, resolveAssignee]);\n\n return (\n <PageLayout\n title=\"Farm Tasks\"\n titleAccent=\"Tasks\"\n description=\"Plan and track farm work — planting, harvesting, maintenance, and more — on a shared board.\"\n helpPrompt=\"How do I use Farm Tasks to plan and track work on my farm?\"\n purpose=\"Farm Tasks is your team's shared to-do board. Create tasks, set priority and due dates, drag them across columns as work progresses, and open any task for details.\"\n purposeIcon={<ListChecks className=\"size-5\" aria-hidden=\"true\" />}\n >\n {!workspaceClient ? (\n <ErrorState\n title=\"Tasks unavailable\"\n description=\"The workspace connection isn't ready. Reload the page or reselect your workspace.\"\n />\n ) : projectError ? (\n <ErrorState title=\"Couldn't open Farm Tasks\" description={projectError.message} onRetry={retry} />\n ) : projectLoading || !projectId ? (\n <PageLoader />\n ) : (\n board\n )}\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAoDA,IAAM,KAAsB,MAAkC;AAC5D,SAAQ,GAAR;EACE,KAAK,QACH,QAAO,kBAAC,GAAD;GAAQ,WAAU;GAAU,eAAY;GAAS,CAAA;EAC1D,KAAK,OACH,QAAO,kBAAC,GAAD;GAAQ,WAAU;GAAU,eAAY;GAAS,CAAA;EAC1D,KAAK,SACH,QAAO,kBAAC,GAAD;GAAU,WAAU;GAAU,eAAY;GAAS,CAAA;EAC5D,KAAK,OACH,QAAO,kBAAC,GAAD;GAAK,WAAU;GAAU,eAAY;GAAS,CAAA;EACvD,QACE,QAAO;;GAIA,UAAsB;CACjC,IAAM,EAAE,gBAAa,gBAAa,cAAW,qBAAkB,GAAgB,EAGzE,IAAkB,EAAqB,YAAY,EACnD,IAAU,GAAa,IAEvB,EACJ,cACA,SAAS,GACT,OAAO,GAC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|
+
import { useQuery as t } from "@tanstack/react-query";
|
|
3
|
+
//#region src/healthybowl/pages/tasks/useCanManageTasks.ts
|
|
4
|
+
var n = "query FarmTasksMyPermissions($scopeId: String!) {\n myPermissions(scopeId: $scopeId) {\n permissions {\n resourceType\n level\n allowedActions\n }\n }\n}";
|
|
5
|
+
function r(e) {
|
|
6
|
+
return e.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
7
|
+
}
|
|
8
|
+
var i = "planmagnetworkitem";
|
|
9
|
+
function a(e) {
|
|
10
|
+
let t = e.find((e) => r(e.resourceType) === i);
|
|
11
|
+
if (!t) return !0;
|
|
12
|
+
let n = (t.level ?? "").toUpperCase(), a = (t.allowedActions ?? []).map((e) => e.toLowerCase());
|
|
13
|
+
return n === "ADMIN" || n === "EDITOR" || a.includes("create") || a.includes("update");
|
|
14
|
+
}
|
|
15
|
+
function o(r) {
|
|
16
|
+
let { data: i, isLoading: o } = t({
|
|
17
|
+
queryKey: [
|
|
18
|
+
"healthybowl",
|
|
19
|
+
"farm-tasks",
|
|
20
|
+
"can-manage",
|
|
21
|
+
r
|
|
22
|
+
],
|
|
23
|
+
enabled: !!r,
|
|
24
|
+
staleTime: 300 * 1e3,
|
|
25
|
+
retry: !1,
|
|
26
|
+
queryFn: async () => a((await e({
|
|
27
|
+
gateway: "workspace",
|
|
28
|
+
workspaceId: r,
|
|
29
|
+
workspaceToken: !0,
|
|
30
|
+
query: n,
|
|
31
|
+
operationName: "FarmTasksMyPermissions",
|
|
32
|
+
variables: { scopeId: r },
|
|
33
|
+
suppressGlobalErrorEvent: !0
|
|
34
|
+
})).data?.myPermissions?.permissions ?? [])
|
|
35
|
+
});
|
|
36
|
+
return {
|
|
37
|
+
canManage: i ?? !0,
|
|
38
|
+
loading: o
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { o as useCanManageTasks };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=useCanManageTasks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCanManageTasks.js","names":[],"sources":["../../../../src/healthybowl/pages/tasks/useCanManageTasks.ts"],"sourcesContent":["/**\n * useCanManageTasks — resolves whether the current user may CREATE/EDIT farm\n * tasks, so the Tasks UI can render read-only for Viewers/Members (who only\n * have `read` on `planmagnet-workitem`) instead of showing write affordances\n * that would 403 server-side.\n *\n * Signal: the workspace gateway's `myPermissions(scopeId)` — the effective\n * permissions for the active workspace — inspecting the `planmagnet-workitem`\n * resource for a create/update grant (ADMIN/EDITOR level, or the action in the\n * allow-list).\n *\n * Fails OPEN on every uncertainty (loading, network error, or the resource not\n * appearing in the response): `canManage` defaults to `true`. RBAC is still\n * enforced server-side, so the worst case of a false-open is a graceful\n * \"Failed to create task\" — whereas a false-CLOSED would wrongly strip write\n * UI from a legitimate Owner/Editor on a transient hiccup. Definitive\n * VIEWER/NONE data is honored (→ read-only).\n *\n * Backed by React Query keyed on the workspace, so the many callers (the Tasks\n * board + every per-row `CreateFarmTaskButton`) share one cached result rather\n * than each firing its own `myPermissions` request.\n *\n * @module healthybowl\n */\n\nimport { useQuery } from '@tanstack/react-query';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql';\n\nconst MY_PERMISSIONS_QUERY = `query FarmTasksMyPermissions($scopeId: String!) {\n myPermissions(scopeId: $scopeId) {\n permissions {\n resourceType\n level\n allowedActions\n }\n }\n}`;\n\ninterface ResourcePermission {\n resourceType: string;\n level?: string | null;\n allowedActions?: string[] | null;\n}\n\ninterface MyPermissionsData {\n myPermissions?: { permissions?: ResourcePermission[] };\n}\n\nexport interface CanManageTasks {\n /** True unless the user is a confirmed read-only member for work items. */\n canManage: boolean;\n loading: boolean;\n}\n\n/** Normalize a resource string so \"planmagnet-workitem\"/\"planmagnet_work_item\" all match. */\nfunction norm(s: string): string {\n return s.toLowerCase().replace(/[^a-z0-9]/g, '');\n}\n\nconst WORK_ITEM_RESOURCE = 'planmagnetworkitem';\n\n/** Fail-open interpretation of a permissions payload. */\nfunction computeCanManage(perms: ResourcePermission[]): boolean {\n const workItem = perms.find((p) => norm(p.resourceType) === WORK_ITEM_RESOURCE);\n // Resource absent (unknown naming / super-admin bypass / no data) → fail open.\n if (!workItem) return true;\n const level = (workItem.level ?? '').toUpperCase();\n const actions = (workItem.allowedActions ?? []).map((a) => a.toLowerCase());\n return level === 'ADMIN' || level === 'EDITOR' || actions.includes('create') || actions.includes('update');\n}\n\nexport function useCanManageTasks(workspaceId: string | undefined): CanManageTasks {\n const { data, isLoading } = useQuery({\n queryKey: ['healthybowl', 'farm-tasks', 'can-manage', workspaceId],\n enabled: Boolean(workspaceId),\n staleTime: 5 * 60 * 1000,\n // Never surface as a hard error — the caller fails open.\n retry: false,\n queryFn: async () => {\n const result = await graphqlFetch<MyPermissionsData>({\n gateway: 'workspace',\n workspaceId: workspaceId as string,\n workspaceToken: true,\n query: MY_PERMISSIONS_QUERY,\n operationName: 'FarmTasksMyPermissions',\n variables: { scopeId: workspaceId },\n suppressGlobalErrorEvent: true,\n });\n return computeCanManage(result.data?.myPermissions?.permissions ?? []);\n },\n });\n\n // Fail open: default to writable until definitive data says otherwise.\n return { canManage: data ?? true, loading: isLoading };\n}\n"],"mappings":";;;AA4BA,IAAM,IAAuB;AA2B7B,SAAS,EAAK,GAAmB;AAC/B,QAAO,EAAE,aAAa,CAAC,QAAQ,cAAc,GAAG;;AAGlD,IAAM,IAAqB;AAG3B,SAAS,EAAiB,GAAsC;CAC9D,IAAM,IAAW,EAAM,MAAM,MAAM,EAAK,EAAE,aAAa,KAAK,EAAmB;AAE/E,KAAI,CAAC,EAAU,QAAO;CACtB,IAAM,KAAS,EAAS,SAAS,IAAI,aAAa,EAC5C,KAAW,EAAS,kBAAkB,EAAE,EAAE,KAAK,MAAM,EAAE,aAAa,CAAC;AAC3E,QAAO,MAAU,WAAW,MAAU,YAAY,EAAQ,SAAS,SAAS,IAAI,EAAQ,SAAS,SAAS;;AAG5G,SAAgB,EAAkB,GAAiD;CACjF,IAAM,EAAE,SAAM,iBAAc,EAAS;EACnC,UAAU;GAAC;GAAe;GAAc;GAAc;GAAY;EAClE,SAAS,EAAQ;EACjB,WAAW,MAAS;EAEpB,OAAO;EACP,SAAS,YAUA,GATQ,MAAM,EAAgC;GACnD,SAAS;GACI;GACb,gBAAgB;GAChB,OAAO;GACP,eAAe;GACf,WAAW,EAAE,SAAS,GAAa;GACnC,0BAA0B;GAC3B,CAAC,EAC6B,MAAM,eAAe,eAAe,EAAE,CAAC;EAEzE,CAAC;AAGF,QAAO;EAAE,WAAW,KAAQ;EAAM,SAAS;EAAW"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { useTr as e } from "../../../shared/hooks/useTr.js";
|
|
2
|
+
import { useMemo as t } from "react";
|
|
3
|
+
//#region src/healthybowl/pages/tasks/useFarmTaskLabels.ts
|
|
4
|
+
function n() {
|
|
5
|
+
let n = e();
|
|
6
|
+
return t(() => ({
|
|
7
|
+
board: n("healthybowl.tasks.board", "Board"),
|
|
8
|
+
list: n("healthybowl.tasks.list", "List"),
|
|
9
|
+
timeline: n("healthybowl.tasks.timeline", "Timeline"),
|
|
10
|
+
searchPlaceholder: n("healthybowl.tasks.searchPlaceholder", "Search tasks…"),
|
|
11
|
+
allPriorities: n("healthybowl.tasks.allPriorities", "All priorities"),
|
|
12
|
+
allTypes: n("healthybowl.tasks.allTypes", "All types"),
|
|
13
|
+
newTask: n("healthybowl.tasks.newTask", "New task"),
|
|
14
|
+
myTasks: n("healthybowl.tasks.myTasks", "My tasks"),
|
|
15
|
+
noTasks: n("healthybowl.tasks.noTasks", "No tasks"),
|
|
16
|
+
noTasksFound: n("healthybowl.tasks.noTasksFound", "No tasks found."),
|
|
17
|
+
dropHere: n("healthybowl.tasks.dropHere", "Drop here"),
|
|
18
|
+
unassigned: n("healthybowl.tasks.unassigned", "Unassigned"),
|
|
19
|
+
assigned: n("healthybowl.tasks.assigned", "Assigned"),
|
|
20
|
+
overdue: n("healthybowl.tasks.overdue", "{n} overdue"),
|
|
21
|
+
noDueDate: n("healthybowl.tasks.noDueDate", "No due date ({n})"),
|
|
22
|
+
milestones: n("healthybowl.tasks.milestones", "Milestones"),
|
|
23
|
+
today: n("healthybowl.tasks.today", "Today"),
|
|
24
|
+
week: n("healthybowl.tasks.week", "Week"),
|
|
25
|
+
month: n("healthybowl.tasks.month", "Month"),
|
|
26
|
+
tasksSingular: n("healthybowl.tasks.tasksSingular", "task"),
|
|
27
|
+
tasksPlural: n("healthybowl.tasks.tasksPlural", "tasks"),
|
|
28
|
+
more: n("healthybowl.tasks.more", "more"),
|
|
29
|
+
colTask: n("healthybowl.tasks.colTask", "Task"),
|
|
30
|
+
colStatus: n("healthybowl.tasks.colStatus", "Status"),
|
|
31
|
+
colPriority: n("healthybowl.tasks.colPriority", "Priority"),
|
|
32
|
+
colAssignee: n("healthybowl.tasks.colAssignee", "Assignee"),
|
|
33
|
+
colDueDate: n("healthybowl.tasks.colDueDate", "Due Date"),
|
|
34
|
+
colPoints: n("healthybowl.tasks.colPoints", "Points"),
|
|
35
|
+
colLinkedRecord: n("healthybowl.tasks.colLinkedRecord", "Linked Record"),
|
|
36
|
+
colType: n("healthybowl.tasks.colType", "Type"),
|
|
37
|
+
colKey: n("healthybowl.tasks.colKey", "Key"),
|
|
38
|
+
colLabels: n("healthybowl.tasks.colLabels", "Labels"),
|
|
39
|
+
newTaskHeading: n("healthybowl.tasks.newTaskHeading", "New task"),
|
|
40
|
+
newTaskSubtitle: n("healthybowl.tasks.newTaskSubtitle", "Create a work item in this workspace."),
|
|
41
|
+
title: n("healthybowl.tasks.title", "Title"),
|
|
42
|
+
titlePlaceholder: n("healthybowl.tasks.titlePlaceholder", "What needs doing?"),
|
|
43
|
+
description: n("healthybowl.tasks.description", "Description"),
|
|
44
|
+
descriptionPlaceholder: n("healthybowl.tasks.descriptionPlaceholder", "Add more detail (optional)"),
|
|
45
|
+
typeLabel: n("healthybowl.tasks.typeLabel", "Type"),
|
|
46
|
+
statusLabel: n("healthybowl.tasks.statusLabel", "Status"),
|
|
47
|
+
priorityLabel: n("healthybowl.tasks.priorityLabel", "Priority"),
|
|
48
|
+
assigneeLabel: n("healthybowl.tasks.assigneeLabel", "Assignee"),
|
|
49
|
+
assigneePlaceholder: n("healthybowl.tasks.assigneePlaceholder", "Actor ID (optional)"),
|
|
50
|
+
dueDateLabel: n("healthybowl.tasks.dueDateLabel", "Due date"),
|
|
51
|
+
storyPointsLabel: n("healthybowl.tasks.storyPointsLabel", "Story points"),
|
|
52
|
+
labelsLabel: n("healthybowl.tasks.labelsLabel", "Labels"),
|
|
53
|
+
labelsPlaceholder: n("healthybowl.tasks.labelsPlaceholder", "comma, separated, labels"),
|
|
54
|
+
create: n("healthybowl.tasks.create", "Create task"),
|
|
55
|
+
creating: n("healthybowl.tasks.creating", "Creating…"),
|
|
56
|
+
cancel: n("healthybowl.tasks.cancel", "Cancel"),
|
|
57
|
+
edit: n("healthybowl.tasks.edit", "Edit"),
|
|
58
|
+
del: n("healthybowl.tasks.del", "Delete"),
|
|
59
|
+
deletePrompt: n("healthybowl.tasks.deletePrompt", "Delete?"),
|
|
60
|
+
yes: n("healthybowl.tasks.yes", "Yes"),
|
|
61
|
+
no: n("healthybowl.tasks.no", "No"),
|
|
62
|
+
save: n("healthybowl.tasks.save", "Save changes"),
|
|
63
|
+
saving: n("healthybowl.tasks.saving", "Saving…"),
|
|
64
|
+
taskNotFound: n("healthybowl.tasks.taskNotFound", "Task not found."),
|
|
65
|
+
projectRequired: n("healthybowl.tasks.projectRequired", "A projectId is required to create a task."),
|
|
66
|
+
errorLoading: n("healthybowl.tasks.errorLoading", "Error loading tasks"),
|
|
67
|
+
moveFailed: n("healthybowl.tasks.moveFailed", "Couldn't move the task. Please try again."),
|
|
68
|
+
failedToCreate: n("healthybowl.tasks.failedToCreate", "Failed to create task"),
|
|
69
|
+
failedToSave: n("healthybowl.tasks.failedToSave", "Failed to save"),
|
|
70
|
+
failedToDelete: n("healthybowl.tasks.failedToDelete", "Failed to delete"),
|
|
71
|
+
overdueLabel: n("healthybowl.tasks.overdueLabel", "Overdue"),
|
|
72
|
+
status: {
|
|
73
|
+
BACKLOG: n("healthybowl.tasks.status.BACKLOG", "Backlog"),
|
|
74
|
+
TODO: n("healthybowl.tasks.status.TODO", "To Do"),
|
|
75
|
+
IN_PROGRESS: n("healthybowl.tasks.status.IN_PROGRESS", "In Progress"),
|
|
76
|
+
IN_REVIEW: n("healthybowl.tasks.status.IN_REVIEW", "In Review"),
|
|
77
|
+
TESTING: n("healthybowl.tasks.status.TESTING", "Testing"),
|
|
78
|
+
DONE: n("healthybowl.tasks.status.DONE", "Done"),
|
|
79
|
+
CANCELLED: n("healthybowl.tasks.status.CANCELLED", "Cancelled")
|
|
80
|
+
},
|
|
81
|
+
priority: {
|
|
82
|
+
NONE: n("healthybowl.tasks.priority.NONE", "None"),
|
|
83
|
+
LOW: n("healthybowl.tasks.priority.LOW", "Low"),
|
|
84
|
+
MEDIUM: n("healthybowl.tasks.priority.MEDIUM", "Medium"),
|
|
85
|
+
HIGH: n("healthybowl.tasks.priority.HIGH", "High"),
|
|
86
|
+
CRITICAL: n("healthybowl.tasks.priority.CRITICAL", "Critical")
|
|
87
|
+
},
|
|
88
|
+
type: {
|
|
89
|
+
TASK: n("healthybowl.tasks.type.TASK", "Task"),
|
|
90
|
+
STORY: n("healthybowl.tasks.type.STORY", "Story"),
|
|
91
|
+
BUG: n("healthybowl.tasks.type.BUG", "Bug"),
|
|
92
|
+
EPIC: n("healthybowl.tasks.type.EPIC", "Epic"),
|
|
93
|
+
SUB_TASK: n("healthybowl.tasks.type.SUB_TASK", "Sub Task")
|
|
94
|
+
}
|
|
95
|
+
}), [n]);
|
|
96
|
+
}
|
|
97
|
+
//#endregion
|
|
98
|
+
export { n as useFarmTaskLabels };
|
|
99
|
+
|
|
100
|
+
//# sourceMappingURL=useFarmTaskLabels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFarmTaskLabels.js","names":[],"sources":["../../../../src/healthybowl/pages/tasks/useFarmTaskLabels.ts"],"sourcesContent":["/**\n * useFarmTaskLabels — bridges HealthyBowl's i18n catalog into the\n * `@burdenoff/planmagnet-fe-sdk` Tasks UI.\n *\n * The SDK renders every string from an injectable `labels` contract\n * (`PartialTaskLabels`, English defaults otherwise). This hook builds that\n * object from HB's `useTr()` so Farm Tasks speaks all six HB languages\n * (en/zh/hi/es/ar/ta). Keys live under `healthybowl.tasks.*`; each `tr()` call\n * carries the English fallback, so the UI reads correctly even before those\n * keys land in the translation catalog (untranslated key → fallback).\n *\n * @module healthybowl\n */\n\nimport { useMemo } from 'react';\nimport type { PartialTaskLabels } from '@burdenoff/planmagnet-fe-sdk';\nimport { useTr } from '../../../shared/hooks/useTr';\n\nexport function useFarmTaskLabels(): PartialTaskLabels {\n const tr = useTr();\n return useMemo<PartialTaskLabels>(\n () => ({\n // Views / toolbar\n board: tr('healthybowl.tasks.board', 'Board'),\n list: tr('healthybowl.tasks.list', 'List'),\n timeline: tr('healthybowl.tasks.timeline', 'Timeline'),\n searchPlaceholder: tr('healthybowl.tasks.searchPlaceholder', 'Search tasks…'),\n allPriorities: tr('healthybowl.tasks.allPriorities', 'All priorities'),\n allTypes: tr('healthybowl.tasks.allTypes', 'All types'),\n newTask: tr('healthybowl.tasks.newTask', 'New task'),\n myTasks: tr('healthybowl.tasks.myTasks', 'My tasks'),\n\n // Board / list / timeline shared\n noTasks: tr('healthybowl.tasks.noTasks', 'No tasks'),\n noTasksFound: tr('healthybowl.tasks.noTasksFound', 'No tasks found.'),\n dropHere: tr('healthybowl.tasks.dropHere', 'Drop here'),\n unassigned: tr('healthybowl.tasks.unassigned', 'Unassigned'),\n assigned: tr('healthybowl.tasks.assigned', 'Assigned'),\n overdue: tr('healthybowl.tasks.overdue', '{n} overdue'),\n noDueDate: tr('healthybowl.tasks.noDueDate', 'No due date ({n})'),\n milestones: tr('healthybowl.tasks.milestones', 'Milestones'),\n today: tr('healthybowl.tasks.today', 'Today'),\n week: tr('healthybowl.tasks.week', 'Week'),\n month: tr('healthybowl.tasks.month', 'Month'),\n tasksSingular: tr('healthybowl.tasks.tasksSingular', 'task'),\n tasksPlural: tr('healthybowl.tasks.tasksPlural', 'tasks'),\n more: tr('healthybowl.tasks.more', 'more'),\n\n // List column headers\n colTask: tr('healthybowl.tasks.colTask', 'Task'),\n colStatus: tr('healthybowl.tasks.colStatus', 'Status'),\n colPriority: tr('healthybowl.tasks.colPriority', 'Priority'),\n colAssignee: tr('healthybowl.tasks.colAssignee', 'Assignee'),\n colDueDate: tr('healthybowl.tasks.colDueDate', 'Due Date'),\n colPoints: tr('healthybowl.tasks.colPoints', 'Points'),\n colLinkedRecord: tr('healthybowl.tasks.colLinkedRecord', 'Linked Record'),\n colType: tr('healthybowl.tasks.colType', 'Type'),\n colKey: tr('healthybowl.tasks.colKey', 'Key'),\n colLabels: tr('healthybowl.tasks.colLabels', 'Labels'),\n\n // Create / detail form\n newTaskHeading: tr('healthybowl.tasks.newTaskHeading', 'New task'),\n newTaskSubtitle: tr('healthybowl.tasks.newTaskSubtitle', 'Create a work item in this workspace.'),\n title: tr('healthybowl.tasks.title', 'Title'),\n titlePlaceholder: tr('healthybowl.tasks.titlePlaceholder', 'What needs doing?'),\n description: tr('healthybowl.tasks.description', 'Description'),\n descriptionPlaceholder: tr('healthybowl.tasks.descriptionPlaceholder', 'Add more detail (optional)'),\n typeLabel: tr('healthybowl.tasks.typeLabel', 'Type'),\n statusLabel: tr('healthybowl.tasks.statusLabel', 'Status'),\n priorityLabel: tr('healthybowl.tasks.priorityLabel', 'Priority'),\n assigneeLabel: tr('healthybowl.tasks.assigneeLabel', 'Assignee'),\n assigneePlaceholder: tr('healthybowl.tasks.assigneePlaceholder', 'Actor ID (optional)'),\n dueDateLabel: tr('healthybowl.tasks.dueDateLabel', 'Due date'),\n storyPointsLabel: tr('healthybowl.tasks.storyPointsLabel', 'Story points'),\n labelsLabel: tr('healthybowl.tasks.labelsLabel', 'Labels'),\n labelsPlaceholder: tr('healthybowl.tasks.labelsPlaceholder', 'comma, separated, labels'),\n create: tr('healthybowl.tasks.create', 'Create task'),\n creating: tr('healthybowl.tasks.creating', 'Creating…'),\n cancel: tr('healthybowl.tasks.cancel', 'Cancel'),\n edit: tr('healthybowl.tasks.edit', 'Edit'),\n del: tr('healthybowl.tasks.del', 'Delete'),\n deletePrompt: tr('healthybowl.tasks.deletePrompt', 'Delete?'),\n yes: tr('healthybowl.tasks.yes', 'Yes'),\n no: tr('healthybowl.tasks.no', 'No'),\n save: tr('healthybowl.tasks.save', 'Save changes'),\n saving: tr('healthybowl.tasks.saving', 'Saving…'),\n taskNotFound: tr('healthybowl.tasks.taskNotFound', 'Task not found.'),\n projectRequired: tr('healthybowl.tasks.projectRequired', 'A projectId is required to create a task.'),\n\n // Status / error messages\n errorLoading: tr('healthybowl.tasks.errorLoading', 'Error loading tasks'),\n moveFailed: tr('healthybowl.tasks.moveFailed', \"Couldn't move the task. Please try again.\"),\n failedToCreate: tr('healthybowl.tasks.failedToCreate', 'Failed to create task'),\n failedToSave: tr('healthybowl.tasks.failedToSave', 'Failed to save'),\n failedToDelete: tr('healthybowl.tasks.failedToDelete', 'Failed to delete'),\n overdueLabel: tr('healthybowl.tasks.overdueLabel', 'Overdue'),\n\n // Enum display labels\n status: {\n BACKLOG: tr('healthybowl.tasks.status.BACKLOG', 'Backlog'),\n TODO: tr('healthybowl.tasks.status.TODO', 'To Do'),\n IN_PROGRESS: tr('healthybowl.tasks.status.IN_PROGRESS', 'In Progress'),\n IN_REVIEW: tr('healthybowl.tasks.status.IN_REVIEW', 'In Review'),\n TESTING: tr('healthybowl.tasks.status.TESTING', 'Testing'),\n DONE: tr('healthybowl.tasks.status.DONE', 'Done'),\n CANCELLED: tr('healthybowl.tasks.status.CANCELLED', 'Cancelled'),\n },\n priority: {\n NONE: tr('healthybowl.tasks.priority.NONE', 'None'),\n LOW: tr('healthybowl.tasks.priority.LOW', 'Low'),\n MEDIUM: tr('healthybowl.tasks.priority.MEDIUM', 'Medium'),\n HIGH: tr('healthybowl.tasks.priority.HIGH', 'High'),\n CRITICAL: tr('healthybowl.tasks.priority.CRITICAL', 'Critical'),\n },\n type: {\n TASK: tr('healthybowl.tasks.type.TASK', 'Task'),\n STORY: tr('healthybowl.tasks.type.STORY', 'Story'),\n BUG: tr('healthybowl.tasks.type.BUG', 'Bug'),\n EPIC: tr('healthybowl.tasks.type.EPIC', 'Epic'),\n SUB_TASK: tr('healthybowl.tasks.type.SUB_TASK', 'Sub Task'),\n },\n }),\n [tr]\n );\n}\n"],"mappings":";;;AAkBA,SAAgB,IAAuC;CACrD,IAAM,IAAK,GAAO;AAClB,QAAO,SACE;EAEL,OAAO,EAAG,2BAA2B,QAAQ;EAC7C,MAAM,EAAG,0BAA0B,OAAO;EAC1C,UAAU,EAAG,8BAA8B,WAAW;EACtD,mBAAmB,EAAG,uCAAuC,gBAAgB;EAC7E,eAAe,EAAG,mCAAmC,iBAAiB;EACtE,UAAU,EAAG,8BAA8B,YAAY;EACvD,SAAS,EAAG,6BAA6B,WAAW;EACpD,SAAS,EAAG,6BAA6B,WAAW;EAGpD,SAAS,EAAG,6BAA6B,WAAW;EACpD,cAAc,EAAG,kCAAkC,kBAAkB;EACrE,UAAU,EAAG,8BAA8B,YAAY;EACvD,YAAY,EAAG,gCAAgC,aAAa;EAC5D,UAAU,EAAG,8BAA8B,WAAW;EACtD,SAAS,EAAG,6BAA6B,cAAc;EACvD,WAAW,EAAG,+BAA+B,oBAAoB;EACjE,YAAY,EAAG,gCAAgC,aAAa;EAC5D,OAAO,EAAG,2BAA2B,QAAQ;EAC7C,MAAM,EAAG,0BAA0B,OAAO;EAC1C,OAAO,EAAG,2BAA2B,QAAQ;EAC7C,eAAe,EAAG,mCAAmC,OAAO;EAC5D,aAAa,EAAG,iCAAiC,QAAQ;EACzD,MAAM,EAAG,0BAA0B,OAAO;EAG1C,SAAS,EAAG,6BAA6B,OAAO;EAChD,W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