@reltio/components 1.4.2231 → 1.4.2232
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/InlineComplexAttribute/InlineComplexAttribute.js +2 -2
- package/InlineComplexAttribute/InlineComplexAttribute.test.js +7 -7
- package/ReadOnlyAttributesList/ReadOnlyAttributesList.d.ts +5 -2
- package/ReadOnlyAttributesList/ReadOnlyAttributesList.js +2 -2
- package/ReadOnlyAttributesPager/ReadOnlyAttributesPager.d.ts +5 -2
- package/ReadOnlyAttributesPager/ReadOnlyAttributesPager.js +3 -3
- package/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.d.ts +5 -2
- package/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.js +15 -11
- package/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.d.ts +5 -2
- package/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.js +13 -11
- package/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.d.ts +5 -2
- package/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.js +24 -12
- package/SimpleAttribute/SimpleAttribute.js +3 -2
- package/SyncedValueHeight/ValueHeightConsumer.js +12 -0
- package/{features/crosswalks/AttributesTable/components/SyncedValueHeight → SyncedValueHeight}/ValueHeightReporter.js +12 -6
- package/cjs/InlineComplexAttribute/InlineComplexAttribute.js +2 -2
- package/cjs/InlineComplexAttribute/InlineComplexAttribute.test.js +7 -7
- package/cjs/ReadOnlyAttributesList/ReadOnlyAttributesList.d.ts +5 -2
- package/cjs/ReadOnlyAttributesList/ReadOnlyAttributesList.js +2 -2
- package/cjs/ReadOnlyAttributesPager/ReadOnlyAttributesPager.d.ts +5 -2
- package/cjs/ReadOnlyAttributesPager/ReadOnlyAttributesPager.js +3 -3
- package/cjs/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.d.ts +5 -2
- package/cjs/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.js +15 -11
- package/cjs/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.d.ts +5 -2
- package/cjs/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.js +13 -11
- package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.d.ts +5 -2
- package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.js +23 -11
- package/cjs/SimpleAttribute/SimpleAttribute.js +3 -2
- package/cjs/SyncedValueHeight/ValueHeightConsumer.js +39 -0
- package/cjs/{features/crosswalks/AttributesTable/components/SyncedValueHeight → SyncedValueHeight}/ValueHeightReporter.js +11 -5
- package/cjs/contexts/AutoExpandedAttributesContext/index.d.ts +8 -0
- package/cjs/contexts/{ExpandedAttributesContext → AutoExpandedAttributesContext}/index.js +8 -8
- package/cjs/contexts/{ExpandedAttributesContext/useAttributeExpanded.test.js → AutoExpandedAttributesContext/useAttributeAutoExpanded.test.js} +3 -3
- package/cjs/contexts/SyncedExpandedAttributesContext/index.d.ts +12 -0
- package/cjs/contexts/SyncedExpandedAttributesContext/index.js +56 -0
- package/{features/crosswalks/contexts/SyncedValueHeightsContext.d.ts → cjs/contexts/SyncedValueHeightsContext/index.d.ts} +2 -2
- package/cjs/{features/crosswalks/contexts/SyncedValueHeightsContext.js → contexts/SyncedValueHeightsContext/index.js} +10 -15
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.js +5 -3
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +1 -1
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.js +93 -34
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test.js +290 -56
- package/cjs/features/crosswalks/AttributesTable/components/AttributeRule/AttributeRule.d.ts +11 -0
- package/cjs/features/crosswalks/AttributesTable/components/AttributeRule/AttributeRule.js +32 -0
- package/cjs/features/crosswalks/AttributesTable/components/AttributeRule/AttributeRule.module.css.js +9 -0
- package/cjs/features/crosswalks/AttributesTable/components/AttributeRule/index.d.ts +1 -0
- package/cjs/features/crosswalks/AttributesTable/components/AttributeRule/index.js +5 -0
- package/cjs/features/crosswalks/AttributesTable/components/ComplexRule/ComplexRule.d.ts +10 -0
- package/cjs/features/crosswalks/AttributesTable/components/ComplexRule/ComplexRule.js +60 -0
- package/cjs/features/crosswalks/AttributesTable/components/ComplexRule/ComplexRule.module.css.js +9 -0
- package/cjs/features/crosswalks/AttributesTable/components/ComplexRule/index.d.ts +1 -0
- package/cjs/features/crosswalks/AttributesTable/components/ComplexRule/index.js +5 -0
- package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js +1 -1
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.d.ts +1 -1
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.js +5 -64
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.module.css.js +2 -2
- package/cjs/features/crosswalks/AttributesTable/components/SimpleRule/SimpleRule.d.ts +10 -0
- package/cjs/features/crosswalks/AttributesTable/components/SimpleRule/SimpleRule.js +94 -0
- package/cjs/features/crosswalks/AttributesTable/components/SimpleRule/SimpleRule.module.css.js +9 -0
- package/cjs/features/crosswalks/AttributesTable/components/SimpleRule/index.d.ts +1 -0
- package/cjs/features/crosswalks/AttributesTable/components/SimpleRule/index.js +5 -0
- package/cjs/features/crosswalks/AttributesTable/helpers.d.ts +1 -2
- package/cjs/features/crosswalks/AttributesTable/helpers.js +82 -56
- package/cjs/features/crosswalks/AttributesTable/helpers.test.js +539 -360
- package/cjs/features/crosswalks/AttributesTable/types.d.ts +17 -10
- package/cjs/features/crosswalks/AttributesTable/types.js +6 -0
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +4 -4
- package/contexts/AutoExpandedAttributesContext/index.d.ts +8 -0
- package/contexts/AutoExpandedAttributesContext/index.js +11 -0
- package/contexts/{ExpandedAttributesContext/useAttributeExpanded.test.js → AutoExpandedAttributesContext/useAttributeAutoExpanded.test.js} +4 -4
- package/contexts/SyncedExpandedAttributesContext/index.d.ts +12 -0
- package/contexts/SyncedExpandedAttributesContext/index.js +28 -0
- package/{cjs/features/crosswalks/contexts/SyncedValueHeightsContext.d.ts → contexts/SyncedValueHeightsContext/index.d.ts} +2 -2
- package/{features/crosswalks/contexts/SyncedValueHeightsContext.js → contexts/SyncedValueHeightsContext/index.js} +9 -13
- package/features/crosswalks/AttributesTable/AttributesTable.js +5 -3
- package/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +1 -1
- package/features/crosswalks/AttributesTable/AttributesTable.test-data.js +91 -32
- package/features/crosswalks/AttributesTable/AttributesTable.test.js +291 -57
- package/features/crosswalks/AttributesTable/components/AttributeRule/AttributeRule.d.ts +11 -0
- package/features/crosswalks/AttributesTable/components/AttributeRule/AttributeRule.js +25 -0
- package/features/crosswalks/AttributesTable/components/AttributeRule/AttributeRule.module.css.js +9 -0
- package/features/crosswalks/AttributesTable/components/AttributeRule/index.d.ts +1 -0
- package/features/crosswalks/AttributesTable/components/AttributeRule/index.js +1 -0
- package/features/crosswalks/AttributesTable/components/ComplexRule/ComplexRule.d.ts +10 -0
- package/features/crosswalks/AttributesTable/components/ComplexRule/ComplexRule.js +30 -0
- package/features/crosswalks/AttributesTable/components/ComplexRule/ComplexRule.module.css.js +9 -0
- package/features/crosswalks/AttributesTable/components/ComplexRule/index.d.ts +1 -0
- package/features/crosswalks/AttributesTable/components/ComplexRule/index.js +1 -0
- package/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js +1 -1
- package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.d.ts +1 -1
- package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.js +6 -65
- package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.module.css.js +2 -2
- package/features/crosswalks/AttributesTable/components/SimpleRule/SimpleRule.d.ts +10 -0
- package/features/crosswalks/AttributesTable/components/SimpleRule/SimpleRule.js +64 -0
- package/features/crosswalks/AttributesTable/components/SimpleRule/SimpleRule.module.css.js +9 -0
- package/features/crosswalks/AttributesTable/components/SimpleRule/index.d.ts +1 -0
- package/features/crosswalks/AttributesTable/components/SimpleRule/index.js +1 -0
- package/features/crosswalks/AttributesTable/helpers.d.ts +1 -2
- package/features/crosswalks/AttributesTable/helpers.js +82 -55
- package/features/crosswalks/AttributesTable/helpers.test.js +540 -361
- package/features/crosswalks/AttributesTable/types.d.ts +17 -10
- package/features/crosswalks/AttributesTable/types.js +5 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/cjs/contexts/ExpandedAttributesContext/index.d.ts +0 -8
- package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.js +0 -15
- package/contexts/ExpandedAttributesContext/index.d.ts +0 -8
- package/contexts/ExpandedAttributesContext/index.js +0 -11
- package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.js +0 -8
- /package/{cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight → SyncedValueHeight}/ValueHeightConsumer.d.ts +0 -0
- /package/{cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight → SyncedValueHeight}/ValueHeightReporter.d.ts +0 -0
- /package/{cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight → SyncedValueHeight}/index.d.ts +0 -0
- /package/{features/crosswalks/AttributesTable/components/SyncedValueHeight → SyncedValueHeight}/index.js +0 -0
- /package/{features/crosswalks/AttributesTable/components → cjs}/SyncedValueHeight/ValueHeightConsumer.d.ts +0 -0
- /package/{features/crosswalks/AttributesTable/components → cjs}/SyncedValueHeight/ValueHeightReporter.d.ts +0 -0
- /package/{features/crosswalks/AttributesTable/components → cjs}/SyncedValueHeight/index.d.ts +0 -0
- /package/cjs/{features/crosswalks/AttributesTable/components/SyncedValueHeight → SyncedValueHeight}/index.js +0 -0
- /package/cjs/contexts/{ExpandedAttributesContext/useAttributeExpanded.test.d.ts → AutoExpandedAttributesContext/useAttributeAutoExpanded.test.d.ts} +0 -0
- /package/contexts/{ExpandedAttributesContext/useAttributeExpanded.test.d.ts → AutoExpandedAttributesContext/useAttributeAutoExpanded.test.d.ts} +0 -0
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
exports.ComplexRule = void 0;
|
|
30
|
+
var react_1 = __importStar(require("react"));
|
|
31
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
32
|
+
var ArrowExpandButton_1 = require("../../../../../ArrowExpandButton");
|
|
33
|
+
var BranchDecorator_1 = require("../../../../../BranchDecorator");
|
|
34
|
+
var SyncedExpandedAttributesContext_1 = require("../../../../../contexts/SyncedExpandedAttributesContext");
|
|
35
|
+
var MdmModuleContext_1 = require("../../../../../contexts/MdmModuleContext");
|
|
36
|
+
var SimpleRule_1 = require("../SimpleRule");
|
|
37
|
+
var AttributeRule_1 = require("../AttributeRule");
|
|
38
|
+
var ComplexRule_module_css_1 = __importDefault(require("./ComplexRule.module.css"));
|
|
39
|
+
var ComplexRule = function (_a) {
|
|
40
|
+
var attributeType = _a.attributeType, attributeValue = _a.attributeValue, getRuleTypeData = _a.getRuleTypeData;
|
|
41
|
+
var metadata = (0, MdmModuleContext_1.useMdmMetadata)();
|
|
42
|
+
var expandedContext = (0, SyncedExpandedAttributesContext_1.useSyncedExpandedAttributes)();
|
|
43
|
+
var attributeUri = attributeValue.uri;
|
|
44
|
+
var expanded = expandedContext ? expandedContext.isExpanded(attributeUri) : false;
|
|
45
|
+
var toggle = (0, react_1.useCallback)(function () {
|
|
46
|
+
if (expandedContext && attributeUri) {
|
|
47
|
+
expandedContext.toggle(attributeUri);
|
|
48
|
+
}
|
|
49
|
+
}, [expandedContext, attributeUri]);
|
|
50
|
+
var subAttributes = (0, mdm_sdk_1.getAttributeTypeSubAttributes)(metadata, attributeType);
|
|
51
|
+
var entity = { attributes: attributeValue.value };
|
|
52
|
+
var attributesList = (0, mdm_sdk_1.getAttributesListForReadMode)(subAttributes, entity, false, []);
|
|
53
|
+
return (react_1.default.createElement("div", null,
|
|
54
|
+
react_1.default.createElement("div", { className: ComplexRule_module_css_1.default.expandableRule },
|
|
55
|
+
react_1.default.createElement(ArrowExpandButton_1.ArrowExpandButton, { expanded: expanded, onClick: toggle }),
|
|
56
|
+
react_1.default.createElement(SimpleRule_1.SimpleRule, { attributeValue: attributeValue, attributeType: attributeType, getRuleTypeData: getRuleTypeData })),
|
|
57
|
+
expanded && (react_1.default.createElement("div", null, attributesList.map(function (item) { return (react_1.default.createElement(BranchDecorator_1.BranchDecorator, { key: item.attrType.uri, enabled: true, className: ComplexRule_module_css_1.default.rulePaddingWrapper },
|
|
58
|
+
react_1.default.createElement(AttributeRule_1.AttributeRule, { attributeType: item.attrType, values: item.values, getRuleTypeData: getRuleTypeData, parentUri: attributeUri }))); })))));
|
|
59
|
+
};
|
|
60
|
+
exports.ComplexRule = ComplexRule;
|
package/cjs/features/crosswalks/AttributesTable/components/ComplexRule/ComplexRule.module.css.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"expandableRule":"ComplexRule-expandableRule--p9mC6","rulePaddingWrapper":"ComplexRule-rulePaddingWrapper--fBmSa"};
|
|
2
|
+
if (typeof document !== 'undefined') {
|
|
3
|
+
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
const style = document.createElement('style');
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
style.innerHTML = `.ComplexRule-expandableRule--p9mC6{align-items:center;display:flex;min-height:18px}.ComplexRule-rulePaddingWrapper--fBmSa{padding-bottom:1px}.ComplexRule-rulePaddingWrapper--fBmSa:last-child{padding-bottom:2px}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
module.exports = styles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ComplexRule } from './ComplexRule';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ComplexRule = void 0;
|
|
4
|
+
var ComplexRule_1 = require("./ComplexRule");
|
|
5
|
+
Object.defineProperty(exports, "ComplexRule", { enumerable: true, get: function () { return ComplexRule_1.ComplexRule; } });
|
package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js
CHANGED
|
@@ -24,7 +24,7 @@ var EntityContext_1 = require("../../../../../contexts/EntityContext");
|
|
|
24
24
|
var MdmModuleContext_1 = require("../../../../../contexts/MdmModuleContext");
|
|
25
25
|
var FallbackIndicator_1 = require("../FallbackIndicator");
|
|
26
26
|
var styles_1 = require("../../styles");
|
|
27
|
-
var SyncedValueHeight_1 = require("
|
|
27
|
+
var SyncedValueHeight_1 = require("../../../../../SyncedValueHeight");
|
|
28
28
|
var styles_2 = require("./styles");
|
|
29
29
|
var OvValuesRenderer = function (_a) {
|
|
30
30
|
var _b = _a.value, values = _b.values, attributeType = _b.attributeType, someRowIsDragging = _a.someRowIsDragging, draggableProps = _a.draggableProps;
|
package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import { RuleTypeValues } from '../../types';
|
|
|
3
3
|
type Props = {
|
|
4
4
|
value: RuleTypeValues;
|
|
5
5
|
};
|
|
6
|
-
export declare const RuleTypeRenderer: ({ value: {
|
|
6
|
+
export declare const RuleTypeRenderer: ({ value: { attributeType, attributeValues, getRuleTypeData } }: Props) => React.JSX.Element;
|
|
7
7
|
export {};
|
package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.js
CHANGED
|
@@ -2,78 +2,19 @@
|
|
|
2
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
|
-
var _a;
|
|
6
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
6
|
exports.RuleTypeRenderer = void 0;
|
|
8
7
|
var react_1 = __importDefault(require("react"));
|
|
9
|
-
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
10
8
|
var classnames_1 = __importDefault(require("classnames"));
|
|
11
|
-
var Info_1 = __importDefault(require("@mui/icons-material/Info"));
|
|
12
9
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
13
|
-
var withTooltip_1 = require("../../../../../HOCs/withTooltip");
|
|
14
|
-
var RuleTypeInfoButton_1 = require("../RuleTypeInfoButton");
|
|
15
10
|
var styles_1 = require("../../styles");
|
|
16
|
-
var SyncedValueHeight_1 = require("
|
|
11
|
+
var SyncedValueHeight_1 = require("../../../../../SyncedValueHeight");
|
|
12
|
+
var SimpleRule_1 = require("../SimpleRule");
|
|
13
|
+
var ComplexRule_1 = require("../ComplexRule");
|
|
17
14
|
var RuleTypeRenderer_module_css_1 = __importDefault(require("./RuleTypeRenderer.module.css"));
|
|
18
|
-
var InfoIconWithTooltip = (0, withTooltip_1.withTooltip)(Info_1.default);
|
|
19
|
-
var PARTICIPATION_STATUS_MAP = (_a = {},
|
|
20
|
-
Object.defineProperty(_a, mdm_sdk_1.ParticipationStatus.Pinned, {
|
|
21
|
-
get: function () {
|
|
22
|
-
return ui_i18n_1.default.text("Value survives because 'pin' flag is set. Survivorship not evaluated");
|
|
23
|
-
},
|
|
24
|
-
enumerable: false,
|
|
25
|
-
configurable: true
|
|
26
|
-
}),
|
|
27
|
-
Object.defineProperty(_a, mdm_sdk_1.ParticipationStatus.Ignored, {
|
|
28
|
-
get: function () {
|
|
29
|
-
return ui_i18n_1.default.text("Value did not participate in survivorship evaluation because 'ignore' flag is set");
|
|
30
|
-
},
|
|
31
|
-
enumerable: false,
|
|
32
|
-
configurable: true
|
|
33
|
-
}),
|
|
34
|
-
Object.defineProperty(_a, mdm_sdk_1.ParticipationStatus.EndDatedCrosswalk, {
|
|
35
|
-
get: function () {
|
|
36
|
-
return ui_i18n_1.default.text("Value did not participate in survivorship evaluation because it's crosswalk is end-dated");
|
|
37
|
-
},
|
|
38
|
-
enumerable: false,
|
|
39
|
-
configurable: true
|
|
40
|
-
}),
|
|
41
|
-
Object.defineProperty(_a, mdm_sdk_1.ParticipationStatus.NotParticipating, {
|
|
42
|
-
get: function () {
|
|
43
|
-
return ui_i18n_1.default.text('Value did not participate in survivorship evaluation because another value was pinned or the source was ignored');
|
|
44
|
-
},
|
|
45
|
-
enumerable: false,
|
|
46
|
-
configurable: true
|
|
47
|
-
}),
|
|
48
|
-
_a);
|
|
49
15
|
var RuleTypeRenderer = function (_a) {
|
|
50
|
-
var
|
|
16
|
+
var _b = _a.value, attributeType = _b.attributeType, attributeValues = _b.attributeValues, getRuleTypeData = _b.getRuleTypeData;
|
|
51
17
|
var commonStyles = (0, styles_1.useCommonStyles)();
|
|
52
|
-
|
|
53
|
-
var strategy = data.strategy, primaryAttributeUri = data.primaryAttributeUri, comparisonAttributeUri = data.comparisonAttributeUri, sourcesUriOrder = data.sourcesUriOrder;
|
|
54
|
-
if (!strategy)
|
|
55
|
-
return null;
|
|
56
|
-
var showInfoIcon = sourcesUriOrder || primaryAttributeUri || comparisonAttributeUri;
|
|
57
|
-
return (react_1.default.createElement("div", { className: RuleTypeRenderer_module_css_1.default.strategyItem },
|
|
58
|
-
react_1.default.createElement("div", { className: RuleTypeRenderer_module_css_1.default.label }, strategy.label),
|
|
59
|
-
showInfoIcon && (react_1.default.createElement(RuleTypeInfoButton_1.RuleTypeInfoButton, { info: {
|
|
60
|
-
sourcesUriOrder: sourcesUriOrder,
|
|
61
|
-
primaryAttributeUri: primaryAttributeUri,
|
|
62
|
-
comparisonAttributeUri: comparisonAttributeUri
|
|
63
|
-
} }))));
|
|
64
|
-
};
|
|
65
|
-
var renderStatus = function (participationStatus) {
|
|
66
|
-
var description = PARTICIPATION_STATUS_MAP[participationStatus];
|
|
67
|
-
return (react_1.default.createElement("div", { className: RuleTypeRenderer_module_css_1.default.statusItem },
|
|
68
|
-
ui_i18n_1.default.text('N/A'),
|
|
69
|
-
description && react_1.default.createElement(InfoIconWithTooltip, { className: RuleTypeRenderer_module_css_1.default.infoIcon, tooltipTitle: description })));
|
|
70
|
-
};
|
|
71
|
-
var renderRuleType = function (item) {
|
|
72
|
-
if (item.type === 'status') {
|
|
73
|
-
return renderStatus(item.data);
|
|
74
|
-
}
|
|
75
|
-
return renderStrategy(item.data);
|
|
76
|
-
};
|
|
77
|
-
return (react_1.default.createElement("div", { className: (0, classnames_1.default)(RuleTypeRenderer_module_css_1.default.list, commonStyles.basicCell) }, ruleTypes.map(function (item) { return (react_1.default.createElement(SyncedValueHeight_1.ValueHeightConsumer, { key: item.valueUri, uri: item.valueUri }, renderRuleType(item))); })));
|
|
18
|
+
return (react_1.default.createElement("div", { className: (0, classnames_1.default)(RuleTypeRenderer_module_css_1.default.list, commonStyles.basicCell) }, attributeValues.length === 0 ? (react_1.default.createElement(SimpleRule_1.SimpleRule, { attributeType: attributeType, getRuleTypeData: getRuleTypeData })) : (attributeValues.map(function (attributeValue) { return (react_1.default.createElement(SyncedValueHeight_1.ValueHeightConsumer, { key: attributeValue.uri, uri: attributeValue.uri }, (0, mdm_sdk_1.isComplexAttribute)(attributeType) ? (react_1.default.createElement(ComplexRule_1.ComplexRule, { attributeType: attributeType, attributeValue: attributeValue, getRuleTypeData: getRuleTypeData })) : (react_1.default.createElement(SimpleRule_1.SimpleRule, { attributeType: attributeType, attributeValue: attributeValue, getRuleTypeData: getRuleTypeData })))); }))));
|
|
78
19
|
};
|
|
79
20
|
exports.RuleTypeRenderer = RuleTypeRenderer;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const styles = {"list":"RuleTypeRenderer-list--IejtI"
|
|
1
|
+
const styles = {"list":"RuleTypeRenderer-list--IejtI"};
|
|
2
2
|
if (typeof document !== 'undefined') {
|
|
3
3
|
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
4
|
const style = document.createElement('style');
|
|
5
5
|
style.type = 'text/css'
|
|
6
|
-
style.innerHTML = `.RuleTypeRenderer-list--IejtI:before{content:"";display:block;height:20px}.RuleTypeRenderer-list--IejtI>div+div{margin-top:4px}
|
|
6
|
+
style.innerHTML = `.RuleTypeRenderer-list--IejtI{font-size:13px;line-height:16px}.RuleTypeRenderer-list--IejtI:before{content:"";display:block;height:20px}.RuleTypeRenderer-list--IejtI>div+div{margin-top:4px}`;
|
|
7
7
|
head.appendChild(style);
|
|
8
8
|
}
|
|
9
9
|
module.exports = styles;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AttributeType } from '@reltio/mdm-sdk';
|
|
3
|
+
import { AttributeValueLite, RuleTypeValues } from '../../types';
|
|
4
|
+
type Props = {
|
|
5
|
+
attributeType: AttributeType;
|
|
6
|
+
attributeValue?: AttributeValueLite;
|
|
7
|
+
getRuleTypeData: RuleTypeValues['getRuleTypeData'];
|
|
8
|
+
};
|
|
9
|
+
export declare const SimpleRule: ({ attributeType, attributeValue, getRuleTypeData }: Props) => React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
var _a;
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.SimpleRule = void 0;
|
|
31
|
+
var react_1 = __importStar(require("react"));
|
|
32
|
+
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
33
|
+
var Info_1 = __importDefault(require("@mui/icons-material/Info"));
|
|
34
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
35
|
+
var withTooltip_1 = require("../../../../../HOCs/withTooltip");
|
|
36
|
+
var types_1 = require("../../types");
|
|
37
|
+
var RuleTypeInfoButton_1 = require("../RuleTypeInfoButton");
|
|
38
|
+
var SimpleRule_module_css_1 = __importDefault(require("./SimpleRule.module.css"));
|
|
39
|
+
var InfoIconWithTooltip = (0, withTooltip_1.withTooltip)(Info_1.default);
|
|
40
|
+
var PARTICIPATION_STATUS_MAP = (_a = {},
|
|
41
|
+
Object.defineProperty(_a, mdm_sdk_1.ParticipationStatus.Pinned, {
|
|
42
|
+
get: function () {
|
|
43
|
+
return ui_i18n_1.default.text("Value survives because 'pin' flag is set. Survivorship not evaluated");
|
|
44
|
+
},
|
|
45
|
+
enumerable: false,
|
|
46
|
+
configurable: true
|
|
47
|
+
}),
|
|
48
|
+
Object.defineProperty(_a, mdm_sdk_1.ParticipationStatus.Ignored, {
|
|
49
|
+
get: function () {
|
|
50
|
+
return ui_i18n_1.default.text("Value did not participate in survivorship evaluation because 'ignore' flag is set");
|
|
51
|
+
},
|
|
52
|
+
enumerable: false,
|
|
53
|
+
configurable: true
|
|
54
|
+
}),
|
|
55
|
+
Object.defineProperty(_a, mdm_sdk_1.ParticipationStatus.EndDatedCrosswalk, {
|
|
56
|
+
get: function () {
|
|
57
|
+
return ui_i18n_1.default.text('Value did not participate in survivorship evaluation because its crosswalk is end-dated');
|
|
58
|
+
},
|
|
59
|
+
enumerable: false,
|
|
60
|
+
configurable: true
|
|
61
|
+
}),
|
|
62
|
+
Object.defineProperty(_a, mdm_sdk_1.ParticipationStatus.NotParticipating, {
|
|
63
|
+
get: function () {
|
|
64
|
+
return ui_i18n_1.default.text('Value did not participate in survivorship evaluation because another value was pinned or the source was ignored');
|
|
65
|
+
},
|
|
66
|
+
enumerable: false,
|
|
67
|
+
configurable: true
|
|
68
|
+
}),
|
|
69
|
+
_a);
|
|
70
|
+
var SimpleRule = function (_a) {
|
|
71
|
+
var attributeType = _a.attributeType, attributeValue = _a.attributeValue, getRuleTypeData = _a.getRuleTypeData;
|
|
72
|
+
var renderStrategy = (0, react_1.useCallback)(function (data) {
|
|
73
|
+
var strategy = data.strategy, primaryAttributeUri = data.primaryAttributeUri, comparisonAttributeUri = data.comparisonAttributeUri, sourcesUriOrder = data.sourcesUriOrder;
|
|
74
|
+
if (!strategy)
|
|
75
|
+
return null;
|
|
76
|
+
var showInfoIcon = sourcesUriOrder || primaryAttributeUri || comparisonAttributeUri;
|
|
77
|
+
return (react_1.default.createElement("div", { className: SimpleRule_module_css_1.default.strategyItem },
|
|
78
|
+
react_1.default.createElement("div", { className: SimpleRule_module_css_1.default.label }, strategy.label),
|
|
79
|
+
showInfoIcon && (react_1.default.createElement(RuleTypeInfoButton_1.RuleTypeInfoButton, { info: {
|
|
80
|
+
sourcesUriOrder: sourcesUriOrder,
|
|
81
|
+
primaryAttributeUri: primaryAttributeUri,
|
|
82
|
+
comparisonAttributeUri: comparisonAttributeUri
|
|
83
|
+
} }))));
|
|
84
|
+
}, []);
|
|
85
|
+
var renderStatus = (0, react_1.useCallback)(function (participationStatus) {
|
|
86
|
+
var description = PARTICIPATION_STATUS_MAP[participationStatus];
|
|
87
|
+
return (react_1.default.createElement("div", { className: SimpleRule_module_css_1.default.statusItem },
|
|
88
|
+
ui_i18n_1.default.text('N/A'),
|
|
89
|
+
description && react_1.default.createElement(InfoIconWithTooltip, { className: SimpleRule_module_css_1.default.infoIcon, tooltipTitle: description })));
|
|
90
|
+
}, []);
|
|
91
|
+
var _b = getRuleTypeData(attributeType, attributeValue), type = _b.type, data = _b.data;
|
|
92
|
+
return type === types_1.RuleItemType.Status ? renderStatus(data) : renderStrategy(data);
|
|
93
|
+
};
|
|
94
|
+
exports.SimpleRule = SimpleRule;
|
package/cjs/features/crosswalks/AttributesTable/components/SimpleRule/SimpleRule.module.css.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"label":"SimpleRule-label--UMv66","strategyItem":"SimpleRule-strategyItem--3WO1E","statusItem":"SimpleRule-statusItem--tkZgO","infoIcon":"SimpleRule-infoIcon--zFQFu"};
|
|
2
|
+
if (typeof document !== 'undefined') {
|
|
3
|
+
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
const style = document.createElement('style');
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
style.innerHTML = `.SimpleRule-label--UMv66{margin-right:5px;white-space:nowrap}.SimpleRule-statusItem--tkZgO,.SimpleRule-strategyItem--3WO1E{align-items:center;display:flex}.SimpleRule-infoIcon--zFQFu{color:var(--mui-palette-text-secondary);height:16px;margin-left:4px;width:16px}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
module.exports = styles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SimpleRule } from './SimpleRule';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SimpleRule = void 0;
|
|
4
|
+
var SimpleRule_1 = require("./SimpleRule");
|
|
5
|
+
Object.defineProperty(exports, "SimpleRule", { enumerable: true, get: function () { return SimpleRule_1.SimpleRule; } });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppliedSurvivorshipRule, AttributeType, AttributeValue, Crosswalk, Metadata, OvDetails, RecordAttributesType } from '@reltio/mdm-sdk';
|
|
2
2
|
import { CrosswalksMap } from '../../../types';
|
|
3
3
|
import { CrosswalksByOwnerTypeMap } from '../types';
|
|
4
|
-
import { AttributesTableRowValue
|
|
4
|
+
import { AttributesTableRowValue } from './types';
|
|
5
5
|
export declare const COLUMNS_DATA: ({
|
|
6
6
|
id: string;
|
|
7
7
|
readonly label: string;
|
|
@@ -31,7 +31,6 @@ export declare const DEFAULT_VISIBLE_COLUMNS: string[];
|
|
|
31
31
|
export declare const countAttributeValues: (type: string, values: AttributeValue[], crosswalksMap: CrosswalksMap) => number;
|
|
32
32
|
export declare const collectRuleNames: (rule: AppliedSurvivorshipRule | undefined) => string[];
|
|
33
33
|
export declare const getFallbackLabels: (metadata: Metadata, ovDetails: OvDetails) => string[];
|
|
34
|
-
export declare const getRuleTypeValues: (metadata: Metadata, attributeType: AttributeType, parentTypeUri: string, attributeValues: AttributeValue[], activeSurvivorshipGroupUri?: string) => RuleTypeValues;
|
|
35
34
|
export declare const getWinnerCrosswalks: (attributeValues: AttributeValue[], crosswalksMap: CrosswalksMap) => Crosswalk[];
|
|
36
35
|
export declare const getBasicTableColumnsData: any;
|
|
37
36
|
export declare const getBasicTableRowsData: (metadata: Metadata, parentTypeUri: string, attrTypes: AttributeType[], columns: string[], crosswalksMap: CrosswalksByOwnerTypeMap, attributes: RecordAttributesType, activeSurvivorshipGroupUri?: string) => AttributesTableRowValue[];
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
3
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
4
|
if (ar || !(i in from)) {
|
|
@@ -23,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
23
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
13
|
};
|
|
25
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getBasicTableRowsData = exports.getBasicTableColumnsData = exports.getWinnerCrosswalks = exports.
|
|
15
|
+
exports.getBasicTableRowsData = exports.getBasicTableColumnsData = exports.getWinnerCrosswalks = exports.getFallbackLabels = exports.collectRuleNames = exports.countAttributeValues = exports.DEFAULT_VISIBLE_COLUMNS = exports.COLUMNS_DATA = void 0;
|
|
27
16
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
28
17
|
var ramda_1 = require("ramda");
|
|
29
18
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
@@ -35,6 +24,7 @@ var OvValuesRenderer_1 = require("./components/OvValuesRenderer");
|
|
|
35
24
|
var CountRenderer_1 = require("./components/CountRenderer");
|
|
36
25
|
var RuleTypeRenderer_1 = require("./components/RuleTypeRenderer");
|
|
37
26
|
var WinnerSourcesRenderer_1 = require("./components/WinnerSourcesRenderer");
|
|
27
|
+
var types_1 = require("./types");
|
|
38
28
|
exports.COLUMNS_DATA = [
|
|
39
29
|
{
|
|
40
30
|
id: 'ovValues',
|
|
@@ -151,7 +141,8 @@ var getFallbackLabels = function (metadata, ovDetails) {
|
|
|
151
141
|
return rules.map(function (uri) { var _a; return ((_a = (0, mdm_sdk_1.getSurvivorshipStrategy)(metadata, uri)) === null || _a === void 0 ? void 0 : _a.label) || uri; });
|
|
152
142
|
};
|
|
153
143
|
exports.getFallbackLabels = getFallbackLabels;
|
|
154
|
-
var
|
|
144
|
+
var createRuleTypeData = function (_a) {
|
|
145
|
+
var metadata = _a.metadata, strategy = _a.strategy, mapping = _a.mapping, attributeType = _a.attributeType, currentSurvivorshipGroup = _a.currentSurvivorshipGroup;
|
|
155
146
|
var fixUri = fixReferencedAttributeUri(attributeType);
|
|
156
147
|
var primaryAttributeUri = isOtherAttributeWinnerRule(strategy) ? fixUri(mapping === null || mapping === void 0 ? void 0 : mapping.primaryAttributeUri) : undefined;
|
|
157
148
|
var comparisonAttributeUri = (0, mdm_sdk_1.isComplexAttribute)(attributeType) && isMinMaxValueRule(strategy)
|
|
@@ -161,62 +152,91 @@ var getStrategyAdditionalFields = function (metadata, strategy, mapping, attribu
|
|
|
161
152
|
? (0, ramda_1.uniq)(__spreadArray(__spreadArray(__spreadArray([], ((mapping === null || mapping === void 0 ? void 0 : mapping.sourcesUriOrder) || []), true), ((currentSurvivorshipGroup === null || currentSurvivorshipGroup === void 0 ? void 0 : currentSurvivorshipGroup.sourcesUriOrder) || []), true), getSourcesUriOrderFromMetadata(metadata), true))
|
|
162
153
|
: undefined;
|
|
163
154
|
return {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
155
|
+
type: types_1.RuleItemType.Rule,
|
|
156
|
+
data: {
|
|
157
|
+
strategy: strategy,
|
|
158
|
+
primaryAttributeUri: primaryAttributeUri,
|
|
159
|
+
comparisonAttributeUri: comparisonAttributeUri,
|
|
160
|
+
sourcesUriOrder: sourcesUriOrder
|
|
161
|
+
}
|
|
167
162
|
};
|
|
168
163
|
};
|
|
169
|
-
var
|
|
170
|
-
|
|
171
|
-
|
|
164
|
+
var mapAttributeToRuleType = function (_a) {
|
|
165
|
+
var metadata = _a.metadata, attributeType = _a.attributeType, attributeValue = _a.attributeValue, mapping = _a.mapping, currentSurvivorshipGroup = _a.currentSurvivorshipGroup;
|
|
166
|
+
var ovDetails = attributeValue.ovDetails;
|
|
167
|
+
if (!ovDetails) {
|
|
168
|
+
return null;
|
|
172
169
|
}
|
|
173
|
-
|
|
174
|
-
var
|
|
175
|
-
if (!ovDetails || !ovDetails.appliedSurvivorshipRules) {
|
|
176
|
-
return null;
|
|
177
|
-
}
|
|
178
|
-
if (ovDetails.participationStatus === mdm_sdk_1.ParticipationStatus.Strategy) {
|
|
179
|
-
return { type: 'rule', data: ovDetails.appliedSurvivorshipRules, valueUri: value.uri };
|
|
180
|
-
}
|
|
181
|
-
return { type: 'status', data: ovDetails.participationStatus, valueUri: value.uri };
|
|
182
|
-
}), (0, ramda_1.reject)(ramda_1.isNil), (0, ramda_1.map)(function (ruleOrStatus) {
|
|
183
|
-
if (ruleOrStatus.type === 'status') {
|
|
184
|
-
return ruleOrStatus;
|
|
185
|
-
}
|
|
186
|
-
var appliedRules = (0, exports.collectRuleNames)(ruleOrStatus.data);
|
|
170
|
+
if (ovDetails.participationStatus === mdm_sdk_1.ParticipationStatus.Strategy) {
|
|
171
|
+
var appliedRules = (0, exports.collectRuleNames)(ovDetails.appliedSurvivorshipRules);
|
|
187
172
|
var lastRule = (0, mdm_sdk_1.getSurvivorshipStrategy)(metadata, (0, ramda_1.last)(appliedRules));
|
|
188
173
|
return lastRule
|
|
189
|
-
? {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
174
|
+
? createRuleTypeData({
|
|
175
|
+
metadata: metadata,
|
|
176
|
+
strategy: lastRule,
|
|
177
|
+
mapping: mapping,
|
|
178
|
+
attributeType: attributeType,
|
|
179
|
+
currentSurvivorshipGroup: currentSurvivorshipGroup
|
|
180
|
+
})
|
|
194
181
|
: null;
|
|
195
|
-
}
|
|
182
|
+
}
|
|
183
|
+
return {
|
|
184
|
+
type: types_1.RuleItemType.Status,
|
|
185
|
+
data: ovDetails.participationStatus
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
var getOvAttributeValues = function (attributeValues) {
|
|
189
|
+
if (!attributeValues) {
|
|
190
|
+
return [];
|
|
191
|
+
}
|
|
192
|
+
return (0, ramda_1.pipe)((0, ramda_1.filter)(isOvValue), (0, ramda_1.filter)((0, ramda_1.has)('ovDetails')), (0, ramda_1.map)((0, ramda_1.pick)(['uri', 'value', 'ovDetails'])))(attributeValues);
|
|
196
193
|
};
|
|
197
|
-
var getRuleTypeValues = function (
|
|
198
|
-
var
|
|
194
|
+
var getRuleTypeValues = function (_a) {
|
|
195
|
+
var _b, _c;
|
|
196
|
+
var metadata = _a.metadata, attributeType = _a.attributeType, parentTypeUri = _a.parentTypeUri, attributeValues = _a.attributeValues, activeSurvivorshipGroupUri = _a.activeSurvivorshipGroupUri;
|
|
199
197
|
var parentType = __spreadArray(__spreadArray([], metadata.entityTypes, true), (metadata.relationTypes || []), true).find((0, ramda_1.propEq)('uri', parentTypeUri));
|
|
200
|
-
var survivorshipGroups = (
|
|
198
|
+
var survivorshipGroups = (_b = parentType === null || parentType === void 0 ? void 0 : parentType.survivorshipGroups) !== null && _b !== void 0 ? _b : [];
|
|
201
199
|
var currentSurvivorshipGroup = (activeSurvivorshipGroupUri && survivorshipGroups.find((0, ramda_1.propEq)('uri', activeSurvivorshipGroupUri))) ||
|
|
202
200
|
survivorshipGroups.find((0, ramda_1.propEq)('default', true));
|
|
203
|
-
var mapping = (
|
|
204
|
-
var
|
|
205
|
-
var
|
|
206
|
-
|
|
207
|
-
|
|
201
|
+
var mapping = (_c = currentSurvivorshipGroup === null || currentSurvivorshipGroup === void 0 ? void 0 : currentSurvivorshipGroup.mapping) === null || _c === void 0 ? void 0 : _c.find((0, ramda_1.propEq)('attribute', attributeType.uri));
|
|
202
|
+
var defaultSurvivorshipStrategy = (0, mdm_sdk_1.getSurvivorshipStrategy)(metadata, mapping === null || mapping === void 0 ? void 0 : mapping.survivorshipStrategy) || (0, mdm_sdk_1.getDefaultSurvivorshipStrategy)(metadata);
|
|
203
|
+
var defaultRuleType = createRuleTypeData({
|
|
204
|
+
metadata: metadata,
|
|
205
|
+
strategy: defaultSurvivorshipStrategy,
|
|
206
|
+
mapping: mapping,
|
|
207
|
+
attributeType: attributeType,
|
|
208
|
+
currentSurvivorshipGroup: currentSurvivorshipGroup
|
|
209
|
+
});
|
|
210
|
+
var ovAttributeValues = getOvAttributeValues(attributeValues);
|
|
211
|
+
var getRuleTypeData = function (attrType, attrValue) {
|
|
212
|
+
var _a, _b;
|
|
213
|
+
if (!(attrValue === null || attrValue === void 0 ? void 0 : attrValue.ovDetails)) {
|
|
214
|
+
return defaultRuleType;
|
|
215
|
+
}
|
|
216
|
+
var mappingForAttr = attrType.uri === attributeType.uri
|
|
217
|
+
? mapping
|
|
218
|
+
: (_a = currentSurvivorshipGroup === null || currentSurvivorshipGroup === void 0 ? void 0 : currentSurvivorshipGroup.mapping) === null || _a === void 0 ? void 0 : _a.find((0, ramda_1.propEq)('attribute', attrType.uri));
|
|
219
|
+
return ((_b = mapAttributeToRuleType({
|
|
220
|
+
metadata: metadata,
|
|
221
|
+
attributeType: attrType,
|
|
222
|
+
attributeValue: attrValue,
|
|
223
|
+
mapping: mappingForAttr,
|
|
224
|
+
currentSurvivorshipGroup: currentSurvivorshipGroup
|
|
225
|
+
})) !== null && _b !== void 0 ? _b : defaultRuleType);
|
|
226
|
+
};
|
|
227
|
+
if (ovAttributeValues.length > 0) {
|
|
228
|
+
return {
|
|
229
|
+
attributeType: attributeType,
|
|
230
|
+
attributeValues: ovAttributeValues,
|
|
231
|
+
getRuleTypeData: getRuleTypeData
|
|
232
|
+
};
|
|
208
233
|
}
|
|
209
234
|
return {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
valueUri: (_d = (_c = attributeValues === null || attributeValues === void 0 ? void 0 : attributeValues[0]) === null || _c === void 0 ? void 0 : _c.uri) !== null && _d !== void 0 ? _d : '',
|
|
214
|
-
data: __assign({ strategy: defaultRuleType }, getStrategyAdditionalFields(metadata, defaultRuleType, mapping, attributeType, currentSurvivorshipGroup))
|
|
215
|
-
}
|
|
216
|
-
]
|
|
235
|
+
attributeType: attributeType,
|
|
236
|
+
attributeValues: [],
|
|
237
|
+
getRuleTypeData: getRuleTypeData
|
|
217
238
|
};
|
|
218
239
|
};
|
|
219
|
-
exports.getRuleTypeValues = getRuleTypeValues;
|
|
220
240
|
var getWinnerCrosswalks = function (attributeValues, crosswalksMap) {
|
|
221
241
|
if (attributeValues === void 0) { attributeValues = []; }
|
|
222
242
|
return (0, ramda_1.pipe)((0, ramda_1.filter)(isOvValue), (0, ramda_1.chain)(function (value) {
|
|
@@ -260,7 +280,13 @@ var getRowValueForColumn = function (columnId, metadata, parentTypeUri, attribut
|
|
|
260
280
|
case 'count':
|
|
261
281
|
return (0, exports.countAttributeValues)(attributeType.type, attributeValues, crosswalksMap);
|
|
262
282
|
case 'ruleType':
|
|
263
|
-
return
|
|
283
|
+
return getRuleTypeValues({
|
|
284
|
+
metadata: metadata,
|
|
285
|
+
attributeType: attributeType,
|
|
286
|
+
parentTypeUri: parentTypeUri,
|
|
287
|
+
attributeValues: attributeValues,
|
|
288
|
+
activeSurvivorshipGroupUri: activeSurvivorshipGroupUri
|
|
289
|
+
});
|
|
264
290
|
case 'winnerSources':
|
|
265
291
|
return { crosswalks: (0, exports.getWinnerCrosswalks)(attributeValues, crosswalksMap) };
|
|
266
292
|
default:
|