@reltio/components 1.4.912 → 1.4.916
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/MergeButton/MergeButton.d.ts +1 -0
- package/cjs/components/MergeButton/MergeButton.js +3 -2
- package/cjs/components/SideIconPanel/SideButtonsPanel.d.ts +3 -3
- package/cjs/components/SideIconPanel/SideButtonsPanel.js +3 -3
- package/cjs/components/SidePanel/SidePanelContentHeader/SidePanelContentHeader.d.ts +3 -2
- package/cjs/components/SidePanel/SidePanelContentHeader/SidePanelContentHeader.js +6 -5
- package/cjs/components/attributes/AttributesView/index.js +1 -1
- package/cjs/components/attributes/ImageAttributesLine/ImageAttributesLine.d.ts +7 -2
- package/cjs/components/attributes/ImageAttributesLine/ImageAttributesLine.js +15 -1
- package/cjs/components/attributes/editMode/AttributesPager/AttributesPager.js +1 -1
- package/cjs/components/attributes/editMode/ImageAttributesLine/ImageAttributesLine.d.ts +8 -2
- package/cjs/components/attributes/editMode/ImageAttributesLine/ImageAttributesLine.js +5 -5
- package/cjs/components/attributes/editMode/SimpleAttributeEditor/selectors/helpers/parents.js +3 -1
- package/cjs/components/attributes/readMode/AttributesPager/AttributesPager.js +1 -1
- package/cjs/components/attributes/readMode/ImageAttributesLine/ImageAttributesLine.d.ts +7 -2
- package/cjs/components/attributes/readMode/ImageAttributesLine/ImageAttributesLine.js +2 -2
- package/cjs/components/history/HistoryTree/HistoryTree.js +11 -1
- package/cjs/components/history/hooks/useHistory.d.ts +1 -0
- package/cjs/components/history/hooks/useHistory.js +7 -2
- package/cjs/components/history/hooks/useHistoryDiff.d.ts +2 -0
- package/cjs/components/history/hooks/useHistoryDiff.js +62 -0
- package/cjs/components/history/hooks/useHistoryWithTotal.d.ts +1 -0
- package/cjs/components/history/hooks/useHistoryWithTotal.js +1 -1
- package/cjs/components/history/index.d.ts +1 -0
- package/cjs/components/history/index.js +3 -1
- package/cjs/components/index.d.ts +1 -0
- package/cjs/components/index.js +5 -3
- package/cjs/contexts/HistoryAppearanceContext/index.js +3 -1
- package/cjs/hooks/useMergeAllRequest.d.ts +2 -1
- package/cjs/hooks/useMergeAllRequest.js +6 -3
- package/esm/components/MergeButton/MergeButton.d.ts +1 -0
- package/esm/components/MergeButton/MergeButton.js +3 -2
- package/esm/components/SideIconPanel/SideButtonsPanel.d.ts +3 -3
- package/esm/components/SideIconPanel/SideButtonsPanel.js +3 -3
- package/esm/components/SidePanel/SidePanelContentHeader/SidePanelContentHeader.d.ts +3 -2
- package/esm/components/SidePanel/SidePanelContentHeader/SidePanelContentHeader.js +6 -5
- package/esm/components/attributes/AttributesView/index.js +1 -1
- package/esm/components/attributes/ImageAttributesLine/ImageAttributesLine.d.ts +7 -2
- package/esm/components/attributes/ImageAttributesLine/ImageAttributesLine.js +15 -1
- package/esm/components/attributes/editMode/AttributesPager/AttributesPager.js +1 -1
- package/esm/components/attributes/editMode/ImageAttributesLine/ImageAttributesLine.d.ts +8 -2
- package/esm/components/attributes/editMode/ImageAttributesLine/ImageAttributesLine.js +6 -6
- package/esm/components/attributes/editMode/SimpleAttributeEditor/selectors/helpers/parents.js +3 -1
- package/esm/components/attributes/readMode/AttributesPager/AttributesPager.js +1 -1
- package/esm/components/attributes/readMode/ImageAttributesLine/ImageAttributesLine.d.ts +7 -2
- package/esm/components/attributes/readMode/ImageAttributesLine/ImageAttributesLine.js +2 -2
- package/esm/components/history/HistoryTree/HistoryTree.js +12 -2
- package/esm/components/history/hooks/useHistory.d.ts +1 -0
- package/esm/components/history/hooks/useHistory.js +7 -2
- package/esm/components/history/hooks/useHistoryDiff.d.ts +2 -0
- package/esm/components/history/hooks/useHistoryDiff.js +39 -0
- package/esm/components/history/hooks/useHistoryWithTotal.d.ts +1 -0
- package/esm/components/history/hooks/useHistoryWithTotal.js +1 -1
- package/esm/components/history/index.d.ts +1 -0
- package/esm/components/history/index.js +1 -0
- package/esm/components/index.d.ts +1 -0
- package/esm/components/index.js +1 -0
- package/esm/contexts/HistoryAppearanceContext/index.js +3 -1
- package/esm/hooks/useMergeAllRequest.d.ts +2 -1
- package/esm/hooks/useMergeAllRequest.js +6 -3
- package/package.json +3 -3
|
@@ -10,6 +10,7 @@ declare type Props = {
|
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
onStartRequest?: () => void;
|
|
12
12
|
onFinishRequest?: () => void;
|
|
13
|
+
onError?: () => void;
|
|
13
14
|
};
|
|
14
15
|
export declare const MergeButton: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLLIElement>>;
|
|
15
16
|
export {};
|
|
@@ -52,12 +52,13 @@ var core_1 = require("../../core");
|
|
|
52
52
|
var ActionButton_1 = require("../ActionButton/ActionButton");
|
|
53
53
|
var hooks_1 = require("../../hooks");
|
|
54
54
|
exports.MergeButton = react_1.forwardRef(function (_a, ref) {
|
|
55
|
-
var className = _a.className, _b = _a.mode, mode = _b === void 0 ? ActionButton_1.ActionButtonMode.iconButton : _b, _c = _a.onMenuClose, onMenuClose = _c === void 0 ? core_1.noop : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, entity = _a.entity, entities = _a.entities, onStartRequest = _a.onStartRequest, onFinishRequest = _a.onFinishRequest, otherProps = __rest(_a, ["className", "mode", "onMenuClose", "disabled", "entity", "entities", "onStartRequest", "onFinishRequest"]);
|
|
55
|
+
var className = _a.className, _b = _a.mode, mode = _b === void 0 ? ActionButton_1.ActionButtonMode.iconButton : _b, _c = _a.onMenuClose, onMenuClose = _c === void 0 ? core_1.noop : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, entity = _a.entity, entities = _a.entities, onStartRequest = _a.onStartRequest, onFinishRequest = _a.onFinishRequest, onError = _a.onError, otherProps = __rest(_a, ["className", "mode", "onMenuClose", "disabled", "entity", "entities", "onStartRequest", "onFinishRequest", "onError"]);
|
|
56
56
|
var sendMergeAllRequest = hooks_1.useMergeAllRequest({
|
|
57
57
|
entity: entity,
|
|
58
58
|
entities: entities,
|
|
59
59
|
onStartRequest: onStartRequest,
|
|
60
|
-
onFinishRequest: onFinishRequest
|
|
60
|
+
onFinishRequest: onFinishRequest,
|
|
61
|
+
onError: onError
|
|
61
62
|
}).sendMergeAllRequest;
|
|
62
63
|
return (react_1.default.createElement(ActionButton_1.ActionButton, __assign({ className: className, disabled: disabled, mode: mode, label: ui_i18n_1.default.text('Merge'), icon: mergeIcon_svg_1.default, onClick: sendMergeAllRequest, onMenuClose: onMenuClose, ref: ref }, otherProps)));
|
|
63
64
|
});
|
|
@@ -3,11 +3,11 @@ declare type Props = {
|
|
|
3
3
|
buttonsProps: {
|
|
4
4
|
icon: ElementType;
|
|
5
5
|
tooltipTitle: string;
|
|
6
|
-
id:
|
|
6
|
+
id: number;
|
|
7
7
|
}[];
|
|
8
|
-
|
|
8
|
+
activeIndexId: number;
|
|
9
9
|
className?: string;
|
|
10
|
-
onButtonClick: (
|
|
10
|
+
onButtonClick: (id: number) => void;
|
|
11
11
|
};
|
|
12
12
|
export declare const SideButtonsPanel: VFC<Props>;
|
|
13
13
|
export {};
|
|
@@ -31,12 +31,12 @@ var classnames_1 = __importDefault(require("classnames"));
|
|
|
31
31
|
var SmallIconButton_1 = require("../SmallIconButton");
|
|
32
32
|
var styles_1 = require("./styles");
|
|
33
33
|
var SideButtonsPanel = function (_a) {
|
|
34
|
-
var buttonsProps = _a.buttonsProps,
|
|
34
|
+
var buttonsProps = _a.buttonsProps, activeIndexId = _a.activeIndexId, className = _a.className, onButtonClick = _a.onButtonClick;
|
|
35
35
|
var styles = styles_1.useStyles();
|
|
36
|
-
return (react_1.default.createElement("div", { className: classnames_1.default(styles.container, className) }, buttonsProps.map(function (_a
|
|
36
|
+
return (react_1.default.createElement("div", { className: classnames_1.default(styles.container, className) }, buttonsProps.map(function (_a) {
|
|
37
37
|
var _b;
|
|
38
38
|
var id = _a.id, buttonProps = __rest(_a, ["id"]);
|
|
39
|
-
return (react_1.default.createElement(SmallIconButton_1.SmallIconButtonWithTooltip, __assign({}, buttonProps, { size: "S", key: id, className: classnames_1.default((_b = {}, _b[styles.active] =
|
|
39
|
+
return (react_1.default.createElement(SmallIconButton_1.SmallIconButtonWithTooltip, __assign({}, buttonProps, { size: "S", key: id, className: classnames_1.default((_b = {}, _b[styles.active] = activeIndexId === id, _b), styles.buttonWrapper), onClick: function () { return onButtonClick(id); }, "data-reltio-id": "reltio-profile-right-side-button-" + id })));
|
|
40
40
|
})));
|
|
41
41
|
};
|
|
42
42
|
exports.SideButtonsPanel = SideButtonsPanel;
|
|
@@ -12,13 +12,14 @@ var Divider_1 = __importDefault(require("@material-ui/core/Divider"));
|
|
|
12
12
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
13
13
|
var SmallIconButton_1 = require("../../SmallIconButton");
|
|
14
14
|
var SidePanelContentHeader = function (_a) {
|
|
15
|
-
var onClose = _a.onClose, mainTitle = _a.mainTitle, secondTitle = _a.secondTitle, rightContent = _a.rightContent;
|
|
15
|
+
var onClose = _a.onClose, mainTitle = _a.mainTitle, secondTitle = _a.secondTitle, content = _a.content, rightContent = _a.rightContent;
|
|
16
16
|
var styles = styles_1.useStyles();
|
|
17
17
|
return (react_1.default.createElement("div", { className: styles.container },
|
|
18
18
|
react_1.default.createElement(SmallIconButton_1.SmallIconButtonWithTooltip, { size: "S", icon: Close_1.default, onClick: onClose, className: styles.icon, tooltipTitle: ui_i18n_1.default.text('Close') }),
|
|
19
|
-
react_1.default.createElement(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
content || (react_1.default.createElement(react_1.default.Fragment, null,
|
|
20
|
+
react_1.default.createElement(Typography_1.default, { variant: "h6" }, mainTitle),
|
|
21
|
+
react_1.default.createElement(Divider_1.default, { orientation: "vertical", flexItem: true, className: styles.divider }),
|
|
22
|
+
react_1.default.createElement(Typography_1.default, { variant: "body1", color: "textSecondary", className: styles.secondTitle }, secondTitle),
|
|
23
|
+
rightContent))));
|
|
23
24
|
};
|
|
24
25
|
exports.SidePanelContentHeader = SidePanelContentHeader;
|
|
@@ -9,7 +9,7 @@ var mdm_module_1 = __importDefault(require("@reltio/mdm-module"));
|
|
|
9
9
|
var AttributesView_1 = __importDefault(require("./AttributesView"));
|
|
10
10
|
exports.AttributesView = AttributesView_1.default;
|
|
11
11
|
var mapStateToProps = function (state, ownProps) { return ({
|
|
12
|
-
entity: ownProps.entity || mdm_module_1.default.selectors.
|
|
12
|
+
entity: ownProps.entity || mdm_module_1.default.selectors.getEntityWithDiff(state),
|
|
13
13
|
mode: ownProps.mode || mdm_module_1.default.selectors.getMode(state)
|
|
14
14
|
}); };
|
|
15
15
|
exports.default = react_redux_1.connect(mapStateToProps)(AttributesView_1.default);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { RequestNextPageOfAttributeValuesPayload } from '@reltio/mdm-module';
|
|
3
|
+
import { AttributeType, ImageAttributeValue, Paging } from '@reltio/mdm-sdk';
|
|
3
4
|
import { AttributeItem } from '../editMode/AttributesPager';
|
|
4
5
|
import { SIZES_TYPE } from './styles';
|
|
5
6
|
export declare type ImageRenderProps = {
|
|
@@ -19,6 +20,10 @@ declare type Props = {
|
|
|
19
20
|
onUpload?: () => void;
|
|
20
21
|
onDeleteAttribute?: (param: AttributeItem) => void;
|
|
21
22
|
imageSize?: SIZES_TYPE;
|
|
23
|
+
paging?: Paging;
|
|
24
|
+
requestNextPageOfAttributeValues?: (payload: RequestNextPageOfAttributeValuesPayload) => void;
|
|
25
|
+
parentUri?: string;
|
|
26
|
+
showNonOv?: boolean;
|
|
22
27
|
};
|
|
23
|
-
declare const ImageAttributesLine: ({ attributeType, attributeValues, renderImage, overlay, countFixedItems, children, onUpload, onDeleteAttribute, imageSize }: Props) => JSX.Element;
|
|
28
|
+
declare const ImageAttributesLine: ({ attributeType, attributeValues, renderImage, overlay, countFixedItems, children, onUpload, onDeleteAttribute, imageSize, paging, parentUri, showNonOv, requestNextPageOfAttributeValues }: Props) => JSX.Element;
|
|
24
29
|
export default ImageAttributesLine;
|
|
@@ -45,11 +45,25 @@ var imageAttributes_1 = require("../helpers/imageAttributes");
|
|
|
45
45
|
var constants_1 = require("./constants");
|
|
46
46
|
var styles_1 = require("./styles");
|
|
47
47
|
var ImageAttributesLine = function (_a) {
|
|
48
|
-
var attributeType = _a.attributeType, _b = _a.attributeValues, attributeValues = _b === void 0 ? [] : _b, renderImage = _a.renderImage, _c = _a.overlay, overlay = _c === void 0 ? false : _c, _d = _a.countFixedItems, countFixedItems = _d === void 0 ? 0 : _d, children = _a.children, onUpload = _a.onUpload, onDeleteAttribute = _a.onDeleteAttribute, _e = _a.imageSize, imageSize = _e === void 0 ? constants_1.DEFAULT_IMAGE_SIZE : _e;
|
|
48
|
+
var attributeType = _a.attributeType, _b = _a.attributeValues, attributeValues = _b === void 0 ? [] : _b, renderImage = _a.renderImage, _c = _a.overlay, overlay = _c === void 0 ? false : _c, _d = _a.countFixedItems, countFixedItems = _d === void 0 ? 0 : _d, children = _a.children, onUpload = _a.onUpload, onDeleteAttribute = _a.onDeleteAttribute, _e = _a.imageSize, imageSize = _e === void 0 ? constants_1.DEFAULT_IMAGE_SIZE : _e, paging = _a.paging, parentUri = _a.parentUri, showNonOv = _a.showNonOv, requestNextPageOfAttributeValues = _a.requestNextPageOfAttributeValues;
|
|
49
49
|
var entity = react_redux_1.useSelector(mdm_module_1.default.selectors.getEntity) || {};
|
|
50
50
|
var isViewMode = react_redux_1.useSelector(mdm_module_1.default.selectors.getIsViewMode);
|
|
51
51
|
var dispatch = react_redux_1.useDispatch();
|
|
52
52
|
var styles = styles_1.useStyles(imageSize);
|
|
53
|
+
react_1.useEffect(function () {
|
|
54
|
+
if (paging && requestNextPageOfAttributeValues) {
|
|
55
|
+
var totalVisibleValues = showNonOv ? paging.totalOvValues : paging.totalValues;
|
|
56
|
+
if (totalVisibleValues > attributeValues.length) {
|
|
57
|
+
requestNextPageOfAttributeValues({
|
|
58
|
+
parentUri: parentUri,
|
|
59
|
+
attributeTypeUri: attributeType.uri,
|
|
60
|
+
attributeTypeName: attributeType.name,
|
|
61
|
+
values: [],
|
|
62
|
+
defaultMaxValues: totalVisibleValues
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}, [paging, requestNextPageOfAttributeValues, attributeType, parentUri, attributeValues.length, showNonOv]);
|
|
53
67
|
var lastWidth = react_1.useRef();
|
|
54
68
|
var _f = react_1.useState(0), maxItems = _f[0], setMaxItems = _f[1];
|
|
55
69
|
var _g = react_1.useState(0), hiddenItemsLength = _g[0], setHiddenItemsLength = _g[1];
|
|
@@ -80,7 +80,7 @@ var AttributesPager = function (_a) {
|
|
|
80
80
|
return (react_1.default.createElement(BranchDecorator_1.default, { enabled: drawLines },
|
|
81
81
|
react_1.default.createElement("div", { className: styles.wrapper },
|
|
82
82
|
react_1.default.createElement(Title_1.default, { label: attributeType === null || attributeType === void 0 ? void 0 : attributeType.label, attributeType: attributeType }),
|
|
83
|
-
react_1.default.createElement(ImageAttributesLine_1.default, { attributeValues: visibleValues, attributeType: attributeType, onDeleteAttribute: onDeleteAttribute, parentUri: parentUri, onChangeAttribute: onChangeAttribute }))));
|
|
83
|
+
react_1.default.createElement(ImageAttributesLine_1.default, { attributeValues: visibleValues, attributeType: attributeType, paging: paging, onDeleteAttribute: onDeleteAttribute, parentUri: parentUri, onChangeAttribute: onChangeAttribute, requestNextPageOfAttributeValues: requestNextPageOfAttributeValues, showNonOv: showNonOv }))));
|
|
84
84
|
default:
|
|
85
85
|
return (react_1.default.createElement(AttributeRenderer_1.default, __assign({ values: visibleValues, attributeType: attributeType, max: max, paging: paging, crosswalks: crosswalks, showEmptyEditors: showEmptyEditors, drawLines: drawLines, requestNextPageOfAttributeValues: requestNextPageOfAttributeValues, showNonOv: showNonOv }, commonProps)));
|
|
86
86
|
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { RequestNextPageOfAttributeValuesPayload } from '@reltio/mdm-module';
|
|
3
|
+
import { AttributeType, ImageAttributeValue, Paging } from '@reltio/mdm-sdk';
|
|
3
4
|
import { AttributeItem } from '../AttributesPager';
|
|
5
|
+
import { SIZES_TYPE } from '../../ImageAttributesLine/styles';
|
|
4
6
|
declare type Props = {
|
|
5
7
|
attributeType: AttributeType;
|
|
6
8
|
attributeValues: ImageAttributeValue[];
|
|
7
9
|
onDeleteAttribute: (param: AttributeItem) => void;
|
|
8
10
|
onChangeAttribute: (param: AttributeItem) => void;
|
|
9
11
|
parentUri: string;
|
|
12
|
+
imageSize?: SIZES_TYPE;
|
|
13
|
+
paging?: Paging;
|
|
14
|
+
requestNextPageOfAttributeValues?: (payload: RequestNextPageOfAttributeValuesPayload) => void;
|
|
15
|
+
showNonOv?: boolean;
|
|
10
16
|
};
|
|
11
|
-
declare const ImageAttributesLine: ({ attributeType, attributeValues, onDeleteAttribute, onChangeAttribute, parentUri }: Props) => JSX.Element;
|
|
17
|
+
declare const ImageAttributesLine: ({ attributeType, attributeValues, onDeleteAttribute, onChangeAttribute, requestNextPageOfAttributeValues, parentUri, paging, showNonOv, imageSize }: Props) => JSX.Element;
|
|
12
18
|
export default ImageAttributesLine;
|
|
@@ -35,14 +35,14 @@ var ImageAttributesLine_1 = __importDefault(require("../../ImageAttributesLine")
|
|
|
35
35
|
var constants_1 = require("../../ImageAttributesLine/constants");
|
|
36
36
|
var styles_1 = require("./styles");
|
|
37
37
|
var ImageAttributesLine = function (_a) {
|
|
38
|
-
var _b = _a.attributeType, attributeType = _b === void 0 ? {} : _b, _c = _a.attributeValues, attributeValues = _c === void 0 ? [] : _c, onDeleteAttribute = _a.onDeleteAttribute, onChangeAttribute = _a.onChangeAttribute, parentUri = _a.parentUri;
|
|
39
|
-
var styles = styles_1.useStyles(
|
|
38
|
+
var _b = _a.attributeType, attributeType = _b === void 0 ? {} : _b, _c = _a.attributeValues, attributeValues = _c === void 0 ? [] : _c, onDeleteAttribute = _a.onDeleteAttribute, onChangeAttribute = _a.onChangeAttribute, requestNextPageOfAttributeValues = _a.requestNextPageOfAttributeValues, parentUri = _a.parentUri, paging = _a.paging, showNonOv = _a.showNonOv, _d = _a.imageSize, imageSize = _d === void 0 ? constants_1.DEFAULT_IMAGE_SIZE : _d;
|
|
39
|
+
var styles = styles_1.useStyles(imageSize);
|
|
40
40
|
var entity = react_redux_1.useSelector(mdm_module_1.default.selectors.getEntity) || {};
|
|
41
41
|
var defaultProfilePic = react_redux_1.useSelector(function (state) {
|
|
42
42
|
return mdm_module_1.default.selectors.getModifiedEntityDefaultProfilePic(state, entity.uri);
|
|
43
43
|
});
|
|
44
44
|
var dispatch = react_redux_1.useDispatch();
|
|
45
|
-
var
|
|
45
|
+
var _e = react_1.useState(false), isVisibleUploadDialog = _e[0], setIsVisibleUploadDialog = _e[1];
|
|
46
46
|
var toggleVisibilityUploadDialog = react_1.useCallback(function () {
|
|
47
47
|
setIsVisibleUploadDialog(function (visible) { return !visible; });
|
|
48
48
|
}, []);
|
|
@@ -94,12 +94,12 @@ var ImageAttributesLine = function (_a) {
|
|
|
94
94
|
var uri = attribute.uri;
|
|
95
95
|
var onOpenImageGalleryDialog = methods.onOpenImageGalleryDialog;
|
|
96
96
|
return (react_1.default.createElement("div", { className: styles.image, key: uri },
|
|
97
|
-
react_1.default.createElement(Image_1.default, { src: src, overlay: renderImageActionsOverlay(methods, attribute), onClick: function () { return onOpenImageGalleryDialog(uri); } })));
|
|
97
|
+
react_1.default.createElement(Image_1.default, { src: src, overlay: renderImageActionsOverlay(methods, attribute), onClick: function () { return onOpenImageGalleryDialog(uri); }, size: { imageWidth: imageSize.imageWidth, imageHeight: imageSize.imageHeight } })));
|
|
98
98
|
};
|
|
99
99
|
return renderImage;
|
|
100
100
|
};
|
|
101
101
|
return (react_1.default.createElement("div", { className: styles.root },
|
|
102
|
-
react_1.default.createElement(ImageAttributesLine_1.default, { attributeValues: attributeValues, attributeType: attributeType, renderImage: renderImage, overlay: true, countFixedItems: 1, onUpload: toggleVisibilityUploadDialog, onDeleteAttribute: handleDeleteAttribute },
|
|
102
|
+
react_1.default.createElement(ImageAttributesLine_1.default, { attributeValues: attributeValues, attributeType: attributeType, renderImage: renderImage, overlay: true, countFixedItems: 1, onUpload: toggleVisibilityUploadDialog, onDeleteAttribute: handleDeleteAttribute, imageSize: imageSize, requestNextPageOfAttributeValues: requestNextPageOfAttributeValues, paging: paging, parentUri: parentUri, showNonOv: showNonOv },
|
|
103
103
|
react_1.default.createElement("div", { className: styles.uploadContainer, onClick: toggleVisibilityUploadDialog },
|
|
104
104
|
react_1.default.createElement(SmallIconButton_1.SmallIconButton, { className: styles.uploadButton, iconClassName: styles.uploadIcon, icon: CloudUpload_1.default }))),
|
|
105
105
|
react_1.default.createElement(UploadImageDialog_1.UploadImageDialog, { open: isVisibleUploadDialog, onUpload: handleAddAttributes, onClose: toggleVisibilityUploadDialog })));
|
package/cjs/components/attributes/editMode/SimpleAttributeEditor/selectors/helpers/parents.js
CHANGED
|
@@ -30,11 +30,13 @@ var getParents = function (state, valueUri, node) {
|
|
|
30
30
|
});
|
|
31
31
|
var modifiedEntities = mdm_module_1.default.selectors.getModifiedEntities(state);
|
|
32
32
|
var entityUri = mdm_module_1.default.selectors.getEntityUri(state);
|
|
33
|
+
var connections = mdm_module_1.default.selectors.getAllRelationsToAddAndEdit(state);
|
|
33
34
|
var ownParentNodesValues = mdm_sdk_1.filterRelatedParentValuesForDependentLookupValueUri({
|
|
34
35
|
parentValues: parentNodesValues,
|
|
35
36
|
valueUri: valueUri,
|
|
36
37
|
entityUri: entityUri,
|
|
37
|
-
modifiedEntities: modifiedEntities
|
|
38
|
+
modifiedEntities: modifiedEntities,
|
|
39
|
+
connections: connections
|
|
38
40
|
});
|
|
39
41
|
var neededParentsAttributeTypes = node.parents.map(function (type) {
|
|
40
42
|
var parentNode = mdm_module_1.default.selectors.getDependentLookupsStructureNode(state, type);
|
|
@@ -71,7 +71,7 @@ var AttributesPager = function (_a) {
|
|
|
71
71
|
case RENDERER_TYPES.imageLine:
|
|
72
72
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
73
73
|
showTitle && react_1.default.createElement(Title_1.default, { label: attributeType === null || attributeType === void 0 ? void 0 : attributeType.label, attributeType: attributeType }),
|
|
74
|
-
react_1.default.createElement(ImageAttributesLine_1.default, { attributeValues: visibleValues, attributeType: attributeType })));
|
|
74
|
+
react_1.default.createElement(ImageAttributesLine_1.default, { attributeValues: visibleValues, attributeType: attributeType, paging: paging, parentUri: parentUri, requestNextPageOfAttributeValues: requestNextPageOfAttributeValues, showNonOv: showNonOv })));
|
|
75
75
|
case RENDERER_TYPES.special:
|
|
76
76
|
return react_1.default.createElement(SpecialRenderer_1.default, { values: visibleValues, attributeType: attributeType, showTitle: showTitle });
|
|
77
77
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AttributeType, ImageAttributeValue } from '@reltio/mdm-sdk';
|
|
2
|
+
import { AttributeType, ImageAttributeValue, Paging } from '@reltio/mdm-sdk';
|
|
3
|
+
import { RequestNextPageOfAttributeValuesPayload } from '@reltio/mdm-module';
|
|
3
4
|
import { SIZES_TYPE } from '../../ImageAttributesLine/styles';
|
|
4
5
|
declare type Props = {
|
|
5
6
|
attributeValues: ImageAttributeValue[];
|
|
6
7
|
attributeType: AttributeType;
|
|
7
8
|
imageSize?: SIZES_TYPE;
|
|
9
|
+
paging?: Paging;
|
|
10
|
+
parentUri?: string;
|
|
11
|
+
showNonOv?: boolean;
|
|
12
|
+
requestNextPageOfAttributeValues?: (payload: RequestNextPageOfAttributeValuesPayload) => void;
|
|
8
13
|
};
|
|
9
|
-
declare const ImageAttributesLine: ({ attributeType, attributeValues, imageSize }: Props) => JSX.Element;
|
|
14
|
+
declare const ImageAttributesLine: ({ attributeType, attributeValues, paging, parentUri, requestNextPageOfAttributeValues, showNonOv, imageSize }: Props) => JSX.Element;
|
|
10
15
|
export default ImageAttributesLine;
|
|
@@ -32,7 +32,7 @@ var constants_1 = require("../../ImageAttributesLine/constants");
|
|
|
32
32
|
var historyAppearance_1 = require("../helpers/historyAppearance");
|
|
33
33
|
var styles_1 = require("./styles");
|
|
34
34
|
var ImageAttributesLine = function (_a) {
|
|
35
|
-
var attributeType = _a.attributeType, _b = _a.attributeValues, attributeValues = _b === void 0 ? [] : _b, _c = _a.imageSize, imageSize = _c === void 0 ? constants_1.DEFAULT_IMAGE_SIZE : _c;
|
|
35
|
+
var attributeType = _a.attributeType, _b = _a.attributeValues, attributeValues = _b === void 0 ? [] : _b, paging = _a.paging, parentUri = _a.parentUri, requestNextPageOfAttributeValues = _a.requestNextPageOfAttributeValues, showNonOv = _a.showNonOv, _c = _a.imageSize, imageSize = _c === void 0 ? constants_1.DEFAULT_IMAGE_SIZE : _c;
|
|
36
36
|
var styles = styles_1.useStyles(imageSize);
|
|
37
37
|
var appearance = react_1.useContext(contexts_1.HistoryDiffContext).appearance;
|
|
38
38
|
var renderImage = function (_a) {
|
|
@@ -50,6 +50,6 @@ var ImageAttributesLine = function (_a) {
|
|
|
50
50
|
};
|
|
51
51
|
return renderImage;
|
|
52
52
|
};
|
|
53
|
-
return (react_1.default.createElement(ImageAttributesLine_1.default, { attributeValues: attributeValues, attributeType: attributeType, renderImage: renderImage, imageSize: imageSize }));
|
|
53
|
+
return (react_1.default.createElement(ImageAttributesLine_1.default, { attributeValues: attributeValues, attributeType: attributeType, renderImage: renderImage, imageSize: imageSize, requestNextPageOfAttributeValues: requestNextPageOfAttributeValues, paging: paging, parentUri: parentUri, showNonOv: showNonOv }));
|
|
54
54
|
};
|
|
55
55
|
exports.default = ImageAttributesLine;
|
|
@@ -39,7 +39,8 @@ var react_resize_detector_1 = __importDefault(require("react-resize-detector"));
|
|
|
39
39
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
40
40
|
var ramda_1 = require("ramda");
|
|
41
41
|
var classnames_1 = __importDefault(require("classnames"));
|
|
42
|
-
var
|
|
42
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
43
|
+
var mdm_module_1 = __importStar(require("@reltio/mdm-module"));
|
|
43
44
|
var Button_1 = __importDefault(require("@material-ui/core/Button"));
|
|
44
45
|
var HistoryRow_1 = __importDefault(require("../HistoryRow/HistoryRow"));
|
|
45
46
|
var HistoryGraph_1 = __importDefault(require("../HistoryGraph/HistoryGraph"));
|
|
@@ -50,6 +51,7 @@ var HistoryTree = function (_a) {
|
|
|
50
51
|
var historyData = _a.historyData, isLoading = _a.isLoading, canLoadMore = _a.canLoadMore, onLoadMore = _a.onLoadMore, entityUri = _a.entityUri, historyEvent = _a.historyEvent, findPreviousChange = _a.findPreviousChange;
|
|
51
52
|
var styles = styles_1.useStyles();
|
|
52
53
|
var dispatch = react_redux_1.useDispatch();
|
|
54
|
+
var isEditableMode = react_redux_1.useSelector(mdm_module_1.default.selectors.getIsEditableMode);
|
|
53
55
|
var _c = react_1.useState({ historyLanes: {}, rows: [] }), graphData = _c[0], setGraphData = _c[1];
|
|
54
56
|
var _d = react_1.useState(false), isScrollable = _d[0], setIsScrollable = _d[1];
|
|
55
57
|
var _e = react_1.useState(-1), selectedIndex = _e[0], setSelectedIndex = _e[1];
|
|
@@ -78,6 +80,14 @@ var HistoryTree = function (_a) {
|
|
|
78
80
|
setIsScrollable(scrollLeft < scrollWidth - clientWidth);
|
|
79
81
|
};
|
|
80
82
|
var handleHistoryRowClick = function (index, change, isSelected, isCurrent) {
|
|
83
|
+
if (isEditableMode) {
|
|
84
|
+
if (window.confirm(ui_i18n_1.default.text('Are you sure you want to go in history mode? All your changes will be lost.'))) {
|
|
85
|
+
dispatch(mdm_module_1.profile.mode.actions.modeUpdated(mdm_sdk_1.Mode.Viewing));
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
81
91
|
if ((isCurrent && !isSelected) || (!isCurrent && isSelected)) {
|
|
82
92
|
dispatch(mdm_module_1.profile.history.actions.clearHistoryEvent());
|
|
83
93
|
setSelectedIndex(0);
|
|
@@ -12,5 +12,6 @@ export declare const useHistory: ({ entityUri, enabled }: Props) => {
|
|
|
12
12
|
historyWithTotal: import("@reltio/mdm-sdk").HistoryWithTotal;
|
|
13
13
|
historyFilter: HistoryFilter;
|
|
14
14
|
setHistoryFilter: import("react").Dispatch<import("react").SetStateAction<HistoryFilter>>;
|
|
15
|
+
reloadHistory: () => void;
|
|
15
16
|
};
|
|
16
17
|
export {};
|
|
@@ -21,7 +21,7 @@ var useHistory = function (_a) {
|
|
|
21
21
|
offset: historyPage * MAX_HISTORY_ROWS,
|
|
22
22
|
order: 'desc',
|
|
23
23
|
showAll: true
|
|
24
|
-
}), isHistoryLoading = _e.isLoading, historyWithTotal = _e.historyWithTotal, loadMore = _e.loadMore;
|
|
24
|
+
}), isHistoryLoading = _e.isLoading, historyWithTotal = _e.historyWithTotal, loadMore = _e.loadMore, loadData = _e.loadData;
|
|
25
25
|
var canLoadMore = react_1.useMemo(function () { return (historyPage + 1) * MAX_HISTORY_ROWS <= (historyWithTotal === null || historyWithTotal === void 0 ? void 0 : historyWithTotal.total); }, [
|
|
26
26
|
historyWithTotal,
|
|
27
27
|
historyPage
|
|
@@ -32,6 +32,10 @@ var useHistory = function (_a) {
|
|
|
32
32
|
loadMore((historyPage + 1) * MAX_HISTORY_ROWS);
|
|
33
33
|
setHistoryPage(historyPage + 1);
|
|
34
34
|
}, [loadMore, historyPage, canLoadMore]);
|
|
35
|
+
var reloadHistory = react_1.useCallback(function () {
|
|
36
|
+
loadData();
|
|
37
|
+
setHistoryPage(0);
|
|
38
|
+
}, [loadData]);
|
|
35
39
|
return {
|
|
36
40
|
isLoading: isHistoryLoading || isHistoricUrisLoading,
|
|
37
41
|
canLoadMore: canLoadMore,
|
|
@@ -39,7 +43,8 @@ var useHistory = function (_a) {
|
|
|
39
43
|
historicUris: historicUris,
|
|
40
44
|
historyWithTotal: historyWithTotal,
|
|
41
45
|
historyFilter: historyFilter,
|
|
42
|
-
setHistoryFilter: setHistoryFilter
|
|
46
|
+
setHistoryFilter: setHistoryFilter,
|
|
47
|
+
reloadHistory: reloadHistory
|
|
43
48
|
};
|
|
44
49
|
};
|
|
45
50
|
exports.useHistory = useHistory;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.useHistoryDiff = void 0;
|
|
23
|
+
var react_1 = require("react");
|
|
24
|
+
var react_redux_1 = require("react-redux");
|
|
25
|
+
var ramda_1 = require("ramda");
|
|
26
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
27
|
+
var mdm_module_1 = __importStar(require("@reltio/mdm-module"));
|
|
28
|
+
var defaultHistoryDiff = {
|
|
29
|
+
appearance: {},
|
|
30
|
+
attributes: {},
|
|
31
|
+
roles: [],
|
|
32
|
+
tags: []
|
|
33
|
+
};
|
|
34
|
+
var fixRefEntity = ramda_1.evolve({
|
|
35
|
+
refEntity: mdm_sdk_1.wrapInArrayIfNeeded,
|
|
36
|
+
refRelation: mdm_sdk_1.wrapInArrayIfNeeded
|
|
37
|
+
});
|
|
38
|
+
var prepareHistorySlice = function (historySlice) {
|
|
39
|
+
if (historySlice) {
|
|
40
|
+
return ramda_1.evolve({
|
|
41
|
+
attributes: ramda_1.map(ramda_1.map(fixRefEntity))
|
|
42
|
+
})(historySlice);
|
|
43
|
+
}
|
|
44
|
+
return historySlice;
|
|
45
|
+
};
|
|
46
|
+
var useHistoryDiff = function () {
|
|
47
|
+
var dispatch = react_redux_1.useDispatch();
|
|
48
|
+
var historySlice = react_redux_1.useSelector(mdm_module_1.default.selectors.getHistorySlice);
|
|
49
|
+
var historyDiff = react_redux_1.useSelector(mdm_module_1.default.selectors.getHistoryDiff);
|
|
50
|
+
var historyMode = react_redux_1.useSelector(mdm_module_1.default.selectors.getHistoryMode);
|
|
51
|
+
var entity = react_redux_1.useSelector(mdm_module_1.default.selectors.getEntity);
|
|
52
|
+
react_1.useEffect(function () {
|
|
53
|
+
if (historySlice) {
|
|
54
|
+
var aEntity = historySlice.aEntity, bEntity = historySlice.bEntity;
|
|
55
|
+
var historyManager = mdm_sdk_1.entity.HistoryManager.createHistoryManager(mdm_sdk_1.entity.AttributesDiff);
|
|
56
|
+
var historyDiff_1 = historyManager.computeEntityHistoryDiff(prepareHistorySlice(historyMode === mdm_module_1.HistoryMode.Current ? entity : bEntity), prepareHistorySlice(aEntity));
|
|
57
|
+
dispatch(mdm_module_1.profile.history.actions.setHistoryDiff(historyDiff_1));
|
|
58
|
+
}
|
|
59
|
+
}, [historySlice, historyMode, dispatch, entity]);
|
|
60
|
+
return historyDiff || defaultHistoryDiff;
|
|
61
|
+
};
|
|
62
|
+
exports.useHistoryDiff = useHistoryDiff;
|
|
@@ -74,6 +74,6 @@ var useHistoryWithTotal = function (_a) {
|
|
|
74
74
|
loadData();
|
|
75
75
|
}
|
|
76
76
|
}, [loadData, enabled]);
|
|
77
|
-
return { isLoading: isLoading, historyWithTotal: historyWithTotal, loadMore: loadMore };
|
|
77
|
+
return { isLoading: isLoading, historyWithTotal: historyWithTotal, loadMore: loadMore, loadData: loadData };
|
|
78
78
|
};
|
|
79
79
|
exports.useHistoryWithTotal = useHistoryWithTotal;
|
|
@@ -2,6 +2,7 @@ export { useHistoricUris } from './hooks/useHistoricUris';
|
|
|
2
2
|
export { useHistoryWithTotal } from './hooks/useHistoryWithTotal';
|
|
3
3
|
export { useHistorySlice } from './hooks/useHistorySlice';
|
|
4
4
|
export { useHistory } from './hooks/useHistory';
|
|
5
|
+
export { useHistoryDiff } from './hooks/useHistoryDiff';
|
|
5
6
|
export { default as HistoryView } from './HistoryView/HistoryView';
|
|
6
7
|
export { default as HistoryHeader } from './HistoryHeader/HistoryHeader';
|
|
7
8
|
export { default as ProfileBandHistory } from './ProfileBandHistory/ProfileBandHistory';
|
|
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
14
|
};
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.ProfileBandHistory = exports.HistoryHeader = exports.HistoryView = exports.useHistory = exports.useHistorySlice = exports.useHistoryWithTotal = exports.useHistoricUris = void 0;
|
|
16
|
+
exports.ProfileBandHistory = exports.HistoryHeader = exports.HistoryView = exports.useHistoryDiff = exports.useHistory = exports.useHistorySlice = exports.useHistoryWithTotal = exports.useHistoricUris = void 0;
|
|
17
17
|
var useHistoricUris_1 = require("./hooks/useHistoricUris");
|
|
18
18
|
Object.defineProperty(exports, "useHistoricUris", { enumerable: true, get: function () { return useHistoricUris_1.useHistoricUris; } });
|
|
19
19
|
var useHistoryWithTotal_1 = require("./hooks/useHistoryWithTotal");
|
|
@@ -22,6 +22,8 @@ var useHistorySlice_1 = require("./hooks/useHistorySlice");
|
|
|
22
22
|
Object.defineProperty(exports, "useHistorySlice", { enumerable: true, get: function () { return useHistorySlice_1.useHistorySlice; } });
|
|
23
23
|
var useHistory_1 = require("./hooks/useHistory");
|
|
24
24
|
Object.defineProperty(exports, "useHistory", { enumerable: true, get: function () { return useHistory_1.useHistory; } });
|
|
25
|
+
var useHistoryDiff_1 = require("./hooks/useHistoryDiff");
|
|
26
|
+
Object.defineProperty(exports, "useHistoryDiff", { enumerable: true, get: function () { return useHistoryDiff_1.useHistoryDiff; } });
|
|
25
27
|
var HistoryView_1 = require("./HistoryView/HistoryView");
|
|
26
28
|
Object.defineProperty(exports, "HistoryView", { enumerable: true, get: function () { return __importDefault(HistoryView_1).default; } });
|
|
27
29
|
var HistoryHeader_1 = require("./HistoryHeader/HistoryHeader");
|
|
@@ -17,6 +17,7 @@ export { default as EditableAttribute } from './attributes/editMode/AttributesFa
|
|
|
17
17
|
export { default as ReadOnlyAttributeValuesBlock } from './attributes/readMode/AttributeValuesBlock/AttributeValuesBlock';
|
|
18
18
|
export { default as ReadOnlyAttributesList } from './attributes/readMode/AttributesList';
|
|
19
19
|
export { default as ImageAttributesLine } from './attributes/readMode/ImageAttributesLine';
|
|
20
|
+
export { default as EditableImageAttributesLine } from './attributes/editMode/ImageAttributesLine';
|
|
20
21
|
export { default as NestedAttribute } from './attributes/readMode/NestedAttribute';
|
|
21
22
|
export { default as ReferenceAttribute } from './attributes/readMode/ReferenceAttribute';
|
|
22
23
|
export { default as SimpleAttribute } from './attributes/readMode/SimpleAttribute';
|
package/cjs/components/index.js
CHANGED
|
@@ -13,9 +13,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
14
|
};
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.ActionButtonMode = exports.ActionButton = exports.NotMatchButton = exports.MergeButton = exports.ProfileMatchCard = exports.RelationEditor = exports.OvIcon = exports.ErrorMessage = exports.ReltioMap = exports.ConfirmDeleteDialog = exports.ConfirmationDialog = exports.Marginator = exports.LightArrowTooltip = exports.ArrowExpandButton = exports.ScrollableTabs = exports.ExpandableSearchInput = exports.VirtualGroupedList = exports.ViewMoreToggle = exports.VerticalHeadingsTable = exports.VerticalDivider = exports.AttributeTitle = exports.Spacer = exports.SourceIcon = exports.SmallIconButtonWithTooltip = exports.SmallIconButton = void 0;
|
|
16
|
+
exports.EntityTypeBadge = exports.EntityAvatar = exports.EMPTY_STATE_VARIANTS = exports.EMPTY_STATE_ICONS = exports.EmptyState = exports.NoResults = exports.NoData = exports.DropDownSelector = exports.DropDownMenuButton = exports.Drawer = exports.DataTypeValue = exports.ConnectionRelationTypeSelector = exports.ConfigureColumnsPopup = exports.MenuWithPopper = exports.DropdownIndicatorWithIconButton = exports.DropdownIndicator = exports.CommentsContainer = exports.ColorBar = exports.CollapseButton = exports.CollaborationItem = exports.ClickAwayProvider = exports.BasicViewHeader = exports.BasicViewContent = exports.BasicView = exports.ProfileBandNavigation = exports.AvatarWithFallback = exports.AutoSizeList = exports.ReadOnlyAttributesPager = exports.SimpleAttribute = exports.ReferenceAttribute = exports.NestedAttribute = exports.EditableImageAttributesLine = exports.ImageAttributesLine = exports.ReadOnlyAttributesList = exports.ReadOnlyAttributeValuesBlock = exports.EditableAttribute = exports.ReadOnlyAttribute = exports.CardinalityMessage = exports.AttributesPager = exports.SimpleAttributeEditor = exports.RelationTypeSelector = exports.ReferenceAttributeEditor = exports.NestedAttributeEditor = exports.MoreAttributesButton = exports.EntitySelector = exports.EntityCreator = exports.AttributesList = exports.BranchDecorator = exports.AttributesView = exports.AttributeListItem = void 0;
|
|
17
|
+
exports.SidePanelContentHeader = exports.SidePanel = exports.SideButtonsPanel = exports.SelectorWithOnlyOptionAutoSelect = exports.SelectionPopupPopper = exports.SelectionPopup = exports.useKeyboardNavigation = exports.WhiteSearchInput = exports.SearchInput = exports.ScoreLabel = exports.Score = exports.ResizablePanes = exports.ReltioGridLayout = exports.ReactSortableTreeUtils = exports.ReactSortableTreeHandlers = exports.ReactSortableTree = exports.ReactSelectOptionFilters = 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.MatchRulesBlock = exports.LoadingSpinner = exports.Link = exports.LinearLoadIndicator = exports.ImportModes = exports.ImportButton = exports.ImageGalleryDialog = exports.Highlighter = exports.HierarchicalAttributeTooltip = exports.HideOnShrink = exports.FlipCard = exports.FacetViewHeader = exports.ExpandedValueTooltip = exports.ErrorWrapper = exports.ErrorPopup = exports.ErrorBoundary = exports.EntityUriLink = exports.EntityTypesSelector = exports.EntityTypeIcon = void 0;
|
|
18
|
+
exports.ActionButtonMode = exports.ActionButton = exports.NotMatchButton = exports.MergeButton = exports.ProfileMatchCard = exports.RelationEditor = exports.OvIcon = exports.ErrorMessage = exports.ReltioMap = exports.ConfirmDeleteDialog = exports.ConfirmationDialog = exports.Marginator = exports.LightArrowTooltip = exports.ArrowExpandButton = exports.ScrollableTabs = exports.ExpandableSearchInput = exports.VirtualGroupedList = exports.ViewMoreToggle = exports.VerticalHeadingsTable = exports.VerticalDivider = exports.AttributeTitle = exports.Spacer = exports.SourceIcon = exports.SmallIconButtonWithTooltip = exports.SmallIconButton = exports.SimpleDropDownSelector = void 0;
|
|
19
19
|
__exportStar(require("./activityLog"), exports);
|
|
20
20
|
var AttributeListItem_1 = require("./AttributeListItem/AttributeListItem");
|
|
21
21
|
Object.defineProperty(exports, "AttributeListItem", { enumerable: true, get: function () { return __importDefault(AttributeListItem_1).default; } });
|
|
@@ -52,6 +52,8 @@ var AttributesList_2 = require("./attributes/readMode/AttributesList");
|
|
|
52
52
|
Object.defineProperty(exports, "ReadOnlyAttributesList", { enumerable: true, get: function () { return __importDefault(AttributesList_2).default; } });
|
|
53
53
|
var ImageAttributesLine_1 = require("./attributes/readMode/ImageAttributesLine");
|
|
54
54
|
Object.defineProperty(exports, "ImageAttributesLine", { enumerable: true, get: function () { return __importDefault(ImageAttributesLine_1).default; } });
|
|
55
|
+
var ImageAttributesLine_2 = require("./attributes/editMode/ImageAttributesLine");
|
|
56
|
+
Object.defineProperty(exports, "EditableImageAttributesLine", { enumerable: true, get: function () { return __importDefault(ImageAttributesLine_2).default; } });
|
|
55
57
|
var NestedAttribute_2 = require("./attributes/readMode/NestedAttribute");
|
|
56
58
|
Object.defineProperty(exports, "NestedAttribute", { enumerable: true, get: function () { return __importDefault(NestedAttribute_2).default; } });
|
|
57
59
|
var ReferenceAttribute_2 = require("./attributes/readMode/ReferenceAttribute");
|
|
@@ -7,6 +7,8 @@ exports.HistoryDiffContext = void 0;
|
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
8
|
exports.HistoryDiffContext = react_1.default.createContext({
|
|
9
9
|
appearance: undefined,
|
|
10
|
-
attributes: undefined
|
|
10
|
+
attributes: undefined,
|
|
11
|
+
roles: undefined,
|
|
12
|
+
tags: undefined
|
|
11
13
|
});
|
|
12
14
|
exports.HistoryDiffContext.displayName = 'HistoryDiffContext';
|
|
@@ -4,8 +4,9 @@ declare type Props = {
|
|
|
4
4
|
entity: Entity;
|
|
5
5
|
onFinishRequest?: () => void;
|
|
6
6
|
onStartRequest?: () => void;
|
|
7
|
+
onError?: () => void;
|
|
7
8
|
};
|
|
8
|
-
export declare const useMergeAllRequest: ({ entities, entity, onFinishRequest, onStartRequest }: Props) => {
|
|
9
|
+
export declare const useMergeAllRequest: ({ entities, entity, onFinishRequest, onStartRequest, onError }: Props) => {
|
|
9
10
|
isPending: boolean;
|
|
10
11
|
sendMergeAllRequest: () => void;
|
|
11
12
|
};
|
|
@@ -8,18 +8,21 @@ var react_1 = require("react");
|
|
|
8
8
|
var react_redux_1 = require("react-redux");
|
|
9
9
|
var mdm_module_1 = __importDefault(require("@reltio/mdm-module"));
|
|
10
10
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
11
|
+
var core_1 = require("../core");
|
|
11
12
|
var useMergeAllRequest = function (_a) {
|
|
12
|
-
var entities = _a.entities, entity = _a.entity, onFinishRequest = _a.onFinishRequest, onStartRequest = _a.onStartRequest;
|
|
13
|
+
var entities = _a.entities, entity = _a.entity, onFinishRequest = _a.onFinishRequest, onStartRequest = _a.onStartRequest, _b = _a.onError, onError = _b === void 0 ? core_1.noop : _b;
|
|
13
14
|
var tenant = react_redux_1.useSelector(mdm_module_1.default.selectors.getTenant);
|
|
14
15
|
var dtssPath = react_redux_1.useSelector(mdm_module_1.default.selectors.getDtssPath);
|
|
15
|
-
var
|
|
16
|
+
var _c = react_1.useState(false), isPending = _c[0], setIsPending = _c[1];
|
|
16
17
|
var sendMergeAllRequest = react_1.useCallback(function () {
|
|
17
18
|
onStartRequest === null || onStartRequest === void 0 ? void 0 : onStartRequest();
|
|
18
19
|
setIsPending(true);
|
|
19
20
|
var params = { dtssPath: dtssPath, customerTenant: tenant, entity: entity, entities: entities };
|
|
20
21
|
(mdm_sdk_1.isDataTenantEntity(entity)
|
|
21
22
|
? mdm_sdk_1.mergeDataTenantEntity(params)
|
|
22
|
-
: mdm_sdk_1.mergeCustomerTenantEntityWithMixedEntities(params))
|
|
23
|
+
: mdm_sdk_1.mergeCustomerTenantEntityWithMixedEntities(params))
|
|
24
|
+
.catch(onError)
|
|
25
|
+
.finally(function () {
|
|
23
26
|
onFinishRequest === null || onFinishRequest === void 0 ? void 0 : onFinishRequest();
|
|
24
27
|
setIsPending(false);
|
|
25
28
|
});
|
|
@@ -10,6 +10,7 @@ declare type Props = {
|
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
onStartRequest?: () => void;
|
|
12
12
|
onFinishRequest?: () => void;
|
|
13
|
+
onError?: () => void;
|
|
13
14
|
};
|
|
14
15
|
export declare const MergeButton: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLLIElement>>;
|
|
15
16
|
export {};
|
|
@@ -27,12 +27,13 @@ import { noop } from '../../core';
|
|
|
27
27
|
import { ActionButton, ActionButtonMode } from '../ActionButton/ActionButton';
|
|
28
28
|
import { useMergeAllRequest } from '../../hooks';
|
|
29
29
|
export var MergeButton = forwardRef(function (_a, ref) {
|
|
30
|
-
var className = _a.className, _b = _a.mode, mode = _b === void 0 ? ActionButtonMode.iconButton : _b, _c = _a.onMenuClose, onMenuClose = _c === void 0 ? noop : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, entity = _a.entity, entities = _a.entities, onStartRequest = _a.onStartRequest, onFinishRequest = _a.onFinishRequest, otherProps = __rest(_a, ["className", "mode", "onMenuClose", "disabled", "entity", "entities", "onStartRequest", "onFinishRequest"]);
|
|
30
|
+
var className = _a.className, _b = _a.mode, mode = _b === void 0 ? ActionButtonMode.iconButton : _b, _c = _a.onMenuClose, onMenuClose = _c === void 0 ? noop : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, entity = _a.entity, entities = _a.entities, onStartRequest = _a.onStartRequest, onFinishRequest = _a.onFinishRequest, onError = _a.onError, otherProps = __rest(_a, ["className", "mode", "onMenuClose", "disabled", "entity", "entities", "onStartRequest", "onFinishRequest", "onError"]);
|
|
31
31
|
var sendMergeAllRequest = useMergeAllRequest({
|
|
32
32
|
entity: entity,
|
|
33
33
|
entities: entities,
|
|
34
34
|
onStartRequest: onStartRequest,
|
|
35
|
-
onFinishRequest: onFinishRequest
|
|
35
|
+
onFinishRequest: onFinishRequest,
|
|
36
|
+
onError: onError
|
|
36
37
|
}).sendMergeAllRequest;
|
|
37
38
|
return (React.createElement(ActionButton, __assign({ className: className, disabled: disabled, mode: mode, label: i18n.text('Merge'), icon: MergeIcon, onClick: sendMergeAllRequest, onMenuClose: onMenuClose, ref: ref }, otherProps)));
|
|
38
39
|
});
|
|
@@ -3,11 +3,11 @@ declare type Props = {
|
|
|
3
3
|
buttonsProps: {
|
|
4
4
|
icon: ElementType;
|
|
5
5
|
tooltipTitle: string;
|
|
6
|
-
id:
|
|
6
|
+
id: number;
|
|
7
7
|
}[];
|
|
8
|
-
|
|
8
|
+
activeIndexId: number;
|
|
9
9
|
className?: string;
|
|
10
|
-
onButtonClick: (
|
|
10
|
+
onButtonClick: (id: number) => void;
|
|
11
11
|
};
|
|
12
12
|
export declare const SideButtonsPanel: VFC<Props>;
|
|
13
13
|
export {};
|
|
@@ -25,11 +25,11 @@ import classnames from 'classnames';
|
|
|
25
25
|
import { SmallIconButtonWithTooltip } from '../SmallIconButton';
|
|
26
26
|
import { useStyles } from './styles';
|
|
27
27
|
export var SideButtonsPanel = function (_a) {
|
|
28
|
-
var buttonsProps = _a.buttonsProps,
|
|
28
|
+
var buttonsProps = _a.buttonsProps, activeIndexId = _a.activeIndexId, className = _a.className, onButtonClick = _a.onButtonClick;
|
|
29
29
|
var styles = useStyles();
|
|
30
|
-
return (React.createElement("div", { className: classnames(styles.container, className) }, buttonsProps.map(function (_a
|
|
30
|
+
return (React.createElement("div", { className: classnames(styles.container, className) }, buttonsProps.map(function (_a) {
|
|
31
31
|
var _b;
|
|
32
32
|
var id = _a.id, buttonProps = __rest(_a, ["id"]);
|
|
33
|
-
return (React.createElement(SmallIconButtonWithTooltip, __assign({}, buttonProps, { size: "S", key: id, className: classnames((_b = {}, _b[styles.active] =
|
|
33
|
+
return (React.createElement(SmallIconButtonWithTooltip, __assign({}, buttonProps, { size: "S", key: id, className: classnames((_b = {}, _b[styles.active] = activeIndexId === id, _b), styles.buttonWrapper), onClick: function () { return onButtonClick(id); }, "data-reltio-id": "reltio-profile-right-side-button-" + id })));
|
|
34
34
|
})));
|
|
35
35
|
};
|
|
@@ -6,12 +6,13 @@ import Divider from '@material-ui/core/Divider';
|
|
|
6
6
|
import i18n from 'ui-i18n';
|
|
7
7
|
import { SmallIconButtonWithTooltip } from '../../SmallIconButton';
|
|
8
8
|
export var SidePanelContentHeader = function (_a) {
|
|
9
|
-
var onClose = _a.onClose, mainTitle = _a.mainTitle, secondTitle = _a.secondTitle, rightContent = _a.rightContent;
|
|
9
|
+
var onClose = _a.onClose, mainTitle = _a.mainTitle, secondTitle = _a.secondTitle, content = _a.content, rightContent = _a.rightContent;
|
|
10
10
|
var styles = useStyles();
|
|
11
11
|
return (React.createElement("div", { className: styles.container },
|
|
12
12
|
React.createElement(SmallIconButtonWithTooltip, { size: "S", icon: CloseIcon, onClick: onClose, className: styles.icon, tooltipTitle: i18n.text('Close') }),
|
|
13
|
-
React.createElement(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
content || (React.createElement(React.Fragment, null,
|
|
14
|
+
React.createElement(Typography, { variant: "h6" }, mainTitle),
|
|
15
|
+
React.createElement(Divider, { orientation: "vertical", flexItem: true, className: styles.divider }),
|
|
16
|
+
React.createElement(Typography, { variant: "body1", color: "textSecondary", className: styles.secondTitle }, secondTitle),
|
|
17
|
+
rightContent))));
|
|
17
18
|
};
|
|
@@ -2,7 +2,7 @@ import { connect } from 'react-redux';
|
|
|
2
2
|
import mdm from '@reltio/mdm-module';
|
|
3
3
|
import AttributesView from './AttributesView';
|
|
4
4
|
var mapStateToProps = function (state, ownProps) { return ({
|
|
5
|
-
entity: ownProps.entity || mdm.selectors.
|
|
5
|
+
entity: ownProps.entity || mdm.selectors.getEntityWithDiff(state),
|
|
6
6
|
mode: ownProps.mode || mdm.selectors.getMode(state)
|
|
7
7
|
}); };
|
|
8
8
|
export { AttributesView };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { RequestNextPageOfAttributeValuesPayload } from '@reltio/mdm-module';
|
|
3
|
+
import { AttributeType, ImageAttributeValue, Paging } from '@reltio/mdm-sdk';
|
|
3
4
|
import { AttributeItem } from '../editMode/AttributesPager';
|
|
4
5
|
import { SIZES_TYPE } from './styles';
|
|
5
6
|
export declare type ImageRenderProps = {
|
|
@@ -19,6 +20,10 @@ declare type Props = {
|
|
|
19
20
|
onUpload?: () => void;
|
|
20
21
|
onDeleteAttribute?: (param: AttributeItem) => void;
|
|
21
22
|
imageSize?: SIZES_TYPE;
|
|
23
|
+
paging?: Paging;
|
|
24
|
+
requestNextPageOfAttributeValues?: (payload: RequestNextPageOfAttributeValuesPayload) => void;
|
|
25
|
+
parentUri?: string;
|
|
26
|
+
showNonOv?: boolean;
|
|
22
27
|
};
|
|
23
|
-
declare const ImageAttributesLine: ({ attributeType, attributeValues, renderImage, overlay, countFixedItems, children, onUpload, onDeleteAttribute, imageSize }: Props) => JSX.Element;
|
|
28
|
+
declare const ImageAttributesLine: ({ attributeType, attributeValues, renderImage, overlay, countFixedItems, children, onUpload, onDeleteAttribute, imageSize, paging, parentUri, showNonOv, requestNextPageOfAttributeValues }: Props) => JSX.Element;
|
|
24
29
|
export default ImageAttributesLine;
|
|
@@ -21,11 +21,25 @@ import { downloadImagesByURLs } from '../helpers/imageAttributes';
|
|
|
21
21
|
import { DEFAULT_IMAGE_SIZE, IMAGE_MIN_VISIBLE_WIDTH } from './constants';
|
|
22
22
|
import { useStyles } from './styles';
|
|
23
23
|
var ImageAttributesLine = function (_a) {
|
|
24
|
-
var attributeType = _a.attributeType, _b = _a.attributeValues, attributeValues = _b === void 0 ? [] : _b, renderImage = _a.renderImage, _c = _a.overlay, overlay = _c === void 0 ? false : _c, _d = _a.countFixedItems, countFixedItems = _d === void 0 ? 0 : _d, children = _a.children, onUpload = _a.onUpload, onDeleteAttribute = _a.onDeleteAttribute, _e = _a.imageSize, imageSize = _e === void 0 ? DEFAULT_IMAGE_SIZE : _e;
|
|
24
|
+
var attributeType = _a.attributeType, _b = _a.attributeValues, attributeValues = _b === void 0 ? [] : _b, renderImage = _a.renderImage, _c = _a.overlay, overlay = _c === void 0 ? false : _c, _d = _a.countFixedItems, countFixedItems = _d === void 0 ? 0 : _d, children = _a.children, onUpload = _a.onUpload, onDeleteAttribute = _a.onDeleteAttribute, _e = _a.imageSize, imageSize = _e === void 0 ? DEFAULT_IMAGE_SIZE : _e, paging = _a.paging, parentUri = _a.parentUri, showNonOv = _a.showNonOv, requestNextPageOfAttributeValues = _a.requestNextPageOfAttributeValues;
|
|
25
25
|
var entity = useSelector(mdm.selectors.getEntity) || {};
|
|
26
26
|
var isViewMode = useSelector(mdm.selectors.getIsViewMode);
|
|
27
27
|
var dispatch = useDispatch();
|
|
28
28
|
var styles = useStyles(imageSize);
|
|
29
|
+
useEffect(function () {
|
|
30
|
+
if (paging && requestNextPageOfAttributeValues) {
|
|
31
|
+
var totalVisibleValues = showNonOv ? paging.totalOvValues : paging.totalValues;
|
|
32
|
+
if (totalVisibleValues > attributeValues.length) {
|
|
33
|
+
requestNextPageOfAttributeValues({
|
|
34
|
+
parentUri: parentUri,
|
|
35
|
+
attributeTypeUri: attributeType.uri,
|
|
36
|
+
attributeTypeName: attributeType.name,
|
|
37
|
+
values: [],
|
|
38
|
+
defaultMaxValues: totalVisibleValues
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}, [paging, requestNextPageOfAttributeValues, attributeType, parentUri, attributeValues.length, showNonOv]);
|
|
29
43
|
var lastWidth = useRef();
|
|
30
44
|
var _f = useState(0), maxItems = _f[0], setMaxItems = _f[1];
|
|
31
45
|
var _g = useState(0), hiddenItemsLength = _g[0], setHiddenItemsLength = _g[1];
|
|
@@ -56,7 +56,7 @@ var AttributesPager = function (_a) {
|
|
|
56
56
|
return (React.createElement(BranchDecorator, { enabled: drawLines },
|
|
57
57
|
React.createElement("div", { className: styles.wrapper },
|
|
58
58
|
React.createElement(Title, { label: attributeType === null || attributeType === void 0 ? void 0 : attributeType.label, attributeType: attributeType }),
|
|
59
|
-
React.createElement(ImageAttributesLine, { attributeValues: visibleValues, attributeType: attributeType, onDeleteAttribute: onDeleteAttribute, parentUri: parentUri, onChangeAttribute: onChangeAttribute }))));
|
|
59
|
+
React.createElement(ImageAttributesLine, { attributeValues: visibleValues, attributeType: attributeType, paging: paging, onDeleteAttribute: onDeleteAttribute, parentUri: parentUri, onChangeAttribute: onChangeAttribute, requestNextPageOfAttributeValues: requestNextPageOfAttributeValues, showNonOv: showNonOv }))));
|
|
60
60
|
default:
|
|
61
61
|
return (React.createElement(AttributeRenderer, __assign({ values: visibleValues, attributeType: attributeType, max: max, paging: paging, crosswalks: crosswalks, showEmptyEditors: showEmptyEditors, drawLines: drawLines, requestNextPageOfAttributeValues: requestNextPageOfAttributeValues, showNonOv: showNonOv }, commonProps)));
|
|
62
62
|
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { RequestNextPageOfAttributeValuesPayload } from '@reltio/mdm-module';
|
|
3
|
+
import { AttributeType, ImageAttributeValue, Paging } from '@reltio/mdm-sdk';
|
|
3
4
|
import { AttributeItem } from '../AttributesPager';
|
|
5
|
+
import { SIZES_TYPE } from '../../ImageAttributesLine/styles';
|
|
4
6
|
declare type Props = {
|
|
5
7
|
attributeType: AttributeType;
|
|
6
8
|
attributeValues: ImageAttributeValue[];
|
|
7
9
|
onDeleteAttribute: (param: AttributeItem) => void;
|
|
8
10
|
onChangeAttribute: (param: AttributeItem) => void;
|
|
9
11
|
parentUri: string;
|
|
12
|
+
imageSize?: SIZES_TYPE;
|
|
13
|
+
paging?: Paging;
|
|
14
|
+
requestNextPageOfAttributeValues?: (payload: RequestNextPageOfAttributeValuesPayload) => void;
|
|
15
|
+
showNonOv?: boolean;
|
|
10
16
|
};
|
|
11
|
-
declare const ImageAttributesLine: ({ attributeType, attributeValues, onDeleteAttribute, onChangeAttribute, parentUri }: Props) => JSX.Element;
|
|
17
|
+
declare const ImageAttributesLine: ({ attributeType, attributeValues, onDeleteAttribute, onChangeAttribute, requestNextPageOfAttributeValues, parentUri, paging, showNonOv, imageSize }: Props) => JSX.Element;
|
|
12
18
|
export default ImageAttributesLine;
|
|
@@ -8,17 +8,17 @@ import ImageActionsOverlay from '../../../Image/ImageActionsOverlay/ImageActions
|
|
|
8
8
|
import { SmallIconButton } from '../../../SmallIconButton';
|
|
9
9
|
import { UploadImageDialog } from '../../../UploadImageDialog/UploadImageDialog';
|
|
10
10
|
import ImageAttributesLineCommon from '../../ImageAttributesLine';
|
|
11
|
-
import {
|
|
11
|
+
import { DEFAULT_IMAGE_SIZE } from '../../ImageAttributesLine/constants';
|
|
12
12
|
import { useStyles } from './styles';
|
|
13
13
|
var ImageAttributesLine = function (_a) {
|
|
14
|
-
var _b = _a.attributeType, attributeType = _b === void 0 ? {} : _b, _c = _a.attributeValues, attributeValues = _c === void 0 ? [] : _c, onDeleteAttribute = _a.onDeleteAttribute, onChangeAttribute = _a.onChangeAttribute, parentUri = _a.parentUri;
|
|
15
|
-
var styles = useStyles(
|
|
14
|
+
var _b = _a.attributeType, attributeType = _b === void 0 ? {} : _b, _c = _a.attributeValues, attributeValues = _c === void 0 ? [] : _c, onDeleteAttribute = _a.onDeleteAttribute, onChangeAttribute = _a.onChangeAttribute, requestNextPageOfAttributeValues = _a.requestNextPageOfAttributeValues, parentUri = _a.parentUri, paging = _a.paging, showNonOv = _a.showNonOv, _d = _a.imageSize, imageSize = _d === void 0 ? DEFAULT_IMAGE_SIZE : _d;
|
|
15
|
+
var styles = useStyles(imageSize);
|
|
16
16
|
var entity = useSelector(mdmModule.selectors.getEntity) || {};
|
|
17
17
|
var defaultProfilePic = useSelector(function (state) {
|
|
18
18
|
return mdmModule.selectors.getModifiedEntityDefaultProfilePic(state, entity.uri);
|
|
19
19
|
});
|
|
20
20
|
var dispatch = useDispatch();
|
|
21
|
-
var
|
|
21
|
+
var _e = useState(false), isVisibleUploadDialog = _e[0], setIsVisibleUploadDialog = _e[1];
|
|
22
22
|
var toggleVisibilityUploadDialog = useCallback(function () {
|
|
23
23
|
setIsVisibleUploadDialog(function (visible) { return !visible; });
|
|
24
24
|
}, []);
|
|
@@ -70,12 +70,12 @@ var ImageAttributesLine = function (_a) {
|
|
|
70
70
|
var uri = attribute.uri;
|
|
71
71
|
var onOpenImageGalleryDialog = methods.onOpenImageGalleryDialog;
|
|
72
72
|
return (React.createElement("div", { className: styles.image, key: uri },
|
|
73
|
-
React.createElement(Image, { src: src, overlay: renderImageActionsOverlay(methods, attribute), onClick: function () { return onOpenImageGalleryDialog(uri); } })));
|
|
73
|
+
React.createElement(Image, { src: src, overlay: renderImageActionsOverlay(methods, attribute), onClick: function () { return onOpenImageGalleryDialog(uri); }, size: { imageWidth: imageSize.imageWidth, imageHeight: imageSize.imageHeight } })));
|
|
74
74
|
};
|
|
75
75
|
return renderImage;
|
|
76
76
|
};
|
|
77
77
|
return (React.createElement("div", { className: styles.root },
|
|
78
|
-
React.createElement(ImageAttributesLineCommon, { attributeValues: attributeValues, attributeType: attributeType, renderImage: renderImage, overlay: true, countFixedItems: 1, onUpload: toggleVisibilityUploadDialog, onDeleteAttribute: handleDeleteAttribute },
|
|
78
|
+
React.createElement(ImageAttributesLineCommon, { attributeValues: attributeValues, attributeType: attributeType, renderImage: renderImage, overlay: true, countFixedItems: 1, onUpload: toggleVisibilityUploadDialog, onDeleteAttribute: handleDeleteAttribute, imageSize: imageSize, requestNextPageOfAttributeValues: requestNextPageOfAttributeValues, paging: paging, parentUri: parentUri, showNonOv: showNonOv },
|
|
79
79
|
React.createElement("div", { className: styles.uploadContainer, onClick: toggleVisibilityUploadDialog },
|
|
80
80
|
React.createElement(SmallIconButton, { className: styles.uploadButton, iconClassName: styles.uploadIcon, icon: CloudUploadIcon }))),
|
|
81
81
|
React.createElement(UploadImageDialog, { open: isVisibleUploadDialog, onUpload: handleAddAttributes, onClose: toggleVisibilityUploadDialog })));
|
package/esm/components/attributes/editMode/SimpleAttributeEditor/selectors/helpers/parents.js
CHANGED
|
@@ -24,11 +24,13 @@ export var getParents = function (state, valueUri, node) {
|
|
|
24
24
|
});
|
|
25
25
|
var modifiedEntities = mdmModule.selectors.getModifiedEntities(state);
|
|
26
26
|
var entityUri = mdmModule.selectors.getEntityUri(state);
|
|
27
|
+
var connections = mdmModule.selectors.getAllRelationsToAddAndEdit(state);
|
|
27
28
|
var ownParentNodesValues = filterRelatedParentValuesForDependentLookupValueUri({
|
|
28
29
|
parentValues: parentNodesValues,
|
|
29
30
|
valueUri: valueUri,
|
|
30
31
|
entityUri: entityUri,
|
|
31
|
-
modifiedEntities: modifiedEntities
|
|
32
|
+
modifiedEntities: modifiedEntities,
|
|
33
|
+
connections: connections
|
|
32
34
|
});
|
|
33
35
|
var neededParentsAttributeTypes = node.parents.map(function (type) {
|
|
34
36
|
var parentNode = mdmModule.selectors.getDependentLookupsStructureNode(state, type);
|
|
@@ -47,7 +47,7 @@ var AttributesPager = function (_a) {
|
|
|
47
47
|
case RENDERER_TYPES.imageLine:
|
|
48
48
|
return (React.createElement(React.Fragment, null,
|
|
49
49
|
showTitle && React.createElement(Title, { label: attributeType === null || attributeType === void 0 ? void 0 : attributeType.label, attributeType: attributeType }),
|
|
50
|
-
React.createElement(ImageAttributesLine, { attributeValues: visibleValues, attributeType: attributeType })));
|
|
50
|
+
React.createElement(ImageAttributesLine, { attributeValues: visibleValues, attributeType: attributeType, paging: paging, parentUri: parentUri, requestNextPageOfAttributeValues: requestNextPageOfAttributeValues, showNonOv: showNonOv })));
|
|
51
51
|
case RENDERER_TYPES.special:
|
|
52
52
|
return React.createElement(SpecialRenderer, { values: visibleValues, attributeType: attributeType, showTitle: showTitle });
|
|
53
53
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AttributeType, ImageAttributeValue } from '@reltio/mdm-sdk';
|
|
2
|
+
import { AttributeType, ImageAttributeValue, Paging } from '@reltio/mdm-sdk';
|
|
3
|
+
import { RequestNextPageOfAttributeValuesPayload } from '@reltio/mdm-module';
|
|
3
4
|
import { SIZES_TYPE } from '../../ImageAttributesLine/styles';
|
|
4
5
|
declare type Props = {
|
|
5
6
|
attributeValues: ImageAttributeValue[];
|
|
6
7
|
attributeType: AttributeType;
|
|
7
8
|
imageSize?: SIZES_TYPE;
|
|
9
|
+
paging?: Paging;
|
|
10
|
+
parentUri?: string;
|
|
11
|
+
showNonOv?: boolean;
|
|
12
|
+
requestNextPageOfAttributeValues?: (payload: RequestNextPageOfAttributeValuesPayload) => void;
|
|
8
13
|
};
|
|
9
|
-
declare const ImageAttributesLine: ({ attributeType, attributeValues, imageSize }: Props) => JSX.Element;
|
|
14
|
+
declare const ImageAttributesLine: ({ attributeType, attributeValues, paging, parentUri, requestNextPageOfAttributeValues, showNonOv, imageSize }: Props) => JSX.Element;
|
|
10
15
|
export default ImageAttributesLine;
|
|
@@ -8,7 +8,7 @@ import { DEFAULT_IMAGE_SIZE } from '../../ImageAttributesLine/constants';
|
|
|
8
8
|
import { getHistoryAppearanceByUri, getHistoryAttributeClassName } from '../helpers/historyAppearance';
|
|
9
9
|
import { useStyles } from './styles';
|
|
10
10
|
var ImageAttributesLine = function (_a) {
|
|
11
|
-
var attributeType = _a.attributeType, _b = _a.attributeValues, attributeValues = _b === void 0 ? [] : _b, _c = _a.imageSize, imageSize = _c === void 0 ? DEFAULT_IMAGE_SIZE : _c;
|
|
11
|
+
var attributeType = _a.attributeType, _b = _a.attributeValues, attributeValues = _b === void 0 ? [] : _b, paging = _a.paging, parentUri = _a.parentUri, requestNextPageOfAttributeValues = _a.requestNextPageOfAttributeValues, showNonOv = _a.showNonOv, _c = _a.imageSize, imageSize = _c === void 0 ? DEFAULT_IMAGE_SIZE : _c;
|
|
12
12
|
var styles = useStyles(imageSize);
|
|
13
13
|
var appearance = useContext(HistoryDiffContext).appearance;
|
|
14
14
|
var renderImage = function (_a) {
|
|
@@ -26,6 +26,6 @@ var ImageAttributesLine = function (_a) {
|
|
|
26
26
|
};
|
|
27
27
|
return renderImage;
|
|
28
28
|
};
|
|
29
|
-
return (React.createElement(ImageAttributesLineCommon, { attributeValues: attributeValues, attributeType: attributeType, renderImage: renderImage, imageSize: imageSize }));
|
|
29
|
+
return (React.createElement(ImageAttributesLineCommon, { attributeValues: attributeValues, attributeType: attributeType, renderImage: renderImage, imageSize: imageSize, requestNextPageOfAttributeValues: requestNextPageOfAttributeValues, paging: paging, parentUri: parentUri, showNonOv: showNonOv }));
|
|
30
30
|
};
|
|
31
31
|
export default ImageAttributesLine;
|
|
@@ -10,12 +10,13 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
13
|
-
import { useDispatch } from 'react-redux';
|
|
13
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
14
14
|
import ReactResizeDetector from 'react-resize-detector';
|
|
15
15
|
import i18n from 'ui-i18n';
|
|
16
16
|
import { isNil } from 'ramda';
|
|
17
17
|
import classnames from 'classnames';
|
|
18
|
-
import {
|
|
18
|
+
import { Mode } from '@reltio/mdm-sdk';
|
|
19
|
+
import mdm, { profile } from '@reltio/mdm-module';
|
|
19
20
|
import Button from '@material-ui/core/Button';
|
|
20
21
|
import HistoryRow from '../HistoryRow/HistoryRow';
|
|
21
22
|
import HistoryGraph from '../HistoryGraph/HistoryGraph';
|
|
@@ -26,6 +27,7 @@ var HistoryTree = function (_a) {
|
|
|
26
27
|
var historyData = _a.historyData, isLoading = _a.isLoading, canLoadMore = _a.canLoadMore, onLoadMore = _a.onLoadMore, entityUri = _a.entityUri, historyEvent = _a.historyEvent, findPreviousChange = _a.findPreviousChange;
|
|
27
28
|
var styles = useStyles();
|
|
28
29
|
var dispatch = useDispatch();
|
|
30
|
+
var isEditableMode = useSelector(mdm.selectors.getIsEditableMode);
|
|
29
31
|
var _c = useState({ historyLanes: {}, rows: [] }), graphData = _c[0], setGraphData = _c[1];
|
|
30
32
|
var _d = useState(false), isScrollable = _d[0], setIsScrollable = _d[1];
|
|
31
33
|
var _e = useState(-1), selectedIndex = _e[0], setSelectedIndex = _e[1];
|
|
@@ -54,6 +56,14 @@ var HistoryTree = function (_a) {
|
|
|
54
56
|
setIsScrollable(scrollLeft < scrollWidth - clientWidth);
|
|
55
57
|
};
|
|
56
58
|
var handleHistoryRowClick = function (index, change, isSelected, isCurrent) {
|
|
59
|
+
if (isEditableMode) {
|
|
60
|
+
if (window.confirm(i18n.text('Are you sure you want to go in history mode? All your changes will be lost.'))) {
|
|
61
|
+
dispatch(profile.mode.actions.modeUpdated(Mode.Viewing));
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
57
67
|
if ((isCurrent && !isSelected) || (!isCurrent && isSelected)) {
|
|
58
68
|
dispatch(profile.history.actions.clearHistoryEvent());
|
|
59
69
|
setSelectedIndex(0);
|
|
@@ -12,5 +12,6 @@ export declare const useHistory: ({ entityUri, enabled }: Props) => {
|
|
|
12
12
|
historyWithTotal: import("@reltio/mdm-sdk").HistoryWithTotal;
|
|
13
13
|
historyFilter: HistoryFilter;
|
|
14
14
|
setHistoryFilter: import("react").Dispatch<import("react").SetStateAction<HistoryFilter>>;
|
|
15
|
+
reloadHistory: () => void;
|
|
15
16
|
};
|
|
16
17
|
export {};
|
|
@@ -18,7 +18,7 @@ export var useHistory = function (_a) {
|
|
|
18
18
|
offset: historyPage * MAX_HISTORY_ROWS,
|
|
19
19
|
order: 'desc',
|
|
20
20
|
showAll: true
|
|
21
|
-
}), isHistoryLoading = _e.isLoading, historyWithTotal = _e.historyWithTotal, loadMore = _e.loadMore;
|
|
21
|
+
}), isHistoryLoading = _e.isLoading, historyWithTotal = _e.historyWithTotal, loadMore = _e.loadMore, loadData = _e.loadData;
|
|
22
22
|
var canLoadMore = useMemo(function () { return (historyPage + 1) * MAX_HISTORY_ROWS <= (historyWithTotal === null || historyWithTotal === void 0 ? void 0 : historyWithTotal.total); }, [
|
|
23
23
|
historyWithTotal,
|
|
24
24
|
historyPage
|
|
@@ -29,6 +29,10 @@ export var useHistory = function (_a) {
|
|
|
29
29
|
loadMore((historyPage + 1) * MAX_HISTORY_ROWS);
|
|
30
30
|
setHistoryPage(historyPage + 1);
|
|
31
31
|
}, [loadMore, historyPage, canLoadMore]);
|
|
32
|
+
var reloadHistory = useCallback(function () {
|
|
33
|
+
loadData();
|
|
34
|
+
setHistoryPage(0);
|
|
35
|
+
}, [loadData]);
|
|
32
36
|
return {
|
|
33
37
|
isLoading: isHistoryLoading || isHistoricUrisLoading,
|
|
34
38
|
canLoadMore: canLoadMore,
|
|
@@ -36,6 +40,7 @@ export var useHistory = function (_a) {
|
|
|
36
40
|
historicUris: historicUris,
|
|
37
41
|
historyWithTotal: historyWithTotal,
|
|
38
42
|
historyFilter: historyFilter,
|
|
39
|
-
setHistoryFilter: setHistoryFilter
|
|
43
|
+
setHistoryFilter: setHistoryFilter,
|
|
44
|
+
reloadHistory: reloadHistory
|
|
40
45
|
};
|
|
41
46
|
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
3
|
+
import { evolve, map } from 'ramda';
|
|
4
|
+
import { entity as History, wrapInArrayIfNeeded } from '@reltio/mdm-sdk';
|
|
5
|
+
import mdmModule, { HistoryMode, profile } from '@reltio/mdm-module';
|
|
6
|
+
var defaultHistoryDiff = {
|
|
7
|
+
appearance: {},
|
|
8
|
+
attributes: {},
|
|
9
|
+
roles: [],
|
|
10
|
+
tags: []
|
|
11
|
+
};
|
|
12
|
+
var fixRefEntity = evolve({
|
|
13
|
+
refEntity: wrapInArrayIfNeeded,
|
|
14
|
+
refRelation: wrapInArrayIfNeeded
|
|
15
|
+
});
|
|
16
|
+
var prepareHistorySlice = function (historySlice) {
|
|
17
|
+
if (historySlice) {
|
|
18
|
+
return evolve({
|
|
19
|
+
attributes: map(map(fixRefEntity))
|
|
20
|
+
})(historySlice);
|
|
21
|
+
}
|
|
22
|
+
return historySlice;
|
|
23
|
+
};
|
|
24
|
+
export var useHistoryDiff = function () {
|
|
25
|
+
var dispatch = useDispatch();
|
|
26
|
+
var historySlice = useSelector(mdmModule.selectors.getHistorySlice);
|
|
27
|
+
var historyDiff = useSelector(mdmModule.selectors.getHistoryDiff);
|
|
28
|
+
var historyMode = useSelector(mdmModule.selectors.getHistoryMode);
|
|
29
|
+
var entity = useSelector(mdmModule.selectors.getEntity);
|
|
30
|
+
useEffect(function () {
|
|
31
|
+
if (historySlice) {
|
|
32
|
+
var aEntity = historySlice.aEntity, bEntity = historySlice.bEntity;
|
|
33
|
+
var historyManager = History.HistoryManager.createHistoryManager(History.AttributesDiff);
|
|
34
|
+
var historyDiff_1 = historyManager.computeEntityHistoryDiff(prepareHistorySlice(historyMode === HistoryMode.Current ? entity : bEntity), prepareHistorySlice(aEntity));
|
|
35
|
+
dispatch(profile.history.actions.setHistoryDiff(historyDiff_1));
|
|
36
|
+
}
|
|
37
|
+
}, [historySlice, historyMode, dispatch, entity]);
|
|
38
|
+
return historyDiff || defaultHistoryDiff;
|
|
39
|
+
};
|
|
@@ -71,5 +71,5 @@ export var useHistoryWithTotal = function (_a) {
|
|
|
71
71
|
loadData();
|
|
72
72
|
}
|
|
73
73
|
}, [loadData, enabled]);
|
|
74
|
-
return { isLoading: isLoading, historyWithTotal: historyWithTotal, loadMore: loadMore };
|
|
74
|
+
return { isLoading: isLoading, historyWithTotal: historyWithTotal, loadMore: loadMore, loadData: loadData };
|
|
75
75
|
};
|
|
@@ -2,6 +2,7 @@ export { useHistoricUris } from './hooks/useHistoricUris';
|
|
|
2
2
|
export { useHistoryWithTotal } from './hooks/useHistoryWithTotal';
|
|
3
3
|
export { useHistorySlice } from './hooks/useHistorySlice';
|
|
4
4
|
export { useHistory } from './hooks/useHistory';
|
|
5
|
+
export { useHistoryDiff } from './hooks/useHistoryDiff';
|
|
5
6
|
export { default as HistoryView } from './HistoryView/HistoryView';
|
|
6
7
|
export { default as HistoryHeader } from './HistoryHeader/HistoryHeader';
|
|
7
8
|
export { default as ProfileBandHistory } from './ProfileBandHistory/ProfileBandHistory';
|
|
@@ -2,6 +2,7 @@ export { useHistoricUris } from './hooks/useHistoricUris';
|
|
|
2
2
|
export { useHistoryWithTotal } from './hooks/useHistoryWithTotal';
|
|
3
3
|
export { useHistorySlice } from './hooks/useHistorySlice';
|
|
4
4
|
export { useHistory } from './hooks/useHistory';
|
|
5
|
+
export { useHistoryDiff } from './hooks/useHistoryDiff';
|
|
5
6
|
export { default as HistoryView } from './HistoryView/HistoryView';
|
|
6
7
|
export { default as HistoryHeader } from './HistoryHeader/HistoryHeader';
|
|
7
8
|
export { default as ProfileBandHistory } from './ProfileBandHistory/ProfileBandHistory';
|
|
@@ -17,6 +17,7 @@ export { default as EditableAttribute } from './attributes/editMode/AttributesFa
|
|
|
17
17
|
export { default as ReadOnlyAttributeValuesBlock } from './attributes/readMode/AttributeValuesBlock/AttributeValuesBlock';
|
|
18
18
|
export { default as ReadOnlyAttributesList } from './attributes/readMode/AttributesList';
|
|
19
19
|
export { default as ImageAttributesLine } from './attributes/readMode/ImageAttributesLine';
|
|
20
|
+
export { default as EditableImageAttributesLine } from './attributes/editMode/ImageAttributesLine';
|
|
20
21
|
export { default as NestedAttribute } from './attributes/readMode/NestedAttribute';
|
|
21
22
|
export { default as ReferenceAttribute } from './attributes/readMode/ReferenceAttribute';
|
|
22
23
|
export { default as SimpleAttribute } from './attributes/readMode/SimpleAttribute';
|
package/esm/components/index.js
CHANGED
|
@@ -16,6 +16,7 @@ export { default as EditableAttribute } from './attributes/editMode/AttributesFa
|
|
|
16
16
|
export { default as ReadOnlyAttributeValuesBlock } from './attributes/readMode/AttributeValuesBlock/AttributeValuesBlock';
|
|
17
17
|
export { default as ReadOnlyAttributesList } from './attributes/readMode/AttributesList';
|
|
18
18
|
export { default as ImageAttributesLine } from './attributes/readMode/ImageAttributesLine';
|
|
19
|
+
export { default as EditableImageAttributesLine } from './attributes/editMode/ImageAttributesLine';
|
|
19
20
|
export { default as NestedAttribute } from './attributes/readMode/NestedAttribute';
|
|
20
21
|
export { default as ReferenceAttribute } from './attributes/readMode/ReferenceAttribute';
|
|
21
22
|
export { default as SimpleAttribute } from './attributes/readMode/SimpleAttribute';
|
|
@@ -4,8 +4,9 @@ declare type Props = {
|
|
|
4
4
|
entity: Entity;
|
|
5
5
|
onFinishRequest?: () => void;
|
|
6
6
|
onStartRequest?: () => void;
|
|
7
|
+
onError?: () => void;
|
|
7
8
|
};
|
|
8
|
-
export declare const useMergeAllRequest: ({ entities, entity, onFinishRequest, onStartRequest }: Props) => {
|
|
9
|
+
export declare const useMergeAllRequest: ({ entities, entity, onFinishRequest, onStartRequest, onError }: Props) => {
|
|
9
10
|
isPending: boolean;
|
|
10
11
|
sendMergeAllRequest: () => void;
|
|
11
12
|
};
|
|
@@ -2,18 +2,21 @@ import { useCallback, useState } from 'react';
|
|
|
2
2
|
import { useSelector } from 'react-redux';
|
|
3
3
|
import mdmModule from '@reltio/mdm-module';
|
|
4
4
|
import { isDataTenantEntity, mergeCustomerTenantEntityWithMixedEntities, mergeDataTenantEntity } from '@reltio/mdm-sdk';
|
|
5
|
+
import { noop } from '../core';
|
|
5
6
|
export var useMergeAllRequest = function (_a) {
|
|
6
|
-
var entities = _a.entities, entity = _a.entity, onFinishRequest = _a.onFinishRequest, onStartRequest = _a.onStartRequest;
|
|
7
|
+
var entities = _a.entities, entity = _a.entity, onFinishRequest = _a.onFinishRequest, onStartRequest = _a.onStartRequest, _b = _a.onError, onError = _b === void 0 ? noop : _b;
|
|
7
8
|
var tenant = useSelector(mdmModule.selectors.getTenant);
|
|
8
9
|
var dtssPath = useSelector(mdmModule.selectors.getDtssPath);
|
|
9
|
-
var
|
|
10
|
+
var _c = useState(false), isPending = _c[0], setIsPending = _c[1];
|
|
10
11
|
var sendMergeAllRequest = useCallback(function () {
|
|
11
12
|
onStartRequest === null || onStartRequest === void 0 ? void 0 : onStartRequest();
|
|
12
13
|
setIsPending(true);
|
|
13
14
|
var params = { dtssPath: dtssPath, customerTenant: tenant, entity: entity, entities: entities };
|
|
14
15
|
(isDataTenantEntity(entity)
|
|
15
16
|
? mergeDataTenantEntity(params)
|
|
16
|
-
: mergeCustomerTenantEntityWithMixedEntities(params))
|
|
17
|
+
: mergeCustomerTenantEntityWithMixedEntities(params))
|
|
18
|
+
.catch(onError)
|
|
19
|
+
.finally(function () {
|
|
17
20
|
onFinishRequest === null || onFinishRequest === void 0 ? void 0 : onFinishRequest();
|
|
18
21
|
setIsPending(false);
|
|
19
22
|
});
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.916",
|
|
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.916",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.916",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|