@truedat/core 4.48.0 → 4.48.2
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/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/core",
|
|
3
|
-
"version": "4.48.
|
|
3
|
+
"version": "4.48.2",
|
|
4
4
|
"description": "Truedat Web Core",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"react-dom": ">= 16.8.6 < 17",
|
|
113
113
|
"semantic-ui-react": ">= 0.88.2 < 2.1"
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "93133e957332713e64c97eecdf45cc283c29bd32"
|
|
116
116
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
|
2
2
|
import moment from "moment";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
|
-
import { useIntl } from "react-intl";
|
|
5
|
-
import { Form, Input, Label, Dropdown } from "semantic-ui-react";
|
|
6
4
|
import { DatesRangeInput } from "semantic-ui-calendar-react";
|
|
7
5
|
|
|
8
6
|
const validNumber = (value) => RegExp("^\\d+$").test(value);
|
|
@@ -10,10 +8,8 @@ const validRange = (value) =>
|
|
|
10
8
|
RegExp("^\\d{4}-\\d\\d-\\d\\d *- *\\d{4}-\\d\\d-\\d\\d$").test(value);
|
|
11
9
|
|
|
12
10
|
export const DateRangeFilter = ({
|
|
13
|
-
label,
|
|
14
11
|
onChange,
|
|
15
12
|
defaultValues,
|
|
16
|
-
size = "small",
|
|
17
13
|
name = "date",
|
|
18
14
|
dateFormat = "YYYY-MM-DD",
|
|
19
15
|
}) => {
|
|
@@ -47,10 +43,8 @@ export const DateRangeFilter = ({
|
|
|
47
43
|
DateRangeFilter.propTypes = {
|
|
48
44
|
dateFormat: PropTypes.string,
|
|
49
45
|
defaultValues: PropTypes.object,
|
|
50
|
-
label: PropTypes.node,
|
|
51
46
|
name: PropTypes.string,
|
|
52
47
|
onChange: PropTypes.func,
|
|
53
|
-
size: PropTypes.string,
|
|
54
48
|
};
|
|
55
49
|
|
|
56
50
|
export default DateRangeFilter;
|
|
@@ -7,14 +7,15 @@ import { useQuery } from "@apollo/client";
|
|
|
7
7
|
import { accentInsensitivePathOrder } from "../services/sort";
|
|
8
8
|
import { TEMPLATES_QUERY } from "../api/queries";
|
|
9
9
|
|
|
10
|
-
const makeOptions =
|
|
11
|
-
_.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
)
|
|
10
|
+
const makeOptions = (formatMessage) =>
|
|
11
|
+
_.flow(
|
|
12
|
+
_.map(({ label, id: value }) => ({
|
|
13
|
+
key: value,
|
|
14
|
+
value,
|
|
15
|
+
text: formatMessage({ id: `templates.${label}`, defaultMessage: label }),
|
|
16
|
+
})),
|
|
17
|
+
_.sortBy(accentInsensitivePathOrder("text"))
|
|
18
|
+
);
|
|
18
19
|
|
|
19
20
|
export const TemplateSelector = ({
|
|
20
21
|
clearable,
|
|
@@ -26,7 +27,7 @@ export const TemplateSelector = ({
|
|
|
26
27
|
templates,
|
|
27
28
|
}) => {
|
|
28
29
|
const { formatMessage } = useIntl();
|
|
29
|
-
const options = makeOptions(templates);
|
|
30
|
+
const options = makeOptions(formatMessage)(templates);
|
|
30
31
|
const hidden = loading ? false : _.size(templates) <= 1;
|
|
31
32
|
|
|
32
33
|
const handleChange = (e, { value, ...data }) => {
|
|
@@ -16,11 +16,11 @@ export const UserFilters = ({
|
|
|
16
16
|
}) => {
|
|
17
17
|
return _.isEmpty(userFilters) ? null : (
|
|
18
18
|
<div className="selectedFilters">
|
|
19
|
-
{userFilters.map((userFilter,
|
|
19
|
+
{userFilters.map((userFilter, key) => (
|
|
20
20
|
<Label
|
|
21
21
|
basic={selectedUserFilter == userFilter.name ? false : true}
|
|
22
22
|
circular
|
|
23
|
-
key={
|
|
23
|
+
key={key}
|
|
24
24
|
>
|
|
25
25
|
<span
|
|
26
26
|
onClick={
|
|
@@ -7,7 +7,7 @@ exports[`<UserFilters /> matches the latest snapshot 1`] = `
|
|
|
7
7
|
<Label
|
|
8
8
|
basic={true}
|
|
9
9
|
circular={true}
|
|
10
|
-
key="
|
|
10
|
+
key="0"
|
|
11
11
|
>
|
|
12
12
|
<span
|
|
13
13
|
className="userFilter"
|
|
@@ -51,7 +51,7 @@ exports[`<UserFilters /> matches the latest snapshot 1`] = `
|
|
|
51
51
|
<Label
|
|
52
52
|
basic={true}
|
|
53
53
|
circular={true}
|
|
54
|
-
key="
|
|
54
|
+
key="1"
|
|
55
55
|
>
|
|
56
56
|
<span
|
|
57
57
|
className="userFilter"
|