@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { MutableRefObject, ReactNode } from 'react';
|
|
2
2
|
import { ColumnConfig } from 'grommet';
|
|
3
3
|
import { ListItemStatus, ShowLoadingIndicatorFunction } from '@vanillabp/bc-shared';
|
|
4
4
|
import { BackgroundType, ColorType } from 'grommet/utils';
|
|
@@ -29,9 +29,9 @@ declare type RefreshNecessaryFunction = () => void;
|
|
|
29
29
|
declare type ReloadCallbackFunction = (updatedItemsIds: Array<string>) => Promise<void>;
|
|
30
30
|
declare type RefreshItemCallbackFunction = (itemIds: Array<string>) => void;
|
|
31
31
|
declare const SearchableAndSortableUpdatingList: <T extends ListItemData>({ itemsRef, updateListRef, refreshItemRef, retrieveItems, reloadItems, refreshNecessaryCallback, columns, showLoadingIndicator, additionalHeader, minWidthOfAutoColumn, rowSeparator, applyBackgroundColor, showColumnHeaders, columnHeaderBackground, columnHeaderSeparator, }: {
|
|
32
|
-
itemsRef:
|
|
32
|
+
itemsRef: React.MutableRefObject<ListItem<T>[] | undefined>;
|
|
33
33
|
updateListRef: MutableRefObject<ReloadCallbackFunction | undefined>;
|
|
34
|
-
refreshItemRef?:
|
|
34
|
+
refreshItemRef?: React.MutableRefObject<RefreshItemCallbackFunction | undefined> | undefined;
|
|
35
35
|
retrieveItems: RetrieveItemsFunction;
|
|
36
36
|
reloadItems: ReloadItemsFunction;
|
|
37
37
|
refreshNecessaryCallback?: RefreshNecessaryFunction | undefined;
|
|
@@ -155,14 +155,14 @@ const SearchableAndSortableUpdatingList = ({
|
|
|
155
155
|
if (item.status === void 0) {
|
|
156
156
|
return __spreadProps(__spreadValues({}, props), {
|
|
157
157
|
[item.id]: {
|
|
158
|
-
background:
|
|
158
|
+
background: "list-ended"
|
|
159
159
|
}
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
if (item.status !== ListItemStatus.INITIAL) {
|
|
163
163
|
return __spreadProps(__spreadValues({}, props), {
|
|
164
164
|
[item.id]: {
|
|
165
|
-
background: item.status === ListItemStatus.NEW ?
|
|
165
|
+
background: item.status === ListItemStatus.NEW ? "list-new" : item.status === ListItemStatus.UPDATED ? "list-updated" : item.status === ListItemStatus.ENDED ? "list-ended" : item.status === ListItemStatus.REMOVED_FROM_LIST ? "list-removed_from_list" : void 0
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
168
|
}
|
|
@@ -172,6 +172,7 @@ const SearchableAndSortableUpdatingList = ({
|
|
|
172
172
|
Box,
|
|
173
173
|
{
|
|
174
174
|
fill: true,
|
|
175
|
+
background: columnHeaderSeparator,
|
|
175
176
|
children: /* @__PURE__ */ jsx(
|
|
176
177
|
SnapScrollingDataTable,
|
|
177
178
|
{
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import * as styled_components from 'styled-components';
|
|
2
|
-
import * as React from 'react';
|
|
3
1
|
import { GridExtendedProps, BoxExtendedProps } from 'grommet';
|
|
2
|
+
import { StyledComponent } from 'styled-components';
|
|
4
3
|
import * as CSS from 'csstype';
|
|
4
|
+
import { FC } from 'react';
|
|
5
5
|
|
|
6
6
|
interface SnapScrollingGridProps extends GridExtendedProps {
|
|
7
7
|
snapDirection: 'horizontal' | 'vertical';
|
|
8
8
|
}
|
|
9
|
-
declare const SnapScrollingGrid:
|
|
9
|
+
declare const SnapScrollingGrid: StyledComponent<FC<GridExtendedProps>, any, SnapScrollingGridProps, never>;
|
|
10
10
|
interface SnapAlignBoxProps extends BoxExtendedProps {
|
|
11
11
|
snapAlign: CSS.Property.ScrollSnapAlign;
|
|
12
12
|
}
|
|
13
|
-
declare const SnapAlignBox:
|
|
13
|
+
declare const SnapAlignBox: StyledComponent<FC<BoxExtendedProps>, any, SnapAlignBoxProps, never>;
|
|
14
14
|
|
|
15
15
|
export { SnapAlignBox, SnapScrollingGrid };
|
|
@@ -3,7 +3,7 @@ import { Box, Grid } from "grommet";
|
|
|
3
3
|
import styled from "styled-components";
|
|
4
4
|
;
|
|
5
5
|
const SnapScrollingGrid = styled(Grid)`
|
|
6
|
-
overflow-${(props) => props.snapDirection === "horizontal" ? "x" : "y"}:
|
|
6
|
+
overflow-${(props) => props.snapDirection === "horizontal" ? "x" : "y"}: overlay;
|
|
7
7
|
scroll-snap-type: ${(props) => props.snapDirection === "horizontal" ? "x" : "y"} mandatory;
|
|
8
8
|
scroll-behavior: smooth;
|
|
9
9
|
`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataTableExtendedProps, ColumnConfig } from 'grommet';
|
|
2
|
-
import
|
|
2
|
+
import React, { PropsWithChildren, ReactNode, UIEventHandler } from 'react';
|
|
3
3
|
import { BackgroundType, ColorType } from 'grommet/utils';
|
|
4
4
|
|
|
5
5
|
interface SnapScrollingDataTableProps<TRowType = any> extends PropsWithChildren<Omit<DataTableExtendedProps<TRowType>, 'columns' | 'ref'>> {
|
|
@@ -12,6 +12,6 @@ interface SnapScrollingDataTableProps<TRowType = any> extends PropsWithChildren<
|
|
|
12
12
|
columnHeaderBackground?: BackgroundType;
|
|
13
13
|
columnHeaderSeparator?: ColorType | null;
|
|
14
14
|
}
|
|
15
|
-
declare const SnapScrollingDataTable:
|
|
15
|
+
declare const SnapScrollingDataTable: React.ForwardRefExoticComponent<SnapScrollingDataTableProps<any> & React.RefAttributes<unknown>>;
|
|
16
16
|
|
|
17
17
|
export { SnapScrollingDataTable };
|
|
@@ -34,6 +34,7 @@ const SnapScrollingDataTable = forwardRef((_a, ref) => {
|
|
|
34
34
|
"columnHeaderBackground",
|
|
35
35
|
"columnHeaderSeparator"
|
|
36
36
|
]);
|
|
37
|
+
const hasAutoWidthColumn = columns.filter((column) => column.size === void 0).length > 0;
|
|
37
38
|
const columnsWidth = columns.reduce((width, column) => calculateColumWidth(minWidthOfAutoColumn, width, column), "");
|
|
38
39
|
const dataTableColumns = columns.map((column) => __spreadProps(__spreadValues({}, column), { header: void 0 }));
|
|
39
40
|
return columns ? /* @__PURE__ */ jsxs(
|
|
@@ -41,7 +42,7 @@ const SnapScrollingDataTable = forwardRef((_a, ref) => {
|
|
|
41
42
|
{
|
|
42
43
|
fill: true,
|
|
43
44
|
rows: ["max-content", "auto"],
|
|
44
|
-
style: { overflow: "
|
|
45
|
+
style: { overflow: "overlay" },
|
|
45
46
|
snapDirection: "horizontal",
|
|
46
47
|
onScroll,
|
|
47
48
|
children: [
|
|
@@ -55,6 +56,7 @@ const SnapScrollingDataTable = forwardRef((_a, ref) => {
|
|
|
55
56
|
zIndex: 2,
|
|
56
57
|
minWidth: "auto"
|
|
57
58
|
},
|
|
59
|
+
overflow: "hidden",
|
|
58
60
|
background: columnHeaderBackground,
|
|
59
61
|
align: "center",
|
|
60
62
|
children: [
|
|
@@ -71,23 +73,34 @@ const SnapScrollingDataTable = forwardRef((_a, ref) => {
|
|
|
71
73
|
marginRight: "auto",
|
|
72
74
|
zIndex: "2"
|
|
73
75
|
},
|
|
74
|
-
children: columns.map((column, index) => /* @__PURE__ */
|
|
76
|
+
children: columns.map((column, index, allColumns) => /* @__PURE__ */ jsxs(
|
|
75
77
|
SnapAlignBox,
|
|
76
78
|
{
|
|
77
|
-
style: column.size === void 0 ? {
|
|
79
|
+
style: column.size === void 0 ? { position: "relative", minWidth: minWidthOfAutoColumn } : { position: "relative", width: column.size },
|
|
78
80
|
align: "left",
|
|
79
81
|
justify: "center",
|
|
80
82
|
height: "100%",
|
|
81
83
|
border: index === 0 || columnHeaderSeparator === null ? void 0 : { side: "left", color: columnHeaderSeparator },
|
|
82
84
|
snapAlign: "center",
|
|
83
|
-
children:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
children: [
|
|
86
|
+
index + 1 === allColumns.length ? /* @__PURE__ */ jsx(
|
|
87
|
+
Box,
|
|
88
|
+
{
|
|
89
|
+
style: { position: "absolute", left: "100%", top: "0px", zIndex: "3" },
|
|
90
|
+
width: "1px",
|
|
91
|
+
height: "100%",
|
|
92
|
+
background: columnHeaderSeparator
|
|
93
|
+
}
|
|
94
|
+
) : void 0,
|
|
95
|
+
column.header instanceof String ? /* @__PURE__ */ jsx(
|
|
96
|
+
Text,
|
|
97
|
+
{
|
|
98
|
+
color: "light-2",
|
|
99
|
+
truncate: "tip",
|
|
100
|
+
children: column.header
|
|
101
|
+
}
|
|
102
|
+
) : column.header
|
|
103
|
+
]
|
|
91
104
|
},
|
|
92
105
|
`column${index}`
|
|
93
106
|
))
|
|
@@ -97,12 +110,24 @@ const SnapScrollingDataTable = forwardRef((_a, ref) => {
|
|
|
97
110
|
}
|
|
98
111
|
),
|
|
99
112
|
/* @__PURE__ */ jsx(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
113
|
+
Box,
|
|
114
|
+
{
|
|
115
|
+
style: {
|
|
116
|
+
minHeight: "100%",
|
|
117
|
+
height: "fit-content",
|
|
118
|
+
minWidth: hasAutoWidthColumn ? `calc(${columnsWidth})` : void 0,
|
|
119
|
+
width: hasAutoWidthColumn ? "100%" : `calc(${columnsWidth})`
|
|
120
|
+
},
|
|
121
|
+
background: "white",
|
|
122
|
+
children: /* @__PURE__ */ jsx(
|
|
123
|
+
DataTable,
|
|
124
|
+
__spreadValues({
|
|
125
|
+
fill: "vertical",
|
|
126
|
+
pad: "none",
|
|
127
|
+
columns: dataTableColumns
|
|
128
|
+
}, props)
|
|
129
|
+
)
|
|
130
|
+
}
|
|
106
131
|
)
|
|
107
132
|
]
|
|
108
133
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Person } from '@vanillabp/bc-official-gui-client';
|
|
2
|
+
import { TranslationFunction } from '@vanillabp/bc-shared';
|
|
2
3
|
|
|
3
|
-
declare type
|
|
4
|
-
|
|
4
|
+
declare type UserProps = {
|
|
5
|
+
t: TranslationFunction;
|
|
6
|
+
user: Person;
|
|
5
7
|
isUserLoggedIn?: boolean;
|
|
6
8
|
size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | string;
|
|
7
9
|
iconSize?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | string;
|
|
8
10
|
};
|
|
9
|
-
declare const User: ({ user, isUserLoggedIn, size, iconSize, }:
|
|
11
|
+
declare const User: ({ t, user, isUserLoggedIn, size, iconSize, }: UserProps) => JSX.Element;
|
|
10
12
|
|
|
11
13
|
export { User };
|
package/dist/components/User.js
CHANGED
|
@@ -2,38 +2,45 @@ import "../chunk-YH4NJHER.js";
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Grid, Text } from "grommet";
|
|
4
4
|
import { UserAvatar } from "./UserAvatar.js";
|
|
5
|
+
import { UserDetailsBox } from "@vanillabp/bc-shared";
|
|
5
6
|
const User = ({
|
|
7
|
+
t,
|
|
6
8
|
user,
|
|
7
9
|
isUserLoggedIn = false,
|
|
8
10
|
size = "medium",
|
|
9
11
|
iconSize
|
|
10
|
-
}) =>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
12
|
+
}) => {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
return /* @__PURE__ */ jsxs(
|
|
15
|
+
Grid,
|
|
16
|
+
{
|
|
17
|
+
fill: "horizontal",
|
|
18
|
+
gap: "small",
|
|
19
|
+
columns: ["auto", "auto", "flex"],
|
|
20
|
+
align: "center",
|
|
21
|
+
children: [
|
|
22
|
+
user.avatar === void 0 ? void 0 : /* @__PURE__ */ jsx(
|
|
23
|
+
UserAvatar,
|
|
24
|
+
{
|
|
25
|
+
t,
|
|
26
|
+
user,
|
|
27
|
+
isUserLoggedIn,
|
|
28
|
+
size: iconSize !== void 0 ? iconSize : size
|
|
29
|
+
}
|
|
30
|
+
),
|
|
31
|
+
/* @__PURE__ */ jsx(
|
|
32
|
+
Text,
|
|
33
|
+
{
|
|
34
|
+
size,
|
|
35
|
+
tip: { content: /* @__PURE__ */ jsx(UserDetailsBox, { user, t }) },
|
|
36
|
+
truncate: true,
|
|
37
|
+
children: (_b = (_a = user.displayShort) != null ? _a : user.email) != null ? _b : user.id
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
};
|
|
37
44
|
export {
|
|
38
45
|
User
|
|
39
46
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Person } from '@vanillabp/bc-official-gui-client';
|
|
2
2
|
import { BorderType } from 'grommet/utils';
|
|
3
|
+
import { TranslationFunction } from '@vanillabp/bc-shared';
|
|
3
4
|
|
|
4
5
|
declare type UserAvatarProps = {
|
|
5
|
-
|
|
6
|
+
t: TranslationFunction;
|
|
7
|
+
user: Person;
|
|
6
8
|
isUserLoggedIn?: boolean;
|
|
7
9
|
border?: BorderType;
|
|
8
10
|
size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | string;
|
|
9
11
|
};
|
|
10
|
-
declare const UserAvatar: ({ user, isUserLoggedIn, border, size, }: UserAvatarProps) => JSX.Element;
|
|
12
|
+
declare const UserAvatar: ({ t, user, isUserLoggedIn, border, size, }: UserAvatarProps) => JSX.Element;
|
|
11
13
|
|
|
12
14
|
export { UserAvatar };
|
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
__async
|
|
3
3
|
} from "../chunk-YH4NJHER.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { Anchor, Avatar, Box, Text } from "grommet";
|
|
5
|
+
import { User as UserMale } from "grommet-icons";
|
|
6
|
+
import { Avatar, Box } from "grommet";
|
|
8
7
|
import { useRef, useState } from "react";
|
|
9
|
-
import { useOnClickOutside, useResponsiveScreen } from "@vanillabp/bc-shared";
|
|
8
|
+
import { useOnClickOutside, UserDetailsBox, useResponsiveScreen } from "@vanillabp/bc-shared";
|
|
10
9
|
const hashCode = (value) => value.split("").reduce((s, c) => Math.imul(31, s) + c.charCodeAt(0) | 0, 0);
|
|
11
10
|
const UserAvatar = ({
|
|
11
|
+
t,
|
|
12
12
|
user,
|
|
13
13
|
isUserLoggedIn = false,
|
|
14
14
|
border,
|
|
@@ -61,7 +61,7 @@ const UserAvatar = ({
|
|
|
61
61
|
style: { position: "relative" },
|
|
62
62
|
onMouseDown: () => loadAndShowDetails(),
|
|
63
63
|
children: [
|
|
64
|
-
showDetails ? /* @__PURE__ */
|
|
64
|
+
showDetails ? /* @__PURE__ */ jsx(
|
|
65
65
|
Box,
|
|
66
66
|
{
|
|
67
67
|
ref,
|
|
@@ -82,35 +82,7 @@ const UserAvatar = ({
|
|
|
82
82
|
left: `calc(${symbolSize} * 0.15)`,
|
|
83
83
|
top: "0.3rem"
|
|
84
84
|
},
|
|
85
|
-
children:
|
|
86
|
-
/* @__PURE__ */ jsx(
|
|
87
|
-
Text,
|
|
88
|
-
{
|
|
89
|
-
weight: "bold",
|
|
90
|
-
children: user.id
|
|
91
|
-
}
|
|
92
|
-
),
|
|
93
|
-
/* @__PURE__ */ jsxs(
|
|
94
|
-
Box,
|
|
95
|
-
{
|
|
96
|
-
pad: { bottom: isPhone ? "medium" : "small" },
|
|
97
|
-
children: [
|
|
98
|
-
/* @__PURE__ */ jsxs(Text, { truncate: "tip", children: [
|
|
99
|
-
showDetails.firstName,
|
|
100
|
-
" ",
|
|
101
|
-
showDetails.lastName
|
|
102
|
-
] }),
|
|
103
|
-
/* @__PURE__ */ jsx(
|
|
104
|
-
Anchor,
|
|
105
|
-
{
|
|
106
|
-
href: `mailto:${showDetails.email}`,
|
|
107
|
-
children: showDetails.email
|
|
108
|
-
}
|
|
109
|
-
)
|
|
110
|
-
]
|
|
111
|
-
}
|
|
112
|
-
)
|
|
113
|
-
]
|
|
85
|
+
children: /* @__PURE__ */ jsx(UserDetailsBox, { user, t })
|
|
114
86
|
}
|
|
115
87
|
) : void 0,
|
|
116
88
|
/* @__PURE__ */ jsx(
|
|
@@ -121,7 +93,7 @@ const UserAvatar = ({
|
|
|
121
93
|
size,
|
|
122
94
|
border,
|
|
123
95
|
src: user.avatar ? `/api/v1/gui/user/${user.id}/avatar?ts=${user.avatar}` : void 0,
|
|
124
|
-
children:
|
|
96
|
+
children: /* @__PURE__ */ jsx(UserMale, { color: "light-3", size: symbolSize })
|
|
125
97
|
}
|
|
126
98
|
)
|
|
127
99
|
]
|
|
@@ -2,7 +2,7 @@ import { FC } from 'react';
|
|
|
2
2
|
import { ShowLoadingIndicatorFunction, ToastFunction, TranslationFunction, BcUserTask, UserTaskForm } from '@vanillabp/bc-shared';
|
|
3
3
|
import { OpenTaskFunction, NavigateToWorkflowFunction } from '../types/navigate.js';
|
|
4
4
|
import { TasklistApiHook } from '../types/apis.js';
|
|
5
|
-
import { AssignTaskFunction } from '../types/lists.js';
|
|
5
|
+
import { AssignTaskFunction, ClaimTaskFunction } from '../types/lists.js';
|
|
6
6
|
import '@vanillabp/bc-official-gui-client';
|
|
7
7
|
import '@vanillabp/bc-official-gui-client/dist/models/UserTasks';
|
|
8
8
|
|
|
@@ -13,6 +13,7 @@ interface UserTaskPageProps {
|
|
|
13
13
|
openTask: OpenTaskFunction;
|
|
14
14
|
navigateToWorkflow: NavigateToWorkflowFunction;
|
|
15
15
|
assignTask: AssignTaskFunction;
|
|
16
|
+
claimTask: ClaimTaskFunction;
|
|
16
17
|
useTasklistApi: TasklistApiHook;
|
|
17
18
|
t: TranslationFunction;
|
|
18
19
|
header?: React.ReactNode;
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
__spreadValues
|
|
4
4
|
} from "../chunk-YH4NJHER.js";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import { useEffect, useState } from "react";
|
|
6
|
+
import { Suspense, useEffect, useState } from "react";
|
|
7
7
|
import {
|
|
8
8
|
UserTaskAppLayout
|
|
9
9
|
} from "@vanillabp/bc-shared";
|
|
@@ -11,12 +11,15 @@ import {
|
|
|
11
11
|
NoUserTaskGiven,
|
|
12
12
|
useFederationModule
|
|
13
13
|
} from "../index.js";
|
|
14
|
-
const loadUserTask = (tasklistApi, userTaskId, setUserTask, navigateToWorkflow, openTask, unassign) => {
|
|
14
|
+
const loadUserTask = (tasklistApi, userTaskId, setUserTask, navigateToWorkflow, openTask, assign, unassign, claim, unclaim) => {
|
|
15
15
|
tasklistApi.getUserTask(userTaskId, true).then((value) => {
|
|
16
16
|
const bcUserTask = __spreadProps(__spreadValues({}, value), {
|
|
17
17
|
open: () => openTask(value),
|
|
18
18
|
navigateToWorkflow: () => navigateToWorkflow(value),
|
|
19
|
-
|
|
19
|
+
assign: (userId) => assign(value, userId),
|
|
20
|
+
unassign: (userId) => unassign(value, userId),
|
|
21
|
+
claim: () => claim(value),
|
|
22
|
+
unclaim: () => unclaim(value)
|
|
20
23
|
});
|
|
21
24
|
setUserTask(bcUserTask);
|
|
22
25
|
}).catch((error) => {
|
|
@@ -33,6 +36,7 @@ const UserTaskPage = ({
|
|
|
33
36
|
navigateToWorkflow,
|
|
34
37
|
useTasklistApi,
|
|
35
38
|
assignTask,
|
|
39
|
+
claimTask,
|
|
36
40
|
t,
|
|
37
41
|
children,
|
|
38
42
|
header,
|
|
@@ -50,7 +54,10 @@ const UserTaskPage = ({
|
|
|
50
54
|
setUserTask,
|
|
51
55
|
(userTask2) => navigateToWorkflow(userTask2),
|
|
52
56
|
(userTask2) => openTask(userTask2),
|
|
53
|
-
(userTask2, userId) => assignTask(userTask2, userId,
|
|
57
|
+
(userTask2, userId) => assignTask(userTask2, userId, false),
|
|
58
|
+
(userTask2, userId) => assignTask(userTask2, userId, true),
|
|
59
|
+
(userTask2) => claimTask(userTask2, false),
|
|
60
|
+
(userTask2) => claimTask(userTask2, true)
|
|
54
61
|
);
|
|
55
62
|
}, [userTaskId]);
|
|
56
63
|
const module = useFederationModule(userTask, "UserTaskForm");
|
|
@@ -83,7 +90,10 @@ const UserTaskPage = ({
|
|
|
83
90
|
setUserTask,
|
|
84
91
|
(userTask2) => navigateToWorkflow(userTask2),
|
|
85
92
|
(userTask2) => openTask(userTask2),
|
|
86
|
-
(userTask2, userId) => assignTask(userTask2, userId,
|
|
93
|
+
(userTask2, userId) => assignTask(userTask2, userId, false),
|
|
94
|
+
(userTask2, userId) => assignTask(userTask2, userId, true),
|
|
95
|
+
(userTask2) => claimTask(userTask2, false),
|
|
96
|
+
(userTask2) => claimTask(userTask2, true)
|
|
87
97
|
)
|
|
88
98
|
}
|
|
89
99
|
);
|
|
@@ -112,9 +122,13 @@ const UserTaskPage = ({
|
|
|
112
122
|
const Form = module.UserTaskForm;
|
|
113
123
|
const bcUserTask = __spreadProps(__spreadValues({}, userTask), {
|
|
114
124
|
open: () => openTask(userTask),
|
|
115
|
-
navigateToWorkflow: () => navigateToWorkflow(userTask)
|
|
125
|
+
navigateToWorkflow: () => navigateToWorkflow(userTask),
|
|
126
|
+
assign: (userId) => assignTask(userTask, userId, false),
|
|
127
|
+
unassign: (userId) => assignTask(userTask, userId, true),
|
|
128
|
+
claim: () => claimTask(userTask, false),
|
|
129
|
+
unclaim: () => claimTask(userTask, true)
|
|
116
130
|
});
|
|
117
|
-
return children === void 0 ? /* @__PURE__ */ jsx(UserTaskAppLayout, { header, footer, children: /* @__PURE__ */ jsx(Form, { userTask: bcUserTask }) }) : children(userTask, Form);
|
|
131
|
+
return /* @__PURE__ */ jsx(Suspense, { children: children === void 0 ? /* @__PURE__ */ jsx(UserTaskAppLayout, { header, footer, children: /* @__PURE__ */ jsx(Form, { userTask: bcUserTask }) }) : children(userTask, Form) });
|
|
118
132
|
};
|
|
119
133
|
export {
|
|
120
134
|
UserTaskPage
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { ShowLoadingIndicatorFunction, ToastFunction, TranslationFunction } from '@vanillabp/bc-shared';
|
|
2
2
|
import { OpenTaskFunction } from '../types/navigate.js';
|
|
3
|
-
import { WorkflowlistApiHook } from '../types/apis.js';
|
|
3
|
+
import { WorkflowlistApiHook, TasklistApiHook } from '../types/apis.js';
|
|
4
4
|
import '@vanillabp/bc-official-gui-client';
|
|
5
5
|
import '@vanillabp/bc-official-gui-client/dist/models/UserTasks';
|
|
6
6
|
|
|
7
|
-
declare const WorkflowPage: ({ workflowId, showLoadingIndicator, toast, useWorkflowlistApi, openTask, t, }: {
|
|
7
|
+
declare const WorkflowPage: ({ workflowId, showLoadingIndicator, toast, useWorkflowlistApi, useTasklistApi, openTask, t, }: {
|
|
8
8
|
workflowId: string | undefined;
|
|
9
9
|
showLoadingIndicator: ShowLoadingIndicatorFunction;
|
|
10
10
|
toast: ToastFunction;
|
|
11
11
|
useWorkflowlistApi: WorkflowlistApiHook;
|
|
12
|
+
useTasklistApi: TasklistApiHook;
|
|
12
13
|
openTask: OpenTaskFunction;
|
|
13
14
|
t: TranslationFunction;
|
|
14
15
|
}) => JSX.Element;
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
__spreadValues
|
|
5
5
|
} from "../chunk-YH4NJHER.js";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
import { useEffect, useRef, useState } from "react";
|
|
7
|
+
import { Suspense, useEffect, useRef, useState } from "react";
|
|
8
8
|
import {
|
|
9
9
|
NoWorkflowGiven,
|
|
10
10
|
useFederationModule
|
|
11
11
|
} from "../index.js";
|
|
12
12
|
import { Box } from "grommet";
|
|
13
|
-
const loadWorkflow = (workflowId, workflowListApi, openTask, setWorkflow) => __async(void 0, null, function* () {
|
|
13
|
+
const loadWorkflow = (workflowId, workflowListApi, tasklistApi, openTask, setWorkflow) => __async(void 0, null, function* () {
|
|
14
14
|
const workflow = yield workflowListApi.getWorkflow(workflowId);
|
|
15
15
|
const getUserTasksFunction = (activeOnly, limitListAccordingToCurrentUsersPermissions) => __async(void 0, null, function* () {
|
|
16
16
|
return (yield workflowListApi.getUserTasksOfWorkflow(
|
|
@@ -20,8 +20,12 @@ const loadWorkflow = (workflowId, workflowListApi, openTask, setWorkflow) => __a
|
|
|
20
20
|
)).map((userTask) => __spreadProps(__spreadValues({}, userTask), {
|
|
21
21
|
open: () => openTask(userTask),
|
|
22
22
|
navigateToWorkflow: () => {
|
|
23
|
-
}
|
|
23
|
+
},
|
|
24
24
|
// don't change view because workflow is already shown
|
|
25
|
+
assign: (userId) => tasklistApi.assignTask(userTask.id, userId, false),
|
|
26
|
+
unassign: (userId) => tasklistApi.assignTask(userTask.id, userId, false),
|
|
27
|
+
claim: () => tasklistApi.claimTask(userTask.id, false),
|
|
28
|
+
unclaim: () => tasklistApi.claimTask(userTask.id, true)
|
|
25
29
|
}));
|
|
26
30
|
});
|
|
27
31
|
const bcWorkflows = __spreadProps(__spreadValues({}, workflow), {
|
|
@@ -36,12 +40,14 @@ const WorkflowPage = ({
|
|
|
36
40
|
showLoadingIndicator,
|
|
37
41
|
toast,
|
|
38
42
|
useWorkflowlistApi,
|
|
43
|
+
useTasklistApi,
|
|
39
44
|
openTask,
|
|
40
45
|
t
|
|
41
46
|
}) => {
|
|
42
47
|
const loadingWorkflow = useRef(false);
|
|
43
48
|
const [workflow, setWorkflow] = useState(void 0);
|
|
44
49
|
const workflowListApi = useWorkflowlistApi();
|
|
50
|
+
const taskListApi = useTasklistApi();
|
|
45
51
|
useEffect(() => {
|
|
46
52
|
if (workflowId === void 0) {
|
|
47
53
|
return;
|
|
@@ -57,10 +63,11 @@ const WorkflowPage = ({
|
|
|
57
63
|
loadWorkflow(
|
|
58
64
|
workflowId,
|
|
59
65
|
workflowListApi,
|
|
66
|
+
taskListApi,
|
|
60
67
|
(userTask) => openTask(userTask),
|
|
61
68
|
setWorkflow
|
|
62
69
|
);
|
|
63
|
-
}, [workflowListApi,
|
|
70
|
+
}, [workflowListApi, taskListApi, workflow, loadingWorkflow, showLoadingIndicator, setWorkflow]);
|
|
64
71
|
const module = useFederationModule(workflow, "WorkflowPage");
|
|
65
72
|
useEffect(() => {
|
|
66
73
|
if (!module) {
|
|
@@ -90,6 +97,7 @@ const WorkflowPage = ({
|
|
|
90
97
|
retry: () => loadWorkflow(
|
|
91
98
|
workflowId,
|
|
92
99
|
workflowListApi,
|
|
100
|
+
taskListApi,
|
|
93
101
|
(userTask) => openTask(userTask),
|
|
94
102
|
setWorkflow
|
|
95
103
|
)
|
|
@@ -117,7 +125,7 @@ const WorkflowPage = ({
|
|
|
117
125
|
);
|
|
118
126
|
}
|
|
119
127
|
const Page = module.WorkflowPage;
|
|
120
|
-
return /* @__PURE__ */ jsx(Box, { fill: true, children: /* @__PURE__ */ jsx(Page, { workflow }) });
|
|
128
|
+
return /* @__PURE__ */ jsx(Box, { fill: true, children: /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(Page, { workflow }) }) });
|
|
121
129
|
};
|
|
122
130
|
export {
|
|
123
131
|
WorkflowPage
|
|
@@ -2,6 +2,7 @@ export { NoElementGivenByModule } from './NoElementGivenByModule.js';
|
|
|
2
2
|
export { SnapAlignBox, SnapScrollingGrid } from './SnapScrolling.js';
|
|
3
3
|
export { SnapScrollingDataTable } from './SnapScrollingDataTable.js';
|
|
4
4
|
export { ListItem, ListItemData, ListItems, RefreshItemCallbackFunction, ReloadCallbackFunction, SearchableAndSortableUpdatingList } from './SearchableAndSortableUpdatingList.js';
|
|
5
|
+
export { FulltextSearchInput } from './FulltextSearchInput.js';
|
|
5
6
|
export { ListCell, TypeOfItem } from './ListCell.js';
|
|
6
7
|
export { ListOfTasks } from './ListOfTasks.js';
|
|
7
8
|
export { ListOfWorkflows } from './ListOfWorkflows.js';
|
|
@@ -11,15 +12,16 @@ export { NoUserTaskGiven } from './NoUserTaskGiven.js';
|
|
|
11
12
|
export { UserTaskPage } from './UserTaskPage.js';
|
|
12
13
|
export { UserAvatar } from './UserAvatar.js';
|
|
13
14
|
export { User } from './User.js';
|
|
14
|
-
|
|
15
|
-
import '../types/navigate.js';
|
|
16
|
-
import '../types/apis.js';
|
|
17
|
-
import '../types/lists.js';
|
|
15
|
+
export { CustomWorkflowModuleComponent } from './CustomWorkflowModuleComponent.js';
|
|
18
16
|
import '@vanillabp/bc-shared';
|
|
19
|
-
import 'styled-components';
|
|
20
|
-
import 'react';
|
|
21
17
|
import 'grommet';
|
|
18
|
+
import 'styled-components';
|
|
22
19
|
import 'csstype';
|
|
20
|
+
import 'react';
|
|
23
21
|
import 'grommet/utils';
|
|
22
|
+
import '../utils/module-federation.js';
|
|
24
23
|
import '@vanillabp/bc-official-gui-client';
|
|
24
|
+
import '../types/navigate.js';
|
|
25
|
+
import '../types/apis.js';
|
|
25
26
|
import '@vanillabp/bc-official-gui-client/dist/models/UserTasks';
|
|
27
|
+
import '../types/lists.js';
|
package/dist/components/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./NoElementGivenByModule.js";
|
|
|
2
2
|
export * from "./SnapScrolling.js";
|
|
3
3
|
export * from "./SnapScrollingDataTable.js";
|
|
4
4
|
export * from "./SearchableAndSortableUpdatingList.js";
|
|
5
|
+
export * from "./FulltextSearchInput.js";
|
|
5
6
|
export * from "./ListCell.js";
|
|
6
7
|
export * from "./ListOfTasks.js";
|
|
7
8
|
export * from "./ListOfWorkflows.js";
|
|
@@ -11,3 +12,4 @@ export * from "./NoUserTaskGiven.js";
|
|
|
11
12
|
export * from "./UserTaskPage.js";
|
|
12
13
|
export * from "./UserAvatar.js";
|
|
13
14
|
export * from "./User.js";
|
|
15
|
+
export * from "./CustomWorkflowModuleComponent.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { NoElementGivenByModule } from './components/NoElementGivenByModule.js';
|
|
|
2
2
|
export { SnapAlignBox, SnapScrollingGrid } from './components/SnapScrolling.js';
|
|
3
3
|
export { SnapScrollingDataTable } from './components/SnapScrollingDataTable.js';
|
|
4
4
|
export { ListItem, ListItemData, ListItems, RefreshItemCallbackFunction, ReloadCallbackFunction, SearchableAndSortableUpdatingList } from './components/SearchableAndSortableUpdatingList.js';
|
|
5
|
+
export { FulltextSearchInput } from './components/FulltextSearchInput.js';
|
|
5
6
|
export { ListCell, TypeOfItem } from './components/ListCell.js';
|
|
6
7
|
export { ListOfTasks } from './components/ListOfTasks.js';
|
|
7
8
|
export { ListOfWorkflows } from './components/ListOfWorkflows.js';
|
|
@@ -11,15 +12,17 @@ export { NoUserTaskGiven } from './components/NoUserTaskGiven.js';
|
|
|
11
12
|
export { UserTaskPage } from './components/UserTaskPage.js';
|
|
12
13
|
export { UserAvatar } from './components/UserAvatar.js';
|
|
13
14
|
export { User } from './components/User.js';
|
|
14
|
-
export {
|
|
15
|
+
export { CustomWorkflowModuleComponent } from './components/CustomWorkflowModuleComponent.js';
|
|
16
|
+
export { Module, ModuleDefinition, TasklistCellProps, UiUriType, WorkflowCellProps, attachScript, detachScript, useFederationModule, useFederationModules } from './utils/module-federation.js';
|
|
17
|
+
export { sortWithColumnTypeSpecificAttributes, sortWithoutColumnTypeSpecificAttributes } from './utils/column-type.js';
|
|
15
18
|
export { NavigateToWorkflowFunction, OpenTaskFunction } from './types/navigate.js';
|
|
16
19
|
export { TasklistApi, TasklistApiHook, WakeupSseCallbackReference, WorkflowlistApi, WorkflowlistApiHook } from './types/apis.js';
|
|
17
|
-
export { AssignTaskFunction, ListOfTasksHeaderFooterFunction, ListOfWorkflowsHeaderFooterFunction } from './types/lists.js';
|
|
20
|
+
export { AssignTaskFunction, ClaimTaskFunction, ListOfTasksHeaderFooterFunction, ListOfWorkflowsHeaderFooterFunction } from './types/lists.js';
|
|
18
21
|
import '@vanillabp/bc-shared';
|
|
19
|
-
import 'styled-components';
|
|
20
|
-
import 'react';
|
|
21
22
|
import 'grommet';
|
|
23
|
+
import 'styled-components';
|
|
22
24
|
import 'csstype';
|
|
25
|
+
import 'react';
|
|
23
26
|
import 'grommet/utils';
|
|
24
27
|
import '@vanillabp/bc-official-gui-client';
|
|
25
28
|
import '@vanillabp/bc-official-gui-client/dist/models/UserTasks';
|