@reltio/components 1.4.2179 → 1.4.2180

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.
Files changed (81) hide show
  1. package/cjs/constants/segmantation.d.ts +14 -0
  2. package/cjs/constants/segmantation.js +17 -1
  3. package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.js +8 -0
  4. package/cjs/features/activity-log/ActivitiesFactory/components/SegmentActivity/SegmentActivity.d.ts +8 -0
  5. package/cjs/features/activity-log/ActivitiesFactory/components/SegmentActivity/SegmentActivity.js +20 -0
  6. package/cjs/features/activity-log/ActivitiesFactory/components/SegmentActivity/index.d.ts +1 -0
  7. package/cjs/features/activity-log/ActivitiesFactory/components/SegmentActivity/index.js +5 -0
  8. package/cjs/features/activity-log/ActivityFilterEditor/helpers.test.js +3 -2
  9. package/cjs/features/activity-log/ActivityLog/ActivityLog.test.js +240 -5
  10. package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.d.ts +2 -1
  11. package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.js +2 -2
  12. package/cjs/features/activity-log/RecordUpdates/RecordUpdates.d.ts +2 -1
  13. package/cjs/features/activity-log/RecordUpdates/RecordUpdates.js +5 -2
  14. package/cjs/features/activity-log/RecordUpdates/components/SegmentDeltaField/SegmentDeltaField.d.ts +7 -0
  15. package/cjs/features/activity-log/RecordUpdates/components/SegmentDeltaField/SegmentDeltaField.js +46 -0
  16. package/cjs/features/activity-log/RecordUpdates/components/SegmentDeltaField/SegmentDeltaField.module.css.js +9 -0
  17. package/cjs/features/activity-log/RecordUpdates/components/SegmentDeltaField/SegmentQueryDeltaValue.d.ts +4 -0
  18. package/cjs/features/activity-log/RecordUpdates/components/SegmentDeltaField/SegmentQueryDeltaValue.js +19 -0
  19. package/cjs/features/activity-log/RecordUpdates/components/SegmentDeltaField/SegmentRefreshScheduleDeltaValue.d.ts +5 -0
  20. package/cjs/features/activity-log/RecordUpdates/components/SegmentDeltaField/SegmentRefreshScheduleDeltaValue.js +57 -0
  21. package/cjs/features/activity-log/RecordUpdates/components/SegmentDeltaField/index.d.ts +1 -0
  22. package/cjs/features/activity-log/RecordUpdates/components/SegmentDeltaField/index.js +5 -0
  23. package/cjs/features/activity-log/SegmentObject/SegmentObject.d.ts +7 -0
  24. package/cjs/features/activity-log/SegmentObject/SegmentObject.js +21 -0
  25. package/cjs/features/activity-log/SegmentObject/SegmentObject.module.css.js +9 -0
  26. package/cjs/features/activity-log/SegmentObject/index.d.ts +1 -0
  27. package/cjs/features/activity-log/SegmentObject/index.js +5 -0
  28. package/cjs/features/activity-log/SegmentRecord/SegmentRecord.d.ts +7 -0
  29. package/cjs/features/activity-log/SegmentRecord/SegmentRecord.js +22 -0
  30. package/cjs/features/activity-log/SegmentRecord/index.d.ts +1 -0
  31. package/cjs/features/activity-log/SegmentRecord/index.js +5 -0
  32. package/cjs/features/activity-log/hooks/useSegmentReadableQuery.d.ts +2 -0
  33. package/cjs/features/activity-log/hooks/useSegmentReadableQuery.js +13 -0
  34. package/cjs/features/activity-log/index.d.ts +1 -0
  35. package/cjs/features/activity-log/index.js +3 -1
  36. package/cjs/features/activity-log/types.d.ts +5 -1
  37. package/cjs/features/activity-log/types.js +3 -0
  38. package/cjs/features/activity-log/utils/activities.js +3 -0
  39. package/cjs/features/activity-log/utils/filters.js +4 -0
  40. package/cjs/features/history/types.d.ts +3 -0
  41. package/constants/segmantation.d.ts +14 -0
  42. package/constants/segmantation.js +16 -0
  43. package/features/activity-log/ActivitiesFactory/ActivitiesFactory.js +8 -0
  44. package/features/activity-log/ActivitiesFactory/components/SegmentActivity/SegmentActivity.d.ts +8 -0
  45. package/features/activity-log/ActivitiesFactory/components/SegmentActivity/SegmentActivity.js +13 -0
  46. package/features/activity-log/ActivitiesFactory/components/SegmentActivity/index.d.ts +1 -0
  47. package/features/activity-log/ActivitiesFactory/components/SegmentActivity/index.js +1 -0
  48. package/features/activity-log/ActivityFilterEditor/helpers.test.js +3 -2
  49. package/features/activity-log/ActivityLog/ActivityLog.test.js +240 -5
  50. package/features/activity-log/ActivityLogFilter/ActivityLogFilter.d.ts +2 -1
  51. package/features/activity-log/ActivityLogFilter/ActivityLogFilter.js +2 -2
  52. package/features/activity-log/RecordUpdates/RecordUpdates.d.ts +2 -1
  53. package/features/activity-log/RecordUpdates/RecordUpdates.js +5 -2
  54. package/features/activity-log/RecordUpdates/components/SegmentDeltaField/SegmentDeltaField.d.ts +7 -0
  55. package/features/activity-log/RecordUpdates/components/SegmentDeltaField/SegmentDeltaField.js +39 -0
  56. package/features/activity-log/RecordUpdates/components/SegmentDeltaField/SegmentDeltaField.module.css.js +9 -0
  57. package/features/activity-log/RecordUpdates/components/SegmentDeltaField/SegmentQueryDeltaValue.d.ts +4 -0
  58. package/features/activity-log/RecordUpdates/components/SegmentDeltaField/SegmentQueryDeltaValue.js +12 -0
  59. package/features/activity-log/RecordUpdates/components/SegmentDeltaField/SegmentRefreshScheduleDeltaValue.d.ts +5 -0
  60. package/features/activity-log/RecordUpdates/components/SegmentDeltaField/SegmentRefreshScheduleDeltaValue.js +27 -0
  61. package/features/activity-log/RecordUpdates/components/SegmentDeltaField/index.d.ts +1 -0
  62. package/features/activity-log/RecordUpdates/components/SegmentDeltaField/index.js +1 -0
  63. package/features/activity-log/SegmentObject/SegmentObject.d.ts +7 -0
  64. package/features/activity-log/SegmentObject/SegmentObject.js +14 -0
  65. package/features/activity-log/SegmentObject/SegmentObject.module.css.js +9 -0
  66. package/features/activity-log/SegmentObject/index.d.ts +1 -0
  67. package/features/activity-log/SegmentObject/index.js +1 -0
  68. package/features/activity-log/SegmentRecord/SegmentRecord.d.ts +7 -0
  69. package/features/activity-log/SegmentRecord/SegmentRecord.js +15 -0
  70. package/features/activity-log/SegmentRecord/index.d.ts +1 -0
  71. package/features/activity-log/SegmentRecord/index.js +1 -0
  72. package/features/activity-log/hooks/useSegmentReadableQuery.d.ts +2 -0
  73. package/features/activity-log/hooks/useSegmentReadableQuery.js +9 -0
  74. package/features/activity-log/index.d.ts +1 -0
  75. package/features/activity-log/index.js +1 -0
  76. package/features/activity-log/types.d.ts +5 -1
  77. package/features/activity-log/types.js +3 -0
  78. package/features/activity-log/utils/activities.js +3 -0
  79. package/features/activity-log/utils/filters.js +4 -0
  80. package/features/history/types.d.ts +3 -0
  81. package/package.json +2 -2
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.SegmentRefreshScheduleDeltaValue = void 0;
30
+ var react_1 = __importStar(require("react"));
31
+ var mdm_sdk_1 = require("@reltio/mdm-sdk");
32
+ var SegmentDeltaField_module_css_1 = __importDefault(require("./SegmentDeltaField.module.css"));
33
+ var addSpace = function (s, withSpace) {
34
+ if (withSpace === void 0) { withSpace = true; }
35
+ return (withSpace ? s + ' ' : s);
36
+ };
37
+ var SegmentRefreshScheduleDeltaValue = function (_a) {
38
+ var value = _a.value;
39
+ var scheduleTextChunks = (0, mdm_sdk_1.convertScheduleApiFormatToTextChunks)(value);
40
+ var scheduleString = (0, react_1.useMemo)(function () {
41
+ var chunkStrings = scheduleTextChunks
42
+ .filter(function (chunk) { return chunk.activeLabel; })
43
+ .map(function (_a) {
44
+ var activeLabel = _a.activeLabel, inactiveLabel = _a.inactiveLabel, _b = _a.hasEndingSpace, hasEndingSpace = _b === void 0 ? true : _b;
45
+ var out = [];
46
+ if (inactiveLabel)
47
+ out.push(addSpace(inactiveLabel));
48
+ var active = activeLabel.trim();
49
+ if (active)
50
+ out.push(addSpace(active, hasEndingSpace));
51
+ return out.join('');
52
+ });
53
+ return chunkStrings.join('').trimEnd();
54
+ }, [scheduleTextChunks]);
55
+ return react_1.default.createElement("p", { className: SegmentDeltaField_module_css_1.default.firstLetterCapitalized }, scheduleString);
56
+ };
57
+ exports.SegmentRefreshScheduleDeltaValue = SegmentRefreshScheduleDeltaValue;
@@ -0,0 +1 @@
1
+ export { SegmentDeltaField } from './SegmentDeltaField';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SegmentDeltaField = void 0;
4
+ var SegmentDeltaField_1 = require("./SegmentDeltaField");
5
+ Object.defineProperty(exports, "SegmentDeltaField", { enumerable: true, get: function () { return SegmentDeltaField_1.SegmentDeltaField; } });
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { ActivityItem } from '../types';
3
+ type Props = {
4
+ item: ActivityItem;
5
+ };
6
+ export declare const SegmentObject: ({ item }: Props) => React.JSX.Element;
7
+ export {};
@@ -0,0 +1,21 @@
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.SegmentObject = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var classnames_1 = __importDefault(require("classnames"));
9
+ var mdm_sdk_1 = require("@reltio/mdm-sdk");
10
+ var types_1 = require("../types");
11
+ var SegmentIdLink_1 = require("../../../SegmentIdLink");
12
+ var SegmentObject_module_css_1 = __importDefault(require("./SegmentObject.module.css"));
13
+ var SegmentObject = function (_a) {
14
+ var _b;
15
+ var item = _a.item;
16
+ var objectLabel = item.objectLabel, objectUri = item.objectUri, data = item.data;
17
+ var isRemoved = (data === null || data === void 0 ? void 0 : data.type) === types_1.ActivityTypes.SEGMENT_DELETE;
18
+ var segmentId = objectUri === null || objectUri === void 0 ? void 0 : objectUri.split('/').pop();
19
+ return (react_1.default.createElement(SegmentIdLink_1.SegmentIdLink, { className: (0, classnames_1.default)(SegmentObject_module_css_1.default.link, (_b = {}, _b[SegmentObject_module_css_1.default.removed] = isRemoved, _b)), segmentId: segmentId }, (0, mdm_sdk_1.getLabel)(objectLabel)));
20
+ };
21
+ exports.SegmentObject = SegmentObject;
@@ -0,0 +1,9 @@
1
+ const styles = {"link":"SegmentObject-link--8NAXv","removed":"SegmentObject-removed--Ws93n"};
2
+ if (typeof document !== 'undefined') {
3
+ const head = document.head || document.getElementsByTagName('head')[0]
4
+ const style = document.createElement('style');
5
+ style.type = 'text/css'
6
+ style.innerHTML = `.SegmentObject-link--8NAXv{color:var(--mui-palette-primary-main);font-size:13px;font-weight:400;line-height:15px;text-decoration:none;white-space:break-spaces}.SegmentObject-link--8NAXv.SegmentObject-removed--Ws93n{color:var(--mui-palette-text-secondary);pointer-events:none}`;
7
+ head.appendChild(style);
8
+ }
9
+ module.exports = styles;
@@ -0,0 +1 @@
1
+ export { SegmentObject } from './SegmentObject';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SegmentObject = void 0;
4
+ var SegmentObject_1 = require("./SegmentObject");
5
+ Object.defineProperty(exports, "SegmentObject", { enumerable: true, get: function () { return SegmentObject_1.SegmentObject; } });
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { ActivityItem } from '../types';
3
+ type Props = {
4
+ item: ActivityItem;
5
+ };
6
+ export declare const SegmentRecord: ({ item }: Props) => React.JSX.Element;
7
+ export {};
@@ -0,0 +1,22 @@
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.SegmentRecord = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var ui_i18n_1 = __importDefault(require("ui-i18n"));
9
+ var Record_1 = require("../Record");
10
+ var RecordLabel_1 = require("../RecordLabel");
11
+ var RecordUpdates_1 = require("../RecordUpdates");
12
+ var SegmentObject_1 = require("../SegmentObject");
13
+ var SegmentRecord = function (_a) {
14
+ var _b;
15
+ var item = _a.item;
16
+ var deltaArray = (_b = item === null || item === void 0 ? void 0 : item.deltaCollection) === null || _b === void 0 ? void 0 : _b.delta;
17
+ return (react_1.default.createElement(Record_1.Record, null,
18
+ react_1.default.createElement(RecordLabel_1.RecordLabel, { description: deltaArray ? '' : ui_i18n_1.default.text('Segment changed') },
19
+ react_1.default.createElement(SegmentObject_1.SegmentObject, { item: item })),
20
+ react_1.default.createElement(RecordUpdates_1.RecordUpdates, { updates: deltaArray, recordId: item.id, isSegment: true })));
21
+ };
22
+ exports.SegmentRecord = SegmentRecord;
@@ -0,0 +1 @@
1
+ export { SegmentRecord } from './SegmentRecord';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SegmentRecord = void 0;
4
+ var SegmentRecord_1 = require("./SegmentRecord");
5
+ Object.defineProperty(exports, "SegmentRecord", { enumerable: true, get: function () { return SegmentRecord_1.SegmentRecord; } });
@@ -0,0 +1,2 @@
1
+ import { ReadableQueryPrimitive, SegmentationQueryGroup } from '@reltio/mdm-sdk';
2
+ export declare const useSegmentReadableQuery: (groups: SegmentationQueryGroup[]) => ReadableQueryPrimitive[];
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useSegmentReadableQuery = void 0;
4
+ var react_1 = require("react");
5
+ var mdm_sdk_1 = require("@reltio/mdm-sdk");
6
+ var MdmModuleContext_1 = require("../../../contexts/MdmModuleContext");
7
+ var useSegmentReadableQuery = function (groups) {
8
+ var metadata = (0, MdmModuleContext_1.useMdmMetadata)();
9
+ var attributesPresentation = (0, MdmModuleContext_1.useMdmAttributesPresentation)();
10
+ var lookups = (0, MdmModuleContext_1.useMdmLookups)();
11
+ return (0, react_1.useMemo)(function () { return (0, mdm_sdk_1.buildSegmentationGroupsReadableQuery)(metadata, attributesPresentation, lookups, groups); }, [metadata, lookups, attributesPresentation, groups]);
12
+ };
13
+ exports.useSegmentReadableQuery = useSegmentReadableQuery;
@@ -3,5 +3,6 @@ export { ActivityLogFilter } from './ActivityLogFilter';
3
3
  export { useActivitiesLoader } from './hooks/useActivitiesLoader';
