@reltio/components 1.4.911 → 1.4.915

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.
Files changed (103) hide show
  1. package/cjs/components/MergeButton/MergeButton.d.ts +1 -0
  2. package/cjs/components/MergeButton/MergeButton.js +3 -2
  3. package/cjs/components/attributes/ImageAttributesLine/ImageAttributesLine.d.ts +7 -2
  4. package/cjs/components/attributes/ImageAttributesLine/ImageAttributesLine.js +15 -1
  5. package/cjs/components/attributes/editMode/AttributesPager/AttributesPager.js +1 -1
  6. package/cjs/components/attributes/editMode/ImageAttributesLine/ImageAttributesLine.d.ts +8 -2
  7. package/cjs/components/attributes/editMode/ImageAttributesLine/ImageAttributesLine.js +5 -5
  8. package/cjs/components/attributes/editMode/SimpleAttributeEditor/selectors/helpers/parents.js +3 -1
  9. package/cjs/components/attributes/readMode/AttributesPager/AttributesPager.js +1 -1
  10. package/cjs/components/attributes/readMode/ImageAttributesLine/ImageAttributesLine.d.ts +7 -2
  11. package/cjs/components/attributes/readMode/ImageAttributesLine/ImageAttributesLine.js +2 -2
  12. package/cjs/components/index.d.ts +1 -0
  13. package/cjs/components/index.js +5 -3
  14. package/cjs/components/workflow/cards/DataChangeRequestTaskCard/DataChangeRequestTaskCard.js +6 -30
  15. package/cjs/components/workflow/components/AttributesChanges/AttributesChanges.d.ts +7 -4
  16. package/cjs/components/workflow/components/AttributesChanges/AttributesChanges.js +19 -9
  17. package/cjs/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.d.ts +4 -4
  18. package/cjs/components/workflow/components/AttributesChanges/components/ChangeView/styles.js +3 -9
  19. package/cjs/components/workflow/components/AttributesChanges/components/DCRChangesList/DCRChangesList.d.ts +2 -2
  20. package/cjs/components/workflow/components/AttributesChanges/components/DCRChangesList/DCRChangesList.js +4 -1
  21. package/cjs/components/workflow/components/AttributesChanges/components/DCRChangesList/styles.d.ts +1 -0
  22. package/cjs/components/workflow/components/AttributesChanges/components/DCRChangesList/styles.js +13 -0
  23. package/cjs/components/workflow/components/AttributesChanges/components/DiffRenderer/DiffRenderer.d.ts +2 -13
  24. package/cjs/components/workflow/components/AttributesChanges/components/DiffRenderer/DiffRenderer.js +25 -9
  25. package/cjs/components/workflow/components/AttributesChanges/components/DiffRenderer/styles.d.ts +1 -1
  26. package/cjs/components/workflow/components/AttributesChanges/components/DiffRenderer/styles.js +14 -2
  27. package/cjs/components/workflow/components/AttributesChanges/contexts/AttributesChangesContext.d.ts +1 -1
  28. package/cjs/components/workflow/components/AttributesChanges/helpers/attributesHelpers.d.ts +3 -2
  29. package/cjs/components/workflow/components/AttributesChanges/helpers/attributesHelpers.js +35 -6
  30. package/cjs/components/workflow/components/AttributesChanges/helpers/helpers.d.ts +4 -6
  31. package/cjs/components/workflow/components/AttributesChanges/helpers/helpers.js +4 -26
  32. package/cjs/components/workflow/components/AttributesChanges/helpers/mergeHelpers.d.ts +3 -2
  33. package/cjs/components/workflow/components/AttributesChanges/helpers/mergeHelpers.js +109 -28
  34. package/cjs/components/workflow/components/AttributesChanges/hooks/useCollapsibleList.d.ts +3 -2
  35. package/cjs/components/workflow/components/AttributesChanges/hooks/useCollapsibleList.js +4 -4
  36. package/cjs/components/workflow/components/AttributesChanges/types/diffTypes.d.ts +16 -0
  37. package/cjs/components/workflow/components/AttributesChanges/types/{DCRTypes.js → diffTypes.js} +0 -0
  38. package/cjs/components/workflow/components/LineDecorator/LineDecorator.d.ts +2 -1
  39. package/cjs/components/workflow/components/LineDecorator/LineDecorator.js +5 -2
  40. package/cjs/components/workflow/components/LineDecorator/styles.d.ts +1 -1
  41. package/cjs/components/workflow/components/LineDecorator/styles.js +4 -1
  42. package/cjs/components/workflow/{components/AttributesChanges/constants → constants}/operations.d.ts +0 -0
  43. package/cjs/components/workflow/{components/AttributesChanges/constants → constants}/operations.js +0 -0
  44. package/cjs/components/workflow/helpers/dcrHelpers.d.ts +7 -0
  45. package/cjs/components/workflow/helpers/dcrHelpers.js +48 -0
  46. package/cjs/components/workflow/hooks/useChangeRequest.d.ts +5 -0
  47. package/cjs/components/workflow/hooks/useChangeRequest.js +58 -0
  48. package/{esm/components/workflow/components/AttributesChanges/types/DCRTypes.d.ts → cjs/components/workflow/types/dcrTypes.d.ts} +22 -16
  49. package/cjs/components/workflow/types/dcrTypes.js +2 -0
  50. package/cjs/hooks/useMergeAllRequest.d.ts +2 -1
  51. package/cjs/hooks/useMergeAllRequest.js +6 -3
  52. package/esm/components/MergeButton/MergeButton.d.ts +1 -0
  53. package/esm/components/MergeButton/MergeButton.js +3 -2
  54. package/esm/components/attributes/ImageAttributesLine/ImageAttributesLine.d.ts +7 -2
  55. package/esm/components/attributes/ImageAttributesLine/ImageAttributesLine.js +15 -1
  56. package/esm/components/attributes/editMode/AttributesPager/AttributesPager.js +1 -1
  57. package/esm/components/attributes/editMode/ImageAttributesLine/ImageAttributesLine.d.ts +8 -2
  58. package/esm/components/attributes/editMode/ImageAttributesLine/ImageAttributesLine.js +6 -6
  59. package/esm/components/attributes/editMode/SimpleAttributeEditor/selectors/helpers/parents.js +3 -1
  60. package/esm/components/attributes/readMode/AttributesPager/AttributesPager.js +1 -1
  61. package/esm/components/attributes/readMode/ImageAttributesLine/ImageAttributesLine.d.ts +7 -2
  62. package/esm/components/attributes/readMode/ImageAttributesLine/ImageAttributesLine.js +2 -2
  63. package/esm/components/index.d.ts +1 -0
  64. package/esm/components/index.js +1 -0
  65. package/esm/components/workflow/cards/DataChangeRequestTaskCard/DataChangeRequestTaskCard.js +6 -11
  66. package/esm/components/workflow/components/AttributesChanges/AttributesChanges.d.ts +7 -4
  67. package/esm/components/workflow/components/AttributesChanges/AttributesChanges.js +19 -9
  68. package/esm/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.d.ts +4 -4
  69. package/esm/components/workflow/components/AttributesChanges/components/ChangeView/styles.js +3 -9
  70. package/esm/components/workflow/components/AttributesChanges/components/DCRChangesList/DCRChangesList.d.ts +2 -2
  71. package/esm/components/workflow/components/AttributesChanges/components/DCRChangesList/DCRChangesList.js +4 -1
  72. package/esm/components/workflow/components/AttributesChanges/components/DCRChangesList/styles.d.ts +1 -0
  73. package/esm/components/workflow/components/AttributesChanges/components/DCRChangesList/styles.js +10 -0
  74. package/esm/components/workflow/components/AttributesChanges/components/DiffRenderer/DiffRenderer.d.ts +2 -13
  75. package/esm/components/workflow/components/AttributesChanges/components/DiffRenderer/DiffRenderer.js +26 -10
  76. package/esm/components/workflow/components/AttributesChanges/components/DiffRenderer/styles.d.ts +1 -1
  77. package/esm/components/workflow/components/AttributesChanges/components/DiffRenderer/styles.js +14 -2
  78. package/esm/components/workflow/components/AttributesChanges/contexts/AttributesChangesContext.d.ts +1 -1
  79. package/esm/components/workflow/components/AttributesChanges/helpers/attributesHelpers.d.ts +3 -2
  80. package/esm/components/workflow/components/AttributesChanges/helpers/attributesHelpers.js +35 -7
  81. package/esm/components/workflow/components/AttributesChanges/helpers/helpers.d.ts +4 -6
  82. package/esm/components/workflow/components/AttributesChanges/helpers/helpers.js +4 -25
  83. package/esm/components/workflow/components/AttributesChanges/helpers/mergeHelpers.d.ts +3 -2
  84. package/esm/components/workflow/components/AttributesChanges/helpers/mergeHelpers.js +112 -31
  85. package/esm/components/workflow/components/AttributesChanges/hooks/useCollapsibleList.d.ts +3 -2
  86. package/esm/components/workflow/components/AttributesChanges/hooks/useCollapsibleList.js +4 -4
  87. package/esm/components/workflow/components/AttributesChanges/types/diffTypes.d.ts +16 -0
  88. package/esm/components/workflow/components/AttributesChanges/types/{DCRTypes.js → diffTypes.js} +0 -0
  89. package/esm/components/workflow/components/LineDecorator/LineDecorator.d.ts +2 -1
  90. package/esm/components/workflow/components/LineDecorator/LineDecorator.js +5 -2
  91. package/esm/components/workflow/components/LineDecorator/styles.d.ts +1 -1
  92. package/esm/components/workflow/components/LineDecorator/styles.js +4 -1
  93. package/esm/components/workflow/{components/AttributesChanges/constants → constants}/operations.d.ts +0 -0
  94. package/esm/components/workflow/{components/AttributesChanges/constants → constants}/operations.js +0 -0
  95. package/esm/components/workflow/helpers/dcrHelpers.d.ts +7 -0
  96. package/esm/components/workflow/helpers/dcrHelpers.js +43 -0
  97. package/esm/components/workflow/hooks/useChangeRequest.d.ts +5 -0
  98. package/esm/components/workflow/hooks/useChangeRequest.js +54 -0
  99. package/{cjs/components/workflow/components/AttributesChanges/types/DCRTypes.d.ts → esm/components/workflow/types/dcrTypes.d.ts} +22 -16
  100. package/esm/components/workflow/types/dcrTypes.js +1 -0
  101. package/esm/hooks/useMergeAllRequest.d.ts +2 -1
  102. package/esm/hooks/useMergeAllRequest.js +6 -3
  103. package/package.json +3 -3
