@reltio/components 1.4.1177 → 1.4.1181

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.
@@ -1,9 +1,10 @@
1
1
  export default ProfileBand;
2
- declare function ProfileBand({ className, entity, children, classes }: {
2
+ declare function ProfileBand({ className, entity, children, classes, showEntityId }: {
3
3
  className: any;
4
4
  entity: any;
5
5
  children: any;
6
6
  classes: any;
7
+ showEntityId?: boolean;
7
8
  }): JSX.Element;
8
9
  declare namespace ProfileBand {
9
10
  namespace propTypes {
@@ -11,6 +12,7 @@ declare namespace ProfileBand {
11
12
  const entity: PropTypes.Requireable<object>;
12
13
  const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
13
14
  const classes: PropTypes.Requireable<object>;
15
+ const showEntityId: PropTypes.Requireable<boolean>;
14
16
  }
15
17
  }
16
18
  import PropTypes from "prop-types";
@@ -37,7 +37,7 @@ var EntityTypeBadge_1 = __importDefault(require("../EntityTypeBadge/EntityTypeBa
37
37
  var styles_1 = __importDefault(require("./styles"));
38
38
  var ProfileBand = function (_a) {
39
39
  var _b;
40
- var className = _a.className, entity = _a.entity, children = _a.children, classes = _a.classes;
40
+ var className = _a.className, entity = _a.entity, children = _a.children, classes = _a.classes, _c = _a.showEntityId, showEntityId = _c === void 0 ? true : _c;
41
41
  var styles = styles_1.default({ classes: classes });
42
42
  var metadata = react_redux_1.useSelector(mdm_module_1.default.selectors.getMetadata);
43
43
  var handleCopyEntityIdToClipboard = react_1.useCallback(function () {
@@ -65,7 +65,7 @@ var ProfileBand = function (_a) {
65
65
  react_1.default.createElement("div", { className: styles.specialInfo },
66
66
  react_1.default.createElement("div", { className: styles.entityType },
67
67
  react_1.default.createElement(EntityTypeBadge_1.default, { entity: entity, size: "medium", className: styles.badge }),
68
- !mdm_sdk_1.isTempUri(entityUri) && (react_1.default.createElement(Tooltip_1.default, { title: ui_i18n_1.default.text('Copy to clipboard') },
68
+ !mdm_sdk_1.isTempUri(entityUri) && showEntityId && (react_1.default.createElement(Tooltip_1.default, { title: ui_i18n_1.default.text('Copy to clipboard') },
69
69
  react_1.default.createElement(Typography_1.default, { display: "inline", variant: "body2", className: styles.entityId, onClick: handleCopyEntityIdToClipboard },
70
70
  ui_i18n_1.default.text('Entity ID'),
71
71
  ": ",
@@ -76,6 +76,7 @@ ProfileBand.propTypes = {
76
76
  className: prop_types_1.default.string,
77
77
  entity: prop_types_1.default.object,
78
78
  children: prop_types_1.default.node,
79
- classes: prop_types_1.default.object
79
+ classes: prop_types_1.default.object,
80
+ showEntityId: prop_types_1.default.bool
80
81
  };
81
82
  exports.default = ProfileBand;
@@ -1,3 +1,2 @@
1
1
  export declare const isNewUI: (path?: string) => boolean;
2
2
  export declare const getWorkerURL: (uiPath: string, tenant: string) => string;
3
- export declare const getFullApiPath: (apiPath: string) => string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFullApiPath = exports.getWorkerURL = exports.isNewUI = void 0;
3
+ exports.getWorkerURL = exports.isNewUI = void 0;
4
4
  var isNewUI = function (path) {
5
5
  return path === null || path === void 0 ? void 0 : path.includes('/nui');
6
6
  };
@@ -14,12 +14,3 @@ var getWorkerURL = function (uiPath, tenant) {
14
14
  }
15
15
  };
16
16
  exports.getWorkerURL = getWorkerURL;
17
- var getFullApiPath = function (apiPath) {
18
- if (exports.isNewUI(apiPath)) {
19
- return "" + window.location.origin + apiPath;
20
- }
21
- else {
22
- return apiPath;
23
- }
24
- };
25
- exports.getFullApiPath = getFullApiPath;
@@ -53,7 +53,7 @@ var useAPI = function (config) {
53
53
  var uiPath = react_redux_1.useSelector(mdm_module_1.default.selectors.getUIPath);
54
54
  var tenant = react_redux_1.useSelector(mdm_module_1.default.selectors.getTenant);
55
55
  var workerUrl = helpers_1.getWorkerURL(uiPath, tenant);
56
- var apiPath = react_redux_1.useSelector(mdm_module_1.default.selectors.getApiPath);
56
+ var reltioPath = react_redux_1.useSelector(mdm_module_1.default.selectors.getReltioPath);
57
57
  var workflowPath = react_redux_1.useSelector(mdm_module_1.default.selectors.getWorkflowPath);
58
58
  var user = react_redux_1.useSelector(mdm_module_1.default.selectors.getUser);
59
59
  var servicesPath = react_redux_1.useSelector(mdm_module_1.default.selectors.getServicesPath);
@@ -167,7 +167,7 @@ var useAPI = function (config) {
167
167
  case mdm_sdk_1.CustomAction.REQUEST: {
168
168
  API_1.processRequest(__assign({ name: task.params.name, paramObject: task, permissions: config.action.permissions, worker: worker,
169
169
  metadata: metadata, config: config, user: user,
170
- servicesPath: servicesPath, apiPath: helpers_1.getFullApiPath(apiPath), tenant: tenant,
170
+ servicesPath: servicesPath, apiPath: reltioPath, tenant: tenant,
171
171
  workflowPath: workflowPath,
172
172
  entity: entity,
173
173
  entityUri: entityUri,
@@ -1,9 +1,10 @@
1
1
  export default ProfileBand;
2
- declare function ProfileBand({ className, entity, children, classes }: {
2
+ declare function ProfileBand({ className, entity, children, classes, showEntityId }: {
3
3
  className: any;
4
4
  entity: any;
5
5
  children: any;
6
6
  classes: any;
7
+ showEntityId?: boolean;
7
8
  }): JSX.Element;
8
9
  declare namespace ProfileBand {
9
10
  namespace propTypes {
@@ -11,6 +12,7 @@ declare namespace ProfileBand {
11
12
  const entity: PropTypes.Requireable<object>;
12
13
  const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
13
14
  const classes: PropTypes.Requireable<object>;
15
+ const showEntityId: PropTypes.Requireable<boolean>;
14
16
  }
15
17
  }
16
18
  import PropTypes from "prop-types";
@@ -13,7 +13,7 @@ import EntityTypeBadge from '../EntityTypeBadge/EntityTypeBadge';
13
13
  import useStyles from './styles';
14
14
  var ProfileBand = function (_a) {
15
15
  var _b;
16
- var className = _a.className, entity = _a.entity, children = _a.children, classes = _a.classes;
16
+ var className = _a.className, entity = _a.entity, children = _a.children, classes = _a.classes, _c = _a.showEntityId, showEntityId = _c === void 0 ? true : _c;
17
17
  var styles = useStyles({ classes: classes });
18
18
  var metadata = useSelector(mdmModule.selectors.getMetadata);
19
19
  var handleCopyEntityIdToClipboard = useCallback(function () {
@@ -41,7 +41,7 @@ var ProfileBand = function (_a) {
41
41
  React.createElement("div", { className: styles.specialInfo },
42
42
  React.createElement("div", { className: styles.entityType },
43
43
  React.createElement(EntityTypeBadge, { entity: entity, size: "medium", className: styles.badge }),
44
- !isTempUri(entityUri) && (React.createElement(Tooltip, { title: i18n.text('Copy to clipboard') },
44
+ !isTempUri(entityUri) && showEntityId && (React.createElement(Tooltip, { title: i18n.text('Copy to clipboard') },
45
45
  React.createElement(Typography, { display: "inline", variant: "body2", className: styles.entityId, onClick: handleCopyEntityIdToClipboard },
46
46
  i18n.text('Entity ID'),
47
47
  ": ",
@@ -52,6 +52,7 @@ ProfileBand.propTypes = {
52
52
  className: PropTypes.string,
53
53
  entity: PropTypes.object,
54
54
  children: PropTypes.node,
55
- classes: PropTypes.object
55
+ classes: PropTypes.object,
56
+ showEntityId: PropTypes.bool
56
57
  };
57
58
  export default ProfileBand;
@@ -1,3 +1,2 @@
1
1
  export declare const isNewUI: (path?: string) => boolean;
2
2
  export declare const getWorkerURL: (uiPath: string, tenant: string) => string;
3
- export declare const getFullApiPath: (apiPath: string) => string;
@@ -9,11 +9,3 @@ export var getWorkerURL = function (uiPath, tenant) {
9
9
  return uiPath + "worker_api.js";
10
10
  }
11
11
  };
12
- export var getFullApiPath = function (apiPath) {
13
- if (isNewUI(apiPath)) {
14
- return "" + window.location.origin + apiPath;
15
- }
16
- else {
17
- return apiPath;
18
- }
19
- };
@@ -16,7 +16,7 @@ import { CustomAction, CustomScriptPlatform, initializeWebWorker, isEmptyValue }
16
16
  import { useWorkflowCheckPermission } from '../../components/workflow';
17
17
  import { SandboxAPIContext, SnackbarContext } from '../../contexts';
18
18
  import { processRequest } from './API';
19
- import { getFullApiPath, getWorkerURL } from './helpers';
19
+ import { getWorkerURL } from './helpers';
20
20
  export var useAPI = function (config) {
21
21
  if (config === void 0) { config = {}; }
22
22
  var _a = useState(), html = _a[0], setHtml = _a[1];
@@ -31,7 +31,7 @@ export var useAPI = function (config) {
31
31
  var uiPath = useSelector(mdmModule.selectors.getUIPath);
32
32
  var tenant = useSelector(mdmModule.selectors.getTenant);
33
33
  var workerUrl = getWorkerURL(uiPath, tenant);
34
- var apiPath = useSelector(mdmModule.selectors.getApiPath);
34
+ var reltioPath = useSelector(mdmModule.selectors.getReltioPath);
35
35
  var workflowPath = useSelector(mdmModule.selectors.getWorkflowPath);
36
36
  var user = useSelector(mdmModule.selectors.getUser);
37
37
  var servicesPath = useSelector(mdmModule.selectors.getServicesPath);
@@ -145,7 +145,7 @@ export var useAPI = function (config) {
145
145
  case CustomAction.REQUEST: {
146
146
  processRequest(__assign({ name: task.params.name, paramObject: task, permissions: config.action.permissions, worker: worker,
147
147
  metadata: metadata, config: config, user: user,
148
- servicesPath: servicesPath, apiPath: getFullApiPath(apiPath), tenant: tenant,
148
+ servicesPath: servicesPath, apiPath: reltioPath, tenant: tenant,
149
149
  workflowPath: workflowPath,
150
150
  entity: entity,
151
151
  entityUri: entityUri,
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.1177",
3
+ "version": "1.4.1181",
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.1177",
11
- "@reltio/mdm-sdk": "^1.4.1177",
10
+ "@reltio/mdm-module": "^1.4.1181",
11
+ "@reltio/mdm-sdk": "^1.4.1181",
12
12
  "classnames": "^2.2.5",
13
13
  "d3-cloud": "^1.2.5",
14
14
  "d3-geo": "^2.0.1",