4
4
  export { useProfileActivitiesLoader } from './hooks/useProfileActivitiesLoader';
5
5
  export { getActivityLabel } from './utils/activities';
6
+ export { buildActivitiesFilterString } from './utils/filters';
6
7
  export { ActivityTypes } from './types';
7
8
  export type { ActivitiesFilter, ActivityData } from './types';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActivityTypes = exports.getActivityLabel = exports.useProfileActivitiesLoader = exports.useActivitiesLoader = exports.ActivityLogFilter = exports.ActivityLog = void 0;
3
+ exports.ActivityTypes = exports.buildActivitiesFilterString = exports.getActivityLabel = exports.useProfileActivitiesLoader = exports.useActivitiesLoader = exports.ActivityLogFilter = exports.ActivityLog = void 0;
4
4
  // components
5
5
  var ActivityLog_1 = require("./ActivityLog");
6
6
  Object.defineProperty(exports, "ActivityLog", { enumerable: true, get: function () { return ActivityLog_1.ActivityLog; } });
@@ -14,6 +14,8 @@ Object.defineProperty(exports, "useProfileActivitiesLoader", { enumerable: true,
14
14
  // helpers
15
15
  var activities_1 = require("./utils/activities");
16
16
  Object.defineProperty(exports, "getActivityLabel", { enumerable: true, get: function () { return activities_1.getActivityLabel; } });
17
+ var filters_1 = require("./utils/filters");
18
+ Object.defineProperty(exports, "buildActivitiesFilterString", { enumerable: true, get: function () { return filters_1.buildActivitiesFilterString; } });
17
19
  // types
18
20
  var types_1 = require("./types");
19
21
  Object.defineProperty(exports, "ActivityTypes", { enumerable: true, get: function () { return types_1.ActivityTypes; } });
@@ -30,7 +30,10 @@ export declare enum ActivityTypes {
30
30
  SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE = "SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE",
31
31
  GROUP_CREATED = "GROUP_CREATED",
32
32
  GROUP_REMOVED = "GROUP_REMOVED",
33
- GROUP_CHANGED = "GROUP_CHANGED"
33
+ GROUP_CHANGED = "GROUP_CHANGED",
34
+ SEGMENT_CREATE = "SEGMENT_CREATE",
35
+ SEGMENT_DELETE = "SEGMENT_DELETE",
36
+ SEGMENT_UPDATE = "SEGMENT_UPDATE"
34
37
  }
35
38
  export type ActivitiesFilter = {
36
39
  users: string[];
@@ -40,6 +43,7 @@ export type ActivitiesFilter = {
40
43
  sources?: Source[];
41
44
  entityTypes?: TEntityType[];
42
45
  entityUri?: string;
46
+ segmentId?: string;
43
47
  };
44
48
  type DeltaObject = {
45
49
  [key: string]: DeltaValue[];
@@ -33,6 +33,9 @@ var ActivityTypes;
33
33
  ActivityTypes["GROUP_CREATED"] = "GROUP_CREATED";
34
34
  ActivityTypes["GROUP_REMOVED"] = "GROUP_REMOVED";
35
35
  ActivityTypes["GROUP_CHANGED"] = "GROUP_CHANGED";
36
+ ActivityTypes["SEGMENT_CREATE"] = "SEGMENT_CREATE";
37
+ ActivityTypes["SEGMENT_DELETE"] = "SEGMENT_DELETE";
38
+ ActivityTypes["SEGMENT_UPDATE"] = "SEGMENT_UPDATE";
36
39
  })(ActivityTypes || (exports.ActivityTypes = ActivityTypes = {}));
37
40
  var DeltaTypes;
38
41
  (function (DeltaTypes) {
@@ -98,6 +98,9 @@ var getActivityLabel = function (type) {
98
98
  _a[types_1.ActivityTypes.USER_SEARCH] = ui_i18n_1.default.text('Searched'),
99
99
  _a[types_1.ActivityTypes.ANALYTICS_ATTRIBUTES_CHANGED] = ui_i18n_1.default.text('Analytics attribute changed'),
100
100
  _a[types_1.ActivityTypes.SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE] = ui_i18n_1.default.text('SFDC connector synchronization issue'),
101
+ _a[types_1.ActivityTypes.SEGMENT_CREATE] = ui_i18n_1.default.text('Segment created'),
102
+ _a[types_1.ActivityTypes.SEGMENT_UPDATE] = ui_i18n_1.default.text('Segment updated'),
103
+ _a[types_1.ActivityTypes.SEGMENT_DELETE] = ui_i18n_1.default.text('Segment deleted'),
101
104
  _a);
102
105
  return labels[type] || '';
103
106
  };
@@ -18,6 +18,9 @@ var buildActivityFilterClause = function (activityType) {
18
18
  var buildAttributeFilterClause = function (attribute) {
19
19
  return "equals(items.delta.attributeType, '".concat(attribute.value, "')");
20
20
  };
21
+ var buildSegmentFilterClause = function (segmentId) {
22
+ return "equals(items.objectUri, 'segments/".concat(segmentId, "')");
23
+ };
21
24
  var getFilterClauseBuilder = (0, ramda_1.cond)([
22
25
  [(0, ramda_1.equals)('users'), function () { return (0, mdm_sdk_1.multiValueFilter)(mdm_sdk_1.buildUserFilterClause); }],
23
26
  [(0, ramda_1.equals)('activities'), function () { return (0, mdm_sdk_1.multiValueFilter)(buildActivityFilterClause); }],
@@ -26,6 +29,7 @@ var getFilterClauseBuilder = (0, ramda_1.cond)([
26
29
  [(0, ramda_1.equals)('entityTypes'), function () { return (0, mdm_sdk_1.multiValueFilter)(mdm_sdk_1.buildEntityTypeFilterClause); }],
27
30
  [(0, ramda_1.equals)('dateRange'), function () { return mdm_sdk_1.buildDateRangeFilterClause; }],
28
31
  [(0, ramda_1.equals)('entityUri'), function () { return mdm_sdk_1.buildEntityUriFilterClause; }],
32
+ [(0, ramda_1.equals)('segmentId'), function () { return buildSegmentFilterClause; }],
29
33
  [(0, ramda_1.equals)('rawFilter'), function () { return ramda_1.identity; }]
30
34
  ]);
31
35
  exports.buildActivitiesFilterString = (0, ramda_1.pipe)((0, ramda_1.defaultTo)({}), mdm_sdk_1.rejectEmptyValues, ramda_1.toPairs, (0, ramda_1.append)(['rawFilter', "not equals(user, 'collaboration-service')"]), (0, ramda_1.map)(function (_a) {
@@ -42,6 +42,9 @@ export declare const HistoryChangeTypes: {
42
42
  GROUP_CREATED: ActivityTypes.GROUP_CREATED;
43
43
  GROUP_REMOVED: ActivityTypes.GROUP_REMOVED;
44
44
  GROUP_CHANGED: ActivityTypes.GROUP_CHANGED;
45
+ SEGMENT_CREATE: ActivityTypes.SEGMENT_CREATE;
46
+ SEGMENT_DELETE: ActivityTypes.SEGMENT_DELETE;
47
+ SEGMENT_UPDATE: ActivityTypes.SEGMENT_UPDATE;
45
48
  };
46
49
  export type HistoryChangeTypes = typeof HistoryChangeTypes;
47
50
  export declare enum HistoryActivityType {
@@ -13,3 +13,17 @@ export declare enum SegmentationColumnId {
13
13
  Destinations = "destinations",
14
14
  Actions = "actions"
15
15
  }
16
+ export declare enum SegmentActivityLogAttributes {
17
+ label = "configuration/segments/attributes/label",
18
+ description = "configuration/segments/attributes/description",
19
+ sharing = "configuration/segments/attributes/sharing",
20
+ schedule = "configuration/segments/attributes/schedule",
21
+ rule = "configuration/segments/attributes/rule"
22
+ }
23
+ export declare const SEGMENT_ACTIVITY_LOG_ATTRIBUTES: {
24
+ "configuration/segments/attributes/label": string;
25
+ "configuration/segments/attributes/description": string;
26
+ "configuration/segments/attributes/sharing": string;
27
+ "configuration/segments/attributes/schedule": string;
28
+ "configuration/segments/attributes/rule": string;
29
+ };
@@ -1,3 +1,4 @@
1
+ var _a;
1
2
  export var SegmentationColumnId;
2
3
  (function (SegmentationColumnId) {
3
4
  SegmentationColumnId["Label"] = "label";
@@ -14,3 +15,18 @@ export var SegmentationColumnId;
14
15
  SegmentationColumnId["Destinations"] = "destinations";
15
16
  SegmentationColumnId["Actions"] = "actions";
16
17
  })(SegmentationColumnId || (SegmentationColumnId = {}));
18
+ export var SegmentActivityLogAttributes;
19
+ (function (SegmentActivityLogAttributes) {
20
+ SegmentActivityLogAttributes["label"] = "configuration/segments/attributes/label";
21
+ SegmentActivityLogAttributes["description"] = "configuration/segments/attributes/description";
22
+ SegmentActivityLogAttributes["sharing"] = "configuration/segments/attributes/sharing";
23
+ SegmentActivityLogAttributes["schedule"] = "configuration/segments/attributes/schedule";
24
+ SegmentActivityLogAttributes["rule"] = "configuration/segments/attributes/rule";
25
+ })(SegmentActivityLogAttributes || (SegmentActivityLogAttributes = {}));
26
+ export var SEGMENT_ACTIVITY_LOG_ATTRIBUTES = (_a = {},
27
+ _a[SegmentActivityLogAttributes.label] = 'Name',
28
+ _a[SegmentActivityLogAttributes.description] = 'Description',
29
+ _a[SegmentActivityLogAttributes.sharing] = 'Shared with',
30
+ _a[SegmentActivityLogAttributes.schedule] = 'Refresh frequency',
31
+ _a[SegmentActivityLogAttributes.rule] = 'Query',
32
+ _a);
@@ -9,6 +9,7 @@ import { RelationActivity } from './components/RelationActivity';
9
9
  import { SearchActivity } from './components/SearchActivity';
10
10
  import { SimpleActivity } from './components/SimpleActivity';
11
11
  import { SynchronizationIssuesActivity } from './components/SynchronizationIssuesActivity';
12
+ import { SegmentActivity } from './components/SegmentActivity';
12
13
  import AddIcon from '../../../icons/Add';
13
14
  import CalendarTodayIcon from '@mui/icons-material/CalendarToday';
14
15
  import CommentIcon from '../../../icons/Comment';
@@ -58,6 +59,10 @@ var ActivitiesFactory = /** @class */ (function () {
58
59
  case ActivityTypes.GROUP_CREATED:
59
60
  case ActivityTypes.GROUP_REMOVED:
60
61
  return React.createElement(GroupActivity, { data: data, type: type });
62
+ case ActivityTypes.SEGMENT_CREATE:
63
+ case ActivityTypes.SEGMENT_DELETE:
64
+ case ActivityTypes.SEGMENT_UPDATE:
65
+ return React.createElement(SegmentActivity, { data: data, type: type });
61
66
  case ActivityTypes.USER_LOGIN:
62
67
  case ActivityTypes.USER_LOGOUT:
63
68
  case ActivityTypes.MODEL_UPDATED:
@@ -93,11 +98,13 @@ var ActivitiesFactory = /** @class */ (function () {
93
98
  case ActivityTypes.ENTITY_CREATED:
94
99
  case ActivityTypes.RELATIONSHIP_CREATED:
95
100
  case ActivityTypes.GROUP_CREATED:
101
+ case ActivityTypes.SEGMENT_CREATE:
96
102
  return React.createElement(AddIcon, null);
97
103
  case ActivityTypes.ENTITY_REMOVED:
98
104
  case ActivityTypes.RELATIONSHIP_REMOVED:
99
105
  case ActivityTypes.POTENTIAL_MATCHES_REMOVED:
100
106
  case ActivityTypes.GROUP_REMOVED:
107
+ case ActivityTypes.SEGMENT_DELETE:
101
108
  return React.createElement(RemoveIcon, null);
102
109
  case ActivityTypes.USER_SEARCH:
103
110
  return React.createElement(SearchIcon, null);
@@ -114,6 +121,7 @@ var ActivitiesFactory = /** @class */ (function () {
114
121
  case ActivityTypes.MODEL_UPDATED:
115
122
  case ActivityTypes.RELATIONSHIP_CHANGED:
116
123
  case ActivityTypes.GROUP_CHANGED:
124
+ case ActivityTypes.SEGMENT_UPDATE:
117
125
  default:
118
126
  return React.createElement(CreateIcon, null);
119
127
  }
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { ActivityTypes, ActivityData } from '../../../types';
3
+ type Props = {
4
+ data: ActivityData;
5
+ type: ActivityTypes;
6
+ };
7
+ export declare const SegmentActivity: ({ type, data }: Props) => React.JSX.Element;
8
+ export {};
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { ActivityTitle } from '../../../ActivityTitle';
3
+ import { CollapsibleActivityRecords } from '../../../CollapsibleActivityRecords';
4
+ import { SegmentObject } from '../../../SegmentObject';
5
+ import { SegmentRecord } from '../../../SegmentRecord';
6
+ export var SegmentActivity = function (_a) {
7
+ var _b;
8
+ var type = _a.type, data = _a.data;
9
+ var isMinimized = data.itemsTotal === 1 && !((_b = data.items[0].deltaCollection) === null || _b === void 0 ? void 0 : _b.delta);
10
+ return (React.createElement("div", { "data-reltio-id": "segment-activity" },
11
+ React.createElement(ActivityTitle, { type: type, "data-reltio-id": "segment-activity-title" }, isMinimized && React.createElement(SegmentObject, { item: data.items[0] })),
12
+ !isMinimized && (React.createElement(CollapsibleActivityRecords, { activityUri: data.uri, items: data.items, RecordComponent: SegmentRecord }))));
13
+ };
@@ -0,0 +1 @@
1
+ export { SegmentActivity } from './SegmentActivity';
@@ -0,0 +1 @@
1
+ export { SegmentActivity } from './SegmentActivity';
@@ -38,6 +38,7 @@ var otherTypes = [
38
38
  'ATTRIBUTE_UNMASKED',
39
39
  'SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE'
40
40
  ];
41
+ var segmentTypes = ['SEGMENT_CREATE', 'SEGMENT_DELETE', 'SEGMENT_UPDATE'];
41
42
  var profileTypes = [
42
43
  'ENTITY_CREATED',
43
44
  'ENTITY_CHANGED',
@@ -61,7 +62,7 @@ describe('helpers tests', function () {
61
62
  var metadata = {
62
63
  entityTypes: []
63
64
  };
64
- expect(getSelectorActivityTypes(metadata)).toEqual(otherTypes);
65
+ expect(getSelectorActivityTypes(metadata)).toEqual(__spreadArray(__spreadArray([], otherTypes, true), segmentTypes, true));
65
66
  });
66
67
  it('should return ActivityTypes with groupRelated when groupTypes is not empty', function () {
67
68
  var metadata = {
@@ -85,7 +86,7 @@ describe('helpers tests', function () {
85
86
  }
86
87
  ]
87
88
  };
88
- expect(getSelectorActivityTypes(metadata)).toEqual(__spreadArray(__spreadArray([], otherTypes, true), groupTypes, true));
89
+ expect(getSelectorActivityTypes(metadata)).toEqual(__spreadArray(__spreadArray(__spreadArray([], otherTypes, true), groupTypes, true), segmentTypes, true));
89
90
  });
90
91
  it('should return profile related ActivityTypes when entityType passed', function () {
91
92
  var metadata = {