@burdenoff/microfe-movethewheels 2026.1117.1 → 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/MoveTheWheelsRoot.js +149 -133
- package/dist/MoveTheWheelsRoutes.js +157 -139
- package/dist/components/EntityConversationsCard.js +145 -0
- package/dist/components/maps/MapCanvas.js +4 -3
- package/dist/events/rybbit.js +87 -0
- package/dist/generated/tracking-quality-operations.d.ts +342 -0
- package/dist/hooks/useEntityComments.js +111 -0
- package/dist/hooks/useFleet.js +394 -311
- package/dist/hooks/useInventory.js +378 -313
- package/dist/hooks/useMultiModalShipments.js +58 -53
- package/dist/hooks/useOrders.js +178 -158
- package/dist/hooks/useRoutes.js +146 -130
- package/dist/index.js +35 -34
- package/dist/movethewheels/components/EntityConversationsCard.d.ts +8 -0
- package/dist/movethewheels/events/rybbit.d.ts +27 -0
- package/dist/movethewheels/hooks/useEntityComments.d.ts +26 -0
- package/dist/movethewheels/hooks/useFleet.d.ts +73 -1
- package/dist/movethewheels/hooks/useInventory.d.ts +19 -0
- package/dist/movethewheels/index.d.ts +1 -0
- package/dist/movethewheels/pages/DocumentsLibraryPage.d.ts +1 -0
- package/dist/movethewheels/pages/NotificationsCenterPage.d.ts +1 -0
- package/dist/movethewheels/types/index.d.ts +95 -2
- package/dist/node_modules/lucide-react/dist/esm/icons/check-check.js +10 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/layers.js +17 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/message-square.js +7 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/send.js +10 -0
- package/dist/pages/DocumentsLibraryPage.js +235 -0
- package/dist/pages/DriverDetailsPage.js +625 -351
- package/dist/pages/NotificationsCenterPage.js +310 -0
- package/dist/pages/OrderDetailsPage.js +48 -42
- package/dist/pages/RouteDetailsPage.js +257 -251
- package/dist/pages/TrackingPage.js +202 -196
- package/dist/pages/VehicleDetailsPage.js +616 -314
- package/dist/pages/WarehouseDetailsPage.js +539 -253
- package/dist/stories/ControlTowerWidgets.stories.d.ts +10 -0
- package/dist/stories/DataTable.stories.d.ts +15 -0
- package/dist/stories/FleetCards.stories.d.ts +9 -0
- package/dist/stories/OrderForms.stories.d.ts +8 -0
- package/dist/stories/RouteMap.stories.d.ts +7 -0
- package/dist/stories/ShipmentTimeline.stories.d.ts +6 -0
- package/package.json +1 -1
- package/src/generated/tracking-quality-operations.ts +407 -0
- package/src/movethewheels/MoveTheWheelsRoot.tsx +16 -0
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +17 -2
- package/src/movethewheels/components/EntityConversationsCard.tsx +143 -0
- package/src/movethewheels/components/maps/MapCanvas.tsx +3 -3
- package/src/movethewheels/events/__tests__/rybbit.test.ts +98 -0
- package/src/movethewheels/events/rybbit.ts +191 -0
- package/src/movethewheels/hooks/useEntityComments.ts +258 -0
- package/src/movethewheels/hooks/useFleet.ts +300 -5
- package/src/movethewheels/hooks/useInventory.ts +231 -3
- package/src/movethewheels/hooks/useMultiModalShipments.ts +8 -1
- package/src/movethewheels/hooks/useOrders.ts +19 -3
- package/src/movethewheels/hooks/useRoutes.ts +14 -2
- package/src/movethewheels/index.ts +1 -0
- package/src/movethewheels/pages/DocumentsLibraryPage.tsx +229 -0
- package/src/movethewheels/pages/DriverDetailsPage.tsx +250 -1
- package/src/movethewheels/pages/NotificationsCenterPage.tsx +331 -0
- package/src/movethewheels/pages/OrderDetailsPage.tsx +8 -0
- package/src/movethewheels/pages/RouteDetailsPage.tsx +6 -0
- package/src/movethewheels/pages/TrackingPage.tsx +8 -0
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +255 -1
- package/src/movethewheels/pages/WarehouseDetailsPage.tsx +266 -2
- package/src/movethewheels/types/index.ts +103 -2
- package/src/stories/ControlTowerWidgets.stories.tsx +150 -0
- package/src/stories/DataTable.stories.tsx +94 -0
- package/src/stories/FleetCards.stories.tsx +77 -0
- package/src/stories/OrderForms.stories.tsx +84 -0
- package/src/stories/RouteMap.stories.tsx +43 -0
- package/src/stories/ShipmentTimeline.stories.tsx +128 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Driver, DriverStatus, FleetFilter, Vehicle, VehicleFuelType, VehicleStatus } from '../types';
|
|
1
|
+
import { Driver, DriverStatus, FleetFilter, Vehicle, VehicleDiagnostics, VehicleFuelType, VehicleStatus } from '../types';
|
|
2
2
|
interface UseFleetOptions {
|
|
3
3
|
filters?: FleetFilter;
|
|
4
4
|
limit?: number;
|
|
@@ -84,6 +84,29 @@ export interface ApiVehicle {
|
|
|
84
84
|
lastServiceDate?: string | null;
|
|
85
85
|
nextServiceDueDate?: string | null;
|
|
86
86
|
nextServiceDueMileage?: number | null;
|
|
87
|
+
diagnostics?: VehicleDiagnostics | null;
|
|
88
|
+
maintenanceLogs?: Array<{
|
|
89
|
+
id: string;
|
|
90
|
+
vehicleId: string;
|
|
91
|
+
serviceDate: string;
|
|
92
|
+
serviceType: string;
|
|
93
|
+
description: string;
|
|
94
|
+
mileage?: number | null;
|
|
95
|
+
cost?: number | null;
|
|
96
|
+
currency?: string | null;
|
|
97
|
+
vendor?: string | null;
|
|
98
|
+
notes?: string | null;
|
|
99
|
+
createdAt: string;
|
|
100
|
+
}>;
|
|
101
|
+
utilizationSummary?: {
|
|
102
|
+
totalRoutes: number;
|
|
103
|
+
completedRoutes: number;
|
|
104
|
+
activeRoutes: number;
|
|
105
|
+
totalDeliveryJobs: number;
|
|
106
|
+
completedDeliveryJobs: number;
|
|
107
|
+
totalDistanceKm: number;
|
|
108
|
+
utilizationRate?: number | null;
|
|
109
|
+
} | null;
|
|
87
110
|
createdAt: string;
|
|
88
111
|
updatedAt?: string;
|
|
89
112
|
drivers?: Array<{
|
|
@@ -116,6 +139,26 @@ export interface ApiDriver {
|
|
|
116
139
|
onLeaveUntil?: string | null;
|
|
117
140
|
terminatedAt?: string | null;
|
|
118
141
|
terminationReason?: string | null;
|
|
142
|
+
shifts?: Array<{
|
|
143
|
+
id: string;
|
|
144
|
+
driverId: string;
|
|
145
|
+
shiftDate: string;
|
|
146
|
+
startTime: string;
|
|
147
|
+
endTime: string;
|
|
148
|
+
status: string;
|
|
149
|
+
maxHours?: number | null;
|
|
150
|
+
notes?: string | null;
|
|
151
|
+
}>;
|
|
152
|
+
complianceRecords?: Array<{
|
|
153
|
+
id: string;
|
|
154
|
+
driverId: string;
|
|
155
|
+
recordType: string;
|
|
156
|
+
status: string;
|
|
157
|
+
issuedAt?: string | null;
|
|
158
|
+
expiresAt?: string | null;
|
|
159
|
+
referenceNumber?: string | null;
|
|
160
|
+
notes?: string | null;
|
|
161
|
+
}>;
|
|
119
162
|
createdAt: string;
|
|
120
163
|
}
|
|
121
164
|
/**
|
|
@@ -164,6 +207,17 @@ export declare function useVehicle(vehicleId: string | undefined): {
|
|
|
164
207
|
isLoading: boolean;
|
|
165
208
|
error: Error | null;
|
|
166
209
|
refetch: () => void;
|
|
210
|
+
addMaintenanceLog: (input: {
|
|
211
|
+
serviceDate: string;
|
|
212
|
+
serviceType: string;
|
|
213
|
+
description: string;
|
|
214
|
+
mileage?: number;
|
|
215
|
+
cost?: number;
|
|
216
|
+
currency?: string;
|
|
217
|
+
vendor?: string;
|
|
218
|
+
notes?: string;
|
|
219
|
+
}) => Promise<void>;
|
|
220
|
+
removeMaintenanceLog: (id: string) => Promise<void>;
|
|
167
221
|
};
|
|
168
222
|
interface UseDriversResult {
|
|
169
223
|
drivers: Driver[];
|
|
@@ -193,6 +247,24 @@ export declare function useDriver(driverId: string | undefined): {
|
|
|
193
247
|
isLoading: boolean;
|
|
194
248
|
error: Error | null;
|
|
195
249
|
refetch: () => void;
|
|
250
|
+
addShift: (input: {
|
|
251
|
+
shiftDate: string;
|
|
252
|
+
startTime: string;
|
|
253
|
+
endTime: string;
|
|
254
|
+
status?: string;
|
|
255
|
+
maxHours?: number;
|
|
256
|
+
notes?: string;
|
|
257
|
+
}) => Promise<void>;
|
|
258
|
+
removeShift: (id: string) => Promise<void>;
|
|
259
|
+
addComplianceRecord: (input: {
|
|
260
|
+
recordType: string;
|
|
261
|
+
status?: string;
|
|
262
|
+
issuedAt?: string;
|
|
263
|
+
expiresAt?: string;
|
|
264
|
+
referenceNumber?: string;
|
|
265
|
+
notes?: string;
|
|
266
|
+
}) => Promise<void>;
|
|
267
|
+
removeComplianceRecord: (id: string) => Promise<void>;
|
|
196
268
|
};
|
|
197
269
|
export interface DriverStatusCounts {
|
|
198
270
|
onBreak: number;
|
|
@@ -116,6 +116,25 @@ export declare function useWarehouse(warehouseId: string | undefined): {
|
|
|
116
116
|
error: Error | null;
|
|
117
117
|
refetch: () => undefined;
|
|
118
118
|
reload: () => Promise<void>;
|
|
119
|
+
addZone: (input: {
|
|
120
|
+
code: string;
|
|
121
|
+
name: string;
|
|
122
|
+
zoneType?: string;
|
|
123
|
+
temperatureRange?: string;
|
|
124
|
+
totalCapacity?: number;
|
|
125
|
+
usedCapacity?: number;
|
|
126
|
+
status?: string;
|
|
127
|
+
}) => Promise<void>;
|
|
128
|
+
removeZone: (id: string) => Promise<void>;
|
|
129
|
+
addStaff: (input: {
|
|
130
|
+
name: string;
|
|
131
|
+
role?: string;
|
|
132
|
+
shift?: string;
|
|
133
|
+
status?: string;
|
|
134
|
+
contactEmail?: string;
|
|
135
|
+
contactPhone?: string;
|
|
136
|
+
}) => Promise<void>;
|
|
137
|
+
removeStaff: (id: string) => Promise<void>;
|
|
119
138
|
};
|
|
120
139
|
export interface InventoryStats {
|
|
121
140
|
/** Units physically in the warehouses. */
|
|
@@ -26,6 +26,7 @@ export { MoveTheWheelsRoot } from './MoveTheWheelsRoot';
|
|
|
26
26
|
export type { MoveTheWheelsRootProps, MoveTheWheelsContextValue, Order, OrderItem, OrderStatus, OrderFilter, Customer, CustomerFilter, Vehicle, VehicleType, VehicleStatus, Driver, DriverStatus, Warehouse, Inventory, InventoryFilter, Product, Route, Tracking, Analytics, ServiceProvider, ServiceOffering, Notification, Address, Location, Dimensions, NavItem, FooterItem, User, UserRole, } from './types';
|
|
27
27
|
export { useMoveTheWheels, useMoveTheWheelsNavigate } from './providers/MoveTheWheelsProvider';
|
|
28
28
|
export { useMoveTheWheelsStore } from './store/movethewheelsStore';
|
|
29
|
+
export { MOVETHEWHEELS_RYBBIT_EVENT_ALLOWLIST } from './events/rybbit';
|
|
29
30
|
export * from './services/createSandboxAssistantTransport';
|
|
30
31
|
export * from './hooks';
|
|
31
32
|
export * from './components';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function DocumentsLibraryPage(): import('react').JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function NotificationsCenterPage(): import('react').JSX.Element;
|
|
@@ -264,6 +264,36 @@ export interface VehicleDocument {
|
|
|
264
264
|
expiryDate: Date;
|
|
265
265
|
verified: boolean;
|
|
266
266
|
}
|
|
267
|
+
export interface VehicleDiagnostics {
|
|
268
|
+
engineStatus?: string;
|
|
269
|
+
batteryVoltage?: number;
|
|
270
|
+
coolantTempC?: number;
|
|
271
|
+
oilPressureKpa?: number;
|
|
272
|
+
faultCodes?: string[];
|
|
273
|
+
lastDiagnosticAt?: string;
|
|
274
|
+
}
|
|
275
|
+
export interface VehicleMaintenanceLog {
|
|
276
|
+
id: string;
|
|
277
|
+
vehicleId: string;
|
|
278
|
+
serviceDate: Date;
|
|
279
|
+
serviceType: string;
|
|
280
|
+
description: string;
|
|
281
|
+
mileage?: number;
|
|
282
|
+
cost?: number;
|
|
283
|
+
currency?: string;
|
|
284
|
+
vendor?: string;
|
|
285
|
+
notes?: string;
|
|
286
|
+
createdAt: Date;
|
|
287
|
+
}
|
|
288
|
+
export interface VehicleUtilizationSummary {
|
|
289
|
+
totalRoutes: number;
|
|
290
|
+
completedRoutes: number;
|
|
291
|
+
activeRoutes: number;
|
|
292
|
+
totalDeliveryJobs: number;
|
|
293
|
+
completedDeliveryJobs: number;
|
|
294
|
+
totalDistanceKm: number;
|
|
295
|
+
utilizationRate?: number;
|
|
296
|
+
}
|
|
267
297
|
export interface Vehicle {
|
|
268
298
|
id: string;
|
|
269
299
|
vehicleNumber: string;
|
|
@@ -293,7 +323,11 @@ export interface Vehicle {
|
|
|
293
323
|
fuelEfficiencyLPer100Km?: number;
|
|
294
324
|
fuelLevel?: number;
|
|
295
325
|
mileage?: number;
|
|
296
|
-
|
|
326
|
+
diagnostics?: VehicleDiagnostics;
|
|
327
|
+
maintenanceLogs?: VehicleMaintenanceLog[];
|
|
328
|
+
utilizationSummary?: VehicleUtilizationSummary;
|
|
329
|
+
/** Documents live in wspace-files-svc and are loaded via DocumentsCard. */
|
|
330
|
+
documents?: VehicleDocument[];
|
|
297
331
|
createdAt: Date;
|
|
298
332
|
}
|
|
299
333
|
export type DriverStatus = 'available' | 'busy' | 'offline' | 'on_break' | 'inactive';
|
|
@@ -304,6 +338,26 @@ export interface DriverDocument {
|
|
|
304
338
|
expiryDate: Date;
|
|
305
339
|
verified: boolean;
|
|
306
340
|
}
|
|
341
|
+
export interface DriverShift {
|
|
342
|
+
id: string;
|
|
343
|
+
driverId: string;
|
|
344
|
+
shiftDate: Date;
|
|
345
|
+
startTime: string;
|
|
346
|
+
endTime: string;
|
|
347
|
+
status: string;
|
|
348
|
+
maxHours?: number;
|
|
349
|
+
notes?: string;
|
|
350
|
+
}
|
|
351
|
+
export interface DriverComplianceRecord {
|
|
352
|
+
id: string;
|
|
353
|
+
driverId: string;
|
|
354
|
+
recordType: string;
|
|
355
|
+
status: string;
|
|
356
|
+
issuedAt?: Date;
|
|
357
|
+
expiresAt?: Date;
|
|
358
|
+
referenceNumber?: string;
|
|
359
|
+
notes?: string;
|
|
360
|
+
}
|
|
307
361
|
export interface Driver {
|
|
308
362
|
id: string;
|
|
309
363
|
userId: string;
|
|
@@ -331,9 +385,45 @@ export interface Driver {
|
|
|
331
385
|
onLeaveUntil?: Date;
|
|
332
386
|
terminatedAt?: Date;
|
|
333
387
|
terminationReason?: string;
|
|
334
|
-
|
|
388
|
+
shifts?: DriverShift[];
|
|
389
|
+
complianceRecords?: DriverComplianceRecord[];
|
|
390
|
+
/** Documents live in wspace-files-svc and are loaded via DocumentsCard. */
|
|
391
|
+
documents?: DriverDocument[];
|
|
335
392
|
createdAt: Date;
|
|
336
393
|
}
|
|
394
|
+
export interface WarehouseZone {
|
|
395
|
+
id: string;
|
|
396
|
+
warehouseId: string;
|
|
397
|
+
code: string;
|
|
398
|
+
name: string;
|
|
399
|
+
zoneType: string;
|
|
400
|
+
temperatureRange?: string;
|
|
401
|
+
totalCapacity?: number;
|
|
402
|
+
usedCapacity?: number;
|
|
403
|
+
status: string;
|
|
404
|
+
}
|
|
405
|
+
export interface WarehouseStaffMember {
|
|
406
|
+
id: string;
|
|
407
|
+
warehouseId: string;
|
|
408
|
+
userId?: string;
|
|
409
|
+
name: string;
|
|
410
|
+
role: string;
|
|
411
|
+
shift?: string;
|
|
412
|
+
status: string;
|
|
413
|
+
contactEmail?: string;
|
|
414
|
+
contactPhone?: string;
|
|
415
|
+
}
|
|
416
|
+
export interface WarehouseMetrics {
|
|
417
|
+
totalLocations: number;
|
|
418
|
+
activeLocations: number;
|
|
419
|
+
zoneCount: number;
|
|
420
|
+
staffCount: number;
|
|
421
|
+
totalSkus: number;
|
|
422
|
+
totalOnHand: number;
|
|
423
|
+
totalAvailable: number;
|
|
424
|
+
lowStockCount: number;
|
|
425
|
+
utilizationPercent?: number;
|
|
426
|
+
}
|
|
337
427
|
export interface Warehouse {
|
|
338
428
|
id: string;
|
|
339
429
|
name: string;
|
|
@@ -356,6 +446,9 @@ export interface Warehouse {
|
|
|
356
446
|
};
|
|
357
447
|
/** Real computed value: usedSpace / totalSpace, when both values are available. */
|
|
358
448
|
utilization?: number;
|
|
449
|
+
zones?: WarehouseZone[];
|
|
450
|
+
staff?: WarehouseStaffMember[];
|
|
451
|
+
metrics?: WarehouseMetrics;
|
|
359
452
|
createdAt: Date;
|
|
360
453
|
}
|
|
361
454
|
export interface InventoryMovement {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import e from "../createLucideIcon.js";
|
|
2
|
+
// node_modules/lucide-react/dist/esm/icons/check-check.js
|
|
3
|
+
var t = e("CheckCheck", [["path", {
|
|
4
|
+
d: "M18 6 7 17l-5-5",
|
|
5
|
+
key: "116fxf"
|
|
6
|
+
}], ["path", {
|
|
7
|
+
d: "m22 10-7.5 7.5L13 16",
|
|
8
|
+
key: "ke71qq"
|
|
9
|
+
}]]);
|
|
10
|
+
export { t as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import e from "../createLucideIcon.js";
|
|
2
|
+
// node_modules/lucide-react/dist/esm/icons/layers.js
|
|
3
|
+
var t = e("Layers", [
|
|
4
|
+
["path", {
|
|
5
|
+
d: "M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",
|
|
6
|
+
key: "zw3jo"
|
|
7
|
+
}],
|
|
8
|
+
["path", {
|
|
9
|
+
d: "M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",
|
|
10
|
+
key: "1wduqc"
|
|
11
|
+
}],
|
|
12
|
+
["path", {
|
|
13
|
+
d: "M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",
|
|
14
|
+
key: "kqbvx6"
|
|
15
|
+
}]
|
|
16
|
+
]);
|
|
17
|
+
export { t as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import e from "../createLucideIcon.js";
|
|
2
|
+
// node_modules/lucide-react/dist/esm/icons/send.js
|
|
3
|
+
var t = e("Send", [["path", {
|
|
4
|
+
d: "M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",
|
|
5
|
+
key: "1ffxy3"
|
|
6
|
+
}], ["path", {
|
|
7
|
+
d: "m21.854 2.147-10.94 10.939",
|
|
8
|
+
key: "12cjpa"
|
|
9
|
+
}]]);
|
|
10
|
+
export { t as default };
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import e from "../node_modules/lucide-react/dist/esm/icons/download.js";
|
|
2
|
+
import t from "../node_modules/lucide-react/dist/esm/icons/external-link.js";
|
|
3
|
+
import n from "../node_modules/lucide-react/dist/esm/icons/file-text.js";
|
|
4
|
+
import r from "../node_modules/lucide-react/dist/esm/icons/search.js";
|
|
5
|
+
import i from "../node_modules/lucide-react/dist/esm/icons/upload.js";
|
|
6
|
+
import { PageLayout as a } from "../components/PageLayout.js";
|
|
7
|
+
import { Badge as o, Button as s, Card as c, CardContent as l, CardHeader as u, CardTitle as d, Input as f } from "../components/ui.js";
|
|
8
|
+
import { useMoveTheWheels as p } from "../providers/MoveTheWheelsProvider.js";
|
|
9
|
+
import { executeGraphQL as m } from "../utils/graphqlClient.js";
|
|
10
|
+
import { formatDate as h } from "../utils/formatters.js";
|
|
11
|
+
import { useCallback as g, useEffect as _, useMemo as v, useState as y } from "react";
|
|
12
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
13
|
+
// src/movethewheels/pages/DocumentsLibraryPage.tsx
|
|
14
|
+
var S = [
|
|
15
|
+
{
|
|
16
|
+
id: "all",
|
|
17
|
+
label: "All documents"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: "order",
|
|
21
|
+
label: "Orders"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: "shipment",
|
|
25
|
+
label: "Shipments"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "vehicle",
|
|
29
|
+
label: "Vehicles"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: "driver",
|
|
33
|
+
label: "Drivers"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: "route",
|
|
37
|
+
label: "Routes"
|
|
38
|
+
}
|
|
39
|
+
], C = "\n query ListMoveTheWheelsDocuments($filter: FileFilterInput, $pagination: PaginationInput) {\n getFiles(filter: $filter, pagination: $pagination) {\n files {\n id\n name\n size\n mimeType\n createdAt\n downloadUrl\n }\n hasMore\n }\n }\n";
|
|
40
|
+
function w(e) {
|
|
41
|
+
if (!Number.isFinite(e) || e <= 0) return "—";
|
|
42
|
+
let t = [
|
|
43
|
+
"B",
|
|
44
|
+
"KB",
|
|
45
|
+
"MB",
|
|
46
|
+
"GB"
|
|
47
|
+
], n = e, r = 0;
|
|
48
|
+
for (; n >= 1024 && r < t.length - 1;) n /= 1024, r += 1;
|
|
49
|
+
return `${n.toFixed(n >= 10 || r === 0 ? 0 : 1)} ${t[r]}`;
|
|
50
|
+
}
|
|
51
|
+
function T() {
|
|
52
|
+
let { apiGatewayUrl: T, authToken: E, workspaceToken: D, workspaceId: O, tenantId: k, currentUser: A, navigate: j } = p(), [M, N] = y("all"), [P, F] = y(""), [I, L] = y([]), [R, z] = y(!1), [B, V] = y(null), H = v(() => ({
|
|
53
|
+
apiGatewayUrl: T,
|
|
54
|
+
authToken: E,
|
|
55
|
+
workspaceToken: D,
|
|
56
|
+
workspaceId: O,
|
|
57
|
+
tenantId: k,
|
|
58
|
+
actorId: A?.id
|
|
59
|
+
}), [
|
|
60
|
+
T,
|
|
61
|
+
E,
|
|
62
|
+
D,
|
|
63
|
+
O,
|
|
64
|
+
k,
|
|
65
|
+
A?.id
|
|
66
|
+
]), U = g(async () => {
|
|
67
|
+
z(!0), V(null);
|
|
68
|
+
try {
|
|
69
|
+
let e = {};
|
|
70
|
+
M !== "all" && (e.tags = [{
|
|
71
|
+
key: "mtwEntityType",
|
|
72
|
+
label: M
|
|
73
|
+
}]), P.trim() && (e.search = P.trim());
|
|
74
|
+
let t = await m(H, C, {
|
|
75
|
+
filter: Object.keys(e).length > 0 ? e : void 0,
|
|
76
|
+
pagination: {
|
|
77
|
+
limit: 50,
|
|
78
|
+
offset: 0
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
L((t.getFiles?.files ?? []).map((e) => ({
|
|
82
|
+
id: e.id,
|
|
83
|
+
name: e.name,
|
|
84
|
+
size: e.size == null ? 0 : Number(e.size),
|
|
85
|
+
mimeType: e.mimeType,
|
|
86
|
+
createdAt: new Date(e.createdAt),
|
|
87
|
+
downloadUrl: e.downloadUrl ?? void 0
|
|
88
|
+
})));
|
|
89
|
+
} catch (e) {
|
|
90
|
+
V(e instanceof Error ? e.message : "Failed to load workspace documents."), L([]);
|
|
91
|
+
} finally {
|
|
92
|
+
z(!1);
|
|
93
|
+
}
|
|
94
|
+
}, [
|
|
95
|
+
H,
|
|
96
|
+
M,
|
|
97
|
+
P
|
|
98
|
+
]);
|
|
99
|
+
return _(() => {
|
|
100
|
+
U();
|
|
101
|
+
}, [U]), /* @__PURE__ */ b(a, {
|
|
102
|
+
title: "Documents",
|
|
103
|
+
subtitle: "BOLs, ePODs, customs paperwork, compliance certificates, and fleet files",
|
|
104
|
+
icon: /* @__PURE__ */ b(n, { size: 24 }),
|
|
105
|
+
headerActions: /* @__PURE__ */ x(s, {
|
|
106
|
+
onClick: () => j("/files/browse"),
|
|
107
|
+
children: [/* @__PURE__ */ b(i, {
|
|
108
|
+
size: 16,
|
|
109
|
+
"aria-hidden": "true"
|
|
110
|
+
}), " Manage in Files"]
|
|
111
|
+
}),
|
|
112
|
+
children: /* @__PURE__ */ x("div", {
|
|
113
|
+
className: "space-y-6",
|
|
114
|
+
children: [/* @__PURE__ */ x("div", {
|
|
115
|
+
className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
|
|
116
|
+
children: [/* @__PURE__ */ b("div", {
|
|
117
|
+
className: "flex flex-wrap gap-2",
|
|
118
|
+
role: "tablist",
|
|
119
|
+
"aria-label": "Document scope",
|
|
120
|
+
children: S.map((e) => /* @__PURE__ */ b(s, {
|
|
121
|
+
type: "button",
|
|
122
|
+
role: "tab",
|
|
123
|
+
"aria-selected": M === e.id,
|
|
124
|
+
variant: M === e.id ? "default" : "outline",
|
|
125
|
+
size: "sm",
|
|
126
|
+
onClick: () => N(e.id),
|
|
127
|
+
children: e.label
|
|
128
|
+
}, e.id))
|
|
129
|
+
}), /* @__PURE__ */ x("div", {
|
|
130
|
+
className: "relative w-full sm:w-64",
|
|
131
|
+
children: [/* @__PURE__ */ b(r, {
|
|
132
|
+
size: 15,
|
|
133
|
+
"aria-hidden": "true",
|
|
134
|
+
className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
|
|
135
|
+
}), /* @__PURE__ */ b(f, {
|
|
136
|
+
value: P,
|
|
137
|
+
onChange: (e) => F(e.target.value),
|
|
138
|
+
placeholder: "Search files...",
|
|
139
|
+
className: "pl-9",
|
|
140
|
+
"aria-label": "Search documents"
|
|
141
|
+
})]
|
|
142
|
+
})]
|
|
143
|
+
}), /* @__PURE__ */ x(c, { children: [/* @__PURE__ */ x(u, {
|
|
144
|
+
className: "flex flex-row items-center justify-between",
|
|
145
|
+
children: [/* @__PURE__ */ x(d, {
|
|
146
|
+
className: "flex items-center gap-2",
|
|
147
|
+
children: [
|
|
148
|
+
/* @__PURE__ */ b(n, {
|
|
149
|
+
size: 18,
|
|
150
|
+
"aria-hidden": "true"
|
|
151
|
+
}),
|
|
152
|
+
"Workspace Documents",
|
|
153
|
+
/* @__PURE__ */ b(o, {
|
|
154
|
+
variant: "secondary",
|
|
155
|
+
children: I.length
|
|
156
|
+
})
|
|
157
|
+
]
|
|
158
|
+
}), /* @__PURE__ */ b(s, {
|
|
159
|
+
variant: "outline",
|
|
160
|
+
size: "sm",
|
|
161
|
+
onClick: () => void U(),
|
|
162
|
+
disabled: R,
|
|
163
|
+
children: "Refresh"
|
|
164
|
+
})]
|
|
165
|
+
}), /* @__PURE__ */ x(l, { children: [B && /* @__PURE__ */ b("p", {
|
|
166
|
+
className: "text-sm text-status-error-text mb-3",
|
|
167
|
+
children: B
|
|
168
|
+
}), R ? /* @__PURE__ */ b("p", {
|
|
169
|
+
className: "text-sm text-text-secondary py-6 text-center",
|
|
170
|
+
children: "Loading documents…"
|
|
171
|
+
}) : I.length === 0 ? /* @__PURE__ */ x("div", {
|
|
172
|
+
className: "py-10 text-center space-y-2",
|
|
173
|
+
children: [
|
|
174
|
+
/* @__PURE__ */ b(n, {
|
|
175
|
+
size: 32,
|
|
176
|
+
className: "mx-auto text-text-secondary opacity-50"
|
|
177
|
+
}),
|
|
178
|
+
/* @__PURE__ */ b("p", {
|
|
179
|
+
className: "text-sm text-text-secondary",
|
|
180
|
+
children: "No documents found for this workspace filter."
|
|
181
|
+
}),
|
|
182
|
+
/* @__PURE__ */ x(s, {
|
|
183
|
+
variant: "outline",
|
|
184
|
+
size: "sm",
|
|
185
|
+
onClick: () => j("/files/browse"),
|
|
186
|
+
children: [/* @__PURE__ */ b(t, {
|
|
187
|
+
size: 14,
|
|
188
|
+
"aria-hidden": "true"
|
|
189
|
+
}), " Upload in Files"]
|
|
190
|
+
})
|
|
191
|
+
]
|
|
192
|
+
}) : /* @__PURE__ */ b("ul", {
|
|
193
|
+
className: "divide-y divide-border-seam",
|
|
194
|
+
children: I.map((n) => /* @__PURE__ */ x("li", {
|
|
195
|
+
className: "flex items-center justify-between gap-4 py-3",
|
|
196
|
+
children: [/* @__PURE__ */ x("div", {
|
|
197
|
+
className: "min-w-0",
|
|
198
|
+
children: [/* @__PURE__ */ b("p", {
|
|
199
|
+
className: "font-medium text-text-primary truncate",
|
|
200
|
+
children: n.name
|
|
201
|
+
}), /* @__PURE__ */ x("p", {
|
|
202
|
+
className: "text-xs text-text-secondary",
|
|
203
|
+
children: [
|
|
204
|
+
n.mimeType,
|
|
205
|
+
" · ",
|
|
206
|
+
w(n.size),
|
|
207
|
+
" ·",
|
|
208
|
+
" ",
|
|
209
|
+
h(n.createdAt, "relative")
|
|
210
|
+
]
|
|
211
|
+
})]
|
|
212
|
+
}), n.downloadUrl ? /* @__PURE__ */ x("a", {
|
|
213
|
+
href: n.downloadUrl,
|
|
214
|
+
target: "_blank",
|
|
215
|
+
rel: "noopener noreferrer",
|
|
216
|
+
className: "inline-flex items-center gap-1 text-sm text-primary hover:underline shrink-0",
|
|
217
|
+
children: [/* @__PURE__ */ b(e, {
|
|
218
|
+
size: 14,
|
|
219
|
+
"aria-hidden": "true"
|
|
220
|
+
}), " Open"]
|
|
221
|
+
}) : /* @__PURE__ */ x(s, {
|
|
222
|
+
variant: "ghost",
|
|
223
|
+
size: "sm",
|
|
224
|
+
onClick: () => j("/files/browse"),
|
|
225
|
+
children: [/* @__PURE__ */ b(t, {
|
|
226
|
+
size: 14,
|
|
227
|
+
"aria-hidden": "true"
|
|
228
|
+
}), " View"]
|
|
229
|
+
})]
|
|
230
|
+
}, n.id))
|
|
231
|
+
})] })] })]
|
|
232
|
+
})
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
export { T as default };
|