@giteeteam/apps-team-components 1.2.2 → 1.3.0-alpha.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.
- package/README.md +21 -28
- package/dist/components/common/EmptyField.d.ts +0 -1
- package/dist/components/common/EmptyField.js +7 -5
- package/dist/components/common/PriceTag.js +26 -23
- package/dist/components/common/expand-component/index.d.ts +22 -0
- package/dist/components/common/expand-component/index.js +67 -0
- package/dist/components/common/expand-component/style.d.ts +2 -0
- package/dist/components/common/expand-component/style.js +10 -0
- package/dist/components/common/item-icon/ItemIcon.d.ts +7 -0
- package/dist/components/common/item-icon/ItemIcon.js +8 -0
- package/dist/components/common/overflow-tooltip/BaseOverflowTooltip.d.ts +0 -1
- package/dist/components/common/overflow-tooltip/BaseOverflowTooltip.js +9 -6
- package/dist/components/common/overflow-tooltip/OverflowTooltip.d.ts +19 -0
- package/dist/components/common/overflow-tooltip/OverflowTooltip.js +57 -0
- package/dist/components/common/overflow-tooltip/SimpleOverflowToolTip.js +8 -5
- package/dist/components/common/overflow-tooltip/style/index.js +16 -14
- package/dist/components/common/style/global.js +4 -2
- package/dist/components/common/style/mixin.d.ts +2 -0
- package/dist/components/common/style/mixin.js +20 -0
- package/dist/components/common/user-field/UserAvatar.js +8 -6
- package/dist/components/common/user-field/style/index.js +23 -21
- package/dist/components/common/utils.d.ts +6 -0
- package/dist/components/common/utils.js +63 -5
- package/dist/components/default-empty-icon/config.d.ts +2 -0
- package/dist/components/default-empty-icon/config.js +24 -0
- package/dist/components/default-empty-icon/index.d.ts +5 -0
- package/dist/components/default-empty-icon/index.js +24 -0
- package/dist/components/default-empty-icon/style.d.ts +11 -0
- package/dist/components/default-empty-icon/style.js +67 -0
- package/dist/components/default-empty-icon/types.d.ts +29 -0
- package/dist/components/default-empty-icon/types.js +8 -0
- package/dist/components/field-behavior/fields/type.js +5 -2
- package/dist/components/fields/actors/BaseField.js +5 -2
- package/dist/components/fields/actors/ReadView.d.ts +0 -1
- package/dist/components/fields/actors/ReadView.js +8 -6
- package/dist/components/fields/ancestor/ReadView.js +8 -6
- package/dist/components/fields/ancestor/utils.js +4 -12
- package/dist/components/fields/assignee/ReadView.d.ts +0 -1
- package/dist/components/fields/assignee/ReadView.js +13 -11
- package/dist/components/fields/base-component/types.d.ts +1 -0
- package/dist/components/fields/base-component/utils.d.ts +2 -0
- package/dist/components/fields/base-component/utils.js +11 -0
- package/dist/components/fields/bind-workspace/ReadView.d.ts +0 -1
- package/dist/components/fields/bind-workspace/ReadView.js +11 -9
- package/dist/components/fields/bind-workspace/hooks.js +10 -7
- package/dist/components/fields/bind-workspace/style/index.js +5 -3
- package/dist/components/fields/cascade/ReadView.js +8 -6
- package/dist/components/fields/cascade/utils.js +4 -3
- package/dist/components/fields/checkbox/ReadView.d.ts +0 -1
- package/dist/components/fields/checkbox/ReadView.js +7 -5
- package/dist/components/fields/created-at/ReadView.js +10 -8
- package/dist/components/fields/created-by/ReadView.d.ts +0 -1
- package/dist/components/fields/created-by/ReadView.js +11 -9
- package/dist/components/fields/data-quote/ReadView.js +12 -10
- package/dist/components/fields/data-quote/utils.js +5 -3
- package/dist/components/fields/date/ReadView.d.ts +0 -1
- package/dist/components/fields/date/ReadView.js +8 -6
- package/dist/components/fields/dropdown/BaseField.d.ts +24 -2
- package/dist/components/fields/dropdown/BaseField.js +565 -2
- package/dist/components/fields/dropdown/Cell.d.ts +3 -0
- package/dist/components/fields/dropdown/Cell.js +8 -0
- package/dist/components/fields/dropdown/ReadView.d.ts +0 -1
- package/dist/components/fields/dropdown/ReadView.js +10 -8
- package/dist/components/fields/dropdown/data.d.ts +9 -0
- package/dist/components/fields/dropdown/data.js +29 -0
- package/dist/components/fields/dropdown/hook.d.ts +102 -0
- package/dist/components/fields/dropdown/hook.js +155 -0
- package/dist/components/fields/dropdown/style.d.ts +16 -0
- package/dist/components/fields/dropdown/style.js +93 -0
- package/dist/components/fields/file/ReadView.d.ts +0 -1
- package/dist/components/fields/file/ReadView.js +7 -5
- package/dist/components/fields/formula/ReadView.d.ts +0 -1
- package/dist/components/fields/formula/ReadView.js +7 -5
- package/dist/components/fields/hooks/useViewClass.d.ts +11 -0
- package/dist/components/fields/hooks/useViewClass.js +20 -0
- package/dist/components/fields/hyper-link/ReadView.d.ts +0 -1
- package/dist/components/fields/hyper-link/ReadView.js +8 -6
- package/dist/components/fields/hyper-link/style/index.js +18 -15
- package/dist/components/fields/item-group/ReadView.d.ts +0 -1
- package/dist/components/fields/item-group/ReadView.js +6 -4
- package/dist/components/fields/item-type/ItemTypeIcon.d.ts +9 -0
- package/dist/components/fields/item-type/ItemTypeIcon.js +31 -0
- package/dist/components/fields/item-type/ReadView.d.ts +0 -1
- package/dist/components/fields/item-type/ReadView.js +7 -5
- package/dist/components/fields/item-type/style/index.d.ts +1 -0
- package/dist/components/fields/item-type/style/index.js +8 -0
- package/dist/components/fields/key/ReadView.d.ts +0 -1
- package/dist/components/fields/key/ReadView.js +7 -5
- package/dist/components/fields/long-text/ReadView.d.ts +0 -1
- package/dist/components/fields/long-text/ReadView.js +8 -6
- package/dist/components/fields/long-text/style/index.js +7 -5
- package/dist/components/fields/number/BaseField.js +5 -2
- package/dist/components/fields/number/ReadView.d.ts +0 -1
- package/dist/components/fields/number/ReadView.js +8 -6
- package/dist/components/fields/priority/ReadView.js +12 -10
- package/dist/components/fields/priority/style/index.js +54 -51
- package/dist/components/fields/radio/ReadView.d.ts +0 -1
- package/dist/components/fields/radio/ReadView.js +8 -6
- package/dist/components/fields/repo-files/ReadView.js +8 -6
- package/dist/components/fields/repo-files/utils.js +5 -3
- package/dist/components/fields/reporter/ReadView.d.ts +0 -1
- package/dist/components/fields/reporter/ReadView.js +11 -9
- package/dist/components/fields/script/BaseField.js +4 -1
- package/dist/components/fields/script/ReadView.d.ts +0 -1
- package/dist/components/fields/script/ReadView.js +10 -8
- package/dist/components/fields/sprint/ReadView.js +7 -5
- package/dist/components/fields/status/Cell.js +8 -6
- package/dist/components/fields/status/Field.d.ts +0 -1
- package/dist/components/fields/status/ReadView.js +10 -8
- package/dist/components/fields/status/SelectFlowHandler.js +15 -12
- package/dist/components/fields/status/SelectTransition.js +13 -10
- package/dist/components/fields/status/Transition.js +18 -15
- package/dist/components/fields/status/TransitionButton.js +17 -14
- package/dist/components/fields/status/TransitionPanel.js +14 -11
- package/dist/components/fields/status/View.js +11 -8
- package/dist/components/fields/status/style/index.js +302 -325
- package/dist/components/fields/story-point/ReadView.d.ts +0 -1
- package/dist/components/fields/story-point/ReadView.js +6 -4
- package/dist/components/fields/tag/ReadView.js +10 -8
- package/dist/components/fields/tag/style/index.js +7 -5
- package/dist/components/fields/team/ReadView.js +10 -8
- package/dist/components/fields/team/style/index.js +5 -3
- package/dist/components/fields/text/BaseField.d.ts +0 -1
- package/dist/components/fields/text/ReadView.js +8 -6
- package/dist/components/fields/tree/ReadView.js +10 -8
- package/dist/components/fields/tree/utils.js +5 -3
- package/dist/components/fields/updated-at/ReadView.js +10 -8
- package/dist/components/fields/updated-by/ReadView.d.ts +0 -1
- package/dist/components/fields/updated-by/ReadView.js +11 -9
- package/dist/components/fields/user/ReadView.d.ts +0 -1
- package/dist/components/fields/user/ReadView.js +11 -9
- package/dist/components/fields/user/style/index.js +12 -9
- package/dist/components/fields/user-group/BaseField.d.ts +0 -1
- package/dist/components/fields/user-group/ReadView.js +12 -14
- package/dist/components/fields/version/ReadView.js +8 -6
- package/dist/components/fields/workspace/ReadView.d.ts +0 -1
- package/dist/components/fields/workspace/ReadView.js +10 -8
- package/dist/components/filters/filter-search/utils.d.ts +4 -0
- package/dist/components/filters/filter-search/utils.js +28 -0
- package/dist/components/item/hooks.js +5 -2
- package/dist/components/table-components/EditTableCell.d.ts +1 -0
- package/dist/components/table-components/EditTableCell.js +8 -4
- package/dist/components/table-components/index.js +14 -11
- package/dist/components/table-components/style/index.js +7 -5
- package/dist/components/table-components/utils.js +50 -45
- package/dist/icons/SyncIconFont.d.ts +6 -0
- package/dist/icons/SyncIconFont.js +17 -0
- package/dist/icons/createFromIconFontClass.d.ts +4 -0
- package/dist/icons/createFromIconFontClass.js +35 -0
- package/dist/icons/empty-icon/data-empty.png +0 -0
- package/dist/icons/empty-icon/forbidden.png +0 -0
- package/dist/icons/empty-icon/index.d.ts +8 -0
- package/dist/icons/empty-icon/large-item@2x.png +0 -0
- package/dist/icons/empty-icon/large-item@2x.png.js +3 -0
- package/dist/icons/empty-icon/large-workspace@2x.png +0 -0
- package/dist/icons/empty-icon/large-workspace@2x.png.js +3 -0
- package/dist/icons/empty-icon/load-error.png +0 -0
- package/dist/icons/empty-icon/not-found.png +0 -0
- package/dist/icons/empty-icon/small-default@2x.png +0 -0
- package/dist/icons/empty-icon/small-default@2x.png.js +3 -0
- package/dist/icons/empty-icon/workspace-empty.svg +127 -0
- package/dist/icons/index.d.ts +58 -1
- package/dist/icons/index.js +315 -19
- package/dist/icons/style/index.d.ts +2 -0
- package/dist/icons/style/index.js +25 -0
- package/dist/icons/svg/ArrowBack.svg.js +3 -0
- package/dist/icons/svg/Done.svg.js +3 -0
- package/dist/icons/svg/DottedCircle.svg.js +3 -0
- package/dist/icons/svg/HollowCircle.svg.js +3 -0
- package/dist/icons/svg/Search.svg.js +3 -0
- package/dist/icons/svg/Workflow.svg.js +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +47 -46
- package/dist/lib/app/utils.d.ts +2 -0
- package/dist/lib/app/utils.js +18 -0
- package/dist/lib/array.js +5 -44
- package/dist/lib/config.d.ts +14 -0
- package/dist/lib/config.js +47 -0
- package/dist/lib/constants/code.d.ts +4 -0
- package/dist/lib/constants/code.js +6 -0
- package/dist/lib/constants/field.d.ts +1 -0
- package/dist/lib/constants/field.js +5 -0
- package/dist/lib/contexts/antdConfig.js +10 -7
- package/dist/lib/contexts/currentUser.js +7 -4
- package/dist/lib/contexts/currentWorkspace.js +7 -4
- package/dist/lib/contexts/datetimeFormat.js +7 -4
- package/dist/lib/contexts/index.js +16 -13
- package/dist/lib/contexts/itemConfig.js +7 -4
- package/dist/lib/contexts/teamConfig.d.ts +3 -0
- package/dist/lib/contexts/teamConfig.js +25 -7
- package/dist/lib/contexts/tenant.js +7 -4
- package/dist/lib/contexts/workflowConfig.js +7 -4
- package/dist/lib/dataType.js +4 -5
- package/dist/lib/date.js +11 -52
- package/dist/lib/dayjs.js +2 -1
- package/dist/lib/error/index.d.ts +2 -0
- package/dist/lib/error/log.d.ts +10 -0
- package/dist/lib/error/log.js +28 -0
- package/dist/lib/error/utils.d.ts +14 -0
- package/dist/lib/error/utils.js +38 -0
- package/dist/lib/error/withServerError.d.ts +1 -0
- package/dist/lib/error/withServerError.js +3 -0
- package/dist/lib/fetch.d.ts +45 -0
- package/dist/lib/fetch.js +270 -0
- package/dist/lib/global.d.ts +18 -0
- package/dist/lib/global.js +28 -8
- package/dist/lib/hooks/useAntdConfig.js +4 -2
- package/dist/lib/hooks/useCurrentUser.js +4 -2
- package/dist/lib/hooks/useCurrentWorkspace.js +4 -2
- package/dist/lib/hooks/useDataQuoteStore.js +8 -5
- package/dist/lib/hooks/useDateTimeFormatType.js +4 -2
- package/dist/lib/hooks/useI18n.d.ts +1 -1
- package/dist/lib/hooks/useI18n.js +4 -2
- package/dist/lib/hooks/useItemConfig.js +4 -2
- package/dist/lib/hooks/useTeamConfig.js +4 -2
- package/dist/lib/hooks/useTenant.js +4 -2
- package/dist/lib/hooks/useWorkflowConfig.js +4 -2
- package/dist/lib/i18n.d.ts +1 -0
- package/dist/lib/i18n.js +6 -2
- package/dist/lib/icons/utils.d.ts +23 -0
- package/dist/lib/icons/utils.js +60 -0
- package/dist/lib/isInOne.js +2 -1
- package/dist/lib/number.js +3 -1
- package/dist/lib/path.d.ts +5 -0
- package/dist/lib/path.js +50 -0
- package/dist/lib/regExp.js +3 -1
- package/dist/lib/router.d.ts +23 -0
- package/dist/lib/router.js +23 -0
- package/dist/lib/storage.d.ts +10 -0
- package/dist/lib/storage.js +27 -0
- package/dist/lib/store/dataQuoteStore.js +5 -2
- package/dist/lib/swr/constants.js +4 -2
- package/dist/lib/swr/hooks.js +6 -3
- package/dist/lib/swr/throttleWithCache.d.ts +17 -0
- package/dist/lib/swr/throttleWithCache.js +110 -0
- package/dist/lib/throttleFetch.d.ts +2 -0
- package/dist/lib/throttleFetch.js +68 -0
- package/dist/lib/useConfig.d.ts +8 -0
- package/dist/lib/useConfig.js +31 -0
- package/dist/lib/useUser.js +9 -6
- package/dist/lib/users.js +5 -2
- package/dist/lib/workflow.js +21 -20
- package/dist/locales/index.d.ts +45 -0
- package/dist/locales/index.js +50 -3
- package/dist/public/icons/BulbIcon.svg +1 -0
- package/dist/public/icons/Cloud.svg +1 -0
- package/dist/public/icons/ConsultIcon.svg +1 -0
- package/dist/public/icons/Demo.svg +1 -0
- package/dist/public/icons/ErrorTemplate.svg +1 -0
- package/dist/public/icons/Fail.svg +1 -0
- package/dist/public/icons/Flag.svg +1 -0
- package/dist/public/icons/GiteeIcon.svg +1 -0
- package/dist/public/icons/IntelligenceGradient.svg +1 -0
- package/dist/public/icons/Issue_Approval.svg +1 -0
- package/dist/public/icons/Issue_Bug.svg +1 -0
- package/dist/public/icons/Issue_Demand.svg +1 -0
- package/dist/public/icons/Issue_Doc.svg +1 -0
- package/dist/public/icons/Issue_Idea.svg +1 -0
- package/dist/public/icons/Issue_List.svg +1 -0
- package/dist/public/icons/Issue_Plan.svg +1 -0
- package/dist/public/icons/Issue_Product.svg +1 -0
- package/dist/public/icons/Issue_Risk.svg +1 -0
- package/dist/public/icons/Issue_Story.svg +1 -0
- package/dist/public/icons/Issue_Subtask.svg +1 -0
- package/dist/public/icons/Issue_Task.svg +1 -0
- package/dist/public/icons/Issue_Test.svg +1 -0
- package/dist/public/icons/Issue_TestExcution.svg +1 -0
- package/dist/public/icons/Issue_TestPlan.svg +1 -0
- package/dist/public/icons/Issue_Time.svg +1 -0
- package/dist/public/icons/Issue_develop.svg +1 -0
- package/dist/public/icons/KanbanCover.svg +7 -0
- package/dist/public/icons/ListCover.svg +118 -0
- package/dist/public/icons/ManHour.svg +1 -0
- package/dist/public/icons/MobileIcon.svg +1 -0
- package/dist/public/icons/NoItemType.svg +10 -0
- package/dist/public/icons/ProductIcon.svg +1 -0
- package/dist/public/icons/RedFlagIcon.svg +1 -0
- package/dist/public/icons/Safe.svg +1 -0
- package/dist/public/icons/StarIcon.svg +61 -0
- package/dist/public/icons/StructureCover.svg +1 -0
- package/dist/public/icons/Success.svg +1 -0
- package/dist/public/icons/TeamIcon.svg +1 -0
- package/dist/public/icons/WebIcon.svg +1 -0
- package/dist/public/icons/iconfont.svg +467 -0
- package/dist/public/icons/iconfont.ttf +0 -0
- package/dist/public/icons/iconfont.woff +0 -0
- package/dist/public/icons/iconfont.woff2 +0 -0
- package/dist/public/icons/iconfont_multiple_color.js +1 -0
- package/dist/public/icons/iconfont_single_color.css +912 -0
- package/dist/public/icons/iconfont_single_color.js +1 -0
- package/dist/public/icons/loginBg.svg +1 -0
- package/dist/public/mockServiceWorker.js +284 -0
- package/dist/style/common.d.ts +1 -0
- package/dist/style/common.js +19 -23
- package/dist/style/global.d.ts +1 -0
- package/dist/style/global.js +10 -0
- package/package.json +111 -69
- package/dist/components/fields/base-component/types.js +0 -1
- package/dist/components/fields/hooks/useParamsAdapter.js +0 -1
- package/dist/components/fields/radio/BaseField.js +0 -1
- package/dist/components/fields/status/Field.js +0 -1
- package/dist/components/fields/tag/BaseField.js +0 -1
- package/dist/components/fields/text/BaseField.js +0 -1
- package/dist/components/fields/tree/BaseField.js +0 -1
- package/dist/components/fields/tree/types.js +0 -1
- package/dist/components/fields/types.js +0 -1
- package/dist/components/fields/user-group/ActionCell.js +0 -1
- package/dist/components/fields/user-group/BaseField.js +0 -1
- package/dist/icons/svg/ArrowBack.svg +0 -1
- package/dist/icons/svg/Done.svg +0 -1
- package/dist/icons/svg/DottedCircle.svg +0 -7
- package/dist/icons/svg/HollowCircle.svg +0 -6
- package/dist/icons/svg/Search.svg +0 -1
- package/dist/icons/svg/Workflow.svg +0 -12
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import React, { memo,
|
|
1
|
+
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import React, { memo, useEffect, useCallback } from 'react';
|
|
3
3
|
import { ClassNames, css } from '@emotion/react';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { ArrowBackIcon,
|
|
7
|
-
import { WorkFlowStatusColor } from '../../../lib/global';
|
|
8
|
-
import { i18n } from '../../../lib/i18n';
|
|
9
|
-
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
|
|
10
|
-
import { FlowHandlerHeader, FlowHandlerSearchWrapper, FlowHandlerSelectContent, FlowHandlerSelectItem,
|
|
4
|
+
import { message, Input, Spin, Button } from 'antd';
|
|
5
|
+
import { debounce, cloneDeep } from 'lodash-es';
|
|
6
|
+
import { ArrowBackIcon, SearchIcon, DoneIcon } from '../../../icons/index.js';
|
|
7
|
+
import { WorkFlowStatusColor } from '../../../lib/global.js';
|
|
8
|
+
import { i18n } from '../../../lib/i18n.js';
|
|
9
|
+
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip.js';
|
|
10
|
+
import { FlowHandlerWrapper, FlowHandlerHeader, FlowHandlerSearchWrapper, FlowHandlerSelectMessage, FlowHandlerSelectContent, FlowHandlerSelectItem, FlowHandlerSubmitWrapper, overflowStyle, tooltipStyle, overflowStyleText, headerFlowStyle, iconStyle, stateBoxStyle, headerStateStyle, flowStateStyle } from './style/index.js';
|
|
11
|
+
|
|
11
12
|
const SelectFlowHandler = ({ itemId, task, onBack, users, loading, loadingUser, fetchUsers, handleTransition, }) => {
|
|
12
13
|
var _a, _b, _c;
|
|
13
14
|
const [selectedUsers, setSelectedUsers] = React.useState([]);
|
|
@@ -65,11 +66,13 @@ const SelectFlowHandler = ({ itemId, task, onBack, users, loading, loadingUser,
|
|
|
65
66
|
]);
|
|
66
67
|
const OverflowText = () => {
|
|
67
68
|
var _a, _b;
|
|
68
|
-
return (
|
|
69
|
+
return (jsxs("div", { css: css(overflowStyle), children: [jsx(BaseOverflowTooltip, { css: css(tooltipStyle, overflowStyleText, headerFlowStyle), title: task.name, children: task.name }), jsx("span", { css: css(iconStyle), children: " \u2192 " }), jsx("div", { css: css(stateBoxStyle), children: jsx("span", { css: css(overflowStyleText, headerStateStyle), children: jsx(BaseOverflowTooltip, { css: css(flowStateStyle, overflowStyleText), style: {
|
|
69
70
|
backgroundColor: (_a = WorkFlowStatusColor[task.target.type]) === null || _a === void 0 ? void 0 : _a.bgColor,
|
|
70
71
|
color: (_b = WorkFlowStatusColor[task.target.type]) === null || _b === void 0 ? void 0 : _b.color,
|
|
71
72
|
}, title: task.target.name, children: task.target.name }) }) })] }));
|
|
72
73
|
};
|
|
73
|
-
return (
|
|
74
|
+
return (jsx(ClassNames, { children: ({ cx, css }) => (jsxs("div", { className: cx(css(FlowHandlerWrapper)), children: [jsxs("header", { className: cx(css(FlowHandlerHeader)), children: [jsx("span", { className: "back-wrapper", onClick: () => onBack === null || onBack === void 0 ? void 0 : onBack(), children: jsx(ArrowBackIcon, { className: "icon-back" }) }), jsx("span", { children: i18n.t('pages.workflow.flowHandler.title') })] }), task && jsx(OverflowText, {}), jsxs("div", { className: cx(css(FlowHandlerSearchWrapper)), children: [jsx(SearchIcon, { className: "icon-search" }), jsx(Input, { className: "search-input", placeholder: i18n.t('pages.workflow.flowHandler.search'), onChange: e => onSearch === null || onSearch === void 0 ? void 0 : onSearch(e.target.value), allowClear: true })] }), jsxs("div", { className: cx(css(FlowHandlerSelectMessage)), children: [jsx("span", { onClick: selectAll, children: i18n.t('pages.workflow.flowHandler.selectAll') }), jsx("span", { children: i18n.t('pages.workflow.flowHandler.count', { count: selectedUserIds.length }) }), jsx("span", { onClick: clearSelect, children: i18n.t('pages.workflow.flowHandler.clear') })] }), jsx("div", { className: cx(css(FlowHandlerSelectContent)), children: jsx(Spin, { spinning: loadingUser, className: "loading", children: users.map(user => (jsxs("div", { className: cx(css(FlowHandlerSelectItem), { active: selectedUserIds.includes(user.objectId) }), onClick: () => selectUser(user), children: [user.username, " ", user.nickname ? `(${user.nickname})` : '', jsx("span", { children: selectedUserIds.includes(user.objectId) && jsx(DoneIcon, { className: "icon-done" }) })] }, user.objectId))) }) }), jsx("div", { className: cx(css(FlowHandlerSubmitWrapper)), children: jsx(Button, { type: "primary", onClick: onSubmit, loading: loading, disabled: !selectedUserIds.length, children: i18n.t('pages.workflow.flowHandler.submit') }) })] })) }));
|
|
74
75
|
};
|
|
75
|
-
|
|
76
|
+
var SelectFlowHandler$1 = memo(SelectFlowHandler);
|
|
77
|
+
|
|
78
|
+
export { SelectFlowHandler$1 as default };
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { ClassNames } from '@emotion/react';
|
|
4
4
|
import { Spin } from 'antd';
|
|
5
|
-
import { i18n } from '../../../lib/i18n';
|
|
6
|
-
import { flowNextStyle, flowWrapperStyle, noPermissionStyle
|
|
7
|
-
import TransitionButton from './TransitionButton';
|
|
8
|
-
import View from './View';
|
|
5
|
+
import { i18n } from '../../../lib/i18n.js';
|
|
6
|
+
import { spinStyle, flowNextStyle, flowWrapperStyle, noPermissionStyle } from './style/index.js';
|
|
7
|
+
import TransitionButton from './TransitionButton.js';
|
|
8
|
+
import View from './View.js';
|
|
9
|
+
|
|
9
10
|
const SelectTransition = ({ fetching, flowing, tasks, itemId, itemData, currentUser, workspace, setPopoverVisible, name, objectId, workflowData, roleIds, groupIds, workspaceRoleIds, approval, checkIn, handleTransition, readonly, flowHandlerActive, }) => {
|
|
10
|
-
return (
|
|
11
|
+
return (jsx(ClassNames, { children: ({ cx, css }) => (jsxs(Fragment, { children: [fetching ? (jsx(Spin, { css: css(spinStyle) })) : tasks.length ? (jsx("div", { className: cx(css(flowNextStyle), `flow-next-global`), children: jsx("div", { className: cx(css(flowWrapperStyle)), children: tasks.map(task => {
|
|
11
12
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
12
|
-
return (
|
|
13
|
-
}) }) })) : (
|
|
13
|
+
return (jsx(TransitionButton, { itemId: itemId, loading: flowing, text: task.name, item: itemData, workspace: workspace, userId: currentUser.id, groupIds: groupIds, roleIds: roleIds, workspaceRoleIds: workspaceRoleIds, currentTaskId: task.id, authUsers: (_b = (_a = task.parameters) === null || _a === void 0 ? void 0 : _a.permissionType) === null || _b === void 0 ? void 0 : _b.users, authRoles: (_d = (_c = task.parameters) === null || _c === void 0 ? void 0 : _c.permissionType) === null || _d === void 0 ? void 0 : _d.roles, authGroups: (_f = (_e = task.parameters) === null || _e === void 0 ? void 0 : _e.permissionType) === null || _f === void 0 ? void 0 : _f.groups, authUserFields: (_h = (_g = task.parameters) === null || _g === void 0 ? void 0 : _g.permissionType) === null || _h === void 0 ? void 0 : _h.customFields, authWorkSpaceRoles: (_k = (_j = task.parameters) === null || _j === void 0 ? void 0 : _j.permissionType) === null || _k === void 0 ? void 0 : _k.workspaceRoles, creatorAuth: (_m = (_l = task.parameters) === null || _l === void 0 ? void 0 : _l.permissionType) === null || _m === void 0 ? void 0 : _m.creatorAuth, scriptValidator: (_o = task.parameters) === null || _o === void 0 ? void 0 : _o.scriptValidator, conditions: (_p = task.parameters) === null || _p === void 0 ? void 0 : _p.fieldType, screenId: (_r = (_q = task.parameters) === null || _q === void 0 ? void 0 : _q.screen) === null || _r === void 0 ? void 0 : _r.key, target: task.target, approval: approval, checkIn: checkIn, handleTransition: handleTransition, hiddenPopover: () => setPopoverVisible(false), readonly: readonly, flowHandlerActive: flowHandlerActive }, task.id));
|
|
14
|
+
}) }) })) : (jsx("span", { onClick: () => {
|
|
14
15
|
setPopoverVisible(false);
|
|
15
|
-
}, css: css(noPermissionStyle), children: i18n.t('pages.fields.view.noWorkflowOrAuth') })),
|
|
16
|
+
}, css: css(noPermissionStyle), children: i18n.t('pages.fields.view.noWorkflowOrAuth') })), jsx(View, { workflowData: workflowData, hiddenPopover: () => setPopoverVisible(false), name: name, objectId: objectId })] })) }));
|
|
16
17
|
};
|
|
17
|
-
|
|
18
|
+
var SelectTransition$1 = memo(SelectTransition);
|
|
19
|
+
|
|
20
|
+
export { SelectTransition$1 as default };
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { memo,
|
|
1
|
+
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { memo, useState, useRef, useCallback, useEffect } from 'react';
|
|
3
3
|
import { CaretDownOutlined } from '@ant-design/icons';
|
|
4
4
|
import { ClassNames } from '@emotion/react';
|
|
5
|
-
import {
|
|
6
|
-
import { WorkFlowStatusColor } from '../../../lib/global';
|
|
7
|
-
import useAntdConfig from '../../../lib/hooks/useAntdConfig';
|
|
8
|
-
import { i18n } from '../../../lib/i18n';
|
|
9
|
-
import EmptyField from '../../common/EmptyField';
|
|
10
|
-
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
|
|
11
|
-
import {
|
|
12
|
-
import TransitionPanel from './TransitionPanel';
|
|
5
|
+
import { Popover, Button } from 'antd';
|
|
6
|
+
import { WorkFlowStatusColor } from '../../../lib/global.js';
|
|
7
|
+
import useAntdConfig from '../../../lib/hooks/useAntdConfig.js';
|
|
8
|
+
import { i18n } from '../../../lib/i18n.js';
|
|
9
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
10
|
+
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip.js';
|
|
11
|
+
import { workflowContentStyle, statePopoverStyle, flowStateStyle, flowStateInWorkflowStyle, flowStateButtonStyle, stateBtnStyle, noStateStyle, caretDownStyle } from './style/index.js';
|
|
12
|
+
import TransitionPanel from './TransitionPanel.js';
|
|
13
|
+
|
|
13
14
|
const Transition = props => {
|
|
14
15
|
const { itemId, itemType, workspace, objectId, onTransitionSuccess, name, type, readonly, apply, flowUsers, loadingFlowUsers, fetchFlowUsers, } = props;
|
|
15
16
|
const [popoverVisible, setPopoverVisible] = useState(false);
|
|
@@ -28,19 +29,21 @@ const Transition = props => {
|
|
|
28
29
|
return { ...data, objectId, name, type };
|
|
29
30
|
});
|
|
30
31
|
}, [objectId, name, type]);
|
|
31
|
-
return (
|
|
32
|
+
return (jsx(ClassNames, { children: ({ cx, css }) => {
|
|
32
33
|
var _a, _b, _c;
|
|
33
|
-
return (
|
|
34
|
+
return (jsx("div", { css: css(workflowContentStyle), children: jsx(Popover, { overlayClassName: cx(css(statePopoverStyle(antPrefix))), destroyTooltipOnHide: true, open: popoverVisible, onOpenChange: visible => {
|
|
34
35
|
if (isProcessing.current || flowing) {
|
|
35
36
|
return;
|
|
36
37
|
}
|
|
37
38
|
setPopoverVisible(visible);
|
|
38
|
-
}, getPopupContainer: () => document.body, trigger: "click", placement: "bottomLeft", content:
|
|
39
|
+
}, getPopupContainer: () => document.body, trigger: "click", placement: "bottomLeft", content: jsx(TransitionPanel, { itemId: itemId, itemType: itemType, workspace: workspace, objectId: showData.objectId, onTransitionSuccess: transitionSuccess, name: name, readonly: readonly, setPopoverVisible: setPopoverVisible, isProcessing: isProcessing, flowing: flowing, setFlowing: setFlowing, flowHandlerActive: props.flowHandlerActive, flowUsers: flowUsers, loadingFlowUsers: loadingFlowUsers, fetchFlowUsers: fetchFlowUsers }), children: jsxs(Button, { type: "link", className: cx('status-btn', css(flowStateStyle), css(flowStateInWorkflowStyle), css(flowStateButtonStyle), css(stateBtnStyle), {
|
|
39
40
|
[css(noStateStyle)]: !showData.name,
|
|
40
41
|
}), style: {
|
|
41
42
|
backgroundColor: (_a = WorkFlowStatusColor[showData.type]) === null || _a === void 0 ? void 0 : _a.bgColor,
|
|
42
43
|
color: (_b = WorkFlowStatusColor[showData.type]) === null || _b === void 0 ? void 0 : _b.color,
|
|
43
|
-
}, children: [
|
|
44
|
+
}, children: [jsx(BaseOverflowTooltip, { title: showData.name, children: showData.name || (apply === 'cell' ? jsx(EmptyField, { readonly: readonly }) : i18n.t('global.stateless')) }), apply !== 'cell' && (jsx(CaretDownOutlined, { css: css(caretDownStyle), style: { color: (_c = WorkFlowStatusColor[showData.type]) === null || _c === void 0 ? void 0 : _c.color, marginLeft: 0 } }))] }) }) }));
|
|
44
45
|
} }));
|
|
45
46
|
};
|
|
46
|
-
|
|
47
|
+
var Transition$1 = memo(Transition);
|
|
48
|
+
|
|
49
|
+
export { Transition$1 as default };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { memo, useCallback, useEffect, useMemo
|
|
3
|
-
import {
|
|
1
|
+
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { memo, useState, useCallback, useEffect, useMemo } from 'react';
|
|
3
|
+
import { css, ClassNames } from '@emotion/react';
|
|
4
4
|
import { Tooltip } from 'antd';
|
|
5
|
-
import { WorkFlowStatusColor } from '../../../lib/global';
|
|
6
|
-
import { i18n } from '../../../lib/i18n';
|
|
7
|
-
import { checkTransition } from '../../../lib/workflow';
|
|
8
|
-
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
|
|
9
|
-
import {
|
|
5
|
+
import { WorkFlowStatusColor } from '../../../lib/global.js';
|
|
6
|
+
import { i18n } from '../../../lib/i18n.js';
|
|
7
|
+
import { checkTransition } from '../../../lib/workflow.js';
|
|
8
|
+
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip.js';
|
|
9
|
+
import { tipLineStyle, flowBtnStyle, notAllowedStyle, pointerStyle, tooltipStyle, iconStyle, stateBoxStyle, flowStateStyle } from './style/index.js';
|
|
10
|
+
|
|
10
11
|
const ApprovalStatus = {
|
|
11
12
|
approved: 'approved',
|
|
12
13
|
rejected: 'rejected',
|
|
@@ -105,21 +106,23 @@ const FlowButton = ({ loading, screenId, text, item, userId, roleIds, groupIds,
|
|
|
105
106
|
if (!tip)
|
|
106
107
|
return '';
|
|
107
108
|
const contents = tip.split('--');
|
|
108
|
-
return (
|
|
109
|
+
return (jsx("div", { children: contents.map((text, index) => (jsx("p", { css: css(tipLineStyle), children: text }, String(index)))) }));
|
|
109
110
|
}, [tip, readonly]);
|
|
110
111
|
const OverflowText = ({ text, target }) => {
|
|
111
112
|
var _a, _b;
|
|
112
|
-
return (
|
|
113
|
+
return (jsxs(Fragment, { children: [jsx(BaseOverflowTooltip, { css: css(tooltipStyle), title: text, children: text }), jsx("span", { css: css(iconStyle), children: " \u2192 " }), jsx("div", { css: css(stateBoxStyle), children: jsx(BaseOverflowTooltip, { css: css(flowStateStyle), style: {
|
|
113
114
|
backgroundColor: (_a = WorkFlowStatusColor[target.type]) === null || _a === void 0 ? void 0 : _a.bgColor,
|
|
114
115
|
color: (_b = WorkFlowStatusColor[target.type]) === null || _b === void 0 ? void 0 : _b.color,
|
|
115
116
|
}, title: target.name, children: target.name }) })] }));
|
|
116
117
|
};
|
|
117
|
-
return (
|
|
118
|
-
return isCheck && !readonly ? (
|
|
118
|
+
return (jsx(ClassNames, { children: ({ cx, css }) => {
|
|
119
|
+
return isCheck && !readonly ? (jsx("div", { className: cx(css(flowBtnStyle), loading ? css(notAllowedStyle) : css(pointerStyle)), onClick: () => {
|
|
119
120
|
if (!loading) {
|
|
120
121
|
handleTransition(text, screenId, scriptValidator);
|
|
121
122
|
}
|
|
122
|
-
}, children:
|
|
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 }) }) }));
|
|
123
124
|
} }));
|
|
124
125
|
};
|
|
125
|
-
|
|
126
|
+
var TransitionButton = memo(FlowButton);
|
|
127
|
+
|
|
128
|
+
export { TransitionButton as default };
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { memo,
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { memo, useState, useRef, useEffect, useCallback } from 'react';
|
|
3
3
|
import { ClassNames } from '@emotion/react';
|
|
4
4
|
import { proximaSdk, useListener } from '@giteeteam/proxima-sdk-js';
|
|
5
5
|
import { message } from 'antd';
|
|
6
6
|
import debug from 'debug';
|
|
7
7
|
import { cloneDeep } from 'lodash-es';
|
|
8
|
-
import useCurrentUser from '../../../lib/hooks/useCurrentUser';
|
|
9
|
-
import useWorkflowConfig from '../../../lib/hooks/useWorkflowConfig';
|
|
10
|
-
import { i18n } from '../../../lib/i18n';
|
|
11
|
-
import {
|
|
12
|
-
import { useItem } from '../../item/hooks';
|
|
13
|
-
import SelectFlowHandler from './SelectFlowHandler';
|
|
14
|
-
import SelectTransition from './SelectTransition';
|
|
8
|
+
import useCurrentUser from '../../../lib/hooks/useCurrentUser.js';
|
|
9
|
+
import useWorkflowConfig from '../../../lib/hooks/useWorkflowConfig.js';
|
|
10
|
+
import { i18n } from '../../../lib/i18n.js';
|
|
11
|
+
import { useWorkflowPermission, getScriptUser } from '../../../lib/workflow.js';
|
|
12
|
+
import { useItem } from '../../item/hooks.js';
|
|
13
|
+
import SelectFlowHandler from './SelectFlowHandler.js';
|
|
14
|
+
import SelectTransition from './SelectTransition.js';
|
|
15
|
+
|
|
15
16
|
const logger = debug('TransitionPanel');
|
|
16
17
|
var TransitionStepType;
|
|
17
18
|
(function (TransitionStepType) {
|
|
@@ -255,7 +256,7 @@ const TransitionPanel = ({ itemId, itemType, workspace, objectId, onTransitionSu
|
|
|
255
256
|
refreshFlag.current++;
|
|
256
257
|
refresh();
|
|
257
258
|
});
|
|
258
|
-
return (
|
|
259
|
+
return (jsx(ClassNames, { children: () => transitionStep === TransitionStepType.SelectFlowHandler ? (jsx(SelectFlowHandler, { itemId: itemId, task: flowTask, onBack: () => setTransitionStep(TransitionStepType.SelectTransition), users: flowUsers, loading: flowing, loadingUser: loadingFlowUsers, fetchUsers: fetchFlowUsers, handleTransition: handleTransition })) : (jsx(SelectTransition, { fetching: fetching, flowing: flowing, tasks: tasks, itemId: itemId, itemData: itemData, currentUser: currentUser, workspace: workspace, setPopoverVisible: setPopoverVisible, name: name, objectId: objectId, workflowData: workflowData, roleIds: roleIds, groupIds: groupIds, workspaceRoleIds: workspaceRoleIds, approval: approval, checkIn: checkIn, handleTransition: handleTransition, readonly: readonly, flowHandlerActive: flowHandlerActive })) }));
|
|
259
260
|
};
|
|
260
261
|
function getWorkflowConfig(workflow, statusId) {
|
|
261
262
|
var _a, _b, _c, _d, _e;
|
|
@@ -275,4 +276,6 @@ function getWorkflowConfig(workflow, statusId) {
|
|
|
275
276
|
}
|
|
276
277
|
return { approval, checkIn };
|
|
277
278
|
}
|
|
278
|
-
|
|
279
|
+
var TransitionPanel$1 = memo(TransitionPanel);
|
|
280
|
+
|
|
281
|
+
export { TransitionPanel$1 as default };
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { memo, useCallback } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { Global, css } from '@emotion/react';
|
|
4
4
|
import { proximaSdk } from '@giteeteam/proxima-sdk-js';
|
|
5
|
-
import { WorkflowIcon } from '../../../icons';
|
|
6
|
-
import { i18n } from '../../../lib/i18n';
|
|
7
|
-
import { statusViewGlobalStyle } from './style';
|
|
5
|
+
import { WorkflowIcon } from '../../../icons/index.js';
|
|
6
|
+
import { i18n } from '../../../lib/i18n.js';
|
|
7
|
+
import { statusViewGlobalStyle } from './style/index.js';
|
|
8
|
+
|
|
8
9
|
const View = ({ name, objectId, hiddenPopover, workflowData }) => {
|
|
9
10
|
const viewClickHandle = useCallback(e => {
|
|
10
11
|
e.stopPropagation();
|
|
11
12
|
}, []);
|
|
12
|
-
return (
|
|
13
|
+
return (jsxs("div", { className: 'field-layout status-view', onClick: viewClickHandle, children: [jsx(Global, { styles: css(statusViewGlobalStyle) }), jsxs("span", { onClick: () => {
|
|
13
14
|
hiddenPopover === null || hiddenPopover === void 0 ? void 0 : hiddenPopover();
|
|
14
15
|
proximaSdk.execute('openItemWorkflowViewerModal', { name, objectId, workflowData });
|
|
15
|
-
}, children: [
|
|
16
|
+
}, children: [jsx(WorkflowIcon, { className: 'status-view-watch' }), i18n.t('pages.fields.view.viewWorkflow')] })] }));
|
|
16
17
|
};
|
|
17
|
-
|
|
18
|
+
var View$1 = memo(View);
|
|
19
|
+
|
|
20
|
+
export { View$1 as default };
|