@@ -1,10 +1,26 @@
1
- import { Crosswalk, NestedAttributeValue, ReferenceAttributeValue, SimpleAttributeValue } from '@reltio/mdm-sdk';
1
+ import { Crosswalk, Entity, NestedAttributeValue, ReferenceAttributeValue, Relation, SimpleAttributeValue } from '@reltio/mdm-sdk';
2
2
  import { DCRTypes } from '../constants/operations';
3
+ export declare type ChangeRequest = {
4
+ changes: DCRChanges;
5
+ createdBy: string;
6
+ createdTime: number;
7
+ objectsInfo: DCRObjectsInfo;
8
+ state: string;
9
+ type: string;
10
+ updatedBy: string;
11
+ updatedTime: number;
12
+ uri: string;
13
+ };
14
+ export declare type GroupedObjectsInfo = {
15
+ entity: EntityInfo;
16
+ relations: RelationInfo[];
17
+ };
3
18
  export declare type EntityInfo = {
4
19
  isExist: boolean;
5
20
  label: string;
6
21
  secondaryLabel: string;
7
22
  type: string;
23
+ uri?: string;
8
24
  };
9
25
  export declare type RelationInfo = {
10
26
  type: string;
@@ -13,11 +29,15 @@ export declare type RelationInfo = {
13
29
  endObjectLabel: string;
14
30
  endObjectUri: string;
15
31
  isExist: boolean;
32
+ uri?: string;
16
33
  };
17
34
  export declare type DCRObjectInfo = EntityInfo | RelationInfo;
18
35
  export declare type DCRObjectsInfo = {
19
36
  [key: string]: DCRObjectInfo;
20
37
  };
38
+ export declare type DCRAttributes = {
39
+ [attributeName: string]: (ChangeValue | DCRChange)[];
40
+ };
21
41
  export declare type Value = DCRAttributes | DCRChange | string | boolean | number;
22
42
  export declare type DCRAttributeValue = Omit<SimpleAttributeValue | NestedAttributeValue | ReferenceAttributeValue, 'uri' | 'value'> & {
23
43
  value: Value;
@@ -27,10 +47,7 @@ export declare type DCRAttributeValue = Omit<SimpleAttributeValue | NestedAttrib
27
47
  };
28
48
  uri?: string;
29
49
  };
