@reltio/components 1.4.2220 → 1.4.2225

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.
@@ -222,14 +222,14 @@ describe('ExportDialog tests', function () {
222
222
  options: {
223
223
  fileFormat: ExportDataFormat.CSV,
224
224
  dateFormat: 'readable',
225
- filter: defaultProps.filter,
226
225
  activeness: ActivityFilter.ALL,
227
226
  options: 'parallelExecution,searchByOv',
228
227
  name: 'Untitled Export Job 11252025_09:10_HCP',
229
228
  select: 'attributes.FirstName,attributes.LastName'
230
229
  },
231
230
  includeType: ['configuration/entityTypes/HCP'],
232
- headerOrder: ExportHeaderOrder.Select
231
+ headerOrder: ExportHeaderOrder.Select,
232
+ filter: defaultProps.filter
233
233
  }));
234
234
  expect(exportData).toHaveBeenCalledWith(expect.objectContaining({
235
235
  exportPath: '/nui/export',
@@ -237,14 +237,14 @@ describe('ExportDialog tests', function () {
237
237
  options: {
238
238
  fileFormat: ExportDataFormat.CSV,
239
239
  dateFormat: 'readable',
240
- filter: defaultProps.filter,
241
240
  activeness: ActivityFilter.ALL,
242
241
  options: 'parallelExecution,searchByOv',
243
242
  name: 'Untitled Export Job 11252025_09:10_entities',
244
243
  sendHidden: false
245
244
  },
246
245
  includeType: ['configuration/entityTypes/HCO'],
247
- headerOrder: ExportHeaderOrder.Default
246
+ headerOrder: ExportHeaderOrder.Default,
247
+ filter: defaultProps.filter
248
248
  }));
249
249
  expect(defaultProps.onLoadingChange).toHaveBeenCalledWith(false);
250
250
  expect(defaultProps.onClose).toHaveBeenCalled();
@@ -47,6 +47,7 @@ import { DependentLookupAutopopulationContext } from '../contexts/DependentLooku
47
47
  import { useStyles } from './styles';
48
48
  import { AddressAutoCompleteContext } from '../contexts/AutoCompleteContext';
49
49
  import { AttributeValueContext } from '../contexts/AttributeValueContext';
50
+ import { AuthoringPerspectiveViewContext } from '../contexts/AuthoringPerspectiveViewContext';
50
51
  var AsyncMountPlaceholder = function () {
51
52
  var styles = useStyles();
52
53
  return React.createElement("div", { className: styles.placeholder });
@@ -112,8 +113,10 @@ var SimpleAttributeEditor = function (_a) {
112
113
  var hasError = !!errorMessage;
113
114
  var deletedProps = deleted ? { disabled: true, isCrossedOut: true } : {};
114
115
  var isProfilePerspectiveView = useContext(ProfilePerspectiveViewContext);
116
+ var isAuthoringPerspectiveView = useContext(AuthoringPerspectiveViewContext);
117
+ var isEntityPerspectiveView = isProfilePerspectiveView || isAuthoringPerspectiveView;
115
118
  var autopopulationContextValue = useAutopopulationContextValue({
116
- enabled: isProfilePerspectiveView && isDependentLookupAttrType(attributeType),
119
+ enabled: isEntityPerspectiveView && isDependentLookupAttrType(attributeType),
117
120
  attributeTypeUri: attributeType === null || attributeType === void 0 ? void 0 : attributeType.uri,
118
121
  valueUri: attributeValue.uri
119
122
  }).autopopulationContextValue;
@@ -54,6 +54,7 @@ import { ProfilePerspectiveViewContext } from '../contexts/ProfilePerspectiveVie
54
54
  import { ScrollType, ScrollToElementContext } from '../contexts/ScrollToElementContext';
55
55
  import { MdmModuleProvider, useMdmDependentLookupEditorContext } from '../contexts/MdmModuleContext';
56
56
  import { AlwaysVisibleAttributesContext } from '../contexts/AlwaysVisibleAttributesContext';
57
+ import { AuthoringPerspectiveViewContext } from '../contexts/AuthoringPerspectiveViewContext';
57
58
  import { useAutopopulationContextValue } from './useAutopopulationContextValue';
58
59
  import { useScrollToAttributeError } from '../hooks/useScrollToAttributeError';
59
60
  import { useAsyncMount } from '../hooks/useAsyncMount';
@@ -105,7 +106,7 @@ describe('SimpleAttributeEditor', function () {
105
106
  onDeactivateError: jest.fn()
106
107
  };
107
108
  var setUp = function (_a) {
108
- var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? {} : _c, _d = _b.error, error = _d === void 0 ? null : _d, _e = _b.isProfilePerspective, isProfilePerspective = _e === void 0 ? false : _e, _f = _b.alwaysVisibleAttributes, alwaysVisibleAttributes = _f === void 0 ? [] : _f;
109
+ var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? {} : _c, _d = _b.error, error = _d === void 0 ? null : _d, _e = _b.isProfilePerspective, isProfilePerspective = _e === void 0 ? false : _e, _f = _b.isAuthoringPerspective, isAuthoringPerspective = _f === void 0 ? false : _f, _g = _b.alwaysVisibleAttributes, alwaysVisibleAttributes = _g === void 0 ? [] : _g;
109
110
  var user = userEvent.setup();
110
111
  var scrollToElementContextValue = getScrollToElementContextValue(error);
111
112
  var Providers = function (_a) {
@@ -113,7 +114,8 @@ describe('SimpleAttributeEditor', function () {
113
114
  return (React.createElement(MdmModuleProvider, { values: mdmValues },
114
115
  React.createElement(AlwaysVisibleAttributesContext.Provider, { value: alwaysVisibleAttributes },
115
116
  React.createElement(ProfilePerspectiveViewContext.Provider, { value: isProfilePerspective },
116
- React.createElement(ScrollToElementContext.Provider, { value: scrollToElementContextValue }, children)))));
117
+ React.createElement(AuthoringPerspectiveViewContext.Provider, { value: isAuthoringPerspective },
118
+ React.createElement(ScrollToElementContext.Provider, { value: scrollToElementContextValue }, children))))));
117
119
  };
118
120
  return __assign({ user: user, scrollToElementContextValue: scrollToElementContextValue }, render(React.createElement(SimpleAttributeEditor, __assign({}, defaultProps, props)), { wrapper: Providers }));
119
121
  };
@@ -348,7 +350,7 @@ describe('SimpleAttributeEditor', function () {
348
350
  uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer',
349
351
  dependentLookupCode: 'Code'
350
352
  };
351
- it('should call getDependentLookupEditorContext selector with correct arguments', function () { return __awaiter(void 0, void 0, void 0, function () {
353
+ it('should call getDependentLookupEditorContext selector with correct arguments for profile perspective', function () { return __awaiter(void 0, void 0, void 0, function () {
352
354
  return __generator(this, function (_a) {
353
355
  switch (_a.label) {
354
356
  case 0:
@@ -366,6 +368,24 @@ describe('SimpleAttributeEditor', function () {
366
368
  }
367
369
  });
368
370
  }); });
371
+ it('should call getDependentLookupEditorContext selector with correct arguments for authoring perspective', function () { return __awaiter(void 0, void 0, void 0, function () {
372
+ return __generator(this, function (_a) {
373
+ switch (_a.label) {
374
+ case 0:
375
+ setUp({ props: { attributeType: attributeType }, isAuthoringPerspective: true });
376
+ return [4 /*yield*/, act(function () { return Promise.resolve(); })];
377
+ case 1:
378
+ _a.sent();
379
+ expect(useMdmDependentLookupEditorContext).toHaveBeenCalledWith(defaultProps.attributeValue, attributeType);
380
+ expect(useAutopopulationContextValue).toHaveBeenCalledWith({
381
+ enabled: true,
382
+ attributeTypeUri: attributeType.uri,
383
+ valueUri: defaultProps.attributeValue.uri
384
+ });
385
+ return [2 /*return*/];
386
+ }
387
+ });
388
+ }); });
369
389
  it('should call useAutopopulationContextValue with enabled: false if component is outside of Profile perspective', function () { return __awaiter(void 0, void 0, void 0, function () {
370
390
  return __generator(this, function (_a) {
371
391
  switch (_a.label) {
@@ -383,6 +403,23 @@ describe('SimpleAttributeEditor', function () {
383
403
  }
384
404
  });
385
405
  }); });
406
+ it('should call useAutopopulationContextValue with enabled: false if component is outside of authoring perspective', function () { return __awaiter(void 0, void 0, void 0, function () {
407
+ return __generator(this, function (_a) {
408
+ switch (_a.label) {
409
+ case 0:
410
+ setUp({ props: { attributeType: attributeType }, isAuthoringPerspective: false });
411
+ return [4 /*yield*/, act(function () { return Promise.resolve(); })];
412
+ case 1:
413
+ _a.sent();
414
+ expect(useAutopopulationContextValue).toHaveBeenCalledWith({
415
+ enabled: false,
416
+ attributeTypeUri: attributeType.uri,
417
+ valueUri: defaultProps.attributeValue.uri
418
+ });
419
+ return [2 /*return*/];
420
+ }
421
+ });
422
+ }); });
386
423
  it('should render dependent lookup editor with applied result of getDependentLookupEditorContext', function () { return __awaiter(void 0, void 0, void 0, function () {
387
424
  var dlEditorContext, input;
388
425
  return __generator(this, function (_a) {
@@ -227,14 +227,14 @@ describe('ExportDialog tests', function () {
227
227
  options: {
228
228
  fileFormat: mdm_sdk_1.ExportDataFormat.CSV,
229
229
  dateFormat: 'readable',
230
- filter: defaultProps.filter,
231
230
  activeness: mdm_sdk_1.ActivityFilter.ALL,
232
231
  options: 'parallelExecution,searchByOv',
233
232
  name: 'Untitled Export Job 11252025_09:10_HCP',
234
233
  select: 'attributes.FirstName,attributes.LastName'
235
234
  },
236
235
  includeType: ['configuration/entityTypes/HCP'],
237
- headerOrder: mdm_sdk_1.ExportHeaderOrder.Select
236
+ headerOrder: mdm_sdk_1.ExportHeaderOrder.Select,
237
+ filter: defaultProps.filter
238
238
  }));
239
239
  expect(mdm_sdk_1.exportData).toHaveBeenCalledWith(expect.objectContaining({
240
240
  exportPath: '/nui/export',
@@ -242,14 +242,14 @@ describe('ExportDialog tests', function () {
242
242
  options: {
243
243
  fileFormat: mdm_sdk_1.ExportDataFormat.CSV,
244
244
  dateFormat: 'readable',
245
- filter: defaultProps.filter,
246
245
  activeness: mdm_sdk_1.ActivityFilter.ALL,
247
246
  options: 'parallelExecution,searchByOv',
248
247
  name: 'Untitled Export Job 11252025_09:10_entities',
249
248
  sendHidden: false
250
249
  },
251
250
  includeType: ['configuration/entityTypes/HCO'],
252
- headerOrder: mdm_sdk_1.ExportHeaderOrder.Default
251
+ headerOrder: mdm_sdk_1.ExportHeaderOrder.Default,
252
+ filter: defaultProps.filter
253
253
  }));
254
254
  expect(defaultProps.onLoadingChange).toHaveBeenCalledWith(false);
255
255
  expect(defaultProps.onClose).toHaveBeenCalled();
@@ -75,6 +75,7 @@ var DependentLookupAutopopulationContext_1 = require("../contexts/DependentLooku
75
75
  var styles_1 = require("./styles");
76
76
  var AutoCompleteContext_1 = require("../contexts/AutoCompleteContext");
77
77
  var AttributeValueContext_1 = require("../contexts/AttributeValueContext");
78
+ var AuthoringPerspectiveViewContext_1 = require("../contexts/AuthoringPerspectiveViewContext");
78
79
  var AsyncMountPlaceholder = function () {
79
80
  var styles = (0, styles_1.useStyles)();
80
81
  return react_1.default.createElement("div", { className: styles.placeholder });
@@ -140,8 +141,10 @@ var SimpleAttributeEditor = function (_a) {
140
141
  var hasError = !!errorMessage;
141
142
  var deletedProps = deleted ? { disabled: true, isCrossedOut: true } : {};
142
143
  var isProfilePerspectiveView = (0, react_1.useContext)(ProfilePerspectiveViewContext_1.ProfilePerspectiveViewContext);
144
+ var isAuthoringPerspectiveView = (0, react_1.useContext)(AuthoringPerspectiveViewContext_1.AuthoringPerspectiveViewContext);
145
+ var isEntityPerspectiveView = isProfilePerspectiveView || isAuthoringPerspectiveView;
143
146
  var autopopulationContextValue = (0, useAutopopulationContextValue_1.useAutopopulationContextValue)({
144
- enabled: isProfilePerspectiveView && (0, mdm_sdk_1.isDependentLookupAttrType)(attributeType),
147
+ enabled: isEntityPerspectiveView && (0, mdm_sdk_1.isDependentLookupAttrType)(attributeType),
145
148
  attributeTypeUri: attributeType === null || attributeType === void 0 ? void 0 : attributeType.uri,
146
149
  valueUri: attributeValue.uri
147
150
  }).autopopulationContextValue;
@@ -59,6 +59,7 @@ var ProfilePerspectiveViewContext_1 = require("../contexts/ProfilePerspectiveVie
59
59
  var ScrollToElementContext_1 = require("../contexts/ScrollToElementContext");
60
60
  var MdmModuleContext_1 = require("../contexts/MdmModuleContext");
61
61
  var AlwaysVisibleAttributesContext_1 = require("../contexts/AlwaysVisibleAttributesContext");
62
+ var AuthoringPerspectiveViewContext_1 = require("../contexts/AuthoringPerspectiveViewContext");
62
63
  var useAutopopulationContextValue_1 = require("./useAutopopulationContextValue");
63
64
  var useScrollToAttributeError_1 = require("../hooks/useScrollToAttributeError");
64
65
  var useAsyncMount_1 = require("../hooks/useAsyncMount");
@@ -110,7 +111,7 @@ describe('SimpleAttributeEditor', function () {
110
111
  onDeactivateError: jest.fn()
111
112
  };
112
113
  var setUp = function (_a) {
113
- var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? {} : _c, _d = _b.error, error = _d === void 0 ? null : _d, _e = _b.isProfilePerspective, isProfilePerspective = _e === void 0 ? false : _e, _f = _b.alwaysVisibleAttributes, alwaysVisibleAttributes = _f === void 0 ? [] : _f;
114
+ var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? {} : _c, _d = _b.error, error = _d === void 0 ? null : _d, _e = _b.isProfilePerspective, isProfilePerspective = _e === void 0 ? false : _e, _f = _b.isAuthoringPerspective, isAuthoringPerspective = _f === void 0 ? false : _f, _g = _b.alwaysVisibleAttributes, alwaysVisibleAttributes = _g === void 0 ? [] : _g;
114
115
  var user = user_event_1.default.setup();
115
116
  var scrollToElementContextValue = getScrollToElementContextValue(error);
116
117
  var Providers = function (_a) {
@@ -118,7 +119,8 @@ describe('SimpleAttributeEditor', function () {
118
119
  return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues },
119
120
  react_1.default.createElement(AlwaysVisibleAttributesContext_1.AlwaysVisibleAttributesContext.Provider, { value: alwaysVisibleAttributes },
120
121
  react_1.default.createElement(ProfilePerspectiveViewContext_1.ProfilePerspectiveViewContext.Provider, { value: isProfilePerspective },
121
- react_1.default.createElement(ScrollToElementContext_1.ScrollToElementContext.Provider, { value: scrollToElementContextValue }, children)))));
122
+ react_1.default.createElement(AuthoringPerspectiveViewContext_1.AuthoringPerspectiveViewContext.Provider, { value: isAuthoringPerspective },
123
+ react_1.default.createElement(ScrollToElementContext_1.ScrollToElementContext.Provider, { value: scrollToElementContextValue }, children))))));
122
124
  };
123
125
  return __assign({ user: user, scrollToElementContextValue: scrollToElementContextValue }, (0, react_2.render)(react_1.default.createElement(SimpleAttributeEditor_1.default, __assign({}, defaultProps, props)), { wrapper: Providers }));
124
126
  };
@@ -353,7 +355,7 @@ describe('SimpleAttributeEditor', function () {
353
355
  uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer',
354
356
  dependentLookupCode: 'Code'
355
357
  };
356
- it('should call getDependentLookupEditorContext selector with correct arguments', function () { return __awaiter(void 0, void 0, void 0, function () {
358
+ it('should call getDependentLookupEditorContext selector with correct arguments for profile perspective', function () { return __awaiter(void 0, void 0, void 0, function () {
357
359
  return __generator(this, function (_a) {
358
360
  switch (_a.label) {
359
361
  case 0:
@@ -371,6 +373,24 @@ describe('SimpleAttributeEditor', function () {
371
373
  }
372
374
  });
373
375
  }); });
376
+ it('should call getDependentLookupEditorContext selector with correct arguments for authoring perspective', function () { return __awaiter(void 0, void 0, void 0, function () {
377
+ return __generator(this, function (_a) {
378
+ switch (_a.label) {
379
+ case 0:
380
+ setUp({ props: { attributeType: attributeType }, isAuthoringPerspective: true });
381
+ return [4 /*yield*/, (0, react_2.act)(function () { return Promise.resolve(); })];
382
+ case 1:
383
+ _a.sent();
384
+ expect(MdmModuleContext_1.useMdmDependentLookupEditorContext).toHaveBeenCalledWith(defaultProps.attributeValue, attributeType);
385
+ expect(useAutopopulationContextValue_1.useAutopopulationContextValue).toHaveBeenCalledWith({
386
+ enabled: true,
387
+ attributeTypeUri: attributeType.uri,
388
+ valueUri: defaultProps.attributeValue.uri
389
+ });
390
+ return [2 /*return*/];
391
+ }
392
+ });
393
+ }); });
374
394
  it('should call useAutopopulationContextValue with enabled: false if component is outside of Profile perspective', function () { return __awaiter(void 0, void 0, void 0, function () {
375
395
  return __generator(this, function (_a) {
376
396
  switch (_a.label) {
@@ -388,6 +408,23 @@ describe('SimpleAttributeEditor', function () {
388
408
  }
389
409
  });
390
410
  }); });
411
+ it('should call useAutopopulationContextValue with enabled: false if component is outside of authoring perspective', function () { return __awaiter(void 0, void 0, void 0, function () {
412
+ return __generator(this, function (_a) {
413
+ switch (_a.label) {
414
+ case 0:
415
+ setUp({ props: { attributeType: attributeType }, isAuthoringPerspective: false });
416
+ return [4 /*yield*/, (0, react_2.act)(function () { return Promise.resolve(); })];
417
+ case 1:
418
+ _a.sent();
419
+ expect(useAutopopulationContextValue_1.useAutopopulationContextValue).toHaveBeenCalledWith({
420
+ enabled: false,
421
+ attributeTypeUri: attributeType.uri,
422
+ valueUri: defaultProps.attributeValue.uri
423
+ });
424
+ return [2 /*return*/];
425
+ }
426
+ });
427
+ }); });
391
428
  it('should render dependent lookup editor with applied result of getDependentLookupEditorContext', function () { return __awaiter(void 0, void 0, void 0, function () {
392
429
  var dlEditorContext, input;
393
430
  return __generator(this, function (_a) {
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const AuthoringPerspectiveViewContext: React.Context<boolean>;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AuthoringPerspectiveViewContext = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ exports.AuthoringPerspectiveViewContext = react_1.default.createContext(false);
9
+ exports.AuthoringPerspectiveViewContext.displayName = 'AuthoringPerspectiveViewContext';
@@ -49,10 +49,9 @@ var ActivityExportButton = function (_a) {
49
49
  var _c = (0, react_1.useState)(false), showSnackbar = _c[0], setShowSnackbar = _c[1];
50
50
  var handleClickExport = (0, react_1.useCallback)(function (type) {
51
51
  var options = {
52
- filter: (0, filters_1.buildActivitiesFilterString)(filters),
53
52
  fileFormat: type
54
53
  };
55
- (0, mdm_sdk_1.exportActivities)({ exportPath: exportPath, tenant: tenant, options: options })
54
+ (0, mdm_sdk_1.exportActivities)({ exportPath: exportPath, tenant: tenant, options: options, filter: (0, filters_1.buildActivitiesFilterString)(filters) })
56
55
  .then(function () { return setShowSnackbar(true); })
57
56
  .catch(onError);
58
57
  }, [filters, tenant, exportPath]);
@@ -279,10 +279,10 @@ describe('Activity log filter tests', function () {
279
279
  expect(mdm_sdk_1.exportActivities).toHaveBeenCalledWith({
280
280
  exportPath: '/nui/export',
281
281
  options: {
282
- fileFormat: undefined,
283
- filter: "(gte(timestamp, 1626076206900)) and (equals(items.objectUri, 'entities/7Jsn1POn6') or equals(items.startObjectUri, 'entities/7Jsn1POn6') or equals(items.endObjectUri, 'entities/7Jsn1POn6')) and (not equals(user, 'collaboration-service'))"
282
+ fileFormat: undefined
284
283
  },
285
- tenant: 'alenat'
284
+ tenant: 'alenat',
285
+ filter: "(gte(timestamp, 1626076206900)) and (equals(items.objectUri, 'entities/7Jsn1POn6') or equals(items.startObjectUri, 'entities/7Jsn1POn6') or equals(items.endObjectUri, 'entities/7Jsn1POn6')) and (not equals(user, 'collaboration-service'))"
286
286
  });
287
287
  alert = react_2.screen.getByRole('alert');
288
288
  (0, react_2.within)(alert).getByText('Export operation is currently in progress. You will receive an email notification once completed. Go to Export Application to view the status.');
@@ -309,10 +309,10 @@ describe('Activity log filter tests', function () {
309
309
  expect(mdm_sdk_1.exportActivities).toHaveBeenCalledWith({
310
310
  exportPath: '/nui/export',
311
311
  options: {
312
- fileFormat: 'json',
313
- filter: "(gte(timestamp, 1626076206900)) and (equals(items.objectUri, 'entities/7Jsn1POn6') or equals(items.startObjectUri, 'entities/7Jsn1POn6') or equals(items.endObjectUri, 'entities/7Jsn1POn6')) and (not equals(user, 'collaboration-service'))"
312
+ fileFormat: 'json'
314
313
  },
315
- tenant: 'alenat'
314
+ tenant: 'alenat',
315
+ filter: "(gte(timestamp, 1626076206900)) and (equals(items.objectUri, 'entities/7Jsn1POn6') or equals(items.startObjectUri, 'entities/7Jsn1POn6') or equals(items.endObjectUri, 'entities/7Jsn1POn6')) and (not equals(user, 'collaboration-service'))"
316
316
  });
317
317
  alert = react_2.screen.getByRole('alert');
318
318
  (0, react_2.within)(alert).getByText('Export operation is currently in progress. You will receive an email notification once completed. Go to Export Application to view the status.');
@@ -337,10 +337,10 @@ describe('Activity log filter tests', function () {
337
337
  expect(mdm_sdk_1.exportActivities).toHaveBeenCalledWith({
338
338
  exportPath: '/nui/export',
339
339
  options: {
340
- fileFormat: 'csv',
341
- filter: "(gte(timestamp, 1626076206900)) and (equals(items.objectUri, 'entities/7Jsn1POn6') or equals(items.startObjectUri, 'entities/7Jsn1POn6') or equals(items.endObjectUri, 'entities/7Jsn1POn6')) and (not equals(user, 'collaboration-service'))"
340
+ fileFormat: 'csv'
342
341
  },
343
- tenant: 'alenat'
342
+ tenant: 'alenat',
343
+ filter: "(gte(timestamp, 1626076206900)) and (equals(items.objectUri, 'entities/7Jsn1POn6') or equals(items.startObjectUri, 'entities/7Jsn1POn6') or equals(items.endObjectUri, 'entities/7Jsn1POn6')) and (not equals(user, 'collaboration-service'))"
344
344
  });
345
345
  expect(errors_1.showErrorMessage).toHaveBeenCalledWith({ errorMessage: 'Something went wrong' }, { defaultMessage: "Can't export activities", title: 'Error' });
346
346
  expect(react_2.screen.queryByRole('alert')).not.toBeInTheDocument();
@@ -122,8 +122,11 @@ exports.getRelationChanges = (0, ramda_1.curry)(function (metadata, relationInfo
122
122
  };
123
123
  var relationType = (0, mdm_sdk_1.getRelationType)(metadata, relationInfo.type);
124
124
  var attrTypes = (0, mdm_sdk_1.getRelationAttributesList)(metadata, relationInfo.type);
125
+ var lineIds = changeType === mdm_sdk_1.DCRTypes.CREATE_RELATIONSHIP || changeType === mdm_sdk_1.DCRTypes.DELETE_RELATIONSHIP
126
+ ? (changes === null || changes === void 0 ? void 0 : changes.lineIds) || relationChangeLineIds
127
+ : undefined;
125
128
  return (0, ramda_1.flatten)([
126
- __assign({ level: 1, label: (0, ramda_1.propOr)('', 'label', relationType), attributeType: null, relationType: relationType, attributeValue: __assign(__assign({}, relationInfo), changes), lineIds: (changes === null || changes === void 0 ? void 0 : changes.lineIds) || relationChangeLineIds }, addRelationOperationIfNeeded(changes, changeType)),
129
+ __assign({ level: 1, label: (0, ramda_1.propOr)('', 'label', relationType), attributeType: null, relationType: relationType, attributeValue: __assign(__assign({}, relationInfo), changes), lineIds: lineIds }, addRelationOperationIfNeeded(changes, changeType)),
127
130
  getAttributesList(metadata, attrTypes, changes, 2)
128
131
  ]);
129
132
  });
@@ -150,7 +150,7 @@ describe('attributes helpers tests', function () {
150
150
  attributeValue: __assign(__assign({}, relationInfo), changes),
151
151
  label: metadata.relationTypes[1].label,
152
152
  level: 1,
153
- lineIds: ['lineIds']
153
+ lineIds: undefined
154
154
  },
155
155
  {
156
156
  attributeType: mdm_sdk_1.EntityAttrTypes.startDate,
@@ -82,18 +82,18 @@ var cleanValueRecursively = function (value) {
82
82
  return (0, ramda_1.filter)(function (propertyValues) { return !(0, ramda_1.isEmpty)(propertyValues); }, cleanedProperties);
83
83
  };
84
84
  var cleanChange = function (change) {
85
- var _a, _b, _c;
85
+ var _a, _b;
86
86
  if (Array.isArray(change.newValue)) {
87
87
  return change;
88
88
  }
89
- if ((0, mdm_sdk_1.isRelationTypeUri)(change.objectType)) {
90
- if (change.type === mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE || change.type === mdm_sdk_1.DCRTypes.UPDATE_ATTRIBUTE) {
91
- var cleanedValues = cleanValueRecursively((_a = change.newValue) === null || _a === void 0 ? void 0 : _a.value);
92
- return (0, ramda_1.assocPath)(['newValue', 'value'], cleanedValues, change);
93
- }
89
+ if (typeof change.newValue === 'object' && (0, ramda_1.hasPath)(['newValue', 'value'], change)) {
90
+ var cleanedValue = cleanValueRecursively((_a = change.newValue) === null || _a === void 0 ? void 0 : _a.value);
91
+ return (0, ramda_1.assocPath)(['newValue', 'value'], cleanedValue, change);
92
+ }
93
+ if (typeof change.newValue === 'object' && (0, ramda_1.hasPath)(['newValue', 'attributes'], change)) {
94
94
  var cleanedAttributes = cleanValueRecursively((_b = change.newValue) === null || _b === void 0 ? void 0 : _b.attributes);
95
95
  var changeWithCleanedAttributes = (0, ramda_1.assocPath)(['newValue', 'attributes'], cleanedAttributes, change);
96
- if (change.type === mdm_sdk_1.DCRTypes.CREATE_RELATIONSHIP) {
96
+ if ((0, mdm_sdk_1.isRelationTypeUri)(change.objectType) && change.type === mdm_sdk_1.DCRTypes.CREATE_RELATIONSHIP) {
97
97
  var cleanByPath = function (valuePath) {
98
98
  return (0, ramda_1.when)((0, ramda_1.allPass)([(0, ramda_1.hasPath)(valuePath), (0, ramda_1.pipe)((0, ramda_1.path)(valuePath), ramda_1.isNil)]), (0, ramda_1.dissocPath)(valuePath));
99
99
  };
@@ -101,10 +101,6 @@ var cleanChange = function (change) {
101
101
  }
102
102
  return changeWithCleanedAttributes;
103
103
  }
104
- if (typeof change.newValue === 'object') {
105
- var cleanedValue = cleanValueRecursively((_c = change.newValue) === null || _c === void 0 ? void 0 : _c.value);
106
- return (0, ramda_1.assocPath)(['newValue', 'value'], cleanedValue, change);
107
- }
108
104
  return change;
109
105
  };
110
106
  var calculateValuePath = function (key, change) {
@@ -142,7 +142,7 @@ var useInternalExport = function (_a) {
142
142
  if (!exportName || !fileFormat)
143
143
  return [2 /*return*/];
144
144
  isCsv = [ExportFormat.CSVFlattened, ExportFormat.CSVExploded].includes(fileFormat.value);
145
- baseOptions = __assign(__assign({ fileFormat: isCsv ? mdm_sdk_1.ExportDataFormat.CSV : mdm_sdk_1.ExportDataFormat.JSON, filter: filter, activeness: activityFilter, options: isSearchByOv ? 'parallelExecution,searchByOv' : 'parallelExecution' }, (fileFormat.value === ExportFormat.CSVExploded ? { exploded: true } : {})), (isCsv ? { dateFormat: 'readable' } : {}));
145
+ baseOptions = __assign(__assign({ fileFormat: isCsv ? mdm_sdk_1.ExportDataFormat.CSV : mdm_sdk_1.ExportDataFormat.JSON, activeness: activityFilter, options: isSearchByOv ? 'parallelExecution,searchByOv' : 'parallelExecution' }, (fileFormat.value === ExportFormat.CSVExploded ? { exploded: true } : {})), (isCsv ? { dateFormat: 'readable' } : {}));
146
146
  tasks = [];
147
147
  typesWithSomeColumns = entityTypes.filter(function (uri) { return columnsByEntityType[uri].length > 0; });
148
148
  typesWithAllColumns = entityTypes.filter(function (uri) { return columnsByEntityType[uri].length === 0; });
@@ -155,7 +155,8 @@ var useInternalExport = function (_a) {
155
155
  tenant: tenant,
156
156
  options: options,
157
157
  includeType: [entityTypeUri],
158
- headerOrder: headerOrder
158
+ headerOrder: headerOrder,
159
+ filter: filter
159
160
  }));
160
161
  jobEntityTypes.push([entityTypeUri]);
161
162
  });
@@ -166,7 +167,8 @@ var useInternalExport = function (_a) {
166
167
  tenant: tenant,
167
168
  options: options,
168
169
  includeType: typesWithAllColumns,
169
- headerOrder: mdm_sdk_1.ExportHeaderOrder.Default
170
+ headerOrder: mdm_sdk_1.ExportHeaderOrder.Default,
171
+ filter: filter
170
172
  }));
171
173
  jobEntityTypes.push(typesWithAllColumns);
172
174
  }
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const AuthoringPerspectiveViewContext: React.Context<boolean>;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export var AuthoringPerspectiveViewContext = React.createContext(false);
3
+ AuthoringPerspectiveViewContext.displayName = 'AuthoringPerspectiveViewContext';
@@ -20,10 +20,9 @@ export var ActivityExportButton = function (_a) {
20
20
  var _c = useState(false), showSnackbar = _c[0], setShowSnackbar = _c[1];
21
21
  var handleClickExport = useCallback(function (type) {
22
22
  var options = {
23
- filter: buildActivitiesFilterString(filters),
24
23
  fileFormat: type
25
24
  };
26
- exportActivities({ exportPath: exportPath, tenant: tenant, options: options })
25
+ exportActivities({ exportPath: exportPath, tenant: tenant, options: options, filter: buildActivitiesFilterString(filters) })
27
26
  .then(function () { return setShowSnackbar(true); })
28
27
  .catch(onError);
29
28
  }, [filters, tenant, exportPath]);
@@ -274,10 +274,10 @@ describe('Activity log filter tests', function () {
274
274
  expect(exportActivities).toHaveBeenCalledWith({
275
275
  exportPath: '/nui/export',
276
276
  options: {
277
- fileFormat: undefined,
278
- filter: "(gte(timestamp, 1626076206900)) and (equals(items.objectUri, 'entities/7Jsn1POn6') or equals(items.startObjectUri, 'entities/7Jsn1POn6') or equals(items.endObjectUri, 'entities/7Jsn1POn6')) and (not equals(user, 'collaboration-service'))"
277
+ fileFormat: undefined
279
278
  },
280
- tenant: 'alenat'
279
+ tenant: 'alenat',
280
+ filter: "(gte(timestamp, 1626076206900)) and (equals(items.objectUri, 'entities/7Jsn1POn6') or equals(items.startObjectUri, 'entities/7Jsn1POn6') or equals(items.endObjectUri, 'entities/7Jsn1POn6')) and (not equals(user, 'collaboration-service'))"
281
281
  });
282
282
  alert = screen.getByRole('alert');
283
283
  within(alert).getByText('Export operation is currently in progress. You will receive an email notification once completed. Go to Export Application to view the status.');
@@ -304,10 +304,10 @@ describe('Activity log filter tests', function () {
304
304
  expect(exportActivities).toHaveBeenCalledWith({
305
305
  exportPath: '/nui/export',
306
306
  options: {
307
- fileFormat: 'json',
308
- filter: "(gte(timestamp, 1626076206900)) and (equals(items.objectUri, 'entities/7Jsn1POn6') or equals(items.startObjectUri, 'entities/7Jsn1POn6') or equals(items.endObjectUri, 'entities/7Jsn1POn6')) and (not equals(user, 'collaboration-service'))"
307
+ fileFormat: 'json'
309
308
  },
310
- tenant: 'alenat'
309
+ tenant: 'alenat',
310
+ filter: "(gte(timestamp, 1626076206900)) and (equals(items.objectUri, 'entities/7Jsn1POn6') or equals(items.startObjectUri, 'entities/7Jsn1POn6') or equals(items.endObjectUri, 'entities/7Jsn1POn6')) and (not equals(user, 'collaboration-service'))"
311
311
  });
312
312
  alert = screen.getByRole('alert');
313
313
  within(alert).getByText('Export operation is currently in progress. You will receive an email notification once completed. Go to Export Application to view the status.');
@@ -332,10 +332,10 @@ describe('Activity log filter tests', function () {
332
332
  expect(exportActivities).toHaveBeenCalledWith({
333
333
  exportPath: '/nui/export',
334
334
  options: {
335
- fileFormat: 'csv',
336
- filter: "(gte(timestamp, 1626076206900)) and (equals(items.objectUri, 'entities/7Jsn1POn6') or equals(items.startObjectUri, 'entities/7Jsn1POn6') or equals(items.endObjectUri, 'entities/7Jsn1POn6')) and (not equals(user, 'collaboration-service'))"
335
+ fileFormat: 'csv'
337
336
  },
338
- tenant: 'alenat'
337
+ tenant: 'alenat',
338
+ filter: "(gte(timestamp, 1626076206900)) and (equals(items.objectUri, 'entities/7Jsn1POn6') or equals(items.startObjectUri, 'entities/7Jsn1POn6') or equals(items.endObjectUri, 'entities/7Jsn1POn6')) and (not equals(user, 'collaboration-service'))"
339
339
  });
340
340
  expect(showErrorMessage).toHaveBeenCalledWith({ errorMessage: 'Something went wrong' }, { defaultMessage: "Can't export activities", title: 'Error' });
341
341
  expect(screen.queryByRole('alert')).not.toBeInTheDocument();
@@ -119,8 +119,11 @@ export var getRelationChanges = curry(function (metadata, relationInfo, changes,
119
119
  };
120
120
  var relationType = getRelationType(metadata, relationInfo.type);
121
121
  var attrTypes = getRelationAttributesList(metadata, relationInfo.type);
122
+ var lineIds = changeType === DCRTypes.CREATE_RELATIONSHIP || changeType === DCRTypes.DELETE_RELATIONSHIP
123
+ ? (changes === null || changes === void 0 ? void 0 : changes.lineIds) || relationChangeLineIds
124
+ : undefined;
122
125
  return flatten([
123
- __assign({ level: 1, label: propOr('', 'label', relationType), attributeType: null, relationType: relationType, attributeValue: __assign(__assign({}, relationInfo), changes), lineIds: (changes === null || changes === void 0 ? void 0 : changes.lineIds) || relationChangeLineIds }, addRelationOperationIfNeeded(changes, changeType)),
126
+ __assign({ level: 1, label: propOr('', 'label', relationType), attributeType: null, relationType: relationType, attributeValue: __assign(__assign({}, relationInfo), changes), lineIds: lineIds }, addRelationOperationIfNeeded(changes, changeType)),
124
127
  getAttributesList(metadata, attrTypes, changes, 2)
125
128
  ]);
126
129
  });
@@ -148,7 +148,7 @@ describe('attributes helpers tests', function () {
148
148
  attributeValue: __assign(__assign({}, relationInfo), changes),
149
149
  label: metadata.relationTypes[1].label,
150
150
  level: 1,
151
- lineIds: ['lineIds']
151
+ lineIds: undefined
152
152
  },
153
153
  {
154
154
  attributeType: EntityAttrTypes.startDate,
@@ -75,18 +75,18 @@ var cleanValueRecursively = function (value) {
75
75
  return filter(function (propertyValues) { return !isEmpty(propertyValues); }, cleanedProperties);
76
76
  };
77
77
  var cleanChange = function (change) {
78
- var _a, _b, _c;
78
+ var _a, _b;
79
79
  if (Array.isArray(change.newValue)) {
80
80
  return change;
81
81
  }
82
- if (isRelationTypeUri(change.objectType)) {
83
- if (change.type === DCRTypes.INSERT_ATTRIBUTE || change.type === DCRTypes.UPDATE_ATTRIBUTE) {
84
- var cleanedValues = cleanValueRecursively((_a = change.newValue) === null || _a === void 0 ? void 0 : _a.value);
85
- return assocPath(['newValue', 'value'], cleanedValues, change);
86
- }
82
+ if (typeof change.newValue === 'object' && hasPath(['newValue', 'value'], change)) {
83
+ var cleanedValue = cleanValueRecursively((_a = change.newValue) === null || _a === void 0 ? void 0 : _a.value);
84
+ return assocPath(['newValue', 'value'], cleanedValue, change);
85
+ }
86
+ if (typeof change.newValue === 'object' && hasPath(['newValue', 'attributes'], change)) {
87
87
  var cleanedAttributes = cleanValueRecursively((_b = change.newValue) === null || _b === void 0 ? void 0 : _b.attributes);
88
88
  var changeWithCleanedAttributes = assocPath(['newValue', 'attributes'], cleanedAttributes, change);
89
- if (change.type === DCRTypes.CREATE_RELATIONSHIP) {
89
+ if (isRelationTypeUri(change.objectType) && change.type === DCRTypes.CREATE_RELATIONSHIP) {
90
90
  var cleanByPath = function (valuePath) {
91
91
  return when(allPass([hasPath(valuePath), pipe(path(valuePath), isNil)]), dissocPath(valuePath));
92
92
  };
@@ -94,10 +94,6 @@ var cleanChange = function (change) {
94
94
  }
95
95
  return changeWithCleanedAttributes;
96
96
  }
97
- if (typeof change.newValue === 'object') {
98
- var cleanedValue = cleanValueRecursively((_c = change.newValue) === null || _c === void 0 ? void 0 : _c.value);
99
- return assocPath(['newValue', 'value'], cleanedValue, change);
100
- }
101
97
  return change;
102
98
  };
103
99
  var calculateValuePath = function (key, change) {
@@ -136,7 +136,7 @@ export var useInternalExport = function (_a) {
136
136
  if (!exportName || !fileFormat)
137
137
  return [2 /*return*/];
138
138
  isCsv = [ExportFormat.CSVFlattened, ExportFormat.CSVExploded].includes(fileFormat.value);
139
- baseOptions = __assign(__assign({ fileFormat: isCsv ? ExportDataFormat.CSV : ExportDataFormat.JSON, filter: filter, activeness: activityFilter, options: isSearchByOv ? 'parallelExecution,searchByOv' : 'parallelExecution' }, (fileFormat.value === ExportFormat.CSVExploded ? { exploded: true } : {})), (isCsv ? { dateFormat: 'readable' } : {}));
139
+ baseOptions = __assign(__assign({ fileFormat: isCsv ? ExportDataFormat.CSV : ExportDataFormat.JSON, activeness: activityFilter, options: isSearchByOv ? 'parallelExecution,searchByOv' : 'parallelExecution' }, (fileFormat.value === ExportFormat.CSVExploded ? { exploded: true } : {})), (isCsv ? { dateFormat: 'readable' } : {}));
140
140
  tasks = [];
141
141
  typesWithSomeColumns = entityTypes.filter(function (uri) { return columnsByEntityType[uri].length > 0; });
142
142
  typesWithAllColumns = entityTypes.filter(function (uri) { return columnsByEntityType[uri].length === 0; });
@@ -149,7 +149,8 @@ export var useInternalExport = function (_a) {
149
149
  tenant: tenant,
150
150
  options: options,
151
151
  includeType: [entityTypeUri],
152
- headerOrder: headerOrder
152
+ headerOrder: headerOrder,
153
+ filter: filter
153
154
  }));
154
155
  jobEntityTypes.push([entityTypeUri]);
155
156
  });
@@ -160,7 +161,8 @@ export var useInternalExport = function (_a) {
160
161
  tenant: tenant,
161
162
  options: options,
162
163
  includeType: typesWithAllColumns,
163
- headerOrder: ExportHeaderOrder.Default
164
+ headerOrder: ExportHeaderOrder.Default,
165
+ filter: filter
164
166
  }));
165
167
  jobEntityTypes.push(typesWithAllColumns);
166
168
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.2220",
3
+ "version": "1.4.2225",
4
4
  "license": "SEE LICENSE IN LICENSE FILE",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./index.js",
@@ -11,7 +11,7 @@
11
11
  "@fluentui/react-context-selector": "^9.1.26",
12
12
  "@googlemaps/markerclusterer": "^2.5.3",
13
13
  "@react-sigma/core": "3.4.0",
14
- "@reltio/mdm-sdk": "^1.4.2018",
14
+ "@reltio/mdm-sdk": "^1.4.2020",
15
15
  "@vis.gl/react-google-maps": "^1.3.0",
16
16
  "d3-cloud": "^1.2.5",
17
17
  "d3-geo": "^2.0.1",