@reltio/components 1.4.1722 → 1.4.1724
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/EntityUriLink/EntityUriLink.js +5 -2
- package/cjs/components/ExternalInvalidRelations/ExternalInvalidRelations.d.ts +10 -0
- package/cjs/components/ExternalInvalidRelations/ExternalInvalidRelations.js +53 -0
- package/cjs/components/ExternalInvalidRelations/styles.d.ts +1 -0
- package/cjs/components/ExternalInvalidRelations/styles.js +10 -0
- package/cjs/components/Link/Link.js +2 -1
- package/cjs/components/PivotingUriLink/PivotingUriLink.js +7 -3
- package/cjs/components/RelationEditor/RelationEditor.js +5 -5
- package/cjs/components/attributes/editMode/EntitySelector/components/SingleValue.d.ts +14 -9
- package/cjs/components/attributes/editMode/EntitySelector/components/SingleValue.js +12 -10
- package/cjs/components/index.d.ts +1 -0
- package/cjs/components/index.js +5 -3
- package/cjs/contexts/MdmModuleContext/context.d.ts +2 -2
- package/cjs/contexts/MdmModuleContext/hooks.d.ts +1 -1
- package/cjs/core/utils.d.ts +9 -8
- package/cjs/core/utils.js +3 -1
- package/cjs/hooks/useExpandInvalidRelations.js +1 -14
- package/esm/components/EntityUriLink/EntityUriLink.js +5 -2
- package/esm/components/ExternalInvalidRelations/ExternalInvalidRelations.d.ts +10 -0
- package/esm/components/ExternalInvalidRelations/ExternalInvalidRelations.js +25 -0
- package/esm/components/ExternalInvalidRelations/styles.d.ts +1 -0
- package/esm/components/ExternalInvalidRelations/styles.js +7 -0
- package/esm/components/Link/Link.js +2 -1
- package/esm/components/PivotingUriLink/PivotingUriLink.js +8 -4
- package/esm/components/RelationEditor/RelationEditor.js +6 -6
- package/esm/components/attributes/editMode/EntitySelector/components/SingleValue.d.ts +14 -9
- package/esm/components/attributes/editMode/EntitySelector/components/SingleValue.js +12 -10
- package/esm/components/index.d.ts +1 -0
- package/esm/components/index.js +1 -0
- package/esm/contexts/MdmModuleContext/context.d.ts +2 -2
- package/esm/contexts/MdmModuleContext/hooks.d.ts +1 -1
- package/esm/core/utils.d.ts +9 -8
- package/esm/core/utils.js +2 -1
- package/esm/hooks/useExpandInvalidRelations.js +2 -15
- package/package.json +2 -2
|
@@ -47,6 +47,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
48
|
var react_1 = __importStar(require("react"));
|
|
49
49
|
var contexts_1 = require("../../contexts");
|
|
50
|
+
var core_1 = require("../../core");
|
|
50
51
|
var EntityUriLink = (0, react_1.forwardRef)(function (_a, ref) {
|
|
51
52
|
var value = _a.value, children = _a.children, screen = _a.screen, className = _a.className, _b = _a.shouldOpenInNewTab, shouldOpenInNewTab = _b === void 0 ? false : _b, otherProps = __rest(_a, ["value", "children", "screen", "className", "shouldOpenInNewTab"]);
|
|
52
53
|
var viewId = (0, react_1.useContext)(contexts_1.ViewIdContext);
|
|
@@ -55,9 +56,11 @@ var EntityUriLink = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
55
56
|
var uiPath = (0, contexts_1.useMdmUiPath)();
|
|
56
57
|
var generateEntityUrlByUri = function (uri) { return generateEntityUrl({ uiPath: uiPath, uri: uri, screen: screen }); };
|
|
57
58
|
var handleClick = (0, react_1.useCallback)(function (e) {
|
|
58
|
-
|
|
59
|
+
if (!(0, core_1.isControlOrCommandPressed)(e)) {
|
|
60
|
+
openEntity({ uri: value, viewId: viewId, screen: screen });
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
}
|
|
59
63
|
e.stopPropagation();
|
|
60
|
-
e.preventDefault();
|
|
61
64
|
}, [openEntity, screen, value, viewId]);
|
|
62
65
|
return (react_1.default.createElement("a", __assign({ ref: ref, href: generateEntityUrlByUri(value), onClick: shouldOpenInNewTab ? undefined : handleClick, target: shouldOpenInNewTab ? '_blank' : '_self', className: className }, otherProps), children));
|
|
63
66
|
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Connection, Metadata, Mode, RelationsViewConfig } from '@reltio/mdm-sdk';
|
|
2
|
+
type Props = {
|
|
3
|
+
connectionsToEdit: Connection[];
|
|
4
|
+
config: RelationsViewConfig;
|
|
5
|
+
metadata: Metadata;
|
|
6
|
+
mode: Mode;
|
|
7
|
+
pageConnections: Connection[];
|
|
8
|
+
};
|
|
9
|
+
declare const ExternalInvalidRelations: ({ connectionsToEdit, config, metadata, mode, pageConnections }: Props) => any;
|
|
10
|
+
export default ExternalInvalidRelations;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
var index_1 = require("../index");
|
|
30
|
+
var react_1 = __importStar(require("react"));
|
|
31
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
32
|
+
var contexts_1 = require("../../contexts");
|
|
33
|
+
var Divider_1 = __importDefault(require("@mui/material/Divider"));
|
|
34
|
+
var styles_1 = require("./styles");
|
|
35
|
+
var ExternalInvalidRelations = function (_a) {
|
|
36
|
+
var connectionsToEdit = _a.connectionsToEdit, config = _a.config, metadata = _a.metadata, mode = _a.mode, pageConnections = _a.pageConnections;
|
|
37
|
+
var profileErrors = (0, contexts_1.useMdmProfileErrors)();
|
|
38
|
+
var styles = (0, styles_1.useStyles)();
|
|
39
|
+
var allInvalidConnections = (0, react_1.useMemo)(function () { return (0, mdm_sdk_1.getInvalidConnections)(profileErrors, connectionsToEdit); }, [profileErrors, connectionsToEdit]);
|
|
40
|
+
var invalidConnections = allInvalidConnections.filter(function (connection) {
|
|
41
|
+
return !pageConnections.some(function (existingConnection) {
|
|
42
|
+
return (0, mdm_sdk_1.getRelationUriFromConnection)(existingConnection) === (0, mdm_sdk_1.getRelationUriFromConnection)(connection);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
return invalidConnections.map(function (connection, index) {
|
|
46
|
+
var _a;
|
|
47
|
+
var itemKey = "".concat((0, mdm_sdk_1.getRelationUriFromConnection)(connection), "-").concat((_a = connection === null || connection === void 0 ? void 0 : connection.relation) === null || _a === void 0 ? void 0 : _a.direction);
|
|
48
|
+
return (react_1.default.createElement(react_1.default.Fragment, { key: itemKey },
|
|
49
|
+
react_1.default.createElement(index_1.RelationEditor, { connection: connection, config: config, mode: mode, metadata: metadata }),
|
|
50
|
+
index === invalidConnections.length - 1 && react_1.default.createElement(Divider_1.default, { className: styles.divider })));
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
exports.default = ExternalInvalidRelations;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"divider">;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useStyles = void 0;
|
|
4
|
+
var styles_1 = require("@mui/styles");
|
|
5
|
+
exports.useStyles = (0, styles_1.makeStyles)({
|
|
6
|
+
divider: {
|
|
7
|
+
margin: '0 0 8px',
|
|
8
|
+
borderColor: 'rgba(0,0,0,0.12)'
|
|
9
|
+
}
|
|
10
|
+
});
|
|
@@ -5,11 +5,12 @@ 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 styles_1 = require("./styles");
|
|
8
|
+
var core_1 = require("../../core");
|
|
8
9
|
var Link = function (_a) {
|
|
9
10
|
var to = _a.to, children = _a.children, onClick = _a.onClick;
|
|
10
11
|
var styles = (0, styles_1.useStyles)();
|
|
11
12
|
return (react_1.default.createElement("a", { href: to, onClick: function (e) {
|
|
12
|
-
if (onClick) {
|
|
13
|
+
if ((!(0, core_1.isControlOrCommandPressed)(e) || !to) && onClick) {
|
|
13
14
|
onClick();
|
|
14
15
|
e.stopPropagation();
|
|
15
16
|
e.preventDefault();
|
|
@@ -30,17 +30,21 @@ var react_1 = __importStar(require("react"));
|
|
|
30
30
|
var classnames_1 = __importDefault(require("classnames"));
|
|
31
31
|
var contexts_1 = require("../../contexts");
|
|
32
32
|
var styles_1 = require("./styles");
|
|
33
|
+
var core_1 = require("../../core");
|
|
33
34
|
var PivotingUriLink = (0, react_1.forwardRef)(function (_a, ref) {
|
|
34
35
|
var value = _a.value, attributeType = _a.attributeType, children = _a.children, className = _a.className, onClick = _a.onClick;
|
|
35
36
|
var styles = (0, styles_1.useStyles)();
|
|
36
37
|
var generatePivotingUrl = (0, react_1.useContext)(contexts_1.UrlGeneratorsContext).generatePivotingUrl;
|
|
37
38
|
var uiPath = (0, contexts_1.useMdmUiPath)();
|
|
38
39
|
var url = generatePivotingUrl({ uiPath: uiPath, uri: attributeType.uri, value: JSON.stringify(value) });
|
|
39
|
-
|
|
40
|
+
var handleClick = (0, react_1.useCallback)(function (e) {
|
|
41
|
+
if (!(0, core_1.isControlOrCommandPressed)(e)) {
|
|
40
42
|
onClick();
|
|
41
|
-
e.stopPropagation();
|
|
42
43
|
e.preventDefault();
|
|
43
|
-
}
|
|
44
|
+
}
|
|
45
|
+
e.stopPropagation();
|
|
46
|
+
}, [onClick]);
|
|
47
|
+
return (react_1.default.createElement("a", { ref: ref, href: url, onClick: handleClick, className: (0, classnames_1.default)(styles.link, className) }, children));
|
|
44
48
|
});
|
|
45
49
|
PivotingUriLink.displayName = 'PivotingUriLink';
|
|
46
50
|
exports.default = PivotingUriLink;
|
|
@@ -102,12 +102,12 @@ var RelationEditor = function (_a) {
|
|
|
102
102
|
var attributeListEntity = (0, react_1.useMemo)(function () { return (__assign({ attributes: __assign({}, (0, mdm_sdk_1.getRelationAttributesFromConnection)(connection)) }, (0, mdm_sdk_1.getActivenessAttributes)(connection.relation))); }, [connection]);
|
|
103
103
|
var relatedTempEntities = (0, react_1.useMemo)(function () { return (0, mdm_sdk_1.findRelatedTemporaryEntities)(allModifiedEntities, modifiedEntity); }, [allModifiedEntities, modifiedEntity]);
|
|
104
104
|
var relatedTempEntitiesUrisHistory = (0, react_1.useRef)([]);
|
|
105
|
-
var setInitialInfo = (0, react_1.useCallback)(function (entity
|
|
106
|
-
mdmSetInitialInfo(config.id, relationUri, entity
|
|
105
|
+
var setInitialInfo = (0, react_1.useCallback)(function (entity) {
|
|
106
|
+
mdmSetInitialInfo(config.id, relationUri, entity);
|
|
107
107
|
}, [mdmSetInitialInfo]);
|
|
108
108
|
(0, react_1.useEffect)(function () {
|
|
109
|
-
if (!
|
|
110
|
-
setInitialInfo(modifiedEntity
|
|
109
|
+
if (modifiedEntity && !initialModifiedEntity) {
|
|
110
|
+
setInitialInfo(modifiedEntity);
|
|
111
111
|
}
|
|
112
112
|
}, []);
|
|
113
113
|
(0, react_1.useEffect)(function () {
|
|
@@ -149,7 +149,7 @@ var RelationEditor = function (_a) {
|
|
|
149
149
|
return errors.length === 0;
|
|
150
150
|
}, [connection, metadata, allModifiedEntities, errorsSet]);
|
|
151
151
|
var resetErrors = (0, react_1.useCallback)(function () { return errorsSet([]); }, [errorsSet]);
|
|
152
|
-
var onApply = (0, react_1.useCallback)((0, ramda_1.pipe)((0, ramda_1.always)(connection), (0, ramda_1.when)(validate, (0, ramda_1.pipe)(mdm_sdk_1.omitMarks, updateModifiedEntityLabel,
|
|
152
|
+
var onApply = (0, react_1.useCallback)((0, ramda_1.pipe)((0, ramda_1.always)(connection), (0, ramda_1.when)(validate, (0, ramda_1.pipe)(mdm_sdk_1.omitMarks, updateModifiedEntityLabel, applyAction(config.id), (0, ramda_1.always)((0, ramda_1.differenceWith)(ramda_1.equals, relatedTempEntitiesUrisHistory.current, relatedTempEntities.map((0, ramda_1.prop)('uri')))), (0, ramda_1.forEach)(deleteModifiedEntity), handleClose))), [connection, config, updateModifiedEntityLabel, validate, relatedTempEntities]);
|
|
153
153
|
var onCancel = (0, react_1.useCallback)(function () {
|
|
154
154
|
if (modifiedEntity !== initialModifiedEntity) {
|
|
155
155
|
if (initialModifiedEntity) {
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TEntityType } from '@reltio/mdm-sdk';
|
|
3
|
+
type Props = {
|
|
4
|
+
selectProps: {
|
|
5
|
+
currentEntityType: TEntityType;
|
|
6
|
+
menuIsOpen: boolean;
|
|
7
|
+
disableLinkClick: boolean;
|
|
8
|
+
};
|
|
9
|
+
children: string;
|
|
10
|
+
data: {
|
|
11
|
+
entityUri: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
declare const SingleValue: ({ selectProps: { currentEntityType, menuIsOpen, disableLinkClick }, children, data }: Props) => JSX.Element;
|
|
1
15
|
export default SingleValue;
|
|
2
|
-
declare function SingleValue(props: any): JSX.Element;
|
|
3
|
-
declare namespace SingleValue {
|
|
4
|
-
namespace propTypes {
|
|
5
|
-
const children: PropTypes.Requireable<string>;
|
|
6
|
-
const data: PropTypes.Validator<object>;
|
|
7
|
-
const selectProps: PropTypes.Validator<object>;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
@@ -38,15 +38,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
var react_1 = __importStar(require("react"));
|
|
41
|
-
var prop_types_1 = __importDefault(require("prop-types"));
|
|
42
41
|
var classnames_1 = __importDefault(require("classnames"));
|
|
43
42
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
44
43
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
45
44
|
var Typography_1 = __importDefault(require("@mui/material/Typography"));
|
|
46
45
|
var contexts_1 = require("../../../../../contexts");
|
|
47
46
|
var styles_1 = require("./styles");
|
|
48
|
-
var
|
|
49
|
-
|
|
47
|
+
var core_1 = require("../../../../../core");
|
|
48
|
+
var SingleValue = function (_a) {
|
|
49
|
+
var _b = _a.selectProps, currentEntityType = _b.currentEntityType, menuIsOpen = _b.menuIsOpen, disableLinkClick = _b.disableLinkClick, children = _a.children, data = _a.data;
|
|
50
50
|
var styles = (0, styles_1.useSingleValueStyles)();
|
|
51
51
|
var openEntity = (0, contexts_1.useMdmAction)('openEntity');
|
|
52
52
|
var uiPath = (0, contexts_1.useMdmUiPath)();
|
|
@@ -54,8 +54,15 @@ var SingleValue = function (props) {
|
|
|
54
54
|
var generateEntityUrl = (0, react_1.useContext)(contexts_1.UrlGeneratorsContext).generateEntityUrl;
|
|
55
55
|
var handleOnMouseDown = function (event) {
|
|
56
56
|
event.stopPropagation();
|
|
57
|
-
|
|
57
|
+
};
|
|
58
|
+
var handleClick = function (event) {
|
|
59
|
+
event.stopPropagation();
|
|
60
|
+
if (disableLinkClick) {
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
}
|
|
63
|
+
else if (!(0, core_1.isControlOrCommandPressed)(event)) {
|
|
58
64
|
openEntity({ uri: data.entityUri, viewId: viewId });
|
|
65
|
+
event.preventDefault();
|
|
59
66
|
}
|
|
60
67
|
};
|
|
61
68
|
var valueProps = (0, mdm_sdk_1.isTempUri)(data.entityUri)
|
|
@@ -66,7 +73,7 @@ var SingleValue = function (props) {
|
|
|
66
73
|
: {
|
|
67
74
|
className: (0, classnames_1.default)(styles.singleValue, styles.linkValue),
|
|
68
75
|
onMouseDown: handleOnMouseDown,
|
|
69
|
-
onClick:
|
|
76
|
+
onClick: handleClick,
|
|
70
77
|
href: generateEntityUrl({ uiPath: uiPath, uri: data.entityUri }),
|
|
71
78
|
component: 'a'
|
|
72
79
|
};
|
|
@@ -74,9 +81,4 @@ var SingleValue = function (props) {
|
|
|
74
81
|
? ui_i18n_1.default.text("New ".concat(currentEntityType.label, " will be created"))
|
|
75
82
|
: (0, mdm_sdk_1.getLabel)(children))));
|
|
76
83
|
};
|
|
77
|
-
SingleValue.propTypes = {
|
|
78
|
-
children: prop_types_1.default.string,
|
|
79
|
-
data: prop_types_1.default.object.isRequired,
|
|
80
|
-
selectProps: prop_types_1.default.object.isRequired
|
|
81
|
-
};
|
|
82
84
|
exports.default = SingleValue;
|
|
@@ -61,6 +61,7 @@ export { AttributesErrorsPanel } from './AttributesErrorsPanel/AttributesErrorsP
|
|
|
61
61
|
export { default as ErrorPopup } from './ErrorPopup/ErrorPopup';
|
|
62
62
|
export { default as ErrorWrapper } from './ErrorWrapper/ErrorWrapper';
|
|
63
63
|
export { default as ExpandedValueTooltip } from './ExpandedValueTooltip/ExpandedValueTooltip';
|
|
64
|
+
export { default as ExternalInvalidRelations } from './ExternalInvalidRelations/ExternalInvalidRelations';
|
|
64
65
|
export { default as FacetViewHeader } from './FacetViewHeader/FacetViewHeader';
|
|
65
66
|
export { default as FlipCard } from './FlipCard/FlipCard';
|
|
66
67
|
export { default as HideOnShrink } from './HideOnShrink/HideOnShrink';
|
package/cjs/components/index.js
CHANGED
|
@@ -18,9 +18,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.EmptyState = exports.NoResults = exports.NoData = exports.DropDownSelector = exports.DropDownMenuButton = exports.Drawer = exports.DataTypeValue = exports.ConnectionRelationTypeSelector = exports.ConfigureColumnsPopup = exports.MenuWithPopper = exports.MenuList = exports.LoadMoreButton = exports.DropdownIndicatorWithIconButton = exports.DropdownIndicator = exports.CommentsContainer = exports.ColorBar = exports.CollapseButton = exports.CollaborationItem = exports.ClickAwayProvider = exports.BasicViewHeader = exports.BasicViewContent = exports.BasicView = exports.ScreenProfileBand = 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.DescriptionIcon = exports.AttributesView = exports.AttributeListItem = void 0;
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.TableSkeleton = exports.StepNavigation = exports.TenantLabel = exports.MultilineMenuItem = void 0;
|
|
21
|
+
exports.useKeyboardNavigation = exports.WhiteSearchInput = exports.SearchInput = exports.ProfileResizablePanes = 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.SimpleMatchRulesBlock = exports.MatchRuleVariant = 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.ExternalInvalidRelations = exports.ExpandedValueTooltip = exports.ErrorWrapper = exports.ErrorPopup = exports.AttributesErrorsPanel = exports.ErrorBoundary = exports.EntityUriLink = exports.RelationTypesSelector = exports.EntityTypesSelector = exports.EntityTypeIcon = exports.EntityTypeBadge = exports.EntityAvatar = exports.EMPTY_STATE_VARIANTS = exports.EMPTY_STATE_ICONS = void 0;
|
|
22
|
+
exports.RequiredMark = exports.HierarchyNodeTitle = exports.DataTenantBadge = exports.SettingsMenu = exports.TenantsDropDownSelector = exports.TenantIcon = exports.SourceSystemsSelector = exports.MatchRulesSelector = exports.MultiValueSelector = exports.DragAndDrop = exports.ConnectionEditor = exports.AttributesFiltersBuilder = exports.AttributesFiltersButton = exports.AttributeGroupIcon = exports.BasicAttributeSelector = exports.ProfilesList = 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.ColoredSourceIcon = exports.SourceIcon = exports.SmallIconButtonWithTooltip = exports.SmallIconButton = exports.SimpleDropDownSelector = exports.SidePanelContentHeader = exports.SidePanel = exports.SidePanelEmptyState = exports.SideButtonsPanel = exports.SelectorWithOnlyOptionAutoSelect = exports.SelectionPopupPopper = exports.SelectionPopup = void 0;
|
|
23
|
+
exports.TableSkeleton = exports.StepNavigation = exports.TenantLabel = exports.MultilineMenuItem = exports.RelevanceScoreBadge = void 0;
|
|
24
24
|
__exportStar(require("./activityLog"), exports);
|
|
25
25
|
var AttributeListItem_1 = require("./AttributeListItem/AttributeListItem");
|
|
26
26
|
Object.defineProperty(exports, "AttributeListItem", { enumerable: true, get: function () { return __importDefault(AttributeListItem_1).default; } });
|
|
@@ -147,6 +147,8 @@ var ErrorWrapper_1 = require("./ErrorWrapper/ErrorWrapper");
|
|
|
147
147
|
Object.defineProperty(exports, "ErrorWrapper", { enumerable: true, get: function () { return __importDefault(ErrorWrapper_1).default; } });
|
|
148
148
|
var ExpandedValueTooltip_1 = require("./ExpandedValueTooltip/ExpandedValueTooltip");
|
|
149
149
|
Object.defineProperty(exports, "ExpandedValueTooltip", { enumerable: true, get: function () { return __importDefault(ExpandedValueTooltip_1).default; } });
|
|
150
|
+
var ExternalInvalidRelations_1 = require("./ExternalInvalidRelations/ExternalInvalidRelations");
|
|
151
|
+
Object.defineProperty(exports, "ExternalInvalidRelations", { enumerable: true, get: function () { return __importDefault(ExternalInvalidRelations_1).default; } });
|
|
150
152
|
var FacetViewHeader_1 = require("./FacetViewHeader/FacetViewHeader");
|
|
151
153
|
Object.defineProperty(exports, "FacetViewHeader", { enumerable: true, get: function () { return __importDefault(FacetViewHeader_1).default; } });
|
|
152
154
|
var FlipCard_1 = require("./FlipCard/FlipCard");
|
|
@@ -111,7 +111,7 @@ export type MdmModuleActionsContextProps = Partial<{
|
|
|
111
111
|
}) => void;
|
|
112
112
|
lookupsListResolved: (payload: Lookups[]) => void;
|
|
113
113
|
relationsLoaded: (payload: RelationsLoadedPayload) => void;
|
|
114
|
-
setInitialInfo: (id: string, relationUri: string, tempEntity: Entity
|
|
114
|
+
setInitialInfo: (id: string, relationUri: string, tempEntity: Entity) => void;
|
|
115
115
|
setRelationType: (id: string, relationUri: string, relationType: CompactRelationType) => void;
|
|
116
116
|
closeRelationEditor: (id: string, relationUri: string) => void;
|
|
117
117
|
openRelationEditor: (id: string, connection: Connection) => void;
|
|
@@ -183,7 +183,7 @@ export declare const MdmModuleActionsContext: import("@fluentui/react-context-se
|
|
|
183
183
|
}) => void;
|
|
184
184
|
lookupsListResolved: (payload: Lookups[]) => void;
|
|
185
185
|
relationsLoaded: (payload: RelationsLoadedPayload) => void;
|
|
186
|
-
setInitialInfo: (id: string, relationUri: string, tempEntity: Entity
|
|
186
|
+
setInitialInfo: (id: string, relationUri: string, tempEntity: Entity) => void;
|
|
187
187
|
setRelationType: (id: string, relationUri: string, relationType: CompactRelationType) => void;
|
|
188
188
|
closeRelationEditor: (id: string, relationUri: string) => void;
|
|
189
189
|
openRelationEditor: (id: string, connection: Connection) => void;
|
|
@@ -128,7 +128,7 @@ export declare const useMdmAction: <T extends "openSearch" | "openHistoryEvent"
|
|
|
128
128
|
}) => void;
|
|
129
129
|
lookupsListResolved: (payload: import("@reltio/mdm-sdk").Lookups[]) => void;
|
|
130
130
|
relationsLoaded: (payload: import("@reltio/mdm-sdk").RelationsLoadedPayload) => void;
|
|
131
|
-
setInitialInfo: (id: string, relationUri: string, tempEntity: import("@reltio/mdm-sdk").Entity
|
|
131
|
+
setInitialInfo: (id: string, relationUri: string, tempEntity: import("@reltio/mdm-sdk").Entity) => void;
|
|
132
132
|
setRelationType: (id: string, relationUri: string, relationType: import("@reltio/mdm-sdk").CompactRelationType) => void;
|
|
133
133
|
closeRelationEditor: (id: string, relationUri: string) => void;
|
|
134
134
|
openRelationEditor: (id: string, connection: import("@reltio/mdm-sdk").Connection) => void;
|
package/cjs/core/utils.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export function getValue(e: any): any;
|
|
2
|
-
export function getChecked(e: any): any;
|
|
3
|
-
export function stopPropagation(e: any): any;
|
|
4
|
-
export function noop(): void;
|
|
5
|
-
export function EmptyStub(): any;
|
|
6
|
-
export function mergeClasses(classes: any, other: any): any;
|
|
7
|
-
export function isIE(): any;
|
|
8
1
|
export function createStandardAction(type: any): (payload: any) => {
|
|
9
2
|
type: any;
|
|
10
3
|
payload: any;
|
|
11
4
|
};
|
|
12
|
-
export function
|
|
5
|
+
export function EmptyStub(): any;
|
|
6
|
+
export function getChecked(e: any): any;
|
|
7
|
+
export function isControlOrCommandPressed(e: any): any;
|
|
8
|
+
export function getValue(e: any): any;
|
|
9
|
+
export function isIE(): any;
|
|
10
|
+
export function mergeClasses(classes: any, other: any): any;
|
|
11
|
+
export function noop(): void;
|
|
13
12
|
export function parseJSON(value: any): any;
|
|
13
|
+
export function stopPropagation(e: any): any;
|
|
14
|
+
export function toggleSortOrder(order: any): "asc" | "desc";
|
package/cjs/core/utils.js
CHANGED
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.toggleSortOrder = exports.stopPropagation = exports.parseJSON = exports.noop = exports.mergeClasses = exports.isIE = exports.getValue = exports.isControlOrCommandPressed = exports.getChecked = exports.EmptyStub = exports.createStandardAction = void 0;
|
|
18
18
|
var ramda_1 = require("ramda");
|
|
19
19
|
var classnames_1 = __importDefault(require("classnames"));
|
|
20
20
|
var getValue = function (e) { return e.target.value; };
|
|
@@ -23,6 +23,8 @@ var getChecked = function (e) { return e.target.checked; };
|
|
|
23
23
|
exports.getChecked = getChecked;
|
|
24
24
|
var stopPropagation = function (e) { return e.stopPropagation(); };
|
|
25
25
|
exports.stopPropagation = stopPropagation;
|
|
26
|
+
var isControlOrCommandPressed = function (e) { return e.ctrlKey || e.metaKey; };
|
|
27
|
+
exports.isControlOrCommandPressed = isControlOrCommandPressed;
|
|
26
28
|
var noop = function () { };
|
|
27
29
|
exports.noop = noop;
|
|
28
30
|
var EmptyStub = function () { return null; };
|
|
@@ -14,19 +14,6 @@ var ramda_1 = require("ramda");
|
|
|
14
14
|
var react_1 = require("react");
|
|
15
15
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
16
16
|
var contexts_1 = require("../contexts");
|
|
17
|
-
var isConnectionHasError = (0, ramda_1.curry)(function (errors, connection) {
|
|
18
|
-
var relationUri = (0, ramda_1.path)(['relation', 'relationUri'], connection);
|
|
19
|
-
return errors.some(function (error) {
|
|
20
|
-
return (0, mdm_sdk_1.areOneHierarchyUris)((0, ramda_1.prop)('uri', error), relationUri) ||
|
|
21
|
-
(0, mdm_sdk_1.areOneHierarchyUris)((0, ramda_1.prop)('parentUri', error), relationUri) ||
|
|
22
|
-
(error.path || []).some(function (errorPath) { return (0, ramda_1.path)(['value', 'relation', 'relationUri'], errorPath) === relationUri; });
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
var getInvalidConnections = function (errors, connections) {
|
|
26
|
-
if (errors === void 0) { errors = []; }
|
|
27
|
-
if (connections === void 0) { connections = []; }
|
|
28
|
-
return (0, ramda_1.filter)(isConnectionHasError(errors), connections);
|
|
29
|
-
};
|
|
30
17
|
var useExpandInvalidRelations = function (configId) {
|
|
31
18
|
var openRelationEditor = (0, contexts_1.useMdmAction)('openRelationEditor');
|
|
32
19
|
var mode = (0, contexts_1.useMdmMode)();
|
|
@@ -38,7 +25,7 @@ var useExpandInvalidRelations = function (configId) {
|
|
|
38
25
|
var preparedConnectionsList = (0, ramda_1.reject)(function (draftConnection) {
|
|
39
26
|
return relationsToAddAndEdit.some((0, ramda_1.eqBy)((0, ramda_1.path)(['relation', 'relationUri']), draftConnection));
|
|
40
27
|
}, __spreadArray(__spreadArray([], addedConnections.map(mdm_sdk_1.markNew), true), editedConnections.map(mdm_sdk_1.markEdited), true));
|
|
41
|
-
var invalidConnections = (0, react_1.useMemo)(function () { return getInvalidConnections(profileErrors, preparedConnectionsList); }, [profileErrors, preparedConnectionsList]);
|
|
28
|
+
var invalidConnections = (0, react_1.useMemo)(function () { return (0, mdm_sdk_1.getInvalidConnections)(profileErrors, preparedConnectionsList); }, [profileErrors, preparedConnectionsList]);
|
|
42
29
|
var expandInvalidRelatonsListener = (0, contexts_1.useMdmListener)('expandInvalidRelatonsListener');
|
|
43
30
|
var setShouldOpenInvalidEditors = function (shouldOpen) { return (shouldOpenInvalidEditors.current = shouldOpen); };
|
|
44
31
|
var listenerCallback = expandInvalidRelatonsListener(function () { return setShouldOpenInvalidEditors(true); });
|
|
@@ -22,6 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
};
|
|
23
23
|
import React, { forwardRef, useCallback, useContext } from 'react';
|
|
24
24
|
import { ViewIdContext, UrlGeneratorsContext, useMdmUiPath, useMdmAction } from '../../contexts';
|
|
25
|
+
import { isControlOrCommandPressed } from '../../core';
|
|
25
26
|
var EntityUriLink = forwardRef(function (_a, ref) {
|
|
26
27
|
var value = _a.value, children = _a.children, screen = _a.screen, className = _a.className, _b = _a.shouldOpenInNewTab, shouldOpenInNewTab = _b === void 0 ? false : _b, otherProps = __rest(_a, ["value", "children", "screen", "className", "shouldOpenInNewTab"]);
|
|
27
28
|
var viewId = useContext(ViewIdContext);
|
|
@@ -30,9 +31,11 @@ var EntityUriLink = forwardRef(function (_a, ref) {
|
|
|
30
31
|
var uiPath = useMdmUiPath();
|
|
31
32
|
var generateEntityUrlByUri = function (uri) { return generateEntityUrl({ uiPath: uiPath, uri: uri, screen: screen }); };
|
|
32
33
|
var handleClick = useCallback(function (e) {
|
|
33
|
-
|
|
34
|
+
if (!isControlOrCommandPressed(e)) {
|
|
35
|
+
openEntity({ uri: value, viewId: viewId, screen: screen });
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
}
|
|
34
38
|
e.stopPropagation();
|
|
35
|
-
e.preventDefault();
|
|
36
39
|
}, [openEntity, screen, value, viewId]);
|
|
37
40
|
return (React.createElement("a", __assign({ ref: ref, href: generateEntityUrlByUri(value), onClick: shouldOpenInNewTab ? undefined : handleClick, target: shouldOpenInNewTab ? '_blank' : '_self', className: className }, otherProps), children));
|
|
38
41
|
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Connection, Metadata, Mode, RelationsViewConfig } from '@reltio/mdm-sdk';
|
|
2
|
+
type Props = {
|
|
3
|
+
connectionsToEdit: Connection[];
|
|
4
|
+
config: RelationsViewConfig;
|
|
5
|
+
metadata: Metadata;
|
|
6
|
+
mode: Mode;
|
|
7
|
+
pageConnections: Connection[];
|
|
8
|
+
};
|
|
9
|
+
declare const ExternalInvalidRelations: ({ connectionsToEdit, config, metadata, mode, pageConnections }: Props) => any;
|
|
10
|
+
export default ExternalInvalidRelations;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { RelationEditor } from '../index';
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import { getInvalidConnections, getRelationUriFromConnection } from '@reltio/mdm-sdk';
|
|
4
|
+
import { useMdmProfileErrors } from '../../contexts';
|
|
5
|
+
import Divider from '@mui/material/Divider';
|
|
6
|
+
import { useStyles } from './styles';
|
|
7
|
+
var ExternalInvalidRelations = function (_a) {
|
|
8
|
+
var connectionsToEdit = _a.connectionsToEdit, config = _a.config, metadata = _a.metadata, mode = _a.mode, pageConnections = _a.pageConnections;
|
|
9
|
+
var profileErrors = useMdmProfileErrors();
|
|
10
|
+
var styles = useStyles();
|
|
11
|
+
var allInvalidConnections = useMemo(function () { return getInvalidConnections(profileErrors, connectionsToEdit); }, [profileErrors, connectionsToEdit]);
|
|
12
|
+
var invalidConnections = allInvalidConnections.filter(function (connection) {
|
|
13
|
+
return !pageConnections.some(function (existingConnection) {
|
|
14
|
+
return getRelationUriFromConnection(existingConnection) === getRelationUriFromConnection(connection);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
return invalidConnections.map(function (connection, index) {
|
|
18
|
+
var _a;
|
|
19
|
+
var itemKey = "".concat(getRelationUriFromConnection(connection), "-").concat((_a = connection === null || connection === void 0 ? void 0 : connection.relation) === null || _a === void 0 ? void 0 : _a.direction);
|
|
20
|
+
return (React.createElement(React.Fragment, { key: itemKey },
|
|
21
|
+
React.createElement(RelationEditor, { connection: connection, config: config, mode: mode, metadata: metadata }),
|
|
22
|
+
index === invalidConnections.length - 1 && React.createElement(Divider, { className: styles.divider })));
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
export default ExternalInvalidRelations;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"divider">;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useStyles } from './styles';
|
|
3
|
+
import { isControlOrCommandPressed } from '../../core';
|
|
3
4
|
var Link = function (_a) {
|
|
4
5
|
var to = _a.to, children = _a.children, onClick = _a.onClick;
|
|
5
6
|
var styles = useStyles();
|
|
6
7
|
return (React.createElement("a", { href: to, onClick: function (e) {
|
|
7
|
-
if (onClick) {
|
|
8
|
+
if ((!isControlOrCommandPressed(e) || !to) && onClick) {
|
|
8
9
|
onClick();
|
|
9
10
|
e.stopPropagation();
|
|
10
11
|
e.preventDefault();
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import React, { forwardRef, useContext } from 'react';
|
|
1
|
+
import React, { forwardRef, useCallback, useContext } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { UrlGeneratorsContext, useMdmUiPath } from '../../contexts';
|
|
4
4
|
import { useStyles } from './styles';
|
|
5
|
+
import { isControlOrCommandPressed } from '../../core';
|
|
5
6
|
var PivotingUriLink = forwardRef(function (_a, ref) {
|
|
6
7
|
var value = _a.value, attributeType = _a.attributeType, children = _a.children, className = _a.className, onClick = _a.onClick;
|
|
7
8
|
var styles = useStyles();
|
|
8
9
|
var generatePivotingUrl = useContext(UrlGeneratorsContext).generatePivotingUrl;
|
|
9
10
|
var uiPath = useMdmUiPath();
|
|
10
11
|
var url = generatePivotingUrl({ uiPath: uiPath, uri: attributeType.uri, value: JSON.stringify(value) });
|
|
11
|
-
|
|
12
|
+
var handleClick = useCallback(function (e) {
|
|
13
|
+
if (!isControlOrCommandPressed(e)) {
|
|
12
14
|
onClick();
|
|
13
|
-
e.stopPropagation();
|
|
14
15
|
e.preventDefault();
|
|
15
|
-
}
|
|
16
|
+
}
|
|
17
|
+
e.stopPropagation();
|
|
18
|
+
}, [onClick]);
|
|
19
|
+
return (React.createElement("a", { ref: ref, href: url, onClick: handleClick, className: classnames(styles.link, className) }, children));
|
|
16
20
|
});
|
|
17
21
|
PivotingUriLink.displayName = 'PivotingUriLink';
|
|
18
22
|
export default PivotingUriLink;
|
|
@@ -12,7 +12,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
13
13
|
import i18n from 'ui-i18n';
|
|
14
14
|
import classnames from 'classnames';
|
|
15
|
-
import { always, concat, differenceWith, equals, forEach,
|
|
15
|
+
import { always, concat, differenceWith, equals, forEach, path, pick, pipe, prop, when, uniq, curry } from 'ramda';
|
|
16
16
|
import Button from '@mui/material/Button';
|
|
17
17
|
import Typography from '@mui/material/Typography';
|
|
18
18
|
import { createTemporaryEntity, findRelatedTemporaryEntities, getActivenessAttributes, getCreatableAttributeTypes, getEntityType, getErrorMessage, getErrorId, omitMarks, relationEditorAttributeTypesSelectionStrategy, validateConnection, updateConnectionEntityLabel, isTempUri, isEmptyValue, getRelationAttributesList, getDefaultRelationTypeObject, getInOutRelations, isSuggestMode, isAttributeTypeError, getRelationUriFromConnection, getRelationEditorActiveError, getRelationAttributesFromConnection, getEntityUriFromConnection } from '@reltio/mdm-sdk';
|
|
@@ -74,12 +74,12 @@ var RelationEditor = function (_a) {
|
|
|
74
74
|
var attributeListEntity = useMemo(function () { return (__assign({ attributes: __assign({}, getRelationAttributesFromConnection(connection)) }, getActivenessAttributes(connection.relation))); }, [connection]);
|
|
75
75
|
var relatedTempEntities = useMemo(function () { return findRelatedTemporaryEntities(allModifiedEntities, modifiedEntity); }, [allModifiedEntities, modifiedEntity]);
|
|
76
76
|
var relatedTempEntitiesUrisHistory = useRef([]);
|
|
77
|
-
var setInitialInfo = useCallback(function (entity
|
|
78
|
-
mdmSetInitialInfo(config.id, relationUri, entity
|
|
77
|
+
var setInitialInfo = useCallback(function (entity) {
|
|
78
|
+
mdmSetInitialInfo(config.id, relationUri, entity);
|
|
79
79
|
}, [mdmSetInitialInfo]);
|
|
80
80
|
useEffect(function () {
|
|
81
|
-
if (!
|
|
82
|
-
setInitialInfo(modifiedEntity
|
|
81
|
+
if (modifiedEntity && !initialModifiedEntity) {
|
|
82
|
+
setInitialInfo(modifiedEntity);
|
|
83
83
|
}
|
|
84
84
|
}, []);
|
|
85
85
|
useEffect(function () {
|
|
@@ -121,7 +121,7 @@ var RelationEditor = function (_a) {
|
|
|
121
121
|
return errors.length === 0;
|
|
122
122
|
}, [connection, metadata, allModifiedEntities, errorsSet]);
|
|
123
123
|
var resetErrors = useCallback(function () { return errorsSet([]); }, [errorsSet]);
|
|
124
|
-
var onApply = useCallback(pipe(always(connection), when(validate, pipe(omitMarks, updateModifiedEntityLabel,
|
|
124
|
+
var onApply = useCallback(pipe(always(connection), when(validate, pipe(omitMarks, updateModifiedEntityLabel, applyAction(config.id), always(differenceWith(equals, relatedTempEntitiesUrisHistory.current, relatedTempEntities.map(prop('uri')))), forEach(deleteModifiedEntity), handleClose))), [connection, config, updateModifiedEntityLabel, validate, relatedTempEntities]);
|
|
125
125
|
var onCancel = useCallback(function () {
|
|
126
126
|
if (modifiedEntity !== initialModifiedEntity) {
|
|
127
127
|
if (initialModifiedEntity) {
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TEntityType } from '@reltio/mdm-sdk';
|
|
3
|
+
type Props = {
|
|
4
|
+
selectProps: {
|
|
5
|
+
currentEntityType: TEntityType;
|
|
6
|
+
menuIsOpen: boolean;
|
|
7
|
+
disableLinkClick: boolean;
|
|
8
|
+
};
|
|
9
|
+
children: string;
|
|
10
|
+
data: {
|
|
11
|
+
entityUri: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
declare const SingleValue: ({ selectProps: { currentEntityType, menuIsOpen, disableLinkClick }, children, data }: Props) => JSX.Element;
|
|
1
15
|
export default SingleValue;
|
|
2
|
-
declare function SingleValue(props: any): JSX.Element;
|
|
3
|
-
declare namespace SingleValue {
|
|
4
|
-
namespace propTypes {
|
|
5
|
-
const children: PropTypes.Requireable<string>;
|
|
6
|
-
const data: PropTypes.Validator<object>;
|
|
7
|
-
const selectProps: PropTypes.Validator<object>;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
@@ -10,15 +10,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import React, { useContext } from 'react';
|
|
13
|
-
import PropTypes from 'prop-types';
|
|
14
13
|
import classnames from 'classnames';
|
|
15
14
|
import i18n from 'ui-i18n';
|
|
16
15
|
import { getLabel, isTempUri } from '@reltio/mdm-sdk';
|
|
17
16
|
import Typography from '@mui/material/Typography';
|
|
18
17
|
import { ViewIdContext, UrlGeneratorsContext, useMdmUiPath, useMdmAction } from '../../../../../contexts';
|
|
19
18
|
import { useSingleValueStyles } from './styles';
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
import { isControlOrCommandPressed } from '../../../../../core';
|
|
20
|
+
var SingleValue = function (_a) {
|
|
21
|
+
var _b = _a.selectProps, currentEntityType = _b.currentEntityType, menuIsOpen = _b.menuIsOpen, disableLinkClick = _b.disableLinkClick, children = _a.children, data = _a.data;
|
|
22
22
|
var styles = useSingleValueStyles();
|
|
23
23
|
var openEntity = useMdmAction('openEntity');
|
|
24
24
|
var uiPath = useMdmUiPath();
|
|
@@ -26,8 +26,15 @@ var SingleValue = function (props) {
|
|
|
26
26
|
var generateEntityUrl = useContext(UrlGeneratorsContext).generateEntityUrl;
|
|
27
27
|
var handleOnMouseDown = function (event) {
|
|
28
28
|
event.stopPropagation();
|
|
29
|
-
|
|
29
|
+
};
|
|
30
|
+
var handleClick = function (event) {
|
|
31
|
+
event.stopPropagation();
|
|
32
|
+
if (disableLinkClick) {
|
|
33
|
+
event.preventDefault();
|
|
34
|
+
}
|
|
35
|
+
else if (!isControlOrCommandPressed(event)) {
|
|
30
36
|
openEntity({ uri: data.entityUri, viewId: viewId });
|
|
37
|
+
event.preventDefault();
|
|
31
38
|
}
|
|
32
39
|
};
|
|
33
40
|
var valueProps = isTempUri(data.entityUri)
|
|
@@ -38,7 +45,7 @@ var SingleValue = function (props) {
|
|
|
38
45
|
: {
|
|
39
46
|
className: classnames(styles.singleValue, styles.linkValue),
|
|
40
47
|
onMouseDown: handleOnMouseDown,
|
|
41
|
-
onClick:
|
|
48
|
+
onClick: handleClick,
|
|
42
49
|
href: generateEntityUrl({ uiPath: uiPath, uri: data.entityUri }),
|
|
43
50
|
component: 'a'
|
|
44
51
|
};
|
|
@@ -46,9 +53,4 @@ var SingleValue = function (props) {
|
|
|
46
53
|
? i18n.text("New ".concat(currentEntityType.label, " will be created"))
|
|
47
54
|
: getLabel(children))));
|
|
48
55
|
};
|
|
49
|
-
SingleValue.propTypes = {
|
|
50
|
-
children: PropTypes.string,
|
|
51
|
-
data: PropTypes.object.isRequired,
|
|
52
|
-
selectProps: PropTypes.object.isRequired
|
|
53
|
-
};
|
|
54
56
|
export default SingleValue;
|
|
@@ -61,6 +61,7 @@ export { AttributesErrorsPanel } from './AttributesErrorsPanel/AttributesErrorsP
|
|
|
61
61
|
export { default as ErrorPopup } from './ErrorPopup/ErrorPopup';
|
|
62
62
|
export { default as ErrorWrapper } from './ErrorWrapper/ErrorWrapper';
|
|
63
63
|
export { default as ExpandedValueTooltip } from './ExpandedValueTooltip/ExpandedValueTooltip';
|
|
64
|
+
export { default as ExternalInvalidRelations } from './ExternalInvalidRelations/ExternalInvalidRelations';
|
|
64
65
|
export { default as FacetViewHeader } from './FacetViewHeader/FacetViewHeader';
|
|
65
66
|
export { default as FlipCard } from './FlipCard/FlipCard';
|
|
66
67
|
export { default as HideOnShrink } from './HideOnShrink/HideOnShrink';
|
package/esm/components/index.js
CHANGED
|
@@ -61,6 +61,7 @@ export { AttributesErrorsPanel } from './AttributesErrorsPanel/AttributesErrorsP
|
|
|
61
61
|
export { default as ErrorPopup } from './ErrorPopup/ErrorPopup';
|
|
62
62
|
export { default as ErrorWrapper } from './ErrorWrapper/ErrorWrapper';
|
|
63
63
|
export { default as ExpandedValueTooltip } from './ExpandedValueTooltip/ExpandedValueTooltip';
|
|
64
|
+
export { default as ExternalInvalidRelations } from './ExternalInvalidRelations/ExternalInvalidRelations';
|
|
64
65
|
export { default as FacetViewHeader } from './FacetViewHeader/FacetViewHeader';
|
|
65
66
|
export { default as FlipCard } from './FlipCard/FlipCard';
|
|
66
67
|
export { default as HideOnShrink } from './HideOnShrink/HideOnShrink';
|
|
@@ -111,7 +111,7 @@ export type MdmModuleActionsContextProps = Partial<{
|
|
|
111
111
|
}) => void;
|
|
112
112
|
lookupsListResolved: (payload: Lookups[]) => void;
|
|
113
113
|
relationsLoaded: (payload: RelationsLoadedPayload) => void;
|
|
114
|
-
setInitialInfo: (id: string, relationUri: string, tempEntity: Entity
|
|
114
|
+
setInitialInfo: (id: string, relationUri: string, tempEntity: Entity) => void;
|
|
115
115
|
setRelationType: (id: string, relationUri: string, relationType: CompactRelationType) => void;
|
|
116
116
|
closeRelationEditor: (id: string, relationUri: string) => void;
|
|
117
117
|
openRelationEditor: (id: string, connection: Connection) => void;
|
|
@@ -183,7 +183,7 @@ export declare const MdmModuleActionsContext: import("@fluentui/react-context-se
|
|
|
183
183
|
}) => void;
|
|
184
184
|
lookupsListResolved: (payload: Lookups[]) => void;
|
|
185
185
|
relationsLoaded: (payload: RelationsLoadedPayload) => void;
|
|
186
|
-
setInitialInfo: (id: string, relationUri: string, tempEntity: Entity
|
|
186
|
+
setInitialInfo: (id: string, relationUri: string, tempEntity: Entity) => void;
|
|
187
187
|
setRelationType: (id: string, relationUri: string, relationType: CompactRelationType) => void;
|
|
188
188
|
closeRelationEditor: (id: string, relationUri: string) => void;
|
|
189
189
|
openRelationEditor: (id: string, connection: Connection) => void;
|
|
@@ -128,7 +128,7 @@ export declare const useMdmAction: <T extends "openSearch" | "openHistoryEvent"
|
|
|
128
128
|
}) => void;
|
|
129
129
|
lookupsListResolved: (payload: import("@reltio/mdm-sdk").Lookups[]) => void;
|
|
130
130
|
relationsLoaded: (payload: import("@reltio/mdm-sdk").RelationsLoadedPayload) => void;
|
|
131
|
-
setInitialInfo: (id: string, relationUri: string, tempEntity: import("@reltio/mdm-sdk").Entity
|
|
131
|
+
setInitialInfo: (id: string, relationUri: string, tempEntity: import("@reltio/mdm-sdk").Entity) => void;
|
|
132
132
|
setRelationType: (id: string, relationUri: string, relationType: import("@reltio/mdm-sdk").CompactRelationType) => void;
|
|
133
133
|
closeRelationEditor: (id: string, relationUri: string) => void;
|
|
134
134
|
openRelationEditor: (id: string, connection: import("@reltio/mdm-sdk").Connection) => void;
|
package/esm/core/utils.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export function getValue(e: any): any;
|
|
2
|
-
export function getChecked(e: any): any;
|
|
3
|
-
export function stopPropagation(e: any): any;
|
|
4
|
-
export function noop(): void;
|
|
5
|
-
export function EmptyStub(): any;
|
|
6
|
-
export function mergeClasses(classes: any, other: any): any;
|
|
7
|
-
export function isIE(): any;
|
|
8
1
|
export function createStandardAction(type: any): (payload: any) => {
|
|
9
2
|
type: any;
|
|
10
3
|
payload: any;
|
|
11
4
|
};
|
|
12
|
-
export function
|
|
5
|
+
export function EmptyStub(): any;
|
|
6
|
+
export function getChecked(e: any): any;
|
|
7
|
+
export function isControlOrCommandPressed(e: any): any;
|
|
8
|
+
export function getValue(e: any): any;
|
|
9
|
+
export function isIE(): any;
|
|
10
|
+
export function mergeClasses(classes: any, other: any): any;
|
|
11
|
+
export function noop(): void;
|
|
13
12
|
export function parseJSON(value: any): any;
|
|
13
|
+
export function stopPropagation(e: any): any;
|
|
14
|
+
export function toggleSortOrder(order: any): "asc" | "desc";
|
package/esm/core/utils.js
CHANGED
|
@@ -14,6 +14,7 @@ import classNames from 'classnames';
|
|
|
14
14
|
var getValue = function (e) { return e.target.value; };
|
|
15
15
|
var getChecked = function (e) { return e.target.checked; };
|
|
16
16
|
var stopPropagation = function (e) { return e.stopPropagation(); };
|
|
17
|
+
var isControlOrCommandPressed = function (e) { return e.ctrlKey || e.metaKey; };
|
|
17
18
|
var noop = function () { };
|
|
18
19
|
var EmptyStub = function () { return null; };
|
|
19
20
|
var mergeClasses = function (classes, other) {
|
|
@@ -36,4 +37,4 @@ var parseJSON = function (value) {
|
|
|
36
37
|
return undefined;
|
|
37
38
|
}
|
|
38
39
|
};
|
|
39
|
-
export {
|
|
40
|
+
export { createStandardAction, EmptyStub, getChecked, isControlOrCommandPressed, getValue, isIE, mergeClasses, noop, parseJSON, stopPropagation, toggleSortOrder };
|
|
@@ -7,23 +7,10 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
7
7
|
}
|
|
8
8
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
10
|
+
import { eqBy, path, reject } from 'ramda';
|
|
11
11
|
import { useEffect, useMemo, useRef } from 'react';
|
|
12
|
-
import {
|
|
12
|
+
import { isEditableMode, getInvalidConnections, markEdited, markNew } from '@reltio/mdm-sdk';
|
|
13
13
|
import { useActionsHook, useMdmAction, useMdmAllRelationsToAddAndEdit, useMdmMode, useMdmProfileErrors, useMdmRelationsDrafts, useMdmListener } from '../contexts';
|
|
14
|
-
var isConnectionHasError = curry(function (errors, connection) {
|
|
15
|
-
var relationUri = path(['relation', 'relationUri'], connection);
|
|
16
|
-
return errors.some(function (error) {
|
|
17
|
-
return areOneHierarchyUris(prop('uri', error), relationUri) ||
|
|
18
|
-
areOneHierarchyUris(prop('parentUri', error), relationUri) ||
|
|
19
|
-
(error.path || []).some(function (errorPath) { return path(['value', 'relation', 'relationUri'], errorPath) === relationUri; });
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
var getInvalidConnections = function (errors, connections) {
|
|
23
|
-
if (errors === void 0) { errors = []; }
|
|
24
|
-
if (connections === void 0) { connections = []; }
|
|
25
|
-
return filter(isConnectionHasError(errors), connections);
|
|
26
|
-
};
|
|
27
14
|
export var useExpandInvalidRelations = function (configId) {
|
|
28
15
|
var openRelationEditor = useMdmAction('openRelationEditor');
|
|
29
16
|
var mode = useMdmMode();
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1724",
|
|
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
|
"@fluentui/react-context-selector": "^9.1.26",
|
|
9
9
|
"@react-google-maps/api": "2.7.0",
|
|
10
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
10
|
+
"@reltio/mdm-sdk": "^1.4.1713",
|
|
11
11
|
"classnames": "^2.2.5",
|
|
12
12
|
"d3-cloud": "^1.2.5",
|
|
13
13
|
"d3-geo": "^2.0.1",
|