30
- export declare type DCRAttributes = {
31
- [attributeName: string]: DCRAttributeValue[];
32
- };
33
- export declare type ChangeValue = DCRAttributeValue | string[];
50
+ export declare type ChangeValue = DCRAttributeValue | string[] | Entity | Relation;
34
51
  export declare type DCRChange = {
35
52
  attributePath?: string;
36
53
  attributeType?: string;
@@ -50,14 +67,3 @@ export declare type DCRChange = {
50
67
  export declare type DCRChanges = {
51
68
  [key: string]: DCRChange[];
52
69
  };
53
- export declare type ChangeRequest = {
54
- changes: DCRChanges;
55
- createdBy: string;
56
- createdTime: number;
57
- objectsInfo: DCRObjectsInfo;
58
- state: string;
59
- type: string;
60
- updatedBy: string;
61
- updatedTime: number;
62
- uri: string;
63
- };
@@ -0,0 +1 @@
1
+ export {};
@@ -4,8 +4,9 @@ declare type Props = {
4
4
  entity: Entity;
5
5
  onFinishRequest?: () => void;
6
6
  onStartRequest?: () => void;
7
+ onError?: () => void;
7
8
  };
8
- export declare const useMergeAllRequest: ({ entities, entity, onFinishRequest, onStartRequest }: Props) => {
9
+ export declare const useMergeAllRequest: ({ entities, entity, onFinishRequest, onStartRequest, onError }: Props) => {
9
10
  isPending: boolean;
10
11
  sendMergeAllRequest: () => void;
11
12
  };
@@ -2,18 +2,21 @@ import { useCallback, useState } from 'react';
2
2
  import { useSelector } from 'react-redux';
3
3
  import mdmModule from '@reltio/mdm-module';
4
4
  import { isDataTenantEntity, mergeCustomerTenantEntityWithMixedEntities, mergeDataTenantEntity } from '@reltio/mdm-sdk';
5
+ import { noop } from '../core';
5
6
  export var useMergeAllRequest = function (_a) {
6
- var entities = _a.entities, entity = _a.entity, onFinishRequest = _a.onFinishRequest, onStartRequest = _a.onStartRequest;
7
+ var entities = _a.entities, entity = _a.entity, onFinishRequest = _a.onFinishRequest, onStartRequest = _a.onStartRequest, _b = _a.onError, onError = _b === void 0 ? noop : _b;
7
8
  var tenant = useSelector(mdmModule.selectors.getTenant);
8
9
  var dtssPath = useSelector(mdmModule.selectors.getDtssPath);
9
- var _b = useState(false), isPending = _b[0], setIsPending = _b[1];
10
+ var _c = useState(false), isPending = _c[0], setIsPending = _c[1];
10
11
  var sendMergeAllRequest = useCallback(function () {
11
12
  onStartRequest === null || onStartRequest === void 0 ? void 0 : onStartRequest();
12
13
  setIsPending(true);
13
14
  var params = { dtssPath: dtssPath, customerTenant: tenant, entity: entity, entities: entities };
14
15
  (isDataTenantEntity(entity)
15
16
  ? mergeDataTenantEntity(params)
16
- : mergeCustomerTenantEntityWithMixedEntities(params)).finally(function () {
17
+ : mergeCustomerTenantEntityWithMixedEntities(params))
18
+ .catch(onError)
19
+ .finally(function () {
17
20
  onFinishRequest === null || onFinishRequest === void 0 ? void 0 : onFinishRequest();
18
21
  setIsPending(false);
19
22
  });
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.911",
3
+ "version": "1.4.915",
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.911",
11
- "@reltio/mdm-sdk": "^1.4.911",
10
+ "@reltio/mdm-module": "^1.4.915",
11
+ "@reltio/mdm-sdk": "^1.4.915",
12
12
  "classnames": "^2.2.5",
13
13
  "d3-cloud": "^1.2.5",
14
14
  "d3-geo": "^2.0.1",