@urbanos/react-discovery-ui 2.1.52 → 2.1.54
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/lib/components/collapsable-box/collapsable-box.scss +2 -1
- package/lib/components/dataset-api-doc/api-example.js +1 -1
- package/lib/components/dataset-api-doc/dataset-api-doc.js +6 -3
- package/lib/components/dataset-dictionary/dataset-dictionary.js +2 -1
- package/lib/components/dataset-metadata/dataset-metadata.js +26 -15
- package/lib/components/dataset-recommendations/dataset-recommendations.js +2 -1
- package/lib/components/generic-elements/arrow-button/arrow-button.js +2 -4
- package/lib/components/generic-elements/chart-icon/index.js +2 -4
- package/lib/components/generic-elements/folder-icon/index.js +3 -5
- package/lib/components/generic-elements/loading-element/loading-element.js +2 -4
- package/lib/components/generic-elements/plus-icon/index.js +2 -5
- package/lib/components/generic-elements/sql-icon/index.js +2 -4
- package/lib/components/generic-elements/visualize-button/visualize-button.js +2 -4
- package/lib/components/organization/organization.js +2 -1
- package/lib/components/query-form/query-form.js +4 -4
- package/lib/components/query-form/query-form.test.js +3 -3
- package/lib/components/recommendation-list/recommendation-list.js +2 -1
- package/lib/components/streaming-api-doc/streaming-api-doc.js +4 -2
- package/lib/pages/chart-view/chart-view.js +2 -1
- package/lib/pages/chart-view/chart-view.test.js +3 -3
- package/lib/pages/dataset-view/dataset-view.js +4 -2
- package/lib/pages/login-view/login-view.test.js +1 -1
- package/lib/pages/oauth-view/oauth-view.test.js +1 -1
- package/lib/pages/user-profile-view/user-profile-view.test.js +1 -1
- package/lib/search-params/search-params-manager.js +29 -4
- package/lib/search-params/search-params-manager.test.js +3 -3
- package/lib/store/sagas/login-saga.test.js +3 -3
- package/lib/store/sagas/visualization-saga.js +33 -33
- package/lib/store/sagas/visualization-saga.test.js +7 -7
- package/lib/utils/geojson-utils.test.js +1 -1
- package/lib/utils/modified-date-string-builder.js +1 -1
- package/package.json +5 -5
|
@@ -65,7 +65,7 @@ function renderHeader(header) {
|
|
|
65
65
|
className: "pill"
|
|
66
66
|
}, header.name)), /*#__PURE__*/React.createElement("td", {
|
|
67
67
|
className: "required-marker"
|
|
68
|
-
}, header.required ?
|
|
68
|
+
}, header.required ? 'Yes' : 'No'), /*#__PURE__*/React.createElement("td", null, header.default), /*#__PURE__*/React.createElement("td", null, header.description));
|
|
69
69
|
}
|
|
70
70
|
function renderExamples(examples, url) {
|
|
71
71
|
examples = examples.map(function (example) {
|
|
@@ -69,17 +69,20 @@ function freestyleDescription() {
|
|
|
69
69
|
role: "link",
|
|
70
70
|
className: "primary-color",
|
|
71
71
|
href: "https://en.wikipedia.org/wiki/SQL_syntax",
|
|
72
|
-
target: "_blank"
|
|
72
|
+
target: "_blank",
|
|
73
|
+
rel: "noreferrer"
|
|
73
74
|
}, "SQL Syntax (Wikipedia)")), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("a", {
|
|
74
75
|
role: "link",
|
|
75
76
|
className: "primary-color",
|
|
76
77
|
href: "https://www.w3schools.com/sql/sql_quickref.asp",
|
|
77
|
-
target: "_blank"
|
|
78
|
+
target: "_blank",
|
|
79
|
+
rel: "noreferrer"
|
|
78
80
|
}, "Quick Reference (W3 Schools)")), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("a", {
|
|
79
81
|
role: "link",
|
|
80
82
|
className: "primary-color",
|
|
81
83
|
href: "https://prestodb.github.io/docs/current/sql/select.html",
|
|
82
|
-
target: "_blank"
|
|
84
|
+
target: "_blank",
|
|
85
|
+
rel: "noreferrer"
|
|
83
86
|
}, "PrestoDB Specific Syntax"))));
|
|
84
87
|
}
|
|
85
88
|
function renderHeader() {
|
|
@@ -158,7 +158,8 @@ var viewLink = function viewLink(datasetId) {
|
|
|
158
158
|
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
159
159
|
href: "".concat(window.DISC_API_URL, "/api/v1/dataset/").concat(datasetId, "/dictionary"),
|
|
160
160
|
target: "_blank",
|
|
161
|
-
role: "link"
|
|
161
|
+
role: "link",
|
|
162
|
+
rel: "noreferrer"
|
|
162
163
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
163
164
|
className: "view-text"
|
|
164
165
|
}, "View as JSON")));
|
|
@@ -35,7 +35,7 @@ var MetadataTable = function MetadataTable(_ref) {
|
|
|
35
35
|
},
|
|
36
36
|
cell: function cell(info) {
|
|
37
37
|
var _info$getValue;
|
|
38
|
-
return (_info$getValue = info.getValue()) !== null && _info$getValue !== void 0 ? _info$getValue : null;
|
|
38
|
+
return (_info$getValue = info.getValue()) !== null && _info$getValue !== void 0 ? _info$getValue : /*#__PURE__*/_react.default.createElement("span", null, "Unavailable");
|
|
39
39
|
}
|
|
40
40
|
}];
|
|
41
41
|
}, []);
|
|
@@ -88,6 +88,7 @@ var MetadataTable = function MetadataTable(_ref) {
|
|
|
88
88
|
})));
|
|
89
89
|
};
|
|
90
90
|
var _default = exports.default = function _default(_ref2) {
|
|
91
|
+
var _dataset$homepage, _dataset$sourceUrl, _dataset$license;
|
|
91
92
|
var dataset = _ref2.dataset;
|
|
92
93
|
if (!dataset) return /*#__PURE__*/_react.default.createElement("div", null);
|
|
93
94
|
var referenceUrls = dataset.referenceUrls || [];
|
|
@@ -117,11 +118,13 @@ var _default = exports.default = function _default(_ref2) {
|
|
|
117
118
|
Value: dataset.publishFrequency
|
|
118
119
|
}, {
|
|
119
120
|
Field: 'Data Dictionary URL',
|
|
120
|
-
Value: /*#__PURE__*/_react.default.createElement("a", {
|
|
121
|
+
Value: dataset.describedByUrl ? /*#__PURE__*/_react.default.createElement("a", {
|
|
121
122
|
role: "link",
|
|
122
123
|
href: dataset.describedByUrl,
|
|
123
|
-
target: "_blank"
|
|
124
|
-
|
|
124
|
+
target: "_blank",
|
|
125
|
+
"aria-label": "Data Dictionary URL",
|
|
126
|
+
rel: "noreferrer"
|
|
127
|
+
}, dataset.describedByUrl) : /*#__PURE__*/_react.default.createElement("span", null, "Unavailable")
|
|
125
128
|
}, {
|
|
126
129
|
Field: 'Data Dictionary Type',
|
|
127
130
|
Value: dataset.describedByMimeType
|
|
@@ -133,39 +136,47 @@ var _default = exports.default = function _default(_ref2) {
|
|
|
133
136
|
Value: dataset.language
|
|
134
137
|
}, {
|
|
135
138
|
Field: 'Homepage URL',
|
|
136
|
-
Value: /*#__PURE__*/_react.default.createElement("a", {
|
|
139
|
+
Value: dataset.homepage ? /*#__PURE__*/_react.default.createElement("a", {
|
|
137
140
|
role: "link",
|
|
138
141
|
href: dataset.homepage,
|
|
139
|
-
target: "_blank"
|
|
140
|
-
|
|
142
|
+
target: "_blank",
|
|
143
|
+
"aria-label": "Homepage URL",
|
|
144
|
+
rel: "noreferrer"
|
|
145
|
+
}, (_dataset$homepage = dataset.homepage) !== null && _dataset$homepage !== void 0 ? _dataset$homepage : 'Unavailable') : /*#__PURE__*/_react.default.createElement("span", null, "Unavailable")
|
|
141
146
|
}, {
|
|
142
147
|
Field: 'Related Documents',
|
|
143
|
-
Value: referenceUrls.map(function (url) {
|
|
148
|
+
Value: referenceUrls.length === 0 ? /*#__PURE__*/_react.default.createElement("span", null, "None") : referenceUrls.map(function (url) {
|
|
144
149
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
145
150
|
key: url
|
|
146
151
|
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
147
152
|
role: "link",
|
|
148
153
|
href: url,
|
|
149
|
-
target: "_blank"
|
|
154
|
+
target: "_blank",
|
|
155
|
+
"aria-label": "Related Document URL",
|
|
156
|
+
rel: "noreferrer"
|
|
150
157
|
}, url));
|
|
151
158
|
})
|
|
152
159
|
}, {
|
|
153
160
|
Field: 'Source URL',
|
|
154
|
-
Value: /*#__PURE__*/_react.default.createElement("a", {
|
|
161
|
+
Value: dataset.sourceUrl ? /*#__PURE__*/_react.default.createElement("a", {
|
|
155
162
|
role: "link",
|
|
156
163
|
href: dataset.sourceUrl,
|
|
157
|
-
target: "_blank"
|
|
158
|
-
|
|
164
|
+
target: "_blank",
|
|
165
|
+
"aria-label": "Source URL",
|
|
166
|
+
rel: "noreferrer"
|
|
167
|
+
}, (_dataset$sourceUrl = dataset.sourceUrl) !== null && _dataset$sourceUrl !== void 0 ? _dataset$sourceUrl : 'Unavailable') : /*#__PURE__*/_react.default.createElement("span", null, "Unavailable")
|
|
159
168
|
}, {
|
|
160
169
|
Field: 'Source Type',
|
|
161
170
|
Value: dataset.sourceType
|
|
162
171
|
}, {
|
|
163
172
|
Field: 'License',
|
|
164
|
-
Value: /*#__PURE__*/_react.default.createElement("a", {
|
|
173
|
+
Value: dataset.license ? /*#__PURE__*/_react.default.createElement("a", {
|
|
165
174
|
role: "link",
|
|
166
175
|
href: dataset.license,
|
|
167
|
-
target: "_blank"
|
|
168
|
-
|
|
176
|
+
target: "_blank",
|
|
177
|
+
"aria-label": "License URL",
|
|
178
|
+
rel: "noreferrer"
|
|
179
|
+
}, (_dataset$license = dataset.license) !== null && _dataset$license !== void 0 ? _dataset$license : 'Unavailable') : /*#__PURE__*/_react.default.createElement("span", null, "Unavailable")
|
|
169
180
|
}, {
|
|
170
181
|
Field: 'Category',
|
|
171
182
|
Value: dataset.catagories
|
|
@@ -35,7 +35,8 @@ var DatasetRecommendations = function DatasetRecommendations(props) {
|
|
|
35
35
|
}, /*#__PURE__*/React.createElement("a", {
|
|
36
36
|
role: "link",
|
|
37
37
|
href: _utils.RecommendationUtils.getDatasetUrl(rec),
|
|
38
|
-
target: "_blank"
|
|
38
|
+
target: "_blank",
|
|
39
|
+
rel: "noreferrer"
|
|
39
40
|
}, rec.dataTitle));
|
|
40
41
|
}))));
|
|
41
42
|
};
|
|
@@ -4,9 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _arrow = _interopRequireDefault(require("../../../assets/arrow.svg"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
var arrow = "<svg viewBox=\"0 0 8 12\" xmlns=\"http://www.w3.org/2000/svg\"><g id=\"arrow-designs\" stroke=\"none\" stroke-width=\"1\" transform=\"rotate(90 4 4)\"><path id=\"arrow-path-1\" d=\"M1.41.59L6 5.17 10.59.59 12 2 6 8 0 2z\"/></g></svg>";
|
|
10
9
|
var ENABLED_COLOR = '#000000';
|
|
11
10
|
var DISABLED_COLOR = '#595959';
|
|
12
11
|
var _default = exports.default = function _default(_ref) {
|
|
@@ -20,9 +19,8 @@ var _default = exports.default = function _default(_ref) {
|
|
|
20
19
|
disabled: disabled,
|
|
21
20
|
className: "".concat(className, " ").concat(disabled ? 'disabled' : ''),
|
|
22
21
|
onClick: onClick
|
|
23
|
-
}, /*#__PURE__*/React.createElement(
|
|
22
|
+
}, /*#__PURE__*/React.createElement(_arrow.default, {
|
|
24
23
|
className: innerClass,
|
|
25
|
-
svg: arrow,
|
|
26
24
|
height: "inherit",
|
|
27
25
|
fill: disabled ? DISABLED_COLOR : ENABLED_COLOR,
|
|
28
26
|
accessibilityDesc: "Arrow"
|
|
@@ -4,18 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _chart = _interopRequireDefault(require("../../../assets/chart.svg"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
var chartSVG = "<svg id=\"chartSVG-Layer_1\" data-name=\"Layer 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 65.5 28\"><path d=\"M0 17.5h13V28H0zM17.5 0h13v28h-13zM35 12.5h13V28H35zM52.5 5h13v23h-13z\"/></svg>";
|
|
10
9
|
var _default = exports.default = function _default(_ref) {
|
|
11
10
|
var className = _ref.className;
|
|
12
11
|
return /*#__PURE__*/React.createElement("span", {
|
|
13
12
|
className: className
|
|
14
|
-
}, /*#__PURE__*/React.createElement(
|
|
13
|
+
}, /*#__PURE__*/React.createElement(_chart.default, {
|
|
15
14
|
style: {
|
|
16
15
|
marginLeft: '.3rem'
|
|
17
16
|
},
|
|
18
|
-
svg: chartSVG,
|
|
19
17
|
height: "14px",
|
|
20
18
|
width: "25px",
|
|
21
19
|
accessibilityDesc: "Chart"
|
|
@@ -4,18 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _folder_icon = _interopRequireDefault(require("../../../assets/folder_icon.svg"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
var folderSVG = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\"><path d=\"M90 50H30L10 80h60z\"/><path d=\"M70 40V30H50L40 20H10v40l13.333-20z\"/></svg>";
|
|
10
9
|
var _default = exports.default = function _default(_ref) {
|
|
11
10
|
var className = _ref.className,
|
|
12
11
|
_ref$accessibilityDes = _ref.accessibilityDesc,
|
|
13
|
-
accessibilityDesc = _ref$accessibilityDes === void 0 ?
|
|
12
|
+
accessibilityDesc = _ref$accessibilityDes === void 0 ? 'Folder Icon' : _ref$accessibilityDes;
|
|
14
13
|
return /*#__PURE__*/React.createElement("span", {
|
|
15
14
|
className: className
|
|
16
|
-
}, /*#__PURE__*/React.createElement(
|
|
15
|
+
}, /*#__PURE__*/React.createElement(_folder_icon.default, {
|
|
17
16
|
className: "folder-icon",
|
|
18
|
-
svg: folderSVG,
|
|
19
17
|
height: "1.6rem",
|
|
20
18
|
width: "1.6rem",
|
|
21
19
|
accessibilityDesc: accessibilityDesc
|
|
@@ -5,17 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
require("./loading-element.scss");
|
|
8
|
-
var
|
|
8
|
+
var _loadingicon = _interopRequireDefault(require("../../../assets/loadingicon.svg"));
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
var loadingIcon = "<svg class=\"lds-spin\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\" style=\"background:0 0\"><g transform=\"translate(80 50)\"><circle r=\"10\" fill=\"#28292f\" transform=\"scale(1.01177)\"><animateTransform attributeName=\"transform\" type=\"scale\" begin=\"-0.875s\" values=\"1.1 1.1;1 1\" keyTimes=\"0;1\" dur=\"1s\" repeatCount=\"indefinite\"/><animate attributeName=\"fill-opacity\" keyTimes=\"0;1\" dur=\"1s\" repeatCount=\"indefinite\" values=\"1;0\" begin=\"-0.875s\"/></circle></g><g transform=\"rotate(45 -50.355 121.569)\"><circle r=\"10\" fill=\"#28292f\" fill-opacity=\".875\" transform=\"scale(1.02427)\"><animateTransform attributeName=\"transform\" type=\"scale\" begin=\"-0.75s\" values=\"1.1 1.1;1 1\" keyTimes=\"0;1\" dur=\"1s\" repeatCount=\"indefinite\"/><animate attributeName=\"fill-opacity\" keyTimes=\"0;1\" dur=\"1s\" repeatCount=\"indefinite\" values=\"1;0\" begin=\"-0.75s\"/></circle></g><g transform=\"rotate(90 -15 65)\"><circle r=\"10\" fill=\"#28292f\" fill-opacity=\".75\" transform=\"scale(1.03677)\"><animateTransform attributeName=\"transform\" type=\"scale\" begin=\"-0.625s\" values=\"1.1 1.1;1 1\" keyTimes=\"0;1\" dur=\"1s\" repeatCount=\"indefinite\"/><animate attributeName=\"fill-opacity\" keyTimes=\"0;1\" dur=\"1s\" repeatCount=\"indefinite\" values=\"1;0\" begin=\"-0.625s\"/></circle></g><g transform=\"rotate(135 -.355 41.569)\"><circle r=\"10\" fill=\"#28292f\" fill-opacity=\".625\" transform=\"scale(1.04927)\"><animateTransform attributeName=\"transform\" type=\"scale\" begin=\"-0.5s\" values=\"1.1 1.1;1 1\" keyTimes=\"0;1\" dur=\"1s\" repeatCount=\"indefinite\"/><animate attributeName=\"fill-opacity\" keyTimes=\"0;1\" dur=\"1s\" repeatCount=\"indefinite\" values=\"1;0\" begin=\"-0.5s\"/></circle></g><g transform=\"rotate(180 10 25)\"><circle r=\"10\" fill=\"#28292f\" fill-opacity=\".5\" transform=\"scale(1.06177)\"><animateTransform attributeName=\"transform\" type=\"scale\" begin=\"-0.375s\" values=\"1.1 1.1;1 1\" keyTimes=\"0;1\" dur=\"1s\" repeatCount=\"indefinite\"/><animate attributeName=\"fill-opacity\" keyTimes=\"0;1\" dur=\"1s\" repeatCount=\"indefinite\" values=\"1;0\" begin=\"-0.375s\"/></circle></g><g transform=\"rotate(-135 20.355 8.431)\"><circle r=\"10\" fill=\"#28292f\" fill-opacity=\".375\" transform=\"scale(1.07427)\"><animateTransform attributeName=\"transform\" type=\"scale\" begin=\"-0.25s\" values=\"1.1 1.1;1 1\" keyTimes=\"0;1\" dur=\"1s\" repeatCount=\"indefinite\"/><animate attributeName=\"fill-opacity\" keyTimes=\"0;1\" dur=\"1s\" repeatCount=\"indefinite\" values=\"1;0\" begin=\"-0.25s\"/></circle></g><g transform=\"rotate(-90 35 -15)\"><circle r=\"10\" fill=\"#28292f\" fill-opacity=\".25\" transform=\"scale(1.08677)\"><animateTransform attributeName=\"transform\" type=\"scale\" begin=\"-0.125s\" values=\"1.1 1.1;1 1\" keyTimes=\"0;1\" dur=\"1s\" repeatCount=\"indefinite\"/><animate attributeName=\"fill-opacity\" keyTimes=\"0;1\" dur=\"1s\" repeatCount=\"indefinite\" values=\"1;0\" begin=\"-0.125s\"/></circle></g><g transform=\"rotate(-45 70.355 -71.569)\"><circle r=\"10\" fill=\"#28292f\" fill-opacity=\".125\" transform=\"scale(1.09927)\"><animateTransform attributeName=\"transform\" type=\"scale\" begin=\"0s\" values=\"1.1 1.1;1 1\" keyTimes=\"0;1\" dur=\"1s\" repeatCount=\"indefinite\"/><animate attributeName=\"fill-opacity\" keyTimes=\"0;1\" dur=\"1s\" repeatCount=\"indefinite\" values=\"1;0\" begin=\"0s\"/></circle></g></svg>";
|
|
11
10
|
var LoadingElement = function LoadingElement(_ref) {
|
|
12
11
|
var _ref$className = _ref.className,
|
|
13
12
|
className = _ref$className === void 0 ? '' : _ref$className;
|
|
14
13
|
return /*#__PURE__*/React.createElement("loading-element", {
|
|
15
14
|
class: "loading-container ".concat(className),
|
|
16
15
|
"data-testid": "loading-spinner"
|
|
17
|
-
}, /*#__PURE__*/React.createElement(
|
|
18
|
-
svg: loadingIcon,
|
|
16
|
+
}, /*#__PURE__*/React.createElement(_loadingicon.default, {
|
|
19
17
|
accessibilityDesc: "Loading..."
|
|
20
18
|
}));
|
|
21
19
|
};
|
|
@@ -4,16 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _plus = _interopRequireDefault(require("../../../assets/plus.svg"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
var folderSVG = "<svg height=\"100\" width=\"100\" fill=\"#999\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"none\"><defs><path d=\"M51.95 48V21.85q0-.8-.55-1.45-.6-.55-1.45-.55t-1.4.55q-.65.65-.65 1.45V48H21.75q-.85 0-1.4.6-.6.6-.6 1.45t.6 1.4q.55.6 1.4.6H47.9V78.2q0 .85.65 1.4.55.65 1.4.65.85 0 1.45-.65.55-.55.55-1.4V52.05H78.1q.85 0 1.45-.6.6-.55.6-1.4 0-.85-.6-1.45T78.1 48H51.95z\" id=\"folderSVG-a\"/></defs><use xlink:href=\"#folderSVG-a\"/></svg>";
|
|
10
9
|
var _default = exports.default = function _default(_ref) {
|
|
11
10
|
var className = _ref.className;
|
|
12
11
|
return /*#__PURE__*/React.createElement("span", {
|
|
13
12
|
className: className
|
|
14
|
-
}, /*#__PURE__*/React.createElement(
|
|
15
|
-
className: "plus-icon",
|
|
16
|
-
svg: folderSVG,
|
|
13
|
+
}, /*#__PURE__*/React.createElement(_plus.default, {
|
|
17
14
|
height: "1.6rem",
|
|
18
15
|
width: "1.6rem",
|
|
19
16
|
accessibilityDesc: "Plus Icon"
|
|
@@ -4,15 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _blkDatabase = _interopRequireDefault(require("../../../assets/blk-database.svg"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
var sqlSVG = "<svg version=\"1.1\" id=\"sqlSVG-Capa_1\" xmlns=\"http://www.w3.org/2000/svg\" x=\"0\" y=\"0\" viewBox=\"0 0 58.201 58.201\" xml:space=\"preserve\"><path d=\"M31.707 33.07a81.522 81.522 0 01-5.22 0c-7.341-.201-13.191-1.238-17.403-2.717C7.104 29.685 5.409 28.899 4.1 28v9.4c2.846 2.971 12.394 5.711 25 5.711s22.154-2.74 25-5.711V28c-1.318.905-3.028 1.697-5.025 2.367-4.21 1.472-10.048 2.503-17.368 2.703z\"/><path d=\"M4.1 14.889v9.4c2.638 2.754 11.033 5.31 22.286 5.668.115.004.233.005.349.008.326.009.651.018.982.023a79.019 79.019 0 002.766.001c.33-.005.656-.014.982-.023l.349-.008c11.253-.359 19.648-2.915 22.286-5.668v-9.401C49.233 18.232 38.944 20 29.1 20s-20.132-1.768-25-5.111zM53.965 8.542C52.843 4.241 44.215 0 29.1 0 14.023 0 5.404 4.22 4.247 8.51A.97.97 0 004.1 9v2.306C6.937 14.267 16.417 17 29.1 17s22.164-2.733 25-5.694V9a.92.92 0 00-.135-.458zM4.1 41v8.201a.94.94 0 00.117.451c1.181 4.895 11.747 8.549 24.883 8.549 13.106 0 23.655-3.639 24.875-8.516a.993.993 0 00.125-.484v-8.199c-4.135 2.911-12.655 5.199-25 5.199-12.346 0-20.866-2.29-25-5.201z\"/></svg>";
|
|
10
9
|
var _default = exports.default = function _default(_ref) {
|
|
11
10
|
var className = _ref.className;
|
|
12
11
|
return /*#__PURE__*/React.createElement("span", {
|
|
13
12
|
className: className
|
|
14
|
-
}, /*#__PURE__*/React.createElement(
|
|
15
|
-
svg: sqlSVG,
|
|
13
|
+
}, /*#__PURE__*/React.createElement(_blkDatabase.default, {
|
|
16
14
|
height: "14px",
|
|
17
15
|
width: "14px",
|
|
18
16
|
accessibilityDesc: "Sql Icon"
|
|
@@ -5,11 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
require("./visualize-button.scss");
|
|
8
|
-
var
|
|
8
|
+
var _chart = _interopRequireDefault(require("../../../assets/chart.svg"));
|
|
9
9
|
var _routes = _interopRequireDefault(require("../../../routes"));
|
|
10
10
|
var _generatedLink = require("../generated-link");
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
var chart = "<svg id=\"chart-Layer_1\" data-name=\"Layer 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 65.5 28\"><path d=\"M0 17.5h13V28H0zM17.5 0h13v28h-13zM35 12.5h13V28H35zM52.5 5h13v23h-13z\"/></svg>";
|
|
13
12
|
var _default = exports.default = function _default(_ref) {
|
|
14
13
|
var organizationName = _ref.organizationName,
|
|
15
14
|
datasetName = _ref.datasetName,
|
|
@@ -26,11 +25,10 @@ var _default = exports.default = function _default(_ref) {
|
|
|
26
25
|
}
|
|
27
26
|
}, /*#__PURE__*/React.createElement("div", {
|
|
28
27
|
className: "visualize-button"
|
|
29
|
-
}, "Visualize", /*#__PURE__*/React.createElement(
|
|
28
|
+
}, "Visualize", /*#__PURE__*/React.createElement(_chart.default, {
|
|
30
29
|
style: {
|
|
31
30
|
marginLeft: '.3rem'
|
|
32
31
|
},
|
|
33
|
-
svg: chart,
|
|
34
32
|
height: "inherit",
|
|
35
33
|
accessibilityDesc: "Chart"
|
|
36
34
|
})));
|
|
@@ -16,7 +16,8 @@ var _default = exports.default = function _default(_ref) {
|
|
|
16
16
|
}, /*#__PURE__*/React.createElement("img", {
|
|
17
17
|
"data-testid": "organization-logo",
|
|
18
18
|
className: "logo",
|
|
19
|
-
src: organization.image
|
|
19
|
+
src: organization.image,
|
|
20
|
+
alt: "".concat(organization.title, " Logo")
|
|
20
21
|
})), /*#__PURE__*/React.createElement("div", {
|
|
21
22
|
"data-testid": "organization-title",
|
|
22
23
|
className: "name wrapped-text"
|
|
@@ -140,7 +140,7 @@ var QueryForm = function QueryForm(props) {
|
|
|
140
140
|
var queryDataDownloadLinkAsCsv = function queryDataDownloadLinkAsCsv() {
|
|
141
141
|
dataObj = queryDataToCSV(queryData);
|
|
142
142
|
data = new Blob([dataObj], {
|
|
143
|
-
type:
|
|
143
|
+
type: 'application/json'
|
|
144
144
|
});
|
|
145
145
|
tempLink = document.createElement('a');
|
|
146
146
|
tempLink.href = window.URL.createObjectURL(data);
|
|
@@ -150,7 +150,7 @@ var QueryForm = function QueryForm(props) {
|
|
|
150
150
|
var queryDataDownloadLinkAsJson = function queryDataDownloadLinkAsJson() {
|
|
151
151
|
dataObj = JSON.stringify(queryData);
|
|
152
152
|
data = new Blob([dataObj], {
|
|
153
|
-
type:
|
|
153
|
+
type: 'text/csv'
|
|
154
154
|
});
|
|
155
155
|
tempLink = document.createElement('a');
|
|
156
156
|
tempLink.href = window.URL.createObjectURL(data);
|
|
@@ -158,9 +158,9 @@ var QueryForm = function QueryForm(props) {
|
|
|
158
158
|
tempLink.click();
|
|
159
159
|
};
|
|
160
160
|
var queryDataDownloadLinkAsXml = function queryDataDownloadLinkAsXml() {
|
|
161
|
-
dataObj = (0, _js2xmlparser.parse)(
|
|
161
|
+
dataObj = (0, _js2xmlparser.parse)('results', queryData);
|
|
162
162
|
data = new Blob([dataObj], {
|
|
163
|
-
type:
|
|
163
|
+
type: 'application/xml'
|
|
164
164
|
});
|
|
165
165
|
tempLink = document.createElement('a');
|
|
166
166
|
tempLink.href = window.URL.createObjectURL(data);
|
|
@@ -213,11 +213,11 @@ describe('QueryForm', () => {
|
|
|
213
213
|
})
|
|
214
214
|
})
|
|
215
215
|
|
|
216
|
-
function createSubject(params) {
|
|
216
|
+
function createSubject (params) {
|
|
217
217
|
const defaults = {
|
|
218
218
|
queryText: 'SELECT * FROM sky',
|
|
219
219
|
queryData: [],
|
|
220
|
-
recommendations
|
|
220
|
+
recommendations,
|
|
221
221
|
usedDatasets: [],
|
|
222
222
|
datasetReferences: {},
|
|
223
223
|
queryFailureMessage: '',
|
|
@@ -242,7 +242,7 @@ function createSubject(params) {
|
|
|
242
242
|
)
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
function getButton(subject, text) {
|
|
245
|
+
function getButton (subject, text) {
|
|
246
246
|
const isButton = x => x.type() === 'button' && x.text() === text
|
|
247
247
|
return subject.findWhere(isButton)
|
|
248
248
|
}
|
|
@@ -58,7 +58,8 @@ var RecommendationList = function RecommendationList(props) {
|
|
|
58
58
|
role: "link",
|
|
59
59
|
href: _utils.RecommendationUtils.getDatasetUrl(recommendation),
|
|
60
60
|
target: "_blank",
|
|
61
|
-
className: "action"
|
|
61
|
+
className: "action",
|
|
62
|
+
rel: "noreferrer"
|
|
62
63
|
}, recommendation.dataTitle)));
|
|
63
64
|
});
|
|
64
65
|
};
|
|
@@ -51,11 +51,13 @@ var _default = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
51
51
|
}, "Phoenix Channels clients"), /*#__PURE__*/React.createElement("div", null, "For application development, look at the ", /*#__PURE__*/React.createElement("a", {
|
|
52
52
|
role: "link",
|
|
53
53
|
href: "https://www.npmjs.com/package/phoenix",
|
|
54
|
-
target: "_blank"
|
|
54
|
+
target: "_blank",
|
|
55
|
+
rel: "noreferrer"
|
|
55
56
|
}, "official Phoenix Javascript library"), ", or one of the ", /*#__PURE__*/React.createElement("a", {
|
|
56
57
|
role: "link",
|
|
57
58
|
href: "https://hexdocs.pm/phoenix/channels.html#client-libraries",
|
|
58
|
-
target: "_blank"
|
|
59
|
+
target: "_blank",
|
|
60
|
+
rel: "noreferrer"
|
|
59
61
|
}, "other client libraries"))));
|
|
60
62
|
}
|
|
61
63
|
}, {
|
|
@@ -8,13 +8,14 @@ exports.default = void 0;
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
require("./chart-view.scss");
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
require("react-chart-editor/lib/react-chart-editor.ie.css");
|
|
12
11
|
var _lib = _interopRequireWildcard(require("react-chart-editor/lib"));
|
|
13
12
|
var _plotly = _interopRequireDefault(require("plotly.js/dist/plotly"));
|
|
14
13
|
var _lodash = require("lodash");
|
|
15
14
|
var _loadingElement = _interopRequireDefault(require("../../components/generic-elements/loading-element"));
|
|
16
15
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
17
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
// import 'react-chart-editor/lib/react-chart-editor.ie.css'
|
|
18
|
+
|
|
18
19
|
var hasDataSources = function hasDataSources(dataSources) {
|
|
19
20
|
return dataSources && Object.keys(dataSources).length > 0;
|
|
20
21
|
};
|
|
@@ -89,7 +89,7 @@ describe('chart view', () => {
|
|
|
89
89
|
beforeEach(() => {
|
|
90
90
|
window.LOGO_URL = 'https://placekitten.com/530/530'
|
|
91
91
|
window.MAPBOX_ACCESS_TOKEN = 'secret key'
|
|
92
|
-
subject = createSubject({ dataSources
|
|
92
|
+
subject = createSubject({ dataSources })
|
|
93
93
|
})
|
|
94
94
|
|
|
95
95
|
it('renders a chart editor', () => {
|
|
@@ -157,7 +157,7 @@ describe('chart view', () => {
|
|
|
157
157
|
|
|
158
158
|
beforeEach(() => {
|
|
159
159
|
setChartInformation = jest.fn()
|
|
160
|
-
subject = createSubject({ dataSources
|
|
160
|
+
subject = createSubject({ dataSources, chart: { data: plotlyData, frames: [], layout: {} }, setChartInformation })
|
|
161
161
|
setChartInformation.mockClear()
|
|
162
162
|
})
|
|
163
163
|
|
|
@@ -186,7 +186,7 @@ describe('chart view', () => {
|
|
|
186
186
|
subject.find(PlotlyEditor).props().onUpdate(data, {}, [])
|
|
187
187
|
|
|
188
188
|
expect(setChartInformation).toHaveBeenCalledTimes(1)
|
|
189
|
-
expect(setChartInformation).toHaveBeenCalledWith({ data
|
|
189
|
+
expect(setChartInformation).toHaveBeenCalledWith({ data, layout: {}, frames: [] })
|
|
190
190
|
})
|
|
191
191
|
})
|
|
192
192
|
})
|
|
@@ -139,13 +139,15 @@ var _default = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
139
139
|
role: "link",
|
|
140
140
|
className: "helpLink primary-color",
|
|
141
141
|
target: "_blank",
|
|
142
|
-
href: "https://en.wikipedia.org/wiki/SQL_syntax"
|
|
142
|
+
href: "https://en.wikipedia.org/wiki/SQL_syntax",
|
|
143
|
+
rel: "noreferrer"
|
|
143
144
|
}, "SQL Help"), this.isVisualizationEnabled() && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "|"), /*#__PURE__*/_react.default.createElement("a", {
|
|
144
145
|
role: "link",
|
|
145
146
|
id: "plotlyhelp",
|
|
146
147
|
className: "helpLink primary-color",
|
|
147
148
|
target: "_blank",
|
|
148
|
-
href: "https://plotly.com/chart-studio-help/tutorials/#basic"
|
|
149
|
+
href: "https://plotly.com/chart-studio-help/tutorials/#basic",
|
|
150
|
+
rel: "noreferrer"
|
|
149
151
|
}, "Plot.ly Help")))), this.isNotDatasetDetailsTab() && /*#__PURE__*/_react.default.createElement("span", {
|
|
150
152
|
className: "action-area"
|
|
151
153
|
}, /*#__PURE__*/_react.default.createElement(_visualizationListMenuItem.default, {
|
|
@@ -18,6 +18,6 @@ describe('login view', () => {
|
|
|
18
18
|
subject.find('.password').simulate('change', { target: { value: password } })
|
|
19
19
|
subject.find('.submit').simulate('click')
|
|
20
20
|
|
|
21
|
-
expect(loginSpy).toHaveBeenCalledWith({ username
|
|
21
|
+
expect(loginSpy).toHaveBeenCalledWith({ username, password, history: fakeHistory })
|
|
22
22
|
})
|
|
23
23
|
})
|
|
@@ -82,7 +82,7 @@ describe('OAuth View', () => {
|
|
|
82
82
|
subject = createSubject({
|
|
83
83
|
callLoggedIn: callLoggedInHandler,
|
|
84
84
|
history,
|
|
85
|
-
auth: { handleRedirectCallback
|
|
85
|
+
auth: { handleRedirectCallback, isLoading: false },
|
|
86
86
|
setGlobalErrorState: setGlobalErrorStateHandler
|
|
87
87
|
})
|
|
88
88
|
})
|
|
@@ -15,6 +15,12 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
15
15
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
16
16
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
17
17
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
18
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
19
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
20
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
21
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
22
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
23
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
18
24
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
19
25
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
20
26
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
@@ -46,7 +52,7 @@ var SearchParamsManager = exports.SearchParamsManager = /*#__PURE__*/function ()
|
|
|
46
52
|
this.sortOrder = this.getParam('sort') || defaults.sortOrder;
|
|
47
53
|
this.page = Number.parseInt(this.getParam('page')) || defaults.page;
|
|
48
54
|
this.searchText = this.getParam('q') || defaults.searchText;
|
|
49
|
-
this.facets = this.getParam('facets') || defaults.facets
|
|
55
|
+
this.facets = this.getFacets(); // this.getParam('facets') || defaults.facets
|
|
50
56
|
}
|
|
51
57
|
return _createClass(SearchParamsManager, [{
|
|
52
58
|
key: "getParam",
|
|
@@ -73,6 +79,25 @@ var SearchParamsManager = exports.SearchParamsManager = /*#__PURE__*/function ()
|
|
|
73
79
|
page: 1
|
|
74
80
|
});
|
|
75
81
|
}
|
|
82
|
+
}, {
|
|
83
|
+
key: "getFacets",
|
|
84
|
+
value: function getFacets() {
|
|
85
|
+
var facets = this.getParam('facets');
|
|
86
|
+
if (!facets) return {};
|
|
87
|
+
var validFacets = Object.entries(facets).filter(function (_ref) {
|
|
88
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
89
|
+
key = _ref2[0],
|
|
90
|
+
_ = _ref2[1];
|
|
91
|
+
var hasInvalidBrackets = /[\[\]{}()]/.test(key);
|
|
92
|
+
return !hasInvalidBrackets;
|
|
93
|
+
}).map(function (_ref3) {
|
|
94
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
95
|
+
key = _ref4[0],
|
|
96
|
+
value = _ref4[1];
|
|
97
|
+
return [key, Array.isArray(value) ? value : [value]];
|
|
98
|
+
});
|
|
99
|
+
return Object.fromEntries(validFacets);
|
|
100
|
+
}
|
|
76
101
|
}, {
|
|
77
102
|
key: "toggleFacet",
|
|
78
103
|
value: function toggleFacet(name, value) {
|
|
@@ -128,7 +153,7 @@ var SearchParamsManager = exports.SearchParamsManager = /*#__PURE__*/function ()
|
|
|
128
153
|
if (focusedElement !== null && focusedElement !== document.body) {
|
|
129
154
|
focusedID = focusedElement.id;
|
|
130
155
|
}
|
|
131
|
-
sessionStorage.setItem(
|
|
156
|
+
sessionStorage.setItem('cachedFocusedElement', focusedID);
|
|
132
157
|
}
|
|
133
158
|
}]);
|
|
134
159
|
}();
|
|
@@ -150,8 +175,8 @@ var withSearchParamsManager = exports.default = function withSearchParamsManager
|
|
|
150
175
|
var searchParamsManager = new SearchParamsManager(history);
|
|
151
176
|
var dispatchDatasetSearch = function dispatchDatasetSearch() {
|
|
152
177
|
try {
|
|
153
|
-
var cachedElementID = sessionStorage.getItem(
|
|
154
|
-
sessionStorage.removeItem(
|
|
178
|
+
var cachedElementID = sessionStorage.getItem('cachedFocusedElement');
|
|
179
|
+
sessionStorage.removeItem('cachedFocusedElement');
|
|
155
180
|
var cachedElement = document.getElementById(cachedElementID);
|
|
156
181
|
cachedElement.focus();
|
|
157
182
|
} catch (e) {}
|
|
@@ -444,8 +444,8 @@ describe('withSearchParamsManager', () => {
|
|
|
444
444
|
})
|
|
445
445
|
|
|
446
446
|
it('refocuses any cached element after the search', () => {
|
|
447
|
-
|
|
448
|
-
|
|
447
|
+
const fakeElementId = 'fakeElement'
|
|
448
|
+
const fakeElement = { focus: jest.fn() }
|
|
449
449
|
sessionStorage.setItem('cachedFocusedElement', fakeElementId)
|
|
450
450
|
document.getElementById = jest.fn(() => fakeElement)
|
|
451
451
|
|
|
@@ -487,4 +487,4 @@ function TestableProvider ({ children, store, ...props }) {
|
|
|
487
487
|
{React.cloneElement(children, { ...props })}
|
|
488
488
|
</Provider>
|
|
489
489
|
)
|
|
490
|
-
}
|
|
490
|
+
}
|
|
@@ -33,9 +33,9 @@ describe('login-saga', () => {
|
|
|
33
33
|
const response = {
|
|
34
34
|
status: 200,
|
|
35
35
|
headers: {
|
|
36
|
-
token
|
|
36
|
+
token
|
|
37
37
|
},
|
|
38
|
-
data
|
|
38
|
+
data
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
beforeEach(() => {
|
|
@@ -63,7 +63,7 @@ describe('login-saga', () => {
|
|
|
63
63
|
it('dispatches a LOGIN_FAILURE event based on 401 code', () => {
|
|
64
64
|
const response = {
|
|
65
65
|
status: 401,
|
|
66
|
-
data
|
|
66
|
+
data
|
|
67
67
|
}
|
|
68
68
|
mockAxios.get.mockImplementationOnce(() => (response))
|
|
69
69
|
|
|
@@ -281,40 +281,40 @@ function handleSaveResponse(clientFunction) {
|
|
|
281
281
|
}
|
|
282
282
|
function handleDeleteResponse(clientFunction) {
|
|
283
283
|
var response;
|
|
284
|
-
return _regeneratorRuntime().wrap(function handleDeleteResponse$(
|
|
285
|
-
while (1) switch (
|
|
284
|
+
return _regeneratorRuntime().wrap(function handleDeleteResponse$(_context0) {
|
|
285
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
286
286
|
case 0:
|
|
287
|
-
|
|
288
|
-
|
|
287
|
+
_context0.prev = 0;
|
|
288
|
+
_context0.next = 3;
|
|
289
289
|
return (0, _effects.call)(clientFunction);
|
|
290
290
|
case 3:
|
|
291
|
-
response =
|
|
291
|
+
response = _context0.sent;
|
|
292
292
|
if (!(response.status < 400)) {
|
|
293
|
-
|
|
293
|
+
_context0.next = 9;
|
|
294
294
|
break;
|
|
295
295
|
}
|
|
296
|
-
|
|
296
|
+
_context0.next = 7;
|
|
297
297
|
return (0, _effects.put)((0, _actions.visualizationDeleteSuccess)());
|
|
298
298
|
case 7:
|
|
299
|
-
|
|
299
|
+
_context0.next = 11;
|
|
300
300
|
break;
|
|
301
301
|
case 9:
|
|
302
|
-
|
|
302
|
+
_context0.next = 11;
|
|
303
303
|
return (0, _effects.put)((0, _actions.visualizationDeleteFailure)(response.status));
|
|
304
304
|
case 11:
|
|
305
|
-
|
|
305
|
+
_context0.next = 17;
|
|
306
306
|
break;
|
|
307
307
|
case 13:
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
return (0, _effects.put)((0, _actions.visualizationDeleteFailure)(
|
|
308
|
+
_context0.prev = 13;
|
|
309
|
+
_context0.t0 = _context0["catch"](0);
|
|
310
|
+
_context0.next = 17;
|
|
311
|
+
return (0, _effects.put)((0, _actions.visualizationDeleteFailure)(_context0.t0.message));
|
|
312
312
|
case 17:
|
|
313
|
-
|
|
313
|
+
_context0.next = 19;
|
|
314
314
|
return (0, _effects.put)((0, _actions.visualizationsLoadAll)());
|
|
315
315
|
case 19:
|
|
316
316
|
case "end":
|
|
317
|
-
return
|
|
317
|
+
return _context0.stop();
|
|
318
318
|
}
|
|
319
319
|
}, _marked7, null, [[0, 13]]);
|
|
320
320
|
}
|
|
@@ -322,50 +322,50 @@ function loadDatasetReferences(_ref4) {
|
|
|
322
322
|
var value = _ref4.value;
|
|
323
323
|
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
324
324
|
var _iterator, _step, datasetId;
|
|
325
|
-
return _regeneratorRuntime().wrap(function _callee4$(
|
|
326
|
-
while (1) switch (
|
|
325
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context1) {
|
|
326
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
327
327
|
case 0:
|
|
328
328
|
_iterator = _createForOfIteratorHelper(value.usedDatasets);
|
|
329
|
-
|
|
329
|
+
_context1.prev = 1;
|
|
330
330
|
_iterator.s();
|
|
331
331
|
case 3:
|
|
332
332
|
if ((_step = _iterator.n()).done) {
|
|
333
|
-
|
|
333
|
+
_context1.next = 9;
|
|
334
334
|
break;
|
|
335
335
|
}
|
|
336
336
|
datasetId = _step.value;
|
|
337
|
-
|
|
337
|
+
_context1.next = 7;
|
|
338
338
|
return (0, _effects.put)((0, _actions.retrieveDatasetReference)(datasetId));
|
|
339
339
|
case 7:
|
|
340
|
-
|
|
340
|
+
_context1.next = 3;
|
|
341
341
|
break;
|
|
342
342
|
case 9:
|
|
343
|
-
|
|
343
|
+
_context1.next = 14;
|
|
344
344
|
break;
|
|
345
345
|
case 11:
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
_iterator.e(
|
|
346
|
+
_context1.prev = 11;
|
|
347
|
+
_context1.t0 = _context1["catch"](1);
|
|
348
|
+
_iterator.e(_context1.t0);
|
|
349
349
|
case 14:
|
|
350
|
-
|
|
350
|
+
_context1.prev = 14;
|
|
351
351
|
_iterator.f();
|
|
352
|
-
return
|
|
352
|
+
return _context1.finish(14);
|
|
353
353
|
case 17:
|
|
354
354
|
case "end":
|
|
355
|
-
return
|
|
355
|
+
return _context1.stop();
|
|
356
356
|
}
|
|
357
357
|
}, _callee4, null, [[1, 11, 14, 17]]);
|
|
358
358
|
})();
|
|
359
359
|
}
|
|
360
360
|
function visualizationSaga() {
|
|
361
|
-
return _regeneratorRuntime().wrap(function visualizationSaga$(
|
|
362
|
-
while (1) switch (
|
|
361
|
+
return _regeneratorRuntime().wrap(function visualizationSaga$(_context10) {
|
|
362
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
363
363
|
case 0:
|
|
364
|
-
|
|
364
|
+
_context10.next = 2;
|
|
365
365
|
return (0, _effects.all)([(0, _effects.fork)(loadVisualizationSaga), (0, _effects.fork)(saveVisualizationSaga), (0, _effects.fork)(loadUserVisualizationsSaga), (0, _effects.fork)(deleteVisualizationSaga)]);
|
|
366
366
|
case 2:
|
|
367
367
|
case "end":
|
|
368
|
-
return
|
|
368
|
+
return _context10.stop();
|
|
369
369
|
}
|
|
370
370
|
}, _marked8);
|
|
371
371
|
}
|
|
@@ -158,8 +158,8 @@ describe('visualization-saga', () => {
|
|
|
158
158
|
it('calls api with parameters that include a dereferenced chart', () => {
|
|
159
159
|
expect(AuthenticatedHTTPClient.post).toHaveBeenCalledWith('/api/v1/visualization',
|
|
160
160
|
{
|
|
161
|
-
title
|
|
162
|
-
query
|
|
161
|
+
title,
|
|
162
|
+
query,
|
|
163
163
|
chart: { data: [{ x: null, xsrc: 'col1' }], frames: [], layout: {} }
|
|
164
164
|
}
|
|
165
165
|
)
|
|
@@ -238,9 +238,9 @@ describe('visualization-saga', () => {
|
|
|
238
238
|
it('calls api with parameters that include a dereferenced chart', () => {
|
|
239
239
|
expect(AuthenticatedHTTPClient.put).toHaveBeenCalledWith(`/api/v1/visualization/${id}`,
|
|
240
240
|
{
|
|
241
|
-
id
|
|
242
|
-
title
|
|
243
|
-
query
|
|
241
|
+
id,
|
|
242
|
+
title,
|
|
243
|
+
query,
|
|
244
244
|
chart: { data: [{ x: null, xsrc: 'col1' }], frames: [], layout: {} }
|
|
245
245
|
}
|
|
246
246
|
)
|
|
@@ -295,8 +295,8 @@ describe('visualization-saga', () => {
|
|
|
295
295
|
it('calls api with parameters that include a dereferenced chart', () => {
|
|
296
296
|
expect(AuthenticatedHTTPClient.post).toHaveBeenCalledWith('/api/v1/visualization',
|
|
297
297
|
{
|
|
298
|
-
title
|
|
299
|
-
query
|
|
298
|
+
title,
|
|
299
|
+
query,
|
|
300
300
|
chart: { data: [{ x: null, xsrc: 'col1' }], frames: [], layout: {} }
|
|
301
301
|
}
|
|
302
302
|
)
|
|
@@ -3,7 +3,7 @@ import { GeoJsonUtils } from './'
|
|
|
3
3
|
describe('determine bounding box', () => {
|
|
4
4
|
it('returns bbox when present on the dataset', () => {
|
|
5
5
|
const bbox = [5, 4, 3, 2]
|
|
6
|
-
const geoJsonData = { bbox
|
|
6
|
+
const geoJsonData = { bbox }
|
|
7
7
|
|
|
8
8
|
const result = GeoJsonUtils.determineBBox(geoJsonData)
|
|
9
9
|
|
|
@@ -22,7 +22,7 @@ var buildDate = function buildDate(date, format) {
|
|
|
22
22
|
if (!date) return NO_DATE_MESSAGE;
|
|
23
23
|
return _luxon.DateTime.fromISO(date, {
|
|
24
24
|
zone: 'utc'
|
|
25
|
-
}).endOf(
|
|
25
|
+
}).endOf('day').setZone('local').toLocaleString(format);
|
|
26
26
|
};
|
|
27
27
|
var _default = exports.default = {
|
|
28
28
|
createDateString: createDateString
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@urbanos/react-discovery-ui",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.54",
|
|
4
4
|
"description": "React component for dataset discovery UI",
|
|
5
5
|
"main": "./lib/ReactDiscoveryUI.js",
|
|
6
6
|
"repository": {
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"react": "^16.14.0",
|
|
45
45
|
"react-aria-modal": "^4.0.2",
|
|
46
46
|
"react-autosize-textarea": "^7.1.0",
|
|
47
|
-
"react-chart-editor": "^0.
|
|
47
|
+
"react-chart-editor": "^0.46.1",
|
|
48
48
|
"react-collapse": "^4.0.3",
|
|
49
49
|
"react-copy-to-clipboard": "^5.1.0",
|
|
50
50
|
"react-device-detect": "^2.2.3",
|
|
51
|
-
"react-dom": "~16.
|
|
51
|
+
"react-dom": "~16.14.0",
|
|
52
52
|
"react-gtm-module": "^2.0.11",
|
|
53
53
|
"react-image-fallback": "^8.0.0",
|
|
54
54
|
"react-intl": "^5.25.1",
|
|
@@ -97,9 +97,9 @@
|
|
|
97
97
|
"@babel/polyfill": "^7.12.1",
|
|
98
98
|
"@babel/preset-env": "^7.26.7",
|
|
99
99
|
"@babel/preset-react": "^7.26.3",
|
|
100
|
+
"@svgr/webpack": "^8.1.0",
|
|
100
101
|
"babel-jest": "^29.7.0",
|
|
101
102
|
"babel-loader": "^8.4.1",
|
|
102
|
-
"babel-plugin-inline-svg": "^1.2.0",
|
|
103
103
|
"copy-webpack-plugin": "^11.0.0",
|
|
104
104
|
"create-react-component-folder": "^0.3.7",
|
|
105
105
|
"cross-env": "^7.0.3",
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"moduleNameMapper": {
|
|
145
145
|
".+\\.(jpg|jpeg|png|gif)$": "<rootDir>/test-helpers/image-mock.js",
|
|
146
146
|
"\\.(css|scss)$": "identity-obj-proxy",
|
|
147
|
-
"\\.(svg)$": "<rootDir>/test-helpers/mock-svg-
|
|
147
|
+
"\\.(svg)$": "<rootDir>/test-helpers/mock-svg-element.js"
|
|
148
148
|
},
|
|
149
149
|
"testPathIgnorePatterns": [
|
|
150
150
|
"/node_modules/",
|