@truedat/core 4.39.0 → 4.40.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 +7 -0
- package/package.json +2 -2
- package/src/components/DateTime.js +4 -2
- package/src/components/SelectedFilters.js +27 -30
- package/src/services/filters.js +4 -11
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.40.2",
|
|
4
4
|
"description": "Truedat Web Core",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -106,5 +106,5 @@
|
|
|
106
106
|
"react-dom": ">= 16.8.6 < 17",
|
|
107
107
|
"semantic-ui-react": ">= 0.88.2 < 2.1"
|
|
108
108
|
},
|
|
109
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "86aa7e6c6e49c8e3a975f8f4f744c44035324c7f"
|
|
110
110
|
}
|
|
@@ -3,11 +3,13 @@ import PropTypes from "prop-types";
|
|
|
3
3
|
import Moment from "react-moment";
|
|
4
4
|
|
|
5
5
|
export const DateTime = ({ value, className }) =>
|
|
6
|
-
value ?
|
|
6
|
+
value ? (
|
|
7
|
+
<Moment className={className} date={value} format="YYYY-MM-DD HH:mm" />
|
|
8
|
+
) : null;
|
|
7
9
|
|
|
8
10
|
DateTime.propTypes = {
|
|
9
11
|
value: PropTypes.string,
|
|
10
|
-
className: PropTypes.
|
|
12
|
+
className: PropTypes.string,
|
|
11
13
|
};
|
|
12
14
|
|
|
13
15
|
export default DateTime;
|
|
@@ -19,7 +19,7 @@ export const SelectedFilters = ({
|
|
|
19
19
|
saveFilters,
|
|
20
20
|
selectedFilter,
|
|
21
21
|
selectedFilters,
|
|
22
|
-
selectedFilterActiveValues,
|
|
22
|
+
selectedFilterActiveValues: activeValues,
|
|
23
23
|
selectedFilterValues,
|
|
24
24
|
selectedUserFilter,
|
|
25
25
|
toggleFilterValue,
|
|
@@ -40,36 +40,33 @@ export const SelectedFilters = ({
|
|
|
40
40
|
/>
|
|
41
41
|
)}
|
|
42
42
|
<div className="selectedFilters">
|
|
43
|
-
{
|
|
44
|
-
<div className="appliedFilters">
|
|
45
|
-
<FormattedMessage id="search.applied_filters" />
|
|
46
|
-
</div>
|
|
47
|
-
)}
|
|
48
|
-
{!_.isEmpty(selectedFilters) &&
|
|
49
|
-
selectedFilters.map((filter) => {
|
|
50
|
-
const filterOptions = _.isEqual(filter, selectedFilter)
|
|
51
|
-
? selectedFilterValues
|
|
52
|
-
: null;
|
|
53
|
-
const props = {
|
|
54
|
-
key: filter,
|
|
55
|
-
activeValues: selectedFilterActiveValues,
|
|
56
|
-
closeFilter: closeFilter,
|
|
57
|
-
filter,
|
|
58
|
-
loading,
|
|
59
|
-
openFilter,
|
|
60
|
-
options: filterOptions,
|
|
61
|
-
removeFilter,
|
|
62
|
-
toggleFilterValue,
|
|
63
|
-
filterItemMapping,
|
|
64
|
-
};
|
|
65
|
-
return selectedFilter === "taxonomy" ? (
|
|
66
|
-
<FilterMultilevelDropdown {...props} />
|
|
67
|
-
) : (
|
|
68
|
-
<FilterDropdown {...props} />
|
|
69
|
-
);
|
|
70
|
-
})}
|
|
71
|
-
{!_.isEmpty(selectedFilters) && (
|
|
43
|
+
{_.isEmpty(selectedFilters) ? null : (
|
|
72
44
|
<>
|
|
45
|
+
<div className="appliedFilters">
|
|
46
|
+
<FormattedMessage id="search.applied_filters" />
|
|
47
|
+
</div>
|
|
48
|
+
{selectedFilters.map((filter) => {
|
|
49
|
+
const options = _.isEqual(filter, selectedFilter)
|
|
50
|
+
? selectedFilterValues
|
|
51
|
+
: null;
|
|
52
|
+
const props = {
|
|
53
|
+
key: filter,
|
|
54
|
+
activeValues,
|
|
55
|
+
closeFilter,
|
|
56
|
+
filter,
|
|
57
|
+
loading,
|
|
58
|
+
openFilter,
|
|
59
|
+
options,
|
|
60
|
+
removeFilter,
|
|
61
|
+
toggleFilterValue,
|
|
62
|
+
filterItemMapping,
|
|
63
|
+
};
|
|
64
|
+
return selectedFilter === "taxonomy" ? (
|
|
65
|
+
<FilterMultilevelDropdown {...props} />
|
|
66
|
+
) : (
|
|
67
|
+
<FilterDropdown {...props} />
|
|
68
|
+
);
|
|
69
|
+
})}
|
|
73
70
|
<a className="resetFilters" onClick={() => resetFilters()}>
|
|
74
71
|
<FormattedMessage id="search.clear_filters" />
|
|
75
72
|
</a>
|
package/src/services/filters.js
CHANGED
|
@@ -28,17 +28,10 @@ export const getSearchPayload = (searchQuery, props) => {
|
|
|
28
28
|
]);
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
export const formatFilterValues = (selectedFilter) => (values) =>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
_.map(_.omit(["parent_ids"]))
|
|
36
|
-
)(values);
|
|
37
|
-
return getDomainSelectorOptions({ domains });
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return values;
|
|
41
|
-
};
|
|
31
|
+
export const formatFilterValues = (selectedFilter) => (values) =>
|
|
32
|
+
selectedFilter === "taxonomy"
|
|
33
|
+
? getDomainSelectorOptions({ domains: values })
|
|
34
|
+
: values;
|
|
42
35
|
|
|
43
36
|
export const toFilterValues = (filterValues) =>
|
|
44
37
|
_.map((v) => (_.isObject(v) ? v.id : v))(filterValues);
|