@burdenoff/microfe-movethewheels 2026.725.1 → 2026.726.1
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.
|
@@ -2,7 +2,7 @@ import { useMoveTheWheels as e } from "../providers/MoveTheWheelsProvider.js";
|
|
|
2
2
|
import { executeGraphQL as t } from "../utils/graphqlClient.js";
|
|
3
3
|
import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
|
|
4
4
|
//#region src/movethewheels/hooks/useEntityDocuments.ts
|
|
5
|
-
var o = "\n query ListEntityDocuments($filter: FileFilterInput, $pagination: PaginationInput) {\n
|
|
5
|
+
var o = "\n query ListEntityDocuments($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 }\n }\n";
|
|
6
6
|
function s(e) {
|
|
7
7
|
return {
|
|
8
8
|
id: e.id,
|
|
@@ -38,16 +38,16 @@ function c(c, l) {
|
|
|
38
38
|
_(((await t(S, o, {
|
|
39
39
|
filter: { tags: [{
|
|
40
40
|
key: "mtwEntityType",
|
|
41
|
-
|
|
41
|
+
label: c
|
|
42
42
|
}, {
|
|
43
43
|
key: "mtwEntityId",
|
|
44
|
-
|
|
44
|
+
label: l
|
|
45
45
|
}] },
|
|
46
46
|
pagination: {
|
|
47
47
|
limit: 50,
|
|
48
48
|
offset: 0
|
|
49
49
|
}
|
|
50
|
-
})).files ?? []).map(s));
|
|
50
|
+
})).getFiles?.files ?? []).map(s));
|
|
51
51
|
} catch (e) {
|
|
52
52
|
x(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load documents")), _([]);
|
|
53
53
|
} finally {
|
|
@@ -5,10 +5,26 @@
|
|
|
5
5
|
* driver or order live in the platform Files module (wspace-files-svc), which
|
|
6
6
|
* federates into the same workspace gateway. We tag each uploaded file with two
|
|
7
7
|
* marqueue entity tags — `mtwEntityType` and `mtwEntityId` — and list them back
|
|
8
|
-
* here through
|
|
8
|
+
* here through `getFiles(filter:{ tags:[...] })`.
|
|
9
9
|
*
|
|
10
10
|
* There is no upload UI here (out of scope): uploading/managing happens in the
|
|
11
11
|
* Files module, deep-linked from DocumentsCard. This hook is read-only.
|
|
12
|
+
*
|
|
13
|
+
* BOFF-3922 fix (2026-07-26): this previously called a non-existent root field
|
|
14
|
+
* `files(...)` — the wspace gateway only exposes `Workspace.files` (nested) and
|
|
15
|
+
* root fields `getFiles`/`searchFiles`/`ownedFiles`/`uploadedFiles`, none named
|
|
16
|
+
* bare `files`. Fixed to `getFiles(...): FileList!` (unwrapping `.files`), the
|
|
17
|
+
* root field whose `folderId` arg is optional so it supports a workspace-wide
|
|
18
|
+
* filter-only lookup. Caught by the new graphql-schema-drift CI guard, which
|
|
19
|
+
* had zero prior coverage on this repo — this bug would otherwise have shipped
|
|
20
|
+
* to prod undetected, same as BOFF-3915/BOFF-4703/BOFF-3529.
|
|
21
|
+
*
|
|
22
|
+
* NOT verified by this fix: whether `TagFilterInput.label` (renamed here from
|
|
23
|
+
* the nonexistent `.value`) actually produces the intended
|
|
24
|
+
* mtwEntityType+mtwEntityId AND-filter semantics against wspace-files-svc's
|
|
25
|
+
* tag-matching resolver — that's a wspace-files-svc/wspace-tags-svc business-
|
|
26
|
+
* logic question outside a schema-shape validator's reach (it operates on
|
|
27
|
+
* runtime variable values, not the query document). Flagged as follow-up.
|
|
12
28
|
*/
|
|
13
29
|
export type EntityDocumentType = 'vehicle' | 'driver' | 'order';
|
|
14
30
|
export interface EntityDocument {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/microfe-movethewheels",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.726.1",
|
|
4
4
|
"description": "Burdenoff MoveTheWheels Microfrontend - Logistics & Supply Chain Management Platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"lint:sanity": "if [ \"${CI:-}\" = \"true\" ]; then bun run lint; else bun run lint -- --cache --cache-location .eslintcache; fi",
|
|
32
32
|
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
|
|
33
33
|
"type:check": "tsc --noEmit",
|
|
34
|
-
"
|
|
34
|
+
"validate:schema-drift": "graphql-schema-drift",
|
|
35
|
+
"sanity": "bun run codegen && bun run validate:schema-drift && bun run lint:sanity && bun run format && bun run type:check && bun run build && bun run build-storybook",
|
|
35
36
|
"storybook": "storybook dev -p 6006",
|
|
36
37
|
"build-storybook": "storybook build",
|
|
37
38
|
"test:storybook": "test-storybook",
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|
|
49
50
|
"@apollo/client": "^4.0.11",
|
|
50
|
-
"@burdenoff/fe-libs": "2026.
|
|
51
|
+
"@burdenoff/fe-libs": "2026.726.1",
|
|
51
52
|
"@react-leaflet/core": "^3.0.0",
|
|
52
53
|
"@tanstack/react-query": "^5.90.16",
|
|
53
54
|
"clsx": "^2.1.1",
|
|
@@ -5,10 +5,26 @@
|
|
|
5
5
|
* driver or order live in the platform Files module (wspace-files-svc), which
|
|
6
6
|
* federates into the same workspace gateway. We tag each uploaded file with two
|
|
7
7
|
* marqueue entity tags — `mtwEntityType` and `mtwEntityId` — and list them back
|
|
8
|
-
* here through
|
|
8
|
+
* here through `getFiles(filter:{ tags:[...] })`.
|
|
9
9
|
*
|
|
10
10
|
* There is no upload UI here (out of scope): uploading/managing happens in the
|
|
11
11
|
* Files module, deep-linked from DocumentsCard. This hook is read-only.
|
|
12
|
+
*
|
|
13
|
+
* BOFF-3922 fix (2026-07-26): this previously called a non-existent root field
|
|
14
|
+
* `files(...)` — the wspace gateway only exposes `Workspace.files` (nested) and
|
|
15
|
+
* root fields `getFiles`/`searchFiles`/`ownedFiles`/`uploadedFiles`, none named
|
|
16
|
+
* bare `files`. Fixed to `getFiles(...): FileList!` (unwrapping `.files`), the
|
|
17
|
+
* root field whose `folderId` arg is optional so it supports a workspace-wide
|
|
18
|
+
* filter-only lookup. Caught by the new graphql-schema-drift CI guard, which
|
|
19
|
+
* had zero prior coverage on this repo — this bug would otherwise have shipped
|
|
20
|
+
* to prod undetected, same as BOFF-3915/BOFF-4703/BOFF-3529.
|
|
21
|
+
*
|
|
22
|
+
* NOT verified by this fix: whether `TagFilterInput.label` (renamed here from
|
|
23
|
+
* the nonexistent `.value`) actually produces the intended
|
|
24
|
+
* mtwEntityType+mtwEntityId AND-filter semantics against wspace-files-svc's
|
|
25
|
+
* tag-matching resolver — that's a wspace-files-svc/wspace-tags-svc business-
|
|
26
|
+
* logic question outside a schema-shape validator's reach (it operates on
|
|
27
|
+
* runtime variable values, not the query document). Flagged as follow-up.
|
|
12
28
|
*/
|
|
13
29
|
|
|
14
30
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
@@ -46,13 +62,15 @@ interface UseEntityDocumentsResult {
|
|
|
46
62
|
|
|
47
63
|
const LIST_ENTITY_FILES_QUERY = `
|
|
48
64
|
query ListEntityDocuments($filter: FileFilterInput, $pagination: PaginationInput) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
65
|
+
getFiles(filter: $filter, pagination: $pagination) {
|
|
66
|
+
files {
|
|
67
|
+
id
|
|
68
|
+
name
|
|
69
|
+
size
|
|
70
|
+
mimeType
|
|
71
|
+
createdAt
|
|
72
|
+
downloadUrl
|
|
73
|
+
}
|
|
56
74
|
}
|
|
57
75
|
}
|
|
58
76
|
`;
|
|
@@ -98,20 +116,20 @@ export function useEntityDocuments(
|
|
|
98
116
|
setIsLoading(true);
|
|
99
117
|
setError(null);
|
|
100
118
|
try {
|
|
101
|
-
const data = await executeGraphQL<{ files: ApiFile[] }>(
|
|
119
|
+
const data = await executeGraphQL<{ getFiles: { files: ApiFile[] } }>(
|
|
102
120
|
graphQLOptions,
|
|
103
121
|
LIST_ENTITY_FILES_QUERY,
|
|
104
122
|
{
|
|
105
123
|
filter: {
|
|
106
124
|
tags: [
|
|
107
|
-
{ key: 'mtwEntityType',
|
|
108
|
-
{ key: 'mtwEntityId',
|
|
125
|
+
{ key: 'mtwEntityType', label: entityType },
|
|
126
|
+
{ key: 'mtwEntityId', label: entityId },
|
|
109
127
|
],
|
|
110
128
|
},
|
|
111
129
|
pagination: { limit: 50, offset: 0 },
|
|
112
130
|
}
|
|
113
131
|
);
|
|
114
|
-
setDocuments((data.files ?? []).map(mapFile));
|
|
132
|
+
setDocuments((data.getFiles?.files ?? []).map(mapFile));
|
|
115
133
|
} catch (fetchError) {
|
|
116
134
|
setError(fetchError instanceof Error ? fetchError : new Error('Failed to load documents'));
|
|
117
135
|
setDocuments([]);
|