@isi-ui7/bos7-shared 0.2.0 → 0.2.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.
- package/package.json +43 -6
- package/src/crud-components.tsx +10 -1
- package/src/workflow/use-crud-form.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isi-ui7/bos7-shared",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Shared auth7 and layout primitives for bos7 applications.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -13,7 +13,44 @@
|
|
|
13
13
|
"module": "dist/index.js",
|
|
14
14
|
"types": "dist/index.d.ts",
|
|
15
15
|
"exports": {
|
|
16
|
-
".": "./dist/index.js"
|
|
16
|
+
".": "./dist/index.js",
|
|
17
|
+
"./auth7": "./src/auth7/index.ts",
|
|
18
|
+
"./page-layout": "./src/page-layout.tsx",
|
|
19
|
+
"./modal-layout": "./src/modal-layout.tsx",
|
|
20
|
+
"./form-layout": "./src/form-layout.tsx",
|
|
21
|
+
"./backend": "./src/backend.ts",
|
|
22
|
+
"./export": "./src/export.ts",
|
|
23
|
+
"./types/notification": "./src/types/notification.ts",
|
|
24
|
+
"./nats/client": "./src/nats/client.ts",
|
|
25
|
+
"./event-bus": "./src/event-bus/index.ts",
|
|
26
|
+
"./event-bus/useEventBus": "./src/event-bus/useEventBus.ts",
|
|
27
|
+
"./api": "./src/api.ts",
|
|
28
|
+
"./types/core": "./src/types/core.ts",
|
|
29
|
+
"./style-contract": "./src/style-contract.ts",
|
|
30
|
+
"./crud-components": "./src/crud-components.tsx",
|
|
31
|
+
"./workflow/backend": "./src/workflow/backend.ts",
|
|
32
|
+
"./workflow/notif7": "./src/workflow/notif7.ts",
|
|
33
|
+
"./workflow/api-client": "./src/workflow/api-client.ts",
|
|
34
|
+
"./workflow/starter": "./src/workflow/starter.ts",
|
|
35
|
+
"./workflow/use-workflow-tracker": "./src/workflow/use-workflow-tracker.ts",
|
|
36
|
+
"./workflow/crud-client": "./src/workflow/crud-client.ts",
|
|
37
|
+
"./data-table/cursor-adapter": "./src/data-table/cursor-adapter.ts",
|
|
38
|
+
"./notification/routing": "./src/notification/routing.ts",
|
|
39
|
+
"./shell/interaction": "./src/shell/interaction.ts",
|
|
40
|
+
"./shell/branch": "./src/shell/branch.ts",
|
|
41
|
+
"./notif7": "./src/notif7.ts",
|
|
42
|
+
"./shell/provider": "./src/shell/provider.tsx",
|
|
43
|
+
"./shell/app-shell-layout": "./src/shell/app-shell-layout.tsx",
|
|
44
|
+
"./notifications-bff": "./src/notifications-bff.ts",
|
|
45
|
+
"./observability/otel-init": "./src/observability/otel-init.ts",
|
|
46
|
+
"./form-types": "./src/form-types.ts",
|
|
47
|
+
"./form-numeric": "./src/form-numeric.ts",
|
|
48
|
+
"./form-renderer": "./src/form-renderer.tsx",
|
|
49
|
+
"./form-renderer-utils": "./src/form-renderer-utils.ts",
|
|
50
|
+
"./form-rules": "./src/form-rules.ts",
|
|
51
|
+
"./i18n": "./src/i18n.tsx",
|
|
52
|
+
"./workflow/use-crud-form": "./src/workflow/use-crud-form.ts",
|
|
53
|
+
"./styles": "./src/form-contract.css"
|
|
17
54
|
},
|
|
18
55
|
"publishConfig": {
|
|
19
56
|
"registry": "https://registry.npmjs.org",
|
|
@@ -61,13 +98,13 @@
|
|
|
61
98
|
"next": "16.1.1",
|
|
62
99
|
"@carbon/react": "^1.97.0",
|
|
63
100
|
"@carbon/icons-react": "^11.71.0",
|
|
101
|
+
"@isi-ui7/ui-shell": "0.2.2",
|
|
102
|
+
"@isi-ui7/modal-manager": "0.2.1",
|
|
64
103
|
"@isi-ui7/i18n": "0.2.0",
|
|
65
|
-
"@isi-ui7/data-table": "0.2.1",
|
|
66
|
-
"@isi-ui7/realtime": "0.2.2",
|
|
67
104
|
"@isi-ui7/corporate-themes": "0.2.2",
|
|
68
105
|
"@isi-ui7/lookup-input": "0.2.1",
|
|
69
|
-
"@isi-ui7/
|
|
70
|
-
"@isi-ui7/
|
|
106
|
+
"@isi-ui7/data-table": "0.2.1",
|
|
107
|
+
"@isi-ui7/realtime": "0.2.2"
|
|
71
108
|
},
|
|
72
109
|
"dependencies": {
|
|
73
110
|
"@carbon/icons-react": "^11.71.0",
|
package/src/crud-components.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { type ReactNode, useCallback, useState } from "react";
|
|
3
|
+
import { type ReactNode, useCallback, useEffect, useState } from "react";
|
|
4
4
|
import { Add } from "@carbon/icons-react";
|
|
5
5
|
import {
|
|
6
6
|
Button,
|
|
@@ -112,6 +112,15 @@ export function CrudSchemaListPage<TData extends Record<string, unknown>>({
|
|
|
112
112
|
}, [listSchema.title]),
|
|
113
113
|
});
|
|
114
114
|
|
|
115
|
+
// Pick up instanceId parked by create/edit page before navigating back.
|
|
116
|
+
const { track } = tracker;
|
|
117
|
+
useEffect(() => {
|
|
118
|
+
const pendingId = sessionStorage.getItem('bos7:pending_wf_instance');
|
|
119
|
+
if (!pendingId) return;
|
|
120
|
+
sessionStorage.removeItem('bos7:pending_wf_instance');
|
|
121
|
+
track(pendingId);
|
|
122
|
+
}, [track]);
|
|
123
|
+
|
|
115
124
|
const onPopupClick = useCallback(
|
|
116
125
|
(row: Record<string, unknown>, actionId: string) => {
|
|
117
126
|
const rid = encodeURIComponent(String(row.id ?? ""));
|
|
@@ -149,6 +149,7 @@ export function useCrudForm<TData extends Record<string, unknown>>({
|
|
|
149
149
|
const url = resolveApiPath(schema.updateApiPath, params);
|
|
150
150
|
instanceId = await submitWorkflowForm(url, "PUT", form);
|
|
151
151
|
}
|
|
152
|
+
sessionStorage.setItem('bos7:pending_wf_instance', instanceId);
|
|
152
153
|
onSuccess?.(instanceId);
|
|
153
154
|
} catch (e: unknown) {
|
|
154
155
|
setServerError(e instanceof Error ? e.message : String(e));
|