@vanillabp/bc-ui 0.0.3 → 0.0.4
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/README.md +1 -1
- package/dist/components/CustomWorkflowModuleComponent.d.ts +13 -0
- package/dist/components/CustomWorkflowModuleComponent.js +54 -0
- package/dist/components/FulltextSearchInput.d.ts +13 -0
- package/dist/components/FulltextSearchInput.js +159 -0
- package/dist/components/ListCell.d.ts +1 -2
- package/dist/components/ListCell.js +3 -5
- package/dist/components/ListColumnHeader.d.ts +7 -3
- package/dist/components/ListColumnHeader.js +27 -12
- package/dist/components/ListOfTasks.d.ts +7 -4
- package/dist/components/ListOfTasks.js +245 -157
- package/dist/components/ListOfWorkflows.d.ts +5 -2
- package/dist/components/ListOfWorkflows.js +150 -260
- package/dist/components/SearchableAndSortableUpdatingList.d.ts +3 -3
- package/dist/components/SearchableAndSortableUpdatingList.js +3 -2
- package/dist/components/SnapScrolling.d.ts +4 -4
- package/dist/components/SnapScrolling.js +1 -1
- package/dist/components/SnapScrollingDataTable.d.ts +2 -2
- package/dist/components/SnapScrollingDataTable.js +42 -17
- package/dist/components/User.d.ts +6 -4
- package/dist/components/User.js +34 -27
- package/dist/components/UserAvatar.d.ts +5 -3
- package/dist/components/UserAvatar.js +7 -35
- package/dist/components/UserTaskPage.d.ts +2 -1
- package/dist/components/UserTaskPage.js +21 -7
- package/dist/components/WorkflowPage.d.ts +3 -2
- package/dist/components/WorkflowPage.js +13 -5
- package/dist/components/index.d.ts +8 -6
- package/dist/components/index.js +2 -0
- package/dist/index.d.ts +7 -4
- package/dist/types/apis.d.ts +5 -3
- package/dist/types/index.d.ts +1 -1
- package/dist/types/lists.d.ts +2 -1
- package/dist/utils/column-type.d.ts +6 -0
- package/dist/utils/column-type.js +11 -0
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/module-federation.d.ts +5 -5
- package/dist/utils/module-federation.js +90 -38
- package/package.json +4 -4
package/dist/types/apis.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WakeupSseCallback } from '@vanillabp/bc-shared';
|
|
2
|
-
import { UserTask, UserSearchResult,
|
|
2
|
+
import { SearchQuery, UserTask, UserSearchResult, KwicResult, Workflows, Workflow } from '@vanillabp/bc-official-gui-client';
|
|
3
3
|
import { UserTasks } from '@vanillabp/bc-official-gui-client/dist/models/UserTasks';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -10,8 +10,8 @@ import { UserTasks } from '@vanillabp/bc-official-gui-client/dist/models/UserTas
|
|
|
10
10
|
interface WakeupSseCallbackReference {
|
|
11
11
|
current: WakeupSseCallback | undefined;
|
|
12
12
|
}
|
|
13
|
-
declare type TasklistApiCall = (listId: string, pageNumber: number, pageSize: number, sort: string | undefined, sortAscending: boolean, initialTimestamp?: Date) => Promise<UserTasks>;
|
|
14
|
-
declare type TasklistUpdateCall = (listId: string, size: number, knownUserTasksIds: Array<string>, sort: string | undefined, sortAscending: boolean, initialTimestamp?: Date) => Promise<UserTasks>;
|
|
13
|
+
declare type TasklistApiCall = (listId: string, pageNumber: number, pageSize: number, sort: string | undefined, sortAscending: boolean, searchQueries?: Array<SearchQuery>, initialTimestamp?: Date) => Promise<UserTasks>;
|
|
14
|
+
declare type TasklistUpdateCall = (listId: string, size: number, knownUserTasksIds: Array<string>, sort: string | undefined, sortAscending: boolean, searchQueries?: Array<SearchQuery>, initialTimestamp?: Date) => Promise<UserTasks>;
|
|
15
15
|
declare type TasklistMarkAsReadCall = (userTaskId: string, unread?: boolean) => void;
|
|
16
16
|
declare type TasklistMarkMultipleAsReadCall = (userTaskIds: Array<string>, unread?: boolean) => void;
|
|
17
17
|
declare type TasklistClaimTaskCall = (userTaskId: string, unclaim?: boolean) => void;
|
|
@@ -20,6 +20,7 @@ declare type TasklistAssignTaskCall = (userTaskId: string, userId: string, unass
|
|
|
20
20
|
declare type TasklistAssignMultipleTasksCall = (userTaskIds: Array<string>, userId: string, unassign?: boolean) => void;
|
|
21
21
|
declare type GetUserTaskCall = (userTaskId: string, markAsRead?: boolean) => Promise<UserTask>;
|
|
22
22
|
declare type FindUsersCall = (query?: string, limit?: number) => Promise<UserSearchResult>;
|
|
23
|
+
declare type KwicUserTasksApiCall = (query: string, path?: string, searchQueries?: Array<SearchQuery>, initialTimestamp?: Date) => Promise<Array<KwicResult>>;
|
|
23
24
|
interface TasklistApi {
|
|
24
25
|
getUserTasks: TasklistApiCall;
|
|
25
26
|
getUserTasksUpdate: TasklistUpdateCall;
|
|
@@ -31,6 +32,7 @@ interface TasklistApi {
|
|
|
31
32
|
assignTasks: TasklistAssignMultipleTasksCall;
|
|
32
33
|
getUserTask: GetUserTaskCall;
|
|
33
34
|
findUsers: FindUsersCall;
|
|
35
|
+
kwicUserTasks: KwicUserTasksApiCall;
|
|
34
36
|
}
|
|
35
37
|
declare type GetWorkflowsApiCall = (requestId: string, pageNumber: number, pageSize: number, sort: string | undefined, sortAscending: boolean, searchQueries?: Array<SearchQuery>, initialTimestamp?: Date) => Promise<Workflows>;
|
|
36
38
|
declare type GetWorkflowsUpdateApiCall = (requestId: string, size: number, knownWorkflowsIds: Array<string>, sort: string | undefined, sortAscending: boolean, searchQueries?: Array<SearchQuery>, initialTimestamp?: Date) => Promise<Workflows>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { NavigateToWorkflowFunction, OpenTaskFunction } from './navigate.js';
|
|
2
2
|
export { TasklistApi, TasklistApiHook, WakeupSseCallbackReference, WorkflowlistApi, WorkflowlistApiHook } from './apis.js';
|
|
3
|
-
export { AssignTaskFunction, ListOfTasksHeaderFooterFunction, ListOfWorkflowsHeaderFooterFunction } from './lists.js';
|
|
3
|
+
export { AssignTaskFunction, ClaimTaskFunction, ListOfTasksHeaderFooterFunction, ListOfWorkflowsHeaderFooterFunction } from './lists.js';
|
|
4
4
|
import '@vanillabp/bc-official-gui-client';
|
|
5
5
|
import '@vanillabp/bc-shared';
|
|
6
6
|
import '@vanillabp/bc-official-gui-client/dist/models/UserTasks';
|
package/dist/types/lists.d.ts
CHANGED
|
@@ -4,9 +4,10 @@ import { Column } from '@vanillabp/bc-shared';
|
|
|
4
4
|
|
|
5
5
|
declare type ListOfTasksHeaderFooterFunction = (isPhone: boolean, isTablet: boolean, numberOfTasks: number, columns: Column[] | undefined, sort: string | undefined, setSort: (column?: Column) => void, sortAscending: boolean, setSortAscending: (sortAscending: boolean) => void, selectAll: (select: boolean) => void, allSelected: boolean, refresh: () => void, refreshDisabled: boolean, markAsRead: () => void, markAsUnread: () => void, markAsReadDisabled: boolean, claimTasks: () => void, unclaimTasks: () => void, claimTasksDisabled: boolean, assignTasks: (userId: string) => void, assignDisabled: boolean) => ReactNode | undefined;
|
|
6
6
|
declare type AssignTaskFunction = (userTask: UserTask, userId: string, unassign: boolean) => void;
|
|
7
|
+
declare type ClaimTaskFunction = (userTask: UserTask, unclaim: boolean) => void;
|
|
7
8
|
declare type ListOfWorkflowsHeaderFooterFunction = (isPhone: boolean, isTablet: boolean, numberOfWorkflows: number, columns: Column[] | undefined, sort: string | undefined, setSort: (column?: Column) => void, sortAscending: boolean, setSortAscending: (sortAscending: boolean) => void, selectAll: (select: boolean) => void, allSelected: boolean, refresh: () => void, refreshDisabled: boolean, initialKwicQuery: (columnPath?: string) => string, limitListToKwic: (columnPath: string | undefined, query?: string) => void, kwic: (columnPath: string | undefined, query: string) => Promise<Array<{
|
|
8
9
|
item: string;
|
|
9
10
|
count: number;
|
|
10
11
|
}>>) => ReactNode | undefined;
|
|
11
12
|
|
|
12
|
-
export { AssignTaskFunction, ListOfTasksHeaderFooterFunction, ListOfWorkflowsHeaderFooterFunction };
|
|
13
|
+
export { AssignTaskFunction, ClaimTaskFunction, ListOfTasksHeaderFooterFunction, ListOfWorkflowsHeaderFooterFunction };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Column } from '@vanillabp/bc-shared';
|
|
2
|
+
|
|
3
|
+
declare const sortWithoutColumnTypeSpecificAttributes: (currentLanguage: string, effectiveSort?: string) => string | undefined;
|
|
4
|
+
declare const sortWithColumnTypeSpecificAttributes: (currentLanguage: string, column?: Column) => string | undefined;
|
|
5
|
+
|
|
6
|
+
export { sortWithColumnTypeSpecificAttributes, sortWithoutColumnTypeSpecificAttributes };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "../chunk-YH4NJHER.js";
|
|
2
|
+
const sortWithoutColumnTypeSpecificAttributes = (currentLanguage, effectiveSort) => (effectiveSort == null ? void 0 : effectiveSort.endsWith(`.${currentLanguage}`)) ? effectiveSort == null ? void 0 : effectiveSort.substring(0, (effectiveSort == null ? void 0 : effectiveSort.length) - currentLanguage.length - 1) : (effectiveSort == null ? void 0 : effectiveSort.indexOf(".sort,")) !== -1 ? effectiveSort == null ? void 0 : effectiveSort.substring(0, effectiveSort == null ? void 0 : effectiveSort.indexOf(".sort,")) : effectiveSort;
|
|
3
|
+
const sortWithColumnTypeSpecificAttributes = (currentLanguage, column) => column === void 0 ? void 0 : column.type === "i18n" ? `${column.path}.${currentLanguage != null ? currentLanguage : window.navigator.language.replace(
|
|
4
|
+
/* exclude country */
|
|
5
|
+
/-.*$/,
|
|
6
|
+
""
|
|
7
|
+
)}` : column.type === "person" ? `${column.path}.sort,${column.path}.id` : column.path;
|
|
8
|
+
export {
|
|
9
|
+
sortWithColumnTypeSpecificAttributes,
|
|
10
|
+
sortWithoutColumnTypeSpecificAttributes
|
|
11
|
+
};
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { Module, ModuleDefinition, TasklistCellProps, UiUriType,
|
|
1
|
+
export { Module, ModuleDefinition, TasklistCellProps, UiUriType, WorkflowCellProps, attachScript, detachScript, useFederationModule, useFederationModules } from './module-federation.js';
|
|
2
|
+
export { sortWithColumnTypeSpecificAttributes, sortWithoutColumnTypeSpecificAttributes } from './column-type.js';
|
|
2
3
|
import '@vanillabp/bc-shared';
|
package/dist/utils/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ColumnsOfUserTaskFunction, ColumnsOfWorkflowFunction, UserTaskForm, UserTaskListCell, WorkflowListCell, WorkflowPage } from '@vanillabp/bc-shared';
|
|
2
2
|
|
|
3
|
-
declare type UseCase = 'UserTaskList' | 'UserTaskForm' | 'WorkflowList' | 'WorkflowPage';
|
|
4
3
|
declare enum UiUriType {
|
|
5
4
|
External = "EXTERNAL",
|
|
6
5
|
WebpackMfReact = "WEBPACK_MF_REACT"
|
|
@@ -31,10 +30,11 @@ interface Module {
|
|
|
31
30
|
UserTaskListCell?: UserTaskListCell;
|
|
32
31
|
WorkflowListCell?: WorkflowListCell;
|
|
33
32
|
WorkflowPage?: WorkflowPage;
|
|
33
|
+
[key: string]: any;
|
|
34
34
|
}
|
|
35
|
-
declare const attachScript: (webpackModuleId: string, url: string
|
|
35
|
+
declare const attachScript: (webpackModuleId: string, url: string, initialTry: boolean) => Promise<void>;
|
|
36
36
|
declare const detachScript: (webpackModuleId: string) => void;
|
|
37
|
-
declare const useFederationModule: (moduleDefinition: ModuleDefinition | undefined, useCase:
|
|
38
|
-
declare const useFederationModules: (moduleDefinitions: ModuleDefinition[] | undefined, useCase:
|
|
37
|
+
declare const useFederationModule: (moduleDefinition: ModuleDefinition | undefined | null, useCase: string) => Module | undefined;
|
|
38
|
+
declare const useFederationModules: (moduleDefinitions: ModuleDefinition[] | undefined | null, useCase: string) => Module[] | undefined;
|
|
39
39
|
|
|
40
|
-
export { Module, ModuleDefinition, TasklistCellProps, UiUriType,
|
|
40
|
+
export { Module, ModuleDefinition, TasklistCellProps, UiUriType, WorkflowCellProps, attachScript, detachScript, useFederationModule, useFederationModules };
|
|
@@ -14,30 +14,62 @@ var UiUriType = /* @__PURE__ */ ((UiUriType2) => {
|
|
|
14
14
|
;
|
|
15
15
|
;
|
|
16
16
|
;
|
|
17
|
+
;
|
|
18
|
+
const loadedScripts = {};
|
|
17
19
|
const modules = {};
|
|
18
|
-
const attachScript = (webpackModuleId, url) => {
|
|
20
|
+
const attachScript = (webpackModuleId, url, initialTry) => {
|
|
19
21
|
const elementId = "___" + webpackModuleId;
|
|
20
22
|
const existingElement = document.getElementById(elementId);
|
|
21
23
|
if (existingElement) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
const loadedScript = loadedScripts[webpackModuleId];
|
|
25
|
+
if (loadedScript.error !== void 0 && !initialTry) {
|
|
26
|
+
detachScript(webpackModuleId);
|
|
27
|
+
} else {
|
|
28
|
+
if (loadedScript.error) {
|
|
29
|
+
return Promise.reject(loadedScript.error);
|
|
30
|
+
}
|
|
31
|
+
if (loadedScript.promises.length === 0) {
|
|
32
|
+
return Promise.resolve();
|
|
33
|
+
}
|
|
34
|
+
return new Promise(
|
|
35
|
+
(resolve, reject) => {
|
|
36
|
+
loadedScript.promises.push({
|
|
37
|
+
resolve,
|
|
38
|
+
reject
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
25
43
|
}
|
|
26
|
-
|
|
27
|
-
element.src = url;
|
|
28
|
-
element.type = "text/javascript";
|
|
29
|
-
element.async = true;
|
|
30
|
-
element.id = elementId;
|
|
31
|
-
const scriptLoadPromise = new Promise(
|
|
44
|
+
return new Promise(
|
|
32
45
|
(resolve, reject) => {
|
|
33
|
-
|
|
46
|
+
const loadedScript = {
|
|
47
|
+
promises: [{
|
|
48
|
+
resolve,
|
|
49
|
+
reject
|
|
50
|
+
}]
|
|
51
|
+
};
|
|
52
|
+
loadedScripts[webpackModuleId] = loadedScript;
|
|
53
|
+
const element = document.createElement("script");
|
|
54
|
+
element.src = url;
|
|
55
|
+
element.type = "text/javascript";
|
|
56
|
+
element.async = true;
|
|
57
|
+
element.id = elementId;
|
|
58
|
+
element.onload = () => __async(void 0, null, function* () {
|
|
59
|
+
yield __webpack_init_sharing__("default");
|
|
60
|
+
const pfs = [...loadedScript.promises];
|
|
61
|
+
loadedScript.promises = [];
|
|
62
|
+
pfs.forEach((pf) => pf.resolve());
|
|
63
|
+
});
|
|
34
64
|
element.onerror = (e) => {
|
|
35
|
-
|
|
65
|
+
const pfs = [...loadedScript.promises];
|
|
66
|
+
loadedScript.promises = [];
|
|
67
|
+
loadedScript.error = e;
|
|
68
|
+
pfs.forEach((pf) => pf.reject(loadedScript.error));
|
|
36
69
|
};
|
|
70
|
+
document.head.appendChild(element);
|
|
37
71
|
}
|
|
38
72
|
);
|
|
39
|
-
document.head.appendChild(element);
|
|
40
|
-
return scriptLoadPromise;
|
|
41
73
|
};
|
|
42
74
|
const detachScript = (webpackModuleId) => {
|
|
43
75
|
const element = document.getElementById("___" + webpackModuleId);
|
|
@@ -46,13 +78,9 @@ const detachScript = (webpackModuleId) => {
|
|
|
46
78
|
};
|
|
47
79
|
const fetchModule = (workflowModuleId, uiUri, initialTry, useCase) => __async(void 0, null, function* () {
|
|
48
80
|
const webpackModuleId = workflowModuleId.replaceAll("-", "_");
|
|
49
|
-
if (!initialTry) {
|
|
50
|
-
detachScript(webpackModuleId);
|
|
51
|
-
}
|
|
52
81
|
let container = window[webpackModuleId];
|
|
53
82
|
if (container === void 0) {
|
|
54
|
-
yield attachScript(webpackModuleId, uiUri);
|
|
55
|
-
yield __webpack_init_sharing__("default");
|
|
83
|
+
yield attachScript(webpackModuleId, uiUri, initialTry);
|
|
56
84
|
container = window[webpackModuleId];
|
|
57
85
|
}
|
|
58
86
|
if (!container.isInitialized) {
|
|
@@ -65,17 +93,20 @@ const fetchModule = (workflowModuleId, uiUri, initialTry, useCase) => __async(vo
|
|
|
65
93
|
return factory();
|
|
66
94
|
});
|
|
67
95
|
const loadModule = (moduleId, moduleDefinition, useCase) => {
|
|
68
|
-
const callbacks = [];
|
|
69
96
|
let module = modules[moduleId];
|
|
70
97
|
if (module === void 0) {
|
|
71
|
-
module = {
|
|
98
|
+
module = {
|
|
99
|
+
moduleId,
|
|
100
|
+
workflowModuleId: moduleDefinition.workflowModuleId,
|
|
101
|
+
callbacks: []
|
|
102
|
+
};
|
|
72
103
|
modules[moduleId] = module;
|
|
73
104
|
}
|
|
74
|
-
const publish = () => callbacks.forEach((callback) => callback(modules[moduleId]));
|
|
105
|
+
const publish = () => module.callbacks.forEach((callback) => callback(modules[moduleId]));
|
|
75
106
|
const retry = (retryCallback, initialTry) => __async(void 0, null, function* () {
|
|
76
|
-
if (module.buildTimestamp !== void 0)
|
|
77
|
-
return;
|
|
78
107
|
try {
|
|
108
|
+
if (module.buildTimestamp !== void 0)
|
|
109
|
+
return;
|
|
79
110
|
if (moduleDefinition.uiUriType === "WEBPACK_MF_REACT" /* WebpackMfReact */) {
|
|
80
111
|
const webpackModule = yield fetchModule(moduleDefinition.workflowModuleId, moduleDefinition.uiUri, initialTry || false, useCase);
|
|
81
112
|
modules[moduleId] = __spreadValues(__spreadValues({}, webpackModule), module);
|
|
@@ -83,6 +114,7 @@ const loadModule = (moduleId, moduleDefinition, useCase) => {
|
|
|
83
114
|
throw new Error(`Unsupported UiUriType: ${moduleDefinition.uiUriType}!`);
|
|
84
115
|
}
|
|
85
116
|
} catch (error) {
|
|
117
|
+
console.error("Error loading module:", error);
|
|
86
118
|
modules[moduleId] = __spreadProps(__spreadValues({}, module), {
|
|
87
119
|
retry
|
|
88
120
|
});
|
|
@@ -94,35 +126,52 @@ const loadModule = (moduleId, moduleDefinition, useCase) => {
|
|
|
94
126
|
}
|
|
95
127
|
});
|
|
96
128
|
const subscribe = (callback) => {
|
|
97
|
-
if (callbacks.includes(callback))
|
|
129
|
+
if (modules[moduleId].callbacks.includes(callback))
|
|
98
130
|
return;
|
|
99
|
-
callbacks.push(callback);
|
|
131
|
+
modules[moduleId].callbacks.push(callback);
|
|
100
132
|
};
|
|
101
133
|
const unsubscribe = (callback) => {
|
|
102
|
-
const index = callbacks.indexOf(callback);
|
|
134
|
+
const index = modules[moduleId].callbacks.indexOf(callback);
|
|
103
135
|
if (index === -1)
|
|
104
136
|
return;
|
|
105
|
-
callbacks.splice(index, 1);
|
|
137
|
+
modules[moduleId].callbacks.splice(index, 1);
|
|
106
138
|
};
|
|
107
139
|
retry(void 0, true);
|
|
108
140
|
return { subscribe, unsubscribe };
|
|
109
141
|
};
|
|
110
142
|
const getModule = (moduleId, moduleDefinition, useCase) => {
|
|
111
|
-
let
|
|
112
|
-
if (
|
|
143
|
+
let module = modules[moduleId];
|
|
144
|
+
if (module !== void 0) {
|
|
145
|
+
let subscribe = void 0;
|
|
146
|
+
let unsubscribe = void 0;
|
|
147
|
+
if (module.buildTimestamp || module.retry) {
|
|
148
|
+
subscribe = (callback) => callback(module);
|
|
149
|
+
unsubscribe = (callback) => callback(module);
|
|
150
|
+
} else {
|
|
151
|
+
subscribe = (callback) => {
|
|
152
|
+
if (modules[moduleId].callbacks.includes(callback))
|
|
153
|
+
return;
|
|
154
|
+
modules[moduleId].callbacks.push(callback);
|
|
155
|
+
};
|
|
156
|
+
unsubscribe = (callback) => {
|
|
157
|
+
const index = modules[moduleId].callbacks.indexOf(callback);
|
|
158
|
+
if (index === -1)
|
|
159
|
+
return;
|
|
160
|
+
modules[moduleId].callbacks.splice(index, 1);
|
|
161
|
+
};
|
|
162
|
+
}
|
|
113
163
|
return {
|
|
114
|
-
subscribe
|
|
115
|
-
unsubscribe
|
|
116
|
-
}
|
|
164
|
+
subscribe,
|
|
165
|
+
unsubscribe
|
|
117
166
|
};
|
|
118
167
|
}
|
|
119
168
|
return loadModule(moduleId, moduleDefinition, useCase);
|
|
120
169
|
};
|
|
121
170
|
const useFederationModule = (moduleDefinition, useCase) => {
|
|
122
|
-
const moduleId = moduleDefinition !== void 0 ? `${moduleDefinition.workflowModuleId}#${useCase}` : "undefined";
|
|
171
|
+
const moduleId = Boolean(moduleDefinition !== void 0) ? `${moduleDefinition.workflowModuleId}#${useCase}` : "undefined";
|
|
123
172
|
const [module, setModule] = useState(modules[moduleId]);
|
|
124
173
|
useEffect(() => {
|
|
125
|
-
if (moduleDefinition
|
|
174
|
+
if (!Boolean(moduleDefinition)) {
|
|
126
175
|
return void 0;
|
|
127
176
|
}
|
|
128
177
|
const { subscribe, unsubscribe } = getModule(moduleId, moduleDefinition, useCase);
|
|
@@ -135,7 +184,7 @@ const useFederationModule = (moduleDefinition, useCase) => {
|
|
|
135
184
|
const useFederationModules = (moduleDefinitions, useCase) => {
|
|
136
185
|
const [modules2, setModules] = useState(void 0);
|
|
137
186
|
useEffect(() => {
|
|
138
|
-
if (moduleDefinitions
|
|
187
|
+
if (!Boolean(moduleDefinitions)) {
|
|
139
188
|
return;
|
|
140
189
|
}
|
|
141
190
|
if (moduleDefinitions.length === 0) {
|
|
@@ -150,7 +199,8 @@ const useFederationModules = (moduleDefinitions, useCase) => {
|
|
|
150
199
|
distinctModuleDefinitions.forEach((moduleDefinition, i) => {
|
|
151
200
|
result[i] = {
|
|
152
201
|
moduleId: `${moduleDefinition.workflowModuleId}#${useCase}`,
|
|
153
|
-
workflowModuleId: moduleDefinition.workflowModuleId
|
|
202
|
+
workflowModuleId: moduleDefinition.workflowModuleId,
|
|
203
|
+
callbacks: []
|
|
154
204
|
};
|
|
155
205
|
});
|
|
156
206
|
const unsubscribers = distinctModuleDefinitions.map((moduleDefinition, index) => {
|
|
@@ -164,7 +214,9 @@ const useFederationModules = (moduleDefinitions, useCase) => {
|
|
|
164
214
|
if (anyModuleStillLoading) {
|
|
165
215
|
return;
|
|
166
216
|
}
|
|
167
|
-
|
|
217
|
+
if (JSON.stringify(result) !== JSON.stringify(modules2)) {
|
|
218
|
+
setModules(result);
|
|
219
|
+
}
|
|
168
220
|
};
|
|
169
221
|
subscribe(handler);
|
|
170
222
|
return () => unsubscribe(handler);
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vanillabp/bc-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
|
+
"sideEffects": false,
|
|
4
5
|
"repository": {
|
|
5
6
|
"type": "git",
|
|
6
7
|
"url": "https://github.com/vanillabp/business-cockpit.git"
|
|
7
8
|
},
|
|
8
9
|
"homepage": "https://github.com/vanillabp/business-cockpit",
|
|
9
|
-
"sideEffects": false,
|
|
10
10
|
"type": "module",
|
|
11
11
|
"main": "dist/index.js",
|
|
12
12
|
"module": "dist/index.js",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"package.json"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@vanillabp/bc-official-gui-client": "0.0.
|
|
20
|
-
"@vanillabp/bc-shared": "0.0.
|
|
19
|
+
"@vanillabp/bc-official-gui-client": "0.0.4",
|
|
20
|
+
"@vanillabp/bc-shared": "0.0.4"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@fontsource/roboto": "4.5.8",
|