@reltio/components 1.4.1391 → 1.4.1393
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/CollaborationItem/Comment/styles.d.ts +1 -1
- package/cjs/components/CollaborationItem/RepliedComment/styles.d.ts +1 -1
- package/cjs/components/UserSelector/UserSelector.js +1 -1
- package/cjs/components/crosswalks/AttributesTable/AttributesTable.d.ts +2 -1
- package/cjs/components/crosswalks/AttributesTable/AttributesTable.js +11 -3
- package/cjs/components/crosswalks/AttributesTable/helpers.d.ts +2 -2
- package/cjs/components/crosswalks/AttributesTable/helpers.js +10 -8
- package/cjs/contexts/UsersContext/index.d.ts +1 -1
- package/cjs/hooks/useUsers.d.ts +2 -1
- package/cjs/hooks/useUsers.js +1 -4
- package/esm/components/CollaborationItem/Comment/styles.d.ts +1 -1
- package/esm/components/CollaborationItem/RepliedComment/styles.d.ts +1 -1
- package/esm/components/UserSelector/UserSelector.js +2 -2
- package/esm/components/crosswalks/AttributesTable/AttributesTable.d.ts +2 -1
- package/esm/components/crosswalks/AttributesTable/AttributesTable.js +11 -3
- package/esm/components/crosswalks/AttributesTable/helpers.d.ts +2 -2
- package/esm/components/crosswalks/AttributesTable/helpers.js +10 -8
- package/esm/contexts/UsersContext/index.d.ts +1 -1
- package/esm/hooks/useUsers.d.ts +2 -1
- package/esm/hooks/useUsers.js +1 -4
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"button" | "body" | "header" | "message" | "
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"button" | "body" | "header" | "message" | "username" | "avatar" | "buttons" | "createdAt" | "commentTarget" | "dropdownMenu">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"root" | "header" | "message" | "
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"root" | "header" | "message" | "username" | "avatar" | "createdAt" | "marked">;
|
|
@@ -52,7 +52,7 @@ var UserSelector = function (_a) {
|
|
|
52
52
|
if (!cachedRequest.current) {
|
|
53
53
|
cachedRequest.current = (0, mdm_sdk_1.getAllUsersForTenant)({ tenant: tenant, servicesPath: servicesPath });
|
|
54
54
|
}
|
|
55
|
-
return cachedRequest.current.then((0, ramda_1.pipe)((0, ramda_1.
|
|
55
|
+
return cachedRequest.current.then((0, ramda_1.pipe)((0, ramda_1.pluck)('username'), filterUsers(inputValue), prepareValues));
|
|
56
56
|
};
|
|
57
57
|
return (react_1.default.createElement("div", { className: (0, classnames_1.default)(styles.root, className) },
|
|
58
58
|
react_1.default.createElement(Typography_1.default, { className: styles.title, variant: 'subtitle1' }, ui_i18n_1.default.text('User')),
|
|
@@ -18,6 +18,7 @@ declare type Props = {
|
|
|
18
18
|
onSelectAttributeTypes?: (selected: AttributeType[]) => void;
|
|
19
19
|
additionalHeaderItems?: React.ReactNode;
|
|
20
20
|
className?: string;
|
|
21
|
+
activeSurvivorshipGroupUri?: string;
|
|
21
22
|
};
|
|
22
|
-
declare const _default: React.MemoExoticComponent<({ entity, isLoading, crosswalksMap, visibleColumns, onChangeVisibleColumns, readOnly, onDelete, onPin, onIgnore, onEdit, onAdd, selectedAttributeTypes, onSelectAttributeTypes, additionalHeaderItems, className }: Props) => JSX.Element>;
|
|
23
|
+
declare const _default: React.MemoExoticComponent<({ entity, isLoading, crosswalksMap, visibleColumns, onChangeVisibleColumns, readOnly, onDelete, onPin, onIgnore, onEdit, onAdd, selectedAttributeTypes, onSelectAttributeTypes, additionalHeaderItems, className, activeSurvivorshipGroupUri }: Props) => JSX.Element>;
|
|
23
24
|
export default _default;
|
|
@@ -55,7 +55,7 @@ var core_1 = require("../../../core");
|
|
|
55
55
|
var styles_1 = require("./styles");
|
|
56
56
|
var DEFAULT_ROW_HEIGHT = 68;
|
|
57
57
|
var AttributesTable = function (_a) {
|
|
58
|
-
var entity = _a.entity, isLoading = _a.isLoading, crosswalksMap = _a.crosswalksMap, _b = _a.visibleColumns, visibleColumns = _b === void 0 ? helpers_1.DEFAULT_VISIBLE_COLUMNS : _b, onChangeVisibleColumns = _a.onChangeVisibleColumns, readOnly = _a.readOnly, _c = _a.onDelete, onDelete = _c === void 0 ? core_1.noop : _c, _d = _a.onPin, onPin = _d === void 0 ? core_1.noop : _d, _e = _a.onIgnore, onIgnore = _e === void 0 ? core_1.noop : _e, _f = _a.onEdit, onEdit = _f === void 0 ? core_1.noop : _f, _g = _a.onAdd, onAdd = _g === void 0 ? core_1.noop : _g, selectedAttributeTypes = _a.selectedAttributeTypes, _h = _a.onSelectAttributeTypes, onSelectAttributeTypes = _h === void 0 ? core_1.noop : _h, additionalHeaderItems = _a.additionalHeaderItems, className = _a.className;
|
|
58
|
+
var entity = _a.entity, isLoading = _a.isLoading, crosswalksMap = _a.crosswalksMap, _b = _a.visibleColumns, visibleColumns = _b === void 0 ? helpers_1.DEFAULT_VISIBLE_COLUMNS : _b, onChangeVisibleColumns = _a.onChangeVisibleColumns, readOnly = _a.readOnly, _c = _a.onDelete, onDelete = _c === void 0 ? core_1.noop : _c, _d = _a.onPin, onPin = _d === void 0 ? core_1.noop : _d, _e = _a.onIgnore, onIgnore = _e === void 0 ? core_1.noop : _e, _f = _a.onEdit, onEdit = _f === void 0 ? core_1.noop : _f, _g = _a.onAdd, onAdd = _g === void 0 ? core_1.noop : _g, selectedAttributeTypes = _a.selectedAttributeTypes, _h = _a.onSelectAttributeTypes, onSelectAttributeTypes = _h === void 0 ? core_1.noop : _h, additionalHeaderItems = _a.additionalHeaderItems, className = _a.className, activeSurvivorshipGroupUri = _a.activeSurvivorshipGroupUri;
|
|
59
59
|
var styles = (0, styles_1.useStyles)();
|
|
60
60
|
var visibleColumnsData = (0, react_1.useMemo)(function () {
|
|
61
61
|
return (0, ramda_1.pipe)((0, ramda_1.filter)(function (_a) {
|
|
@@ -73,9 +73,17 @@ var AttributesTable = function (_a) {
|
|
|
73
73
|
}, [entity, selectedAttributeTypes]);
|
|
74
74
|
var rowsData = (0, react_1.useMemo)(function () {
|
|
75
75
|
return parentTypeUri
|
|
76
|
-
? (0, helpers_1.getBasicTableRowsData)(metadata, parentTypeUri, selectedAttributeTypes, visibleColumns, crosswalksMap, attributes)
|
|
76
|
+
? (0, helpers_1.getBasicTableRowsData)(metadata, parentTypeUri, selectedAttributeTypes, visibleColumns, crosswalksMap, attributes, activeSurvivorshipGroupUri)
|
|
77
77
|
: [];
|
|
78
|
-
}, [
|
|
78
|
+
}, [
|
|
79
|
+
metadata,
|
|
80
|
+
parentTypeUri,
|
|
81
|
+
selectedAttributeTypes,
|
|
82
|
+
visibleColumns,
|
|
83
|
+
attributes,
|
|
84
|
+
crosswalksMap,
|
|
85
|
+
activeSurvivorshipGroupUri
|
|
86
|
+
]);
|
|
79
87
|
var _l = (0, BasicTableView_1.useDynamicRowCellHeight)(), getDynamicRowCellHeight = _l.getDynamicRowCellHeight, changeRowCellHeight = _l.changeRowCellHeight;
|
|
80
88
|
var renderRowCell = (0, react_1.useCallback)(function (props) { return (react_1.default.createElement(BasicTableView_1.RowCellAutoSizer, __assign({ onChangeHeight: changeRowCellHeight }, props),
|
|
81
89
|
react_1.default.createElement(RowCellRenderer_1.default, __assign({}, props)))); }, [changeRowCellHeight]);
|
|
@@ -28,7 +28,7 @@ export declare const COLUMNS_DATA: ({
|
|
|
28
28
|
})[];
|
|
29
29
|
export declare const DEFAULT_VISIBLE_COLUMNS: string[];
|
|
30
30
|
export declare const countAttributeValues: (type: string, values: AttributeValue[], crosswalksMap: CrosswalksMap) => number;
|
|
31
|
-
export declare const getRuleTypeValues: (metadata: Metadata, attributeType: AttributeType, parentTypeUri: string) => {
|
|
31
|
+
export declare const getRuleTypeValues: (metadata: Metadata, attributeType: AttributeType, parentTypeUri: string, activeSurvivorshipGroupUri?: string) => {
|
|
32
32
|
ruleType: SurvivorStrategy;
|
|
33
33
|
sourcesUriOrder: any;
|
|
34
34
|
primaryAttributeUri: any;
|
|
@@ -36,4 +36,4 @@ export declare const getRuleTypeValues: (metadata: Metadata, attributeType: Attr
|
|
|
36
36
|
};
|
|
37
37
|
export declare const getWinnerCrosswalks: (attributeValues: AttributeValue[], crosswalksMap: CrosswalksMap) => any;
|
|
38
38
|
export declare const getBasicTableColumnsData: any;
|
|
39
|
-
export declare const getBasicTableRowsData: (metadata: Metadata, parentTypeUri: string, attrTypes: AttributeType[], columns: string[], crosswalksMap: CrosswalksByOwnerTypeMap, attributes: RecordAttributesType) => any[];
|
|
39
|
+
export declare const getBasicTableRowsData: (metadata: Metadata, parentTypeUri: string, attrTypes: AttributeType[], columns: string[], crosswalksMap: CrosswalksByOwnerTypeMap, attributes: RecordAttributesType, activeSurvivorshipGroupUri?: string) => any[];
|
|
@@ -114,14 +114,16 @@ var fixReferencedAttributeUri = (0, ramda_1.curry)(function (parentType, attrTyp
|
|
|
114
114
|
return attrTypeUri;
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
|
-
var getRuleTypeValues = function (metadata, attributeType, parentTypeUri) {
|
|
117
|
+
var getRuleTypeValues = function (metadata, attributeType, parentTypeUri, activeSurvivorshipGroupUri) {
|
|
118
118
|
var _a, _b;
|
|
119
119
|
var parentType = __spreadArray(__spreadArray([], metadata.entityTypes, true), (metadata.relationTypes || []), true).find((0, ramda_1.propEq)('uri', parentTypeUri));
|
|
120
|
-
var
|
|
121
|
-
var
|
|
120
|
+
var survivorshipGroups = (_a = parentType === null || parentType === void 0 ? void 0 : parentType.survivorshipGroups) !== null && _a !== void 0 ? _a : [];
|
|
121
|
+
var currentSurvivorshipGroup = (activeSurvivorshipGroupUri && survivorshipGroups.find((0, ramda_1.propEq)('uri', activeSurvivorshipGroupUri))) ||
|
|
122
|
+
survivorshipGroups.find((0, ramda_1.propEq)('default', true));
|
|
123
|
+
var mapping = (_b = currentSurvivorshipGroup === null || currentSurvivorshipGroup === void 0 ? void 0 : currentSurvivorshipGroup.mapping) === null || _b === void 0 ? void 0 : _b.find((0, ramda_1.propEq)('attribute', attributeType.uri));
|
|
122
124
|
var ruleType = (0, mdm_sdk_1.getSurvivorshipStrategy)(metadata, mapping === null || mapping === void 0 ? void 0 : mapping.survivorshipStrategy) || (0, mdm_sdk_1.getDefaultSurvivorshipStrategy)(metadata);
|
|
123
125
|
var sourcesUriOrder = isSourceSystemRule(ruleType)
|
|
124
|
-
? (0, ramda_1.uniq)(__spreadArray(__spreadArray(__spreadArray([], ((mapping === null || mapping === void 0 ? void 0 : mapping.sourcesUriOrder) || []), true), ((
|
|
126
|
+
? (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))
|
|
125
127
|
: undefined;
|
|
126
128
|
var fixUri = fixReferencedAttributeUri(attributeType);
|
|
127
129
|
var primaryAttributeUri = isOtherAttributeWinnerRule(ruleType) ? fixUri(mapping === null || mapping === void 0 ? void 0 : mapping.primaryAttributeUri) : undefined;
|
|
@@ -162,7 +164,7 @@ exports.getBasicTableColumnsData = (0, ramda_1.map)(function (_a) {
|
|
|
162
164
|
rowCellValueRenderer: getCellValueRenderer(id)
|
|
163
165
|
});
|
|
164
166
|
});
|
|
165
|
-
var getRowValueForColumn = function (columnId, metadata, parentTypeUri, attributeType, crosswalksMap, attributeValues) {
|
|
167
|
+
var getRowValueForColumn = function (columnId, metadata, parentTypeUri, attributeType, crosswalksMap, attributeValues, activeSurvivorshipGroupUri) {
|
|
166
168
|
switch (columnId) {
|
|
167
169
|
case 'ovValues':
|
|
168
170
|
return {
|
|
@@ -178,21 +180,21 @@ var getRowValueForColumn = function (columnId, metadata, parentTypeUri, attribut
|
|
|
178
180
|
case 'count':
|
|
179
181
|
return (0, exports.countAttributeValues)(attributeType.type, attributeValues, crosswalksMap);
|
|
180
182
|
case 'ruleType':
|
|
181
|
-
return (0, exports.getRuleTypeValues)(metadata, attributeType, parentTypeUri);
|
|
183
|
+
return (0, exports.getRuleTypeValues)(metadata, attributeType, parentTypeUri, activeSurvivorshipGroupUri);
|
|
182
184
|
case 'winnerSources':
|
|
183
185
|
return { crosswalks: (0, exports.getWinnerCrosswalks)(attributeValues, crosswalksMap) };
|
|
184
186
|
default:
|
|
185
187
|
return null;
|
|
186
188
|
}
|
|
187
189
|
};
|
|
188
|
-
var getBasicTableRowsData = function (metadata, parentTypeUri, attrTypes, columns, crosswalksMap, attributes) {
|
|
190
|
+
var getBasicTableRowsData = function (metadata, parentTypeUri, attrTypes, columns, crosswalksMap, attributes, activeSurvivorshipGroupUri) {
|
|
189
191
|
if (attrTypes === void 0) { attrTypes = []; }
|
|
190
192
|
return attrTypes.map(function (attributeType) {
|
|
191
193
|
var attrName = (0, mdm_sdk_1.getLastUriPart)(attributeType.uri);
|
|
192
194
|
var attrValues = attributes[attrName];
|
|
193
195
|
var crosswalksMapForAttribute = (0, mdm_sdk_1.isReference)(attributeType) ? crosswalksMap.relation : crosswalksMap.entity;
|
|
194
196
|
return (0, ramda_1.pipe)((0, ramda_1.reduce)(function (acc, columnId) {
|
|
195
|
-
return (0, ramda_1.assoc)(columnId, getRowValueForColumn(columnId, metadata, parentTypeUri, attributeType, crosswalksMapForAttribute, attrValues), acc);
|
|
197
|
+
return (0, ramda_1.assoc)(columnId, getRowValueForColumn(columnId, metadata, parentTypeUri, attributeType, crosswalksMapForAttribute, attrValues, activeSurvivorshipGroupUri), acc);
|
|
196
198
|
}, {}), (0, ramda_1.assoc)('rawValue', attrValues))(columns);
|
|
197
199
|
});
|
|
198
200
|
};
|
package/cjs/hooks/useUsers.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { UserInfo } from '@reltio/mdm-sdk';
|
|
2
|
+
export declare const useUsers: () => UserInfo[];
|
package/cjs/hooks/useUsers.js
CHANGED
|
@@ -18,10 +18,7 @@ var useUsers = function () {
|
|
|
18
18
|
};
|
|
19
19
|
(0, react_1.useEffect)(function () {
|
|
20
20
|
(0, mdm_sdk_1.getAllUsersForTenant)({ tenant: tenant, servicesPath: servicesPath })
|
|
21
|
-
.then(function (
|
|
22
|
-
var array = _a.array;
|
|
23
|
-
return setUsers(array);
|
|
24
|
-
})
|
|
21
|
+
.then(function (users) { return setUsers(users); })
|
|
25
22
|
.catch(onError);
|
|
26
23
|
}, [tenant, servicesPath]);
|
|
27
24
|
return users;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"button" | "body" | "header" | "message" | "
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"button" | "body" | "header" | "message" | "username" | "avatar" | "buttons" | "createdAt" | "commentTarget" | "dropdownMenu">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"root" | "header" | "message" | "
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"root" | "header" | "message" | "username" | "avatar" | "createdAt" | "marked">;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useRef } from 'react';
|
|
2
2
|
import { useSelector } from 'react-redux';
|
|
3
3
|
import i18n from 'ui-i18n';
|
|
4
|
-
import { defaultTo, pipe, pluck
|
|
4
|
+
import { defaultTo, pipe, pluck } from 'ramda';
|
|
5
5
|
import classnames from 'classnames';
|
|
6
6
|
import Typography from '@material-ui/core/Typography';
|
|
7
7
|
import MultiSelect from '../ReactSelect/MultiSelect';
|
|
@@ -24,7 +24,7 @@ var UserSelector = function (_a) {
|
|
|
24
24
|
if (!cachedRequest.current) {
|
|
25
25
|
cachedRequest.current = getAllUsersForTenant({ tenant: tenant, servicesPath: servicesPath });
|
|
26
26
|
}
|
|
27
|
-
return cachedRequest.current.then(pipe(
|
|
27
|
+
return cachedRequest.current.then(pipe(pluck('username'), filterUsers(inputValue), prepareValues));
|
|
28
28
|
};
|
|
29
29
|
return (React.createElement("div", { className: classnames(styles.root, className) },
|
|
30
30
|
React.createElement(Typography, { className: styles.title, variant: 'subtitle1' }, i18n.text('User')),
|
|
@@ -18,6 +18,7 @@ declare type Props = {
|
|
|
18
18
|
onSelectAttributeTypes?: (selected: AttributeType[]) => void;
|
|
19
19
|
additionalHeaderItems?: React.ReactNode;
|
|
20
20
|
className?: string;
|
|
21
|
+
activeSurvivorshipGroupUri?: string;
|
|
21
22
|
};
|
|
22
|
-
declare const _default: React.MemoExoticComponent<({ entity, isLoading, crosswalksMap, visibleColumns, onChangeVisibleColumns, readOnly, onDelete, onPin, onIgnore, onEdit, onAdd, selectedAttributeTypes, onSelectAttributeTypes, additionalHeaderItems, className }: Props) => JSX.Element>;
|
|
23
|
+
declare const _default: React.MemoExoticComponent<({ entity, isLoading, crosswalksMap, visibleColumns, onChangeVisibleColumns, readOnly, onDelete, onPin, onIgnore, onEdit, onAdd, selectedAttributeTypes, onSelectAttributeTypes, additionalHeaderItems, className, activeSurvivorshipGroupUri }: Props) => JSX.Element>;
|
|
23
24
|
export default _default;
|
|
@@ -27,7 +27,7 @@ import { noop } from '../../../core';
|
|
|
27
27
|
import { useStyles } from './styles';
|
|
28
28
|
var DEFAULT_ROW_HEIGHT = 68;
|
|
29
29
|
var AttributesTable = function (_a) {
|
|
30
|
-
var entity = _a.entity, isLoading = _a.isLoading, crosswalksMap = _a.crosswalksMap, _b = _a.visibleColumns, visibleColumns = _b === void 0 ? DEFAULT_VISIBLE_COLUMNS : _b, onChangeVisibleColumns = _a.onChangeVisibleColumns, readOnly = _a.readOnly, _c = _a.onDelete, onDelete = _c === void 0 ? noop : _c, _d = _a.onPin, onPin = _d === void 0 ? noop : _d, _e = _a.onIgnore, onIgnore = _e === void 0 ? noop : _e, _f = _a.onEdit, onEdit = _f === void 0 ? noop : _f, _g = _a.onAdd, onAdd = _g === void 0 ? noop : _g, selectedAttributeTypes = _a.selectedAttributeTypes, _h = _a.onSelectAttributeTypes, onSelectAttributeTypes = _h === void 0 ? noop : _h, additionalHeaderItems = _a.additionalHeaderItems, className = _a.className;
|
|
30
|
+
var entity = _a.entity, isLoading = _a.isLoading, crosswalksMap = _a.crosswalksMap, _b = _a.visibleColumns, visibleColumns = _b === void 0 ? DEFAULT_VISIBLE_COLUMNS : _b, onChangeVisibleColumns = _a.onChangeVisibleColumns, readOnly = _a.readOnly, _c = _a.onDelete, onDelete = _c === void 0 ? noop : _c, _d = _a.onPin, onPin = _d === void 0 ? noop : _d, _e = _a.onIgnore, onIgnore = _e === void 0 ? noop : _e, _f = _a.onEdit, onEdit = _f === void 0 ? noop : _f, _g = _a.onAdd, onAdd = _g === void 0 ? noop : _g, selectedAttributeTypes = _a.selectedAttributeTypes, _h = _a.onSelectAttributeTypes, onSelectAttributeTypes = _h === void 0 ? noop : _h, additionalHeaderItems = _a.additionalHeaderItems, className = _a.className, activeSurvivorshipGroupUri = _a.activeSurvivorshipGroupUri;
|
|
31
31
|
var styles = useStyles();
|
|
32
32
|
var visibleColumnsData = useMemo(function () {
|
|
33
33
|
return pipe(filter(function (_a) {
|
|
@@ -45,9 +45,17 @@ var AttributesTable = function (_a) {
|
|
|
45
45
|
}, [entity, selectedAttributeTypes]);
|
|
46
46
|
var rowsData = useMemo(function () {
|
|
47
47
|
return parentTypeUri
|
|
48
|
-
? getBasicTableRowsData(metadata, parentTypeUri, selectedAttributeTypes, visibleColumns, crosswalksMap, attributes)
|
|
48
|
+
? getBasicTableRowsData(metadata, parentTypeUri, selectedAttributeTypes, visibleColumns, crosswalksMap, attributes, activeSurvivorshipGroupUri)
|
|
49
49
|
: [];
|
|
50
|
-
}, [
|
|
50
|
+
}, [
|
|
51
|
+
metadata,
|
|
52
|
+
parentTypeUri,
|
|
53
|
+
selectedAttributeTypes,
|
|
54
|
+
visibleColumns,
|
|
55
|
+
attributes,
|
|
56
|
+
crosswalksMap,
|
|
57
|
+
activeSurvivorshipGroupUri
|
|
58
|
+
]);
|
|
51
59
|
var _l = useDynamicRowCellHeight(), getDynamicRowCellHeight = _l.getDynamicRowCellHeight, changeRowCellHeight = _l.changeRowCellHeight;
|
|
52
60
|
var renderRowCell = useCallback(function (props) { return (React.createElement(RowCellAutoSizer, __assign({ onChangeHeight: changeRowCellHeight }, props),
|
|
53
61
|
React.createElement(RowCellRenderer, __assign({}, props)))); }, [changeRowCellHeight]);
|
|
@@ -28,7 +28,7 @@ export declare const COLUMNS_DATA: ({
|
|
|
28
28
|
})[];
|
|
29
29
|
export declare const DEFAULT_VISIBLE_COLUMNS: string[];
|
|
30
30
|
export declare const countAttributeValues: (type: string, values: AttributeValue[], crosswalksMap: CrosswalksMap) => number;
|
|
31
|
-
export declare const getRuleTypeValues: (metadata: Metadata, attributeType: AttributeType, parentTypeUri: string) => {
|
|
31
|
+
export declare const getRuleTypeValues: (metadata: Metadata, attributeType: AttributeType, parentTypeUri: string, activeSurvivorshipGroupUri?: string) => {
|
|
32
32
|
ruleType: SurvivorStrategy;
|
|
33
33
|
sourcesUriOrder: any;
|
|
34
34
|
primaryAttributeUri: any;
|
|
@@ -36,4 +36,4 @@ export declare const getRuleTypeValues: (metadata: Metadata, attributeType: Attr
|
|
|
36
36
|
};
|
|
37
37
|
export declare const getWinnerCrosswalks: (attributeValues: AttributeValue[], crosswalksMap: CrosswalksMap) => any;
|
|
38
38
|
export declare const getBasicTableColumnsData: any;
|
|
39
|
-
export declare const getBasicTableRowsData: (metadata: Metadata, parentTypeUri: string, attrTypes: AttributeType[], columns: string[], crosswalksMap: CrosswalksByOwnerTypeMap, attributes: RecordAttributesType) => any[];
|
|
39
|
+
export declare const getBasicTableRowsData: (metadata: Metadata, parentTypeUri: string, attrTypes: AttributeType[], columns: string[], crosswalksMap: CrosswalksByOwnerTypeMap, attributes: RecordAttributesType, activeSurvivorshipGroupUri?: string) => any[];
|
|
@@ -107,14 +107,16 @@ var fixReferencedAttributeUri = curry(function (parentType, attrTypeUri) {
|
|
|
107
107
|
return attrTypeUri;
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
|
-
export var getRuleTypeValues = function (metadata, attributeType, parentTypeUri) {
|
|
110
|
+
export var getRuleTypeValues = function (metadata, attributeType, parentTypeUri, activeSurvivorshipGroupUri) {
|
|
111
111
|
var _a, _b;
|
|
112
112
|
var parentType = __spreadArray(__spreadArray([], metadata.entityTypes, true), (metadata.relationTypes || []), true).find(propEq('uri', parentTypeUri));
|
|
113
|
-
var
|
|
114
|
-
var
|
|
113
|
+
var survivorshipGroups = (_a = parentType === null || parentType === void 0 ? void 0 : parentType.survivorshipGroups) !== null && _a !== void 0 ? _a : [];
|
|
114
|
+
var currentSurvivorshipGroup = (activeSurvivorshipGroupUri && survivorshipGroups.find(propEq('uri', activeSurvivorshipGroupUri))) ||
|
|
115
|
+
survivorshipGroups.find(propEq('default', true));
|
|
116
|
+
var mapping = (_b = currentSurvivorshipGroup === null || currentSurvivorshipGroup === void 0 ? void 0 : currentSurvivorshipGroup.mapping) === null || _b === void 0 ? void 0 : _b.find(propEq('attribute', attributeType.uri));
|
|
115
117
|
var ruleType = getSurvivorshipStrategy(metadata, mapping === null || mapping === void 0 ? void 0 : mapping.survivorshipStrategy) || getDefaultSurvivorshipStrategy(metadata);
|
|
116
118
|
var sourcesUriOrder = isSourceSystemRule(ruleType)
|
|
117
|
-
? uniq(__spreadArray(__spreadArray(__spreadArray([], ((mapping === null || mapping === void 0 ? void 0 : mapping.sourcesUriOrder) || []), true), ((
|
|
119
|
+
? 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))
|
|
118
120
|
: undefined;
|
|
119
121
|
var fixUri = fixReferencedAttributeUri(attributeType);
|
|
120
122
|
var primaryAttributeUri = isOtherAttributeWinnerRule(ruleType) ? fixUri(mapping === null || mapping === void 0 ? void 0 : mapping.primaryAttributeUri) : undefined;
|
|
@@ -153,7 +155,7 @@ export var getBasicTableColumnsData = map(function (_a) {
|
|
|
153
155
|
rowCellValueRenderer: getCellValueRenderer(id)
|
|
154
156
|
});
|
|
155
157
|
});
|
|
156
|
-
var getRowValueForColumn = function (columnId, metadata, parentTypeUri, attributeType, crosswalksMap, attributeValues) {
|
|
158
|
+
var getRowValueForColumn = function (columnId, metadata, parentTypeUri, attributeType, crosswalksMap, attributeValues, activeSurvivorshipGroupUri) {
|
|
157
159
|
switch (columnId) {
|
|
158
160
|
case 'ovValues':
|
|
159
161
|
return {
|
|
@@ -169,21 +171,21 @@ var getRowValueForColumn = function (columnId, metadata, parentTypeUri, attribut
|
|
|
169
171
|
case 'count':
|
|
170
172
|
return countAttributeValues(attributeType.type, attributeValues, crosswalksMap);
|
|
171
173
|
case 'ruleType':
|
|
172
|
-
return getRuleTypeValues(metadata, attributeType, parentTypeUri);
|
|
174
|
+
return getRuleTypeValues(metadata, attributeType, parentTypeUri, activeSurvivorshipGroupUri);
|
|
173
175
|
case 'winnerSources':
|
|
174
176
|
return { crosswalks: getWinnerCrosswalks(attributeValues, crosswalksMap) };
|
|
175
177
|
default:
|
|
176
178
|
return null;
|
|
177
179
|
}
|
|
178
180
|
};
|
|
179
|
-
export var getBasicTableRowsData = function (metadata, parentTypeUri, attrTypes, columns, crosswalksMap, attributes) {
|
|
181
|
+
export var getBasicTableRowsData = function (metadata, parentTypeUri, attrTypes, columns, crosswalksMap, attributes, activeSurvivorshipGroupUri) {
|
|
180
182
|
if (attrTypes === void 0) { attrTypes = []; }
|
|
181
183
|
return attrTypes.map(function (attributeType) {
|
|
182
184
|
var attrName = getLastUriPart(attributeType.uri);
|
|
183
185
|
var attrValues = attributes[attrName];
|
|
184
186
|
var crosswalksMapForAttribute = isReference(attributeType) ? crosswalksMap.relation : crosswalksMap.entity;
|
|
185
187
|
return pipe(reduce(function (acc, columnId) {
|
|
186
|
-
return assoc(columnId, getRowValueForColumn(columnId, metadata, parentTypeUri, attributeType, crosswalksMapForAttribute, attrValues), acc);
|
|
188
|
+
return assoc(columnId, getRowValueForColumn(columnId, metadata, parentTypeUri, attributeType, crosswalksMapForAttribute, attrValues, activeSurvivorshipGroupUri), acc);
|
|
187
189
|
}, {}), assoc('rawValue', attrValues))(columns);
|
|
188
190
|
});
|
|
189
191
|
};
|
package/esm/hooks/useUsers.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { UserInfo } from '@reltio/mdm-sdk';
|
|
2
|
+
export declare const useUsers: () => UserInfo[];
|
package/esm/hooks/useUsers.js
CHANGED
|
@@ -12,10 +12,7 @@ export var useUsers = function () {
|
|
|
12
12
|
};
|
|
13
13
|
useEffect(function () {
|
|
14
14
|
getAllUsersForTenant({ tenant: tenant, servicesPath: servicesPath })
|
|
15
|
-
.then(function (
|
|
16
|
-
var array = _a.array;
|
|
17
|
-
return setUsers(array);
|
|
18
|
-
})
|
|
15
|
+
.then(function (users) { return setUsers(users); })
|
|
19
16
|
.catch(onError);
|
|
20
17
|
}, [tenant, servicesPath]);
|
|
21
18
|
return users;
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1393",
|
|
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.1393",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1393",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|