@reltio/components 1.4.1504 → 1.4.1506

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.
@@ -46,7 +46,7 @@ var HierarchyNodeTitle = function (_a) {
46
46
  var generateEntityUrl = (0, react_1.useContext)(contexts_1.UrlGeneratorsContext).generateEntityUrl;
47
47
  var _d = (0, useEntityDetails_1.useEntityDetails)(entityUri), isLoading = _d.isLoading, entityDetails = _d.entityDetails, showEntityDetails = _d.showEntityDetails, hideEntityDetails = _d.hideEntityDetails;
48
48
  var link = generateEntityUrl({ uiPath: uiPath, uri: entityUri });
49
- var showPopper = anchorEl && (Boolean(entityDetails) || isLoading);
49
+ var showPopper = Boolean(anchorEl) && (Boolean(entityDetails) || isLoading);
50
50
  var handleClick = (0, react_1.useCallback)(function () {
51
51
  dispatch(mdm_module_1.ui.actions.openEntity({ uri: entityUri, viewId: viewId }));
52
52
  }, [dispatch, entityUri, viewId]);
@@ -27,6 +27,9 @@ exports.getParents = void 0;
27
27
  var ramda_1 = require("ramda");
28
28
  var mdm_module_1 = __importDefault(require("@reltio/mdm-module"));
29
29
  var mdm_sdk_1 = require("@reltio/mdm-sdk");
30
+ var getTypesMapKey = function (parent) {
31
+ return "".concat(parent.type, "_").concat((0, mdm_sdk_1.getParentUri)(parent.uri));
32
+ };
30
33
  var getParents = function (state, valueUri, node) {
31
34
  var _a;
32
35
  var parentNodesValues = node.parents.flatMap(function (type) {
@@ -63,13 +66,14 @@ var getParents = function (state, valueUri, node) {
63
66
  var parents = Object.values(ownParentNodesValues.reduce(function (typesMap, parent) {
64
67
  var _a;
65
68
  var _b;
66
- return (__assign(__assign({}, typesMap), (_a = {}, _a[parent.dependentLookupCode] = {
69
+ var key = getTypesMapKey(parent);
70
+ return __assign(__assign({}, typesMap), (_a = {}, _a[key] = {
67
71
  type: parent.dependentLookupCode,
68
- codeValues: (0, ramda_1.uniq)(__spreadArray([parent.value], (((_b = typesMap[parent.dependentLookupCode]) === null || _b === void 0 ? void 0 : _b.codeValues) || []), true))
72
+ codeValues: (0, ramda_1.uniq)(__spreadArray([parent.value], (((_b = typesMap[key]) === null || _b === void 0 ? void 0 : _b.codeValues) || []), true))
69
73
  .filter(Boolean)
70
74
  .sort()
71
- }, _a)));
72
- }, {}));
75
+ }, _a));
76
+ }, {})).filter(function (item) { return !!item.codeValues.length; });
73
77
  return { parents: parents, missedParentsAttributeTypes: missedParentsAttributeTypes };
74
78
  };
75
79
  exports.getParents = getParents;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  declare type Features = {
3
3
  showDescription?: boolean;
4
+ showNavigateToGraph?: boolean;
4
5
  };
5
6
  export declare const FeaturesContext: React.Context<Features>;
6
7
  export {};
@@ -5,5 +5,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.FeaturesContext = void 0;
7
7
  var react_1 = __importDefault(require("react"));
8
- exports.FeaturesContext = react_1.default.createContext({});
8
+ exports.FeaturesContext = react_1.default.createContext({ showDescription: false, showNavigateToGraph: true });
9
9
  exports.FeaturesContext.displayName = 'FeaturesContext';
@@ -17,7 +17,7 @@ export var HierarchyNodeTitle = function (_a) {
17
17
  var generateEntityUrl = useContext(UrlGeneratorsContext).generateEntityUrl;
18
18
  var _d = useEntityDetails(entityUri), isLoading = _d.isLoading, entityDetails = _d.entityDetails, showEntityDetails = _d.showEntityDetails, hideEntityDetails = _d.hideEntityDetails;
19
19
  var link = generateEntityUrl({ uiPath: uiPath, uri: entityUri });
20
- var showPopper = anchorEl && (Boolean(entityDetails) || isLoading);
20
+ var showPopper = Boolean(anchorEl) && (Boolean(entityDetails) || isLoading);
21
21
  var handleClick = useCallback(function () {
22
22
  dispatch(ui.actions.openEntity({ uri: entityUri, viewId: viewId }));
23
23
  }, [dispatch, entityUri, viewId]);
@@ -20,7 +20,10 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
20
20
  };
21
21
  import { defaultTo, isNil, map, path, pipe, prepend, reject, uniq } from 'ramda';
22
22
  import mdmModule from '@reltio/mdm-module';
23
- import { areOneHierarchyUris, filterRelatedParentValuesForDependentLookupValueUri, getAttributeValuePath, getBaseUri } from '@reltio/mdm-sdk';
23
+ import { areOneHierarchyUris, filterRelatedParentValuesForDependentLookupValueUri, getAttributeValuePath, getBaseUri, getParentUri } from '@reltio/mdm-sdk';
24
+ var getTypesMapKey = function (parent) {
25
+ return "".concat(parent.type, "_").concat(getParentUri(parent.uri));
26
+ };
24
27
  export var getParents = function (state, valueUri, node) {
25
28
  var _a;
26
29
  var parentNodesValues = node.parents.flatMap(function (type) {
@@ -57,12 +60,13 @@ export var getParents = function (state, valueUri, node) {
57
60
  var parents = Object.values(ownParentNodesValues.reduce(function (typesMap, parent) {
58
61
  var _a;
59
62
  var _b;
60
- return (__assign(__assign({}, typesMap), (_a = {}, _a[parent.dependentLookupCode] = {
63
+ var key = getTypesMapKey(parent);
64
+ return __assign(__assign({}, typesMap), (_a = {}, _a[key] = {
61
65
  type: parent.dependentLookupCode,
62
- codeValues: uniq(__spreadArray([parent.value], (((_b = typesMap[parent.dependentLookupCode]) === null || _b === void 0 ? void 0 : _b.codeValues) || []), true))
66
+ codeValues: uniq(__spreadArray([parent.value], (((_b = typesMap[key]) === null || _b === void 0 ? void 0 : _b.codeValues) || []), true))
63
67
  .filter(Boolean)
64
68
  .sort()
65
- }, _a)));
66
- }, {}));
69
+ }, _a));
70
+ }, {})).filter(function (item) { return !!item.codeValues.length; });
67
71
  return { parents: parents, missedParentsAttributeTypes: missedParentsAttributeTypes };
68
72
  };
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  declare type Features = {
3
3
  showDescription?: boolean;
4
+ showNavigateToGraph?: boolean;
4
5
  };
5
6
  export declare const FeaturesContext: React.Context<Features>;
6
7
  export {};
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- export var FeaturesContext = React.createContext({});
2
+ export var FeaturesContext = React.createContext({ showDescription: false, showNavigateToGraph: true });
3
3
  FeaturesContext.displayName = 'FeaturesContext';
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.1504",
3
+ "version": "1.4.1506",
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.1504",
11
- "@reltio/mdm-sdk": "^1.4.1504",
10
+ "@reltio/mdm-module": "^1.4.1506",
11
+ "@reltio/mdm-sdk": "^1.4.1506",
12
12
  "classnames": "^2.2.5",
13
13
  "d3-cloud": "^1.2.5",
14
14
  "d3-geo": "^2.0.1",