@reltio/components 1.4.2226 → 1.4.2228
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/AttributeVerificationStatus/AttributeVerificationStatus.module.css.js +2 -2
- package/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.d.ts +9 -1
- package/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.js +3 -3
- package/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.module.css.js +1 -1
- package/SimpleAttribute/SimpleAttribute.d.ts +5 -2
- package/SimpleAttribute/SimpleAttribute.js +15 -7
- package/SimpleAttribute/SimpleAttribute.module.css.js +9 -0
- package/VerificationButton/VerificationButton.js +9 -17
- package/VerificationButton/VerificationButton.module.css.js +2 -2
- package/cjs/AttributeVerificationStatus/AttributeVerificationStatus.module.css.js +2 -2
- package/cjs/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.d.ts +9 -1
- package/cjs/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.js +3 -3
- package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.module.css.js +1 -1
- package/cjs/SimpleAttribute/SimpleAttribute.d.ts +5 -2
- package/cjs/SimpleAttribute/SimpleAttribute.js +19 -11
- package/cjs/SimpleAttribute/SimpleAttribute.module.css.js +9 -0
- package/cjs/VerificationButton/VerificationButton.js +9 -17
- package/cjs/VerificationButton/VerificationButton.module.css.js +2 -2
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.js +3 -1
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +4 -1
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.js +51 -21
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test.js +56 -0
- package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.d.ts +7 -0
- package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.js +31 -0
- package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.module.css.js +9 -0
- package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/index.d.ts +1 -0
- package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/index.js +5 -0
- package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js +3 -1
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.js +1 -1
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.d.ts +1 -1
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.js +65 -11
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.module.css.js +9 -0
- package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.d.ts +7 -0
- package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.js +15 -0
- package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.d.ts +7 -0
- package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.js +53 -0
- package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.d.ts +2 -0
- package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.js +7 -0
- package/cjs/features/crosswalks/AttributesTable/helpers.d.ts +4 -2
- package/cjs/features/crosswalks/AttributesTable/helpers.js +96 -17
- package/cjs/features/crosswalks/AttributesTable/helpers.test.js +499 -50
- package/cjs/features/crosswalks/AttributesTable/types.d.ts +17 -3
- package/cjs/features/crosswalks/contexts/SyncedValueHeightsContext.d.ts +11 -0
- package/cjs/features/crosswalks/contexts/SyncedValueHeightsContext.js +66 -0
- package/features/crosswalks/AttributesTable/AttributesTable.js +3 -1
- package/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +4 -1
- package/features/crosswalks/AttributesTable/AttributesTable.test-data.js +49 -20
- package/features/crosswalks/AttributesTable/AttributesTable.test.js +58 -2
- package/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.d.ts +7 -0
- package/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.js +24 -0
- package/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.module.css.js +9 -0
- package/features/crosswalks/AttributesTable/components/FallbackIndicator/index.d.ts +1 -0
- package/features/crosswalks/AttributesTable/components/FallbackIndicator/index.js +1 -0
- package/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js +3 -1
- package/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.js +1 -1
- package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.d.ts +1 -1
- package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.js +65 -11
- package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.module.css.js +9 -0
- package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.d.ts +7 -0
- package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.js +8 -0
- package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.d.ts +7 -0
- package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.js +23 -0
- package/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.d.ts +2 -0
- package/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.js +2 -0
- package/features/crosswalks/AttributesTable/helpers.d.ts +4 -2
- package/features/crosswalks/AttributesTable/helpers.js +95 -18
- package/features/crosswalks/AttributesTable/helpers.test.js +501 -52
- package/features/crosswalks/AttributesTable/types.d.ts +17 -3
- package/features/crosswalks/contexts/SyncedValueHeightsContext.d.ts +11 -0
- package/features/crosswalks/contexts/SyncedValueHeightsContext.js +38 -0
- package/package.json +2 -2
- package/SimpleAttribute/styles.d.ts +0 -1
- package/SimpleAttribute/styles.js +0 -42
- package/cjs/SimpleAttribute/styles.d.ts +0 -1
- package/cjs/SimpleAttribute/styles.js +0 -45
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.js +0 -13
- package/cjs/icons/VerifyAllIcon.d.ts +0 -3
- package/cjs/icons/VerifyAllIcon.js +0 -26
- package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.d.ts +0 -1
- package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.js +0 -10
- package/icons/VerifyAllIcon.d.ts +0 -3
- package/icons/VerifyAllIcon.js +0 -21
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
13
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
14
|
if (ar || !(i in from)) {
|
|
@@ -8,8 +19,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
8
19
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
20
|
};
|
|
10
21
|
import i18n from 'ui-i18n';
|
|
11
|
-
import { assoc, chain, curry, descend, filter, find, flatten, map, pickBy, pipe, prop, propEq, propOr, reduce, sortWith, uniq, uniqBy, values
|
|
12
|
-
import { areOneHierarchyUris, DataTypes, findValueInAttributesByUriSuffix, getBaseUri, getCrosswalksTypes, getDefaultSurvivorshipStrategy, getLastUriPart, getReferencedAttrTypeUrisFromAttrType, getSurvivorshipStrategy, isComplexAttribute, isOv, isReference, isTempUri } from '@reltio/mdm-sdk';
|
|
22
|
+
import { assoc, chain, curry, descend, filter, find, flatten, isNil, last, map, pathOr, pickBy, pipe, prop, propEq, propOr, reduce, reject, sortWith, uniq, uniqBy, values } from 'ramda';
|
|
23
|
+
import { areOneHierarchyUris, DataTypes, findValueInAttributesByUriSuffix, getBaseUri, getCrosswalksTypes, getDefaultSurvivorshipStrategy, getLastUriPart, getReferencedAttrTypeUrisFromAttrType, getSurvivorshipStrategy, isComplexAttribute, isOv, isReference, isTempUri, ParticipationStatus } from '@reltio/mdm-sdk';
|
|
13
24
|
import { HeadCellRenderer } from './components/HeadCellRenderer';
|
|
14
25
|
import { AttributesHeadCellRenderer } from './components/AttributesHeadCellRenderer';
|
|
15
26
|
import { DefaultCellValueRenderer } from './components/DefaultCellValueRenderer';
|
|
@@ -107,27 +118,93 @@ var fixReferencedAttributeUri = curry(function (parentType, attrTypeUri) {
|
|
|
107
118
|
return attrTypeUri;
|
|
108
119
|
}
|
|
109
120
|
});
|
|
110
|
-
export var
|
|
111
|
-
|
|
121
|
+
export var collectRuleNames = function (rule) {
|
|
122
|
+
if (!rule) {
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
125
|
+
if (typeof rule === 'string') {
|
|
126
|
+
return [rule];
|
|
127
|
+
}
|
|
128
|
+
var entries = Object.entries(rule);
|
|
129
|
+
return entries.flatMap(function (_a) {
|
|
130
|
+
var key = _a[0], value = _a[1];
|
|
131
|
+
return __spreadArray([key], value.flatMap(collectRuleNames), true);
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
export var getFallbackLabels = function (metadata, ovDetails) {
|
|
135
|
+
if ((ovDetails === null || ovDetails === void 0 ? void 0 : ovDetails.participationStatus) && ovDetails.participationStatus !== ParticipationStatus.Strategy) {
|
|
136
|
+
return [];
|
|
137
|
+
}
|
|
138
|
+
var appliedRules = ovDetails === null || ovDetails === void 0 ? void 0 : ovDetails.appliedSurvivorshipRules;
|
|
139
|
+
var rules = collectRuleNames(appliedRules);
|
|
140
|
+
if (rules.length <= 1) {
|
|
141
|
+
return [];
|
|
142
|
+
}
|
|
143
|
+
return rules.map(function (uri) { var _a; return ((_a = getSurvivorshipStrategy(metadata, uri)) === null || _a === void 0 ? void 0 : _a.label) || uri; });
|
|
144
|
+
};
|
|
145
|
+
var getStrategyAdditionalFields = function (metadata, strategy, mapping, attributeType, currentSurvivorshipGroup) {
|
|
146
|
+
var fixUri = fixReferencedAttributeUri(attributeType);
|
|
147
|
+
var primaryAttributeUri = isOtherAttributeWinnerRule(strategy) ? fixUri(mapping === null || mapping === void 0 ? void 0 : mapping.primaryAttributeUri) : undefined;
|
|
148
|
+
var comparisonAttributeUri = isComplexAttribute(attributeType) && isMinMaxValueRule(strategy)
|
|
149
|
+
? fixUri(mapping === null || mapping === void 0 ? void 0 : mapping.comparisonAttributeUri)
|
|
150
|
+
: undefined;
|
|
151
|
+
var sourcesUriOrder = isSourceSystemRule(strategy)
|
|
152
|
+
? 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))
|
|
153
|
+
: undefined;
|
|
154
|
+
return {
|
|
155
|
+
primaryAttributeUri: primaryAttributeUri,
|
|
156
|
+
comparisonAttributeUri: comparisonAttributeUri,
|
|
157
|
+
sourcesUriOrder: sourcesUriOrder
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
var getAppliedSurvivorshipRules = function (metadata, mapping, attributeType, attributeValues, currentSurvivorshipGroup) {
|
|
161
|
+
if (isComplexAttribute(attributeType) || !attributeValues) {
|
|
162
|
+
return [];
|
|
163
|
+
}
|
|
164
|
+
return pipe(filter(isOvValue), map(function (value) {
|
|
165
|
+
var ovDetails = value.ovDetails;
|
|
166
|
+
if (!ovDetails || !ovDetails.appliedSurvivorshipRules) {
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
if (ovDetails.participationStatus === ParticipationStatus.Strategy) {
|
|
170
|
+
return { type: 'rule', data: ovDetails.appliedSurvivorshipRules, valueUri: value.uri };
|
|
171
|
+
}
|
|
172
|
+
return { type: 'status', data: ovDetails.participationStatus, valueUri: value.uri };
|
|
173
|
+
}), reject(isNil), map(function (ruleOrStatus) {
|
|
174
|
+
if (ruleOrStatus.type === 'status') {
|
|
175
|
+
return ruleOrStatus;
|
|
176
|
+
}
|
|
177
|
+
var appliedRules = collectRuleNames(ruleOrStatus.data);
|
|
178
|
+
var lastRule = getSurvivorshipStrategy(metadata, last(appliedRules));
|
|
179
|
+
return lastRule
|
|
180
|
+
? {
|
|
181
|
+
type: 'rule',
|
|
182
|
+
valueUri: ruleOrStatus.valueUri,
|
|
183
|
+
data: __assign({ strategy: lastRule }, getStrategyAdditionalFields(metadata, lastRule, mapping, attributeType, currentSurvivorshipGroup))
|
|
184
|
+
}
|
|
185
|
+
: null;
|
|
186
|
+
}), reject(isNil))(attributeValues);
|
|
187
|
+
};
|
|
188
|
+
export var getRuleTypeValues = function (metadata, attributeType, parentTypeUri, attributeValues, activeSurvivorshipGroupUri) {
|
|
189
|
+
var _a, _b, _c, _d;
|
|
112
190
|
var parentType = __spreadArray(__spreadArray([], metadata.entityTypes, true), (metadata.relationTypes || []), true).find(propEq('uri', parentTypeUri));
|
|
113
191
|
var survivorshipGroups = (_a = parentType === null || parentType === void 0 ? void 0 : parentType.survivorshipGroups) !== null && _a !== void 0 ? _a : [];
|
|
114
192
|
var currentSurvivorshipGroup = (activeSurvivorshipGroupUri && survivorshipGroups.find(propEq('uri', activeSurvivorshipGroupUri))) ||
|
|
115
193
|
survivorshipGroups.find(propEq('default', true));
|
|
116
194
|
var mapping = (_b = currentSurvivorshipGroup === null || currentSurvivorshipGroup === void 0 ? void 0 : currentSurvivorshipGroup.mapping) === null || _b === void 0 ? void 0 : _b.find(propEq('attribute', attributeType.uri));
|
|
117
|
-
var
|
|
118
|
-
var
|
|
119
|
-
|
|
120
|
-
:
|
|
121
|
-
|
|
122
|
-
var primaryAttributeUri = isOtherAttributeWinnerRule(ruleType) ? fixUri(mapping === null || mapping === void 0 ? void 0 : mapping.primaryAttributeUri) : undefined;
|
|
123
|
-
var comparisonAttributeUri = isComplexAttribute(attributeType) && isMinMaxValueRule(ruleType)
|
|
124
|
-
? fixUri(mapping === null || mapping === void 0 ? void 0 : mapping.comparisonAttributeUri)
|
|
125
|
-
: undefined;
|
|
195
|
+
var defaultRuleType = getSurvivorshipStrategy(metadata, mapping === null || mapping === void 0 ? void 0 : mapping.survivorshipStrategy) || getDefaultSurvivorshipStrategy(metadata);
|
|
196
|
+
var appliedSurvivorshipRules = getAppliedSurvivorshipRules(metadata, mapping, attributeType, attributeValues, currentSurvivorshipGroup);
|
|
197
|
+
if (appliedSurvivorshipRules.length > 0) {
|
|
198
|
+
return { ruleTypes: appliedSurvivorshipRules };
|
|
199
|
+
}
|
|
126
200
|
return {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
201
|
+
ruleTypes: [
|
|
202
|
+
{
|
|
203
|
+
type: 'rule',
|
|
204
|
+
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 : '',
|
|
205
|
+
data: __assign({ strategy: defaultRuleType }, getStrategyAdditionalFields(metadata, defaultRuleType, mapping, attributeType, currentSurvivorshipGroup))
|
|
206
|
+
}
|
|
207
|
+
]
|
|
131
208
|
};
|
|
132
209
|
};
|
|
133
210
|
export var getWinnerCrosswalks = function (attributeValues, crosswalksMap) {
|
|
@@ -172,7 +249,7 @@ var getRowValueForColumn = function (columnId, metadata, parentTypeUri, attribut
|
|
|
172
249
|
case 'count':
|
|
173
250
|
return countAttributeValues(attributeType.type, attributeValues, crosswalksMap);
|
|
174
251
|
case 'ruleType':
|
|
175
|
-
return getRuleTypeValues(metadata, attributeType, parentTypeUri, activeSurvivorshipGroupUri);
|
|
252
|
+
return getRuleTypeValues(metadata, attributeType, parentTypeUri, attributeValues, activeSurvivorshipGroupUri);
|
|
176
253
|
case 'winnerSources':
|
|
177
254
|
return { crosswalks: getWinnerCrosswalks(attributeValues, crosswalksMap) };
|
|
178
255
|
default:
|