@civicactions/cmsds-open-data-components 1.7.0 → 1.8.0
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/dist/scss/components/breadcrumb.scss +0 -1
- package/dist/scss/components/dataset-search-list-item.scss +2 -3
- package/dist/scss/components/dataset-tags.scss +1 -1
- package/dist/scss/components/datatable.scss +1 -1
- package/dist/scss/components/index.scss +9 -9
- package/dist/scss/components/pagination.scss +2 -2
- package/dist/scss/index.scss +2 -2
- package/dist/scss/templates/dataset-search.scss +3 -3
- package/dist/scss/templates/dataset.scss +1 -1
- package/dist/scss/templates/filtered-resource.scss +1 -1
- package/dist/scss/templates/footer.scss +9 -5
- package/dist/scss/templates/header.scss +15 -15
- package/dist/scss/templates/index.scss +6 -6
- package/dist/scss/templates/swagger.scss +2 -2
- package/lib/assets/icons/close.jsx +16 -4
- package/lib/components/DataTableRowChanger/index.js +1 -1
- package/lib/components/DatasetAdditionalInformation/index.js +1 -1
- package/lib/components/DatasetSearchFacets/dataset_search_facets.test.js +3 -3
- package/lib/components/DatasetSearchListItem/datasetsearchlistitem.test.js +7 -7
- package/lib/components/Hero/index.js +5 -5
- package/lib/components/ResourceConditionField/index.js +21 -21
- package/lib/components/ResourceFilter/index.js +3 -3
- package/lib/components/ResourceFilter/resourcefilter.test.js +18 -18
- package/lib/components/ResourcePreview/index.js +20 -18
- package/lib/components/SubMenu/index.js +5 -5
- package/lib/components/TransformedDate/index.js +1 -1
- package/lib/templates/Dataset/DatasetBody.js +17 -17
- package/lib/templates/Dataset/index.js +1 -1
- package/lib/templates/DatasetSearch/index.js +36 -39
- package/lib/templates/FilteredResource/FilteredResourceBody.js +10 -9
- package/lib/templates/FilteredResource/functions.js +13 -2
- package/lib/templates/FilteredResource/index.js +5 -3
- package/lib/templates/Footer/index.js +15 -15
- package/lib/templates/mobile_header/index.js +15 -15
- package/package.json +2 -2
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import '~@cmsgov/design-system/dist/scss/settings/variables/color';
|
|
2
2
|
|
|
3
3
|
.dc-dataset-searchlist-item {
|
|
4
|
-
|
|
5
4
|
h2 a {
|
|
6
5
|
text-decoration: none;
|
|
7
6
|
&:hover {
|
|
@@ -18,4 +17,4 @@
|
|
|
18
17
|
border: none;
|
|
19
18
|
color: $color-base;
|
|
20
19
|
}
|
|
21
|
-
}
|
|
20
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
@import
|
|
2
|
-
@import
|
|
3
|
-
@import
|
|
4
|
-
@import
|
|
5
|
-
@import
|
|
6
|
-
@import
|
|
7
|
-
@import
|
|
8
|
-
@import
|
|
9
|
-
@import
|
|
1
|
+
@import './datatable.scss';
|
|
2
|
+
@import './dataset-tags.scss';
|
|
3
|
+
@import './dataset-downloads.scss';
|
|
4
|
+
@import './pagination.scss';
|
|
5
|
+
@import './dataset-search-list-item.scss';
|
|
6
|
+
@import './dataset-search-facets.scss';
|
|
7
|
+
@import './additional-information-table.scss';
|
|
8
|
+
@import './breadcrumb.scss';
|
|
9
|
+
@import './resource-information-table.scss';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import '~@cmsgov/design-system/dist/scss/settings/variables/color';
|
|
2
2
|
|
|
3
3
|
.dc-pagination {
|
|
4
4
|
ol {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
.dc-pagination--next__button {
|
|
17
17
|
height: 100%;
|
|
18
18
|
&:disabled {
|
|
19
|
-
background: transparent!important;
|
|
19
|
+
background: transparent !important;
|
|
20
20
|
&::before,
|
|
21
21
|
&::after {
|
|
22
22
|
color: $color-base;
|
package/dist/scss/index.scss
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@import
|
|
2
|
-
@import
|
|
1
|
+
@import './components';
|
|
2
|
+
@import './templates';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import '~@cmsgov/design-system/dist/scss/settings/variables/color';
|
|
2
2
|
|
|
3
3
|
.dc-dataset-search-list {
|
|
4
4
|
list-style: none;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
.dc-search-header {
|
|
19
19
|
display: relative;
|
|
20
20
|
&::after {
|
|
21
|
-
content:
|
|
21
|
+
content: '';
|
|
22
22
|
display: block;
|
|
23
23
|
width: 48px;
|
|
24
24
|
height: 4px;
|
|
@@ -29,4 +29,4 @@
|
|
|
29
29
|
|
|
30
30
|
.dataset-results-count {
|
|
31
31
|
font-weight: bold;
|
|
32
|
-
}
|
|
32
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import '~@cmsgov/design-system/dist/scss/settings/variables/color';
|
|
2
2
|
|
|
3
3
|
.dc-c-footer {
|
|
4
4
|
background-color: white;
|
|
@@ -43,7 +43,12 @@
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.dc-c-emailupdates {
|
|
46
|
-
background-image: linear-gradient(
|
|
46
|
+
background-image: linear-gradient(
|
|
47
|
+
35deg,
|
|
48
|
+
$color-primary-darkest,
|
|
49
|
+
$color-primary-darker,
|
|
50
|
+
$color-primary
|
|
51
|
+
);
|
|
47
52
|
color: $color-white;
|
|
48
53
|
}
|
|
49
54
|
.dc-c-footer--svg-icon {
|
|
@@ -60,15 +65,14 @@
|
|
|
60
65
|
}
|
|
61
66
|
|
|
62
67
|
.fa-circle {
|
|
63
|
-
fill: #
|
|
68
|
+
fill: #6f757c;
|
|
64
69
|
}
|
|
65
70
|
|
|
66
71
|
.fa-inverse {
|
|
67
72
|
font-size: 25px;
|
|
68
73
|
padding-left: 2px;
|
|
69
|
-
fill
|
|
74
|
+
fill: $color-white;
|
|
70
75
|
}
|
|
71
|
-
|
|
72
76
|
}
|
|
73
77
|
.svg-inline--fa {
|
|
74
78
|
bottom: 0;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import '~@cmsgov/design-system/dist/scss/settings/variables/color';
|
|
2
2
|
|
|
3
3
|
.dc-c-mobile-menu--open {
|
|
4
4
|
color: $color-white;
|
|
5
5
|
text-decoration: none;
|
|
6
6
|
&::before {
|
|
7
|
-
font-family:
|
|
8
|
-
content:
|
|
7
|
+
font-family: 'Font Awesome 5 Pro';
|
|
8
|
+
content: '\f0c9';
|
|
9
9
|
color: $color-white;
|
|
10
10
|
font-size: 18px;
|
|
11
11
|
padding-right: 10px;
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
padding-left: 0;
|
|
27
27
|
padding-bottom: 16px;
|
|
28
28
|
&::before {
|
|
29
|
-
font-family:
|
|
30
|
-
content:
|
|
29
|
+
font-family: 'Font Awesome 5 Pro';
|
|
30
|
+
content: '\f00d';
|
|
31
31
|
color: $color-white;
|
|
32
32
|
font-size: 18px;
|
|
33
33
|
padding-right: 10px;
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
width: 48px;
|
|
79
79
|
height: 2px;
|
|
80
80
|
background: $color-primary-alt-light;
|
|
81
|
-
content:
|
|
81
|
+
content: '';
|
|
82
82
|
}
|
|
83
83
|
ul {
|
|
84
84
|
list-style: none;
|
|
@@ -100,8 +100,8 @@
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
.has-submenu > button::after {
|
|
103
|
-
font-family:
|
|
104
|
-
content:
|
|
103
|
+
font-family: 'Font Awesome 5 Pro';
|
|
104
|
+
content: '\f105';
|
|
105
105
|
color: $color-white;
|
|
106
106
|
font-size: 18px;
|
|
107
107
|
padding-right: 10px;
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
font-weight: lighter;
|
|
116
116
|
}
|
|
117
117
|
.has-submenu.open > button::after {
|
|
118
|
-
content:
|
|
118
|
+
content: '\f107';
|
|
119
119
|
}
|
|
120
120
|
.dc-c-header--mobile-links {
|
|
121
121
|
button {
|
|
@@ -157,8 +157,8 @@
|
|
|
157
157
|
display: inline-block;
|
|
158
158
|
}
|
|
159
159
|
a::before {
|
|
160
|
-
font-family:
|
|
161
|
-
content:
|
|
160
|
+
font-family: 'Font Awesome 5 Pro';
|
|
161
|
+
content: '\f33e';
|
|
162
162
|
color: #323a45;
|
|
163
163
|
font-size: 18px;
|
|
164
164
|
padding-right: 10px;
|
|
@@ -340,8 +340,8 @@ div.ds-c-dialog button {
|
|
|
340
340
|
top: 24px;
|
|
341
341
|
right: 24px;
|
|
342
342
|
&::after {
|
|
343
|
-
font-family:
|
|
344
|
-
content:
|
|
343
|
+
font-family: 'Font Awesome 5 Pro';
|
|
344
|
+
content: '\f00d';
|
|
345
345
|
height: 22px;
|
|
346
346
|
font-size: 20px;
|
|
347
347
|
line-height: 20px;
|
|
@@ -357,8 +357,8 @@ div.ds-c-dialog button {
|
|
|
357
357
|
|
|
358
358
|
.dc-c-search-modal--button {
|
|
359
359
|
&::before {
|
|
360
|
-
font-family:
|
|
361
|
-
content:
|
|
360
|
+
font-family: 'Font Awesome 5 Pro';
|
|
361
|
+
content: '\f002';
|
|
362
362
|
color: $color-white;
|
|
363
363
|
font-size: 18px;
|
|
364
364
|
padding-right: 10px;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@import
|
|
2
|
-
@import
|
|
3
|
-
@import
|
|
4
|
-
@import
|
|
5
|
-
@import
|
|
6
|
-
@import
|
|
1
|
+
@import './dataset-search.scss';
|
|
2
|
+
@import './footer.scss';
|
|
3
|
+
@import './header.scss';
|
|
4
|
+
@import './filtered-resource.scss';
|
|
5
|
+
@import './dataset.scss';
|
|
6
|
+
@import './swagger.scss';
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
const CloseIcon = () => (
|
|
4
|
-
<svg
|
|
4
|
+
<svg
|
|
5
|
+
width="15px"
|
|
6
|
+
height="15px"
|
|
7
|
+
viewBox="0 0 15 15"
|
|
8
|
+
version="1.1"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
xmlnsXlink="http://www.w3.org/1999/xlink"
|
|
11
|
+
>
|
|
5
12
|
<title>Artboard</title>
|
|
6
13
|
<desc>Created with Sketch.</desc>
|
|
7
14
|
<g id="Artboard" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
|
|
8
|
-
|
|
15
|
+
<path
|
|
16
|
+
d="M14.6467778,11.2126037 C14.8818403,11.4476661 15,11.7342663 15,12.0711472 C15,12.4080282 14.8818403,12.6946283 14.6467778,12.9296908 L12.9296908,14.6467778 C12.6933713,14.8830973 12.4067711,15.001257 12.0698902,15.001257 C11.7342663,15.001257 11.4476661,14.8830973 11.2126037,14.6467778 L7.49937149,10.9348026 L3.7873963,14.6467778 C3.55233386,14.8830973 3.26573368,15.001257 2.92885276,15.001257 C2.59197184,15.001257 2.30662868,14.8830973 2.07030923,14.6467778 L0.353222157,12.9296908 C0.116902707,12.6946283 0,12.4080282 0,12.0711472 C0,11.7342663 0.116902707,11.4476661 0.353222157,11.2126037 L4.06519735,7.50062851 L0.353222157,3.78865331 C0.116902707,3.55233386 0,3.2669907 0,2.92885276 C0,2.59322886 0.116902707,2.30662868 0.353222157,2.07156624 L2.07030923,0.353222157 C2.30662868,0.118159725 2.59197184,0 2.92885276,0 C3.26573368,0 3.55233386,0.118159725 3.7873963,0.353222157 L7.49937149,4.06519735 L11.2126037,0.353222157 C11.4476661,0.118159725 11.7342663,0 12.0698902,0 C12.4067711,0 12.6933713,0.118159725 12.9296908,0.353222157 L14.6467778,2.07156624 C14.8818403,2.30662868 15,2.59322886 15,2.92885276 C15,3.2669907 14.8818403,3.55233386 14.6467778,3.78865331 L10.9348026,7.50062851 L14.6467778,11.2126037 Z"
|
|
17
|
+
id="Path"
|
|
18
|
+
fill="#000000"
|
|
19
|
+
fill-rule="nonzero"
|
|
20
|
+
></path>
|
|
9
21
|
</g>
|
|
10
22
|
</svg>
|
|
11
|
-
)
|
|
23
|
+
);
|
|
12
24
|
|
|
13
|
-
export default CloseIcon;
|
|
25
|
+
export default CloseIcon;
|
|
@@ -30,7 +30,7 @@ var DataTableRowChanger = function DataTableRowChanger(_ref) {
|
|
|
30
30
|
size: "small",
|
|
31
31
|
variation: "transparent",
|
|
32
32
|
className: "".concat(limit === r ? 'ds-u-font-weight--bold ds-u-border-bottom--2' : '', " ds-u-text-decoration--none ds-u-padding--0 ds-u-margin-right--1")
|
|
33
|
-
}, r,
|
|
33
|
+
}, r, " ", /*#__PURE__*/_react["default"].createElement("span", {
|
|
34
34
|
className: "ds-u-visibility--screen-reader"
|
|
35
35
|
}, "rows per page"));
|
|
36
36
|
}));
|
|
@@ -40,7 +40,7 @@ var DatasetAdditionalInformation = function DatasetAdditionalInformation(_ref) {
|
|
|
40
40
|
to: "/datasets?keyword[]=".concat(k.data)
|
|
41
41
|
}, k.data);
|
|
42
42
|
} else {
|
|
43
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, ",
|
|
43
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, ",", ' ', /*#__PURE__*/_react["default"].createElement(_router.Link, {
|
|
44
44
|
key: k.data,
|
|
45
45
|
to: "/datasets?keyword[]=".concat(k.data)
|
|
46
46
|
}, k.data));
|
|
@@ -44,7 +44,7 @@ describe('<DatasetSearchFacets />', function () {
|
|
|
44
44
|
}
|
|
45
45
|
}));
|
|
46
46
|
expect(_react2.screen.getByRole('button', {
|
|
47
|
-
name:
|
|
47
|
+
name: 'Facets'
|
|
48
48
|
})).toBeInTheDocument();
|
|
49
49
|
expect(_react2.screen.getByLabelText('facet-1 (2)')).toBeInTheDocument();
|
|
50
50
|
expect(_react2.screen.getByLabelText('facet-2 (3)')).toBeInTheDocument();
|
|
@@ -61,14 +61,14 @@ describe('<DatasetSearchFacets />', function () {
|
|
|
61
61
|
expect(_react2.screen.getAllByRole('checkbox')).toHaveLength(2);
|
|
62
62
|
|
|
63
63
|
_react2.fireEvent.click(_react2.screen.getByRole('button', {
|
|
64
|
-
name:
|
|
64
|
+
name: 'Facets'
|
|
65
65
|
}));
|
|
66
66
|
|
|
67
67
|
expect(_react2.screen.queryByLabelText('facet-1 (2)')).toBeNull();
|
|
68
68
|
expect(_react2.screen.queryAllByRole('checkbox')).toHaveLength(0);
|
|
69
69
|
|
|
70
70
|
_react2.fireEvent.click(_react2.screen.getByRole('button', {
|
|
71
|
-
name:
|
|
71
|
+
name: 'Facets'
|
|
72
72
|
}));
|
|
73
73
|
|
|
74
74
|
expect(_react2.screen.getAllByRole('checkbox')).toHaveLength(2);
|
|
@@ -11,11 +11,11 @@ require("@testing-library/jest-dom/extend-expect");
|
|
|
11
11
|
var _index = _interopRequireDefault(require("./index"));
|
|
12
12
|
|
|
13
13
|
var singleItem = {
|
|
14
|
-
title:
|
|
15
|
-
modified:
|
|
16
|
-
description:
|
|
17
|
-
theme: [
|
|
18
|
-
keyword: [
|
|
14
|
+
title: 'Dataset Title',
|
|
15
|
+
modified: '2020-10-22',
|
|
16
|
+
description: 'This is my description.',
|
|
17
|
+
theme: ['dkan'],
|
|
18
|
+
keyword: ['my keyword']
|
|
19
19
|
};
|
|
20
20
|
describe('<DatasetSearchListItem />', function () {
|
|
21
21
|
test('Renders correctly', function () {
|
|
@@ -33,10 +33,10 @@ describe('<DatasetSearchListItem />', function () {
|
|
|
33
33
|
expect(getByText(listItemOptions[idx])).toBeInTheDocument();
|
|
34
34
|
});
|
|
35
35
|
expect(_react2.screen.getByRole('heading', {
|
|
36
|
-
name:
|
|
36
|
+
name: 'Dataset Title'
|
|
37
37
|
})).toBeInTheDocument();
|
|
38
38
|
expect(_react2.screen.getByRole('link', {
|
|
39
|
-
name:
|
|
39
|
+
name: 'Dataset Title'
|
|
40
40
|
})).toBeInTheDocument();
|
|
41
41
|
expect(_react2.screen.getByText('Updated October 22, 2020')).toBeInTheDocument();
|
|
42
42
|
expect(_react2.screen.getByText('This is my description.')).toBeInTheDocument();
|
|
@@ -55,17 +55,17 @@ var Hero = function Hero(_ref) {
|
|
|
55
55
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
56
56
|
className: "ds-u-padding--0 ds-u-margin-right--1",
|
|
57
57
|
style: {
|
|
58
|
-
flex:
|
|
59
|
-
maxWidth:
|
|
58
|
+
flex: '1 1 100%',
|
|
59
|
+
maxWidth: '100%'
|
|
60
60
|
}
|
|
61
61
|
}, /*#__PURE__*/_react["default"].createElement(_designSystem.TextField, {
|
|
62
62
|
label: textfieldLabel,
|
|
63
63
|
labelClassName: "ds-u-visibility--screen-reader",
|
|
64
64
|
name: "search_text_input",
|
|
65
65
|
style: {
|
|
66
|
-
maxWidth:
|
|
67
|
-
height:
|
|
68
|
-
margin:
|
|
66
|
+
maxWidth: 'none',
|
|
67
|
+
height: '61px',
|
|
68
|
+
margin: '0 20px 0 0'
|
|
69
69
|
},
|
|
70
70
|
onChange: function onChange(e) {
|
|
71
71
|
return setSearchValue(e.target.value);
|
|
@@ -37,42 +37,42 @@ function buildOperatorOptions(type) {
|
|
|
37
37
|
|
|
38
38
|
case 'string':
|
|
39
39
|
return [{
|
|
40
|
-
label:
|
|
41
|
-
value:
|
|
40
|
+
label: 'Is',
|
|
41
|
+
value: '='
|
|
42
42
|
}, {
|
|
43
|
-
label:
|
|
44
|
-
value:
|
|
43
|
+
label: 'Contains',
|
|
44
|
+
value: 'like'
|
|
45
45
|
}, {
|
|
46
|
-
label:
|
|
47
|
-
value:
|
|
46
|
+
label: 'Is Not',
|
|
47
|
+
value: '<>'
|
|
48
48
|
}, {
|
|
49
|
-
label:
|
|
50
|
-
value:
|
|
49
|
+
label: 'Or',
|
|
50
|
+
value: 'in'
|
|
51
51
|
}];
|
|
52
52
|
|
|
53
53
|
case 'date':
|
|
54
54
|
return [{
|
|
55
|
-
label:
|
|
56
|
-
value:
|
|
55
|
+
label: 'Is',
|
|
56
|
+
value: '='
|
|
57
57
|
}, {
|
|
58
|
-
label:
|
|
59
|
-
value:
|
|
58
|
+
label: 'Is Not',
|
|
59
|
+
value: '<>'
|
|
60
60
|
}, {
|
|
61
|
-
label:
|
|
62
|
-
value:
|
|
61
|
+
label: 'Greater Than',
|
|
62
|
+
value: '>'
|
|
63
63
|
}, {
|
|
64
|
-
label:
|
|
65
|
-
value:
|
|
64
|
+
label: 'Less Than',
|
|
65
|
+
value: '<'
|
|
66
66
|
}];
|
|
67
67
|
|
|
68
68
|
default:
|
|
69
69
|
// These 2 should be safe for all data types
|
|
70
70
|
return [{
|
|
71
|
-
label:
|
|
72
|
-
value:
|
|
71
|
+
label: 'Is',
|
|
72
|
+
value: '='
|
|
73
73
|
}, {
|
|
74
|
-
label:
|
|
75
|
-
value:
|
|
74
|
+
label: 'Is Not',
|
|
75
|
+
value: '<>'
|
|
76
76
|
}];
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -84,7 +84,7 @@ function cleanText(value, operator) {
|
|
|
84
84
|
newValue = newValue.join(',');
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
return newValue.replace(/(^\%+|\%+$)/
|
|
87
|
+
return newValue.replace(/(^\%+|\%+$)/gm, '');
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
var ResourceConditionField = function ResourceConditionField(_ref) {
|
|
@@ -90,7 +90,7 @@ var ResourceFilter = function ResourceFilter(_ref) {
|
|
|
90
90
|
cond.value = cond.value.join();
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
cond.value = cond.value.replace(/(^\%+|\%+$)/
|
|
93
|
+
cond.value = cond.value.replace(/(^\%+|\%+$)/gm, '');
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
if (cond.operator.toLowerCase() === 'like') {
|
|
@@ -98,7 +98,7 @@ var ResourceFilter = function ResourceFilter(_ref) {
|
|
|
98
98
|
cond.value = cond.value.join();
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
var cleanedValue = cond.value.replace(/(^\%+|\%+$)/
|
|
101
|
+
var cleanedValue = cond.value.replace(/(^\%+|\%+$)/gm, '');
|
|
102
102
|
cond.value = "%".concat(cleanedValue, "%");
|
|
103
103
|
}
|
|
104
104
|
|
|
@@ -110,7 +110,7 @@ var ResourceFilter = function ResourceFilter(_ref) {
|
|
|
110
110
|
|
|
111
111
|
if (Array.isArray(cond.value)) {
|
|
112
112
|
cond.value = cond.value.map(function (v) {
|
|
113
|
-
return v.trim().replace(/(^\%+|\%+$)/
|
|
113
|
+
return v.trim().replace(/(^\%+|\%+$)/gm, '');
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -24,26 +24,26 @@ var _index = _interopRequireDefault(require("./index"));
|
|
|
24
24
|
* @jest-environment jsdom
|
|
25
25
|
*/
|
|
26
26
|
// import { act } from 'react-dom/test-utils';
|
|
27
|
-
var columns = [
|
|
27
|
+
var columns = ['column_1', 'column_2', 'column_3'];
|
|
28
28
|
var sampleDefaultCondition = {
|
|
29
29
|
operator: '',
|
|
30
30
|
property: '',
|
|
31
31
|
value: ''
|
|
32
32
|
};
|
|
33
33
|
var sampleSchema = {
|
|
34
|
-
|
|
34
|
+
'1234-abcd': {
|
|
35
35
|
fields: {
|
|
36
36
|
column_1: {
|
|
37
|
-
description:
|
|
38
|
-
type:
|
|
37
|
+
description: '',
|
|
38
|
+
type: 'text'
|
|
39
39
|
},
|
|
40
40
|
column_2: {
|
|
41
|
-
description:
|
|
42
|
-
type:
|
|
41
|
+
description: '',
|
|
42
|
+
type: 'text'
|
|
43
43
|
},
|
|
44
44
|
column_3: {
|
|
45
|
-
description:
|
|
46
|
-
type:
|
|
45
|
+
description: '',
|
|
46
|
+
type: 'text'
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -72,7 +72,7 @@ var sampleResource2 = {
|
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
var BasicFilter = /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
75
|
-
id:
|
|
75
|
+
id: '1234-abcd',
|
|
76
76
|
filterOpen: true,
|
|
77
77
|
setFilterOpen: function setFilterOpen() {
|
|
78
78
|
return !filterOpen;
|
|
@@ -83,7 +83,7 @@ var BasicFilter = /*#__PURE__*/_react["default"].createElement(_index["default"]
|
|
|
83
83
|
});
|
|
84
84
|
|
|
85
85
|
var PreFilledFilter = /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
86
|
-
id:
|
|
86
|
+
id: '1234-abcd',
|
|
87
87
|
filterOpen: true,
|
|
88
88
|
setFilterOpen: function setFilterOpen() {
|
|
89
89
|
return !filterOpen;
|
|
@@ -100,7 +100,7 @@ var WrapperComponent = function WrapperComponent() {
|
|
|
100
100
|
setConditions = _React$useState2[1];
|
|
101
101
|
|
|
102
102
|
return /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
103
|
-
id:
|
|
103
|
+
id: '1234-abcd',
|
|
104
104
|
filterOpen: true,
|
|
105
105
|
setFilterOpen: function setFilterOpen() {
|
|
106
106
|
return !filterOpen;
|
|
@@ -126,10 +126,10 @@ describe('Resource Filter Functions', function () {
|
|
|
126
126
|
(0, _react2.render)(BasicFilter);
|
|
127
127
|
expect(_react2.screen.getByRole('heading', {
|
|
128
128
|
level: 3,
|
|
129
|
-
name:
|
|
129
|
+
name: 'Add filters'
|
|
130
130
|
})).toBeInTheDocument();
|
|
131
131
|
expect(_react2.screen.getByRole('button', {
|
|
132
|
-
name:
|
|
132
|
+
name: 'Close help drawer'
|
|
133
133
|
})).toBeInTheDocument();
|
|
134
134
|
|
|
135
135
|
case 3:
|
|
@@ -147,10 +147,10 @@ describe('Resource Filter Functions', function () {
|
|
|
147
147
|
(0, _react2.render)(BasicFilter);
|
|
148
148
|
expect(_react2.screen.getByRole('heading', {
|
|
149
149
|
level: 4,
|
|
150
|
-
name:
|
|
150
|
+
name: 'Update actions'
|
|
151
151
|
})).toBeInTheDocument();
|
|
152
152
|
expect(_react2.screen.getByRole('button', {
|
|
153
|
-
name:
|
|
153
|
+
name: 'Update table'
|
|
154
154
|
})).toBeInTheDocument();
|
|
155
155
|
|
|
156
156
|
case 3:
|
|
@@ -167,7 +167,7 @@ describe('Resource Filter Functions', function () {
|
|
|
167
167
|
case 0:
|
|
168
168
|
(0, _react2.render)(BasicFilter);
|
|
169
169
|
expect(_react2.screen.queryByRole('button', {
|
|
170
|
-
name:
|
|
170
|
+
name: 'Remove all filters'
|
|
171
171
|
})).not.toBeInTheDocument();
|
|
172
172
|
|
|
173
173
|
case 2:
|
|
@@ -189,10 +189,10 @@ describe('Resource Filter Functions', function () {
|
|
|
189
189
|
expect(_react2.screen.getByDisplayValue('Select column')).toBeInTheDocument();
|
|
190
190
|
expect(_react2.screen.getByDisplayValue('--')).toBeInTheDocument();
|
|
191
191
|
expect(_react2.screen.getByRole('button', {
|
|
192
|
-
name:
|
|
192
|
+
name: 'Remove filter'
|
|
193
193
|
})).toBeInTheDocument();
|
|
194
194
|
expect(_react2.screen.getByRole('button', {
|
|
195
|
-
name:
|
|
195
|
+
name: '+ Add another filter'
|
|
196
196
|
})).toBeInTheDocument();
|
|
197
197
|
|
|
198
198
|
case 8:
|