@reltio/components 1.4.1806 → 1.4.1807
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/crosswalks/hooks/useAttributeActions.d.ts +1 -1
- package/cjs/components/crosswalks/hooks/useAttributeActions.js +2 -2
- package/cjs/components/crosswalks/hooks/useModifiedEntity.js +0 -1
- package/cjs/components/crosswalks/types/CreateAttributeEvent.d.ts +1 -2
- package/esm/components/crosswalks/hooks/useAttributeActions.d.ts +1 -1
- package/esm/components/crosswalks/hooks/useAttributeActions.js +3 -3
- package/esm/components/crosswalks/hooks/useModifiedEntity.js +0 -1
- package/esm/components/crosswalks/types/CreateAttributeEvent.d.ts +1 -2
- package/package.json +2 -2
|
@@ -10,6 +10,6 @@ export declare const useAttributeActions: ({ onSuccess, onError, onLoad }: Props
|
|
|
10
10
|
pinAttribute: ({ attributeValue }: PinInlineAttributeEvent) => void;
|
|
11
11
|
ignoreAttribute: ({ attributeValue }: IgnoreInlineAttributeEvent) => void;
|
|
12
12
|
updateAttribute: ({ attributeValue, attributeType, crosswalk, clearAttributeFlags }: EditInlineAttributeEvent) => void;
|
|
13
|
-
createAttribute: ({ attributeValue,
|
|
13
|
+
createAttribute: ({ attributeValue, crosswalk }: CreateAttributeEvent) => void;
|
|
14
14
|
};
|
|
15
15
|
export {};
|
|
@@ -129,7 +129,7 @@ var useAttributeActions = function (_a) {
|
|
|
129
129
|
handleAction(update());
|
|
130
130
|
}, [handleAction, handleErrorResponse]);
|
|
131
131
|
var createAttributeAction = (0, react_1.useCallback)(function (_a) {
|
|
132
|
-
var attributeValue = _a.attributeValue,
|
|
132
|
+
var attributeValue = _a.attributeValue, crosswalk = _a.crosswalk;
|
|
133
133
|
(0, ramda_1.pipe)(mdm_sdk_1.createAttribute, (0, ramda_1.andThen)(function (_a) {
|
|
134
134
|
var errors = _a[0].errors;
|
|
135
135
|
if (errors)
|
|
@@ -139,7 +139,7 @@ var useAttributeActions = function (_a) {
|
|
|
139
139
|
sourceUri: crosswalk.type,
|
|
140
140
|
crosswalkValue: crosswalk.value,
|
|
141
141
|
crosswalkSourceTable: crosswalk.sourceTable,
|
|
142
|
-
value: (0, mdm_sdk_1.
|
|
142
|
+
value: (0, mdm_sdk_1.isLookupValue)(attributeValue)
|
|
143
143
|
? attributeValue.lookupCode
|
|
144
144
|
: attributeValue.value
|
|
145
145
|
});
|
|
@@ -131,7 +131,6 @@ var useModifiedEntity = function (_a) {
|
|
|
131
131
|
});
|
|
132
132
|
createAttribute({
|
|
133
133
|
attributeValue: (0, mdm_sdk_1.findAttributeValueByUri)(editedEntity, tempAttributeUri),
|
|
134
|
-
attributeType: attributeType,
|
|
135
134
|
crosswalk: crosswalk
|
|
136
135
|
});
|
|
137
136
|
crosswalkForNewAttributes.current = crosswalk;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { AttributeValue, Crosswalk, RelationCrosswalk
|
|
1
|
+
import { AttributeValue, Crosswalk, RelationCrosswalk } from '@reltio/mdm-sdk';
|
|
2
2
|
export type CreateAttributeEvent = {
|
|
3
3
|
attributeValue: AttributeValue;
|
|
4
|
-
attributeType: AttributeType;
|
|
5
4
|
crosswalk: Crosswalk | RelationCrosswalk;
|
|
6
5
|
};
|
|
@@ -10,6 +10,6 @@ export declare const useAttributeActions: ({ onSuccess, onError, onLoad }: Props
|
|
|
10
10
|
pinAttribute: ({ attributeValue }: PinInlineAttributeEvent) => void;
|
|
11
11
|
ignoreAttribute: ({ attributeValue }: IgnoreInlineAttributeEvent) => void;
|
|
12
12
|
updateAttribute: ({ attributeValue, attributeType, crosswalk, clearAttributeFlags }: EditInlineAttributeEvent) => void;
|
|
13
|
-
createAttribute: ({ attributeValue,
|
|
13
|
+
createAttribute: ({ attributeValue, crosswalk }: CreateAttributeEvent) => void;
|
|
14
14
|
};
|
|
15
15
|
export {};
|
|
@@ -35,7 +35,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
import { useCallback } from 'react';
|
|
38
|
-
import { createAttribute, entityCumulativeDelete, getBaseUri, getReferencedRelationFromAttrValue, ignoreAttribute, isComplexAttribute, isImage, isLookupAttrType, isReference, pinAttribute, removeRelation, updateAttribute } from '@reltio/mdm-sdk';
|
|
38
|
+
import { createAttribute, entityCumulativeDelete, getBaseUri, getReferencedRelationFromAttrValue, ignoreAttribute, isComplexAttribute, isImage, isLookupAttrType, isLookupValue, isReference, pinAttribute, removeRelation, updateAttribute } from '@reltio/mdm-sdk';
|
|
39
39
|
import { andThen, pipe, prop, defaultTo, map } from 'ramda';
|
|
40
40
|
import { noop } from '../../../core';
|
|
41
41
|
export var useAttributeActions = function (_a) {
|
|
@@ -126,7 +126,7 @@ export var useAttributeActions = function (_a) {
|
|
|
126
126
|
handleAction(update());
|
|
127
127
|
}, [handleAction, handleErrorResponse]);
|
|
128
128
|
var createAttributeAction = useCallback(function (_a) {
|
|
129
|
-
var attributeValue = _a.attributeValue,
|
|
129
|
+
var attributeValue = _a.attributeValue, crosswalk = _a.crosswalk;
|
|
130
130
|
pipe(createAttribute, andThen(function (_a) {
|
|
131
131
|
var errors = _a[0].errors;
|
|
132
132
|
if (errors)
|
|
@@ -136,7 +136,7 @@ export var useAttributeActions = function (_a) {
|
|
|
136
136
|
sourceUri: crosswalk.type,
|
|
137
137
|
crosswalkValue: crosswalk.value,
|
|
138
138
|
crosswalkSourceTable: crosswalk.sourceTable,
|
|
139
|
-
value:
|
|
139
|
+
value: isLookupValue(attributeValue)
|
|
140
140
|
? attributeValue.lookupCode
|
|
141
141
|
: attributeValue.value
|
|
142
142
|
});
|
|
@@ -128,7 +128,6 @@ export var useModifiedEntity = function (_a) {
|
|
|
128
128
|
});
|
|
129
129
|
createAttribute({
|
|
130
130
|
attributeValue: findAttributeValueByUri(editedEntity, tempAttributeUri),
|
|
131
|
-
attributeType: attributeType,
|
|
132
131
|
crosswalk: crosswalk
|
|
133
132
|
});
|
|
134
133
|
crosswalkForNewAttributes.current = crosswalk;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { AttributeValue, Crosswalk, RelationCrosswalk
|
|
1
|
+
import { AttributeValue, Crosswalk, RelationCrosswalk } from '@reltio/mdm-sdk';
|
|
2
2
|
export type CreateAttributeEvent = {
|
|
3
3
|
attributeValue: AttributeValue;
|
|
4
|
-
attributeType: AttributeType;
|
|
5
4
|
crosswalk: Crosswalk | RelationCrosswalk;
|
|
6
5
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1807",
|
|
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
|
"@fluentui/react-context-selector": "^9.1.26",
|
|
9
9
|
"@react-google-maps/api": "2.7.0",
|
|
10
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
10
|
+
"@reltio/mdm-sdk": "^1.4.1770",
|
|
11
11
|
"classnames": "^2.2.5",
|
|
12
12
|
"d3-cloud": "^1.2.5",
|
|
13
13
|
"d3-geo": "^2.0.1",
|