@reltio/components 1.4.842 → 1.4.846
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/components/AttributeSelector/AttributeSelector.d.ts +14 -0
- package/components/{activityLog/ActivityFilterEditor → AttributeSelector}/AttributeSelector.js +10 -10
- package/components/AttributeSelector/styles.d.ts +4 -0
- package/components/AttributeSelector/styles.js +41 -0
- package/components/BasicView/styles.js +14 -9
- package/components/DateIntervalSelector/DateIntervalSelector.d.ts +8 -0
- package/components/{activityLog/ActivityFilterEditor/IntervalSelector.js → DateIntervalSelector/DateIntervalSelector.js} +8 -17
- package/components/DateIntervalSelector/styles.d.ts +1 -0
- package/components/DateIntervalSelector/styles.js +25 -0
- package/components/DateRangePicker/styles.d.ts +1 -1
- package/components/ImageGalleryDialog/styles.d.ts +1 -1
- package/components/ReltioGridLayout/ReltioGridLayout.d.ts +6 -1
- package/components/ReltioGridLayout/ReltioGridLayout.js +43 -5
- package/components/ReltioGridLayout/helpers.d.ts +3 -0
- package/components/ReltioGridLayout/helpers.js +14 -1
- package/components/UploadImageDialog/ImageByUrlField/styles.d.ts +1 -1
- package/components/UserSelector/UserSelector.d.ts +9 -0
- package/components/{activityLog/ActivityFilterEditor → UserSelector}/UserSelector.js +6 -6
- package/components/UserSelector/styles.d.ts +5 -0
- package/components/UserSelector/styles.js +39 -0
- package/components/activityLog/ActivityFilterEditor/ActivityFilterEditor.js +4 -4
- package/components/activityLog/ActivityFilterEditor/DateRangeSelector.d.ts +3 -3
- package/components/activityLog/ActivityFilterEditor/DateRangeSelector.js +6 -6
- package/components/activityLog/ActivityFilterEditor/styles.d.ts +1 -1
- package/components/activityLog/ActivityFilterEditor/styles.js +3 -32
- package/components/activityLog/ActivityLogFilter/helpers.js +1 -1
- package/components/activityLog/types/ActivitiesFilter.d.ts +2 -7
- package/components/activityLog/types/index.d.ts +1 -3
- package/components/activityLog/types/index.js +1 -3
- package/components/activityLog/utils/filters.d.ts +2 -2
- package/components/activityLog/utils/filters.js +1 -1
- package/components/attributes/inline/SimpleAttributeEditor/styles.d.ts +1 -1
- package/components/{activityLog/ActivityFilterEditor/ActivityDateRangeEditor.d.ts → editors/CustomDateRangeEditor/CustomDateRangeEditor.d.ts} +3 -3
- package/components/{activityLog/ActivityFilterEditor/ActivityDateRangeEditor.js → editors/CustomDateRangeEditor/CustomDateRangeEditor.js} +6 -5
- package/components/editors/CustomDateRangeEditor/styles.d.ts +1 -0
- package/components/editors/CustomDateRangeEditor/styles.js +25 -0
- package/components/editors/DateRangeEditor/styles.d.ts +1 -1
- package/components/history/DateRangeSelector/DateRangeSelector.d.ts +9 -0
- package/components/history/DateRangeSelector/DateRangeSelector.js +91 -0
- package/components/history/DateRangeSelector/styles.d.ts +1 -0
- package/components/history/DateRangeSelector/styles.js +22 -0
- package/components/history/DateRangeSelector/utils.d.ts +3 -0
- package/components/history/DateRangeSelector/utils.js +19 -0
- package/components/history/HistoryActivitySelector/HistoryActivitySelector.d.ts +9 -0
- package/components/history/HistoryActivitySelector/HistoryActivitySelector.js +27 -0
- package/components/history/HistoryActivitySelector/styles.d.ts +4 -0
- package/components/history/HistoryActivitySelector/styles.js +42 -0
- package/components/history/HistoryActivitySelector/utils.d.ts +3 -0
- package/components/history/HistoryActivitySelector/utils.js +23 -0
- package/components/history/HistoryFilterButton/HistoryFilterButton.d.ts +10 -0
- package/components/history/HistoryFilterButton/HistoryFilterButton.js +87 -0
- package/components/history/HistoryFilterButton/styles.d.ts +1 -1
- package/components/history/HistoryFilterButton/styles.js +26 -0
- package/components/history/HistoryHeader/HistoryHeader.d.ts +6 -1
- package/components/history/HistoryHeader/HistoryHeader.js +3 -3
- package/components/history/index.d.ts +2 -1
- package/components/history/index.js +13 -2
- package/components/history/types/HistoryFilter.d.ts +12 -0
- package/components/history/types/HistoryFilter.js +9 -0
- package/components/history/types/index.d.ts +2 -0
- package/components/history/types/index.js +5 -0
- package/hooks/useCollaboration.js +1 -1
- package/package.json +3 -3
- package/types/index.d.ts +19 -0
- package/types/index.js +7 -0
- package/components/activityLog/ActivityFilterEditor/AttributeSelector.d.ts +0 -10
- package/components/activityLog/ActivityFilterEditor/IntervalSelector.d.ts +0 -8
- package/components/activityLog/ActivityFilterEditor/UserSelector.d.ts +0 -7
- package/components/activityLog/types/AttributeOption.d.ts +0 -8
- package/components/activityLog/types/AttributeOption.js +0 -2
- package/components/activityLog/types/DateRangeTypes.d.ts +0 -5
- package/components/activityLog/types/DateRangeTypes.js +0 -9
- package/components/history/HistoryFilterButton/HistoryFilterBitton.d.ts +0 -3
- package/components/history/HistoryFilterButton/HistoryFilterBitton.js +0 -14
|
@@ -38,31 +38,13 @@ exports.useStyles = styles_1.makeStyles({
|
|
|
38
38
|
marginRight: '30px'
|
|
39
39
|
},
|
|
40
40
|
dateOptionAgo: {
|
|
41
|
-
display: 'flex'
|
|
41
|
+
display: 'flex',
|
|
42
|
+
marginBottom: '10px'
|
|
42
43
|
},
|
|
43
44
|
dateOptionWithin: {
|
|
44
45
|
display: 'flex',
|
|
45
46
|
marginRight: '30px',
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
dateRangeRoot: {
|
|
49
|
-
width: '100%'
|
|
50
|
-
},
|
|
51
|
-
dateInput: {
|
|
52
|
-
backgroundColor: 'rgba(0, 0, 0, 0.03)'
|
|
53
|
-
},
|
|
54
|
-
dateInputNumber: {
|
|
55
|
-
minWidth: '60px',
|
|
56
|
-
marginRight: '25px',
|
|
57
|
-
height: '100%'
|
|
58
|
-
},
|
|
59
|
-
input: {
|
|
60
|
-
height: '100%',
|
|
61
|
-
paddingLeft: '12px',
|
|
62
|
-
paddingRight: '8px'
|
|
63
|
-
},
|
|
64
|
-
dateInputPeriod: {
|
|
65
|
-
width: '100%'
|
|
47
|
+
marginBottom: '10px'
|
|
66
48
|
},
|
|
67
49
|
dateOptionLabel: {
|
|
68
50
|
minWidth: '100px'
|
|
@@ -73,10 +55,6 @@ exports.useStyles = styles_1.makeStyles({
|
|
|
73
55
|
backgroundColor: 'rgba(0, 0, 0, 0.03)',
|
|
74
56
|
borderTop: '4px'
|
|
75
57
|
},
|
|
76
|
-
activityPlaceholder: {
|
|
77
|
-
paddingLeft: '10px',
|
|
78
|
-
color: 'rgba(0,0,0,0.87)'
|
|
79
|
-
},
|
|
80
58
|
filterControls: {
|
|
81
59
|
display: 'flex',
|
|
82
60
|
paddingTop: '30px'
|
|
@@ -84,18 +62,11 @@ exports.useStyles = styles_1.makeStyles({
|
|
|
84
62
|
clearButton: {
|
|
85
63
|
marginRight: 'auto'
|
|
86
64
|
},
|
|
87
|
-
paper: {
|
|
88
|
-
minWidth: '112px'
|
|
89
|
-
},
|
|
90
65
|
borderBottom: {
|
|
91
66
|
borderBottom: 'solid 1px rgba(0, 0, 0, 0.12)',
|
|
92
67
|
paddingBottom: '10px',
|
|
93
68
|
marginBottom: '15px'
|
|
94
69
|
},
|
|
95
|
-
intervalContainer: {
|
|
96
|
-
display: 'flex',
|
|
97
|
-
width: '100%'
|
|
98
|
-
},
|
|
99
70
|
option: {
|
|
100
71
|
fontSize: '14px',
|
|
101
72
|
height: '32px'
|
|
@@ -7,7 +7,7 @@ exports.getFilterLabel = void 0;
|
|
|
7
7
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
8
8
|
var ramda_1 = require("ramda");
|
|
9
9
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
10
|
-
var types_1 = require("
|
|
10
|
+
var types_1 = require("../../../types");
|
|
11
11
|
var activities_1 = require("../utils/activities");
|
|
12
12
|
var getFilterLabel = function (filters) {
|
|
13
13
|
var getLabel = ramda_1.curry(function (unit, pluralUnit, values) {
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { Source } from '@reltio/mdm-sdk';
|
|
2
2
|
import { ActivityTypes } from './ActivityTypes';
|
|
3
|
-
import { AttributeOption } from '
|
|
4
|
-
import { DateRangeTypes } from './DateRangeTypes';
|
|
5
|
-
export declare type ActivitiesFilterDateRange = {
|
|
6
|
-
type: DateRangeTypes;
|
|
7
|
-
period: [number, string] | [Date, Date];
|
|
8
|
-
};
|
|
3
|
+
import { AttributeOption, DateRangeFilter } from '../../../types';
|
|
9
4
|
export declare type ActivitiesFilter = {
|
|
10
5
|
users: string[];
|
|
11
6
|
activities: ActivityTypes[];
|
|
12
|
-
dateRange:
|
|
7
|
+
dateRange: DateRangeFilter;
|
|
13
8
|
attributes?: AttributeOption[];
|
|
14
9
|
sources?: Source[];
|
|
15
10
|
entityUri?: string;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
export type { ActivitiesFilter
|
|
1
|
+
export type { ActivitiesFilter } from './ActivitiesFilter';
|
|
2
2
|
export type { ActivityData } from './ActivityData';
|
|
3
3
|
export type { ActivityDelta } from './ActivityDelta';
|
|
4
4
|
export type { ActivityItem } from './ActivityItem';
|
|
5
|
-
export type { AttributeOption } from './AttributeOption';
|
|
6
5
|
export type { DeltaValue } from './DeltaValue';
|
|
7
6
|
export { ActivityTypes } from './ActivityTypes';
|
|
8
7
|
export { DeltaTypes } from './DeltaTypes';
|
|
9
|
-
export { DateRangeTypes } from './DateRangeTypes';
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DeltaTypes = exports.ActivityTypes = void 0;
|
|
4
4
|
var ActivityTypes_1 = require("./ActivityTypes");
|
|
5
5
|
Object.defineProperty(exports, "ActivityTypes", { enumerable: true, get: function () { return ActivityTypes_1.ActivityTypes; } });
|
|
6
6
|
var DeltaTypes_1 = require("./DeltaTypes");
|
|
7
7
|
Object.defineProperty(exports, "DeltaTypes", { enumerable: true, get: function () { return DeltaTypes_1.DeltaTypes; } });
|
|
8
|
-
var DateRangeTypes_1 = require("./DateRangeTypes");
|
|
9
|
-
Object.defineProperty(exports, "DateRangeTypes", { enumerable: true, get: function () { return DateRangeTypes_1.DateRangeTypes; } });
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DateRangeFilter } from '../../../types';
|
|
2
2
|
export declare const buildActivitiesFilterString: any;
|
|
3
|
-
export declare const isDateRangeValid: (value:
|
|
3
|
+
export declare const isDateRangeValid: (value: DateRangeFilter) => boolean;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.isDateRangeValid = exports.buildActivitiesFilterString = void 0;
|
|
7
7
|
var ramda_1 = require("ramda");
|
|
8
8
|
var moment_1 = __importDefault(require("moment"));
|
|
9
|
-
var types_1 = require("
|
|
9
|
+
var types_1 = require("../../../types");
|
|
10
10
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
11
11
|
var wrapInBrackets = function (str) { return "(" + str + ")"; };
|
|
12
12
|
var multiValueFilter = function (filterClauseFn) { return function (values) { return values.map(filterClauseFn).join(' or '); }; };
|
|
@@ -2,5 +2,5 @@ declare type StylesProps = {
|
|
|
2
2
|
color: string;
|
|
3
3
|
containerWidth: number;
|
|
4
4
|
};
|
|
5
|
-
export declare const useStyles: (props: StylesProps) => import("@material-ui/core/styles/withStyles").ClassNameMap<"input" | "
|
|
5
|
+
export declare const useStyles: (props: StylesProps) => import("@material-ui/core/styles/withStyles").ClassNameMap<"input" | "inputMultiline" | "paper" | "textField" | "popoverRoot" | "booleanEditor" | "timestampEditor">;
|
|
6
6
|
export {};
|
|
@@ -3,7 +3,7 @@ declare type DateValues = [Date, Date];
|
|
|
3
3
|
declare type Props = {
|
|
4
4
|
values: DateValues;
|
|
5
5
|
onChange: (values: DateValues) => void;
|
|
6
|
-
onFocus
|
|
6
|
+
onFocus?: () => void;
|
|
7
7
|
};
|
|
8
|
-
declare const
|
|
9
|
-
export default
|
|
8
|
+
declare const CustomDateRangeEditor: ({ values, onChange, onFocus }: Props) => JSX.Element;
|
|
9
|
+
export default CustomDateRangeEditor;
|
|
@@ -38,7 +38,7 @@ var formatValue = function (value, placeholder) {
|
|
|
38
38
|
? "" + placeholder
|
|
39
39
|
: "" + mdm_sdk_1.formatDataTypeValue({ dataTypeDefinition: { type: mdm_sdk_1.DataTypes.TYPE_ACTIVENESS_DATE } }, value);
|
|
40
40
|
};
|
|
41
|
-
var
|
|
41
|
+
var CustomDateRangeEditor = function (_a) {
|
|
42
42
|
var values = _a.values, onChange = _a.onChange, onFocus = _a.onFocus;
|
|
43
43
|
var placeholder = localeFormat;
|
|
44
44
|
var inputRef = react_1.useRef(null);
|
|
@@ -55,13 +55,14 @@ var ActivityDateRangeEditor = function (_a) {
|
|
|
55
55
|
var onCancel = function () {
|
|
56
56
|
setOpen(false);
|
|
57
57
|
};
|
|
58
|
-
return (react_1.default.createElement("div", { className: styles.
|
|
59
|
-
react_1.default.createElement(TextField_1.default, { fullWidth: true, value: values.map(function (value) { return formatValue(value, placeholder); }).join(' \u2014 '), onClick: handleToggle, variant: "filled",
|
|
58
|
+
return (react_1.default.createElement("div", { className: styles.root },
|
|
59
|
+
react_1.default.createElement(TextField_1.default, { fullWidth: true, value: values.map(function (value) { return formatValue(value, placeholder); }).join(' \u2014 '), onClick: handleToggle, variant: "filled", ref: inputRef, InputProps: {
|
|
60
60
|
endAdornment: (react_1.default.createElement(DropdownIndicatorWithIconButton_1.default, { selectProps: { classes: styles, menuIsOpen: open }, innerProps: {} })),
|
|
61
61
|
disableUnderline: ramda_1.isNil(values),
|
|
62
62
|
readOnly: true,
|
|
63
63
|
classes: {
|
|
64
|
-
root: styles.
|
|
64
|
+
root: styles.inputRoot,
|
|
65
|
+
input: styles.input
|
|
65
66
|
}
|
|
66
67
|
}, InputLabelProps: {
|
|
67
68
|
shrink: false
|
|
@@ -84,4 +85,4 @@ var ActivityDateRangeEditor = function (_a) {
|
|
|
84
85
|
// @ts-ignore
|
|
85
86
|
values: values, onCancel: onCancel, onApply: onApply, type: mdm_sdk_1.DataTypes.TYPE_ACTIVENESS_DATE }))));
|
|
86
87
|
};
|
|
87
|
-
exports.default =
|
|
88
|
+
exports.default = CustomDateRangeEditor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"input" | "root" | "dateOptionLabel" | "dropdownIndicator" | "inputRoot" | "paper">;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useStyles = void 0;
|
|
4
|
+
var styles_1 = require("@material-ui/core/styles");
|
|
5
|
+
exports.useStyles = styles_1.makeStyles({
|
|
6
|
+
root: {
|
|
7
|
+
flex: 1
|
|
8
|
+
},
|
|
9
|
+
dropdownIndicator: {
|
|
10
|
+
transition: 'transform .15s ease'
|
|
11
|
+
},
|
|
12
|
+
inputRoot: {
|
|
13
|
+
fontSize: '14px',
|
|
14
|
+
height: 46
|
|
15
|
+
},
|
|
16
|
+
input: {
|
|
17
|
+
padding: '0 12px 0'
|
|
18
|
+
},
|
|
19
|
+
dateOptionLabel: {
|
|
20
|
+
minWidth: '100px'
|
|
21
|
+
},
|
|
22
|
+
paper: {
|
|
23
|
+
minWidth: '112px'
|
|
24
|
+
}
|
|
25
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"underline" | "
|
|
1
|
+
export const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"underline" | "dropdownIndicator" | "adornedEnd" | "inputRoot" | "paper" | "menuItem" | "menuText" | "inputLabel">;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DateRangeFilter } from '../../../types';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
value: DateRangeFilter;
|
|
5
|
+
onChange: (range: DateRangeFilter) => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const DateRangeSelector: ({ value, onChange, className }: Props) => JSX.Element;
|
|
9
|
+
export default DateRangeSelector;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
var react_1 = __importStar(require("react"));
|
|
26
|
+
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
27
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
28
|
+
var Typography_1 = __importDefault(require("@material-ui/core/Typography"));
|
|
29
|
+
var SimpleDropDownSelector_1 = __importDefault(require("../../SimpleDropDownSelector/SimpleDropDownSelector"));
|
|
30
|
+
var utils_1 = require("./utils");
|
|
31
|
+
var DateIntervalSelector_1 = __importDefault(require("../../DateIntervalSelector/DateIntervalSelector"));
|
|
32
|
+
var hooks_1 = require("../../../hooks");
|
|
33
|
+
var CustomDateRangeEditor_1 = __importDefault(require("../../editors/CustomDateRangeEditor/CustomDateRangeEditor"));
|
|
34
|
+
var types_1 = require("../../../types");
|
|
35
|
+
var styles_1 = require("./styles");
|
|
36
|
+
var emptyDates = [null, null];
|
|
37
|
+
var emptyInterval = [null, 'hours'];
|
|
38
|
+
var DateRangeSelector = function (_a) {
|
|
39
|
+
var value = _a.value, onChange = _a.onChange, className = _a.className;
|
|
40
|
+
var styles = styles_1.useStyles();
|
|
41
|
+
var isIntervalType = function (type) { return type === types_1.DateRangeTypes.WITHIN || type === types_1.DateRangeTypes.AGO; };
|
|
42
|
+
var isBetweenType = function (type) { return type === types_1.DateRangeTypes.BETWEEN; };
|
|
43
|
+
var initDatesInterval = isBetweenType(value === null || value === void 0 ? void 0 : value.type) ? value.period : emptyDates;
|
|
44
|
+
var initInterval = isIntervalType(value === null || value === void 0 ? void 0 : value.type) ? value.period : emptyInterval;
|
|
45
|
+
var _b = react_1.useState(initDatesInterval), datesInterval = _b[0], setDatesInterval = _b[1];
|
|
46
|
+
var _c = react_1.useState(initInterval), interval = _c[0], setInterval = _c[1];
|
|
47
|
+
var selectedType = (value === null || value === void 0 ? void 0 : value.type) || types_1.DateRangeTypes.WITHIN;
|
|
48
|
+
var getCurrentPeriodByType = function (type) {
|
|
49
|
+
if (isIntervalType(type)) {
|
|
50
|
+
return interval;
|
|
51
|
+
}
|
|
52
|
+
else if (isBetweenType(type)) {
|
|
53
|
+
return datesInterval;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var changeType = function (_a) {
|
|
57
|
+
var type = _a.value;
|
|
58
|
+
if ((value === null || value === void 0 ? void 0 : value.type) !== type) {
|
|
59
|
+
onChange({ period: getCurrentPeriodByType(type), type: type });
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var changePeriod = function (period) {
|
|
63
|
+
onChange({ type: selectedType, period: period });
|
|
64
|
+
};
|
|
65
|
+
hooks_1.useDidUpdateEffect(function () {
|
|
66
|
+
if (value) {
|
|
67
|
+
if (isIntervalType(value.type)) {
|
|
68
|
+
setInterval(value.period);
|
|
69
|
+
}
|
|
70
|
+
else if (isBetweenType(value.type)) {
|
|
71
|
+
setDatesInterval(value.period);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
setDatesInterval(emptyDates);
|
|
76
|
+
setInterval(emptyInterval);
|
|
77
|
+
}
|
|
78
|
+
}, [value]);
|
|
79
|
+
return (react_1.default.createElement("div", { className: classnames_1.default(styles.root, className) },
|
|
80
|
+
react_1.default.createElement(Typography_1.default, { className: styles.title, variant: 'subtitle1' }, ui_i18n_1.default.text('Date')),
|
|
81
|
+
react_1.default.createElement("div", { className: styles.intervalContainer },
|
|
82
|
+
react_1.default.createElement(SimpleDropDownSelector_1.default, { label: '', className: styles.typeInput, value: {
|
|
83
|
+
value: selectedType,
|
|
84
|
+
label: utils_1.getDateRangeTypeLabel(selectedType)
|
|
85
|
+
}, options: utils_1.dateRangeTypeOptions.map(function (option) { return ({
|
|
86
|
+
value: option,
|
|
87
|
+
label: utils_1.getDateRangeTypeLabel(option)
|
|
88
|
+
}); }), onChange: changeType }),
|
|
89
|
+
isIntervalType(selectedType) ? (react_1.default.createElement(DateIntervalSelector_1.default, { interval: interval, onChange: changePeriod })) : (react_1.default.createElement(CustomDateRangeEditor_1.default, { values: datesInterval, onChange: changePeriod })))));
|
|
90
|
+
};
|
|
91
|
+
exports.default = DateRangeSelector;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"title" | "root" | "intervalContainer" | "typeInput">;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useStyles = void 0;
|
|
4
|
+
var styles_1 = require("@material-ui/core/styles");
|
|
5
|
+
exports.useStyles = styles_1.makeStyles({
|
|
6
|
+
root: {
|
|
7
|
+
flex: 1
|
|
8
|
+
},
|
|
9
|
+
title: {
|
|
10
|
+
paddingBottom: '10px',
|
|
11
|
+
paddingLeft: '5px',
|
|
12
|
+
fontSize: '14px'
|
|
13
|
+
},
|
|
14
|
+
intervalContainer: {
|
|
15
|
+
display: 'flex',
|
|
16
|
+
justifyContent: 'space-between'
|
|
17
|
+
},
|
|
18
|
+
typeInput: {
|
|
19
|
+
width: 160,
|
|
20
|
+
marginRight: 10
|
|
21
|
+
}
|
|
22
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
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.getDateRangeTypeLabel = exports.dateRangeTypeOptions = void 0;
|
|
7
|
+
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
8
|
+
var types_1 = require("../../../types");
|
|
9
|
+
exports.dateRangeTypeOptions = [types_1.DateRangeTypes.WITHIN, types_1.DateRangeTypes.AGO, types_1.DateRangeTypes.BETWEEN];
|
|
10
|
+
var getDateRangeTypeLabel = function (type) {
|
|
11
|
+
var _a;
|
|
12
|
+
var labels = (_a = {},
|
|
13
|
+
_a[types_1.DateRangeTypes.WITHIN] = ui_i18n_1.default.text('Within the last'),
|
|
14
|
+
_a[types_1.DateRangeTypes.AGO] = ui_i18n_1.default.text('More than'),
|
|
15
|
+
_a[types_1.DateRangeTypes.BETWEEN] = ui_i18n_1.default.text('Date range'),
|
|
16
|
+
_a);
|
|
17
|
+
return labels[type] || '';
|
|
18
|
+
};
|
|
19
|
+
exports.getDateRangeTypeLabel = getDateRangeTypeLabel;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { HistoryActivityType } from '../types/HistoryFilter';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
selectedHistoryActivityTypes: HistoryActivityType[];
|
|
5
|
+
onChange: (activities: HistoryActivityType[]) => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const HistoryActivitySelector: ({ selectedHistoryActivityTypes, onChange, className }: Props) => JSX.Element;
|
|
9
|
+
export default HistoryActivitySelector;
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
var react_1 = __importDefault(require("react"));
|
|
7
|
+
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
8
|
+
var ramda_1 = require("ramda");
|
|
9
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
10
|
+
var Typography_1 = __importDefault(require("@material-ui/core/Typography"));
|
|
11
|
+
var MultiSelect_1 = __importDefault(require("../../ReactSelect/MultiSelect"));
|
|
12
|
+
var DropdownIndicatorWithIconButton_1 = __importDefault(require("../../commonReactSelectComponents/DropdownIndicatorWithIconButton"));
|
|
13
|
+
var utils_1 = require("./utils");
|
|
14
|
+
var styles_1 = require("./styles");
|
|
15
|
+
var HistoryActivitySelector = function (_a) {
|
|
16
|
+
var selectedHistoryActivityTypes = _a.selectedHistoryActivityTypes, onChange = _a.onChange, className = _a.className;
|
|
17
|
+
var styles = styles_1.useStyles();
|
|
18
|
+
var valueToOption = function (value) { return ({ value: value, label: utils_1.getHistoryActivityLabel(value) }); };
|
|
19
|
+
var prepareValues = function (values) { return values.map(valueToOption); };
|
|
20
|
+
var options = prepareValues(utils_1.historyActivityOptions);
|
|
21
|
+
return (react_1.default.createElement("div", { className: classnames_1.default(styles.root, className) },
|
|
22
|
+
react_1.default.createElement(Typography_1.default, { className: styles.title, variant: 'subtitle1' }, ui_i18n_1.default.text('Activity')),
|
|
23
|
+
react_1.default.createElement(MultiSelect_1.default, { value: prepareValues(selectedHistoryActivityTypes), onChange: ramda_1.pipe(ramda_1.defaultTo([]), ramda_1.pluck('value'), onChange), options: options, TextFieldProps: { classes: { root: styles.dropDownInput } }, components: {
|
|
24
|
+
DropdownIndicator: DropdownIndicatorWithIconButton_1.default
|
|
25
|
+
}, styles: styles_1.customStyles, classes: styles, menuPlacement: "bottom" })));
|
|
26
|
+
};
|
|
27
|
+
exports.default = HistoryActivitySelector;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.useStyles = exports.customStyles = void 0;
|
|
15
|
+
var styles_1 = require("@material-ui/core/styles");
|
|
16
|
+
exports.customStyles = {
|
|
17
|
+
input: function (currentStyles) { return (__assign(__assign({}, currentStyles), { fontSize: '14px' })); }
|
|
18
|
+
};
|
|
19
|
+
exports.useStyles = styles_1.makeStyles({
|
|
20
|
+
root: {
|
|
21
|
+
flex: 1
|
|
22
|
+
},
|
|
23
|
+
title: {
|
|
24
|
+
paddingBottom: '10px',
|
|
25
|
+
paddingLeft: '5px',
|
|
26
|
+
fontSize: '14px'
|
|
27
|
+
},
|
|
28
|
+
dropDownInput: {
|
|
29
|
+
width: '100%',
|
|
30
|
+
justifyContent: 'center',
|
|
31
|
+
backgroundColor: 'rgba(0, 0, 0, 0.03)',
|
|
32
|
+
borderTop: '4px'
|
|
33
|
+
},
|
|
34
|
+
valueContainer: {
|
|
35
|
+
overflowY: 'auto',
|
|
36
|
+
height: 44
|
|
37
|
+
},
|
|
38
|
+
option: {
|
|
39
|
+
fontSize: '14px',
|
|
40
|
+
height: '32px'
|
|
41
|
+
}
|
|
42
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
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.getHistoryActivityLabel = exports.historyActivityOptions = void 0;
|
|
7
|
+
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
8
|
+
var HistoryFilter_1 = require("../types/HistoryFilter");
|
|
9
|
+
exports.historyActivityOptions = [
|
|
10
|
+
HistoryFilter_1.HistoryActivityType.UPDATE,
|
|
11
|
+
HistoryFilter_1.HistoryActivityType.MERGE,
|
|
12
|
+
HistoryFilter_1.HistoryActivityType.UNMERGE
|
|
13
|
+
];
|
|
14
|
+
var getHistoryActivityLabel = function (type) {
|
|
15
|
+
var _a;
|
|
16
|
+
var labels = (_a = {},
|
|
17
|
+
_a[HistoryFilter_1.HistoryActivityType.UPDATE] = ui_i18n_1.default.text('Update'),
|
|
18
|
+
_a[HistoryFilter_1.HistoryActivityType.MERGE] = ui_i18n_1.default.text('Merge'),
|
|
19
|
+
_a[HistoryFilter_1.HistoryActivityType.UNMERGE] = ui_i18n_1.default.text('Unmerge'),
|
|
20
|
+
_a);
|
|
21
|
+
return labels[type] || '';
|
|
22
|
+
};
|
|
23
|
+
exports.getHistoryActivityLabel = getHistoryActivityLabel;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TEntityType } from '@reltio/mdm-sdk';
|
|
3
|
+
import { HistoryFilter } from '../types';
|
|
4
|
+
declare type Props = {
|
|
5
|
+
filter: HistoryFilter;
|
|
6
|
+
onApplyFilter: (filter: HistoryFilter) => void;
|
|
7
|
+
entityType: TEntityType;
|
|
8
|
+
};
|
|
9
|
+
declare const HistoryFilterButton: ({ filter, onApplyFilter, entityType }: Props) => JSX.Element;
|
|
10
|
+
export default HistoryFilterButton;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
+
if (mod && mod.__esModule) return mod;
|
|
27
|
+
var result = {};
|
|
28
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
+
__setModuleDefault(result, mod);
|
|
30
|
+
return result;
|
|
31
|
+
};
|
|
32
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
33
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
34
|
+
};
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
var react_1 = __importStar(require("react"));
|
|
37
|
+
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
38
|
+
var ramda_1 = require("ramda");
|
|
39
|
+
var FilterList_1 = __importDefault(require("@material-ui/icons/FilterList"));
|
|
40
|
+
var Button_1 = __importDefault(require("@material-ui/core/Button"));
|
|
41
|
+
var Popover_1 = __importDefault(require("@material-ui/core/Popover"));
|
|
42
|
+
var Typography_1 = __importDefault(require("@material-ui/core/Typography"));
|
|
43
|
+
var SmallIconButton_1 = require("../../SmallIconButton");
|
|
44
|
+
var UserSelector_1 = __importDefault(require("../../UserSelector/UserSelector"));
|
|
45
|
+
var AttributeSelector_1 = __importDefault(require("../../AttributeSelector/AttributeSelector"));
|
|
46
|
+
var DateRangeSelector_1 = __importDefault(require("../DateRangeSelector/DateRangeSelector"));
|
|
47
|
+
var HistoryActivitySelector_1 = __importDefault(require("../HistoryActivitySelector/HistoryActivitySelector"));
|
|
48
|
+
var styles_1 = require("./styles");
|
|
49
|
+
var HistoryFilterButton = function (_a) {
|
|
50
|
+
var filter = _a.filter, onApplyFilter = _a.onApplyFilter, entityType = _a.entityType;
|
|
51
|
+
var styles = styles_1.useStyles();
|
|
52
|
+
var _b = react_1.useState(null), anchorEl = _b[0], setAnchorEl = _b[1];
|
|
53
|
+
var openPopup = function (event) { return setAnchorEl(event.currentTarget); };
|
|
54
|
+
var closePopup = function () { return setAnchorEl(null); };
|
|
55
|
+
var _c = react_1.useState(filter), currentValue = _c[0], setCurrentValue = _c[1];
|
|
56
|
+
var clearCurrentValue = function () { return setCurrentValue(null); };
|
|
57
|
+
var handlePropChange = ramda_1.curry(function (propName, value) {
|
|
58
|
+
setCurrentValue(function (filterValue) {
|
|
59
|
+
var _a;
|
|
60
|
+
return (__assign(__assign({}, filterValue), (_a = {}, _a[propName] = value, _a)));
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
var _d = currentValue || {}, _e = _d.activities, activities = _e === void 0 ? [] : _e, _f = _d.attributes, attributes = _f === void 0 ? [] : _f, _g = _d.dateRange, dateRange = _g === void 0 ? null : _g, _h = _d.users, users = _h === void 0 ? [] : _h;
|
|
64
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
65
|
+
react_1.default.createElement(SmallIconButton_1.SmallIconButton, { icon: FilterList_1.default, size: "XS", onClick: openPopup, className: styles.icon }),
|
|
66
|
+
react_1.default.createElement(Popover_1.default, { classes: { paper: styles.popup }, open: !!anchorEl, anchorEl: anchorEl, onClose: closePopup, anchorOrigin: {
|
|
67
|
+
vertical: 'bottom',
|
|
68
|
+
horizontal: 'right'
|
|
69
|
+
}, transformOrigin: {
|
|
70
|
+
vertical: 'top',
|
|
71
|
+
horizontal: 'right'
|
|
72
|
+
} },
|
|
73
|
+
react_1.default.createElement("div", { className: styles.filterContainer },
|
|
74
|
+
react_1.default.createElement(Typography_1.default, { variant: "h6" }, ui_i18n_1.default.text('Filter')),
|
|
75
|
+
react_1.default.createElement(DateRangeSelector_1.default, { value: dateRange, onChange: handlePropChange('dateRange'), className: styles.filterItem }),
|
|
76
|
+
react_1.default.createElement(UserSelector_1.default, { selectedUsers: users, onChange: handlePropChange('users'), className: styles.filterItem }),
|
|
77
|
+
react_1.default.createElement(HistoryActivitySelector_1.default, { selectedHistoryActivityTypes: activities, onChange: handlePropChange('activities'), className: styles.filterItem }),
|
|
78
|
+
react_1.default.createElement(AttributeSelector_1.default, { selectedAttributes: attributes, entityType: entityType, onChange: handlePropChange('attributes'), className: styles.filterItem, title: ui_i18n_1.default.text('Attribute updated'), menuPlacement: "top" })),
|
|
79
|
+
react_1.default.createElement("div", { className: styles.filterControls },
|
|
80
|
+
react_1.default.createElement(Button_1.default, { onClick: clearCurrentValue, className: styles.clearButton }, ui_i18n_1.default.text('Clear all')),
|
|
81
|
+
react_1.default.createElement(Button_1.default, { onClick: closePopup }, ui_i18n_1.default.text('Cancel')),
|
|
82
|
+
react_1.default.createElement(Button_1.default, { color: "primary", onClick: function () {
|
|
83
|
+
onApplyFilter(currentValue);
|
|
84
|
+
closePopup();
|
|
85
|
+
} }, ui_i18n_1.default.text('Apply'))))));
|
|
86
|
+
};
|
|
87
|
+
exports.default = HistoryFilterButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"icon">;
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"icon" | "input" | "popup" | "filterControls" | "clearButton" | "filterContainer" | "filterItem">;
|
|
@@ -5,5 +5,31 @@ var styles_1 = require("@material-ui/core/styles");
|
|
|
5
5
|
exports.useStyles = styles_1.makeStyles({
|
|
6
6
|
icon: {
|
|
7
7
|
margin: 5
|
|
8
|
+
},
|
|
9
|
+
popup: {
|
|
10
|
+
width: 500,
|
|
11
|
+
height: 500,
|
|
12
|
+
overflowY: 'hidden'
|
|
13
|
+
},
|
|
14
|
+
filterContainer: {
|
|
15
|
+
padding: 20,
|
|
16
|
+
height: 410,
|
|
17
|
+
overflowY: 'auto'
|
|
18
|
+
},
|
|
19
|
+
filterItem: {
|
|
20
|
+
marginTop: 15
|
|
21
|
+
},
|
|
22
|
+
filterControls: {
|
|
23
|
+
display: 'flex',
|
|
24
|
+
padding: '10px 12px 0',
|
|
25
|
+
borderTop: 'solid 1px rgba(0, 0, 0, 0.12)'
|
|
26
|
+
},
|
|
27
|
+
clearButton: {
|
|
28
|
+
marginRight: 'auto'
|
|
29
|
+
},
|
|
30
|
+
input: {
|
|
31
|
+
height: '100%',
|
|
32
|
+
paddingLeft: '12px',
|
|
33
|
+
paddingRight: '8px'
|
|
8
34
|
}
|
|
9
35
|
});
|