@reltio/components 1.4.927 → 1.4.928
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/cjs/components/CollaborationItem/SendMessageArea/SendMessageArea.js +3 -1
- package/cjs/components/CommentsContainer/CommentsContainer.js +10 -1
- package/cjs/components/LinearLoadIndicator/LinearLoadIndicator.d.ts +2 -1
- package/cjs/components/LinearLoadIndicator/LinearLoadIndicator.js +7 -3
- package/cjs/components/LinearLoadIndicator/styles.d.ts +1 -1
- package/cjs/components/LinearLoadIndicator/styles.js +5 -0
- package/cjs/components/charts/MapChart/MapChart.js +23 -20
- package/cjs/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.js +2 -1
- package/cjs/components/workflow/components/AttributesChanges/helpers/attributesHelpers.js +9 -7
- package/cjs/components/workflow/components/AttributesChanges/helpers/mergeHelpers.js +3 -2
- package/cjs/contexts/RelatedObjectUrisContext/index.d.ts +2 -0
- package/cjs/contexts/RelatedObjectUrisContext/index.js +9 -0
- package/cjs/contexts/index.d.ts +1 -0
- package/cjs/contexts/index.js +3 -1
- package/esm/components/CollaborationItem/SendMessageArea/SendMessageArea.js +3 -1
- package/esm/components/CommentsContainer/CommentsContainer.js +12 -3
- package/esm/components/LinearLoadIndicator/LinearLoadIndicator.d.ts +2 -1
- package/esm/components/LinearLoadIndicator/LinearLoadIndicator.js +7 -3
- package/esm/components/LinearLoadIndicator/styles.d.ts +1 -1
- package/esm/components/LinearLoadIndicator/styles.js +5 -0
- package/esm/components/charts/MapChart/MapChart.js +24 -21
- package/esm/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.js +2 -1
- package/esm/components/workflow/components/AttributesChanges/helpers/attributesHelpers.js +10 -8
- package/esm/components/workflow/components/AttributesChanges/helpers/mergeHelpers.js +4 -3
- package/esm/contexts/RelatedObjectUrisContext/index.d.ts +2 -0
- package/esm/contexts/RelatedObjectUrisContext/index.js +3 -0
- package/esm/contexts/index.d.ts +1 -0
- package/esm/contexts/index.js +1 -0
- package/package.json +3 -3
|
@@ -35,6 +35,7 @@ var Avatar_1 = require("../Avatar/Avatar");
|
|
|
35
35
|
var contexts_1 = require("../../../contexts");
|
|
36
36
|
var styles_1 = require("./styles");
|
|
37
37
|
var ramda_1 = require("ramda");
|
|
38
|
+
var hooks_1 = require("../../../hooks");
|
|
38
39
|
var getPlaceholder = function (status) {
|
|
39
40
|
switch (status) {
|
|
40
41
|
case 'open':
|
|
@@ -63,6 +64,7 @@ var SendMessageArea = function (_a) {
|
|
|
63
64
|
var _d = react_1.useState(''), plainTextValue = _d[0], setPlainTextValue = _d[1];
|
|
64
65
|
var _e = react_1.useState([]), mentions = _e[0], setMentions = _e[1];
|
|
65
66
|
var _f = react_1.useState(false), focused = _f[0], setFocused = _f[1];
|
|
67
|
+
var safePromise = hooks_1.useSafePromise();
|
|
66
68
|
var hasValue = value.trim() !== '';
|
|
67
69
|
var shouldShowButtons = focused || hasValue;
|
|
68
70
|
var status = comment === null || comment === void 0 ? void 0 : comment.status;
|
|
@@ -123,7 +125,7 @@ var SendMessageArea = function (_a) {
|
|
|
123
125
|
}
|
|
124
126
|
]
|
|
125
127
|
]);
|
|
126
|
-
return request().then(clearValue).catch(console.log); //eslint-disable-line no-console
|
|
128
|
+
return safePromise(request()).then(clearValue).catch(console.log); //eslint-disable-line no-console
|
|
127
129
|
};
|
|
128
130
|
react_1.useEffect(function () {
|
|
129
131
|
if (popperRef) {
|
|
@@ -18,6 +18,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
22
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
23
|
+
to[j] = from[i];
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
21
26
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
27
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
28
|
};
|
|
@@ -63,6 +68,10 @@ var CommentsContainer = function (_a) {
|
|
|
63
68
|
onChangePopupVisibility(isOpenPopup);
|
|
64
69
|
}
|
|
65
70
|
}, [isOpenPopup]);
|
|
71
|
+
var additionalRelatedObjectUris = react_1.useContext(contexts_1.RelatedObjectUrisContext);
|
|
72
|
+
var allRelatedObjectUris = react_1.useMemo(function () {
|
|
73
|
+
return additionalRelatedObjectUris ? __spreadArray(__spreadArray([], relatedObjectUris), additionalRelatedObjectUris) : relatedObjectUris;
|
|
74
|
+
}, [additionalRelatedObjectUris, relatedObjectUris]);
|
|
66
75
|
return (showComments && (react_1.default.createElement("div", { className: classnames_1.default(styles.root, className) },
|
|
67
76
|
shouldShowAddCommentButton && (react_1.default.createElement(AddCommentButton_1.default, { className: classnames_1.default(styles.addButton, (_b = {},
|
|
68
77
|
_b[styles.showAlways] = showAlways || isOpenPopupWithNewComment,
|
|
@@ -71,6 +80,6 @@ var CommentsContainer = function (_a) {
|
|
|
71
80
|
var replies = _a.replies, commentId = _a.commentId;
|
|
72
81
|
return (react_1.default.createElement(CommentButton_1.default, { ref: commentId === (currentComment === null || currentComment === void 0 ? void 0 : currentComment.commentId) ? setAnchorEl : null, key: commentId, onClick: function () { return handleClickCommentButton(commentId); } }, 1 + replies));
|
|
73
82
|
}),
|
|
74
|
-
react_1.default.createElement(CollaborationPopup_1.CollaborationPopup, { anchorEl: anchorEl, open: isOpenPopup, onClose: handleClose, uri: uri, relatedObjectUris:
|
|
83
|
+
react_1.default.createElement(CollaborationPopup_1.CollaborationPopup, { anchorEl: anchorEl, open: isOpenPopup, onClose: handleClose, uri: uri, relatedObjectUris: allRelatedObjectUris, objectType: objectType, comment: currentComment }))));
|
|
75
84
|
};
|
|
76
85
|
exports.default = CommentsContainer;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare type Props = {
|
|
3
3
|
transparent?: boolean;
|
|
4
|
+
relativePosition?: boolean;
|
|
4
5
|
};
|
|
5
|
-
declare const LinearLoadIndicator: ({ transparent }: Props) => JSX.Element;
|
|
6
|
+
declare const LinearLoadIndicator: ({ transparent, relativePosition }: Props) => JSX.Element;
|
|
6
7
|
export default LinearLoadIndicator;
|
|
@@ -9,9 +9,13 @@ var LinearProgress_1 = __importDefault(require("@material-ui/core/LinearProgress
|
|
|
9
9
|
var styles_1 = require("./styles");
|
|
10
10
|
var LinearLoadIndicator = function (_a) {
|
|
11
11
|
var _b;
|
|
12
|
-
var _c = _a.transparent, transparent = _c === void 0 ? false : _c;
|
|
12
|
+
var _c = _a.transparent, transparent = _c === void 0 ? false : _c, _d = _a.relativePosition, relativePosition = _d === void 0 ? false : _d;
|
|
13
13
|
var styles = styles_1.useStyles();
|
|
14
|
-
return (react_1.default.createElement(
|
|
15
|
-
react_1.default.createElement(
|
|
14
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
15
|
+
react_1.default.createElement("div", { className: classnames_1.default(styles.loadingOverlay, (_b = {},
|
|
16
|
+
_b[styles.transparent] = transparent,
|
|
17
|
+
_b[styles.relativePosition] = relativePosition,
|
|
18
|
+
_b)) },
|
|
19
|
+
react_1.default.createElement(LinearProgress_1.default, { color: "secondary" }))));
|
|
16
20
|
};
|
|
17
21
|
exports.default = LinearLoadIndicator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"transparent" | "loadingOverlay">;
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"transparent" | "loadingOverlay" | "relativePosition">;
|
|
@@ -36,6 +36,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.MapChart = exports.LEGEND_WIDTH = void 0;
|
|
37
37
|
var react_1 = __importStar(require("react"));
|
|
38
38
|
var withPercents_1 = __importDefault(require("../HOCs/withPercents"));
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
40
|
+
// @ts-ignore
|
|
39
41
|
var react_simple_maps_1 = require("react-simple-maps");
|
|
40
42
|
var d3_scale_1 = require("d3-scale");
|
|
41
43
|
var d3Geo = __importStar(require("d3-geo"));
|
|
@@ -82,27 +84,28 @@ var MapChart = function (_a) {
|
|
|
82
84
|
var _d = useTooltipState_1.default(), tooltipState = _d.tooltipState, showTooltip = _d.showTooltip, hideTooltip = _d.hideTooltip;
|
|
83
85
|
var clickable = useClickableStyle_1.useClickableStyle(onItemClick);
|
|
84
86
|
return (react_1.default.createElement("div", { className: styles.mapChart, style: { width: width, height: height } },
|
|
85
|
-
react_1.default.createElement(react_simple_maps_1.
|
|
86
|
-
react_1.default.createElement(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
var
|
|
93
|
-
|
|
87
|
+
react_1.default.createElement(react_simple_maps_1.MapProvider, { width: mapWidth, height: height, projection: projectionFunc, projectionConfig: {} },
|
|
88
|
+
react_1.default.createElement("svg", { width: mapWidth, height: height, viewBox: "0 0 " + mapWidth + " " + height, className: 'rsm-svg' },
|
|
89
|
+
react_1.default.createElement(react_simple_maps_1.Geographies, { geography: geography }, function (_a) {
|
|
90
|
+
var geographies = _a.geographies;
|
|
91
|
+
return geographies.map(function (geo) {
|
|
92
|
+
var geoId = geo.properties[geoIdName || 'name'];
|
|
93
|
+
var geoLabel = geo.properties.name;
|
|
94
|
+
var cur = data.find(function (_a) {
|
|
95
|
+
var group = _a.group;
|
|
96
|
+
return group === geoId;
|
|
97
|
+
});
|
|
98
|
+
return (react_1.default.createElement(react_simple_maps_1.Geography, { key: geo.rsmKey, geography: geo, fill: cur ? colorScale(cur.value) : '#EEE', stroke: '#FFF', className: classnames_1.default(styles.geography, clickable), onMouseEnter: function (event) {
|
|
99
|
+
var data = cur || { label: geoLabel, value: 0, percent: 0, group: geoId };
|
|
100
|
+
var mapRect = event.target.parentElement.parentElement.getBoundingClientRect();
|
|
101
|
+
var coordinate = {
|
|
102
|
+
x: event.clientX - mapRect.x,
|
|
103
|
+
y: event.clientY - mapRect.y
|
|
104
|
+
};
|
|
105
|
+
showTooltip(data, coordinate);
|
|
106
|
+
}, onMouseLeave: function () { return hideTooltip(); }, onClick: onItemClick && (function () { return onItemClick(geoId); }) }));
|
|
94
107
|
});
|
|
95
|
-
|
|
96
|
-
var data = cur || { label: geoLabel, value: 0, percent: 0, group: geoId };
|
|
97
|
-
var mapRect = event.target.parentElement.parentElement.getBoundingClientRect();
|
|
98
|
-
var coordinate = {
|
|
99
|
-
x: event.clientX - mapRect.x,
|
|
100
|
-
y: event.clientY - mapRect.y
|
|
101
|
-
};
|
|
102
|
-
showTooltip(data, coordinate);
|
|
103
|
-
}, onMouseLeave: function () { return hideTooltip(); }, onClick: onItemClick && (function () { return onItemClick(geoId); }) }));
|
|
104
|
-
});
|
|
105
|
-
})),
|
|
108
|
+
}))),
|
|
106
109
|
showLegend && react_1.default.createElement(Legend_1.default, { width: exports.LEGEND_WIDTH, minValue: minValue, maxValue: maxValue, colors: MAP_COLORS }),
|
|
107
110
|
react_1.default.createElement(recharts_1.Tooltip, __assign({ viewBox: {
|
|
108
111
|
x: 0,
|
package/cjs/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.js
CHANGED
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
var react_1 = __importDefault(require("react"));
|
|
7
7
|
var classnames_1 = __importDefault(require("classnames"));
|
|
8
|
+
var ramda_1 = require("ramda");
|
|
8
9
|
var ArrowRightAlt_1 = __importDefault(require("@material-ui/icons/ArrowRightAlt"));
|
|
9
10
|
var Chip_1 = __importDefault(require("@material-ui/core/Chip"));
|
|
10
11
|
var helpers_1 = require("../../helpers/helpers");
|
|
@@ -17,7 +18,7 @@ var ChangeView = function (_a) {
|
|
|
17
18
|
react_1.default.createElement("span", { className: styles.fieldName },
|
|
18
19
|
label,
|
|
19
20
|
":"),
|
|
20
|
-
react_1.default.createElement("span", { className: styles.difference },
|
|
21
|
+
!ramda_1.isNil(value) && react_1.default.createElement("span", { className: styles.difference },
|
|
21
22
|
value,
|
|
22
23
|
newValue && oldValue && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
23
24
|
react_1.default.createElement(ArrowRightAlt_1.default, { className: styles.arrow }),
|
|
@@ -40,16 +40,18 @@ var getEntityChanges = ramda_1.curry(function (metadata, entityInfo, changes) {
|
|
|
40
40
|
return getAttributesList(metadata, attrTypes, changes);
|
|
41
41
|
});
|
|
42
42
|
exports.getEntityChanges = getEntityChanges;
|
|
43
|
-
var getRelationChanges = ramda_1.curry(function (metadata, relationInfo, changes) {
|
|
43
|
+
var getRelationChanges = ramda_1.curry(function (metadata, relationInfo, changes, changeType) {
|
|
44
|
+
var addRelationOperationIfNeeded = function (changes, changeType) {
|
|
45
|
+
if (changeType === operations_1.DCRTypes.CREATE_RELATIONSHIP || mdm_sdk_1.isEmptyValue(changes)) {
|
|
46
|
+
var operation = helpers_1.getOperationType(changeType);
|
|
47
|
+
return operation ? { operation: operation } : {};
|
|
48
|
+
}
|
|
49
|
+
return {};
|
|
50
|
+
};
|
|
44
51
|
var relationType = mdm_sdk_1.getRelationType(metadata, relationInfo.type);
|
|
45
52
|
var attrTypes = mdm_sdk_1.getRelationAttributesList(metadata, relationInfo.type);
|
|
46
53
|
return ramda_1.flatten([
|
|
47
|
-
{
|
|
48
|
-
level: 1,
|
|
49
|
-
label: ramda_1.propOr('', 'label', relationType),
|
|
50
|
-
attributeType: relationType,
|
|
51
|
-
attributeValue: __assign(__assign({}, relationInfo), changes)
|
|
52
|
-
},
|
|
54
|
+
__assign({ level: 1, label: ramda_1.propOr('', 'label', relationType), attributeType: relationType, attributeValue: __assign(__assign({}, relationInfo), changes) }, addRelationOperationIfNeeded(changes, changeType)),
|
|
53
55
|
getAttributesList(metadata, attrTypes, changes, 2)
|
|
54
56
|
]);
|
|
55
57
|
});
|
|
@@ -26,7 +26,7 @@ var SPECIAL_ATTRIBUTES_NAMES = [
|
|
|
26
26
|
];
|
|
27
27
|
var prepareStartOrEndDate = function (_a) {
|
|
28
28
|
var newValue = _a.newValue, oldValue = _a.oldValue;
|
|
29
|
-
var parseValue = function (value) { return (isNaN(value) ? value : parseInt(value)); };
|
|
29
|
+
var parseValue = function (value) { return (isNaN(value) || mdm_sdk_1.isEmptyValue(value) ? value : parseInt(value)); };
|
|
30
30
|
var isExistedValue = function (value) { return (value === null || value === void 0 ? void 0 : value.length) && !mdm_sdk_1.isEmptyValue(value); };
|
|
31
31
|
var isExistNewValue = isExistedValue(newValue);
|
|
32
32
|
var isExistOldValue = isExistedValue(oldValue);
|
|
@@ -211,7 +211,8 @@ var mergeChanges = function (metadata, changes, entityInfo, relationsInfo) {
|
|
|
211
211
|
getAttributeChanges(mdm_sdk_1.EntityAttrTypes.endDate.name)
|
|
212
212
|
], changesTree);
|
|
213
213
|
var relationsChanges = ramda_1.flatten(relationsInfo.map(function (relationInfo, index) {
|
|
214
|
-
|
|
214
|
+
var changeType = ramda_1.path([relationInfo.uri, 0, 'type'], changes);
|
|
215
|
+
return attributesHelpers_1.getRelationChanges(metadata, relationInfo, relationsTrees[index], changeType);
|
|
215
216
|
}));
|
|
216
217
|
return [entityChanges, relationsChanges];
|
|
217
218
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
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.RelatedObjectUrisContext = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
exports.RelatedObjectUrisContext = react_1.default.createContext([]);
|
|
9
|
+
exports.RelatedObjectUrisContext.displayName = 'RelatedObjectUrisContext';
|
package/cjs/contexts/index.d.ts
CHANGED
|
@@ -13,3 +13,4 @@ export { CrosswalksDisplayProvider, useCrosswalkColor, useCrosswalkFocus, useCro
|
|
|
13
13
|
export { ExpandedAttributesProvider, useAttributeExpanded } from './ExpandedAttributesContext';
|
|
14
14
|
export { EntityMarkerContext } from './EntityMarkerContext';
|
|
15
15
|
export { WorkflowTasksContext } from './WorkflowTasksContext';
|
|
16
|
+
export { RelatedObjectUrisContext } from './RelatedObjectUrisContext';
|
package/cjs/contexts/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WorkflowTasksContext = exports.EntityMarkerContext = exports.useAttributeExpanded = exports.ExpandedAttributesProvider = exports.useHighlightedCrosswalks = exports.useCrosswalkHighlight = exports.useCrosswalkFocus = exports.useCrosswalkColor = exports.CrosswalksDisplayProvider = exports.EntitiesMapContext = exports.IdContext = exports.ProfilePerspectiveViewContext = exports.PivotingAttributeContext = exports.UsersContext = exports.CollaborationContext = exports.BlockImageGalleryDialogContext = exports.ViewIdContext = exports.PopupBoundariesContext = exports.HistoryDiffContext = exports.AsyncMountContext = void 0;
|
|
3
|
+
exports.RelatedObjectUrisContext = exports.WorkflowTasksContext = exports.EntityMarkerContext = exports.useAttributeExpanded = exports.ExpandedAttributesProvider = exports.useHighlightedCrosswalks = exports.useCrosswalkHighlight = exports.useCrosswalkFocus = exports.useCrosswalkColor = exports.CrosswalksDisplayProvider = exports.EntitiesMapContext = exports.IdContext = exports.ProfilePerspectiveViewContext = exports.PivotingAttributeContext = exports.UsersContext = exports.CollaborationContext = exports.BlockImageGalleryDialogContext = exports.ViewIdContext = exports.PopupBoundariesContext = exports.HistoryDiffContext = exports.AsyncMountContext = void 0;
|
|
4
4
|
var AsyncMountContext_1 = require("./AsyncMountContext");
|
|
5
5
|
Object.defineProperty(exports, "AsyncMountContext", { enumerable: true, get: function () { return AsyncMountContext_1.AsyncMountContext; } });
|
|
6
6
|
var HistoryAppearanceContext_1 = require("./HistoryAppearanceContext");
|
|
@@ -36,3 +36,5 @@ var EntityMarkerContext_1 = require("./EntityMarkerContext");
|
|
|
36
36
|
Object.defineProperty(exports, "EntityMarkerContext", { enumerable: true, get: function () { return EntityMarkerContext_1.EntityMarkerContext; } });
|
|
37
37
|
var WorkflowTasksContext_1 = require("./WorkflowTasksContext");
|
|
38
38
|
Object.defineProperty(exports, "WorkflowTasksContext", { enumerable: true, get: function () { return WorkflowTasksContext_1.WorkflowTasksContext; } });
|
|
39
|
+
var RelatedObjectUrisContext_1 = require("./RelatedObjectUrisContext");
|
|
40
|
+
Object.defineProperty(exports, "RelatedObjectUrisContext", { enumerable: true, get: function () { return RelatedObjectUrisContext_1.RelatedObjectUrisContext; } });
|
|
@@ -10,6 +10,7 @@ import { Avatar } from '../Avatar/Avatar';
|
|
|
10
10
|
import { CollaborationContext } from '../../../contexts';
|
|
11
11
|
import { useStyles } from './styles';
|
|
12
12
|
import { always, cond, T } from 'ramda';
|
|
13
|
+
import { useSafePromise } from '../../../hooks';
|
|
13
14
|
var getPlaceholder = function (status) {
|
|
14
15
|
switch (status) {
|
|
15
16
|
case 'open':
|
|
@@ -38,6 +39,7 @@ export var SendMessageArea = function (_a) {
|
|
|
38
39
|
var _d = useState(''), plainTextValue = _d[0], setPlainTextValue = _d[1];
|
|
39
40
|
var _e = useState([]), mentions = _e[0], setMentions = _e[1];
|
|
40
41
|
var _f = useState(false), focused = _f[0], setFocused = _f[1];
|
|
42
|
+
var safePromise = useSafePromise();
|
|
41
43
|
var hasValue = value.trim() !== '';
|
|
42
44
|
var shouldShowButtons = focused || hasValue;
|
|
43
45
|
var status = comment === null || comment === void 0 ? void 0 : comment.status;
|
|
@@ -98,7 +100,7 @@ export var SendMessageArea = function (_a) {
|
|
|
98
100
|
}
|
|
99
101
|
]
|
|
100
102
|
]);
|
|
101
|
-
return request().then(clearValue).catch(console.log); //eslint-disable-line no-console
|
|
103
|
+
return safePromise(request()).then(clearValue).catch(console.log); //eslint-disable-line no-console
|
|
102
104
|
};
|
|
103
105
|
useEffect(function () {
|
|
104
106
|
if (popperRef) {
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
2
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
3
|
+
to[j] = from[i];
|
|
4
|
+
return to;
|
|
5
|
+
};
|
|
6
|
+
import React, { useContext, useMemo, useState } from 'react';
|
|
2
7
|
import classnames from 'classnames';
|
|
3
8
|
import { useStyles } from './styles';
|
|
4
9
|
import { useDidUpdateEffect } from '../../hooks';
|
|
5
|
-
import { CollaborationContext } from '../../contexts';
|
|
10
|
+
import { CollaborationContext, RelatedObjectUrisContext } from '../../contexts';
|
|
6
11
|
import CommentButton from './buttons/CommentButton';
|
|
7
12
|
import AddCommentButton from './buttons/AddCommentButton';
|
|
8
13
|
import { CollaborationPopup } from '../CollaborationPopup/CollaborationPopup';
|
|
@@ -39,6 +44,10 @@ var CommentsContainer = function (_a) {
|
|
|
39
44
|
onChangePopupVisibility(isOpenPopup);
|
|
40
45
|
}
|
|
41
46
|
}, [isOpenPopup]);
|
|
47
|
+
var additionalRelatedObjectUris = useContext(RelatedObjectUrisContext);
|
|
48
|
+
var allRelatedObjectUris = useMemo(function () {
|
|
49
|
+
return additionalRelatedObjectUris ? __spreadArray(__spreadArray([], relatedObjectUris), additionalRelatedObjectUris) : relatedObjectUris;
|
|
50
|
+
}, [additionalRelatedObjectUris, relatedObjectUris]);
|
|
42
51
|
return (showComments && (React.createElement("div", { className: classnames(styles.root, className) },
|
|
43
52
|
shouldShowAddCommentButton && (React.createElement(AddCommentButton, { className: classnames(styles.addButton, (_b = {},
|
|
44
53
|
_b[styles.showAlways] = showAlways || isOpenPopupWithNewComment,
|
|
@@ -47,6 +56,6 @@ var CommentsContainer = function (_a) {
|
|
|
47
56
|
var replies = _a.replies, commentId = _a.commentId;
|
|
48
57
|
return (React.createElement(CommentButton, { ref: commentId === (currentComment === null || currentComment === void 0 ? void 0 : currentComment.commentId) ? setAnchorEl : null, key: commentId, onClick: function () { return handleClickCommentButton(commentId); } }, 1 + replies));
|
|
49
58
|
}),
|
|
50
|
-
React.createElement(CollaborationPopup, { anchorEl: anchorEl, open: isOpenPopup, onClose: handleClose, uri: uri, relatedObjectUris:
|
|
59
|
+
React.createElement(CollaborationPopup, { anchorEl: anchorEl, open: isOpenPopup, onClose: handleClose, uri: uri, relatedObjectUris: allRelatedObjectUris, objectType: objectType, comment: currentComment }))));
|
|
51
60
|
};
|
|
52
61
|
export default CommentsContainer;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare type Props = {
|
|
3
3
|
transparent?: boolean;
|
|
4
|
+
relativePosition?: boolean;
|
|
4
5
|
};
|
|
5
|
-
declare const LinearLoadIndicator: ({ transparent }: Props) => JSX.Element;
|
|
6
|
+
declare const LinearLoadIndicator: ({ transparent, relativePosition }: Props) => JSX.Element;
|
|
6
7
|
export default LinearLoadIndicator;
|
|
@@ -4,9 +4,13 @@ import LinearProgress from '@material-ui/core/LinearProgress';
|
|
|
4
4
|
import { useStyles } from './styles';
|
|
5
5
|
var LinearLoadIndicator = function (_a) {
|
|
6
6
|
var _b;
|
|
7
|
-
var _c = _a.transparent, transparent = _c === void 0 ? false : _c;
|
|
7
|
+
var _c = _a.transparent, transparent = _c === void 0 ? false : _c, _d = _a.relativePosition, relativePosition = _d === void 0 ? false : _d;
|
|
8
8
|
var styles = useStyles();
|
|
9
|
-
return (React.createElement(
|
|
10
|
-
React.createElement(
|
|
9
|
+
return (React.createElement(React.Fragment, null,
|
|
10
|
+
React.createElement("div", { className: classnames(styles.loadingOverlay, (_b = {},
|
|
11
|
+
_b[styles.transparent] = transparent,
|
|
12
|
+
_b[styles.relativePosition] = relativePosition,
|
|
13
|
+
_b)) },
|
|
14
|
+
React.createElement(LinearProgress, { color: "secondary" }))));
|
|
11
15
|
};
|
|
12
16
|
export default LinearLoadIndicator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"transparent" | "loadingOverlay">;
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"transparent" | "loadingOverlay" | "relativePosition">;
|
|
@@ -11,7 +11,9 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import React, { useMemo } from 'react';
|
|
13
13
|
import withPercents from '../HOCs/withPercents';
|
|
14
|
-
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
import { Geographies, Geography, MapProvider } from 'react-simple-maps';
|
|
15
17
|
import { scaleQuantize } from 'd3-scale';
|
|
16
18
|
import * as d3Geo from 'd3-geo';
|
|
17
19
|
import { feature } from 'topojson-client';
|
|
@@ -57,27 +59,28 @@ export var MapChart = function (_a) {
|
|
|
57
59
|
var _d = useTooltipState(), tooltipState = _d.tooltipState, showTooltip = _d.showTooltip, hideTooltip = _d.hideTooltip;
|
|
58
60
|
var clickable = useClickableStyle(onItemClick);
|
|
59
61
|
return (React.createElement("div", { className: styles.mapChart, style: { width: width, height: height } },
|
|
60
|
-
React.createElement(
|
|
61
|
-
React.createElement(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
var
|
|
68
|
-
|
|
62
|
+
React.createElement(MapProvider, { width: mapWidth, height: height, projection: projectionFunc, projectionConfig: {} },
|
|
63
|
+
React.createElement("svg", { width: mapWidth, height: height, viewBox: "0 0 " + mapWidth + " " + height, className: 'rsm-svg' },
|
|
64
|
+
React.createElement(Geographies, { geography: geography }, function (_a) {
|
|
65
|
+
var geographies = _a.geographies;
|
|
66
|
+
return geographies.map(function (geo) {
|
|
67
|
+
var geoId = geo.properties[geoIdName || 'name'];
|
|
68
|
+
var geoLabel = geo.properties.name;
|
|
69
|
+
var cur = data.find(function (_a) {
|
|
70
|
+
var group = _a.group;
|
|
71
|
+
return group === geoId;
|
|
72
|
+
});
|
|
73
|
+
return (React.createElement(Geography, { key: geo.rsmKey, geography: geo, fill: cur ? colorScale(cur.value) : '#EEE', stroke: '#FFF', className: classnames(styles.geography, clickable), onMouseEnter: function (event) {
|
|
74
|
+
var data = cur || { label: geoLabel, value: 0, percent: 0, group: geoId };
|
|
75
|
+
var mapRect = event.target.parentElement.parentElement.getBoundingClientRect();
|
|
76
|
+
var coordinate = {
|
|
77
|
+
x: event.clientX - mapRect.x,
|
|
78
|
+
y: event.clientY - mapRect.y
|
|
79
|
+
};
|
|
80
|
+
showTooltip(data, coordinate);
|
|
81
|
+
}, onMouseLeave: function () { return hideTooltip(); }, onClick: onItemClick && (function () { return onItemClick(geoId); }) }));
|
|
69
82
|
});
|
|
70
|
-
|
|
71
|
-
var data = cur || { label: geoLabel, value: 0, percent: 0, group: geoId };
|
|
72
|
-
var mapRect = event.target.parentElement.parentElement.getBoundingClientRect();
|
|
73
|
-
var coordinate = {
|
|
74
|
-
x: event.clientX - mapRect.x,
|
|
75
|
-
y: event.clientY - mapRect.y
|
|
76
|
-
};
|
|
77
|
-
showTooltip(data, coordinate);
|
|
78
|
-
}, onMouseLeave: function () { return hideTooltip(); }, onClick: onItemClick && (function () { return onItemClick(geoId); }) }));
|
|
79
|
-
});
|
|
80
|
-
})),
|
|
83
|
+
}))),
|
|
81
84
|
showLegend && React.createElement(Legend, { width: LEGEND_WIDTH, minValue: minValue, maxValue: maxValue, colors: MAP_COLORS }),
|
|
82
85
|
React.createElement(Tooltip, __assign({ viewBox: {
|
|
83
86
|
x: 0,
|
package/esm/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
|
+
import { isNil } from 'ramda';
|
|
3
4
|
import ArrowRightAltIcon from '@material-ui/icons/ArrowRightAlt';
|
|
4
5
|
import Chip from '@material-ui/core/Chip';
|
|
5
6
|
import { getOperationLabel } from '../../helpers/helpers';
|
|
@@ -12,7 +13,7 @@ var ChangeView = function (_a) {
|
|
|
12
13
|
React.createElement("span", { className: styles.fieldName },
|
|
13
14
|
label,
|
|
14
15
|
":"),
|
|
15
|
-
React.createElement("span", { className: styles.difference },
|
|
16
|
+
!isNil(value) && React.createElement("span", { className: styles.difference },
|
|
16
17
|
value,
|
|
17
18
|
newValue && oldValue && (React.createElement(React.Fragment, null,
|
|
18
19
|
React.createElement(ArrowRightAltIcon, { className: styles.arrow }),
|
|
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { complement, curry, flatten, is, isEmpty, pathOr, propOr, times } from 'ramda';
|
|
13
|
-
import { DataTypes, getAttributeTypeSubAttributes, getLabel, getRelationAttributesList, getRelationType, isSpecialAttribute } from '@reltio/mdm-sdk';
|
|
13
|
+
import { DataTypes, getAttributeTypeSubAttributes, getLabel, getRelationAttributesList, getRelationType, isEmptyValue, isSpecialAttribute } from '@reltio/mdm-sdk';
|
|
14
14
|
import { getFilteredAttrTypes } from '../../../../attributes/helpers/attributesView';
|
|
15
15
|
import { getOperationType } from './helpers';
|
|
16
16
|
import { DCRTypes } from '../../../constants/operations';
|
|
@@ -36,16 +36,18 @@ var getEntityChanges = curry(function (metadata, entityInfo, changes) {
|
|
|
36
36
|
var attrTypes = getFilteredAttrTypes(metadata, entityInfo.type, [], []);
|
|
37
37
|
return getAttributesList(metadata, attrTypes, changes);
|
|
38
38
|
});
|
|
39
|
-
var getRelationChanges = curry(function (metadata, relationInfo, changes) {
|
|
39
|
+
var getRelationChanges = curry(function (metadata, relationInfo, changes, changeType) {
|
|
40
|
+
var addRelationOperationIfNeeded = function (changes, changeType) {
|
|
41
|
+
if (changeType === DCRTypes.CREATE_RELATIONSHIP || isEmptyValue(changes)) {
|
|
42
|
+
var operation = getOperationType(changeType);
|
|
43
|
+
return operation ? { operation: operation } : {};
|
|
44
|
+
}
|
|
45
|
+
return {};
|
|
46
|
+
};
|
|
40
47
|
var relationType = getRelationType(metadata, relationInfo.type);
|
|
41
48
|
var attrTypes = getRelationAttributesList(metadata, relationInfo.type);
|
|
42
49
|
return flatten([
|
|
43
|
-
{
|
|
44
|
-
level: 1,
|
|
45
|
-
label: propOr('', 'label', relationType),
|
|
46
|
-
attributeType: relationType,
|
|
47
|
-
attributeValue: __assign(__assign({}, relationInfo), changes)
|
|
48
|
-
},
|
|
50
|
+
__assign({ level: 1, label: propOr('', 'label', relationType), attributeType: relationType, attributeValue: __assign(__assign({}, relationInfo), changes) }, addRelationOperationIfNeeded(changes, changeType)),
|
|
49
51
|
getAttributesList(metadata, attrTypes, changes, 2)
|
|
50
52
|
]);
|
|
51
53
|
});
|
|
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { concat, curry, difference, flatten, identity, isNil, omit, pick, pipe, propEq, propOr, reduce } from 'ramda';
|
|
12
|
+
import { concat, curry, difference, flatten, identity, isNil, omit, path, pick, pipe, propEq, propOr, reduce } from 'ramda';
|
|
13
13
|
import { EntityAttrTypes, generateTempUri, getRoleLabel, isEmptyValue } from '@reltio/mdm-sdk';
|
|
14
14
|
import { DCRTypes } from '../../../constants/operations';
|
|
15
15
|
import { getEntityChanges, getRelationChanges } from './attributesHelpers';
|
|
@@ -23,7 +23,7 @@ var SPECIAL_ATTRIBUTES_NAMES = [
|
|
|
23
23
|
];
|
|
24
24
|
var prepareStartOrEndDate = function (_a) {
|
|
25
25
|
var newValue = _a.newValue, oldValue = _a.oldValue;
|
|
26
|
-
var parseValue = function (value) { return (isNaN(value) ? value : parseInt(value)); };
|
|
26
|
+
var parseValue = function (value) { return (isNaN(value) || isEmptyValue(value) ? value : parseInt(value)); };
|
|
27
27
|
var isExistedValue = function (value) { return (value === null || value === void 0 ? void 0 : value.length) && !isEmptyValue(value); };
|
|
28
28
|
var isExistNewValue = isExistedValue(newValue);
|
|
29
29
|
var isExistOldValue = isExistedValue(oldValue);
|
|
@@ -208,7 +208,8 @@ var mergeChanges = function (metadata, changes, entityInfo, relationsInfo) {
|
|
|
208
208
|
getAttributeChanges(EntityAttrTypes.endDate.name)
|
|
209
209
|
], changesTree);
|
|
210
210
|
var relationsChanges = flatten(relationsInfo.map(function (relationInfo, index) {
|
|
211
|
-
|
|
211
|
+
var changeType = path([relationInfo.uri, 0, 'type'], changes);
|
|
212
|
+
return getRelationChanges(metadata, relationInfo, relationsTrees[index], changeType);
|
|
212
213
|
}));
|
|
213
214
|
return [entityChanges, relationsChanges];
|
|
214
215
|
};
|
package/esm/contexts/index.d.ts
CHANGED
|
@@ -13,3 +13,4 @@ export { CrosswalksDisplayProvider, useCrosswalkColor, useCrosswalkFocus, useCro
|
|
|
13
13
|
export { ExpandedAttributesProvider, useAttributeExpanded } from './ExpandedAttributesContext';
|
|
14
14
|
export { EntityMarkerContext } from './EntityMarkerContext';
|
|
15
15
|
export { WorkflowTasksContext } from './WorkflowTasksContext';
|
|
16
|
+
export { RelatedObjectUrisContext } from './RelatedObjectUrisContext';
|
package/esm/contexts/index.js
CHANGED
|
@@ -13,3 +13,4 @@ export { CrosswalksDisplayProvider, useCrosswalkColor, useCrosswalkFocus, useCro
|
|
|
13
13
|
export { ExpandedAttributesProvider, useAttributeExpanded } from './ExpandedAttributesContext';
|
|
14
14
|
export { EntityMarkerContext } from './EntityMarkerContext';
|
|
15
15
|
export { WorkflowTasksContext } from './WorkflowTasksContext';
|
|
16
|
+
export { RelatedObjectUrisContext } from './RelatedObjectUrisContext';
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.928",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE FILE",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@date-io/moment": "^1.3.5",
|
|
9
9
|
"@react-google-maps/api": "^2.7.0",
|
|
10
|
-
"@reltio/mdm-module": "^1.4.
|
|
11
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
10
|
+
"@reltio/mdm-module": "^1.4.928",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.928",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|