@reltio/components 1.4.894 → 1.4.898
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/BasicView/BasicView.d.ts +1 -1
- package/cjs/components/ProfileBandNavigation/ProfileBandNavigationWidget.d.ts +1 -1
- package/cjs/components/ReltioMap/MapControls/TopRightMapControls/TopRightMapControls.d.ts +1 -1
- package/cjs/components/SmallIconButton/SmallIconButton.d.ts +1 -1
- package/cjs/components/SmallIconButton/index.d.ts +2 -2
- package/cjs/components/attributes/PivotingAttributes/PivotingTooltipContent.js +11 -3
- package/cjs/components/attributes/PivotingAttributes/helpers.d.ts +4 -0
- package/cjs/components/attributes/PivotingAttributes/helpers.js +17 -1
- package/cjs/components/attributes/PivotingAttributes/styles.d.ts +1 -1
- package/cjs/components/attributes/PivotingAttributes/styles.js +3 -0
- package/cjs/components/history/ContributorsPanel/styles.d.ts +1 -1
- package/cjs/components/workflow/cards/DataChangeRequestTaskCard/DataChangeRequestTaskCard.js +6 -12
- package/cjs/components/workflow/components/AttributesChanges/AttributesChanges.d.ts +8 -0
- package/cjs/components/workflow/components/AttributesChanges/AttributesChanges.js +47 -0
- package/cjs/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.d.ts +11 -0
- package/cjs/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.js +27 -0
- package/cjs/components/workflow/components/AttributesChanges/components/ChangeView/styles.d.ts +1 -0
- package/cjs/components/workflow/components/AttributesChanges/components/ChangeView/styles.js +55 -0
- package/cjs/components/workflow/components/AttributesChanges/components/DCRChangesList/DCRChangesList.d.ts +7 -0
- package/cjs/components/workflow/components/AttributesChanges/components/DCRChangesList/DCRChangesList.js +25 -0
- package/cjs/components/workflow/components/AttributesChanges/components/DiffRenderer/DiffRenderer.d.ts +15 -0
- package/cjs/components/workflow/components/AttributesChanges/components/DiffRenderer/DiffRenderer.js +61 -0
- package/cjs/components/workflow/components/AttributesChanges/components/DiffRenderer/styles.d.ts +5 -0
- package/cjs/components/workflow/components/AttributesChanges/components/DiffRenderer/styles.js +18 -0
- package/cjs/components/workflow/components/AttributesChanges/components/ShowMoreLink/ShowMoreLink.d.ts +9 -0
- package/cjs/components/workflow/components/AttributesChanges/components/ShowMoreLink/ShowMoreLink.js +18 -0
- package/cjs/components/workflow/components/AttributesChanges/components/ShowMoreLink/styles.d.ts +1 -0
- package/cjs/components/workflow/components/AttributesChanges/components/ShowMoreLink/styles.js +12 -0
- package/cjs/components/workflow/components/AttributesChanges/constants/operations.d.ts +25 -0
- package/cjs/components/workflow/components/AttributesChanges/constants/operations.js +30 -0
- package/cjs/components/workflow/components/AttributesChanges/contexts/AttributesChangesContext.d.ts +3 -0
- package/cjs/components/workflow/components/AttributesChanges/contexts/AttributesChangesContext.js +9 -0
- package/cjs/components/workflow/components/AttributesChanges/helpers/attributesHelpers.d.ts +2 -0
- package/cjs/components/workflow/components/AttributesChanges/helpers/attributesHelpers.js +89 -0
- package/cjs/components/workflow/components/AttributesChanges/helpers/contextHelpers.d.ts +1 -0
- package/cjs/components/workflow/components/AttributesChanges/helpers/contextHelpers.js +5 -0
- package/cjs/components/workflow/components/AttributesChanges/helpers/helpers.d.ts +12 -0
- package/cjs/components/workflow/components/AttributesChanges/helpers/helpers.js +88 -0
- package/cjs/components/workflow/components/AttributesChanges/helpers/mergeHelpers.d.ts +4 -0
- package/cjs/components/workflow/components/AttributesChanges/helpers/mergeHelpers.js +137 -0
- package/cjs/components/workflow/components/AttributesChanges/hooks/useCollapsibleList.d.ts +6 -0
- package/cjs/components/workflow/components/AttributesChanges/hooks/useCollapsibleList.js +18 -0
- package/cjs/components/workflow/components/AttributesChanges/styles.d.ts +1 -0
- package/cjs/components/workflow/components/AttributesChanges/styles.js +27 -0
- package/cjs/components/workflow/components/AttributesChanges/types/DCRTypes.d.ts +63 -0
- package/cjs/components/workflow/components/AttributesChanges/types/DCRTypes.js +2 -0
- package/cjs/components/workflow/components/LineDecorator/styles.js +4 -2
- package/esm/components/BasicView/BasicView.d.ts +1 -1
- package/esm/components/ProfileBandNavigation/ProfileBandNavigationWidget.d.ts +1 -1
- package/esm/components/ReltioMap/MapControls/TopRightMapControls/TopRightMapControls.d.ts +1 -1
- package/esm/components/SmallIconButton/SmallIconButton.d.ts +1 -1
- package/esm/components/SmallIconButton/index.d.ts +2 -2
- package/esm/components/attributes/PivotingAttributes/PivotingTooltipContent.js +13 -5
- package/esm/components/attributes/PivotingAttributes/helpers.d.ts +4 -0
- package/esm/components/attributes/PivotingAttributes/helpers.js +15 -1
- package/esm/components/attributes/PivotingAttributes/styles.d.ts +1 -1
- package/esm/components/attributes/PivotingAttributes/styles.js +3 -0
- package/esm/components/history/ContributorsPanel/styles.d.ts +1 -1
- package/esm/components/workflow/cards/DataChangeRequestTaskCard/DataChangeRequestTaskCard.js +7 -13
- package/esm/components/workflow/components/AttributesChanges/AttributesChanges.d.ts +8 -0
- package/esm/components/workflow/components/AttributesChanges/AttributesChanges.js +23 -0
- package/esm/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.d.ts +11 -0
- package/esm/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.js +22 -0
- package/esm/components/workflow/components/AttributesChanges/components/ChangeView/styles.d.ts +1 -0
- package/esm/components/workflow/components/AttributesChanges/components/ChangeView/styles.js +52 -0
- package/esm/components/workflow/components/AttributesChanges/components/DCRChangesList/DCRChangesList.d.ts +7 -0
- package/esm/components/workflow/components/AttributesChanges/components/DCRChangesList/DCRChangesList.js +20 -0
- package/esm/components/workflow/components/AttributesChanges/components/DiffRenderer/DiffRenderer.d.ts +15 -0
- package/esm/components/workflow/components/AttributesChanges/components/DiffRenderer/DiffRenderer.js +37 -0
- package/esm/components/workflow/components/AttributesChanges/components/DiffRenderer/styles.d.ts +5 -0
- package/esm/components/workflow/components/AttributesChanges/components/DiffRenderer/styles.js +15 -0
- package/esm/components/workflow/components/AttributesChanges/components/ShowMoreLink/ShowMoreLink.d.ts +9 -0
- package/esm/components/workflow/components/AttributesChanges/components/ShowMoreLink/ShowMoreLink.js +13 -0
- package/esm/components/workflow/components/AttributesChanges/components/ShowMoreLink/styles.d.ts +1 -0
- package/esm/components/workflow/components/AttributesChanges/components/ShowMoreLink/styles.js +9 -0
- package/esm/components/workflow/components/AttributesChanges/constants/operations.d.ts +25 -0
- package/esm/components/workflow/components/AttributesChanges/constants/operations.js +27 -0
- package/esm/components/workflow/components/AttributesChanges/contexts/AttributesChangesContext.d.ts +3 -0
- package/esm/components/workflow/components/AttributesChanges/contexts/AttributesChangesContext.js +3 -0
- package/esm/components/workflow/components/AttributesChanges/helpers/attributesHelpers.d.ts +2 -0
- package/esm/components/workflow/components/AttributesChanges/helpers/attributesHelpers.js +86 -0
- package/esm/components/workflow/components/AttributesChanges/helpers/contextHelpers.d.ts +1 -0
- package/esm/components/workflow/components/AttributesChanges/helpers/contextHelpers.js +2 -0
- package/esm/components/workflow/components/AttributesChanges/helpers/helpers.d.ts +12 -0
- package/esm/components/workflow/components/AttributesChanges/helpers/helpers.js +77 -0
- package/esm/components/workflow/components/AttributesChanges/helpers/mergeHelpers.d.ts +4 -0
- package/esm/components/workflow/components/AttributesChanges/helpers/mergeHelpers.js +134 -0
- package/esm/components/workflow/components/AttributesChanges/hooks/useCollapsibleList.d.ts +6 -0
- package/esm/components/workflow/components/AttributesChanges/hooks/useCollapsibleList.js +14 -0
- package/esm/components/workflow/components/AttributesChanges/styles.d.ts +1 -0
- package/esm/components/workflow/components/AttributesChanges/styles.js +24 -0
- package/esm/components/workflow/components/AttributesChanges/types/DCRTypes.d.ts +63 -0
- package/esm/components/workflow/components/AttributesChanges/types/DCRTypes.js +1 -0
- package/esm/components/workflow/components/LineDecorator/styles.js +4 -2
- package/package.json +3 -3
package/cjs/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var react_1 = __importDefault(require("react"));
|
|
7
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
8
|
+
var ArrowRightAlt_1 = __importDefault(require("@material-ui/icons/ArrowRightAlt"));
|
|
9
|
+
var Chip_1 = __importDefault(require("@material-ui/core/Chip"));
|
|
10
|
+
var helpers_1 = require("../../helpers/helpers");
|
|
11
|
+
var styles_1 = require("./styles");
|
|
12
|
+
var ChangeView = function (_a) {
|
|
13
|
+
var label = _a.label, oldValue = _a.oldValue, newValue = _a.newValue, operation = _a.operation, className = _a.className;
|
|
14
|
+
var styles = styles_1.useStyles();
|
|
15
|
+
var value = oldValue || newValue;
|
|
16
|
+
return (react_1.default.createElement("div", { className: classnames_1.default(styles.field, className) },
|
|
17
|
+
react_1.default.createElement("span", { className: styles.fieldName },
|
|
18
|
+
label,
|
|
19
|
+
":"),
|
|
20
|
+
react_1.default.createElement("span", { className: styles.difference },
|
|
21
|
+
value,
|
|
22
|
+
newValue && oldValue && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
23
|
+
react_1.default.createElement(ArrowRightAlt_1.default, { className: styles.arrow }),
|
|
24
|
+
newValue))),
|
|
25
|
+
operation && (react_1.default.createElement(Chip_1.default, { variant: "outlined", label: helpers_1.getOperationLabel(operation), className: classnames_1.default(styles.chip, operation) }))));
|
|
26
|
+
};
|
|
27
|
+
exports.default = ChangeView;
|
package/cjs/components/workflow/components/AttributesChanges/components/ChangeView/styles.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"fieldName" | "difference" | "field" | "arrow" | "chip">;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useStyles = void 0;
|
|
4
|
+
var styles_1 = require("@material-ui/core/styles");
|
|
5
|
+
exports.useStyles = styles_1.makeStyles(function (theme) { return ({
|
|
6
|
+
field: {
|
|
7
|
+
fontSize: '12px',
|
|
8
|
+
lineHeight: '20px',
|
|
9
|
+
color: theme.palette.text.primary,
|
|
10
|
+
marginTop: '6px',
|
|
11
|
+
display: 'flex',
|
|
12
|
+
flexWrap: 'wrap',
|
|
13
|
+
overflow: 'hidden'
|
|
14
|
+
},
|
|
15
|
+
fieldName: {
|
|
16
|
+
display: 'flex',
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
color: theme.palette.text.secondary,
|
|
19
|
+
marginRight: '8px'
|
|
20
|
+
},
|
|
21
|
+
difference: {
|
|
22
|
+
display: 'flex',
|
|
23
|
+
alignItems: 'center',
|
|
24
|
+
flexDirection: 'row'
|
|
25
|
+
},
|
|
26
|
+
arrow: {
|
|
27
|
+
margin: '0 4px',
|
|
28
|
+
fontSize: '12px',
|
|
29
|
+
color: theme.palette.text.primary
|
|
30
|
+
},
|
|
31
|
+
chip: {
|
|
32
|
+
height: '20px',
|
|
33
|
+
fontSize: '10px',
|
|
34
|
+
fontWeight: 500,
|
|
35
|
+
lineHeight: '16px',
|
|
36
|
+
letterSpacing: 0,
|
|
37
|
+
marginLeft: '8px',
|
|
38
|
+
flexShrink: 0,
|
|
39
|
+
textTransform: 'capitalize',
|
|
40
|
+
color: theme.palette.primary.main,
|
|
41
|
+
borderColor: theme.palette.primary.main,
|
|
42
|
+
'&.edited': {
|
|
43
|
+
color: '#CC7500',
|
|
44
|
+
borderColor: '#CC7500'
|
|
45
|
+
},
|
|
46
|
+
'&.added': {
|
|
47
|
+
color: '#599E0E',
|
|
48
|
+
borderColor: '#599E0E'
|
|
49
|
+
},
|
|
50
|
+
'&.deleted': {
|
|
51
|
+
color: '#CF0E26',
|
|
52
|
+
borderColor: '#CF0E26'
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}); });
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var react_1 = __importDefault(require("react"));
|
|
18
|
+
var DiffRenderer_1 = __importDefault(require("../DiffRenderer/DiffRenderer"));
|
|
19
|
+
var DCRChangesList = function (_a) {
|
|
20
|
+
var changes = _a.changes;
|
|
21
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, changes.map(function (change, index) {
|
|
22
|
+
return react_1.default.createElement(DiffRenderer_1.default, __assign({}, change, { key: index }));
|
|
23
|
+
})));
|
|
24
|
+
};
|
|
25
|
+
exports.default = DCRChangesList;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AttributeType } from '@reltio/mdm-sdk';
|
|
3
|
+
import { OperationTypes } from '../../constants/operations';
|
|
4
|
+
import { ChangeValue, DCRAttributeValue } from '../../types/DCRTypes';
|
|
5
|
+
export declare type Props = {
|
|
6
|
+
level: number;
|
|
7
|
+
label: string;
|
|
8
|
+
attributeType: AttributeType;
|
|
9
|
+
attributeValue?: DCRAttributeValue;
|
|
10
|
+
newValue?: ChangeValue;
|
|
11
|
+
oldValue?: ChangeValue;
|
|
12
|
+
operation?: OperationTypes;
|
|
13
|
+
};
|
|
14
|
+
declare const DiffRenderer: ({ label, level, attributeType, attributeValue, oldValue, newValue, operation }: Props) => JSX.Element;
|
|
15
|
+
export default DiffRenderer;
|
package/cjs/components/workflow/components/AttributesChanges/components/DiffRenderer/DiffRenderer.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
var react_1 = __importStar(require("react"));
|
|
26
|
+
var react_redux_1 = require("react-redux");
|
|
27
|
+
var ramda_1 = require("ramda");
|
|
28
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
29
|
+
var mdm_module_1 = __importDefault(require("@reltio/mdm-module"));
|
|
30
|
+
var ChangeView_1 = __importDefault(require("../ChangeView/ChangeView"));
|
|
31
|
+
var helpers_1 = require("../../helpers/helpers");
|
|
32
|
+
var EntityUriLink_1 = __importDefault(require("../../../../../EntityUriLink/EntityUriLink"));
|
|
33
|
+
var AttributesChangesContext_1 = require("../../contexts/AttributesChangesContext");
|
|
34
|
+
var DataTypeValue_1 = __importDefault(require("../../../../../DataTypeValue/DataTypeValue"));
|
|
35
|
+
var styles_1 = require("./styles");
|
|
36
|
+
var DiffRenderer = function (_a) {
|
|
37
|
+
var label = _a.label, level = _a.level, attributeType = _a.attributeType, attributeValue = _a.attributeValue, oldValue = _a.oldValue, newValue = _a.newValue, operation = _a.operation;
|
|
38
|
+
var styles = styles_1.useStyles({ level: level });
|
|
39
|
+
var entity = react_redux_1.useSelector(mdm_module_1.default.selectors.getEntity);
|
|
40
|
+
var objectsInfo = react_1.useContext(AttributesChangesContext_1.AttributesChangesContext);
|
|
41
|
+
var renderLink = react_1.useCallback(function () {
|
|
42
|
+
if (mdm_sdk_1.isReference(attributeType)) {
|
|
43
|
+
var value = ramda_1.when(ramda_1.anyPass([ramda_1.hasPath(['value', 'newValue']), ramda_1.hasPath(['value', 'oldValue'])]), ramda_1.ifElse(ramda_1.hasPath(['value', 'newValue']), ramda_1.path(['value', 'newValue']), ramda_1.path(['value', 'oldValue'])))(attributeValue);
|
|
44
|
+
var _a = helpers_1.getAttributeDescription(attributeType, value, entity.uri, objectsInfo), objectUri = _a.objectUri, objectLabel = _a.objectLabel;
|
|
45
|
+
return (react_1.default.createElement(EntityUriLink_1.default, { value: objectUri, className: styles.uri },
|
|
46
|
+
react_1.default.createElement("span", null, mdm_sdk_1.getLabel(objectLabel))));
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
}, [attributeType, attributeValue, entity.uri, objectsInfo, styles.uri]);
|
|
50
|
+
var changeLabel = react_1.useMemo(function () {
|
|
51
|
+
return (react_1.default.createElement("div", null,
|
|
52
|
+
label,
|
|
53
|
+
renderLink()));
|
|
54
|
+
}, [label, renderLink]);
|
|
55
|
+
var renderValue = react_1.useCallback(function (value) {
|
|
56
|
+
var attrValue = mdm_sdk_1.getAttributeValue(value);
|
|
57
|
+
return (react_1.default.createElement(DataTypeValue_1.default, { value: attrValue, dataTypeDefinition: helpers_1.getDataTypeDefinition(attributeType, attrValue) }));
|
|
58
|
+
}, [attributeType]);
|
|
59
|
+
return (react_1.default.createElement(ChangeView_1.default, { className: styles.change, label: changeLabel, oldValue: oldValue && renderValue(oldValue), newValue: newValue && renderValue(newValue), operation: operation }));
|
|
60
|
+
};
|
|
61
|
+
exports.default = DiffRenderer;
|
package/cjs/components/workflow/components/AttributesChanges/components/DiffRenderer/styles.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useStyles = void 0;
|
|
4
|
+
var styles_1 = require("@material-ui/core/styles");
|
|
5
|
+
exports.useStyles = styles_1.makeStyles(function (theme) { return ({
|
|
6
|
+
uri: {
|
|
7
|
+
color: theme.palette.primary.main,
|
|
8
|
+
textDecoration: 'none',
|
|
9
|
+
cursor: 'pointer',
|
|
10
|
+
marginLeft: '4px'
|
|
11
|
+
},
|
|
12
|
+
change: function (_a) {
|
|
13
|
+
var _b = _a.level, level = _b === void 0 ? 0 : _b;
|
|
14
|
+
return ({
|
|
15
|
+
marginLeft: level * 16 + "px"
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}); });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Props = {
|
|
3
|
+
onClick: () => void;
|
|
4
|
+
suggestionsCount: number;
|
|
5
|
+
isExpanded: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const ShowMoreLink: ({ suggestionsCount, isExpanded, onClick, className }: Props) => JSX.Element;
|
|
9
|
+
export default ShowMoreLink;
|
package/cjs/components/workflow/components/AttributesChanges/components/ShowMoreLink/ShowMoreLink.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var react_1 = __importDefault(require("react"));
|
|
7
|
+
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
8
|
+
var Link_1 = __importDefault(require("@material-ui/core/Link"));
|
|
9
|
+
var styles_1 = require("./styles");
|
|
10
|
+
var ShowMoreLink = function (_a) {
|
|
11
|
+
var suggestionsCount = _a.suggestionsCount, isExpanded = _a.isExpanded, onClick = _a.onClick, className = _a.className;
|
|
12
|
+
var styles = styles_1.useStyles();
|
|
13
|
+
return (react_1.default.createElement(Link_1.default, { component: "button", variant: "caption", underline: "none", onClick: onClick, className: className },
|
|
14
|
+
react_1.default.createElement("span", { className: styles.linkLabel }, isExpanded
|
|
15
|
+
? ui_i18n_1.default.text('View less suggestions')
|
|
16
|
+
: ui_i18n_1.default.text('View ${suggestionsCount} more suggestions', { suggestionsCount: suggestionsCount }))));
|
|
17
|
+
};
|
|
18
|
+
exports.default = ShowMoreLink;
|
package/cjs/components/workflow/components/AttributesChanges/components/ShowMoreLink/styles.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"linkLabel">;
|
package/cjs/components/workflow/components/AttributesChanges/components/ShowMoreLink/styles.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useStyles = void 0;
|
|
4
|
+
var styles_1 = require("@material-ui/core/styles");
|
|
5
|
+
exports.useStyles = styles_1.makeStyles(function (theme) { return ({
|
|
6
|
+
linkLabel: {
|
|
7
|
+
color: theme.palette.primary.main,
|
|
8
|
+
fontSize: '12px',
|
|
9
|
+
letterSpacing: 0,
|
|
10
|
+
lineHeight: '16px'
|
|
11
|
+
}
|
|
12
|
+
}); });
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare enum OperationTypes {
|
|
2
|
+
ADDED = "added",
|
|
3
|
+
EDITED = "edited",
|
|
4
|
+
DELETED = "deleted",
|
|
5
|
+
PINNED = "pinned",
|
|
6
|
+
IGNORED = "ignored",
|
|
7
|
+
PIN_DELETED = "pin_deleted",
|
|
8
|
+
IGNORE_DELETED = "ignore_deleted"
|
|
9
|
+
}
|
|
10
|
+
export declare enum DCRTypes {
|
|
11
|
+
INSERT_ATTRIBUTE = "INSERT_ATTRIBUTE",
|
|
12
|
+
UPDATE_ATTRIBUTE = "UPDATE_ATTRIBUTE",
|
|
13
|
+
DELETE_ATTRIBUTE = "DELETE_ATTRIBUTE",
|
|
14
|
+
PIN_ATTRIBUTE = "PIN_ATTRIBUTE",
|
|
15
|
+
IGNORE_ATTRIBUTE = "IGNORE_ATTRIBUTE",
|
|
16
|
+
CREATE_ENTITY = "CREATE_ENTITY",
|
|
17
|
+
CREATE_RELATIONSHIP = "CREATE_RELATIONSHIP",
|
|
18
|
+
UPDATE_TAGS = "UPDATE_TAGS",
|
|
19
|
+
UPDATE_ROLES = "UPDATE_ROLES",
|
|
20
|
+
UPDATE_START_DATE = "UPDATE_START_DATE",
|
|
21
|
+
UPDATE_END_DATE = "UPDATE_END_DATE",
|
|
22
|
+
UPDATE_PROFILE_PIC_BY_URL = "UPDATE_PROFILE_PIC_BY_URL",
|
|
23
|
+
UPDATE_PROFILE_PIC_BY_URI = "UPDATE_PROFILE_PIC_BY_URI",
|
|
24
|
+
DELETE_RELATIONSHIP = "DELETE_RELATIONSHIP"
|
|
25
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DCRTypes = exports.OperationTypes = void 0;
|
|
4
|
+
var OperationTypes;
|
|
5
|
+
(function (OperationTypes) {
|
|
6
|
+
OperationTypes["ADDED"] = "added";
|
|
7
|
+
OperationTypes["EDITED"] = "edited";
|
|
8
|
+
OperationTypes["DELETED"] = "deleted";
|
|
9
|
+
OperationTypes["PINNED"] = "pinned";
|
|
10
|
+
OperationTypes["IGNORED"] = "ignored";
|
|
11
|
+
OperationTypes["PIN_DELETED"] = "pin_deleted";
|
|
12
|
+
OperationTypes["IGNORE_DELETED"] = "ignore_deleted";
|
|
13
|
+
})(OperationTypes = exports.OperationTypes || (exports.OperationTypes = {}));
|
|
14
|
+
var DCRTypes;
|
|
15
|
+
(function (DCRTypes) {
|
|
16
|
+
DCRTypes["INSERT_ATTRIBUTE"] = "INSERT_ATTRIBUTE";
|
|
17
|
+
DCRTypes["UPDATE_ATTRIBUTE"] = "UPDATE_ATTRIBUTE";
|
|
18
|
+
DCRTypes["DELETE_ATTRIBUTE"] = "DELETE_ATTRIBUTE";
|
|
19
|
+
DCRTypes["PIN_ATTRIBUTE"] = "PIN_ATTRIBUTE";
|
|
20
|
+
DCRTypes["IGNORE_ATTRIBUTE"] = "IGNORE_ATTRIBUTE";
|
|
21
|
+
DCRTypes["CREATE_ENTITY"] = "CREATE_ENTITY";
|
|
22
|
+
DCRTypes["CREATE_RELATIONSHIP"] = "CREATE_RELATIONSHIP";
|
|
23
|
+
DCRTypes["UPDATE_TAGS"] = "UPDATE_TAGS";
|
|
24
|
+
DCRTypes["UPDATE_ROLES"] = "UPDATE_ROLES";
|
|
25
|
+
DCRTypes["UPDATE_START_DATE"] = "UPDATE_START_DATE";
|
|
26
|
+
DCRTypes["UPDATE_END_DATE"] = "UPDATE_END_DATE";
|
|
27
|
+
DCRTypes["UPDATE_PROFILE_PIC_BY_URL"] = "UPDATE_PROFILE_PIC_BY_URL";
|
|
28
|
+
DCRTypes["UPDATE_PROFILE_PIC_BY_URI"] = "UPDATE_PROFILE_PIC_BY_URI";
|
|
29
|
+
DCRTypes["DELETE_RELATIONSHIP"] = "DELETE_RELATIONSHIP";
|
|
30
|
+
})(DCRTypes = exports.DCRTypes || (exports.DCRTypes = {}));
|
package/cjs/components/workflow/components/AttributesChanges/contexts/AttributesChangesContext.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AttributesChangesContext = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
exports.AttributesChangesContext = react_1.default.createContext(null);
|
|
9
|
+
exports.AttributesChangesContext.displayName = 'AttributesChangesContext';
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getChanges = void 0;
|
|
4
|
+
var ramda_1 = require("ramda");
|
|
5
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
6
|
+
var attributesView_1 = require("../../../../attributes/helpers/attributesView");
|
|
7
|
+
var helpers_1 = require("./helpers");
|
|
8
|
+
var operations_1 = require("../constants/operations");
|
|
9
|
+
var getValues = function (attributes, attrType) {
|
|
10
|
+
if ('newValue' in attributes || 'oldValue' in attributes) {
|
|
11
|
+
var newValue = attributes.newValue, oldValue = attributes.oldValue, type_1 = attributes.type;
|
|
12
|
+
var newAttrValues_1 = ramda_1.pathOr([], ['value', attrType.name])(newValue);
|
|
13
|
+
var oldAttrValues_1 = ramda_1.pathOr([], ['value', attrType.name])(oldValue);
|
|
14
|
+
var length_1 = Math.max(newAttrValues_1.length, oldAttrValues_1.length);
|
|
15
|
+
return ramda_1.times(function (index) {
|
|
16
|
+
var attributeValue = {
|
|
17
|
+
newValue: newAttrValues_1[index],
|
|
18
|
+
oldValue: oldAttrValues_1[index],
|
|
19
|
+
type: type_1
|
|
20
|
+
};
|
|
21
|
+
return [{ value: attributeValue }];
|
|
22
|
+
}, length_1);
|
|
23
|
+
}
|
|
24
|
+
var values = attributes[attrType.name];
|
|
25
|
+
return values ? [values] : [];
|
|
26
|
+
};
|
|
27
|
+
var getChanges = ramda_1.curry(function (metadata, objectInfo, changes) {
|
|
28
|
+
var attrTypes = attributesView_1.getFilteredAttrTypes(metadata, objectInfo.type, [], []);
|
|
29
|
+
return getAttributesList(metadata, attrTypes, changes);
|
|
30
|
+
});
|
|
31
|
+
exports.getChanges = getChanges;
|
|
32
|
+
var getAttributesList = function (metadata, attrTypes, attributes, level) {
|
|
33
|
+
if (level === void 0) { level = 0; }
|
|
34
|
+
return ramda_1.flatten(attrTypes
|
|
35
|
+
.map(function (attrType) {
|
|
36
|
+
return getValues(attributes, attrType).map(function (value) {
|
|
37
|
+
return value.map(function (attributeValue) {
|
|
38
|
+
return dcrAttributesFactory(metadata, attrType, attributeValue, level);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
})
|
|
42
|
+
.filter(ramda_1.complement(ramda_1.isEmpty)));
|
|
43
|
+
};
|
|
44
|
+
var dcrAttributesFactory = function (metadata, attributeType, attributeValue, level) {
|
|
45
|
+
switch (attributeType.type) {
|
|
46
|
+
case mdm_sdk_1.DataTypes.TYPE_NESTED:
|
|
47
|
+
case mdm_sdk_1.DataTypes.TYPE_IMAGE:
|
|
48
|
+
return getNestedAttributeChange(metadata, attributeType, attributeValue, level);
|
|
49
|
+
case mdm_sdk_1.DataTypes.TYPE_REFERENCE:
|
|
50
|
+
return getReferenceAttributeChange(metadata, attributeType, attributeValue, level);
|
|
51
|
+
default: {
|
|
52
|
+
var value = mdm_sdk_1.isSpecialAttribute(attributeType) ? attributeValue : attributeValue.value;
|
|
53
|
+
return getSimpleAttributeChange(attributeType, value, level);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
var getNestedAttributeChange = function (metadata, attributeType, attributeValue, level) {
|
|
58
|
+
var attributeTypeList = mdm_sdk_1.getAttributeTypeSubAttributes({}, attributeType);
|
|
59
|
+
var label = mdm_sdk_1.getLabel((attributeType === null || attributeType === void 0 ? void 0 : attributeType.label) || (attributeType === null || attributeType === void 0 ? void 0 : attributeType.name));
|
|
60
|
+
return [
|
|
61
|
+
{ level: level, label: label, attributeType: attributeType, attributeValue: attributeValue },
|
|
62
|
+
getAttributesList(metadata, attributeTypeList, attributeValue.value, level + 1)
|
|
63
|
+
];
|
|
64
|
+
};
|
|
65
|
+
var getReferenceAttributeChange = function (metadata, attributeType, attributeValue, level) {
|
|
66
|
+
var attributeTypeList = mdm_sdk_1.getAttributeTypeSubAttributes(metadata, attributeType);
|
|
67
|
+
var label = (attributeType === null || attributeType === void 0 ? void 0 : attributeType.label) || (attributeType === null || attributeType === void 0 ? void 0 : attributeType.name);
|
|
68
|
+
return [
|
|
69
|
+
{ level: level, label: label, attributeType: attributeType, attributeValue: attributeValue },
|
|
70
|
+
getAttributesList(metadata, attributeTypeList, attributeValue.value, level + 1)
|
|
71
|
+
];
|
|
72
|
+
};
|
|
73
|
+
var getDiffParameters = function (_a) {
|
|
74
|
+
var newValue = _a.newValue, oldValue = _a.oldValue, type = _a.type;
|
|
75
|
+
return type === operations_1.DCRTypes.UPDATE_ATTRIBUTE ? { type: type, newValue: newValue, oldValue: oldValue } : { type: type, newValue: oldValue || newValue };
|
|
76
|
+
};
|
|
77
|
+
var getSimpleAttributeChange = function (attributeType, attributeValue, level) {
|
|
78
|
+
var _a = getDiffParameters(attributeValue), newValue = _a.newValue, oldValue = _a.oldValue, type = _a.type;
|
|
79
|
+
var operation = helpers_1.getOperationType(type, oldValue);
|
|
80
|
+
var label = (attributeType === null || attributeType === void 0 ? void 0 : attributeType.label) || (attributeType === null || attributeType === void 0 ? void 0 : attributeType.name);
|
|
81
|
+
return {
|
|
82
|
+
attributeType: attributeType,
|
|
83
|
+
newValue: newValue,
|
|
84
|
+
oldValue: oldValue,
|
|
85
|
+
operation: operation,
|
|
86
|
+
label: label,
|
|
87
|
+
level: level
|
|
88
|
+
};
|
|
89
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getSuggestionsCount: any;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AttributeType } from '@reltio/mdm-sdk';
|
|
2
|
+
import { OperationTypes } from '../constants/operations';
|
|
3
|
+
import { ChangeRequest, DCRAttributeValue, DCRObjectsInfo, Value } from '../types/DCRTypes';
|
|
4
|
+
export declare const getOperationType: (type: string, oldValue?: DCRAttributeValue) => OperationTypes;
|
|
5
|
+
export declare const getOperationLabel: (operation: OperationTypes) => string;
|
|
6
|
+
export declare const getAttributeDescription: (attrType: AttributeType, value: DCRAttributeValue, currentEntityUri: string, objectsInfo?: DCRObjectsInfo) => {
|
|
7
|
+
objectUri: any;
|
|
8
|
+
objectLabel: any;
|
|
9
|
+
entityTypeUri: any;
|
|
10
|
+
};
|
|
11
|
+
export declare const extractObjectsFromChangeRequest: ({ objectsInfo, changes }: ChangeRequest) => any;
|
|
12
|
+
export declare const getDataTypeDefinition: (attributeType: AttributeType, attributeValue: Value) => any;
|
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.getDataTypeDefinition = exports.extractObjectsFromChangeRequest = exports.getAttributeDescription = exports.getOperationLabel = exports.getOperationType = void 0;
|
|
18
|
+
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
19
|
+
var ramda_1 = require("ramda");
|
|
20
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
21
|
+
var operations_1 = require("../constants/operations");
|
|
22
|
+
var getOperationType = function (type, oldValue) {
|
|
23
|
+
switch (type) {
|
|
24
|
+
case operations_1.DCRTypes.CREATE_RELATIONSHIP:
|
|
25
|
+
case operations_1.DCRTypes.INSERT_ATTRIBUTE:
|
|
26
|
+
return operations_1.OperationTypes.ADDED;
|
|
27
|
+
case operations_1.DCRTypes.UPDATE_TAGS:
|
|
28
|
+
case operations_1.DCRTypes.UPDATE_ROLES:
|
|
29
|
+
case operations_1.DCRTypes.UPDATE_ATTRIBUTE:
|
|
30
|
+
return operations_1.OperationTypes.EDITED;
|
|
31
|
+
case operations_1.DCRTypes.DELETE_ATTRIBUTE:
|
|
32
|
+
case operations_1.DCRTypes.DELETE_RELATIONSHIP:
|
|
33
|
+
return operations_1.OperationTypes.DELETED;
|
|
34
|
+
case operations_1.DCRTypes.PIN_ATTRIBUTE:
|
|
35
|
+
return (oldValue === null || oldValue === void 0 ? void 0 : oldValue.pin) ? operations_1.OperationTypes.PIN_DELETED : operations_1.OperationTypes.PINNED;
|
|
36
|
+
case operations_1.DCRTypes.IGNORE_ATTRIBUTE:
|
|
37
|
+
return (oldValue === null || oldValue === void 0 ? void 0 : oldValue.ignored) ? operations_1.OperationTypes.IGNORE_DELETED : operations_1.OperationTypes.IGNORED;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.getOperationType = getOperationType;
|
|
41
|
+
var getOperationLabel = function (operation) {
|
|
42
|
+
var _a;
|
|
43
|
+
var labels = (_a = {},
|
|
44
|
+
_a[operations_1.OperationTypes.ADDED] = ui_i18n_1.default.text('added'),
|
|
45
|
+
_a[operations_1.OperationTypes.EDITED] = ui_i18n_1.default.text('edited'),
|
|
46
|
+
_a[operations_1.OperationTypes.DELETED] = ui_i18n_1.default.text('deleted'),
|
|
47
|
+
_a[operations_1.OperationTypes.PINNED] = ui_i18n_1.default.text('pinned'),
|
|
48
|
+
_a[operations_1.OperationTypes.PIN_DELETED] = ui_i18n_1.default.text('pin deleted'),
|
|
49
|
+
_a[operations_1.OperationTypes.IGNORED] = ui_i18n_1.default.text('ignored'),
|
|
50
|
+
_a[operations_1.OperationTypes.IGNORE_DELETED] = ui_i18n_1.default.text('ignore deleted'),
|
|
51
|
+
_a);
|
|
52
|
+
return labels[operation] || '';
|
|
53
|
+
};
|
|
54
|
+
exports.getOperationLabel = getOperationLabel;
|
|
55
|
+
var getAttributeDescription = function (attrType, value, currentEntityUri, objectsInfo) {
|
|
56
|
+
if (objectsInfo === void 0) { objectsInfo = {}; }
|
|
57
|
+
var objectLabel, objectUri, entityTypeUri;
|
|
58
|
+
var relation = objectsInfo[value.refObjectURI];
|
|
59
|
+
if (relation) {
|
|
60
|
+
objectUri = currentEntityUri === relation.startObjectUri ? relation.endObjectUri : relation.startObjectUri;
|
|
61
|
+
objectLabel =
|
|
62
|
+
currentEntityUri === relation.startObjectUri ? relation.endObjectLabel : relation.startObjectLabel;
|
|
63
|
+
}
|
|
64
|
+
else if (value.refEntity) {
|
|
65
|
+
objectUri = value.refEntity.objectURI;
|
|
66
|
+
objectLabel = objectsInfo[objectUri].label;
|
|
67
|
+
}
|
|
68
|
+
if (objectUri && objectLabel) {
|
|
69
|
+
var objectInfo = objectsInfo[objectUri];
|
|
70
|
+
entityTypeUri = objectInfo ? objectInfo.type : attrType.referencedEntityTypeURI;
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
objectUri: objectUri,
|
|
74
|
+
objectLabel: objectLabel,
|
|
75
|
+
entityTypeUri: entityTypeUri
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
exports.getAttributeDescription = getAttributeDescription;
|
|
79
|
+
var extractObjectsFromChangeRequest = function (_a) {
|
|
80
|
+
var _b = _a.objectsInfo, objectsInfo = _b === void 0 ? {} : _b, _c = _a.changes, changes = _c === void 0 ? {} : _c;
|
|
81
|
+
var getChange = function (key) { return ramda_1.prop([key], changes); };
|
|
82
|
+
return ramda_1.pipe(ramda_1.keys, ramda_1.filter(getChange), ramda_1.map(function (key) { return (__assign(__assign({}, objectsInfo[key]), { uri: key })); }))(objectsInfo);
|
|
83
|
+
};
|
|
84
|
+
exports.extractObjectsFromChangeRequest = extractObjectsFromChangeRequest;
|
|
85
|
+
var getDataTypeDefinition = function (attributeType, attributeValue) {
|
|
86
|
+
return ramda_1.when(ramda_1.allPass([ramda_1.pipe(ramda_1.prop('type'), ramda_1.equals(mdm_sdk_1.DataTypes.TYPE_STRING)), function () { return mdm_sdk_1.isUrl(attributeValue); }]), ramda_1.evolve({ type: ramda_1.always(mdm_sdk_1.DataTypes.TYPE_URL) }))(mdm_sdk_1.getAttrDataTypeDefinition(attributeType));
|
|
87
|
+
};
|
|
88
|
+
exports.getDataTypeDefinition = getDataTypeDefinition;
|