@reltio/components 1.4.2259 → 1.4.2261
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.
- package/AttributesValuesEditor/AttributesValuesEditor.js +8 -2
- package/DataTypeValue/DataTypeValue.js +7 -3
- package/DataTypeValue/DataTypeValue.test.js +26 -2
- package/FilterValueEditor/FilterValueEditor.js +9 -3
- package/FilterValueEditor/helpers.d.ts +6 -2
- package/FilterValueEditor/helpers.js +40 -24
- package/FilterValueEditor/helpers.test.d.ts +1 -0
- package/FilterValueEditor/helpers.test.js +30 -0
- package/HOCs/withFilter/components/ColumnFilter/ColumnFilter.js +10 -3
- package/HOCs/withFilter/components/FilterChip/FilterChip.js +13 -3
- package/InlineSimpleAttributeEditor/InlineSimpleAttributeEditor.js +14 -4
- package/SimpleAttributeEditor/SimpleAttributeEditor.js +8 -4
- package/SimpleAttributeEditor/helpers.d.ts +7 -1
- package/SimpleAttributeEditor/helpers.js +10 -8
- package/SimpleAttributeEditor/helpers.test.js +52 -9
- package/cjs/AttributesValuesEditor/AttributesValuesEditor.js +7 -1
- package/cjs/DataTypeValue/DataTypeValue.js +5 -1
- package/cjs/DataTypeValue/DataTypeValue.test.js +26 -2
- package/cjs/FilterValueEditor/FilterValueEditor.js +8 -2
- package/cjs/FilterValueEditor/helpers.d.ts +6 -2
- package/cjs/FilterValueEditor/helpers.js +40 -24
- package/cjs/FilterValueEditor/helpers.test.d.ts +1 -0
- package/cjs/FilterValueEditor/helpers.test.js +32 -0
- package/cjs/HOCs/withFilter/components/ColumnFilter/ColumnFilter.js +9 -2
- package/cjs/HOCs/withFilter/components/FilterChip/FilterChip.js +11 -1
- package/cjs/InlineSimpleAttributeEditor/InlineSimpleAttributeEditor.js +13 -3
- package/cjs/SimpleAttributeEditor/SimpleAttributeEditor.js +6 -2
- package/cjs/SimpleAttributeEditor/helpers.d.ts +7 -1
- package/cjs/SimpleAttributeEditor/helpers.js +11 -8
- package/cjs/SimpleAttributeEditor/helpers.test.js +51 -8
- package/cjs/contexts/MdmModuleContext/context.d.ts +2 -0
- package/cjs/contexts/MdmModuleContext/hooks.d.ts +1 -0
- package/cjs/contexts/MdmModuleContext/hooks.js +5 -1
- package/cjs/contexts/MdmModuleContext/index.d.ts +1 -1
- package/cjs/contexts/MdmModuleContext/index.js +2 -1
- package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.js +4 -1
- package/cjs/features/activity-log/hooks/useSegmentReadableQuery.js +6 -1
- package/cjs/features/activity-log/utils/activities.d.ts +3 -1
- package/cjs/features/activity-log/utils/activities.js +8 -3
- package/cjs/features/activity-log/utils/activities.test.js +21 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/DCRValueEditor/DCRValueEditor.d.ts +2 -2
- package/cjs/features/workflow/ChangeRequestEditor/components/DCRValueEditor/DCRValueEditor.js +8 -1
- package/cjs/features/workflow/ChangeRequestEditor/components/DCRValueEditorFactory/DCRValueEditorFactory.d.ts +4 -4
- package/cjs/features/workflow/ChangeRequestEditor/components/DCRValueEditorFactory/DCRValueEditorFactory.js +8 -4
- package/cjs/helpers/attributesView.d.ts +6 -5
- package/cjs/helpers/attributesView.js +24 -10
- package/cjs/helpers/attributesView.test.js +68 -0
- package/cjs/helpers/basicTable.d.ts +5 -2
- package/cjs/helpers/basicTable.js +9 -9
- package/cjs/helpers/basicTable.test.js +56 -0
- package/cjs/hooks/useReadableSearchState/useReadableSearchState.js +4 -2
- package/cjs/hooks/useReadableSearchState/useReadableSearchState.test.js +2 -2
- package/contexts/MdmModuleContext/context.d.ts +2 -0
- package/contexts/MdmModuleContext/hooks.d.ts +1 -0
- package/contexts/MdmModuleContext/hooks.js +3 -0
- package/contexts/MdmModuleContext/index.d.ts +1 -1
- package/contexts/MdmModuleContext/index.js +1 -1
- package/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.js +5 -2
- package/features/activity-log/hooks/useSegmentReadableQuery.js +7 -2
- package/features/activity-log/utils/activities.d.ts +3 -1
- package/features/activity-log/utils/activities.js +9 -4
- package/features/activity-log/utils/activities.test.js +21 -0
- package/features/workflow/ChangeRequestEditor/components/DCRValueEditor/DCRValueEditor.d.ts +2 -2
- package/features/workflow/ChangeRequestEditor/components/DCRValueEditor/DCRValueEditor.js +8 -1
- package/features/workflow/ChangeRequestEditor/components/DCRValueEditorFactory/DCRValueEditorFactory.d.ts +4 -4
- package/features/workflow/ChangeRequestEditor/components/DCRValueEditorFactory/DCRValueEditorFactory.js +8 -4
- package/helpers/attributesView.d.ts +6 -5
- package/helpers/attributesView.js +24 -10
- package/helpers/attributesView.test.js +69 -1
- package/helpers/basicTable.d.ts +5 -2
- package/helpers/basicTable.js +10 -10
- package/helpers/basicTable.test.js +57 -1
- package/hooks/useReadableSearchState/useReadableSearchState.js +5 -3
- package/hooks/useReadableSearchState/useReadableSearchState.test.js +2 -2
- package/package.json +2 -2
|
@@ -4,5 +4,7 @@ export declare const getActivityType: (activity: ActivityData) => any;
|
|
|
4
4
|
export declare const isValidActivityType: (type: string) => boolean;
|
|
5
5
|
export declare const removeIgnoredItems: (activity: ActivityData) => ActivityData;
|
|
6
6
|
export declare const splitActivityByType: (activity: ActivityData) => any;
|
|
7
|
-
export declare const stringifyDeltaValue: (deltaValue: DeltaValue["value"], attributeTypeUri: string, metadata: Metadata, attributesPresentation?: AttributesPresentation
|
|
7
|
+
export declare const stringifyDeltaValue: (deltaValue: DeltaValue["value"], attributeTypeUri: string, metadata: Metadata, attributesPresentation?: AttributesPresentation, options?: {
|
|
8
|
+
disableTimestampLocalization?: boolean;
|
|
9
|
+
}) => any;
|
|
8
10
|
export declare const getActivityLabel: (type: ActivityTypes) => string;
|
|
@@ -45,10 +45,15 @@ var splitActivityByType = function (activity) {
|
|
|
45
45
|
}, (0, ramda_1.map)(function (items) { return (__assign(__assign({}, activity), { items: items, itemsTotal: items.length })); }), function () { return [activity]; }))(activity);
|
|
46
46
|
};
|
|
47
47
|
exports.splitActivityByType = splitActivityByType;
|
|
48
|
-
var stringifyDeltaValue = function (deltaValue, attributeTypeUri, metadata, attributesPresentation) {
|
|
48
|
+
var stringifyDeltaValue = function (deltaValue, attributeTypeUri, metadata, attributesPresentation, options) {
|
|
49
|
+
if (options === void 0) { options = {}; }
|
|
49
50
|
var attributeType = (0, mdm_sdk_1.findAttributeTypeByUri)(metadata, attributeTypeUri);
|
|
50
51
|
var dataTypeDefinition = (0, mdm_sdk_1.getAttrDataTypeDefinition)(attributeType);
|
|
51
|
-
var formatValue = (0, mdm_sdk_1.formatDataTypeValue)({
|
|
52
|
+
var formatValue = (0, mdm_sdk_1.formatDataTypeValue)({
|
|
53
|
+
attributesPresentation: attributesPresentation,
|
|
54
|
+
dataTypeDefinition: dataTypeDefinition,
|
|
55
|
+
disableTimestampLocalization: (0, mdm_sdk_1.shouldDisableTimestampLocalizationForAttribute)(attributeType, options)
|
|
56
|
+
});
|
|
52
57
|
if ((0, ramda_1.isNil)(deltaValue)) {
|
|
53
58
|
return '';
|
|
54
59
|
}
|
|
@@ -59,7 +64,7 @@ var stringifyDeltaValue = function (deltaValue, attributeTypeUri, metadata, attr
|
|
|
59
64
|
.flatMap(function (_a) {
|
|
60
65
|
var attributeTypeName = _a[0], deltaValues = _a[1];
|
|
61
66
|
return deltaValues.map(function (deltaValue) {
|
|
62
|
-
return (0, exports.stringifyDeltaValue)(deltaValue.value, (0, mdm_sdk_1.makeAttrTypeUri)(attributeTypeUri, attributeTypeName), metadata, attributesPresentation);
|
|
67
|
+
return (0, exports.stringifyDeltaValue)(deltaValue.value, (0, mdm_sdk_1.makeAttrTypeUri)(attributeTypeUri, attributeTypeName), metadata, attributesPresentation, options);
|
|
63
68
|
});
|
|
64
69
|
})
|
|
65
70
|
.join(', ');
|
|
@@ -16,8 +16,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
18
18
|
var ramda_1 = require("ramda");
|
|
19
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
19
20
|
var types_1 = require("../types");
|
|
20
21
|
var activities_1 = require("./activities");
|
|
22
|
+
jest.mock('@reltio/mdm-sdk', function () {
|
|
23
|
+
var actual = jest.requireActual('@reltio/mdm-sdk');
|
|
24
|
+
return __assign(__assign({}, actual), { formatDataTypeValue: jest.fn(actual.formatDataTypeValue) });
|
|
25
|
+
});
|
|
26
|
+
var formatDataTypeValueMock = mdm_sdk_1.formatDataTypeValue;
|
|
21
27
|
describe('activities utils tests', function () {
|
|
22
28
|
var activityWithDataTypes = {
|
|
23
29
|
uri: 'activities/711d84f6-f96b-4b93-b06f-a165c1776914',
|
|
@@ -374,6 +380,7 @@ describe('activities utils tests', function () {
|
|
|
374
380
|
});
|
|
375
381
|
afterEach(function () {
|
|
376
382
|
i18nDateSpy.mockReset();
|
|
383
|
+
formatDataTypeValueMock.mockClear();
|
|
377
384
|
});
|
|
378
385
|
var metadata = {
|
|
379
386
|
entityTypes: [
|
|
@@ -550,6 +557,20 @@ describe('activities utils tests', function () {
|
|
|
550
557
|
]
|
|
551
558
|
}, attributeTypeUri, metadata)).toBe('2022-12-02, 12,345, String 2, $5,000, String, Yes, 2020-12-01T15:12:00.000+0000');
|
|
552
559
|
});
|
|
560
|
+
describe('disableTimestampLocalization', function () {
|
|
561
|
+
var middleOfUtcDayMs = Date.UTC(2019, 10, 1, 14, 30, 0);
|
|
562
|
+
var regularTimestampUri = 'configuration/entityTypes/HCP/attributes/Timestamp';
|
|
563
|
+
it('forwards disableTimestampLocalization=true to formatDataTypeValue for regular Timestamp', function () {
|
|
564
|
+
(0, activities_1.stringifyDeltaValue)(String(middleOfUtcDayMs), regularTimestampUri, metadata, undefined, {
|
|
565
|
+
disableTimestampLocalization: true
|
|
566
|
+
});
|
|
567
|
+
expect(formatDataTypeValueMock).toHaveBeenCalledWith(expect.objectContaining({ disableTimestampLocalization: true }));
|
|
568
|
+
});
|
|
569
|
+
it('forwards disableTimestampLocalization=false for regular Timestamp when option is missing', function () {
|
|
570
|
+
(0, activities_1.stringifyDeltaValue)(String(middleOfUtcDayMs), regularTimestampUri, metadata);
|
|
571
|
+
expect(formatDataTypeValueMock).toHaveBeenCalledWith(expect.objectContaining({ disableTimestampLocalization: false }));
|
|
572
|
+
});
|
|
573
|
+
});
|
|
553
574
|
});
|
|
554
575
|
describe('removeIgnoredItems', function () {
|
|
555
576
|
var consoleWarnMock;
|
package/cjs/features/workflow/ChangeRequestEditor/components/DCRValueEditor/DCRValueEditor.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AttributeType, ChangeValue, PrimitiveValue, SimpleAttributeValue } from '@reltio/mdm-sdk';
|
|
2
|
+
import { AttributeType, ChangeValue, LookupValue, PrimitiveValue, SimpleAttributeValue } from '@reltio/mdm-sdk';
|
|
3
3
|
import { LineDataValue } from '../../../types';
|
|
4
4
|
type Props = {
|
|
5
5
|
attributeType: AttributeType;
|
|
6
6
|
value: LineDataValue | ChangeValue;
|
|
7
|
-
onChange: (value: SimpleAttributeValue | string[] | PrimitiveValue) => void;
|
|
7
|
+
onChange: (value: SimpleAttributeValue | string[] | PrimitiveValue | LookupValue) => void;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
};
|
|
10
10
|
export declare const DCRValueEditor: ({ attributeType, value, onChange, disabled }: Props) => React.JSX.Element;
|
package/cjs/features/workflow/ChangeRequestEditor/components/DCRValueEditor/DCRValueEditor.js
CHANGED
|
@@ -5,15 +5,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.DCRValueEditor = void 0;
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
8
9
|
var DCRValueEditorFactory_1 = require("../DCRValueEditorFactory");
|
|
10
|
+
var MdmModuleContext_1 = require("../../../../../contexts/MdmModuleContext");
|
|
9
11
|
var DCRValueEditor_module_css_1 = __importDefault(require("./DCRValueEditor.module.css"));
|
|
10
12
|
var DCRValueEditor = function (_a) {
|
|
11
13
|
var attributeType = _a.attributeType, value = _a.value, onChange = _a.onChange, _b = _a.disabled, disabled = _b === void 0 ? false : _b;
|
|
14
|
+
var disableTimestampLocalizationFlag = (0, MdmModuleContext_1.useMdmDisableTimestampLocalization)();
|
|
15
|
+
var disableTimestampLocalization = (0, mdm_sdk_1.shouldDisableTimestampLocalizationForAttribute)(attributeType, {
|
|
16
|
+
disableTimestampLocalization: disableTimestampLocalizationFlag
|
|
17
|
+
});
|
|
12
18
|
return (react_1.default.createElement("div", { className: DCRValueEditor_module_css_1.default.editor }, DCRValueEditorFactory_1.DCRValueEditorFactory.build({
|
|
13
19
|
attributeType: attributeType,
|
|
14
20
|
value: value,
|
|
15
21
|
onChange: onChange,
|
|
16
|
-
disabled: disabled
|
|
22
|
+
disabled: disabled,
|
|
23
|
+
disableTimestampLocalization: disableTimestampLocalization
|
|
17
24
|
})));
|
|
18
25
|
};
|
|
19
26
|
exports.DCRValueEditor = DCRValueEditor;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type AttributeType, type ChangeValue, type
|
|
2
|
+
import { type AttributeType, type ChangeValue, type LookupValue, type PrimitiveValue, type SimpleAttributeValue } from '@reltio/mdm-sdk';
|
|
3
3
|
import type { LineDataValue } from '../../../types';
|
|
4
4
|
type Props = {
|
|
5
5
|
attributeType: AttributeType;
|
|
6
6
|
value: LineDataValue | ChangeValue;
|
|
7
|
-
onChange: (value: SimpleAttributeValue | string[] | PrimitiveValue) => void;
|
|
8
|
-
dataTypeDefinition?: DataTypeDefinition;
|
|
7
|
+
onChange: (value: SimpleAttributeValue | string[] | PrimitiveValue | LookupValue) => void;
|
|
9
8
|
disabled?: boolean;
|
|
9
|
+
disableTimestampLocalization?: boolean;
|
|
10
10
|
};
|
|
11
11
|
export declare class DCRValueEditorFactory {
|
|
12
|
-
static build({ attributeType, value, onChange, disabled }: Props): React.JSX.Element;
|
|
12
|
+
static build({ attributeType, value, onChange, disabled, disableTimestampLocalization }: Props): React.JSX.Element;
|
|
13
13
|
}
|
|
14
14
|
export {};
|
|
@@ -16,7 +16,7 @@ var DCRValueEditorFactory = /** @class */ (function () {
|
|
|
16
16
|
function DCRValueEditorFactory() {
|
|
17
17
|
}
|
|
18
18
|
DCRValueEditorFactory.build = function (_a) {
|
|
19
|
-
var attributeType = _a.attributeType, value = _a.value, onChange = _a.onChange, _b = _a.disabled, disabled = _b === void 0 ? false : _b;
|
|
19
|
+
var attributeType = _a.attributeType, value = _a.value, onChange = _a.onChange, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.disableTimestampLocalization, disableTimestampLocalization = _c === void 0 ? false : _c;
|
|
20
20
|
var dcrValue = (0, mdm_sdk_1.getAttributeValue)(value);
|
|
21
21
|
switch (attributeType.uri) {
|
|
22
22
|
case mdm_sdk_1.EntityAttrTypes.roles.uri: {
|
|
@@ -31,10 +31,14 @@ var DCRValueEditorFactory = /** @class */ (function () {
|
|
|
31
31
|
default: {
|
|
32
32
|
var dataTypeDefinition = (0, common_1.getDataTypeDefinition)(attributeType, dcrValue);
|
|
33
33
|
var editorValue = value && dataTypeDefinition
|
|
34
|
-
? (0, attributesView_1.attributeValueToEditorValue)(value, dataTypeDefinition
|
|
34
|
+
? (0, attributesView_1.attributeValueToEditorValue)(value, dataTypeDefinition, {
|
|
35
|
+
disableTimestampLocalization: disableTimestampLocalization
|
|
36
|
+
})
|
|
35
37
|
: null;
|
|
36
|
-
var handleChange = function (
|
|
37
|
-
var valueConvertedToAttributeValue = (0, attributesView_1.editorValueToAttributeValue)(attributeType,
|
|
38
|
+
var handleChange = function (newValue) {
|
|
39
|
+
var valueConvertedToAttributeValue = (0, attributesView_1.editorValueToAttributeValue)(attributeType, newValue, {
|
|
40
|
+
disableTimestampLocalization: disableTimestampLocalization
|
|
41
|
+
});
|
|
38
42
|
onChange(valueConvertedToAttributeValue);
|
|
39
43
|
};
|
|
40
44
|
return (react_1.default.createElement(DataTypeValueEditor_1.DataTypeValueEditor, { fieldName: attributeType.uri, value: editorValue, dataTypeDefinition: dataTypeDefinition, onChange: handleChange, fullWidth: true, disabled: disabled }));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AttributeType, DataTypeDefinition, Metadata, NestedAttributeValue, ReferenceAttributeValue, SimpleAttributeValue } from '@reltio/mdm-sdk';
|
|
1
|
+
import { AttributeType, DataTypeDefinition, LookupValue, Metadata, NestedAttributeValue, PrimitiveValue, ReferenceAttributeValue, SimpleAttributeValue } from '@reltio/mdm-sdk';
|
|
2
2
|
import { AttributeSelectorItem } from '../types';
|
|
3
3
|
export declare const getFilteredAttrTypes: (metadata: Metadata, type: string, includeUris: string[], excludeUris: string[]) => any;
|
|
4
4
|
type PagersData = {
|
|
@@ -6,11 +6,12 @@ type PagersData = {
|
|
|
6
6
|
values: (SimpleAttributeValue | NestedAttributeValue | ReferenceAttributeValue | string | number)[];
|
|
7
7
|
};
|
|
8
8
|
export declare const splitPagersData: (fixedTypeUris: string[], pagersData: PagersData[]) => [PagersData[], PagersData[]];
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
lookupCode: string;
|
|
9
|
+
export type AttributeValueConversionOptions = {
|
|
10
|
+
disableTimestampLocalization?: boolean;
|
|
12
11
|
};
|
|
13
|
-
export
|
|
12
|
+
export type EditorValue = PrimitiveValue | Date | LookupValue | null;
|
|
13
|
+
export declare const attributeValueToEditorValue: (attributeValue: SimpleAttributeValue, { type }: DataTypeDefinition, { disableTimestampLocalization }?: AttributeValueConversionOptions) => EditorValue;
|
|
14
|
+
export declare const editorValueToAttributeValue: (attributeType: AttributeType, editorValue: EditorValue, { disableTimestampLocalization }?: AttributeValueConversionOptions) => PrimitiveValue | LookupValue;
|
|
14
15
|
export declare const isEqualAttributes: any;
|
|
15
16
|
export declare const checkAttributeIncludes: (attribute: AttributeSelectorItem, selectedAttributes: AttributeSelectorItem[]) => boolean;
|
|
16
17
|
export {};
|
|
@@ -24,9 +24,10 @@ var splitPagersData = function (fixedTypeUris, pagersData) {
|
|
|
24
24
|
return (0, ramda_1.partition)((0, ramda_1.pipe)((0, ramda_1.path)(['attrType', 'uri']), (0, ramda_1.includes)(ramda_1.__, fixedTypeUris)), pagersData);
|
|
25
25
|
};
|
|
26
26
|
exports.splitPagersData = splitPagersData;
|
|
27
|
-
var attributeValueToEditorValue = function (attributeValue, _a) {
|
|
27
|
+
var attributeValueToEditorValue = function (attributeValue, _a, _b) {
|
|
28
28
|
var type = _a.type;
|
|
29
|
-
var
|
|
29
|
+
var _c = _b === void 0 ? {} : _b, _d = _c.disableTimestampLocalization, disableTimestampLocalization = _d === void 0 ? false : _d;
|
|
30
|
+
var _e = attributeValue || {}, value = _e.value, lookupCode = _e.lookupCode;
|
|
30
31
|
switch (type) {
|
|
31
32
|
case mdm_sdk_1.DataTypes.TYPE_BOOLEAN:
|
|
32
33
|
case mdm_sdk_1.DataTypes.TYPE_BOOLEAN_RADIO:
|
|
@@ -35,8 +36,16 @@ var attributeValueToEditorValue = function (attributeValue, _a) {
|
|
|
35
36
|
}
|
|
36
37
|
case mdm_sdk_1.DataTypes.TYPE_DATE:
|
|
37
38
|
return (value && mdm_sdk_1.utils.dates.toLocalDate(value)) || null;
|
|
39
|
+
case mdm_sdk_1.DataTypes.TYPE_TIMESTAMP: {
|
|
40
|
+
if (!value) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
if (disableTimestampLocalization) {
|
|
44
|
+
return mdm_sdk_1.utils.dates.toLocalDate(value);
|
|
45
|
+
}
|
|
46
|
+
return new Date(value);
|
|
47
|
+
}
|
|
38
48
|
case mdm_sdk_1.DataTypes.TYPE_LOCAL_DATE:
|
|
39
|
-
case mdm_sdk_1.DataTypes.TYPE_TIMESTAMP:
|
|
40
49
|
case mdm_sdk_1.DataTypes.TYPE_ACTIVENESS_DATE: {
|
|
41
50
|
return (value && new Date(value)) || null;
|
|
42
51
|
}
|
|
@@ -49,7 +58,8 @@ var attributeValueToEditorValue = function (attributeValue, _a) {
|
|
|
49
58
|
}
|
|
50
59
|
};
|
|
51
60
|
exports.attributeValueToEditorValue = attributeValueToEditorValue;
|
|
52
|
-
var editorValueToAttributeValue = function (attributeType, editorValue) {
|
|
61
|
+
var editorValueToAttributeValue = function (attributeType, editorValue, _a) {
|
|
62
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.disableTimestampLocalization, disableTimestampLocalization = _c === void 0 ? false : _c;
|
|
53
63
|
var type = (0, mdm_sdk_1.getAttrDataTypeDefinition)(attributeType).type;
|
|
54
64
|
switch (type) {
|
|
55
65
|
case mdm_sdk_1.DataTypes.TYPE_BOOLEAN:
|
|
@@ -59,17 +69,21 @@ var editorValueToAttributeValue = function (attributeType, editorValue) {
|
|
|
59
69
|
case mdm_sdk_1.DataTypes.TYPE_DATE:
|
|
60
70
|
return (editorValue && (0, moment_1.default)(editorValue).format('YYYY-MM-DD')) || '';
|
|
61
71
|
case mdm_sdk_1.DataTypes.TYPE_TIMESTAMP: {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
72
|
+
if (!editorValue) {
|
|
73
|
+
return '';
|
|
74
|
+
}
|
|
75
|
+
if (disableTimestampLocalization) {
|
|
76
|
+
return moment_1.default.utc(mdm_sdk_1.utils.dates.toUtcDate(editorValue)).format();
|
|
77
|
+
}
|
|
78
|
+
return (0, moment_1.default)(editorValue)
|
|
79
|
+
.utc()
|
|
80
|
+
.format();
|
|
67
81
|
}
|
|
68
82
|
case mdm_sdk_1.DataTypes.TYPE_ACTIVENESS_DATE:
|
|
69
83
|
case mdm_sdk_1.DataTypes.TYPE_LOCAL_DATE:
|
|
70
84
|
return editorValue && editorValue.valueOf();
|
|
71
85
|
default:
|
|
72
|
-
return editorValue || '';
|
|
86
|
+
return (editorValue || '');
|
|
73
87
|
}
|
|
74
88
|
};
|
|
75
89
|
exports.editorValueToAttributeValue = editorValueToAttributeValue;
|
|
@@ -75,6 +75,48 @@ describe('attributesView tests', function () {
|
|
|
75
75
|
};
|
|
76
76
|
expect((0, attributesView_1.attributeValueToEditorValue)(attributeValue, attributeType)).toBe(null);
|
|
77
77
|
});
|
|
78
|
+
describe('TYPE_TIMESTAMP', function () {
|
|
79
|
+
var attributeType = {
|
|
80
|
+
type: mdm_sdk_1.DataTypes.TYPE_TIMESTAMP,
|
|
81
|
+
uri: 'configuration/entityTypes/HCP/attributes/Updated',
|
|
82
|
+
name: 'Updated'
|
|
83
|
+
};
|
|
84
|
+
it('returns Date constructed from value when flag is off', function () {
|
|
85
|
+
var ms = Date.UTC(2020, 1, 20, 7, 0, 0);
|
|
86
|
+
var result = (0, attributesView_1.attributeValueToEditorValue)({ value: ms, uri: '' }, attributeType);
|
|
87
|
+
expect(result).toEqual(new Date(ms));
|
|
88
|
+
});
|
|
89
|
+
it('uses toLocalDate (UTC parts as local) when flag is on (numeric input)', function () {
|
|
90
|
+
var ms = Date.UTC(2020, 1, 20, 7, 15, 30);
|
|
91
|
+
var result = (0, attributesView_1.attributeValueToEditorValue)({ value: ms, uri: '' }, attributeType, {
|
|
92
|
+
disableTimestampLocalization: true
|
|
93
|
+
});
|
|
94
|
+
expect(result.getFullYear()).toBe(2020);
|
|
95
|
+
expect(result.getMonth()).toBe(1);
|
|
96
|
+
expect(result.getDate()).toBe(20);
|
|
97
|
+
expect(result.getHours()).toBe(7);
|
|
98
|
+
expect(result.getMinutes()).toBe(15);
|
|
99
|
+
expect(result.getSeconds()).toBe(30);
|
|
100
|
+
});
|
|
101
|
+
it('uses toLocalDate when flag is on (ISO string input)', function () {
|
|
102
|
+
var value = '2020-02-20T07:15:30.000+0000';
|
|
103
|
+
var result = (0, attributesView_1.attributeValueToEditorValue)({ value: value, uri: '' }, attributeType, {
|
|
104
|
+
disableTimestampLocalization: true
|
|
105
|
+
});
|
|
106
|
+
expect(result.getFullYear()).toBe(2020);
|
|
107
|
+
expect(result.getMonth()).toBe(1);
|
|
108
|
+
expect(result.getDate()).toBe(20);
|
|
109
|
+
expect(result.getHours()).toBe(7);
|
|
110
|
+
expect(result.getMinutes()).toBe(15);
|
|
111
|
+
expect(result.getSeconds()).toBe(30);
|
|
112
|
+
});
|
|
113
|
+
it('returns null when value is missing', function () {
|
|
114
|
+
expect((0, attributesView_1.attributeValueToEditorValue)({ value: undefined, uri: '' }, attributeType)).toBeNull();
|
|
115
|
+
expect((0, attributesView_1.attributeValueToEditorValue)({ value: undefined, uri: '' }, attributeType, {
|
|
116
|
+
disableTimestampLocalization: true
|
|
117
|
+
})).toBeNull();
|
|
118
|
+
});
|
|
119
|
+
});
|
|
78
120
|
it('should return lookup value+lookupCode if attribute is lookup', function () {
|
|
79
121
|
var attributeValue = {
|
|
80
122
|
value: 'KT',
|
|
@@ -92,4 +134,30 @@ describe('attributesView tests', function () {
|
|
|
92
134
|
});
|
|
93
135
|
});
|
|
94
136
|
});
|
|
137
|
+
describe('editorValueToAttributeValue TYPE_TIMESTAMP', function () {
|
|
138
|
+
var attributeType = {
|
|
139
|
+
type: mdm_sdk_1.DataTypes.TYPE_TIMESTAMP,
|
|
140
|
+
uri: 'configuration/entityTypes/HCP/attributes/Updated',
|
|
141
|
+
name: 'Updated'
|
|
142
|
+
};
|
|
143
|
+
it('returns ISO UTC string from local Date when flag is off', function () {
|
|
144
|
+
var localDate = new Date(2020, 1, 20, 7, 0, 0);
|
|
145
|
+
var result = (0, attributesView_1.editorValueToAttributeValue)(attributeType, localDate);
|
|
146
|
+
expect(typeof result).toBe('string');
|
|
147
|
+
expect(result).toMatch(/Z$|\+00:?00$/);
|
|
148
|
+
expect(new Date(result).getTime()).toBe(localDate.getTime());
|
|
149
|
+
});
|
|
150
|
+
it('preserves local parts as UTC when flag is on', function () {
|
|
151
|
+
var localDate = new Date(2020, 1, 20, 7, 0, 0);
|
|
152
|
+
var result = (0, attributesView_1.editorValueToAttributeValue)(attributeType, localDate, {
|
|
153
|
+
disableTimestampLocalization: true
|
|
154
|
+
});
|
|
155
|
+
var expectedMs = Date.UTC(localDate.getFullYear(), localDate.getMonth(), localDate.getDate(), localDate.getHours(), localDate.getMinutes(), localDate.getSeconds(), localDate.getMilliseconds());
|
|
156
|
+
expect(new Date(result).getTime()).toBe(expectedMs);
|
|
157
|
+
});
|
|
158
|
+
it('returns empty string when editor value is empty', function () {
|
|
159
|
+
expect((0, attributesView_1.editorValueToAttributeValue)(attributeType, null)).toBe('');
|
|
160
|
+
expect((0, attributesView_1.editorValueToAttributeValue)(attributeType, null, { disableTimestampLocalization: true })).toBe('');
|
|
161
|
+
});
|
|
162
|
+
});
|
|
95
163
|
});
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { FacetFilter } from '@reltio/mdm-sdk';
|
|
2
2
|
import { ColumnData, ColumnFilter, ColumnSize } from '../types/basicTable';
|
|
3
3
|
import { ColumnsSizeById } from '../types/preferences';
|
|
4
|
+
export type BuildColumnsFilterOptions = {
|
|
5
|
+
disableTimestampLocalization?: boolean;
|
|
6
|
+
};
|
|
4
7
|
export declare const defaultGetRowCellHeight: ({ columnData, cell }: {
|
|
5
8
|
columnData: any;
|
|
6
9
|
cell: any;
|
|
@@ -10,6 +13,6 @@ export declare const defaultRenderRowCell: ({ cell, CellValueRenderer, ...otherP
|
|
|
10
13
|
cell: any;
|
|
11
14
|
CellValueRenderer: any;
|
|
12
15
|
}) => any;
|
|
13
|
-
export declare const columnFilterToMdmFilter: (columnData: Pick<ColumnData, "id" | "dataTypeDefinition">, columnFilter?: ColumnFilter) => FacetFilter;
|
|
14
|
-
export declare const buildColumnsFilter: (columnsData: ColumnData[], filters?: Record<string, ColumnFilter
|
|
16
|
+
export declare const columnFilterToMdmFilter: (columnData: Pick<ColumnData, "id" | "dataTypeDefinition">, columnFilter?: ColumnFilter, { disableTimestampLocalization }?: BuildColumnsFilterOptions) => FacetFilter;
|
|
17
|
+
export declare const buildColumnsFilter: (columnsData: ColumnData[], filters?: Record<string, ColumnFilter>, options?: BuildColumnsFilterOptions) => string;
|
|
15
18
|
export declare const buildColumnsSizeById: (columnsSize?: ColumnSize[]) => ColumnsSizeById;
|
|
@@ -53,24 +53,24 @@ var defaultRenderRowCell = function (_a) {
|
|
|
53
53
|
return cell.values.map(function (value, index) { return react_1.default.createElement(CellValueRenderer, __assign({ key: index, value: value }, otherProps)); });
|
|
54
54
|
};
|
|
55
55
|
exports.defaultRenderRowCell = defaultRenderRowCell;
|
|
56
|
-
var columnFilterToMdmFilter = function (columnData, columnFilter) {
|
|
56
|
+
var columnFilterToMdmFilter = function (columnData, columnFilter, _a) {
|
|
57
57
|
if (columnFilter === void 0) { columnFilter = {}; }
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
});
|
|
58
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.disableTimestampLocalization, disableTimestampLocalization = _c === void 0 ? false : _c;
|
|
59
|
+
var dataTypeDefinition = columnData.dataTypeDefinition;
|
|
60
|
+
return __assign({ fieldName: columnData.id, filter: columnFilter.filter, values: [columnFilter.value], type: dataTypeDefinition.type }, ((0, mdm_sdk_1.shouldDisableTimestampLocalizationForAttribute)(dataTypeDefinition, { disableTimestampLocalization: disableTimestampLocalization })
|
|
61
|
+
? { disableTimestampLocalization: true }
|
|
62
|
+
: {}));
|
|
64
63
|
};
|
|
65
64
|
exports.columnFilterToMdmFilter = columnFilterToMdmFilter;
|
|
66
|
-
var buildColumnsFilter = function (columnsData, filters) {
|
|
65
|
+
var buildColumnsFilter = function (columnsData, filters, options) {
|
|
66
|
+
if (options === void 0) { options = {}; }
|
|
67
67
|
return mdm_sdk_1.Maybe.fromNull(filters)
|
|
68
68
|
.map(function (filters) {
|
|
69
69
|
return Object.entries(filters)
|
|
70
70
|
.map(function (_a) {
|
|
71
71
|
var columnId = _a[0], columnFilter = _a[1];
|
|
72
72
|
var columnData = columnsData.find((0, ramda_1.propEq)('id', columnId));
|
|
73
|
-
return columnData && (0, exports.columnFilterToMdmFilter)(columnData, columnFilter);
|
|
73
|
+
return columnData && (0, exports.columnFilterToMdmFilter)(columnData, columnFilter, options);
|
|
74
74
|
})
|
|
75
75
|
.filter(ramda_1.identity);
|
|
76
76
|
})
|
|
@@ -36,5 +36,61 @@ describe('basicTable tests', function () {
|
|
|
36
36
|
it('should return correct filter string', function () {
|
|
37
37
|
expect((0, basicTable_1.buildColumnsFilter)(columnsData, filters)).toBe("equals(label,'123') and lte(directional,'852163199999')");
|
|
38
38
|
});
|
|
39
|
+
it('should produce UTC day boundaries for Timestamp column when disableTimestampLocalization is on', function () {
|
|
40
|
+
var middleOfUtcDayMs = Date.UTC(2019, 10, 1, 14, 30, 0);
|
|
41
|
+
var utcDayStart = Date.UTC(2019, 10, 1, 0, 0, 0, 0);
|
|
42
|
+
var utcDayEnd = Date.UTC(2019, 10, 1, 23, 59, 59, 999);
|
|
43
|
+
var tsColumns = [
|
|
44
|
+
{
|
|
45
|
+
id: 'attributes.UpdatedDate',
|
|
46
|
+
label: 'Updated date',
|
|
47
|
+
dataTypeDefinition: {
|
|
48
|
+
type: mdm_sdk_1.DataTypes.TYPE_TIMESTAMP,
|
|
49
|
+
uri: 'configuration/entityTypes/HCP/attributes/UpdatedDate'
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
];
|
|
53
|
+
var tsFilters = { 'attributes.UpdatedDate': { filter: 'on', value: middleOfUtcDayMs } };
|
|
54
|
+
expect((0, basicTable_1.buildColumnsFilter)(tsColumns, tsFilters, { disableTimestampLocalization: true })).toBe("range(attributes.UpdatedDate,".concat(utcDayStart, ",").concat(utcDayEnd, ")"));
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
describe('columnFilterToMdmFilter disableTimestampLocalization', function () {
|
|
58
|
+
var middleOfUtcDayMs = Date.UTC(2019, 10, 1, 14, 30, 0);
|
|
59
|
+
var regularTimestampColumn = {
|
|
60
|
+
id: 'attributes.UpdatedDate',
|
|
61
|
+
dataTypeDefinition: {
|
|
62
|
+
type: mdm_sdk_1.DataTypes.TYPE_TIMESTAMP,
|
|
63
|
+
uri: 'configuration/entityTypes/HCP/attributes/UpdatedDate'
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
var specialTimestampColumn = {
|
|
67
|
+
id: 'createdTime',
|
|
68
|
+
dataTypeDefinition: { type: mdm_sdk_1.DataTypes.TYPE_TIMESTAMP, uri: 'createdTime' }
|
|
69
|
+
};
|
|
70
|
+
var stringColumn = {
|
|
71
|
+
id: 'attributes.Name',
|
|
72
|
+
dataTypeDefinition: { type: mdm_sdk_1.DataTypes.TYPE_STRING, uri: 'configuration/entityTypes/HCP/attributes/Name' }
|
|
73
|
+
};
|
|
74
|
+
var onFilter = { filter: 'on', value: middleOfUtcDayMs };
|
|
75
|
+
it('adds disableTimestampLocalization to filter for regular timestamp column when flag is on', function () {
|
|
76
|
+
var result = (0, basicTable_1.columnFilterToMdmFilter)(regularTimestampColumn, onFilter, {
|
|
77
|
+
disableTimestampLocalization: true
|
|
78
|
+
});
|
|
79
|
+
expect(result).toMatchObject({ disableTimestampLocalization: true });
|
|
80
|
+
});
|
|
81
|
+
it('does not add disableTimestampLocalization for regular timestamp column when flag is off', function () {
|
|
82
|
+
var result = (0, basicTable_1.columnFilterToMdmFilter)(regularTimestampColumn, onFilter);
|
|
83
|
+
expect(result).not.toHaveProperty('disableTimestampLocalization');
|
|
84
|
+
});
|
|
85
|
+
it('does not add disableTimestampLocalization for special timestamp column even when flag is on', function () {
|
|
86
|
+
var result = (0, basicTable_1.columnFilterToMdmFilter)(specialTimestampColumn, onFilter, {
|
|
87
|
+
disableTimestampLocalization: true
|
|
88
|
+
});
|
|
89
|
+
expect(result).not.toHaveProperty('disableTimestampLocalization');
|
|
90
|
+
});
|
|
91
|
+
it('does not add disableTimestampLocalization for non-timestamp column when flag is on', function () {
|
|
92
|
+
var result = (0, basicTable_1.columnFilterToMdmFilter)(stringColumn, { filter: 'equals', value: 'John' }, { disableTimestampLocalization: true });
|
|
93
|
+
expect(result).not.toHaveProperty('disableTimestampLocalization');
|
|
94
|
+
});
|
|
39
95
|
});
|
|
40
96
|
});
|
|
@@ -11,6 +11,8 @@ var useReadableSearchState = function (searchState) {
|
|
|
11
11
|
var dataTenants = (0, MdmModuleContext_1.useMdmDataTenants)();
|
|
12
12
|
var attributesPresentation = (0, MdmModuleContext_1.useMdmAttributesPresentation)();
|
|
13
13
|
var lookups = (0, MdmModuleContext_1.useMdmLookups)();
|
|
14
|
+
var disableTimestampLocalization = (0, MdmModuleContext_1.useMdmDisableTimestampLocalization)();
|
|
15
|
+
var formatOptions = { disableTimestampLocalization: disableTimestampLocalization };
|
|
14
16
|
var map = searchState.map;
|
|
15
17
|
var keyword = (0, mdm_sdk_1.getKeywordFromSearchState)(searchState);
|
|
16
18
|
var groups = (0, mdm_sdk_1.getGroupsFromSearchState)(metadata, dataTenants, true, searchState);
|
|
@@ -24,8 +26,8 @@ var useReadableSearchState = function (searchState) {
|
|
|
24
26
|
}
|
|
25
27
|
}, [searchState]); // eslint-disable-line
|
|
26
28
|
return {
|
|
27
|
-
readableQuery: (0, mdm_sdk_1.buildReadableQuery)(metadata, attributesPresentation, lookups, groups, keyword, map),
|
|
28
|
-
readableQueryString: (0, mdm_sdk_1.buildReadableQueryToString)(metadata, attributesPresentation, lookups, groups, keyword, map)
|
|
29
|
+
readableQuery: (0, mdm_sdk_1.buildReadableQuery)(metadata, attributesPresentation, lookups, groups, keyword, map, formatOptions),
|
|
30
|
+
readableQueryString: (0, mdm_sdk_1.buildReadableQueryToString)(metadata, attributesPresentation, lookups, groups, keyword, map, formatOptions)
|
|
29
31
|
};
|
|
30
32
|
};
|
|
31
33
|
exports.useReadableSearchState = useReadableSearchState;
|
|
@@ -113,8 +113,8 @@ describe('useReadableSearchState tests', function () {
|
|
|
113
113
|
expect(mdm_sdk_1.getKeywordFromSearchState).toHaveBeenCalledWith(searchState);
|
|
114
114
|
expect(mdm_sdk_1.getGroupsFromSearchState).toHaveBeenCalledWith(metadata, dataTenants, true, searchState);
|
|
115
115
|
expect(mdm_sdk_1.getUnresolvedLookupsListFromSearchGroups).toHaveBeenCalledWith(groups, lookups);
|
|
116
|
-
expect(mdm_sdk_1.buildReadableQueryToString).toHaveBeenCalledWith(metadata, attributesPresentation, lookups, groups, keyword, map);
|
|
117
|
-
expect(mdm_sdk_1.buildReadableQuery).toHaveBeenCalledWith(metadata, attributesPresentation, lookups, groups, keyword, map);
|
|
116
|
+
expect(mdm_sdk_1.buildReadableQueryToString).toHaveBeenCalledWith(metadata, attributesPresentation, lookups, groups, keyword, map, { disableTimestampLocalization: false });
|
|
117
|
+
expect(mdm_sdk_1.buildReadableQuery).toHaveBeenCalledWith(metadata, attributesPresentation, lookups, groups, keyword, map, { disableTimestampLocalization: false });
|
|
118
118
|
expect(mdm_sdk_1.resolveLookupsList).not.toHaveBeenCalled();
|
|
119
119
|
expect(result.current).toEqual({
|
|
120
120
|
readableQueryString: searchStateString,
|
|
@@ -62,6 +62,7 @@ export type MdmModuleValuesContextProps = Partial<{
|
|
|
62
62
|
dcrReviewAllowAddAttributes: boolean;
|
|
63
63
|
dcrReviewValidation: boolean;
|
|
64
64
|
canUserMakeExport: boolean;
|
|
65
|
+
disableTimestampLocalization: boolean;
|
|
65
66
|
}>;
|
|
66
67
|
export type MdmModuleActionsContextProps = Partial<{
|
|
67
68
|
openSearch: (payload: SearchState) => void;
|
|
@@ -280,6 +281,7 @@ export declare const MdmModuleValuesContext: import("@fluentui/react-context-sel
|
|
|
280
281
|
dcrReviewAllowAddAttributes: boolean;
|
|
281
282
|
dcrReviewValidation: boolean;
|
|
282
283
|
canUserMakeExport: boolean;
|
|
284
|
+
disableTimestampLocalization: boolean;
|
|
283
285
|
}>>;
|
|
284
286
|
export declare const MdmModuleListenersContext: import("@fluentui/react-context-selector").Context<Partial<{
|
|
285
287
|
expandInvalidRelatonsListener: (callback: () => void) => (action: any) => void;
|
|
@@ -161,3 +161,4 @@ export declare const useMdmReviewDCREnabled: () => boolean;
|
|
|
161
161
|
export declare const useMdmDcrReviewAllowAddAttributes: () => boolean;
|
|
162
162
|
export declare const useMdmDcrReviewValidation: () => boolean;
|
|
163
163
|
export declare const useMdmCanUserMakeExport: () => boolean;
|
|
164
|
+
export declare const useMdmDisableTimestampLocalization: () => boolean;
|
|
@@ -170,3 +170,6 @@ export var useMdmDcrReviewAllowAddAttributes = function () {
|
|
|
170
170
|
};
|
|
171
171
|
export var useMdmDcrReviewValidation = function () { return useMdmModuleValuesContext(function (context) { return context.dcrReviewValidation; }); };
|
|
172
172
|
export var useMdmCanUserMakeExport = function () { return useMdmModuleValuesContext(function (context) { return context.canUserMakeExport; }); };
|
|
173
|
+
export var useMdmDisableTimestampLocalization = function () {
|
|
174
|
+
return useMdmModuleValuesContext(function (context) { var _a; return (_a = context.disableTimestampLocalization) !== null && _a !== void 0 ? _a : false; });
|
|
175
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { MdmModuleProvider } from './provider';
|
|
2
|
-
export { useMdmAutoCloseInterval, useMdmUiError, useMdmWorkflowEnvironmentUrl, useMdmExportPath, useMdmAbsoluteImagePath, useMdmUiPath, useMdmDtssPath, useMdmServicesPath, useMdmWorkflowPath, useMdmImageServicePath, useMdmReltioPath, useMdmApiPath, useMdmCollaborationPath, useMdmImageAttributesFieldsOrder, useMdmShowEntityId, useMdmPivotingAttributes, useMdmDateMask, useMdmDateTimeMask, useMdmAttributesPresentation, useMdmMaxValuesInResponse, useMdmAttributesSortingStrategy, useMdmLookupAutocomplete, useMdmModifiedEntities, useMdmEntity, useMdmEntityUri, useMdmEntityWithDiff, useMdmEntityUriWithDataTenant, useMdmMode, useMdmIsViewMode, useMdmIsEditableMode, useMdmHistoryDiff, useMdmHistoryMode, useMdmHistorySlice, useMdmHistoryEvent, useMdmProfileLastLoadedTime, useMdmLookups, useMdmDependentLookups, useMdmMetadata, useMdmUser, useMdmUsername, useMdmUserRoles, useMdmTenantObject, useMdmTenant, useMdmTenantName, useMdmEnvironment, useMdmDataTenants, useMdmDataTenantsWithIdBuilder, useMdmSearchNavigationData, useMdmSearchProviderData, useMdmIsCollaborationEnabled, useMdmIsWorkflowEnabled, useMdmProfileErrors, useMdmRelationsDrafts, useMdmModifiedEntityDefaultProfilePic, useMdmModifiedEntity, useMdmInitialConnectionTempEntity, useMdmInitialConnection, useMdmDependentLookupEditorState, useMdmActiveErrorsForAttributesPager, useMdmDependentLookupsStructureNode, useMdmAllRelationsToAddAndEdit, useMdmDependentLookupEditorContext, useMdmGlobalSearchRequestOptions, useMdmAuthoringItemsByEntityType, useMdmAction, useMdmListener, useMdmIsSourcesScreenEnabled, useMdmHiddenAttributes, useMdmControlAttributes, useMdmShowMasking, useMdmReviewDCREnabled, useMdmDcrReviewAllowAddAttributes, useMdmDcrReviewValidation, useMdmImagePath } from './hooks';
|
|
2
|
+
export { useMdmAutoCloseInterval, useMdmUiError, useMdmWorkflowEnvironmentUrl, useMdmExportPath, useMdmAbsoluteImagePath, useMdmUiPath, useMdmDtssPath, useMdmServicesPath, useMdmWorkflowPath, useMdmImageServicePath, useMdmReltioPath, useMdmApiPath, useMdmCollaborationPath, useMdmImageAttributesFieldsOrder, useMdmShowEntityId, useMdmPivotingAttributes, useMdmDateMask, useMdmDateTimeMask, useMdmAttributesPresentation, useMdmMaxValuesInResponse, useMdmAttributesSortingStrategy, useMdmLookupAutocomplete, useMdmModifiedEntities, useMdmEntity, useMdmEntityUri, useMdmEntityWithDiff, useMdmEntityUriWithDataTenant, useMdmMode, useMdmIsViewMode, useMdmIsEditableMode, useMdmHistoryDiff, useMdmHistoryMode, useMdmHistorySlice, useMdmHistoryEvent, useMdmProfileLastLoadedTime, useMdmLookups, useMdmDependentLookups, useMdmMetadata, useMdmUser, useMdmUsername, useMdmUserRoles, useMdmTenantObject, useMdmTenant, useMdmTenantName, useMdmEnvironment, useMdmDataTenants, useMdmDataTenantsWithIdBuilder, useMdmSearchNavigationData, useMdmSearchProviderData, useMdmIsCollaborationEnabled, useMdmIsWorkflowEnabled, useMdmProfileErrors, useMdmRelationsDrafts, useMdmModifiedEntityDefaultProfilePic, useMdmModifiedEntity, useMdmInitialConnectionTempEntity, useMdmInitialConnection, useMdmDependentLookupEditorState, useMdmActiveErrorsForAttributesPager, useMdmDependentLookupsStructureNode, useMdmAllRelationsToAddAndEdit, useMdmDependentLookupEditorContext, useMdmGlobalSearchRequestOptions, useMdmAuthoringItemsByEntityType, useMdmAction, useMdmListener, useMdmIsSourcesScreenEnabled, useMdmHiddenAttributes, useMdmControlAttributes, useMdmShowMasking, useMdmReviewDCREnabled, useMdmDcrReviewAllowAddAttributes, useMdmDcrReviewValidation, useMdmImagePath, useMdmDisableTimestampLocalization } from './hooks';
|
|
3
3
|
export type { MdmModuleActionsContextProps, MdmModuleValuesContextProps, MdmModuleListenersContextProps } from './context';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { MdmModuleProvider } from './provider';
|
|
2
|
-
export { useMdmAutoCloseInterval, useMdmUiError, useMdmWorkflowEnvironmentUrl, useMdmExportPath, useMdmAbsoluteImagePath, useMdmUiPath, useMdmDtssPath, useMdmServicesPath, useMdmWorkflowPath, useMdmImageServicePath, useMdmReltioPath, useMdmApiPath, useMdmCollaborationPath, useMdmImageAttributesFieldsOrder, useMdmShowEntityId, useMdmPivotingAttributes, useMdmDateMask, useMdmDateTimeMask, useMdmAttributesPresentation, useMdmMaxValuesInResponse, useMdmAttributesSortingStrategy, useMdmLookupAutocomplete, useMdmModifiedEntities, useMdmEntity, useMdmEntityUri, useMdmEntityWithDiff, useMdmEntityUriWithDataTenant, useMdmMode, useMdmIsViewMode, useMdmIsEditableMode, useMdmHistoryDiff, useMdmHistoryMode, useMdmHistorySlice, useMdmHistoryEvent, useMdmProfileLastLoadedTime, useMdmLookups, useMdmDependentLookups, useMdmMetadata, useMdmUser, useMdmUsername, useMdmUserRoles, useMdmTenantObject, useMdmTenant, useMdmTenantName, useMdmEnvironment, useMdmDataTenants, useMdmDataTenantsWithIdBuilder, useMdmSearchNavigationData, useMdmSearchProviderData, useMdmIsCollaborationEnabled, useMdmIsWorkflowEnabled, useMdmProfileErrors, useMdmRelationsDrafts, useMdmModifiedEntityDefaultProfilePic, useMdmModifiedEntity, useMdmInitialConnectionTempEntity, useMdmInitialConnection, useMdmDependentLookupEditorState, useMdmActiveErrorsForAttributesPager, useMdmDependentLookupsStructureNode, useMdmAllRelationsToAddAndEdit, useMdmDependentLookupEditorContext, useMdmGlobalSearchRequestOptions, useMdmAuthoringItemsByEntityType, useMdmAction, useMdmListener, useMdmIsSourcesScreenEnabled, useMdmHiddenAttributes, useMdmControlAttributes, useMdmShowMasking, useMdmReviewDCREnabled, useMdmDcrReviewAllowAddAttributes, useMdmDcrReviewValidation, useMdmImagePath } from './hooks';
|
|
2
|
+
export { useMdmAutoCloseInterval, useMdmUiError, useMdmWorkflowEnvironmentUrl, useMdmExportPath, useMdmAbsoluteImagePath, useMdmUiPath, useMdmDtssPath, useMdmServicesPath, useMdmWorkflowPath, useMdmImageServicePath, useMdmReltioPath, useMdmApiPath, useMdmCollaborationPath, useMdmImageAttributesFieldsOrder, useMdmShowEntityId, useMdmPivotingAttributes, useMdmDateMask, useMdmDateTimeMask, useMdmAttributesPresentation, useMdmMaxValuesInResponse, useMdmAttributesSortingStrategy, useMdmLookupAutocomplete, useMdmModifiedEntities, useMdmEntity, useMdmEntityUri, useMdmEntityWithDiff, useMdmEntityUriWithDataTenant, useMdmMode, useMdmIsViewMode, useMdmIsEditableMode, useMdmHistoryDiff, useMdmHistoryMode, useMdmHistorySlice, useMdmHistoryEvent, useMdmProfileLastLoadedTime, useMdmLookups, useMdmDependentLookups, useMdmMetadata, useMdmUser, useMdmUsername, useMdmUserRoles, useMdmTenantObject, useMdmTenant, useMdmTenantName, useMdmEnvironment, useMdmDataTenants, useMdmDataTenantsWithIdBuilder, useMdmSearchNavigationData, useMdmSearchProviderData, useMdmIsCollaborationEnabled, useMdmIsWorkflowEnabled, useMdmProfileErrors, useMdmRelationsDrafts, useMdmModifiedEntityDefaultProfilePic, useMdmModifiedEntity, useMdmInitialConnectionTempEntity, useMdmInitialConnection, useMdmDependentLookupEditorState, useMdmActiveErrorsForAttributesPager, useMdmDependentLookupsStructureNode, useMdmAllRelationsToAddAndEdit, useMdmDependentLookupEditorContext, useMdmGlobalSearchRequestOptions, useMdmAuthoringItemsByEntityType, useMdmAction, useMdmListener, useMdmIsSourcesScreenEnabled, useMdmHiddenAttributes, useMdmControlAttributes, useMdmShowMasking, useMdmReviewDCREnabled, useMdmDcrReviewAllowAddAttributes, useMdmDcrReviewValidation, useMdmImagePath, useMdmDisableTimestampLocalization } from './hooks';
|
|
@@ -6,7 +6,7 @@ import Chip from '@mui/material/Chip';
|
|
|
6
6
|
import ArrowForwardIcon from '@mui/icons-material/ArrowForward';
|
|
7
7
|
import { DeltaTypes, MemberDeltaTypes } from '../../../types';
|
|
8
8
|
import { stringifyDeltaValue } from '../../../utils/activities';
|
|
9
|
-
import { useMdmMetadata, useMdmAttributesPresentation } from '../../../../../contexts/MdmModuleContext';
|
|
9
|
+
import { useMdmMetadata, useMdmAttributesPresentation, useMdmDisableTimestampLocalization } from '../../../../../contexts/MdmModuleContext';
|
|
10
10
|
import { Field } from '../../../Field';
|
|
11
11
|
import styles from './DeltaField.module.css';
|
|
12
12
|
export var DeltaField = function (_a) {
|
|
@@ -14,6 +14,7 @@ export var DeltaField = function (_a) {
|
|
|
14
14
|
var delta = _a.delta;
|
|
15
15
|
var metadata = useMdmMetadata();
|
|
16
16
|
var attributesPresentation = useMdmAttributesPresentation();
|
|
17
|
+
var disableTimestampLocalization = useMdmDisableTimestampLocalization();
|
|
17
18
|
var isMemberDelta = delta.type in MemberDeltaTypes;
|
|
18
19
|
var attributeType = !isMemberDelta ? findAttributeTypeByUri(metadata, delta.attributeType) : undefined;
|
|
19
20
|
var memberType = isMemberDelta ? findMemberTypeByUri(metadata, delta.attributeType) : undefined;
|
|
@@ -24,7 +25,9 @@ export var DeltaField = function (_a) {
|
|
|
24
25
|
var value = oldValue || newValue;
|
|
25
26
|
var deltaLabel = (isMemberDelta ? MemberDeltaTypes : DeltaTypes)[delta.type];
|
|
26
27
|
var converter = function (deltaValue) {
|
|
27
|
-
return isMemberDelta ? (React.createElement(EntityUriLink, { value: 'entities/' + deltaValue, className: styles.entityLink }, deltaValue)) : (stringifyDeltaValue(deltaValue, delta.attributeType, metadata, attributesPresentation
|
|
28
|
+
return isMemberDelta ? (React.createElement(EntityUriLink, { value: 'entities/' + deltaValue, className: styles.entityLink }, deltaValue)) : (stringifyDeltaValue(deltaValue, delta.attributeType, metadata, attributesPresentation, {
|
|
29
|
+
disableTimestampLocalization: disableTimestampLocalization
|
|
30
|
+
}));
|
|
28
31
|
};
|
|
29
32
|
return (React.createElement(Field, { fieldName: fieldName, "data-reltio-id": "delta-field" },
|
|
30
33
|
React.createElement("span", null,
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { buildSegmentationGroupsReadableQuery } from '@reltio/mdm-sdk';
|
|
3
|
-
import { useMdmAttributesPresentation, useMdmLookups, useMdmMetadata } from '../../../contexts/MdmModuleContext';
|
|
3
|
+
import { useMdmAttributesPresentation, useMdmDisableTimestampLocalization, useMdmLookups, useMdmMetadata } from '../../../contexts/MdmModuleContext';
|
|
4
4
|
export var useSegmentReadableQuery = function (groups) {
|
|
5
5
|
var metadata = useMdmMetadata();
|
|
6
6
|
var attributesPresentation = useMdmAttributesPresentation();
|
|
7
7
|
var lookups = useMdmLookups();
|
|
8
|
-
|
|
8
|
+
var disableTimestampLocalization = useMdmDisableTimestampLocalization();
|
|
9
|
+
return useMemo(function () {
|
|
10
|
+
return buildSegmentationGroupsReadableQuery(metadata, attributesPresentation, lookups, groups, {
|
|
11
|
+
disableTimestampLocalization: disableTimestampLocalization
|
|
12
|
+
});
|
|
13
|
+
}, [metadata, lookups, attributesPresentation, groups, disableTimestampLocalization]);
|
|
9
14
|
};
|
|
@@ -4,5 +4,7 @@ export declare const getActivityType: (activity: ActivityData) => any;
|
|
|
4
4
|
export declare const isValidActivityType: (type: string) => boolean;
|
|
5
5
|
export declare const removeIgnoredItems: (activity: ActivityData) => ActivityData;
|
|
6
6
|
export declare const splitActivityByType: (activity: ActivityData) => any;
|
|
7
|
-
export declare const stringifyDeltaValue: (deltaValue: DeltaValue["value"], attributeTypeUri: string, metadata: Metadata, attributesPresentation?: AttributesPresentation
|
|
7
|
+
export declare const stringifyDeltaValue: (deltaValue: DeltaValue["value"], attributeTypeUri: string, metadata: Metadata, attributesPresentation?: AttributesPresentation, options?: {
|
|
8
|
+
disableTimestampLocalization?: boolean;
|
|
9
|
+
}) => any;
|
|
8
10
|
export declare const getActivityLabel: (type: ActivityTypes) => string;
|