@burdenoff/microfe-healthybowl 2026.706.5 → 2026.706.7
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.map +1 -1
- package/dist/healthybowl/pages/pest-management/PestIssuesPage.js +1 -1
- package/dist/healthybowl/pages/pest-management/PestIssuesPage.js.map +1 -1
- package/dist/healthybowl/pages/tasks/TasksPage.js +1 -0
- package/dist/healthybowl/pages/tasks/TasksPage.js.map +1 -1
- package/dist/healthybowl/pages/tasks/useFarmTaskLabels.js +3 -0
- package/dist/healthybowl/pages/tasks/useFarmTaskLabels.js.map +1 -1
- package/dist/node_modules/@burdenoff/planmagnet-fe-sdk/dist/index.js +601 -500
- package/dist/node_modules/@burdenoff/planmagnet-fe-sdk/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -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 { 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' | '
|
|
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 Issue).\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_ISSUE';\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,aACA,gBACA,WAAQ,eACR,aAAU,WACV,SACA,aACA,UACA,cACA,cACI;CACJ,IAAM,IAAkB,EAAqB,YAAY,EACnD,EAAE,mBAAgB,GAAgB,EAClC,EAAE,iBAAc,EAAkB,EAAY,EAC9C,CAAC,GAAM,KAAW,EAAS,GAAM;AAOvC,QAFI,CAAC,KAAmB,CAAC,IAAkB,OAGzC,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;EACW;EACH;EACN,eAAe,EAAQ,GAAK;EACjB;EACX,OAAO,MAAU,IAAW,IAAQ,KAAA;EACpC,cAAY,IAAY,KAAS,IAAS,KAAA;YAN5C,CAQG,KAAQ,kBAAC,GAAD;GAAe,WAAU;GAAS,eAAY;GAAS,CAAA,EAC/D,CAAC,KAAY,EACP;KACT,kBAAC,GAAD;EACQ;EACN,eAAe,EAAQ,GAAM;EAC7B,OAAM;EACN,aAAa,2BAA2B,EAAY;YAEpD,kBAAC,GAAD;GAAgB,QAAQ;aACtB,kBAAC,GAAD;IACE,QAAQ;IACI;IACF;IACG;IACb,cAAc,EAAQ,GAAM;IAC5B,CAAA;GACa,CAAA;EACX,CAAA,CACP,EAAA,CAAA;GAID,KAMA,EAAE,WAAQ,eAAY,aAAU,gBAAa,gBAAa;CAC9D,IAAM,EAAE,gBAAa,mBAAgB,GAAgB,EAC/C,EAAE,cAAW,YAAS,aAAU,EAAsB,GAAQ,GAAa,GAAa,GAAG,EAC3F,CAAC,KAAgB,EAAY,EAAsB,EACnD,EAAE,aAAU,GAAU,EAEtB,IAAgB,EACpB,OAAO,MAA6B;AAClC,MAAI;AAaF,GAZA,MAAM,EAAa,EACjB,WAAW,EACT,OAAO;IACL,YAAY,EAAS;IACrB,eAAe;IACf;IACA;IACA,qBAAqB;IACrB,kBAAkB,OAAO,SAAS,WAAW,OAAO,SAAS;IAC9D,EACF,EACF,CAAC,EACF,EAAM;IACJ,OAAO;IACP,aAAa,aAAa,EAAY;IACtC,SAAS;IACV,CAAC;UACI;AAEN,KAAM;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PestIssuesPage.js","names":[],"sources":["../../../../src/healthybowl/pages/pest-management/PestIssuesPage.tsx"],"sourcesContent":["import { useState, type FormEvent } from 'react';\nimport { Bug, ClipboardList, Plus, Trash2 } from 'lucide-react';\nimport {\n PageLayout,\n DataTable,\n StatusBadge,\n FilterBar,\n Modal,\n ToastContainer,\n ErrorState,\n PageLoader,\n CreateFarmTaskButton,\n useConfirm,\n} from '../../components';\nimport { Button, Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '@burdenoff/fe-libs/ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useHealthyBowlData } from '../../hooks/useHealthyBowlData';\nimport { useToast } from '../../hooks/useToast';\nimport { formatDate } from '../../utils/helpers';\nimport type { PestIssue } from '../../types';\n\nconst severityVariant: Record<string, 'error' | 'warning' | 'info'> = {\n high: 'error',\n medium: 'warning',\n low: 'info',\n};\n\nconst statusVariant: Record<string, 'warning' | 'info' | 'success'> = {\n treating: 'warning',\n monitoring: 'info',\n resolved: 'success',\n};\n\nconst typeVariant: Record<string, 'error' | 'warning' | 'info' | 'muted'> = {\n insect: 'warning',\n fungus: 'info',\n disease: 'error',\n};\n\nconst defaultFormData = {\n pest: '',\n type: 'insect' as PestIssue['type'],\n affectedCrop: '',\n affectedField: '',\n severity: 'medium' as PestIssue['severity'],\n treatment: '',\n};\n\nexport function PestIssuesPage() {\n const { t } = useI18n();\n const confirm = useConfirm();\n const { pestIssues, crops, fields, createPestIssue, updatePestIssue, deletePestIssue, loadings, errors, refetch } =\n useHealthyBowlData();\n\n const [search, setSearch] = useState('');\n const [showAddModal, setShowAddModal] = useState(false);\n const [formData, setFormData] = useState(defaultFormData);\n const [updatingIds, setUpdatingIds] = useState<Set<string>>(new Set());\n const [deletingId, setDeletingId] = useState<string | null>(null);\n const [pendingStatus, setPendingStatus] = useState<Record<string, PestIssue['status']>>({});\n const { toasts, toast, dismiss } = useToast();\n\n const filtered = pestIssues.filter(\n (p) =>\n (p.pest ?? '').toLowerCase().includes(search.toLowerCase()) ||\n (p.affectedCrop ?? '').toLowerCase().includes(search.toLowerCase()) ||\n (p.affectedField ?? '').toLowerCase().includes(search.toLowerCase())\n );\n\n const handleSubmit = async (e: FormEvent) => {\n e.preventDefault();\n if (!formData.pest || !formData.affectedCrop || !formData.affectedField) {\n toast({\n title: t('healthybowl.pestManagement.pestIssues.toast.missingFields.title', 'Missing required fields'),\n description: t(\n 'healthybowl.pestManagement.pestIssues.toast.missingFields.description',\n 'Please fill in pest, crop, and field.'\n ),\n variant: 'warning',\n });\n return;\n }\n try {\n await createPestIssue({\n fieldId: formData.affectedField,\n pestName: formData.pest,\n type: formData.type,\n cropAffected: formData.affectedCrop,\n severity: formData.severity,\n status: 'active',\n detectedDate: new Date().toISOString(),\n treatment: formData.treatment || undefined,\n });\n setShowAddModal(false);\n setFormData(defaultFormData);\n toast({\n title: t('healthybowl.pestManagement.pestIssues.toast.reported', 'Pest issue reported successfully.'),\n variant: 'success',\n });\n } catch (err) {\n toast({\n title: t('healthybowl.pestManagement.pestIssues.toast.reportFailed', 'Failed to report pest issue'),\n description: err instanceof Error ? err.message : t('healthybowl.common.error', 'Unknown error'),\n variant: 'error',\n });\n }\n };\n\n const handleDelete = async (id: string, label: string) => {\n if (\n !(await confirm({\n message: t(\n 'healthybowl.pestManagement.pestIssues.confirmDelete',\n 'Delete the pest issue \"{{label}}\"? This cannot be undone.',\n { label }\n ),\n }))\n )\n return;\n setDeletingId(id);\n try {\n await deletePestIssue(id);\n toast({\n title: t('healthybowl.pestManagement.pestIssues.toast.deleted', 'Pest issue deleted'),\n variant: 'success',\n });\n } catch (err) {\n toast({\n title: t('healthybowl.pestManagement.pestIssues.toast.deleteFailed', 'Failed to delete pest issue'),\n description: err instanceof Error ? err.message : t('healthybowl.common.error', 'Unknown error'),\n variant: 'error',\n });\n } finally {\n setDeletingId(null);\n }\n };\n\n // Lifecycle: move a pest issue through active → treating → monitoring → resolved\n // via the real updateHealthyBowlPestIssue mutation (was create-only before).\n const handleStatusChange = async (id: string, status: PestIssue['status']) => {\n const current = pestIssues.find((p) => p.id === id);\n if (current?.status === status) return;\n setUpdatingIds((prev) => new Set(prev).add(id));\n setPendingStatus((prev) => ({ ...prev, [id]: status }));\n try {\n await updatePestIssue({ id, status });\n toast({\n title: t('healthybowl.pestManagement.pestIssues.toast.statusUpdated.title', 'Status updated'),\n description: t(\n 'healthybowl.pestManagement.pestIssues.toast.statusUpdated.description',\n 'Marked as {{status}}.',\n {\n status,\n }\n ),\n variant: 'success',\n });\n } catch (err) {\n toast({\n title: t('healthybowl.pestManagement.pestIssues.toast.statusUpdateFailed', 'Failed to update status'),\n description: err instanceof Error ? err.message : t('healthybowl.common.error', 'Unknown error'),\n variant: 'error',\n });\n } finally {\n setUpdatingIds((prev) => {\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n setPendingStatus((prev) => {\n const next = { ...prev };\n delete next[id];\n return next;\n });\n }\n };\n\n const columns = [\n {\n key: 'pest',\n header: t('healthybowl.pestManagement.pestIssues.table.headers.pest', 'Pest / Disease'),\n render: (r: (typeof pestIssues)[0]) => (\n <div className=\"flex items-center gap-2\">\n <Bug className=\"h-4 w-4 text-text-secondary\" />\n <span className=\"font-medium text-text-primary\">{r.pest}</span>\n </div>\n ),\n },\n {\n key: 'type',\n header: t('healthybowl.pestManagement.pestIssues.table.headers.type', 'Type'),\n render: (r: (typeof pestIssues)[0]) => <StatusBadge label={r.type} variant={typeVariant[r.type] ?? 'muted'} />,\n },\n { key: 'affectedCrop', header: t('healthybowl.pestManagement.pestIssues.table.headers.crop', 'Crop') },\n { key: 'affectedField', header: t('healthybowl.pestManagement.pestIssues.table.headers.field', 'Field') },\n {\n key: 'severity',\n header: t('healthybowl.pestManagement.pestIssues.table.headers.severity', 'Severity'),\n render: (r: (typeof pestIssues)[0]) => (\n <StatusBadge label={r.severity} variant={severityVariant[r.severity] ?? 'info'} />\n ),\n },\n {\n key: 'status',\n header: t('healthybowl.pestManagement.pestIssues.table.headers.status', 'Status'),\n render: (r: (typeof pestIssues)[0]) => (\n <StatusBadge label={r.status} variant={statusVariant[r.status ?? 'unknown'] ?? 'info'} dot />\n ),\n },\n {\n key: 'treatment',\n header: t('healthybowl.pestManagement.pestIssues.table.headers.treatment', 'Treatment'),\n render: (r: (typeof pestIssues)[0]) => <span className=\"text-text-secondary\">{r.treatment ?? '—'}</span>,\n },\n {\n key: 'detectedDate',\n header: t('healthybowl.pestManagement.pestIssues.table.headers.detected', 'Detected'),\n render: (r: (typeof pestIssues)[0]) => <span className=\"text-text-secondary\">{formatDate(r.detectedDate)}</span>,\n },\n {\n key: 'actions',\n header: t('healthybowl.pestManagement.pestIssues.table.headers.updateStatus', 'Update Status'),\n render: (r: (typeof pestIssues)[0]) => (\n <div className=\"flex items-center gap-2\">\n <Select\n value={pendingStatus[r.id] ?? r.status}\n disabled={updatingIds.has(r.id)}\n onValueChange={(value) => handleStatusChange(r.id, value as PestIssue['status'])}\n >\n <SelectTrigger className=\"h-auto w-auto px-2 py-1 text-xs\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"active\">\n {t('healthybowl.pestManagement.pestIssues.status.active', 'Active')}\n </SelectItem>\n <SelectItem value=\"treating\">\n {t('healthybowl.pestManagement.pestIssues.status.treating', 'Treating')}\n </SelectItem>\n <SelectItem value=\"monitoring\">\n {t('healthybowl.pestManagement.pestIssues.status.monitoring', 'Monitoring')}\n </SelectItem>\n <SelectItem value=\"resolved\">\n {t('healthybowl.pestManagement.pestIssues.status.resolved', 'Resolved')}\n </SelectItem>\n </SelectContent>\n </Select>\n <CreateFarmTaskButton\n entityType=\"PEST\"\n entityId={r.id}\n entityLabel={r.pest ?? t('healthybowl.pestManagement.pestIssues.defaultLabel', 'pest issue')}\n iconOnly\n size=\"icon-sm\"\n variant=\"ghost\"\n title={t('healthybowl.pestManagement.pestIssues.actions.createTask', 'Create task for this issue')}\n icon={<ClipboardList className=\"h-3.5 w-3.5\" />}\n />\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n onClick={() =>\n handleDelete(r.id, r.pest ?? t('healthybowl.pestManagement.pestIssues.defaultLabel', 'pest issue'))\n }\n disabled={deletingId === r.id}\n className=\"text-status-error-text hover:bg-status-error-bg/10 hover:text-status-error-text\"\n title={t('healthybowl.pestManagement.pestIssues.actions.deleteIssue', 'Delete issue')}\n aria-label={t('healthybowl.pestManagement.pestIssues.actions.deleteIssue', 'Delete issue')}\n >\n <Trash2 className=\"h-3.5 w-3.5\" />\n </Button>\n </div>\n ),\n },\n ];\n\n return (\n <PageLayout\n title={t('healthybowl.pestManagement.pestIssues.title', 'Pest Issues')}\n description={t('healthybowl.pestManagement.pestIssues.subtitle', 'All active and historical pest/disease issues')}\n purpose=\"A log of every pest and disease problem you've spotted, past and present. Recording them here helps you treat issues consistently, watch for recurring trouble, and keep the records organic certification asks for.\"\n actions={\n <Button onClick={() => setShowAddModal(true)}>\n <Plus className=\"h-4 w-4\" /> {t('healthybowl.pestManagement.pestIssues.actions.report', 'Report Issue')}\n </Button>\n }\n >\n <FilterBar\n searchValue={search}\n onSearchChange={setSearch}\n searchPlaceholder={t(\n 'healthybowl.pestManagement.pestIssues.searchPlaceholder',\n 'Search pests, crops, fields...'\n )}\n />\n {loadings.pest ? (\n <PageLoader />\n ) : errors.pest ? (\n <ErrorState onRetry={refetch} />\n ) : (\n <DataTable columns={columns} data={filtered} keyField=\"id\" />\n )}\n\n <Modal\n open={showAddModal}\n onClose={() => {\n setShowAddModal(false);\n setFormData(defaultFormData);\n }}\n title={t('healthybowl.pestManagement.pestIssues.modal.title', 'Report Pest Issue')}\n description={t(\n 'healthybowl.pestManagement.pestIssues.modal.description',\n 'Report a new pest or disease issue on your farm.'\n )}\n size=\"lg\"\n footer={\n <>\n <Button\n variant=\"outline\"\n className=\"text-text-secondary\"\n onClick={() => {\n setShowAddModal(false);\n setFormData(defaultFormData);\n }}\n >\n {t('healthybowl.common.cancel', 'Cancel')}\n </Button>\n <Button onClick={handleSubmit as unknown as () => void}>\n {t('healthybowl.pestManagement.pestIssues.actions.report', 'Report Issue')}\n </Button>\n </>\n }\n >\n <form onSubmit={handleSubmit} className=\"grid gap-4 sm:grid-cols-2\">\n <div>\n <label className=\"text-sm font-medium text-text-primary\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.pest.label', 'Pest / Disease Name *')}\n </label>\n <input\n type=\"text\"\n value={formData.pest}\n onChange={(e) => setFormData((prev) => ({ ...prev, pest: e.target.value }))}\n placeholder={t(\n 'healthybowl.pestManagement.pestIssues.form.fields.pest.placeholder',\n 'e.g., Aphids, Powdery Mildew'\n )}\n className=\"mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n <div>\n <label className=\"text-sm font-medium text-text-primary\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.type.label', 'Type *')}\n </label>\n <Select\n value={formData.type}\n onValueChange={(value) => setFormData((prev) => ({ ...prev, type: value as PestIssue['type'] }))}\n >\n <SelectTrigger className=\"mt-1 w-full\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"insect\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.type.options.insect', 'Insect')}\n </SelectItem>\n <SelectItem value=\"disease\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.type.options.disease', 'Disease')}\n </SelectItem>\n <SelectItem value=\"weed\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.type.options.weed', 'Weed')}\n </SelectItem>\n <SelectItem value=\"fungus\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.type.options.fungus', 'Fungus')}\n </SelectItem>\n </SelectContent>\n </Select>\n </div>\n <div>\n <label className=\"text-sm font-medium text-text-primary\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.crop.label', 'Affected Crop *')}\n </label>\n <Select\n value={formData.affectedCrop}\n onValueChange={(value) => setFormData((prev) => ({ ...prev, affectedCrop: value }))}\n >\n <SelectTrigger className=\"mt-1 w-full\">\n <SelectValue\n placeholder={t('healthybowl.pestManagement.pestIssues.form.fields.crop.placeholder', 'Select crop')}\n />\n </SelectTrigger>\n <SelectContent>\n {crops.map((c) => (\n <SelectItem key={c.id} value={c.name}>\n {c.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div>\n <label className=\"text-sm font-medium text-text-primary\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.field.label', 'Affected Field *')}\n </label>\n <Select\n value={formData.affectedField}\n onValueChange={(value) => setFormData((prev) => ({ ...prev, affectedField: value }))}\n >\n <SelectTrigger className=\"mt-1 w-full\">\n <SelectValue\n placeholder={t('healthybowl.pestManagement.pestIssues.form.fields.field.placeholder', 'Select field')}\n />\n </SelectTrigger>\n <SelectContent>\n {fields.map((f) => (\n <SelectItem key={f.id} value={f.id}>\n {f.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div>\n <label className=\"text-sm font-medium text-text-primary\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.severity.label', 'Severity *')}\n </label>\n <Select\n value={formData.severity}\n onValueChange={(value) => setFormData((prev) => ({ ...prev, severity: value as PestIssue['severity'] }))}\n >\n <SelectTrigger className=\"mt-1 w-full\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"low\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.severity.options.low', 'Low')}\n </SelectItem>\n <SelectItem value=\"medium\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.severity.options.medium', 'Medium')}\n </SelectItem>\n <SelectItem value=\"high\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.severity.options.high', 'High')}\n </SelectItem>\n <SelectItem value=\"critical\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.severity.options.critical', 'Critical')}\n </SelectItem>\n </SelectContent>\n </Select>\n </div>\n <div>\n <label className=\"text-sm font-medium text-text-primary\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.treatment.label', 'Treatment (optional)')}\n </label>\n <input\n type=\"text\"\n value={formData.treatment}\n onChange={(e) => setFormData((prev) => ({ ...prev, treatment: e.target.value }))}\n placeholder={t(\n 'healthybowl.pestManagement.pestIssues.form.fields.treatment.placeholder',\n 'e.g., Neem Oil Spray'\n )}\n className=\"mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color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qEAAqE,uBAAuB;OACzF,CAAA,EACR,kBAAC,SAAD;OACE,MAAK;OACL,OAAO,EAAS;OAChB,WAAW,MAAM,GAAa,OAAU;QAAE,GAAG;QAAM,WAAW,EAAE,OAAO;QAAO,EAAE;OAChF,aAAa,EACX,2EACA,uBACD;OACD,WAAU;OACV,CAAA,CACE,EAAA,CAAA;MACD;;IACD,CAAA;GAER,kBAAC,GAAD;IAAwB;IAAQ,WAAW;IAAW,CAAA;GAC3C"}
|
|
1
|
+
{"version":3,"file":"PestIssuesPage.js","names":[],"sources":["../../../../src/healthybowl/pages/pest-management/PestIssuesPage.tsx"],"sourcesContent":["import { useState, type FormEvent } from 'react';\nimport { Bug, ClipboardList, Plus, Trash2 } from 'lucide-react';\nimport {\n PageLayout,\n DataTable,\n StatusBadge,\n FilterBar,\n Modal,\n ToastContainer,\n ErrorState,\n PageLoader,\n CreateFarmTaskButton,\n useConfirm,\n} from '../../components';\nimport { Button, Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '@burdenoff/fe-libs/ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useHealthyBowlData } from '../../hooks/useHealthyBowlData';\nimport { useToast } from '../../hooks/useToast';\nimport { formatDate } from '../../utils/helpers';\nimport type { PestIssue } from '../../types';\n\nconst severityVariant: Record<string, 'error' | 'warning' | 'info'> = {\n high: 'error',\n medium: 'warning',\n low: 'info',\n};\n\nconst statusVariant: Record<string, 'warning' | 'info' | 'success'> = {\n treating: 'warning',\n monitoring: 'info',\n resolved: 'success',\n};\n\nconst typeVariant: Record<string, 'error' | 'warning' | 'info' | 'muted'> = {\n insect: 'warning',\n fungus: 'info',\n disease: 'error',\n};\n\nconst defaultFormData = {\n pest: '',\n type: 'insect' as PestIssue['type'],\n affectedCrop: '',\n affectedField: '',\n severity: 'medium' as PestIssue['severity'],\n treatment: '',\n};\n\nexport function PestIssuesPage() {\n const { t } = useI18n();\n const confirm = useConfirm();\n const { pestIssues, crops, fields, createPestIssue, updatePestIssue, deletePestIssue, loadings, errors, refetch } =\n useHealthyBowlData();\n\n const [search, setSearch] = useState('');\n const [showAddModal, setShowAddModal] = useState(false);\n const [formData, setFormData] = useState(defaultFormData);\n const [updatingIds, setUpdatingIds] = useState<Set<string>>(new Set());\n const [deletingId, setDeletingId] = useState<string | null>(null);\n const [pendingStatus, setPendingStatus] = useState<Record<string, PestIssue['status']>>({});\n const { toasts, toast, dismiss } = useToast();\n\n const filtered = pestIssues.filter(\n (p) =>\n (p.pest ?? '').toLowerCase().includes(search.toLowerCase()) ||\n (p.affectedCrop ?? '').toLowerCase().includes(search.toLowerCase()) ||\n (p.affectedField ?? '').toLowerCase().includes(search.toLowerCase())\n );\n\n const handleSubmit = async (e: FormEvent) => {\n e.preventDefault();\n if (!formData.pest || !formData.affectedCrop || !formData.affectedField) {\n toast({\n title: t('healthybowl.pestManagement.pestIssues.toast.missingFields.title', 'Missing required fields'),\n description: t(\n 'healthybowl.pestManagement.pestIssues.toast.missingFields.description',\n 'Please fill in pest, crop, and field.'\n ),\n variant: 'warning',\n });\n return;\n }\n try {\n await createPestIssue({\n fieldId: formData.affectedField,\n pestName: formData.pest,\n type: formData.type,\n cropAffected: formData.affectedCrop,\n severity: formData.severity,\n status: 'active',\n detectedDate: new Date().toISOString(),\n treatment: formData.treatment || undefined,\n });\n setShowAddModal(false);\n setFormData(defaultFormData);\n toast({\n title: t('healthybowl.pestManagement.pestIssues.toast.reported', 'Pest issue reported successfully.'),\n variant: 'success',\n });\n } catch (err) {\n toast({\n title: t('healthybowl.pestManagement.pestIssues.toast.reportFailed', 'Failed to report pest issue'),\n description: err instanceof Error ? err.message : t('healthybowl.common.error', 'Unknown error'),\n variant: 'error',\n });\n }\n };\n\n const handleDelete = async (id: string, label: string) => {\n if (\n !(await confirm({\n message: t(\n 'healthybowl.pestManagement.pestIssues.confirmDelete',\n 'Delete the pest issue \"{{label}}\"? This cannot be undone.',\n { label }\n ),\n }))\n )\n return;\n setDeletingId(id);\n try {\n await deletePestIssue(id);\n toast({\n title: t('healthybowl.pestManagement.pestIssues.toast.deleted', 'Pest issue deleted'),\n variant: 'success',\n });\n } catch (err) {\n toast({\n title: t('healthybowl.pestManagement.pestIssues.toast.deleteFailed', 'Failed to delete pest issue'),\n description: err instanceof Error ? err.message : t('healthybowl.common.error', 'Unknown error'),\n variant: 'error',\n });\n } finally {\n setDeletingId(null);\n }\n };\n\n // Lifecycle: move a pest issue through active → treating → monitoring → resolved\n // via the real updateHealthyBowlPestIssue mutation (was create-only before).\n const handleStatusChange = async (id: string, status: PestIssue['status']) => {\n const current = pestIssues.find((p) => p.id === id);\n if (current?.status === status) return;\n setUpdatingIds((prev) => new Set(prev).add(id));\n setPendingStatus((prev) => ({ ...prev, [id]: status }));\n try {\n await updatePestIssue({ id, status });\n toast({\n title: t('healthybowl.pestManagement.pestIssues.toast.statusUpdated.title', 'Status updated'),\n description: t(\n 'healthybowl.pestManagement.pestIssues.toast.statusUpdated.description',\n 'Marked as {{status}}.',\n {\n status,\n }\n ),\n variant: 'success',\n });\n } catch (err) {\n toast({\n title: t('healthybowl.pestManagement.pestIssues.toast.statusUpdateFailed', 'Failed to update status'),\n description: err instanceof Error ? err.message : t('healthybowl.common.error', 'Unknown error'),\n variant: 'error',\n });\n } finally {\n setUpdatingIds((prev) => {\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n setPendingStatus((prev) => {\n const next = { ...prev };\n delete next[id];\n return next;\n });\n }\n };\n\n const columns = [\n {\n key: 'pest',\n header: t('healthybowl.pestManagement.pestIssues.table.headers.pest', 'Pest / Disease'),\n render: (r: (typeof pestIssues)[0]) => (\n <div className=\"flex items-center gap-2\">\n <Bug className=\"h-4 w-4 text-text-secondary\" />\n <span className=\"font-medium text-text-primary\">{r.pest}</span>\n </div>\n ),\n },\n {\n key: 'type',\n header: t('healthybowl.pestManagement.pestIssues.table.headers.type', 'Type'),\n render: (r: (typeof pestIssues)[0]) => <StatusBadge label={r.type} variant={typeVariant[r.type] ?? 'muted'} />,\n },\n { key: 'affectedCrop', header: t('healthybowl.pestManagement.pestIssues.table.headers.crop', 'Crop') },\n { key: 'affectedField', header: t('healthybowl.pestManagement.pestIssues.table.headers.field', 'Field') },\n {\n key: 'severity',\n header: t('healthybowl.pestManagement.pestIssues.table.headers.severity', 'Severity'),\n render: (r: (typeof pestIssues)[0]) => (\n <StatusBadge label={r.severity} variant={severityVariant[r.severity] ?? 'info'} />\n ),\n },\n {\n key: 'status',\n header: t('healthybowl.pestManagement.pestIssues.table.headers.status', 'Status'),\n render: (r: (typeof pestIssues)[0]) => (\n <StatusBadge label={r.status} variant={statusVariant[r.status ?? 'unknown'] ?? 'info'} dot />\n ),\n },\n {\n key: 'treatment',\n header: t('healthybowl.pestManagement.pestIssues.table.headers.treatment', 'Treatment'),\n render: (r: (typeof pestIssues)[0]) => <span className=\"text-text-secondary\">{r.treatment ?? '—'}</span>,\n },\n {\n key: 'detectedDate',\n header: t('healthybowl.pestManagement.pestIssues.table.headers.detected', 'Detected'),\n render: (r: (typeof pestIssues)[0]) => <span className=\"text-text-secondary\">{formatDate(r.detectedDate)}</span>,\n },\n {\n key: 'actions',\n header: t('healthybowl.pestManagement.pestIssues.table.headers.updateStatus', 'Update Status'),\n render: (r: (typeof pestIssues)[0]) => (\n <div className=\"flex items-center gap-2\">\n <Select\n value={pendingStatus[r.id] ?? r.status}\n disabled={updatingIds.has(r.id)}\n onValueChange={(value) => handleStatusChange(r.id, value as PestIssue['status'])}\n >\n <SelectTrigger className=\"h-auto w-auto px-2 py-1 text-xs\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"active\">\n {t('healthybowl.pestManagement.pestIssues.status.active', 'Active')}\n </SelectItem>\n <SelectItem value=\"treating\">\n {t('healthybowl.pestManagement.pestIssues.status.treating', 'Treating')}\n </SelectItem>\n <SelectItem value=\"monitoring\">\n {t('healthybowl.pestManagement.pestIssues.status.monitoring', 'Monitoring')}\n </SelectItem>\n <SelectItem value=\"resolved\">\n {t('healthybowl.pestManagement.pestIssues.status.resolved', 'Resolved')}\n </SelectItem>\n </SelectContent>\n </Select>\n <CreateFarmTaskButton\n entityType=\"PEST_ISSUE\"\n entityId={r.id}\n entityLabel={r.pest ?? t('healthybowl.pestManagement.pestIssues.defaultLabel', 'pest issue')}\n iconOnly\n size=\"icon-sm\"\n variant=\"ghost\"\n title={t('healthybowl.pestManagement.pestIssues.actions.createTask', 'Create task for this issue')}\n icon={<ClipboardList className=\"h-3.5 w-3.5\" />}\n />\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n onClick={() =>\n handleDelete(r.id, r.pest ?? t('healthybowl.pestManagement.pestIssues.defaultLabel', 'pest issue'))\n }\n disabled={deletingId === r.id}\n className=\"text-status-error-text hover:bg-status-error-bg/10 hover:text-status-error-text\"\n title={t('healthybowl.pestManagement.pestIssues.actions.deleteIssue', 'Delete issue')}\n aria-label={t('healthybowl.pestManagement.pestIssues.actions.deleteIssue', 'Delete issue')}\n >\n <Trash2 className=\"h-3.5 w-3.5\" />\n </Button>\n </div>\n ),\n },\n ];\n\n return (\n <PageLayout\n title={t('healthybowl.pestManagement.pestIssues.title', 'Pest Issues')}\n description={t('healthybowl.pestManagement.pestIssues.subtitle', 'All active and historical pest/disease issues')}\n purpose=\"A log of every pest and disease problem you've spotted, past and present. Recording them here helps you treat issues consistently, watch for recurring trouble, and keep the records organic certification asks for.\"\n actions={\n <Button onClick={() => setShowAddModal(true)}>\n <Plus className=\"h-4 w-4\" /> {t('healthybowl.pestManagement.pestIssues.actions.report', 'Report Issue')}\n </Button>\n }\n >\n <FilterBar\n searchValue={search}\n onSearchChange={setSearch}\n searchPlaceholder={t(\n 'healthybowl.pestManagement.pestIssues.searchPlaceholder',\n 'Search pests, crops, fields...'\n )}\n />\n {loadings.pest ? (\n <PageLoader />\n ) : errors.pest ? (\n <ErrorState onRetry={refetch} />\n ) : (\n <DataTable columns={columns} data={filtered} keyField=\"id\" />\n )}\n\n <Modal\n open={showAddModal}\n onClose={() => {\n setShowAddModal(false);\n setFormData(defaultFormData);\n }}\n title={t('healthybowl.pestManagement.pestIssues.modal.title', 'Report Pest Issue')}\n description={t(\n 'healthybowl.pestManagement.pestIssues.modal.description',\n 'Report a new pest or disease issue on your farm.'\n )}\n size=\"lg\"\n footer={\n <>\n <Button\n variant=\"outline\"\n className=\"text-text-secondary\"\n onClick={() => {\n setShowAddModal(false);\n setFormData(defaultFormData);\n }}\n >\n {t('healthybowl.common.cancel', 'Cancel')}\n </Button>\n <Button onClick={handleSubmit as unknown as () => void}>\n {t('healthybowl.pestManagement.pestIssues.actions.report', 'Report Issue')}\n </Button>\n </>\n }\n >\n <form onSubmit={handleSubmit} className=\"grid gap-4 sm:grid-cols-2\">\n <div>\n <label className=\"text-sm font-medium text-text-primary\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.pest.label', 'Pest / Disease Name *')}\n </label>\n <input\n type=\"text\"\n value={formData.pest}\n onChange={(e) => setFormData((prev) => ({ ...prev, pest: e.target.value }))}\n placeholder={t(\n 'healthybowl.pestManagement.pestIssues.form.fields.pest.placeholder',\n 'e.g., Aphids, Powdery Mildew'\n )}\n className=\"mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n <div>\n <label className=\"text-sm font-medium text-text-primary\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.type.label', 'Type *')}\n </label>\n <Select\n value={formData.type}\n onValueChange={(value) => setFormData((prev) => ({ ...prev, type: value as PestIssue['type'] }))}\n >\n <SelectTrigger className=\"mt-1 w-full\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"insect\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.type.options.insect', 'Insect')}\n </SelectItem>\n <SelectItem value=\"disease\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.type.options.disease', 'Disease')}\n </SelectItem>\n <SelectItem value=\"weed\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.type.options.weed', 'Weed')}\n </SelectItem>\n <SelectItem value=\"fungus\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.type.options.fungus', 'Fungus')}\n </SelectItem>\n </SelectContent>\n </Select>\n </div>\n <div>\n <label className=\"text-sm font-medium text-text-primary\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.crop.label', 'Affected Crop *')}\n </label>\n <Select\n value={formData.affectedCrop}\n onValueChange={(value) => setFormData((prev) => ({ ...prev, affectedCrop: value }))}\n >\n <SelectTrigger className=\"mt-1 w-full\">\n <SelectValue\n placeholder={t('healthybowl.pestManagement.pestIssues.form.fields.crop.placeholder', 'Select crop')}\n />\n </SelectTrigger>\n <SelectContent>\n {crops.map((c) => (\n <SelectItem key={c.id} value={c.name}>\n {c.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div>\n <label className=\"text-sm font-medium text-text-primary\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.field.label', 'Affected Field *')}\n </label>\n <Select\n value={formData.affectedField}\n onValueChange={(value) => setFormData((prev) => ({ ...prev, affectedField: value }))}\n >\n <SelectTrigger className=\"mt-1 w-full\">\n <SelectValue\n placeholder={t('healthybowl.pestManagement.pestIssues.form.fields.field.placeholder', 'Select field')}\n />\n </SelectTrigger>\n <SelectContent>\n {fields.map((f) => (\n <SelectItem key={f.id} value={f.id}>\n {f.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div>\n <label className=\"text-sm font-medium text-text-primary\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.severity.label', 'Severity *')}\n </label>\n <Select\n value={formData.severity}\n onValueChange={(value) => setFormData((prev) => ({ ...prev, severity: value as PestIssue['severity'] }))}\n >\n <SelectTrigger className=\"mt-1 w-full\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"low\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.severity.options.low', 'Low')}\n </SelectItem>\n <SelectItem value=\"medium\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.severity.options.medium', 'Medium')}\n </SelectItem>\n <SelectItem value=\"high\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.severity.options.high', 'High')}\n </SelectItem>\n <SelectItem value=\"critical\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.severity.options.critical', 'Critical')}\n </SelectItem>\n </SelectContent>\n </Select>\n </div>\n <div>\n <label className=\"text-sm font-medium text-text-primary\">\n {t('healthybowl.pestManagement.pestIssues.form.fields.treatment.label', 'Treatment (optional)')}\n </label>\n <input\n type=\"text\"\n value={formData.treatment}\n onChange={(e) => setFormData((prev) => ({ ...prev, treatment: e.target.value }))}\n placeholder={t(\n 'healthybowl.pestManagement.pestIssues.form.fields.treatment.placeholder',\n 'e.g., Neem Oil Spray'\n )}\n className=\"mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n </form>\n </Modal>\n\n <ToastContainer toasts={toasts} onDismiss={dismiss} />\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqBA,IAAM,IAAgE;CACpE,MAAM;CACN,QAAQ;CACR,KAAK;CACN,EAEK,IAAgE;CACpE,UAAU;CACV,YAAY;CACZ,UAAU;CACX,EAEK,IAAsE;CAC1E,QAAQ;CACR,QAAQ;CACR,SAAS;CACV,EAEK,IAAkB;CACtB,MAAM;CACN,MAAM;CACN,cAAc;CACd,eAAe;CACf,UAAU;CACV,WAAW;CACZ;AAED,SAAgB,IAAiB;CAC/B,IAAM,EAAE,SAAM,GAAS,EACjB,IAAU,GAAY,EACtB,EAAE,eAAY,UAAO,WAAQ,oBAAiB,oBAAiB,oBAAiB,aAAU,WAAQ,gBACtG,GAAoB,EAEhB,CAAC,GAAQ,KAAa,EAAS,GAAG,EAClC,CA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WAAU;iBACd,EAAE,oEAAoE,aAAa;OAC9E,CAAA,EACR,kBAAC,GAAD;OACE,OAAO,EAAS;OAChB,gBAAgB,MAAU,GAAa,OAAU;QAAE,GAAG;QAAM,UAAU;QAAgC,EAAE;iBAF1G,CAIE,kBAAC,GAAD;QAAe,WAAU;kBACvB,kBAAC,GAAD,EAAe,CAAA;QACD,CAAA,EAChB,kBAAC,GAAD,EAAA,UAAA;QACE,kBAAC,GAAD;SAAY,OAAM;mBACf,EAAE,0EAA0E,MAAM;SACxE,CAAA;QACb,kBAAC,GAAD;SAAY,OAAM;mBACf,EAAE,6EAA6E,SAAS;SAC9E,CAAA;QACb,kBAAC,GAAD;SAAY,OAAM;mBACf,EAAE,2EAA2E,OAAO;SAC1E,CAAA;QACb,kBAAC,GAAD;SAAY,OAAM;mBACf,EAAE,+EAA+E,WAAW;SAClF,CAAA;QACC,EAAA,CAAA,CACT;SACL,EAAA,CAAA;MACN,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,SAAD;OAAO,WAAU;iBACd,EAAE,qEAAqE,uBAAuB;OACzF,CAAA,EACR,kBAAC,SAAD;OACE,MAAK;OACL,OAAO,EAAS;OAChB,WAAW,MAAM,GAAa,OAAU;QAAE,GAAG;QAAM,WAAW,EAAE,OAAO;QAAO,EAAE;OAChF,aAAa,EACX,2EACA,uBACD;OACD,WAAU;OACV,CAAA,CACE,EAAA,CAAA;MACD;;IACD,CAAA;GAER,kBAAC,GAAD;IAAwB;IAAQ,WAAW;IAAW,CAAA;GAC3C"}
|
|
@@ -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 * 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 { useSearchParams } from 'react-router-dom';\nimport { gql } from '@apollo/client';\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\n/**\n * IN_APP-notify @-mentioned members of a task comment. The comment lives in the\n * shared conversations service (which can't carry the workspace member ids), so\n * the SDK hands us the mentioned ids via `onMention` and wspace-healthybowl-svc\n * dispatches the notifications with its own service identity.\n */\nconst NOTIFY_MENTION = gql`\n mutation HealthyBowlNotifyMention($input: HealthyBowlNotifyMentionInput!) {\n healthybowlNotifyMention(input: $input)\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 // Deep-link from the calendar: `/healthybowl/tasks?item=<id>` opens that task.\n const [searchParams] = useSearchParams();\n const openItemId = searchParams.get('item') ?? undefined;\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 // @mention notifications: the SDK fires this after a comment @-mentions\n // members; dispatch IN_APP notifications via wspace-healthybowl-svc (which\n // notifies with its service identity). Fire-and-forget — never blocks the UI.\n const handleMention = useCallback(\n (payload: { mentionedIds: string[]; entityId: string }) => {\n if (!workspaceClient || payload.mentionedIds.length === 0) return;\n void workspaceClient\n .mutate({\n mutation: NOTIFY_MENTION,\n variables: {\n input: { taskId: payload.entityId, mentionedUserIds: payload.mentionedIds },\n },\n })\n .catch(() => {\n // Best-effort: a notification failure must never disrupt commenting.\n });\n },\n [workspaceClient]\n );\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 commentsEntityType=\"planmagnet_workitem\"\n onMention={handleMention}\n openItemId={openItemId}\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 }, [\n workspaceClient,\n workspaceId,\n projectId,\n canManage,\n ownerId,\n openItemId,\n labels,\n assigneeOptions,\n resolveAssignee,\n handleMention,\n ]);\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":";;;;;;;;;;;;;;;;;;AAsDA,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;;GAUP,IAAiB,CAAG;;;;GAMb,UAAsB;CACjC,IAAM,EAAE,gBAAa,gBAAa,cAAW,qBAAkB,GAAgB,EAGzE,IAAkB,EAAqB,YAAY,EACnD,IAAU,GAAa,IAEvB,CAAC,KAAgB,GAAiB,EAClC,IAAa,EAAa,IAAI,OAAO,IAAI,KAAA,GAEzC,EACJ,cACA,SAAS,GACT,OAAO,GACP,aACE,EAAsB,GAAiB,GAAa,EAAQ,EAG1D,EAAE,eAAY,EAAsB;EAAE;EAAa;EAAW;EAAe,CAAC,EAC9E,IAAkB,QAAgC,EAAQ,KAAK,OAAO;EAAE,IAAI,EAAE;EAAI,MAAM,EAAE;EAAM,EAAE,EAAE,CAAC,EAAQ,CAAC,EAC9G,IAAiB,QA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asks/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 and Pest Issue rows (WorkItemLink); no longer a TODO.\n *\n * @module healthybowl\n */\n\nimport { useCallback, useMemo, type FC, type ReactNode } from 'react';\nimport { useSearchParams } from 'react-router-dom';\nimport { gql } from '@apollo/client';\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 issue 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_ISSUE':\n case 'PEST':\n return <Bug className=\"h-3 w-3\" aria-hidden=\"true\" />;\n default:\n return null;\n }\n};\n\n/**\n * IN_APP-notify @-mentioned members of a task comment. The comment lives in the\n * shared conversations service (which can't carry the workspace member ids), so\n * the SDK hands us the mentioned ids via `onMention` and wspace-healthybowl-svc\n * dispatches the notifications with its own service identity.\n */\nconst NOTIFY_MENTION = gql`\n mutation HealthyBowlNotifyMention($input: HealthyBowlNotifyMentionInput!) {\n healthybowlNotifyMention(input: $input)\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 // Deep-link from the calendar: `/healthybowl/tasks?item=<id>` opens that task.\n const [searchParams] = useSearchParams();\n const openItemId = searchParams.get('item') ?? undefined;\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 // @mention notifications: the SDK fires this after a comment @-mentions\n // members; dispatch IN_APP notifications via wspace-healthybowl-svc (which\n // notifies with its service identity). Fire-and-forget — never blocks the UI.\n const handleMention = useCallback(\n (payload: { mentionedIds: string[]; entityId: string }) => {\n if (!workspaceClient || payload.mentionedIds.length === 0) return;\n void workspaceClient\n .mutate({\n mutation: NOTIFY_MENTION,\n variables: {\n input: { taskId: payload.entityId, mentionedUserIds: payload.mentionedIds },\n },\n })\n .catch(() => {\n // Best-effort: a notification failure must never disrupt commenting.\n });\n },\n [workspaceClient]\n );\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 commentsEntityType=\"planmagnet_workitem\"\n onMention={handleMention}\n openItemId={openItemId}\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 }, [\n workspaceClient,\n workspaceId,\n projectId,\n canManage,\n ownerId,\n openItemId,\n labels,\n assigneeOptions,\n resolveAssignee,\n handleMention,\n ]);\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":";;;;;;;;;;;;;;;;;;AAsDA,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;EACL,KAAK,OACH,QAAO,kBAAC,GAAD;GAAK,WAAU;GAAU,eAAY;GAAS,CAAA;EACvD,QACE,QAAO;;GAUP,IAAiB,CAAG;;;;GAMb,UAAsB;CACjC,IAAM,EAAE,gBAAa,gBAAa,cAAW,qBAAkB,GAAgB,EAGzE,IAAkB,EAAqB,YAAY,EACnD,IAAU,GAAa,IAEvB,CAAC,KAAgB,GAAiB,EAClC,IAAa,EAAa,IAAI,OAAO,IAAI,KAAA,GAEzC,EACJ,cACA,SA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AY,OAAM;GAA2B,aAAa,EAAa;GAAS,SAAS;GAAS,CAAA,GAChG,KAAkB,CAAC,IACrB,kBAAC,GAAD,EAAc,CAAA,GAEd,IATA,kBAAC,GAAD;GACE,OAAM;GACN,aAAY;GACZ,CAAA;EAQO,CAAA"}
|
|
@@ -20,6 +20,9 @@ function n() {
|
|
|
20
20
|
overdue: n("healthybowl.tasks.overdue", "{n} overdue"),
|
|
21
21
|
noDueDate: n("healthybowl.tasks.noDueDate", "No due date ({n})"),
|
|
22
22
|
milestones: n("healthybowl.tasks.milestones", "Milestones"),
|
|
23
|
+
addMilestone: n("healthybowl.tasks.addMilestone", "Add milestone"),
|
|
24
|
+
milestoneNamePlaceholder: n("healthybowl.tasks.milestoneNamePlaceholder", "Milestone name"),
|
|
25
|
+
failedToCreateMilestone: n("healthybowl.tasks.failedToCreateMilestone", "Failed to create milestone"),
|
|
23
26
|
today: n("healthybowl.tasks.today", "Today"),
|
|
24
27
|
week: n("healthybowl.tasks.week", "Week"),
|
|
25
28
|
month: n("healthybowl.tasks.month", "Month"),
|
|
@@ -1 +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 // Drag-move confirmation\n moveConfirmTitle: tr('healthybowl.tasks.moveConfirmTitle', 'Move task?'),\n moveConfirmPrompt: tr('healthybowl.tasks.moveConfirmPrompt', 'Move \"{task}\" to {status}?'),\n moveConfirm: tr('healthybowl.tasks.moveConfirm', 'Move'),\n\n // Detail: linked records + metadata\n linkedRecordsLabel: tr('healthybowl.tasks.linkedRecordsLabel', 'Linked records'),\n createdLabel: tr('healthybowl.tasks.createdLabel', 'Created'),\n updatedLabel: tr('healthybowl.tasks.updatedLabel', 'Updated'),\n\n // Sub-issues\n parentLabel: tr('healthybowl.tasks.parentLabel', 'Parent'),\n subtasksLabel: tr('healthybowl.tasks.subtasksLabel', 'Sub-tasks'),\n addSubtask: tr('healthybowl.tasks.addSubtask', 'Add sub-task'),\n\n // Comments + threading + mentions\n commentsLabel: tr('healthybowl.tasks.commentsLabel', 'Comments'),\n commentPlaceholder: tr('healthybowl.tasks.commentPlaceholder', 'Write a comment…'),\n postComment: tr('healthybowl.tasks.postComment', 'Comment'),\n posting: tr('healthybowl.tasks.posting', 'Posting…'),\n noComments: tr('healthybowl.tasks.noComments', 'No comments yet'),\n you: tr('healthybowl.tasks.you', 'You'),\n editedTag: tr('healthybowl.tasks.editedTag', '(edited)'),\n failedToComment: tr('healthybowl.tasks.failedToComment', 'Failed to post comment'),\n failedToDeleteComment: tr('healthybowl.tasks.failedToDeleteComment', 'Failed to delete comment'),\n reply: tr('healthybowl.tasks.reply', 'Reply'),\n replyPlaceholder: tr('healthybowl.tasks.replyPlaceholder', 'Write a reply…'),\n repliesCount: tr('healthybowl.tasks.repliesCount', '{n} replies'),\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;EACp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AW;EACxD,iBAAiB,EAAG,qCAAqC,yBAAyB;EAClF,uBAAuB,EAAG,2CAA2C,2BAA2B;EAChG,OAAO,EAAG,2BAA2B,QAAQ;EAC7C,kBAAkB,EAAG,sCAAsC,iBAAiB;EAC5E,cAAc,EAAG,kCAAkC,cAAc;EAGjE,QAAQ;GACN,SAAS,EAAG,oCAAoC,UAAU;GAC1D,MAAM,EAAG,iCAAiC,QAAQ;GAClD,aAAa,EAAG,wCAAwC,cAAc;GACtE,WAAW,EAAG,sCAAsC,YAAY;GAChE,SAAS,EAAG,oCAAoC,UAAU;GAC1D,MAAM,EAAG,iCAAiC,OAAO;GACjD,WAAW,EAAG,sCAAsC,YAAY;GACjE;EACD,UAAU;GACR,MAAM,EAAG,mCAAmC,OAAO;GACnD,KAAK,EAAG,kCAAkC,MAAM;GAChD,QAAQ,EAAG,qCAAqC,SAAS;GACzD,MAAM,EAAG,mCAAmC,OAAO;GACnD,UAAU,EAAG,uCAAuC,WAAW;GAChE;EACD,MAAM;GACJ,MAAM,EAAG,+BAA+B,OAAO;GAC/C,OAAO,EAAG,gCAAgC,QAAQ;GAClD,KAAK,EAAG,8BAA8B,MAAM;GAC5C,MAAM,EAAG,+BAA+B,OAAO;GAC/C,UAAU,EAAG,mCAAmC,WAAW;GAC5D;EACF,GACD,CAAC,EAAG,CACL"}
|
|
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 addMilestone: tr('healthybowl.tasks.addMilestone', 'Add milestone'),\n milestoneNamePlaceholder: tr('healthybowl.tasks.milestoneNamePlaceholder', 'Milestone name'),\n failedToCreateMilestone: tr('healthybowl.tasks.failedToCreateMilestone', 'Failed to create milestone'),\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 // Drag-move confirmation\n moveConfirmTitle: tr('healthybowl.tasks.moveConfirmTitle', 'Move task?'),\n moveConfirmPrompt: tr('healthybowl.tasks.moveConfirmPrompt', 'Move \"{task}\" to {status}?'),\n moveConfirm: tr('healthybowl.tasks.moveConfirm', 'Move'),\n\n // Detail: linked records + metadata\n linkedRecordsLabel: tr('healthybowl.tasks.linkedRecordsLabel', 'Linked records'),\n createdLabel: tr('healthybowl.tasks.createdLabel', 'Created'),\n updatedLabel: tr('healthybowl.tasks.updatedLabel', 'Updated'),\n\n // Sub-issues\n parentLabel: tr('healthybowl.tasks.parentLabel', 'Parent'),\n subtasksLabel: tr('healthybowl.tasks.subtasksLabel', 'Sub-tasks'),\n addSubtask: tr('healthybowl.tasks.addSubtask', 'Add sub-task'),\n\n // Comments + threading + mentions\n commentsLabel: tr('healthybowl.tasks.commentsLabel', 'Comments'),\n commentPlaceholder: tr('healthybowl.tasks.commentPlaceholder', 'Write a comment…'),\n postComment: tr('healthybowl.tasks.postComment', 'Comment'),\n posting: tr('healthybowl.tasks.posting', 'Posting…'),\n noComments: tr('healthybowl.tasks.noComments', 'No comments yet'),\n you: tr('healthybowl.tasks.you', 'You'),\n editedTag: tr('healthybowl.tasks.editedTag', '(edited)'),\n failedToComment: tr('healthybowl.tasks.failedToComment', 'Failed to post comment'),\n failedToDeleteComment: tr('healthybowl.tasks.failedToDeleteComment', 'Failed to delete comment'),\n reply: tr('healthybowl.tasks.reply', 'Reply'),\n replyPlaceholder: tr('healthybowl.tasks.replyPlaceholder', 'Write a reply…'),\n repliesCount: tr('healthybowl.tasks.repliesCount', '{n} replies'),\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;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