@reltio/components 1.4.1552 → 1.4.1554
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.
|
@@ -8,6 +8,7 @@ var react_1 = require("react");
|
|
|
8
8
|
var mdm_module_1 = __importDefault(require("@reltio/mdm-module"));
|
|
9
9
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
10
10
|
var react_redux_1 = require("react-redux");
|
|
11
|
+
var hooks_1 = require("../../../hooks");
|
|
11
12
|
var filterDefinitions = function (definitions, entityType) {
|
|
12
13
|
return definitions.filter(function (_a) {
|
|
13
14
|
var manualStart = _a.manualStart, objectTypes = _a.objectTypes;
|
|
@@ -21,10 +22,14 @@ var useWorkflowDefinitions = function () {
|
|
|
21
22
|
var tenant = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getTenant);
|
|
22
23
|
var entity = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getEntity);
|
|
23
24
|
var entityType = entity.type;
|
|
25
|
+
var safePromise = (0, hooks_1.useSafePromise)();
|
|
24
26
|
(0, react_1.useEffect)(function () {
|
|
25
|
-
(0, mdm_sdk_1.processDefinitions)({ workflowPath: workflowPath, environment: environment, tenant: tenant }).then(function (_a) {
|
|
27
|
+
safePromise((0, mdm_sdk_1.processDefinitions)({ workflowPath: workflowPath, environment: environment, tenant: tenant })).then(function (_a) {
|
|
26
28
|
var data = _a.data;
|
|
27
|
-
|
|
29
|
+
if (!data) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
setDefinitions(filterDefinitions(data, entityType));
|
|
28
33
|
});
|
|
29
34
|
}, [entityType, workflowPath, environment, tenant]);
|
|
30
35
|
return { definitions: definitions };
|
|
@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react';
|
|
|
2
2
|
import mdmModule from '@reltio/mdm-module';
|
|
3
3
|
import { processDefinitions } from '@reltio/mdm-sdk';
|
|
4
4
|
import { useSelector } from 'react-redux';
|
|
5
|
+
import { useSafePromise } from '../../../hooks';
|
|
5
6
|
var filterDefinitions = function (definitions, entityType) {
|
|
6
7
|
return definitions.filter(function (_a) {
|
|
7
8
|
var manualStart = _a.manualStart, objectTypes = _a.objectTypes;
|
|
@@ -15,10 +16,14 @@ export var useWorkflowDefinitions = function () {
|
|
|
15
16
|
var tenant = useSelector(mdmModule.selectors.getTenant);
|
|
16
17
|
var entity = useSelector(mdmModule.selectors.getEntity);
|
|
17
18
|
var entityType = entity.type;
|
|
19
|
+
var safePromise = useSafePromise();
|
|
18
20
|
useEffect(function () {
|
|
19
|
-
processDefinitions({ workflowPath: workflowPath, environment: environment, tenant: tenant }).then(function (_a) {
|
|
21
|
+
safePromise(processDefinitions({ workflowPath: workflowPath, environment: environment, tenant: tenant })).then(function (_a) {
|
|
20
22
|
var data = _a.data;
|
|
21
|
-
|
|
23
|
+
if (!data) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
setDefinitions(filterDefinitions(data, entityType));
|
|
22
27
|
});
|
|
23
28
|
}, [entityType, workflowPath, environment, tenant]);
|
|
24
29
|
return { definitions: definitions };
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1554",
|
|
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.1554",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1554",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|