@reltio/components 1.4.1797 → 1.4.1799

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.
@@ -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, crosswalk }: CreateAttributeEvent) => void;
13
+ createAttribute: ({ attributeValue, attributeType, 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, crosswalk = _a.crosswalk;
132
+ var attributeValue = _a.attributeValue, attributeType = _a.attributeType, 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,9 @@ var useAttributeActions = function (_a) {
139
139
  sourceUri: crosswalk.type,
140
140
  crosswalkValue: crosswalk.value,
141
141
  crosswalkSourceTable: crosswalk.sourceTable,
142
- value: attributeValue.value
142
+ value: (0, mdm_sdk_1.isLookupAttrType)(attributeType)
143
+ ? attributeValue.lookupCode
144
+ : attributeValue.value
143
145
  });
144
146
  }, [handleAction]);
145
147
  return {
@@ -131,6 +131,7 @@ var useModifiedEntity = function (_a) {
131
131
  });
132
132
  createAttribute({
133
133
  attributeValue: (0, mdm_sdk_1.findAttributeValueByUri)(editedEntity, tempAttributeUri),
134
+ attributeType: attributeType,
134
135
  crosswalk: crosswalk
135
136
  });
136
137
  crosswalkForNewAttributes.current = crosswalk;
@@ -1,5 +1,6 @@
1
- import { AttributeValue, Crosswalk, RelationCrosswalk } from '@reltio/mdm-sdk';
1
+ import { AttributeValue, Crosswalk, RelationCrosswalk, AttributeType } from '@reltio/mdm-sdk';
2
2
  export type CreateAttributeEvent = {
3
3
  attributeValue: AttributeValue;
4
+ attributeType: AttributeType;
4
5
  crosswalk: Crosswalk | RelationCrosswalk;
5
6
  };
@@ -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, crosswalk }: CreateAttributeEvent) => void;
13
+ createAttribute: ({ attributeValue, attributeType, crosswalk }: CreateAttributeEvent) => void;
14
14
  };
15
15
  export {};
@@ -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, crosswalk = _a.crosswalk;
129
+ var attributeValue = _a.attributeValue, attributeType = _a.attributeType, crosswalk = _a.crosswalk;
130
130
  pipe(createAttribute, andThen(function (_a) {
131
131
  var errors = _a[0].errors;
132
132
  if (errors)
@@ -136,7 +136,9 @@ export var useAttributeActions = function (_a) {
136
136
  sourceUri: crosswalk.type,
137
137
  crosswalkValue: crosswalk.value,
138
138
  crosswalkSourceTable: crosswalk.sourceTable,
139
- value: attributeValue.value
139
+ value: isLookupAttrType(attributeType)
140
+ ? attributeValue.lookupCode
141
+ : attributeValue.value
140
142
  });
141
143
  }, [handleAction]);
142
144
  return {
@@ -128,6 +128,7 @@ export var useModifiedEntity = function (_a) {
128
128
  });
129
129
  createAttribute({
130
130
  attributeValue: findAttributeValueByUri(editedEntity, tempAttributeUri),
131
+ attributeType: attributeType,
131
132
  crosswalk: crosswalk
132
133
  });
133
134
  crosswalkForNewAttributes.current = crosswalk;
@@ -1,5 +1,6 @@
1
- import { AttributeValue, Crosswalk, RelationCrosswalk } from '@reltio/mdm-sdk';
1
+ import { AttributeValue, Crosswalk, RelationCrosswalk, AttributeType } from '@reltio/mdm-sdk';
2
2
  export type CreateAttributeEvent = {
3
3
  attributeValue: AttributeValue;
4
+ attributeType: AttributeType;
4
5
  crosswalk: Crosswalk | RelationCrosswalk;
5
6
  };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.1797",
3
+ "version": "1.4.1799",
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.1763",
10
+ "@reltio/mdm-sdk": "^1.4.1764",
11
11
  "classnames": "^2.2.5",
12
12
  "d3-cloud": "^1.2.5",
13
13
  "d3-geo": "^2.0.1",