@giteeteam/apps-team-components 1.11.1 → 1.11.2
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.
|
@@ -62,24 +62,25 @@ const TransitionPanel = ({ itemId, itemType, workspace, objectId, onTransitionSu
|
|
|
62
62
|
const [workflowData, setWorkflowData] = useState({ nodes: [], transitions: [] });
|
|
63
63
|
const [checkResultList, setCheckResultList] = useState([]);
|
|
64
64
|
const checkApproval = useCallback(({ text }) => {
|
|
65
|
-
var _a;
|
|
65
|
+
var _a, _b;
|
|
66
66
|
if (!approval.requireApproval)
|
|
67
67
|
return [true];
|
|
68
68
|
const approvedTransitions = approval.transition.approved.map(approved => approved.label);
|
|
69
69
|
const rejectedTransitions = approval.transition.rejected.map(rejected => rejected.label);
|
|
70
70
|
const unrestrictedTransitions = ((_a = approval.transition.unrestricted) === null || _a === void 0 ? void 0 : _a.map(unrestricted => unrestricted.label)) || [];
|
|
71
|
+
const noResultRestrictions = ((_b = approval.transition.noResultRestriction) === null || _b === void 0 ? void 0 : _b.map(i => i.label)) || [];
|
|
72
|
+
const unionStatus = [ApprovalStatus.approved, ApprovalStatus.rejected];
|
|
71
73
|
if ((ApprovalStatus.approved === approval.approvalStatus && approvedTransitions.includes(text)) ||
|
|
72
74
|
(ApprovalStatus.rejected === approval.approvalStatus && rejectedTransitions.includes(text))) {
|
|
73
75
|
return [true];
|
|
74
76
|
}
|
|
75
|
-
if (!
|
|
77
|
+
if (!approval.startApproval &&
|
|
78
|
+
!unionStatus.includes(approval.approvalStatus) &&
|
|
76
79
|
(unrestrictedTransitions === null || unrestrictedTransitions === void 0 ? void 0 : unrestrictedTransitions.includes(text))) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return [false, i18n.t('pages.fields.view.unrestrictedStatus')];
|
|
82
|
-
}
|
|
80
|
+
return [true];
|
|
81
|
+
}
|
|
82
|
+
if (noResultRestrictions.includes(text)) {
|
|
83
|
+
return approval.startApproval ? [true] : [false, i18n.t('pages.fields.view.noResultRestrictedStatus')];
|
|
83
84
|
}
|
|
84
85
|
return [false, i18n.t('pages.fields.view.approvalStatus')];
|
|
85
86
|
}, [approval]);
|
package/dist/locales/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare const en: {
|
|
|
17
17
|
'pages.fields.view.noWorkflowOrAuth': string;
|
|
18
18
|
'pages.fields.view.viewWorkflow': string;
|
|
19
19
|
'pages.fields.view.unrestrictedStatus': string;
|
|
20
|
+
'pages.fields.view.noResultRestrictedStatus': string;
|
|
20
21
|
'pages.fields.view.approvalStatus': string;
|
|
21
22
|
'pages.fields.view.checkInStatus': string;
|
|
22
23
|
'pages.fields.view.readonlyStatus': string;
|
|
@@ -87,6 +88,7 @@ export declare const zh: {
|
|
|
87
88
|
'pages.fields.view.noWorkflowOrAuth': string;
|
|
88
89
|
'pages.fields.view.viewWorkflow': string;
|
|
89
90
|
'pages.fields.view.unrestrictedStatus': string;
|
|
91
|
+
'pages.fields.view.noResultRestrictedStatus': string;
|
|
90
92
|
'pages.fields.view.approvalStatus': string;
|
|
91
93
|
'pages.fields.view.checkInStatus': string;
|
|
92
94
|
'pages.fields.view.readonlyStatus': string;
|
|
@@ -157,6 +159,7 @@ export declare const ru: {
|
|
|
157
159
|
'pages.fields.view.noWorkflowOrAuth': string;
|
|
158
160
|
'pages.fields.view.viewWorkflow': string;
|
|
159
161
|
'pages.fields.view.unrestrictedStatus': string;
|
|
162
|
+
'pages.fields.view.noResultRestrictedStatus': string;
|
|
160
163
|
'pages.fields.view.approvalStatus': string;
|
|
161
164
|
'pages.fields.view.checkInStatus': string;
|
|
162
165
|
'pages.fields.view.readonlyStatus': string;
|
package/dist/locales/index.js
CHANGED
|
@@ -17,6 +17,7 @@ const en = {
|
|
|
17
17
|
'pages.fields.view.noWorkflowOrAuth': `Current state doesn't allow workflow or has no permission`,
|
|
18
18
|
'pages.fields.view.viewWorkflow': 'View workflow diagram',
|
|
19
19
|
'pages.fields.view.unrestrictedStatus': 'This transition can only be clicked before approval',
|
|
20
|
+
'pages.fields.view.noResultRestrictedStatus': 'This transition can only be clicked after approval',
|
|
20
21
|
'pages.fields.view.approvalStatus': 'The transition needs approval',
|
|
21
22
|
'pages.fields.view.checkInStatus': 'The transition needs check-in',
|
|
22
23
|
'pages.fields.view.readonlyStatus': 'Read only status, please contact the administrator for configuration.',
|
|
@@ -87,6 +88,7 @@ const zh = {
|
|
|
87
88
|
'pages.fields.view.noWorkflowOrAuth': '当前状态无法继续流转或者没有权限',
|
|
88
89
|
'pages.fields.view.viewWorkflow': '查看工作流图',
|
|
89
90
|
'pages.fields.view.unrestrictedStatus': '该流转动作只有未审批前才可点击',
|
|
91
|
+
'pages.fields.view.noResultRestrictedStatus': '该流转动作只有审批过才可点击',
|
|
90
92
|
'pages.fields.view.approvalStatus': '该流转需要审批完成后才能流转',
|
|
91
93
|
'pages.fields.view.checkInStatus': '该流转需要签到完成后才能流转',
|
|
92
94
|
'pages.fields.view.readonlyStatus': '只读状态,请联系管理员配置。',
|
|
@@ -156,7 +158,8 @@ const ru = {
|
|
|
156
158
|
'pages.fields.default.noItemType': 'Тип задачи не указан',
|
|
157
159
|
'pages.fields.view.noWorkflowOrAuth': `Текущее состояние не допускает рабочий процесс или не имеет разрешения`,
|
|
158
160
|
'pages.fields.view.viewWorkflow': 'Посмотреть схему рабочего процесса',
|
|
159
|
-
'pages.fields.view.unrestrictedStatus': '
|
|
161
|
+
'pages.fields.view.unrestrictedStatus': 'Этот переход можно нажать только до утверждения',
|
|
162
|
+
'pages.fields.view.noResultRestrictedStatus': 'Этот переход можно нажать только после утверждения',
|
|
160
163
|
'pages.fields.view.approvalStatus': 'Данный перевод требует подтверждения',
|
|
161
164
|
'pages.fields.view.checkInStatus': 'The transition needs check-in',
|
|
162
165
|
'pages.fields.view.readonlyStatus': 'Статус только для чтения, пожалуйста, свяжитесь с администратором для настройки.',
|