@reltio/components 1.4.1526 → 1.4.1528
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/MatchRulesBlock/MatchRulesBlock.js +2 -2
- package/cjs/components/MatchRulesBlock/SimpleMatchRules/SimpleMatchRules.d.ts +3 -1
- package/cjs/components/MatchRulesBlock/SimpleMatchRules/SimpleMatchRules.js +14 -4
- package/cjs/components/MatchRulesBlock/SimpleMatchRules/styles.d.ts +1 -1
- package/cjs/components/MatchRulesBlock/SimpleMatchRules/styles.js +12 -0
- package/cjs/components/MatchRulesBlock/SimpleMatchRulesBlock/SimpleMatchRulesBlock.d.ts +3 -1
- package/cjs/components/MatchRulesBlock/SimpleMatchRulesBlock/SimpleMatchRulesBlock.js +3 -3
- package/cjs/components/MatchRulesBlock/SimpleMatchRulesBlock/styles.js +2 -1
- package/cjs/components/MatchRulesBlock/SimpleMatchRulesBuilder/SimpleMatchRulesBuilder.d.ts +2 -0
- package/cjs/components/MatchRulesBlock/TransitiveMatchBlock/TransitiveMatchBlock.d.ts +3 -1
- package/cjs/components/MatchRulesBlock/TransitiveMatchBlock/TransitiveMatchBlock.js +2 -2
- package/cjs/components/MatchRulesBlock/TransitiveMatchRules/TransitiveMatchRule.d.ts +3 -1
- package/cjs/components/MatchRulesBlock/TransitiveMatchRules/TransitiveMatchRule.js +2 -2
- package/cjs/components/SidePanel/SidePanel.js +1 -1
- package/esm/components/MatchRulesBlock/MatchRulesBlock.js +2 -2
- package/esm/components/MatchRulesBlock/SimpleMatchRules/SimpleMatchRules.d.ts +3 -1
- package/esm/components/MatchRulesBlock/SimpleMatchRules/SimpleMatchRules.js +14 -4
- package/esm/components/MatchRulesBlock/SimpleMatchRules/styles.d.ts +1 -1
- package/esm/components/MatchRulesBlock/SimpleMatchRules/styles.js +12 -0
- package/esm/components/MatchRulesBlock/SimpleMatchRulesBlock/SimpleMatchRulesBlock.d.ts +3 -1
- package/esm/components/MatchRulesBlock/SimpleMatchRulesBlock/SimpleMatchRulesBlock.js +3 -3
- package/esm/components/MatchRulesBlock/SimpleMatchRulesBlock/styles.js +2 -1
- package/esm/components/MatchRulesBlock/SimpleMatchRulesBuilder/SimpleMatchRulesBuilder.d.ts +2 -0
- package/esm/components/MatchRulesBlock/TransitiveMatchBlock/TransitiveMatchBlock.d.ts +3 -1
- package/esm/components/MatchRulesBlock/TransitiveMatchBlock/TransitiveMatchBlock.js +2 -2
- package/esm/components/MatchRulesBlock/TransitiveMatchRules/TransitiveMatchRule.d.ts +3 -1
- package/esm/components/MatchRulesBlock/TransitiveMatchRules/TransitiveMatchRule.js +2 -2
- package/esm/components/SidePanel/SidePanel.js +1 -1
- package/package.json +3 -3
|
@@ -25,8 +25,8 @@ var MatchRulesBlock = function (_a) {
|
|
|
25
25
|
var showSimple = !isTransitive && !hasNotMatch;
|
|
26
26
|
var showNotMatch = hasNotMatch && variant !== types_1.MatchRuleVariant.excludeNotMatch;
|
|
27
27
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
28
|
-
isTransitive ? (react_1.default.createElement(TransitiveMatchBlock_1.default, { transitiveMatchRules: (0, mdm_sdk_1.getTransitiveMatchRules)(metadata, match, entitiesMap) })) : null,
|
|
29
|
-
showSimple ? (react_1.default.createElement(SimpleMatchRulesBuilder_1.default, { variant: variant, matchRules: matchRules, Component: SimpleMatchRulesBlock_1.default })) : null,
|
|
28
|
+
isTransitive ? (react_1.default.createElement(TransitiveMatchBlock_1.default, { transitiveMatchRules: (0, mdm_sdk_1.getTransitiveMatchRules)(metadata, match, entitiesMap), matchRuleSummaries: match.matchRuleSummaries })) : null,
|
|
29
|
+
showSimple ? (react_1.default.createElement(SimpleMatchRulesBuilder_1.default, { variant: variant, matchRules: matchRules, matchRuleSummaries: match.matchRuleSummaries, Component: SimpleMatchRulesBlock_1.default })) : null,
|
|
30
30
|
showNotMatch ? react_1.default.createElement(NotMatchRule_1.default, null) : null));
|
|
31
31
|
};
|
|
32
32
|
exports.default = MatchRulesBlock;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { MatchRuleSummary } from '@reltio/mdm-sdk';
|
|
2
3
|
import { MatchRules } from '../types';
|
|
3
4
|
declare type Props = {
|
|
4
5
|
isMlMatch?: boolean;
|
|
5
6
|
matchRules: MatchRules;
|
|
6
7
|
className?: string;
|
|
8
|
+
matchRuleSummaries?: MatchRuleSummary[];
|
|
7
9
|
};
|
|
8
|
-
declare const SimpleMatchRules: ({ isMlMatch, matchRules, className }: Props) => JSX.Element;
|
|
10
|
+
declare const SimpleMatchRules: ({ isMlMatch, matchRules, className, matchRuleSummaries }: Props) => JSX.Element;
|
|
9
11
|
export default SimpleMatchRules;
|
|
@@ -5,17 +5,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
var react_1 = __importDefault(require("react"));
|
|
7
7
|
var classnames_1 = __importDefault(require("classnames"));
|
|
8
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
9
|
+
var Tooltip_1 = __importDefault(require("@material-ui/core/Tooltip"));
|
|
10
|
+
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
8
11
|
var MatchRulesTitle_1 = __importDefault(require("../MatchRulesTitle"));
|
|
9
12
|
var styles_1 = __importDefault(require("./styles"));
|
|
10
13
|
var NegativeRuleIcon_1 = __importDefault(require("../../../icons/NegativeRuleIcon"));
|
|
11
14
|
var SimpleMatchRules = function (_a) {
|
|
12
|
-
var isMlMatch = _a.isMlMatch, matchRules = _a.matchRules, className = _a.className;
|
|
15
|
+
var isMlMatch = _a.isMlMatch, matchRules = _a.matchRules, className = _a.className, matchRuleSummaries = _a.matchRuleSummaries;
|
|
13
16
|
var styles = (0, styles_1.default)();
|
|
14
17
|
return (react_1.default.createElement("div", { "data-reltio-id": "simple-match-rules", className: (0, classnames_1.default)(styles.container, className) },
|
|
15
18
|
react_1.default.createElement("div", { className: styles.title },
|
|
16
19
|
react_1.default.createElement(MatchRulesTitle_1.default, { isMlMatch: isMlMatch })),
|
|
17
|
-
react_1.default.createElement("div", { className: styles.labelsContainer }, matchRules.map(function (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
react_1.default.createElement("div", { className: styles.labelsContainer }, matchRules.map(function (matchRule) {
|
|
21
|
+
var matchRuleSummary = (0, mdm_sdk_1.getMatchRuleSummary)(matchRuleSummaries, matchRule.uri);
|
|
22
|
+
var relevancePercentage = (0, mdm_sdk_1.formatRelevanceScore)(matchRuleSummary);
|
|
23
|
+
return (react_1.default.createElement("div", { className: styles.matchRuleInfo, key: matchRule.uri, "data-reltio-id": "match-rule-info" },
|
|
24
|
+
react_1.default.createElement("div", { className: styles.matchRuleLabel },
|
|
25
|
+
'- ',
|
|
26
|
+
matchRule.negativeRule && react_1.default.createElement(NegativeRuleIcon_1.default, { className: styles.negativeRuleIcon }), "".concat(matchRule.label)),
|
|
27
|
+
relevancePercentage && (react_1.default.createElement(Tooltip_1.default, { title: ui_i18n_1.default.text('Relevance score') },
|
|
28
|
+
react_1.default.createElement("div", { className: styles.relevanceScore }, relevancePercentage)))));
|
|
29
|
+
}))));
|
|
20
30
|
};
|
|
21
31
|
exports.default = SimpleMatchRules;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const styles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"title" | "container" | "negativeRuleIcon" | "labelsContainer">;
|
|
1
|
+
declare const styles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"title" | "container" | "negativeRuleIcon" | "labelsContainer" | "matchRuleInfo" | "matchRuleLabel" | "relevanceScore">;
|
|
2
2
|
export default styles;
|
|
@@ -18,6 +18,18 @@ var styles = (0, styles_1.makeStyles)(function (theme) { return ({
|
|
|
18
18
|
position: 'relative',
|
|
19
19
|
marginRight: '4px',
|
|
20
20
|
top: '1px'
|
|
21
|
+
},
|
|
22
|
+
matchRuleInfo: {
|
|
23
|
+
display: 'flex',
|
|
24
|
+
alignItems: 'flex-start',
|
|
25
|
+
justifyContent: 'space-between'
|
|
26
|
+
},
|
|
27
|
+
matchRuleLabel: {
|
|
28
|
+
wordBreak: 'break-word'
|
|
29
|
+
},
|
|
30
|
+
relevanceScore: {
|
|
31
|
+
marginLeft: '8px',
|
|
32
|
+
color: theme.palette.text.secondary
|
|
21
33
|
}
|
|
22
34
|
}); });
|
|
23
35
|
exports.default = styles;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { MatchRuleSummary } from '@reltio/mdm-sdk';
|
|
2
3
|
import { MatchRules } from '../types';
|
|
3
4
|
export declare const MatchRuleBadgeWithTooltip: React.ForwardRefExoticComponent<import("prop-types").InferPropsInner<Pick<{
|
|
4
5
|
tooltipTitle: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
@@ -15,6 +16,7 @@ export declare const MatchRuleBadgeWithTooltip: React.ForwardRefExoticComponent<
|
|
|
15
16
|
declare type Props = {
|
|
16
17
|
isMlMatch?: boolean;
|
|
17
18
|
matchRules: MatchRules;
|
|
19
|
+
matchRuleSummaries?: MatchRuleSummary[];
|
|
18
20
|
};
|
|
19
|
-
declare const SimpleMatchRulesBlock: ({ isMlMatch, matchRules }: Props) => JSX.Element;
|
|
21
|
+
declare const SimpleMatchRulesBlock: ({ isMlMatch, matchRules, matchRuleSummaries }: Props) => JSX.Element;
|
|
20
22
|
export default SimpleMatchRulesBlock;
|
|
@@ -37,14 +37,14 @@ var MlMatch_1 = __importDefault(require("../../../icons/MlMatch"));
|
|
|
37
37
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
38
38
|
exports.MatchRuleBadgeWithTooltip = (0, HOCs_1.withTooltip)(MatchRulesBadge_1.default);
|
|
39
39
|
var SimpleMatchRulesBlock = function (_a) {
|
|
40
|
-
var _b = _a.isMlMatch, isMlMatch = _b === void 0 ? false : _b, matchRules = _a.matchRules;
|
|
40
|
+
var _b = _a.isMlMatch, isMlMatch = _b === void 0 ? false : _b, matchRules = _a.matchRules, matchRuleSummaries = _a.matchRuleSummaries;
|
|
41
41
|
var styles = (0, styles_1.default)();
|
|
42
42
|
var _c = (0, react_1.useState)(false), expanded = _c[0], setExpanded = _c[1];
|
|
43
43
|
var handleOnExpand = (0, react_1.useCallback)(function () { return setExpanded(function (expand) { return !expand; }); }, []);
|
|
44
|
-
return (react_1.default.createElement("div", { className: styles.container },
|
|
44
|
+
return (react_1.default.createElement("div", { className: styles.container, "data-reltio-id": "simple-match-rules-block" },
|
|
45
45
|
react_1.default.createElement(exports.MatchRuleBadgeWithTooltip, { tooltipTitle: react_1.default.createElement(MatchRulesTooltip_1.default, { matchRules: matchRules, isMlMatch: isMlMatch }), tooltipPlacement: "bottom-start", onExpand: handleOnExpand, expanded: expanded }, isMlMatch ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
46
46
|
react_1.default.createElement(MlMatch_1.default, { className: styles.icon }),
|
|
47
47
|
ui_i18n_1.default.text('Match IQ'))) : (ui_i18n_1.default.text('Rules'))),
|
|
48
|
-
expanded ? (react_1.default.createElement(SimpleMatchRules_1.default, { className: styles.rulesContainer, matchRules: matchRules, isMlMatch: isMlMatch })) : null));
|
|
48
|
+
expanded ? (react_1.default.createElement(SimpleMatchRules_1.default, { className: styles.rulesContainer, matchRules: matchRules, isMlMatch: isMlMatch, matchRuleSummaries: matchRuleSummaries })) : null));
|
|
49
49
|
};
|
|
50
50
|
exports.default = SimpleMatchRulesBlock;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { MatchRuleSummary } from '@reltio/mdm-sdk';
|
|
3
4
|
import { MatchRules, MatchRuleVariant } from '../types';
|
|
4
5
|
declare type Props = {
|
|
5
6
|
matchRules: MatchRules;
|
|
6
7
|
Component: React.ElementType;
|
|
7
8
|
className?: string;
|
|
8
9
|
variant?: MatchRuleVariant;
|
|
10
|
+
matchRuleSummaries?: MatchRuleSummary[];
|
|
9
11
|
};
|
|
10
12
|
declare const SimpleMatchRulesBuilder: {
|
|
11
13
|
({ matchRules, Component, variant, ...otherProps }: Props): JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { MatchRuleSummary } from '@reltio/mdm-sdk';
|
|
2
3
|
import { TransitiveMatchRules } from '../types';
|
|
3
4
|
export declare const MatchRuleBadgeWithTooltip: React.ForwardRefExoticComponent<import("prop-types").InferPropsInner<Pick<{
|
|
4
5
|
tooltipTitle: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
@@ -14,6 +15,7 @@ export declare const MatchRuleBadgeWithTooltip: React.ForwardRefExoticComponent<
|
|
|
14
15
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
15
16
|
declare type Props = {
|
|
16
17
|
transitiveMatchRules: TransitiveMatchRules;
|
|
18
|
+
matchRuleSummaries?: MatchRuleSummary[];
|
|
17
19
|
};
|
|
18
|
-
declare const TransitiveMatchBlock: ({ transitiveMatchRules }: Props) => JSX.Element;
|
|
20
|
+
declare const TransitiveMatchBlock: ({ transitiveMatchRules, matchRuleSummaries }: Props) => JSX.Element;
|
|
19
21
|
export default TransitiveMatchBlock;
|
|
@@ -47,7 +47,7 @@ var HOCs_1 = require("../../../HOCs");
|
|
|
47
47
|
var TransitiveMatchRulesTooltip_1 = __importDefault(require("../TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip"));
|
|
48
48
|
exports.MatchRuleBadgeWithTooltip = (0, HOCs_1.withTooltip)(MatchRulesBadge_1.default);
|
|
49
49
|
var TransitiveMatchBlock = function (_a) {
|
|
50
|
-
var transitiveMatchRules = _a.transitiveMatchRules;
|
|
50
|
+
var transitiveMatchRules = _a.transitiveMatchRules, matchRuleSummaries = _a.matchRuleSummaries;
|
|
51
51
|
var styles = (0, styles_1.default)();
|
|
52
52
|
var _b = (0, react_1.useState)(false), expanded = _b[0], setExpanded = _b[1];
|
|
53
53
|
var handleOnExpand = (0, react_1.useCallback)(function () { return setExpanded(function (expand) { return !expand; }); }, []);
|
|
@@ -55,7 +55,7 @@ var TransitiveMatchBlock = function (_a) {
|
|
|
55
55
|
react_1.default.createElement(exports.MatchRuleBadgeWithTooltip, { tooltipTitle: react_1.default.createElement(TransitiveMatchRulesTooltip_1.default, { transitiveMatchRules: transitiveMatchRules }), tooltipPlacement: "bottom-start", onExpand: handleOnExpand, expanded: expanded }, ui_i18n_1.default.text('Transitive matches')),
|
|
56
56
|
expanded
|
|
57
57
|
? transitiveMatchRules.map(function (match, index) {
|
|
58
|
-
return react_1.default.createElement(TransitiveMatchRule_1.default, __assign({ key: index }, match));
|
|
58
|
+
return react_1.default.createElement(TransitiveMatchRule_1.default, __assign({ key: index }, match, { matchRuleSummaries: matchRuleSummaries }));
|
|
59
59
|
})
|
|
60
60
|
: null));
|
|
61
61
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { MatchRuleSummary } from '@reltio/mdm-sdk';
|
|
2
3
|
import { MatchRules } from '../types';
|
|
3
4
|
declare type Props = {
|
|
4
5
|
label: string;
|
|
5
6
|
matchRules: MatchRules;
|
|
7
|
+
matchRuleSummaries?: MatchRuleSummary[];
|
|
6
8
|
};
|
|
7
|
-
declare const TransitiveMatchRule: ({ label, matchRules }: Props) => JSX.Element;
|
|
9
|
+
declare const TransitiveMatchRule: ({ label, matchRules, matchRuleSummaries }: Props) => JSX.Element;
|
|
8
10
|
export default TransitiveMatchRule;
|
|
@@ -32,7 +32,7 @@ var SimpleMatchRules_1 = __importDefault(require("../SimpleMatchRules/SimpleMatc
|
|
|
32
32
|
var SimpleMatchRulesBuilder_1 = __importDefault(require("../SimpleMatchRulesBuilder/SimpleMatchRulesBuilder"));
|
|
33
33
|
var styles_1 = __importDefault(require("./styles"));
|
|
34
34
|
var TransitiveMatchRule = function (_a) {
|
|
35
|
-
var label = _a.label, matchRules = _a.matchRules;
|
|
35
|
+
var label = _a.label, matchRules = _a.matchRules, matchRuleSummaries = _a.matchRuleSummaries;
|
|
36
36
|
var styles = (0, styles_1.default)();
|
|
37
37
|
var _b = (0, react_1.useState)(false), expanded = _b[0], setExpanded = _b[1];
|
|
38
38
|
var handleOnExpand = (0, react_1.useCallback)(function () { return setExpanded(function (expand) { return !expand; }); }, []);
|
|
@@ -40,6 +40,6 @@ var TransitiveMatchRule = function (_a) {
|
|
|
40
40
|
react_1.default.createElement("div", { onClick: handleOnExpand, className: styles.badge },
|
|
41
41
|
react_1.default.createElement(ArrowExpandButton_1.default, { expanded: expanded }),
|
|
42
42
|
react_1.default.createElement("div", { className: styles.label }, label)),
|
|
43
|
-
expanded ? (react_1.default.createElement(SimpleMatchRulesBuilder_1.default, { Component: SimpleMatchRules_1.default, matchRules: matchRules, className: styles.matchLabels })) : null));
|
|
43
|
+
expanded ? (react_1.default.createElement(SimpleMatchRulesBuilder_1.default, { Component: SimpleMatchRules_1.default, matchRules: matchRules, matchRuleSummaries: matchRuleSummaries, className: styles.matchLabels })) : null));
|
|
44
44
|
};
|
|
45
45
|
exports.default = TransitiveMatchRule;
|
|
@@ -9,7 +9,7 @@ var styles_1 = require("./styles");
|
|
|
9
9
|
var SidePanel = function (_a) {
|
|
10
10
|
var width = _a.width, open = _a.open, children = _a.children;
|
|
11
11
|
var styles = (0, styles_1.useStyles)();
|
|
12
|
-
return (react_1.default.createElement("div", { className: styles.contentWrapper, style: {
|
|
12
|
+
return (react_1.default.createElement("div", { className: styles.contentWrapper, "data-reltio-id": "side-panel", style: {
|
|
13
13
|
width: width ? "".concat(open ? width : 0, "px") : '100%'
|
|
14
14
|
} }, open && react_1.default.createElement(react_1.default.Fragment, null, children)));
|
|
15
15
|
};
|
|
@@ -20,8 +20,8 @@ var MatchRulesBlock = function (_a) {
|
|
|
20
20
|
var showSimple = !isTransitive && !hasNotMatch;
|
|
21
21
|
var showNotMatch = hasNotMatch && variant !== MatchRuleVariant.excludeNotMatch;
|
|
22
22
|
return (React.createElement(React.Fragment, null,
|
|
23
|
-
isTransitive ? (React.createElement(TransitiveMatchBlock, { transitiveMatchRules: getTransitiveMatchRules(metadata, match, entitiesMap) })) : null,
|
|
24
|
-
showSimple ? (React.createElement(SimpleMatchRulesBuilder, { variant: variant, matchRules: matchRules, Component: SimpleMatchRulesBlock })) : null,
|
|
23
|
+
isTransitive ? (React.createElement(TransitiveMatchBlock, { transitiveMatchRules: getTransitiveMatchRules(metadata, match, entitiesMap), matchRuleSummaries: match.matchRuleSummaries })) : null,
|
|
24
|
+
showSimple ? (React.createElement(SimpleMatchRulesBuilder, { variant: variant, matchRules: matchRules, matchRuleSummaries: match.matchRuleSummaries, Component: SimpleMatchRulesBlock })) : null,
|
|
25
25
|
showNotMatch ? React.createElement(NotMatchRule, null) : null));
|
|
26
26
|
};
|
|
27
27
|
export default MatchRulesBlock;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { MatchRuleSummary } from '@reltio/mdm-sdk';
|
|
2
3
|
import { MatchRules } from '../types';
|
|
3
4
|
declare type Props = {
|
|
4
5
|
isMlMatch?: boolean;
|
|
5
6
|
matchRules: MatchRules;
|
|
6
7
|
className?: string;
|
|
8
|
+
matchRuleSummaries?: MatchRuleSummary[];
|
|
7
9
|
};
|
|
8
|
-
declare const SimpleMatchRules: ({ isMlMatch, matchRules, className }: Props) => JSX.Element;
|
|
10
|
+
declare const SimpleMatchRules: ({ isMlMatch, matchRules, className, matchRuleSummaries }: Props) => JSX.Element;
|
|
9
11
|
export default SimpleMatchRules;
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
|
+
import { getMatchRuleSummary, formatRelevanceScore } from '@reltio/mdm-sdk';
|
|
4
|
+
import Tooltip from '@material-ui/core/Tooltip';
|
|
5
|
+
import i18n from 'ui-i18n';
|
|
3
6
|
import MatchRulesTitle from '../MatchRulesTitle';
|
|
4
7
|
import useStyles from './styles';
|
|
5
8
|
import NegativeRuleIcon from '../../../icons/NegativeRuleIcon';
|
|
6
9
|
var SimpleMatchRules = function (_a) {
|
|
7
|
-
var isMlMatch = _a.isMlMatch, matchRules = _a.matchRules, className = _a.className;
|
|
10
|
+
var isMlMatch = _a.isMlMatch, matchRules = _a.matchRules, className = _a.className, matchRuleSummaries = _a.matchRuleSummaries;
|
|
8
11
|
var styles = useStyles();
|
|
9
12
|
return (React.createElement("div", { "data-reltio-id": "simple-match-rules", className: classnames(styles.container, className) },
|
|
10
13
|
React.createElement("div", { className: styles.title },
|
|
11
14
|
React.createElement(MatchRulesTitle, { isMlMatch: isMlMatch })),
|
|
12
|
-
React.createElement("div", { className: styles.labelsContainer }, matchRules.map(function (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
React.createElement("div", { className: styles.labelsContainer }, matchRules.map(function (matchRule) {
|
|
16
|
+
var matchRuleSummary = getMatchRuleSummary(matchRuleSummaries, matchRule.uri);
|
|
17
|
+
var relevancePercentage = formatRelevanceScore(matchRuleSummary);
|
|
18
|
+
return (React.createElement("div", { className: styles.matchRuleInfo, key: matchRule.uri, "data-reltio-id": "match-rule-info" },
|
|
19
|
+
React.createElement("div", { className: styles.matchRuleLabel },
|
|
20
|
+
'- ',
|
|
21
|
+
matchRule.negativeRule && React.createElement(NegativeRuleIcon, { className: styles.negativeRuleIcon }), "".concat(matchRule.label)),
|
|
22
|
+
relevancePercentage && (React.createElement(Tooltip, { title: i18n.text('Relevance score') },
|
|
23
|
+
React.createElement("div", { className: styles.relevanceScore }, relevancePercentage)))));
|
|
24
|
+
}))));
|
|
15
25
|
};
|
|
16
26
|
export default SimpleMatchRules;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const styles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"title" | "container" | "negativeRuleIcon" | "labelsContainer">;
|
|
1
|
+
declare const styles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"title" | "container" | "negativeRuleIcon" | "labelsContainer" | "matchRuleInfo" | "matchRuleLabel" | "relevanceScore">;
|
|
2
2
|
export default styles;
|
|
@@ -16,6 +16,18 @@ var styles = makeStyles(function (theme) { return ({
|
|
|
16
16
|
position: 'relative',
|
|
17
17
|
marginRight: '4px',
|
|
18
18
|
top: '1px'
|
|
19
|
+
},
|
|
20
|
+
matchRuleInfo: {
|
|
21
|
+
display: 'flex',
|
|
22
|
+
alignItems: 'flex-start',
|
|
23
|
+
justifyContent: 'space-between'
|
|
24
|
+
},
|
|
25
|
+
matchRuleLabel: {
|
|
26
|
+
wordBreak: 'break-word'
|
|
27
|
+
},
|
|
28
|
+
relevanceScore: {
|
|
29
|
+
marginLeft: '8px',
|
|
30
|
+
color: theme.palette.text.secondary
|
|
19
31
|
}
|
|
20
32
|
}); });
|
|
21
33
|
export default styles;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { MatchRuleSummary } from '@reltio/mdm-sdk';
|
|
2
3
|
import { MatchRules } from '../types';
|
|
3
4
|
export declare const MatchRuleBadgeWithTooltip: React.ForwardRefExoticComponent<import("prop-types").InferPropsInner<Pick<{
|
|
4
5
|
tooltipTitle: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
@@ -15,6 +16,7 @@ export declare const MatchRuleBadgeWithTooltip: React.ForwardRefExoticComponent<
|
|
|
15
16
|
declare type Props = {
|
|
16
17
|
isMlMatch?: boolean;
|
|
17
18
|
matchRules: MatchRules;
|
|
19
|
+
matchRuleSummaries?: MatchRuleSummary[];
|
|
18
20
|
};
|
|
19
|
-
declare const SimpleMatchRulesBlock: ({ isMlMatch, matchRules }: Props) => JSX.Element;
|
|
21
|
+
declare const SimpleMatchRulesBlock: ({ isMlMatch, matchRules, matchRuleSummaries }: Props) => JSX.Element;
|
|
20
22
|
export default SimpleMatchRulesBlock;
|
|
@@ -8,14 +8,14 @@ import MLMatchIcon from '../../../icons/MlMatch';
|
|
|
8
8
|
import i18n from 'ui-i18n';
|
|
9
9
|
export var MatchRuleBadgeWithTooltip = withTooltip(MatchRulesBadge);
|
|
10
10
|
var SimpleMatchRulesBlock = function (_a) {
|
|
11
|
-
var _b = _a.isMlMatch, isMlMatch = _b === void 0 ? false : _b, matchRules = _a.matchRules;
|
|
11
|
+
var _b = _a.isMlMatch, isMlMatch = _b === void 0 ? false : _b, matchRules = _a.matchRules, matchRuleSummaries = _a.matchRuleSummaries;
|
|
12
12
|
var styles = useStyles();
|
|
13
13
|
var _c = useState(false), expanded = _c[0], setExpanded = _c[1];
|
|
14
14
|
var handleOnExpand = useCallback(function () { return setExpanded(function (expand) { return !expand; }); }, []);
|
|
15
|
-
return (React.createElement("div", { className: styles.container },
|
|
15
|
+
return (React.createElement("div", { className: styles.container, "data-reltio-id": "simple-match-rules-block" },
|
|
16
16
|
React.createElement(MatchRuleBadgeWithTooltip, { tooltipTitle: React.createElement(MatchRulesTooltip, { matchRules: matchRules, isMlMatch: isMlMatch }), tooltipPlacement: "bottom-start", onExpand: handleOnExpand, expanded: expanded }, isMlMatch ? (React.createElement(React.Fragment, null,
|
|
17
17
|
React.createElement(MLMatchIcon, { className: styles.icon }),
|
|
18
18
|
i18n.text('Match IQ'))) : (i18n.text('Rules'))),
|
|
19
|
-
expanded ? (React.createElement(SimpleMatchRules, { className: styles.rulesContainer, matchRules: matchRules, isMlMatch: isMlMatch })) : null));
|
|
19
|
+
expanded ? (React.createElement(SimpleMatchRules, { className: styles.rulesContainer, matchRules: matchRules, isMlMatch: isMlMatch, matchRuleSummaries: matchRuleSummaries })) : null));
|
|
20
20
|
};
|
|
21
21
|
export default SimpleMatchRulesBlock;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { MatchRuleSummary } from '@reltio/mdm-sdk';
|
|
3
4
|
import { MatchRules, MatchRuleVariant } from '../types';
|
|
4
5
|
declare type Props = {
|
|
5
6
|
matchRules: MatchRules;
|
|
6
7
|
Component: React.ElementType;
|
|
7
8
|
className?: string;
|
|
8
9
|
variant?: MatchRuleVariant;
|
|
10
|
+
matchRuleSummaries?: MatchRuleSummary[];
|
|
9
11
|
};
|
|
10
12
|
declare const SimpleMatchRulesBuilder: {
|
|
11
13
|
({ matchRules, Component, variant, ...otherProps }: Props): JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { MatchRuleSummary } from '@reltio/mdm-sdk';
|
|
2
3
|
import { TransitiveMatchRules } from '../types';
|
|
3
4
|
export declare const MatchRuleBadgeWithTooltip: React.ForwardRefExoticComponent<import("prop-types").InferPropsInner<Pick<{
|
|
4
5
|
tooltipTitle: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
@@ -14,6 +15,7 @@ export declare const MatchRuleBadgeWithTooltip: React.ForwardRefExoticComponent<
|
|
|
14
15
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
15
16
|
declare type Props = {
|
|
16
17
|
transitiveMatchRules: TransitiveMatchRules;
|
|
18
|
+
matchRuleSummaries?: MatchRuleSummary[];
|
|
17
19
|
};
|
|
18
|
-
declare const TransitiveMatchBlock: ({ transitiveMatchRules }: Props) => JSX.Element;
|
|
20
|
+
declare const TransitiveMatchBlock: ({ transitiveMatchRules, matchRuleSummaries }: Props) => JSX.Element;
|
|
19
21
|
export default TransitiveMatchBlock;
|
|
@@ -18,7 +18,7 @@ import { withTooltip } from '../../../HOCs';
|
|
|
18
18
|
import TransitiveMatchRulesTooltip from '../TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip';
|
|
19
19
|
export var MatchRuleBadgeWithTooltip = withTooltip(MatchRulesBadge);
|
|
20
20
|
var TransitiveMatchBlock = function (_a) {
|
|
21
|
-
var transitiveMatchRules = _a.transitiveMatchRules;
|
|
21
|
+
var transitiveMatchRules = _a.transitiveMatchRules, matchRuleSummaries = _a.matchRuleSummaries;
|
|
22
22
|
var styles = useStyles();
|
|
23
23
|
var _b = useState(false), expanded = _b[0], setExpanded = _b[1];
|
|
24
24
|
var handleOnExpand = useCallback(function () { return setExpanded(function (expand) { return !expand; }); }, []);
|
|
@@ -26,7 +26,7 @@ var TransitiveMatchBlock = function (_a) {
|
|
|
26
26
|
React.createElement(MatchRuleBadgeWithTooltip, { tooltipTitle: React.createElement(TransitiveMatchRulesTooltip, { transitiveMatchRules: transitiveMatchRules }), tooltipPlacement: "bottom-start", onExpand: handleOnExpand, expanded: expanded }, i18n.text('Transitive matches')),
|
|
27
27
|
expanded
|
|
28
28
|
? transitiveMatchRules.map(function (match, index) {
|
|
29
|
-
return React.createElement(TransitiveMatchRule, __assign({ key: index }, match));
|
|
29
|
+
return React.createElement(TransitiveMatchRule, __assign({ key: index }, match, { matchRuleSummaries: matchRuleSummaries }));
|
|
30
30
|
})
|
|
31
31
|
: null));
|
|
32
32
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { MatchRuleSummary } from '@reltio/mdm-sdk';
|
|
2
3
|
import { MatchRules } from '../types';
|
|
3
4
|
declare type Props = {
|
|
4
5
|
label: string;
|
|
5
6
|
matchRules: MatchRules;
|
|
7
|
+
matchRuleSummaries?: MatchRuleSummary[];
|
|
6
8
|
};
|
|
7
|
-
declare const TransitiveMatchRule: ({ label, matchRules }: Props) => JSX.Element;
|
|
9
|
+
declare const TransitiveMatchRule: ({ label, matchRules, matchRuleSummaries }: Props) => JSX.Element;
|
|
8
10
|
export default TransitiveMatchRule;
|
|
@@ -4,7 +4,7 @@ import SimpleMatchRules from '../SimpleMatchRules/SimpleMatchRules';
|
|
|
4
4
|
import SimpleMatchRulesBuilder from '../SimpleMatchRulesBuilder/SimpleMatchRulesBuilder';
|
|
5
5
|
import useStyles from './styles';
|
|
6
6
|
var TransitiveMatchRule = function (_a) {
|
|
7
|
-
var label = _a.label, matchRules = _a.matchRules;
|
|
7
|
+
var label = _a.label, matchRules = _a.matchRules, matchRuleSummaries = _a.matchRuleSummaries;
|
|
8
8
|
var styles = useStyles();
|
|
9
9
|
var _b = useState(false), expanded = _b[0], setExpanded = _b[1];
|
|
10
10
|
var handleOnExpand = useCallback(function () { return setExpanded(function (expand) { return !expand; }); }, []);
|
|
@@ -12,6 +12,6 @@ var TransitiveMatchRule = function (_a) {
|
|
|
12
12
|
React.createElement("div", { onClick: handleOnExpand, className: styles.badge },
|
|
13
13
|
React.createElement(ArrowExpandButton, { expanded: expanded }),
|
|
14
14
|
React.createElement("div", { className: styles.label }, label)),
|
|
15
|
-
expanded ? (React.createElement(SimpleMatchRulesBuilder, { Component: SimpleMatchRules, matchRules: matchRules, className: styles.matchLabels })) : null));
|
|
15
|
+
expanded ? (React.createElement(SimpleMatchRulesBuilder, { Component: SimpleMatchRules, matchRules: matchRules, matchRuleSummaries: matchRuleSummaries, className: styles.matchLabels })) : null));
|
|
16
16
|
};
|
|
17
17
|
export default TransitiveMatchRule;
|
|
@@ -3,7 +3,7 @@ import { useStyles } from './styles';
|
|
|
3
3
|
export var SidePanel = function (_a) {
|
|
4
4
|
var width = _a.width, open = _a.open, children = _a.children;
|
|
5
5
|
var styles = useStyles();
|
|
6
|
-
return (React.createElement("div", { className: styles.contentWrapper, style: {
|
|
6
|
+
return (React.createElement("div", { className: styles.contentWrapper, "data-reltio-id": "side-panel", style: {
|
|
7
7
|
width: width ? "".concat(open ? width : 0, "px") : '100%'
|
|
8
8
|
} }, open && React.createElement(React.Fragment, null, children)));
|
|
9
9
|
};
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1528",
|
|
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.1528",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1528",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|