@giteeteam/apps-team-components 1.3.2-alpha.1 → 1.3.3

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 CHANGED
@@ -19,3 +19,6 @@ pnpm storybook
19
19
 
20
20
  # 1.2.x版本
21
21
  - team最低版本为4.21.0
22
+
23
+ # 1.3.x版本
24
+ - team最低版本为4.23.0
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { NodeItemProps } from '../../../lib/types/workflow';
2
3
  interface SelectFlowHandlerProps {
3
4
  itemId: string;
4
5
  onBack: () => void;
@@ -7,7 +8,7 @@ interface SelectFlowHandlerProps {
7
8
  loading: boolean;
8
9
  loadingUser: boolean;
9
10
  fetchUsers: (itemId: string, status: string, keyword?: string) => Promise<void>;
10
- handleTransition: (updateTask: string, screenId: string, script: string, flowHandler?: Array<{
11
+ handleTransition: (updateTask: string, screenId: string, script: string, target: NodeItemProps, flowHandler?: Array<{
11
12
  label: string;
12
13
  value: string;
13
14
  }>) => void;
@@ -55,7 +55,7 @@ const SelectFlowHandler = ({ itemId, task, onBack, users, loading, loadingUser,
55
55
  label: user.nickname ? `${user.nickname}(${user.username})` : user.username,
56
56
  value: user.objectId,
57
57
  }));
58
- handleTransition(task.name, (_b = (_a = task.parameters) === null || _a === void 0 ? void 0 : _a.screen) === null || _b === void 0 ? void 0 : _b.key, (_c = task.parameters) === null || _c === void 0 ? void 0 : _c.scriptValidator, submitUsers);
58
+ handleTransition(task.name, (_b = (_a = task.parameters) === null || _a === void 0 ? void 0 : _a.screen) === null || _b === void 0 ? void 0 : _b.key, (_c = task.parameters) === null || _c === void 0 ? void 0 : _c.scriptValidator, task.target, submitUsers);
59
59
  }, [
60
60
  handleTransition,
61
61
  selectedUserIds.length,
@@ -63,6 +63,7 @@ const SelectFlowHandler = ({ itemId, task, onBack, users, loading, loadingUser,
63
63
  task.name,
64
64
  (_b = (_a = task.parameters) === null || _a === void 0 ? void 0 : _a.screen) === null || _b === void 0 ? void 0 : _b.key,
65
65
  (_c = task.parameters) === null || _c === void 0 ? void 0 : _c.scriptValidator,
66
+ task.target,
66
67
  ]);
67
68
  const OverflowText = () => {
68
69
  var _a, _b;
@@ -18,7 +18,7 @@ interface SelectTransitionProps {
18
18
  workspaceRoleIds: string[];
19
19
  approval: ApprovalData;
20
20
  checkIn: CheckInData;
21
- handleTransition: (updateTask: string, screenId: string, script: string) => void;
21
+ handleTransition: (updateTask: string, screenId: string, script: string, target?: any) => void;
22
22
  readonly: boolean;
23
23
  flowHandlerActive?: boolean;
24
24
  }
@@ -23,7 +23,7 @@ interface FlowButtonProps {
23
23
  conditions?: ConditionType[];
24
24
  approval: ApprovalData;
25
25
  checkIn: CheckInData;
26
- handleTransition: (updateTask: string, screenId: string, script: string) => void;
26
+ handleTransition: (updateTask: string, screenId: string, script: string, target: NodeItemProps) => void;
27
27
  target: NodeItemProps & {
28
28
  type?: string;
29
29
  };
@@ -118,7 +118,7 @@ const FlowButton = ({ loading, screenId, text, item, userId, roleIds, groupIds,
118
118
  return (jsx(ClassNames, { children: ({ cx, css }) => {
119
119
  return isCheck && !readonly ? (jsx("div", { className: cx(css(flowBtnStyle), loading ? css(notAllowedStyle) : css(pointerStyle)), onClick: () => {
120
120
  if (!loading) {
121
- handleTransition(text, screenId, scriptValidator);
121
+ handleTransition(text, screenId, scriptValidator, target);
122
122
  }
123
123
  }, children: jsx(OverflowText, { text: text, target: target }) })) : (jsx(Tooltip, { title: tipContent, placement: "right", children: jsx("div", { className: cx(css(flowBtnStyle), css(notAllowedStyle)), children: jsx(OverflowText, { text: text, target: target }) }) }));
124
124
  } }));
@@ -172,13 +172,16 @@ const TransitionPanel = ({ itemId, itemType, workspace, objectId, onTransitionSu
172
172
  const submitTransition = useCallback(async (itemDetail) => {
173
173
  await submitHandle(updateTransitionText, itemDetail);
174
174
  }, [submitHandle, updateTransitionText]);
175
- const handleTransition = useCallback(async (transitionText, screenId, scriptValidator, flowHandler) => {
175
+ const handleTransition = useCallback(async (transitionText, screenId, scriptValidator, target, flowHandler) => {
176
176
  if (flowHandlerActive) {
177
177
  if (transitionStep === TransitionStepType.SelectTransition) {
178
- setCurrentFlowHandler(undefined);
179
- setFlowTask(tasks.find(task => task.name === transitionText));
180
- setTransitionStep(TransitionStepType.SelectFlowHandler);
181
- return;
178
+ const nextStateTransition = workflowData.transitions.find(t => t.source.id === target.key);
179
+ if (nextStateTransition) {
180
+ setCurrentFlowHandler(undefined);
181
+ setFlowTask(tasks.find(task => task.name === transitionText));
182
+ setTransitionStep(TransitionStepType.SelectFlowHandler);
183
+ return;
184
+ }
182
185
  }
183
186
  else {
184
187
  console.info('flowHandler', flowHandler);
@@ -221,8 +224,9 @@ const TransitionPanel = ({ itemId, itemType, workspace, objectId, onTransitionSu
221
224
  }
222
225
  }, [
223
226
  flowHandlerActive,
224
- transitionStep,
225
227
  setFlowing,
228
+ transitionStep,
229
+ workflowData.transitions,
226
230
  tasks,
227
231
  itemId,
228
232
  itemType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giteeteam/apps-team-components",
3
- "version": "1.3.2-alpha.1",
3
+ "version": "1.3.3",
4
4
  "description": "Gitee team components",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",