@burdenoff/microfe-healthybowl 2026.1120.3 → 2026.1123.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.d.ts +15 -0
- package/dist/healthybowl/components/CreateFarmTaskButton.js +40 -26
- package/dist/healthybowl/components/index.d.ts +2 -2
- package/dist/healthybowl/components/index.js +2 -2
- package/dist/healthybowl/hooks/index.d.ts +4 -0
- package/dist/healthybowl/hooks/useCropBrowse.d.ts +85 -0
- package/dist/healthybowl/hooks/useCropBrowse.js +85 -0
- package/dist/healthybowl/hooks/useCropPage.d.ts +1 -0
- package/dist/healthybowl/hooks/useCropPage.js +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlData.d.ts +2 -0
- package/dist/healthybowl/hooks/useHealthyBowlData.js +1 -0
- package/dist/healthybowl/hooks/usePlantCatalog.d.ts +1 -0
- package/dist/healthybowl/hooks/usePlantCatalog.js +1 -1
- package/dist/healthybowl/hooks/usePlantCatalogBrowse.d.ts +33 -0
- package/dist/healthybowl/hooks/usePlantCatalogBrowse.js +51 -0
- package/dist/healthybowl/pages/HomePage.js +232 -594
- package/dist/healthybowl/pages/catalog/CatalogRows.d.ts +15 -0
- package/dist/healthybowl/pages/catalog/CatalogRows.js +214 -0
- package/dist/healthybowl/pages/catalog/PlantCatalogPage.js +186 -492
- package/dist/healthybowl/pages/catalog/PlantEntryDialog.d.ts +13 -0
- package/dist/healthybowl/pages/catalog/PlantEntryDialog.js +155 -0
- package/dist/healthybowl/pages/catalog/browsePagination.d.ts +9 -0
- package/dist/healthybowl/pages/catalog/browsePagination.js +11 -1
- package/dist/healthybowl/pages/catalog/plantCatalogView.d.ts +62 -0
- package/dist/healthybowl/pages/catalog/plantCatalogView.js +73 -0
- package/dist/healthybowl/pages/catalog/plantEntryForm.d.ts +26 -0
- package/dist/healthybowl/pages/catalog/plantEntryForm.js +56 -0
- package/dist/healthybowl/pages/crops/CropDetailsPage.js +194 -722
- package/dist/healthybowl/pages/crops/CropsPage.js +415 -829
- package/dist/healthybowl/pages/crops/cropDetail/CropActivityLog.d.ts +10 -0
- package/dist/healthybowl/pages/crops/cropDetail/CropActivityLog.js +92 -0
- package/dist/healthybowl/pages/crops/cropDetail/CropAttentionCard.d.ts +16 -0
- package/dist/healthybowl/pages/crops/cropDetail/CropAttentionCard.js +190 -0
- package/dist/healthybowl/pages/crops/cropDetail/CropCard.d.ts +21 -0
- package/dist/healthybowl/pages/crops/cropDetail/CropCard.js +31 -0
- package/dist/healthybowl/pages/crops/cropDetail/CropEditModal.d.ts +20 -0
- package/dist/healthybowl/pages/crops/cropDetail/CropEditModal.js +120 -0
- package/dist/healthybowl/pages/crops/cropDetail/CropHeader.d.ts +17 -0
- package/dist/healthybowl/pages/crops/cropDetail/CropHeader.js +182 -0
- package/dist/healthybowl/pages/crops/cropDetail/CropHealthChart.d.ts +13 -0
- package/dist/healthybowl/pages/crops/cropDetail/CropHealthChart.js +168 -0
- package/dist/healthybowl/pages/crops/cropDetail/CropNumbers.d.ts +14 -0
- package/dist/healthybowl/pages/crops/cropDetail/CropNumbers.js +79 -0
- package/dist/healthybowl/pages/crops/cropDetail/CropSeasonStrip.d.ts +10 -0
- package/dist/healthybowl/pages/crops/cropDetail/CropSeasonStrip.js +80 -0
- package/dist/healthybowl/pages/crops/cropDetail/CropSideCards.d.ts +16 -0
- package/dist/healthybowl/pages/crops/cropDetail/CropSideCards.js +160 -0
- package/dist/healthybowl/pages/crops/cropDetail/cropDetailLogic.d.ts +133 -0
- package/dist/healthybowl/pages/crops/cropDetail/cropDetailLogic.js +298 -0
- package/dist/healthybowl/pages/crops/cropDetail/cropText.d.ts +9 -0
- package/dist/healthybowl/pages/crops/cropDetail/cropText.js +28 -0
- package/dist/healthybowl/pages/crops/cropDetail/useCropDetailData.d.ts +21 -0
- package/dist/healthybowl/pages/crops/cropDetail/useCropDetailData.js +53 -0
- package/dist/healthybowl/pages/crops/list/CropCard.d.ts +19 -0
- package/dist/healthybowl/pages/crops/list/CropCard.js +259 -0
- package/dist/healthybowl/pages/crops/list/CropFormDialog.d.ts +27 -0
- package/dist/healthybowl/pages/crops/list/CropFormDialog.js +227 -0
- package/dist/healthybowl/pages/crops/list/cropsLabels.d.ts +15 -0
- package/dist/healthybowl/pages/crops/list/cropsLabels.js +117 -0
- package/dist/healthybowl/pages/crops/list/cropsList.d.ts +89 -0
- package/dist/healthybowl/pages/crops/list/cropsList.js +202 -0
- package/dist/healthybowl/pages/dashboard/AddMenu.d.ts +12 -0
- package/dist/healthybowl/pages/dashboard/AddMenu.js +68 -0
- package/dist/healthybowl/pages/dashboard/AttentionCard.d.ts +17 -0
- package/dist/healthybowl/pages/dashboard/AttentionCard.js +119 -0
- package/dist/healthybowl/pages/dashboard/CropsSection.d.ts +17 -0
- package/dist/healthybowl/pages/dashboard/CropsSection.js +146 -0
- package/dist/healthybowl/pages/dashboard/DashboardParts.d.ts +51 -0
- package/dist/healthybowl/pages/dashboard/DashboardParts.js +100 -0
- package/dist/healthybowl/pages/dashboard/PlanNote.d.ts +12 -0
- package/dist/healthybowl/pages/dashboard/PlanNote.js +50 -0
- package/dist/healthybowl/pages/dashboard/SetupCard.d.ts +13 -0
- package/dist/healthybowl/pages/dashboard/SetupCard.js +97 -0
- package/dist/healthybowl/pages/dashboard/TodayCard.d.ts +20 -0
- package/dist/healthybowl/pages/dashboard/TodayCard.js +94 -0
- package/dist/healthybowl/pages/dashboard/WeekCards.d.ts +45 -0
- package/dist/healthybowl/pages/dashboard/WeekCards.js +286 -0
- package/dist/healthybowl/pages/dashboard/dashboardModel.d.ts +162 -0
- package/dist/healthybowl/pages/dashboard/dashboardModel.js +225 -0
- package/dist/healthybowl/pages/dashboard/useDashboardTasks.d.ts +9 -0
- package/dist/healthybowl/pages/dashboard/useDashboardTasks.js +95 -0
- package/dist/healthybowl/pages/financial/FinancialDashboardPage.d.ts +1 -0
- package/dist/healthybowl/pages/financial/FinancialDashboardPage.js +230 -571
- package/dist/healthybowl/pages/financial/dashboard/FinancialLists.d.ts +19 -0
- package/dist/healthybowl/pages/financial/dashboard/FinancialLists.js +180 -0
- package/dist/healthybowl/pages/financial/dashboard/IncomeCostsChart.d.ts +8 -0
- package/dist/healthybowl/pages/financial/dashboard/IncomeCostsChart.js +163 -0
- package/dist/healthybowl/pages/financial/dashboard/NeedsAttention.d.ts +10 -0
- package/dist/healthybowl/pages/financial/dashboard/NeedsAttention.js +86 -0
- package/dist/healthybowl/pages/financial/dashboard/NumberTiles.d.ts +13 -0
- package/dist/healthybowl/pages/financial/dashboard/NumberTiles.js +56 -0
- package/dist/healthybowl/pages/financial/dashboard/RankedBars.d.ts +13 -0
- package/dist/healthybowl/pages/financial/dashboard/RankedBars.js +86 -0
- package/dist/healthybowl/pages/financial/dashboard/categoryText.d.ts +2 -0
- package/dist/healthybowl/pages/financial/dashboard/categoryText.js +23 -0
- package/dist/healthybowl/pages/financial/dashboard/financialDashboardLogic.d.ts +93 -0
- package/dist/healthybowl/pages/financial/dashboard/financialDashboardLogic.js +150 -0
- package/dist/healthybowl/pages/livestock/AnimalRegistryPage.js +240 -686
- package/dist/healthybowl/pages/livestock/animals/AnimalFormDialogs.d.ts +18 -0
- package/dist/healthybowl/pages/livestock/animals/AnimalFormDialogs.js +407 -0
- package/dist/healthybowl/pages/livestock/animals/AnimalRegistryList.d.ts +22 -0
- package/dist/healthybowl/pages/livestock/animals/AnimalRegistryList.js +175 -0
- package/dist/healthybowl/pages/livestock/animals/animalRegistryModel.d.ts +98 -0
- package/dist/healthybowl/pages/livestock/animals/animalRegistryModel.js +228 -0
- package/dist/healthybowl/pages/livestock/animals/animalText.d.ts +22 -0
- package/dist/healthybowl/pages/livestock/animals/animalText.js +87 -0
- package/dist/healthybowl/pages/weather/WeatherOverviewPage.js +232 -972
- package/dist/healthybowl/pages/weather/overview/AlertCard.d.ts +15 -0
- package/dist/healthybowl/pages/weather/overview/AlertCard.js +109 -0
- package/dist/healthybowl/pages/weather/overview/FarmAdvice.d.ts +19 -0
- package/dist/healthybowl/pages/weather/overview/FarmAdvice.js +146 -0
- package/dist/healthybowl/pages/weather/overview/NowAndWeek.d.ts +18 -0
- package/dist/healthybowl/pages/weather/overview/NowAndWeek.js +146 -0
- package/dist/healthybowl/pages/weather/overview/PlanWorkDialog.d.ts +18 -0
- package/dist/healthybowl/pages/weather/overview/PlanWorkDialog.js +63 -0
- package/dist/healthybowl/pages/weather/overview/QuieterCards.d.ts +47 -0
- package/dist/healthybowl/pages/weather/overview/QuieterCards.js +145 -0
- package/dist/healthybowl/pages/weather/overview/translate.d.ts +2 -0
- package/dist/healthybowl/pages/weather/overview/weatherIcons.d.ts +13 -0
- package/dist/healthybowl/pages/weather/overview/weatherIcons.js +41 -0
- package/dist/healthybowl/pages/weather/overview/weatherOverview.d.ts +123 -0
- package/dist/healthybowl/pages/weather/overview/weatherOverview.js +256 -0
- package/dist/healthybowl/utils/milk.d.ts +5 -0
- package/dist/healthybowl/utils/milk.js +30 -0
- package/dist/healthybowl/utils/monthTotals.d.ts +25 -0
- package/dist/healthybowl/utils/monthTotals.js +37 -0
- package/package.json +2 -2
|
@@ -18,4 +18,19 @@ export interface CreateFarmTaskButtonProps {
|
|
|
18
18
|
className?: string;
|
|
19
19
|
icon?: ReactNode;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Whether this person can create a linked farm task here: there is a workspace connection and
|
|
23
|
+
* they may manage tasks. Read-only members (Viewer/Member) can't, so callers hide the action
|
|
24
|
+
* rather than surface one that would 403 on submit.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useCanCreateFarmTask(): boolean;
|
|
27
|
+
export interface CreateFarmTaskDialogProps {
|
|
28
|
+
entityType: FarmEntityType;
|
|
29
|
+
entityId: string;
|
|
30
|
+
entityLabel: string;
|
|
31
|
+
open: boolean;
|
|
32
|
+
onOpenChange: (open: boolean) => void;
|
|
33
|
+
}
|
|
34
|
+
/** The "Create Farm Task" dialog on its own, for callers that open it from a menu. */
|
|
35
|
+
export declare const CreateFarmTaskDialog: FC<CreateFarmTaskDialogProps>;
|
|
21
36
|
export declare const CreateFarmTaskButton: FC<CreateFarmTaskButtonProps>;
|
|
@@ -18,36 +18,50 @@ var v = m`
|
|
|
18
18
|
id
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
className: "size-4",
|
|
32
|
-
"aria-hidden": "true"
|
|
33
|
-
}), !g && o]
|
|
34
|
-
}), /* @__PURE__ */ d(t, {
|
|
35
|
-
open: T,
|
|
36
|
-
onClose: () => E(!1),
|
|
21
|
+
`;
|
|
22
|
+
function y() {
|
|
23
|
+
let e = _("workspace"), { workspaceId: t } = n(), { canManage: r } = i(t);
|
|
24
|
+
return !!e && r;
|
|
25
|
+
}
|
|
26
|
+
var b = ({ entityType: e, entityId: n, entityLabel: r, open: i, onOpenChange: a }) => {
|
|
27
|
+
let o = _("workspace");
|
|
28
|
+
return o ? /* @__PURE__ */ d(t, {
|
|
29
|
+
open: i,
|
|
30
|
+
onClose: () => a(!1),
|
|
37
31
|
title: "Create Farm Task",
|
|
38
|
-
description: `Create a task linked to ${
|
|
32
|
+
description: `Create a task linked to ${r}.`,
|
|
39
33
|
children: /* @__PURE__ */ d(h, {
|
|
40
|
-
client:
|
|
41
|
-
children: /* @__PURE__ */ d(
|
|
42
|
-
client:
|
|
34
|
+
client: o,
|
|
35
|
+
children: /* @__PURE__ */ d(S, {
|
|
36
|
+
client: o,
|
|
43
37
|
entityType: e,
|
|
44
|
-
entityId:
|
|
45
|
-
entityLabel:
|
|
46
|
-
onDone: () =>
|
|
38
|
+
entityId: n,
|
|
39
|
+
entityLabel: r,
|
|
40
|
+
onDone: () => a(!1)
|
|
47
41
|
})
|
|
48
42
|
})
|
|
49
|
-
})
|
|
50
|
-
},
|
|
43
|
+
}) : null;
|
|
44
|
+
}, x = ({ entityType: e, entityId: t, entityLabel: n, label: r = "Create Task", variant: i = "outline", size: a, iconOnly: o, title: s, className: m, icon: h }) => {
|
|
45
|
+
let g = y(), [_, v] = c(!1);
|
|
46
|
+
return g ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f(p, {
|
|
47
|
+
variant: i,
|
|
48
|
+
size: a,
|
|
49
|
+
onClick: () => v(!0),
|
|
50
|
+
className: m,
|
|
51
|
+
title: s ?? (o ? r : void 0),
|
|
52
|
+
"aria-label": o ? s ?? r : void 0,
|
|
53
|
+
children: [h ?? /* @__PURE__ */ d(l, {
|
|
54
|
+
className: "size-4",
|
|
55
|
+
"aria-hidden": "true"
|
|
56
|
+
}), !o && r]
|
|
57
|
+
}), /* @__PURE__ */ d(b, {
|
|
58
|
+
entityType: e,
|
|
59
|
+
entityId: t,
|
|
60
|
+
entityLabel: n,
|
|
61
|
+
open: _,
|
|
62
|
+
onOpenChange: v
|
|
63
|
+
})] }) : null;
|
|
64
|
+
}, S = ({ client: t, entityType: i, entityId: c, entityLabel: l, onDone: u }) => {
|
|
51
65
|
let { workspaceId: p, currentUser: m } = n(), { projectId: h, loading: _, error: y, ensureProject: b } = r(t, p, m?.id);
|
|
52
66
|
s(() => {
|
|
53
67
|
b();
|
|
@@ -103,4 +117,4 @@ var v = m`
|
|
|
103
117
|
onCancel: u
|
|
104
118
|
});
|
|
105
119
|
};
|
|
106
|
-
export {
|
|
120
|
+
export { x as CreateFarmTaskButton, b as CreateFarmTaskDialog, y as useCanCreateFarmTask };
|
|
@@ -33,7 +33,7 @@ export { WeatherMap } from './WeatherMap';
|
|
|
33
33
|
export { FieldMap } from './FieldMap';
|
|
34
34
|
export { DeliveryRouteMap } from './DeliveryRouteMap';
|
|
35
35
|
export type { DeliveryRouteMapStop } from './DeliveryRouteMap';
|
|
36
|
-
export { CreateFarmTaskButton } from './CreateFarmTaskButton';
|
|
37
|
-
export type { FarmEntityType, CreateFarmTaskButtonProps } from './CreateFarmTaskButton';
|
|
36
|
+
export { CreateFarmTaskButton, CreateFarmTaskDialog, useCanCreateFarmTask } from './CreateFarmTaskButton';
|
|
37
|
+
export type { FarmEntityType, CreateFarmTaskButtonProps, CreateFarmTaskDialogProps } from './CreateFarmTaskButton';
|
|
38
38
|
export { AIAssistantPanel } from '../../components/assistant';
|
|
39
39
|
export type { AIAssistantPanelProps } from '../../components/assistant';
|
|
@@ -24,7 +24,7 @@ import { PlatformActivityLog as g } from "./PlatformActivityLog.js";
|
|
|
24
24
|
import { WeatherMap as _ } from "./WeatherMap.js";
|
|
25
25
|
import { FieldMap as v } from "./FieldMap.js";
|
|
26
26
|
import { DeliveryRouteMap as y } from "./DeliveryRouteMap.js";
|
|
27
|
-
import { CreateFarmTaskButton as b } from "./CreateFarmTaskButton.js";
|
|
27
|
+
import { CreateFarmTaskButton as b, CreateFarmTaskDialog as x, useCanCreateFarmTask as S } from "./CreateFarmTaskButton.js";
|
|
28
28
|
import "../../components/assistant/AIAssistantPanel.js";
|
|
29
29
|
import "../../components/assistant/index.js";
|
|
30
|
-
export { u as Breadcrumbs, o as ChartCard, b as CreateFarmTaskButton, n as DataTable, y as DeliveryRouteMap, i as EmptyState, a as ErrorState, v as FieldMap, s as FilterBar, h as HBEntityImages, m as HBEntityTags, d as LoadingSkeleton, p as MethodNote, e as PageLayout, f as PageLoader, g as PlatformActivityLog, t as StatCard, r as StatusBadge, c as ToastContainer, _ as WeatherMap, l as useConfirm };
|
|
30
|
+
export { u as Breadcrumbs, o as ChartCard, b as CreateFarmTaskButton, x as CreateFarmTaskDialog, n as DataTable, y as DeliveryRouteMap, i as EmptyState, a as ErrorState, v as FieldMap, s as FilterBar, h as HBEntityImages, m as HBEntityTags, d as LoadingSkeleton, p as MethodNote, e as PageLayout, f as PageLoader, g as PlatformActivityLog, t as StatCard, r as StatusBadge, c as ToastContainer, _ as WeatherMap, S as useCanCreateFarmTask, l as useConfirm };
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export { useCropPage, useCropDetail } from './useCropPage';
|
|
5
5
|
export type { CropPageOptions } from './useCropPage';
|
|
6
|
+
export { useCropBrowse } from './useCropBrowse';
|
|
7
|
+
export type { CropBrowseOptions } from './useCropBrowse';
|
|
8
|
+
export { usePlantCatalogBrowse } from './usePlantCatalogBrowse';
|
|
9
|
+
export type { PlantCatalogBrowseOptions } from './usePlantCatalogBrowse';
|
|
6
10
|
export { usePlantCatalog, usePlantCatalogPage, usePlantCatalogEntry, useMatchedPlantCatalogEntry, } from './usePlantCatalog';
|
|
7
11
|
export type { PlantCatalogEntry, PlantCatalogInput, PlantCatalogPageOptions } from './usePlantCatalog';
|
|
8
12
|
export type { OffsetPage, PageReadOptions, ReadState } from './useWorkspaceRead';
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { TypedDocumentNode } from '@apollo/client';
|
|
2
|
+
import { Crop } from '../types';
|
|
3
|
+
import { OffsetPage, PageReadOptions, ReadState, WorkspaceReadContext } from './useWorkspaceRead';
|
|
4
|
+
/** Mirrors the server's HealthyBowlCropStatusGroup: PLANNED = planning, HARVESTED = harvested, GROWING = the rest. */
|
|
5
|
+
export type CropStatusGroup = 'GROWING' | 'PLANNED' | 'HARVESTED';
|
|
6
|
+
/** Mirrors the server's HealthyBowlCropSort. CREATED is the server's default. */
|
|
7
|
+
export type CropSort = 'CREATED' | 'HARVEST_SOONEST' | 'NAME' | 'NEWEST' | 'HEALTH';
|
|
8
|
+
export interface CropBrowseOptions extends PageReadOptions {
|
|
9
|
+
fieldId?: string;
|
|
10
|
+
status?: string;
|
|
11
|
+
growthStage?: string;
|
|
12
|
+
season?: string;
|
|
13
|
+
healthStatus?: string;
|
|
14
|
+
statusGroup?: CropStatusGroup;
|
|
15
|
+
needsAttention?: boolean;
|
|
16
|
+
sort?: CropSort;
|
|
17
|
+
}
|
|
18
|
+
/** Counts under every filter except status, statusGroup and needsAttention (the status chips). */
|
|
19
|
+
export interface CropPageCounts {
|
|
20
|
+
all: number;
|
|
21
|
+
growing: number;
|
|
22
|
+
planned: number;
|
|
23
|
+
harvested: number;
|
|
24
|
+
needsAttention: number;
|
|
25
|
+
}
|
|
26
|
+
export declare const EMPTY_CROP_COUNTS: CropPageCounts;
|
|
27
|
+
/** Crops in one category under every filter except the category ones; `category` is null for none. */
|
|
28
|
+
export interface CropCategoryCount {
|
|
29
|
+
category: string | null;
|
|
30
|
+
count: number;
|
|
31
|
+
}
|
|
32
|
+
/** A total in one unit: expected yield of the growing crops of the whole farm. */
|
|
33
|
+
export interface CropYieldTotal {
|
|
34
|
+
unit: string;
|
|
35
|
+
total: number;
|
|
36
|
+
crops: number;
|
|
37
|
+
}
|
|
38
|
+
/** Whole-workspace summary of the active crops; ignores every filter. */
|
|
39
|
+
export interface CropFarmSummary {
|
|
40
|
+
crops: number;
|
|
41
|
+
plots: number;
|
|
42
|
+
expectedYield: CropYieldTotal[];
|
|
43
|
+
}
|
|
44
|
+
/** What one crop on the page gave at harvest, in one unit (a crop with two units has two rows). */
|
|
45
|
+
export interface CropHarvestTotal {
|
|
46
|
+
cropId: string;
|
|
47
|
+
unit: string;
|
|
48
|
+
quantity: number;
|
|
49
|
+
records: number;
|
|
50
|
+
lastHarvestDate: string;
|
|
51
|
+
}
|
|
52
|
+
export declare const EMPTY_FARM_SUMMARY: CropFarmSummary;
|
|
53
|
+
interface CropBrowseVariables {
|
|
54
|
+
context: WorkspaceReadContext;
|
|
55
|
+
search?: string;
|
|
56
|
+
category?: string;
|
|
57
|
+
uncategorized?: boolean;
|
|
58
|
+
fieldId?: string;
|
|
59
|
+
status?: string;
|
|
60
|
+
growthStage?: string;
|
|
61
|
+
season?: string;
|
|
62
|
+
healthStatus?: string;
|
|
63
|
+
statusGroup?: CropStatusGroup;
|
|
64
|
+
needsAttention?: boolean;
|
|
65
|
+
sort?: CropSort;
|
|
66
|
+
limit: number;
|
|
67
|
+
offset: number;
|
|
68
|
+
}
|
|
69
|
+
interface CropBrowseData {
|
|
70
|
+
getHealthyBowlCropsPage: OffsetPage<Crop> & {
|
|
71
|
+
counts: CropPageCounts;
|
|
72
|
+
categories: CropCategoryCount[];
|
|
73
|
+
farm: CropFarmSummary;
|
|
74
|
+
harvestTotals: CropHarvestTotal[];
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export declare const CROP_BROWSE_QUERY: TypedDocumentNode<CropBrowseData, CropBrowseVariables>;
|
|
78
|
+
export type CropBrowseResult = OffsetPage<Crop> & ReadState & {
|
|
79
|
+
counts: CropPageCounts;
|
|
80
|
+
categories: CropCategoryCount[];
|
|
81
|
+
farm: CropFarmSummary;
|
|
82
|
+
harvestTotals: CropHarvestTotal[];
|
|
83
|
+
};
|
|
84
|
+
export declare function useCropBrowse(options?: CropBrowseOptions): CropBrowseResult;
|
|
85
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { useHealthyBowl as e } from "../context/HealthyBowlContext.js";
|
|
2
|
+
import { CROP_FIELDS as t } from "./useCropPage.js";
|
|
3
|
+
import { emptyOffsetPage as n, normalizeReadPagination as r, useWorkspaceRead as i } from "./useWorkspaceRead.js";
|
|
4
|
+
import { useMemo as a } from "react";
|
|
5
|
+
import { gql as o } from "@apollo/client";
|
|
6
|
+
// src/healthybowl/hooks/useCropBrowse.ts
|
|
7
|
+
var s = {
|
|
8
|
+
all: 0,
|
|
9
|
+
growing: 0,
|
|
10
|
+
planned: 0,
|
|
11
|
+
harvested: 0,
|
|
12
|
+
needsAttention: 0
|
|
13
|
+
}, c = {
|
|
14
|
+
crops: 0,
|
|
15
|
+
plots: 0,
|
|
16
|
+
expectedYield: []
|
|
17
|
+
}, l = [], u = [], d = o`
|
|
18
|
+
query GetHealthyBowlCropsBrowse(
|
|
19
|
+
$context: ContextInput!, $search: String, $category: String, $uncategorized: Boolean,
|
|
20
|
+
$fieldId: ID, $status: String, $growthStage: String, $season: String, $healthStatus: String,
|
|
21
|
+
$statusGroup: HealthyBowlCropStatusGroup, $needsAttention: Boolean, $sort: HealthyBowlCropSort,
|
|
22
|
+
$limit: Int, $offset: Int
|
|
23
|
+
) {
|
|
24
|
+
getHealthyBowlCropsPage(
|
|
25
|
+
context: $context, search: $search, category: $category, uncategorized: $uncategorized,
|
|
26
|
+
fieldId: $fieldId, status: $status, growthStage: $growthStage, season: $season,
|
|
27
|
+
healthStatus: $healthStatus, statusGroup: $statusGroup, needsAttention: $needsAttention, sort: $sort,
|
|
28
|
+
limit: $limit, offset: $offset
|
|
29
|
+
) {
|
|
30
|
+
items { ${t} }
|
|
31
|
+
total limit offset hasMore nextOffset
|
|
32
|
+
counts { all growing planned harvested needsAttention }
|
|
33
|
+
categories { category count }
|
|
34
|
+
farm { crops plots expectedYield { unit total crops } }
|
|
35
|
+
harvestTotals { cropId unit quantity records lastHarvestDate }
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
function f(t = {}) {
|
|
40
|
+
let { workspaceId: o } = e(), { search: f, category: p, uncategorized: m, fieldId: h, status: g, growthStage: _, season: v, healthStatus: y, statusGroup: b, needsAttention: x, sort: S, skip: C } = t, { limit: w, offset: T } = r(t), E = a(() => ({
|
|
41
|
+
context: { workspaceId: o },
|
|
42
|
+
search: f,
|
|
43
|
+
category: p,
|
|
44
|
+
uncategorized: m,
|
|
45
|
+
fieldId: h,
|
|
46
|
+
status: g,
|
|
47
|
+
growthStage: _,
|
|
48
|
+
season: v,
|
|
49
|
+
healthStatus: y,
|
|
50
|
+
statusGroup: b,
|
|
51
|
+
needsAttention: x,
|
|
52
|
+
sort: S,
|
|
53
|
+
limit: w,
|
|
54
|
+
offset: T
|
|
55
|
+
}), [
|
|
56
|
+
o,
|
|
57
|
+
f,
|
|
58
|
+
p,
|
|
59
|
+
m,
|
|
60
|
+
h,
|
|
61
|
+
g,
|
|
62
|
+
_,
|
|
63
|
+
v,
|
|
64
|
+
y,
|
|
65
|
+
b,
|
|
66
|
+
x,
|
|
67
|
+
S,
|
|
68
|
+
w,
|
|
69
|
+
T
|
|
70
|
+
]), { data: D, loading: O, error: k, refetch: A } = i(d, E, C), j = D?.getHealthyBowlCropsPage;
|
|
71
|
+
return {
|
|
72
|
+
...j ?? n({
|
|
73
|
+
limit: w,
|
|
74
|
+
offset: T
|
|
75
|
+
}),
|
|
76
|
+
counts: j?.counts ?? s,
|
|
77
|
+
categories: j?.categories ?? l,
|
|
78
|
+
farm: j?.farm ?? c,
|
|
79
|
+
harvestTotals: j?.harvestTotals ?? u,
|
|
80
|
+
loading: O,
|
|
81
|
+
error: k,
|
|
82
|
+
refetch: A
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export { d as CROP_BROWSE_QUERY, s as EMPTY_CROP_COUNTS, c as EMPTY_FARM_SUMMARY, f as useCropBrowse };
|
|
@@ -27,6 +27,7 @@ interface CropDetailVariables {
|
|
|
27
27
|
interface CropDetailData {
|
|
28
28
|
getHealthyBowlCrop: Crop | null;
|
|
29
29
|
}
|
|
30
|
+
export declare const CROP_FIELDS = "\n id name variety category season plantingDate expectedHarvestDate field fieldName\n status growthStage healthStatus yieldEstimate yieldUnit yieldEstimateSource yieldEstimateAt\n healthScore healthScoreSource healthScoreAt organicCertified daysToHarvest progress imageIds\n entityTags { id key label color vocabularyKey }\n";
|
|
30
31
|
export declare const CROP_PAGE_QUERY: TypedDocumentNode<CropPageData, CropPageVariables>;
|
|
31
32
|
export declare const CROP_DETAIL_QUERY: TypedDocumentNode<CropDetailData, CropDetailVariables>;
|
|
32
33
|
export declare function useCropPage(options?: CropPageOptions): OffsetPage<Crop> & ReadState;
|
|
@@ -430,6 +430,8 @@ export interface HealthyBowlDataBundle {
|
|
|
430
430
|
traceBatches: TraceBatch[];
|
|
431
431
|
transactions: Transaction[];
|
|
432
432
|
weatherData: WeatherData;
|
|
433
|
+
/** When the server last refreshed the farm's weather (ISO time), or null before the first answer. */
|
|
434
|
+
weatherUpdatedAt: string | null;
|
|
433
435
|
budgets: Budget[];
|
|
434
436
|
governmentSchemes: GovernmentScheme[];
|
|
435
437
|
messages: GovernmentMessage[];
|
|
@@ -1757,6 +1757,7 @@ function dn() {
|
|
|
1757
1757
|
transactions: c(q?.transactions, []),
|
|
1758
1758
|
vaccinations: c(K?.vaccinations, []),
|
|
1759
1759
|
weatherData: l(V?.weather, un),
|
|
1760
|
+
weatherUpdatedAt: typeof V?.updatedAt == "string" ? V.updatedAt : null,
|
|
1760
1761
|
budgets: c(q?.budgets, []),
|
|
1761
1762
|
analyticsReports: c(B?.reports, []),
|
|
1762
1763
|
cropDistributionData: c(B?.cropDistribution, []),
|
|
@@ -34,6 +34,7 @@ export interface PlantCatalogInput {
|
|
|
34
34
|
organicSuitable?: boolean | null;
|
|
35
35
|
notes?: string | null;
|
|
36
36
|
}
|
|
37
|
+
export declare const CATALOG_FIELDS = "\n id\n name\n category\n variety\n plantSpacingCm\n rowSpacingCm\n daysToMaturity\n seedsPerGram\n germinationRate\n seedsPerCell\n organicSuitable\n notes\n";
|
|
37
38
|
interface CatalogQueryVariables {
|
|
38
39
|
context: WorkspaceReadContext;
|
|
39
40
|
}
|
|
@@ -160,4 +160,4 @@ function v(t) {
|
|
|
160
160
|
deleteEntry: S
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
|
-
export { p as PLANT_CATALOG_PAGE_QUERY, _ as useMatchedPlantCatalogEntry, v as usePlantCatalog, g as usePlantCatalogEntry, h as usePlantCatalogPage };
|
|
163
|
+
export { c as CATALOG_FIELDS, p as PLANT_CATALOG_PAGE_QUERY, _ as useMatchedPlantCatalogEntry, v as usePlantCatalog, g as usePlantCatalogEntry, h as usePlantCatalogPage };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { TypedDocumentNode } from '@apollo/client';
|
|
2
|
+
import { PlantCatalogEntry } from './usePlantCatalog';
|
|
3
|
+
import { OffsetPage, PageReadOptions, ReadState, WorkspaceReadContext } from './useWorkspaceRead';
|
|
4
|
+
/** Server sort orders of the catalog page read; the server's default (when omitted) is CREATED. */
|
|
5
|
+
export type PlantCatalogSort = 'CREATED' | 'NAME' | 'CATEGORY' | 'DAYS_TO_MATURITY';
|
|
6
|
+
/** One category with the varieties in it; `category` is null for the varieties with none. */
|
|
7
|
+
export interface PlantCategoryCount {
|
|
8
|
+
category: string | null;
|
|
9
|
+
count: number;
|
|
10
|
+
}
|
|
11
|
+
export interface PlantCatalogBrowseOptions extends PageReadOptions {
|
|
12
|
+
/** Order of the whole catalog (server side). Omitted: the server's default, CREATED. */
|
|
13
|
+
sort?: PlantCatalogSort;
|
|
14
|
+
}
|
|
15
|
+
interface CatalogBrowseVariables {
|
|
16
|
+
context: WorkspaceReadContext;
|
|
17
|
+
search?: string;
|
|
18
|
+
category?: string;
|
|
19
|
+
uncategorized?: boolean;
|
|
20
|
+
limit: number;
|
|
21
|
+
offset: number;
|
|
22
|
+
sort?: PlantCatalogSort;
|
|
23
|
+
}
|
|
24
|
+
interface CatalogBrowseData {
|
|
25
|
+
healthyBowlPlantCatalogPage: OffsetPage<PlantCatalogEntry> & {
|
|
26
|
+
categories: PlantCategoryCount[];
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export declare const PLANT_CATALOG_BROWSE_QUERY: TypedDocumentNode<CatalogBrowseData, CatalogBrowseVariables>;
|
|
30
|
+
export declare function usePlantCatalogBrowse(options?: PlantCatalogBrowseOptions): OffsetPage<PlantCatalogEntry> & ReadState & {
|
|
31
|
+
categories: PlantCategoryCount[];
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useHealthyBowl as e } from "../context/HealthyBowlContext.js";
|
|
2
|
+
import { CATALOG_FIELDS as t } from "./usePlantCatalog.js";
|
|
3
|
+
import { emptyOffsetPage as n, normalizeReadPagination as r, useWorkspaceRead as i } from "./useWorkspaceRead.js";
|
|
4
|
+
import { useMemo as a } from "react";
|
|
5
|
+
import { gql as o } from "@apollo/client";
|
|
6
|
+
// src/healthybowl/hooks/usePlantCatalogBrowse.ts
|
|
7
|
+
var s = [], c = o`
|
|
8
|
+
query HealthyBowlPlantCatalogBrowse(
|
|
9
|
+
$context: ContextInput!, $search: String, $category: String, $uncategorized: Boolean,
|
|
10
|
+
$limit: Int, $offset: Int, $sort: HealthyBowlPlantCatalogSort
|
|
11
|
+
) {
|
|
12
|
+
healthyBowlPlantCatalogPage(
|
|
13
|
+
context: $context, search: $search, category: $category, uncategorized: $uncategorized,
|
|
14
|
+
limit: $limit, offset: $offset, sort: $sort
|
|
15
|
+
) {
|
|
16
|
+
items { ${t} }
|
|
17
|
+
total limit offset hasMore nextOffset
|
|
18
|
+
categories { category count }
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
function l(t = {}) {
|
|
23
|
+
let { workspaceId: o } = e(), { search: l, category: u, uncategorized: d, sort: f, skip: p } = t, { limit: m, offset: h } = r(t), g = a(() => ({
|
|
24
|
+
context: { workspaceId: o },
|
|
25
|
+
search: l,
|
|
26
|
+
category: u,
|
|
27
|
+
uncategorized: d,
|
|
28
|
+
limit: m,
|
|
29
|
+
offset: h,
|
|
30
|
+
sort: f
|
|
31
|
+
}), [
|
|
32
|
+
o,
|
|
33
|
+
l,
|
|
34
|
+
u,
|
|
35
|
+
d,
|
|
36
|
+
m,
|
|
37
|
+
h,
|
|
38
|
+
f
|
|
39
|
+
]), { data: _, loading: v, error: y, refetch: b } = i(c, g, p), x = _?.healthyBowlPlantCatalogPage;
|
|
40
|
+
return {
|
|
41
|
+
...x ?? n({
|
|
42
|
+
limit: m,
|
|
43
|
+
offset: h
|
|
44
|
+
}),
|
|
45
|
+
categories: x?.categories ?? s,
|
|
46
|
+
loading: v,
|
|
47
|
+
error: y,
|
|
48
|
+
refetch: b
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export { c as PLANT_CATALOG_BROWSE_QUERY, l as usePlantCatalogBrowse };
|