@reltio/components 1.4.2215 → 1.4.2216
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/CollaborationButton/CollaborationButton.d.ts +4 -0
- package/CollaborationButton/CollaborationButton.js +12 -0
- package/CollaborationButton/CollaborationButton.module.css.js +9 -0
- package/CollaborationButton/index.d.ts +1 -0
- package/CollaborationButton/index.js +1 -0
- package/ProfileResizablePanes/ProfileResizablePanes.js +2 -1
- package/ProfileResizablePanes/ProfileResizablePanes.spec.js +3 -3
- package/cjs/CollaborationButton/CollaborationButton.d.ts +4 -0
- package/cjs/CollaborationButton/CollaborationButton.js +19 -0
- package/cjs/CollaborationButton/CollaborationButton.module.css.js +9 -0
- package/cjs/CollaborationButton/index.d.ts +1 -0
- package/cjs/CollaborationButton/index.js +5 -0
- package/cjs/ProfileResizablePanes/ProfileResizablePanes.js +2 -1
- package/cjs/ProfileResizablePanes/ProfileResizablePanes.spec.js +3 -3
- package/cjs/features/workflow/WorkflowComments/WorkflowComments.d.ts +3 -2
- package/cjs/features/workflow/WorkflowComments/WorkflowComments.js +3 -2
- package/cjs/features/workflow/hooks/useWorkflowComments.d.ts +4 -2
- package/cjs/features/workflow/hooks/useWorkflowComments.js +3 -2
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +6 -4
- package/features/workflow/WorkflowComments/WorkflowComments.d.ts +3 -2
- package/features/workflow/WorkflowComments/WorkflowComments.js +3 -2
- package/features/workflow/hooks/useWorkflowComments.d.ts +4 -2
- package/features/workflow/hooks/useWorkflowComments.js +3 -2
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Badge from '@mui/material/Badge';
|
|
3
|
+
import CollaborationIcon from '../icons/CollaborationIcon';
|
|
4
|
+
import styles from './CollaborationButton.module.css';
|
|
5
|
+
export var CollaborationButton = function (_a) {
|
|
6
|
+
var totalCommentsCount = _a.totalCommentsCount;
|
|
7
|
+
return (React.createElement(Badge, { badgeContent: totalCommentsCount, classes: {
|
|
8
|
+
anchorOriginTopRightRectangular: styles.badgePosition,
|
|
9
|
+
badge: styles.badge
|
|
10
|
+
} },
|
|
11
|
+
React.createElement(CollaborationIcon, null)));
|
|
12
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"badge":"CollaborationButton-badge--noyiE","badgePosition":"CollaborationButton-badgePosition--30Efs"};
|
|
2
|
+
if (typeof document !== 'undefined') {
|
|
3
|
+
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
const style = document.createElement('style');
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
style.innerHTML = `.CollaborationButton-badge--noyiE{background-color:#ff4081;color:#fff;font-size:12px;height:18px;min-width:18px}.CollaborationButton-badgePosition--30Efs{right:5px}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CollaborationButton } from './CollaborationButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CollaborationButton } from './CollaborationButton';
|
|
@@ -13,7 +13,8 @@ export var ProfileResizablePanes = function (_a) {
|
|
|
13
13
|
var _b = usePerspectivesSettings(perspectiveId), perspectiveSettings = _b.perspectiveSettings, updatePerspectiveSettings = _b.updatePerspectiveSettings;
|
|
14
14
|
var _c = (perspectiveSettings || {}).width, width = _c === void 0 ? DEFAULT_R_PANE_SIZE : _c;
|
|
15
15
|
var active = !isNil(defaultTab) ? defaultTab : perspectiveSettings === null || perspectiveSettings === void 0 ? void 0 : perspectiveSettings.active;
|
|
16
|
-
var
|
|
16
|
+
var activeButton = buttonsProps.find(function (button) { return button.id === active; });
|
|
17
|
+
var isSidePanelOpen = !isNil(active) && !disabled && Boolean(activeButton);
|
|
17
18
|
var handleUpdateSettings = useCallback(function (newSetting) {
|
|
18
19
|
updatePerspectiveSettings(newSetting);
|
|
19
20
|
}, [updatePerspectiveSettings]);
|
|
@@ -81,7 +81,7 @@ var setUp = function (props) {
|
|
|
81
81
|
width: 480
|
|
82
82
|
},
|
|
83
83
|
graph: {
|
|
84
|
-
active:
|
|
84
|
+
active: 1,
|
|
85
85
|
width: 320
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -129,10 +129,10 @@ describe('ProfileResizablePanes tests', function () {
|
|
|
129
129
|
expect(screen.getByRole('button', { name: 'Button 2' })).toBeInTheDocument();
|
|
130
130
|
expect(screen.getByRole('separator')).toBeInTheDocument();
|
|
131
131
|
});
|
|
132
|
-
it('should render resizable panes with open second pane with defaultTab:
|
|
132
|
+
it('should render resizable panes with open second pane with defaultTab:1', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
133
133
|
var container;
|
|
134
134
|
return __generator(this, function (_a) {
|
|
135
|
-
container = setUp(__assign(__assign({}, defaultProps), { defaultTab:
|
|
135
|
+
container = setUp(__assign(__assign({}, defaultProps), { defaultTab: 1 })).container;
|
|
136
136
|
expect(screen.getByTestId('content')).toBeInTheDocument();
|
|
137
137
|
expect(screen.getByTestId('rightPanel')).toBeInTheDocument();
|
|
138
138
|
expect(getSplitPane1(container)).toBeInTheDocument();
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CollaborationButton = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var Badge_1 = __importDefault(require("@mui/material/Badge"));
|
|
9
|
+
var CollaborationIcon_1 = __importDefault(require("../icons/CollaborationIcon"));
|
|
10
|
+
var CollaborationButton_module_css_1 = __importDefault(require("./CollaborationButton.module.css"));
|
|
11
|
+
var CollaborationButton = function (_a) {
|
|
12
|
+
var totalCommentsCount = _a.totalCommentsCount;
|
|
13
|
+
return (react_1.default.createElement(Badge_1.default, { badgeContent: totalCommentsCount, classes: {
|
|
14
|
+
anchorOriginTopRightRectangular: CollaborationButton_module_css_1.default.badgePosition,
|
|
15
|
+
badge: CollaborationButton_module_css_1.default.badge
|
|
16
|
+
} },
|
|
17
|
+
react_1.default.createElement(CollaborationIcon_1.default, null)));
|
|
18
|
+
};
|
|
19
|
+
exports.CollaborationButton = CollaborationButton;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"badge":"CollaborationButton-badge--noyiE","badgePosition":"CollaborationButton-badgePosition--30Efs"};
|
|
2
|
+
if (typeof document !== 'undefined') {
|
|
3
|
+
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
const style = document.createElement('style');
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
style.innerHTML = `.CollaborationButton-badge--noyiE{background-color:#ff4081;color:#fff;font-size:12px;height:18px;min-width:18px}.CollaborationButton-badgePosition--30Efs{right:5px}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
module.exports = styles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CollaborationButton } from './CollaborationButton';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CollaborationButton = void 0;
|
|
4
|
+
var CollaborationButton_1 = require("./CollaborationButton");
|
|
5
|
+
Object.defineProperty(exports, "CollaborationButton", { enumerable: true, get: function () { return CollaborationButton_1.CollaborationButton; } });
|
|
@@ -39,7 +39,8 @@ var ProfileResizablePanes = function (_a) {
|
|
|
39
39
|
var _b = (0, PerspectivesSettingsContext_1.usePerspectivesSettings)(perspectiveId), perspectiveSettings = _b.perspectiveSettings, updatePerspectiveSettings = _b.updatePerspectiveSettings;
|
|
40
40
|
var _c = (perspectiveSettings || {}).width, width = _c === void 0 ? DEFAULT_R_PANE_SIZE : _c;
|
|
41
41
|
var active = !(0, ramda_1.isNil)(defaultTab) ? defaultTab : perspectiveSettings === null || perspectiveSettings === void 0 ? void 0 : perspectiveSettings.active;
|
|
42
|
-
var
|
|
42
|
+
var activeButton = buttonsProps.find(function (button) { return button.id === active; });
|
|
43
|
+
var isSidePanelOpen = !(0, ramda_1.isNil)(active) && !disabled && Boolean(activeButton);
|
|
43
44
|
var handleUpdateSettings = (0, react_1.useCallback)(function (newSetting) {
|
|
44
45
|
updatePerspectiveSettings(newSetting);
|
|
45
46
|
}, [updatePerspectiveSettings]);
|
|
@@ -86,7 +86,7 @@ var setUp = function (props) {
|
|
|
86
86
|
width: 480
|
|
87
87
|
},
|
|
88
88
|
graph: {
|
|
89
|
-
active:
|
|
89
|
+
active: 1,
|
|
90
90
|
width: 320
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -134,10 +134,10 @@ describe('ProfileResizablePanes tests', function () {
|
|
|
134
134
|
expect(react_2.screen.getByRole('button', { name: 'Button 2' })).toBeInTheDocument();
|
|
135
135
|
expect(react_2.screen.getByRole('separator')).toBeInTheDocument();
|
|
136
136
|
});
|
|
137
|
-
it('should render resizable panes with open second pane with defaultTab:
|
|
137
|
+
it('should render resizable panes with open second pane with defaultTab:1', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
138
138
|
var container;
|
|
139
139
|
return __generator(this, function (_a) {
|
|
140
|
-
container = setUp(__assign(__assign({}, defaultProps), { defaultTab:
|
|
140
|
+
container = setUp(__assign(__assign({}, defaultProps), { defaultTab: 1 })).container;
|
|
141
141
|
expect(react_2.screen.getByTestId('content')).toBeInTheDocument();
|
|
142
142
|
expect(react_2.screen.getByTestId('rightPanel')).toBeInTheDocument();
|
|
143
143
|
expect(getSplitPane1(container)).toBeInTheDocument();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { WorkflowAction, WorkflowComment } from '@reltio/mdm-sdk';
|
|
2
|
+
import { WorkflowAction, WorkflowComment, WorkflowTaskData } from '@reltio/mdm-sdk';
|
|
3
3
|
import { TaskAction } from '../types';
|
|
4
4
|
type Props = {
|
|
5
5
|
actionRequestIsInProgress?: boolean;
|
|
@@ -14,6 +14,7 @@ type Props = {
|
|
|
14
14
|
container?: string;
|
|
15
15
|
commentsContainer?: string;
|
|
16
16
|
};
|
|
17
|
+
onCommentWrite?: (taskFields: Pick<WorkflowTaskData, 'processInstanceComments'>) => void;
|
|
17
18
|
};
|
|
18
|
-
export declare const WorkflowComments: ({ workflowActions: actions, actionRequestIsInProgress, processInstanceComments, taskId, isTaskOpen, preferredAction, showActionButtons, alwaysExpanded, classes }: Props) => React.JSX.Element;
|
|
19
|
+
export declare const WorkflowComments: ({ workflowActions: actions, actionRequestIsInProgress, processInstanceComments, taskId, isTaskOpen, preferredAction, showActionButtons, alwaysExpanded, classes, onCommentWrite }: Props) => React.JSX.Element;
|
|
19
20
|
export {};
|
|
@@ -40,13 +40,14 @@ var SmallIconButton_1 = require("../../../SmallIconButton");
|
|
|
40
40
|
var WorkflowActionButtons_1 = require("../WorkflowActionButtons");
|
|
41
41
|
var WorkflowComments_module_css_1 = __importDefault(require("./WorkflowComments.module.css"));
|
|
42
42
|
var WorkflowComments = function (_a) {
|
|
43
|
-
var actions = _a.workflowActions, actionRequestIsInProgress = _a.actionRequestIsInProgress, processInstanceComments = _a.processInstanceComments, taskId = _a.taskId, isTaskOpen = _a.isTaskOpen, preferredAction = _a.preferredAction, _b = _a.showActionButtons, showActionButtons = _b === void 0 ? true : _b, _c = _a.alwaysExpanded, alwaysExpanded = _c === void 0 ? false : _c, classes = _a.classes;
|
|
43
|
+
var actions = _a.workflowActions, actionRequestIsInProgress = _a.actionRequestIsInProgress, processInstanceComments = _a.processInstanceComments, taskId = _a.taskId, isTaskOpen = _a.isTaskOpen, preferredAction = _a.preferredAction, _b = _a.showActionButtons, showActionButtons = _b === void 0 ? true : _b, _c = _a.alwaysExpanded, alwaysExpanded = _c === void 0 ? false : _c, classes = _a.classes, onCommentWrite = _a.onCommentWrite;
|
|
44
44
|
var _d = (0, react_1.useState)(false), expanded = _d[0], setExpanded = _d[1];
|
|
45
45
|
var _e = (0, react_1.useState)(''), comment = _e[0], setComment = _e[1];
|
|
46
46
|
var _f = (0, useWorkflowComments_1.useWorkflowComments)({
|
|
47
47
|
processInstanceComments: processInstanceComments,
|
|
48
48
|
taskId: taskId,
|
|
49
|
-
isOpen: isTaskOpen
|
|
49
|
+
isOpen: isTaskOpen,
|
|
50
|
+
onCommentWrite: onCommentWrite
|
|
50
51
|
}), comments = _f.comments, writeComment = _f.writeComment, readOnly = _f.readOnly;
|
|
51
52
|
var sendComment = (0, react_1.useCallback)(function () {
|
|
52
53
|
writeComment(comment);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { WorkflowTaskData } from '@reltio/mdm-sdk';
|
|
2
|
-
type Props = Pick<WorkflowTaskData, 'processInstanceComments' | 'taskId' | 'isOpen'
|
|
3
|
-
|
|
2
|
+
type Props = Pick<WorkflowTaskData, 'processInstanceComments' | 'taskId' | 'isOpen'> & {
|
|
3
|
+
onCommentWrite?: (taskFields: Pick<WorkflowTaskData, 'processInstanceComments'>) => void;
|
|
4
|
+
};
|
|
5
|
+
export declare const useWorkflowComments: ({ processInstanceComments, taskId, isOpen, onCommentWrite }: Props) => {
|
|
4
6
|
comments: any[];
|
|
5
7
|
requestIsInProgress: boolean;
|
|
6
8
|
writeComment: (comment: any) => void;
|
|
@@ -10,7 +10,7 @@ var common_1 = require("../helpers/common");
|
|
|
10
10
|
var useWorkflowCheckPermission_1 = require("./useWorkflowCheckPermission");
|
|
11
11
|
var MdmModuleContext_1 = require("../../../contexts/MdmModuleContext");
|
|
12
12
|
var useWorkflowComments = function (_a) {
|
|
13
|
-
var processInstanceComments = _a.processInstanceComments, taskId = _a.taskId, isOpen = _a.isOpen;
|
|
13
|
+
var processInstanceComments = _a.processInstanceComments, taskId = _a.taskId, isOpen = _a.isOpen, onCommentWrite = _a.onCommentWrite;
|
|
14
14
|
var updateTaskState = ((0, react_1.useContext)(WorkflowTasksContext_1.WorkflowTasksContext) || {}).updateTaskState;
|
|
15
15
|
var workflowPath = (0, MdmModuleContext_1.useMdmWorkflowPath)();
|
|
16
16
|
var environment = (0, MdmModuleContext_1.useMdmWorkflowEnvironmentUrl)();
|
|
@@ -44,11 +44,12 @@ var useWorkflowComments = function (_a) {
|
|
|
44
44
|
var processInstanceComments = _a.processInstanceComments;
|
|
45
45
|
setComments(processInstanceComments || []);
|
|
46
46
|
updateTaskState === null || updateTaskState === void 0 ? void 0 : updateTaskState(taskId, { processInstanceComments: processInstanceComments });
|
|
47
|
+
onCommentWrite === null || onCommentWrite === void 0 ? void 0 : onCommentWrite({ processInstanceComments: processInstanceComments });
|
|
47
48
|
})
|
|
48
49
|
.catch(errors_1.showWorkflowError)
|
|
49
50
|
.finally(function () { return setRequestIsInProgress(false); });
|
|
50
51
|
}
|
|
51
|
-
}, [environment, taskId, tenant, workflowPath, safePromise, updateTaskState, canUpdateTask]);
|
|
52
|
+
}, [environment, taskId, tenant, workflowPath, safePromise, updateTaskState, canUpdateTask, onCommentWrite]);
|
|
52
53
|
return { comments: comments, requestIsInProgress: requestIsInProgress, writeComment: writeComment, readOnly: !canUpdateTask };
|
|
53
54
|
};
|
|
54
55
|
exports.useWorkflowComments = useWorkflowComments;
|
package/cjs/index.d.ts
CHANGED
|
@@ -196,6 +196,7 @@ export { FacetGroupTitle } from './FacetGroupTitle';
|
|
|
196
196
|
export { FacetsSelector } from './FacetsSelector';
|
|
197
197
|
export { FacetContainer } from './FacetContainer';
|
|
198
198
|
export { RequestedData } from './RequestedData';
|
|
199
|
+
export { CollaborationButton } from './CollaborationButton';
|
|
199
200
|
export { withTooltip } from './HOCs/withTooltip';
|
|
200
201
|
export { withAsyncMount } from './HOCs/withAsyncMount';
|
|
201
202
|
export { withDragHandle } from './HOCs/withDragHandle';
|
package/cjs/index.js
CHANGED
|
@@ -18,10 +18,10 @@ exports.NestedAttribute = exports.MoreAttributesButton = exports.InlineReference
|
|
|
18
18
|
exports.ReactSelectMenuList = exports.ReactSelectLoadMoreButton = exports.ReactSelectDropdownIndicatorWithIconButton = exports.ReactSelectDropdownIndicator = exports.Highlighter = exports.HierarchyNodeTitle = exports.HierarchicalAttributeTooltip = exports.HideOnShrink = exports.ExpandableSearchInput = exports.ErrorPopup = exports.ErrorBoundary = exports.SegmentIdLink = exports.EntityUriLink = exports.EntityTypesSelector = exports.EntityTypeIcon = exports.EntityTypeBadge = exports.EntityAvatar = exports.EMPTY_STATE_VARIANTS = exports.EMPTY_STATE_ICONS = exports.EmptyState = exports.Drawer = exports.DataTypeValue = exports.DataTenantBadge = exports.ConnectionRelationTypeSelector = exports.CollaborationItem = exports.ConfirmationDialog = exports.CommentsContainer = exports.ColoredSourceIcon = exports.CollapseButton = exports.TreeChart = exports.TableWithBars = exports.SourceIcon = exports.SmallIconButtonWithTooltip = exports.SmallIconButton = exports.SimpleAttributeEditor = exports.SimpleAttribute = exports.RowCellChips = exports.RowCellChipWithTooltip = exports.RowCellAutoSizer = exports.RelationTypeSelector = exports.ReferenceAttributeEditor = exports.ReferenceAttribute = exports.ImageAttributesLine = exports.ReadOnlyAttributesPager = exports.ReadOnlyAttributesList = exports.ReadOnlyAttribute = exports.ReadOnlyAttributeValuesBlock = exports.PieChart = exports.OvIcon = exports.NestedAttributeEditor = void 0;
|
|
19
19
|
exports.LoadingSpinner = exports.Link = exports.LinearLoadIndicator = exports.ImportButton = exports.ReadableSearchQueryBuilder = exports.ReadableSearchQuery = exports.LogicOperatorWithPlaceholder = exports.LogicOperator = exports.TableSkeleton = exports.StepNavigation = exports.TenantLabel = exports.RelevanceScoreBadge = exports.RequiredMark = exports.SettingsMenu = exports.TenantsDropDownSelector = exports.TenantIcon = exports.SourceSystemsSelector = exports.MatchRulesSelector = exports.MultiValueSelector = exports.ProfilesList = exports.NotMatchButton = exports.MergeButton = exports.ProfileMatchCard = exports.ImageGalleryDialog = exports.RelationTypesSelector = exports.ScreenProfileBand = exports.ProfileBandNavigation = exports.EmptyStub = exports.MaskingSwitcher = exports.FileTypeEditor = exports.EmptySearchResult = exports.DropDownEditor = exports.FilterValueEditor = exports.MultiValueChip = exports.TextEditor = exports.DateRangeEditor = exports.NumberEditor = exports.DataTypeValueEditor = exports.DateEditor = exports.ErrorWrapper = exports.ErrorMessage = exports.HIDE = exports.INSERT_RIGHT = exports.INSERT_LEFT = exports.ConfigColumnPopup = exports.ConfigureColumnsPopup = exports.ConnectionEditor = exports.DropDownSelector = exports.ReactSelectOptionWithCheckIcon = exports.ReactSelectMenuWithPopper = void 0;
|
|
20
20
|
exports.DefaultHeadCellRendererWithTooltip = exports.LazyRenderer = exports.MetadataTypesSelector = exports.DateRangeSelector = exports.UpSetChart = exports.GaugeChart = exports.RelationEditor = exports.ReltioMap = exports.Marginator = exports.LightArrowTooltip = exports.ScrollableTabs = exports.VirtualGroupedList = exports.ViewMoreToggle = exports.VerticalHeadingsTable = exports.VerticalDivider = exports.AttributeTitle = exports.Spacer = exports.SimpleDropDownSelector = exports.SidePanelContentHeader = exports.SidePanel = exports.SidePanelEmptyState = exports.SideButtonsPanel = exports.SelectorWithOnlyOptionAutoSelect = exports.SelectionPopup = exports.WhiteSearchInput = exports.SearchInput = exports.ProfileResizablePanes = exports.ResizablePanes = exports.ReltioGridLayout = exports.RCTreeSwitchRenderer = exports.RCTreeLevelLines = exports.RCTree = exports.reactSortableTreeHelpers = exports.ReactSortableTree = exports.MultiSelect = exports.QueryBuilderRowsGroup = exports.QueryBuilderRow = exports.ProfileCard = exports.ProfileBand = exports.PotentialMatchReviewCard = exports.PopupWithArrow = exports.Popper = exports.MultipleInput = exports.ModeSwitcherSelect = exports.ModeSwitcher = exports.TransitiveMatchBlock = exports.SimpleMatchRulesBuilder = exports.SimpleMatchRulesBlock = exports.SimpleMatchRules = exports.MatchRulesBlock = void 0;
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.
|
|
24
|
-
exports.mockComputedStyles = exports.FakeMouseEvent = exports.rerenderWrapper = exports.mockElementSizes = exports.fixClicksOnResizablePanes = exports.mockBasicTableSizing = exports.getMuiIconsByName = exports.getMuiIconByName = exports.deepFreeze = exports.awaitMockPromises = exports.TestStylesProvider = exports.TestPerspectivesSettingsProvider = void 0;
|
|
21
|
+
exports.EntityContext = exports.RelatedObjectUrisContext = exports.WorkflowTasksContext = exports.useEntityLoadingIndication = exports.EntityLoadingIndicationProvider = exports.EntityMarkerContext = exports.useAttributeExpanded = exports.ExpandedAttributesProvider = exports.useHighlightedCrosswalks = exports.useCrosswalkHighlight = exports.useCrosswalkFocus = exports.useCrosswalkColor = exports.CrosswalksDisplayProvider = exports.EntitiesMapContext = exports.IdContext = exports.ProfilePerspectiveViewContext = exports.usePerspectivesSettings = exports.PerspectivesSettingsContext = exports.PivotingAttributeContext = exports.UsersContext = exports.InitialCollaborationContextValue = exports.CollaborationContextProvider = exports.CollaborationContext = exports.BlockNavigationContext = exports.BlockImageGalleryDialogContext = exports.PopupBoundariesContext = exports.HistoryDiffContext = exports.AsyncMountContext = exports.MdmModuleProvider = exports.withColumnConfigurator = exports.withBlockNavigation = exports.withCollapseButton = exports.withTableContext = exports.withFilterAtBottom = exports.withPercents = exports.withContext = exports.withDateRangeSelector = exports.withDragHandle = exports.withAsyncMount = exports.withTooltip = exports.CollaborationButton = exports.RequestedData = exports.FacetContainer = exports.FacetsSelector = exports.FacetGroupTitle = exports.QuickFiltersEntityTypeFacet = exports.FacetGroup = exports.QuickFiltersFacetPanel = exports.AdvancedSearchFabButton = exports.QuickFiltersDrawer = void 0;
|
|
22
|
+
exports.useSafePromise = exports.useRunOnceAfterValueInitialization = exports.useRelationsLoader = exports.useRelationTypeSelector = exports.usePrevious = exports.useDidUpdateEffect = exports.useCommentsEntitiesMap = exports.useCollaboration = exports.useAsyncMount = exports.useAPI = exports.useActions = exports.useMatchesColumnsData = exports.useScrollToAttributeError = exports.ThemeProvider = exports.ProfileTablesContext = exports.HiddenAttributesContext = exports.BasicTableContext = exports.BasicTableRowCollapseContext = exports.useDeleteUnmaskedAttributeForRelation = exports.useUnmaskedAttributeValue = exports.useUnmaskAttributeValue = exports.useMaskAttributeValue = exports.MaskedAttributesProvider = exports.useReloadData = exports.ReloadDataProvider = exports.useAttributeValueConfigPermissions = exports.ConfigPermissionsContextProvider = exports.ConfigPermissionsContext = exports.useActionsHook = exports.ActionsHookProvider = exports.PageRequestsAbortingContext = exports.DependentLookupAutopopulationContext = exports.FeaturesContext = exports.LabelsContext = exports.UrlGeneratorsContext = exports.isHighlightedAttributeType = exports.isHighlightedErrorType = exports.ScrollType = exports.ScrollToElementProvider = exports.ScrollToElementContext = exports.SearchValueContext = exports.InterceptHandlersContext = exports.HighlightedValuesContext = exports.SnackbarContext = exports.SearchFiltersContext = exports.useReloadFacet = exports.ReloadFacetProvider = exports.useReloadAllFacets = exports.SandboxAPIContext = exports.RelationContext = void 0;
|
|
23
|
+
exports.getAttributeHeight = exports.getNestedPathByColumnId = exports.applyCompactValuesCountConstraint = exports.getAttributeSelectorItems = exports.mergeClasses = exports.isControlOrCommandPressed = exports.getValue = exports.getChecked = exports.showErrorMessage = exports.showDefaultErrorMessage = exports.enrichDataWithPercents = exports.defaultRenderRowCell = exports.defaultGetRowCellHeight = exports.columnFilterToMdmFilter = exports.buildColumnsSizeById = exports.buildColumnsFilter = exports.useTableColumns = exports.useSegmentsLoader = exports.useDndBasicTableScrollModifier = exports.useDynamicYAxisWidth = exports.useFilterAutoFocus = exports.useSegmentationRequest = exports.resolveMarkers = exports.useMarkers = exports.useMaskedAttribute = exports.useKeyboardNavigation = exports.useDynamicRowCellHeight = exports.useClickableStyle = exports.BasicTableCellRenderer = exports.useBasicTableCellRenderer = exports.useHiddenAttributes = exports.useSavedSearchesRequest = exports.useRequestDCRReview = exports.useAutoFocus = exports.useExpandInvalidRelations = exports.useLayoutResetter = exports.useIsMountedRef = exports.useSnackbar = exports.useSavedStateForEntityType = exports.useReadableSearchState = exports.useEditableConnection = exports.useCustomScripts = exports.useMarkAsNotMatchRequest = exports.useMergeAllRequest = exports.usePagingSimulator = exports.useMatchesLoader = exports.useConfigPermissions = exports.useWhyDidYouUpdate = exports.useUsers = exports.useSavedState = void 0;
|
|
24
|
+
exports.mockComputedStyles = exports.FakeMouseEvent = exports.rerenderWrapper = exports.mockElementSizes = exports.fixClicksOnResizablePanes = exports.mockBasicTableSizing = exports.getMuiIconsByName = exports.getMuiIconByName = exports.deepFreeze = exports.awaitMockPromises = exports.TestStylesProvider = exports.TestPerspectivesSettingsProvider = exports.getAttrPathFromColumnId = void 0;
|
|
25
25
|
// components
|
|
26
26
|
var ActionButton_1 = require("./ActionButton");
|
|
27
27
|
Object.defineProperty(exports, "ActionButton", { enumerable: true, get: function () { return ActionButton_1.ActionButton; } });
|
|
@@ -429,6 +429,8 @@ var FacetContainer_1 = require("./FacetContainer");
|
|
|
429
429
|
Object.defineProperty(exports, "FacetContainer", { enumerable: true, get: function () { return FacetContainer_1.FacetContainer; } });
|
|
430
430
|
var RequestedData_1 = require("./RequestedData");
|
|
431
431
|
Object.defineProperty(exports, "RequestedData", { enumerable: true, get: function () { return RequestedData_1.RequestedData; } });
|
|
432
|
+
var CollaborationButton_1 = require("./CollaborationButton");
|
|
433
|
+
Object.defineProperty(exports, "CollaborationButton", { enumerable: true, get: function () { return CollaborationButton_1.CollaborationButton; } });
|
|
432
434
|
// HOCs
|
|
433
435
|
var withTooltip_1 = require("./HOCs/withTooltip");
|
|
434
436
|
Object.defineProperty(exports, "withTooltip", { enumerable: true, get: function () { return withTooltip_1.withTooltip; } });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { WorkflowAction, WorkflowComment } from '@reltio/mdm-sdk';
|
|
2
|
+
import { WorkflowAction, WorkflowComment, WorkflowTaskData } from '@reltio/mdm-sdk';
|
|
3
3
|
import { TaskAction } from '../types';
|
|
4
4
|
type Props = {
|
|
5
5
|
actionRequestIsInProgress?: boolean;
|
|
@@ -14,6 +14,7 @@ type Props = {
|
|
|
14
14
|
container?: string;
|
|
15
15
|
commentsContainer?: string;
|
|
16
16
|
};
|
|
17
|
+
onCommentWrite?: (taskFields: Pick<WorkflowTaskData, 'processInstanceComments'>) => void;
|
|
17
18
|
};
|
|
18
|
-
export declare const WorkflowComments: ({ workflowActions: actions, actionRequestIsInProgress, processInstanceComments, taskId, isTaskOpen, preferredAction, showActionButtons, alwaysExpanded, classes }: Props) => React.JSX.Element;
|
|
19
|
+
export declare const WorkflowComments: ({ workflowActions: actions, actionRequestIsInProgress, processInstanceComments, taskId, isTaskOpen, preferredAction, showActionButtons, alwaysExpanded, classes, onCommentWrite }: Props) => React.JSX.Element;
|
|
19
20
|
export {};
|
|
@@ -11,13 +11,14 @@ import { SmallIconButton } from '../../../SmallIconButton';
|
|
|
11
11
|
import { WorkflowActionButtons } from '../WorkflowActionButtons';
|
|
12
12
|
import styles from './WorkflowComments.module.css';
|
|
13
13
|
export var WorkflowComments = function (_a) {
|
|
14
|
-
var actions = _a.workflowActions, actionRequestIsInProgress = _a.actionRequestIsInProgress, processInstanceComments = _a.processInstanceComments, taskId = _a.taskId, isTaskOpen = _a.isTaskOpen, preferredAction = _a.preferredAction, _b = _a.showActionButtons, showActionButtons = _b === void 0 ? true : _b, _c = _a.alwaysExpanded, alwaysExpanded = _c === void 0 ? false : _c, classes = _a.classes;
|
|
14
|
+
var actions = _a.workflowActions, actionRequestIsInProgress = _a.actionRequestIsInProgress, processInstanceComments = _a.processInstanceComments, taskId = _a.taskId, isTaskOpen = _a.isTaskOpen, preferredAction = _a.preferredAction, _b = _a.showActionButtons, showActionButtons = _b === void 0 ? true : _b, _c = _a.alwaysExpanded, alwaysExpanded = _c === void 0 ? false : _c, classes = _a.classes, onCommentWrite = _a.onCommentWrite;
|
|
15
15
|
var _d = useState(false), expanded = _d[0], setExpanded = _d[1];
|
|
16
16
|
var _e = useState(''), comment = _e[0], setComment = _e[1];
|
|
17
17
|
var _f = useWorkflowComments({
|
|
18
18
|
processInstanceComments: processInstanceComments,
|
|
19
19
|
taskId: taskId,
|
|
20
|
-
isOpen: isTaskOpen
|
|
20
|
+
isOpen: isTaskOpen,
|
|
21
|
+
onCommentWrite: onCommentWrite
|
|
21
22
|
}), comments = _f.comments, writeComment = _f.writeComment, readOnly = _f.readOnly;
|
|
22
23
|
var sendComment = useCallback(function () {
|
|
23
24
|
writeComment(comment);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { WorkflowTaskData } from '@reltio/mdm-sdk';
|
|
2
|
-
type Props = Pick<WorkflowTaskData, 'processInstanceComments' | 'taskId' | 'isOpen'
|
|
3
|
-
|
|
2
|
+
type Props = Pick<WorkflowTaskData, 'processInstanceComments' | 'taskId' | 'isOpen'> & {
|
|
3
|
+
onCommentWrite?: (taskFields: Pick<WorkflowTaskData, 'processInstanceComments'>) => void;
|
|
4
|
+
};
|
|
5
|
+
export declare const useWorkflowComments: ({ processInstanceComments, taskId, isOpen, onCommentWrite }: Props) => {
|
|
4
6
|
comments: any[];
|
|
5
7
|
requestIsInProgress: boolean;
|
|
6
8
|
writeComment: (comment: any) => void;
|
|
@@ -7,7 +7,7 @@ import { isOpenTask } from '../helpers/common';
|
|
|
7
7
|
import { useWorkflowCheckPermission } from './useWorkflowCheckPermission';
|
|
8
8
|
import { useMdmTenant, useMdmWorkflowEnvironmentUrl, useMdmWorkflowPath } from '../../../contexts/MdmModuleContext';
|
|
9
9
|
export var useWorkflowComments = function (_a) {
|
|
10
|
-
var processInstanceComments = _a.processInstanceComments, taskId = _a.taskId, isOpen = _a.isOpen;
|
|
10
|
+
var processInstanceComments = _a.processInstanceComments, taskId = _a.taskId, isOpen = _a.isOpen, onCommentWrite = _a.onCommentWrite;
|
|
11
11
|
var updateTaskState = (useContext(WorkflowTasksContext) || {}).updateTaskState;
|
|
12
12
|
var workflowPath = useMdmWorkflowPath();
|
|
13
13
|
var environment = useMdmWorkflowEnvironmentUrl();
|
|
@@ -41,10 +41,11 @@ export var useWorkflowComments = function (_a) {
|
|
|
41
41
|
var processInstanceComments = _a.processInstanceComments;
|
|
42
42
|
setComments(processInstanceComments || []);
|
|
43
43
|
updateTaskState === null || updateTaskState === void 0 ? void 0 : updateTaskState(taskId, { processInstanceComments: processInstanceComments });
|
|
44
|
+
onCommentWrite === null || onCommentWrite === void 0 ? void 0 : onCommentWrite({ processInstanceComments: processInstanceComments });
|
|
44
45
|
})
|
|
45
46
|
.catch(showWorkflowError)
|
|
46
47
|
.finally(function () { return setRequestIsInProgress(false); });
|
|
47
48
|
}
|
|
48
|
-
}, [environment, taskId, tenant, workflowPath, safePromise, updateTaskState, canUpdateTask]);
|
|
49
|
+
}, [environment, taskId, tenant, workflowPath, safePromise, updateTaskState, canUpdateTask, onCommentWrite]);
|
|
49
50
|
return { comments: comments, requestIsInProgress: requestIsInProgress, writeComment: writeComment, readOnly: !canUpdateTask };
|
|
50
51
|
};
|
package/index.d.ts
CHANGED
|
@@ -196,6 +196,7 @@ export { FacetGroupTitle } from './FacetGroupTitle';
|
|
|
196
196
|
export { FacetsSelector } from './FacetsSelector';
|
|
197
197
|
export { FacetContainer } from './FacetContainer';
|
|
198
198
|
export { RequestedData } from './RequestedData';
|
|
199
|
+
export { CollaborationButton } from './CollaborationButton';
|
|
199
200
|
export { withTooltip } from './HOCs/withTooltip';
|
|
200
201
|
export { withAsyncMount } from './HOCs/withAsyncMount';
|
|
201
202
|
export { withDragHandle } from './HOCs/withDragHandle';
|
package/index.js
CHANGED
|
@@ -196,6 +196,7 @@ export { FacetGroupTitle } from './FacetGroupTitle';
|
|
|
196
196
|
export { FacetsSelector } from './FacetsSelector';
|
|
197
197
|
export { FacetContainer } from './FacetContainer';
|
|
198
198
|
export { RequestedData } from './RequestedData';
|
|
199
|
+
export { CollaborationButton } from './CollaborationButton';
|
|
199
200
|
// HOCs
|
|
200
201
|
export { withTooltip } from './HOCs/withTooltip';
|
|
201
202
|
export { withAsyncMount } from './HOCs/withAsyncMount';
|