@urbanos/react-discovery-ui 2.1.43
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/LICENSE +201 -0
- package/README.md +118 -0
- package/lib/ReactDiscoveryUI.js +103 -0
- package/lib/ReactDiscoveryUI.scss +13 -0
- package/lib/assets/arrow.svg +6 -0
- package/lib/assets/blk-database.svg +48 -0
- package/lib/assets/chart.svg +1 -0
- package/lib/assets/down.png +0 -0
- package/lib/assets/down.svg +1 -0
- package/lib/assets/folder_icon.png +0 -0
- package/lib/assets/folder_icon.svg +1 -0
- package/lib/assets/ic_arrow.svg +15 -0
- package/lib/assets/loadingicon.svg +57 -0
- package/lib/assets/no_image.png +0 -0
- package/lib/assets/plus.png +0 -0
- package/lib/assets/plus.svg +1 -0
- package/lib/assets/user.svg +1 -0
- package/lib/auth/auth0-client-provider.js +37 -0
- package/lib/auth/auth0-client-provider.test.js +33 -0
- package/lib/auth/auth0-wrapper.js +155 -0
- package/lib/auth/auth0-wrapper.test.js +100 -0
- package/lib/components/auth0-login-zone/auth0-login-zone.js +147 -0
- package/lib/components/auth0-login-zone/auth0-login-zone.test.js +177 -0
- package/lib/components/auth0-login-zone/index.js +9 -0
- package/lib/components/code-editor/code-editor.css +173 -0
- package/lib/components/code-editor/code-editor.js +64 -0
- package/lib/components/code-editor/index.js +9 -0
- package/lib/components/collapsable-box/collapsable-box.js +81 -0
- package/lib/components/collapsable-box/collapsable-box.scss +39 -0
- package/lib/components/collapsable-box/collapsable-box.test.js +87 -0
- package/lib/components/collapsable-box/index.js +9 -0
- package/lib/components/data-card/data-card.js +63 -0
- package/lib/components/data-card/data-card.scss +93 -0
- package/lib/components/data-card/data-card.test.js +74 -0
- package/lib/components/data-card/index.js +9 -0
- package/lib/components/data-view/data-view.js +194 -0
- package/lib/components/data-view/data-view.scss +39 -0
- package/lib/components/data-view/data-view.test.js +155 -0
- package/lib/components/data-view/index.js +9 -0
- package/lib/components/dataset-api-doc/api-example.js +120 -0
- package/lib/components/dataset-api-doc/api-example.scss +84 -0
- package/lib/components/dataset-api-doc/api-example.test.js +88 -0
- package/lib/components/dataset-api-doc/dataset-api-doc.js +117 -0
- package/lib/components/dataset-api-doc/dataset-api-doc.scss +8 -0
- package/lib/components/dataset-api-doc/dataset-api-doc.test.js +42 -0
- package/lib/components/dataset-api-doc/index.js +9 -0
- package/lib/components/dataset-details/dataset-details.js +64 -0
- package/lib/components/dataset-details/dataset-details.scss +58 -0
- package/lib/components/dataset-details/dataset-details.test.js +38 -0
- package/lib/components/dataset-details/index.js +9 -0
- package/lib/components/dataset-dictionary/dataset-dictionary.js +127 -0
- package/lib/components/dataset-dictionary/dataset-dictionary.scss +42 -0
- package/lib/components/dataset-dictionary/dataset-dictionary.test.js +286 -0
- package/lib/components/dataset-dictionary/index.js +9 -0
- package/lib/components/dataset-list/dataset-list.js +22 -0
- package/lib/components/dataset-list/dataset-list.scss +9 -0
- package/lib/components/dataset-list/dataset-list.test.js +16 -0
- package/lib/components/dataset-list/index.js +9 -0
- package/lib/components/dataset-metadata/dataset-metadata.js +169 -0
- package/lib/components/dataset-metadata/dataset-metadata.scss +34 -0
- package/lib/components/dataset-metadata/dataset-metadata.test.js +24 -0
- package/lib/components/dataset-metadata/index.js +9 -0
- package/lib/components/dataset-preview/connector.js +26 -0
- package/lib/components/dataset-preview/dataset-preview.js +58 -0
- package/lib/components/dataset-preview/dataset-preview.scss +24 -0
- package/lib/components/dataset-preview/dataset-preview.test.js +34 -0
- package/lib/components/dataset-preview/index.js +9 -0
- package/lib/components/dataset-quality/dataset-quality.js +56 -0
- package/lib/components/dataset-quality/dataset-quality.scss +24 -0
- package/lib/components/dataset-quality/dataset-quality.test.js +34 -0
- package/lib/components/dataset-quality/index.js +9 -0
- package/lib/components/dataset-recommendations/connector.js +24 -0
- package/lib/components/dataset-recommendations/dataset-recommendations.js +47 -0
- package/lib/components/dataset-recommendations/dataset-recommendations.scss +17 -0
- package/lib/components/dataset-recommendations/dataset-recommendations.test.js +37 -0
- package/lib/components/dataset-recommendations/index.js +9 -0
- package/lib/components/detail-toggle-icon/detail-toggle-icon.js +41 -0
- package/lib/components/detail-toggle-icon/detail-toggle-icon.scss +13 -0
- package/lib/components/detail-toggle-icon/detail-toggle-icon.test.js +20 -0
- package/lib/components/detail-toggle-icon/index.js +9 -0
- package/lib/components/facet-list/facet-list.js +47 -0
- package/lib/components/facet-list/facet-list.scss +19 -0
- package/lib/components/facet-list/facet-list.test.js +94 -0
- package/lib/components/facet-list/index.js +9 -0
- package/lib/components/facet-sidebar/facet-sidebar.js +101 -0
- package/lib/components/facet-sidebar/facet-sidebar.scss +129 -0
- package/lib/components/facet-sidebar/facet-sidebar.test.js +93 -0
- package/lib/components/facet-sidebar/index.js +9 -0
- package/lib/components/generic-elements/alert-component/alert-component.js +51 -0
- package/lib/components/generic-elements/alert-component/alert-component.scss +26 -0
- package/lib/components/generic-elements/alert-component/alert-component.test.js +26 -0
- package/lib/components/generic-elements/alert-component/index.js +9 -0
- package/lib/components/generic-elements/arrow-button/arrow-button.js +30 -0
- package/lib/components/generic-elements/arrow-button/index.js +9 -0
- package/lib/components/generic-elements/auto-anchoring-popover/index.js +61 -0
- package/lib/components/generic-elements/back-button/back-button.js +14 -0
- package/lib/components/generic-elements/back-button/back-button.scss +14 -0
- package/lib/components/generic-elements/back-button/index.js +9 -0
- package/lib/components/generic-elements/call-to-action-button/call-to-action-button.js +118 -0
- package/lib/components/generic-elements/call-to-action-button/call-to-action-button.scss +19 -0
- package/lib/components/generic-elements/call-to-action-button/call-to-action-button.test.js +68 -0
- package/lib/components/generic-elements/call-to-action-button/index.js +9 -0
- package/lib/components/generic-elements/chart-icon/index.js +23 -0
- package/lib/components/generic-elements/checkbox/checkbox.js +50 -0
- package/lib/components/generic-elements/checkbox/checkbox.scss +44 -0
- package/lib/components/generic-elements/checkbox/checkbox.test.js +71 -0
- package/lib/components/generic-elements/checkbox/index.js +9 -0
- package/lib/components/generic-elements/error-component/error-component.js +21 -0
- package/lib/components/generic-elements/error-component/error-component.scss +16 -0
- package/lib/components/generic-elements/error-component/error-component.test.js +12 -0
- package/lib/components/generic-elements/error-component/index.js +9 -0
- package/lib/components/generic-elements/folder-icon/index.js +23 -0
- package/lib/components/generic-elements/generated-link/generated-link.js +25 -0
- package/lib/components/generic-elements/generated-link/index.js +13 -0
- package/lib/components/generic-elements/loading-element/index.js +9 -0
- package/lib/components/generic-elements/loading-element/loading-element.js +22 -0
- package/lib/components/generic-elements/loading-element/loading-element.scss +6 -0
- package/lib/components/generic-elements/loading-element/loading-element.test.js +11 -0
- package/lib/components/generic-elements/paginator/index.js +9 -0
- package/lib/components/generic-elements/paginator/paginator.js +84 -0
- package/lib/components/generic-elements/paginator/paginator.scss +38 -0
- package/lib/components/generic-elements/paginator/paginator.test.js +140 -0
- package/lib/components/generic-elements/plus-icon/index.js +21 -0
- package/lib/components/generic-elements/save-indicator/index.js +9 -0
- package/lib/components/generic-elements/save-indicator/save-indicator.js +39 -0
- package/lib/components/generic-elements/save-indicator/save-indicator.scss +31 -0
- package/lib/components/generic-elements/save-indicator/save-indicator.test.js +89 -0
- package/lib/components/generic-elements/search/index.js +9 -0
- package/lib/components/generic-elements/search/search.js +93 -0
- package/lib/components/generic-elements/search/search.scss +90 -0
- package/lib/components/generic-elements/search/search.test.js +41 -0
- package/lib/components/generic-elements/select/index.js +9 -0
- package/lib/components/generic-elements/select/select.js +44 -0
- package/lib/components/generic-elements/select/select.scss +22 -0
- package/lib/components/generic-elements/select/select.test.js +34 -0
- package/lib/components/generic-elements/share-link/index.js +9 -0
- package/lib/components/generic-elements/share-link/share-link.js +23 -0
- package/lib/components/generic-elements/share-link/share-link.scss +17 -0
- package/lib/components/generic-elements/share-link/share-link.test.js +28 -0
- package/lib/components/generic-elements/sql-icon/index.js +20 -0
- package/lib/components/generic-elements/tab-button/index.js +9 -0
- package/lib/components/generic-elements/tab-button/tab-button.js +25 -0
- package/lib/components/generic-elements/tab-button/tab-button.scss +27 -0
- package/lib/components/generic-elements/visualize-button/index.js +9 -0
- package/lib/components/generic-elements/visualize-button/visualize-button.js +37 -0
- package/lib/components/generic-elements/visualize-button/visualize-button.scss +14 -0
- package/lib/components/login-zone/connector.js +25 -0
- package/lib/components/login-zone/index.js +9 -0
- package/lib/components/login-zone/login-svgs-and-text.js +39 -0
- package/lib/components/login-zone/login-zone.js +21 -0
- package/lib/components/login-zone/login-zone.scss +115 -0
- package/lib/components/login-zone/login-zone.test.js +17 -0
- package/lib/components/login-zone/login.js +48 -0
- package/lib/components/login-zone/logout.js +39 -0
- package/lib/components/network-loading-element/connector.js +17 -0
- package/lib/components/network-loading-element/index.js +9 -0
- package/lib/components/network-loading-element/network-loading-element.js +23 -0
- package/lib/components/network-loading-element/network-loading-element.scss +21 -0
- package/lib/components/network-loading-element/network-loading-element.test.js +34 -0
- package/lib/components/organization/index.js +9 -0
- package/lib/components/organization/organization.js +27 -0
- package/lib/components/organization/organization.scss +32 -0
- package/lib/components/protected-route/protected-route.js +101 -0
- package/lib/components/protected-route/protected-route.scss +4 -0
- package/lib/components/protected-route/protected-route.test.js +63 -0
- package/lib/components/query-form/index.js +9 -0
- package/lib/components/query-form/query-form.js +262 -0
- package/lib/components/query-form/query-form.scss +167 -0
- package/lib/components/query-form/query-form.test.js +248 -0
- package/lib/components/recommendation-list/index.js +9 -0
- package/lib/components/recommendation-list/recommendation-list.js +72 -0
- package/lib/components/recommendation-list/recommendation-list.scss +61 -0
- package/lib/components/recommendation-list/recommendation-list.test.js +38 -0
- package/lib/components/remote-toggle/__snapshots__/remote-toggle.test.js.snap +3 -0
- package/lib/components/remote-toggle/index.js +13 -0
- package/lib/components/remote-toggle/remote-toggle.js +35 -0
- package/lib/components/remote-toggle/remote-toggle.scss +0 -0
- package/lib/components/remote-toggle/remote-toggle.test.js +10 -0
- package/lib/components/share/index.js +9 -0
- package/lib/components/share/share.js +109 -0
- package/lib/components/share/share.scss +66 -0
- package/lib/components/streaming-api-doc/index.js +9 -0
- package/lib/components/streaming-api-doc/streaming-api-doc.js +76 -0
- package/lib/components/streaming-api-doc/streaming-api-doc.scss +23 -0
- package/lib/components/streaming-api-doc/streaming-api-doc.test.js +24 -0
- package/lib/components/tooltip/index.js +9 -0
- package/lib/components/tooltip/tooltip.js +17 -0
- package/lib/components/tooltip/tooltip.scss +16 -0
- package/lib/components/tooltip/tooltip.test.js +19 -0
- package/lib/components/visualization-list-menu-item/index.js +9 -0
- package/lib/components/visualization-list-menu-item/visualization-list-menu-item.js +53 -0
- package/lib/components/visualization-list-menu-item/visualization-list-menu-item.scss +21 -0
- package/lib/components/visualization-list-menu-item/visualization-list-menu-item.test.js +42 -0
- package/lib/components/visualization-save-menu-item/index.js +9 -0
- package/lib/components/visualization-save-menu-item/visualization-save-menu-item.js +101 -0
- package/lib/components/visualization-save-menu-item/visualization-save-menu-item.scss +37 -0
- package/lib/components/visualization-save-menu-item/visualization-save-menu-item.test.js +185 -0
- package/lib/components/visualizations/geojson/connector.js +29 -0
- package/lib/components/visualizations/geojson/geojson-visualization.js +151 -0
- package/lib/components/visualizations/geojson/geojson-visualization.scss +24 -0
- package/lib/components/visualizations/geojson/geojson-visualization.test.js +238 -0
- package/lib/components/visualizations/geojson/index.js +9 -0
- package/lib/pages/apikey-view/apiKey-view.test.js +204 -0
- package/lib/pages/apikey-view/apikey-view.js +166 -0
- package/lib/pages/apikey-view/apikey-view.scss +340 -0
- package/lib/pages/apikey-view/connector.js +31 -0
- package/lib/pages/apikey-view/index.js +9 -0
- package/lib/pages/chart-view/chart-view.js +92 -0
- package/lib/pages/chart-view/chart-view.scss +35 -0
- package/lib/pages/chart-view/chart-view.test.js +206 -0
- package/lib/pages/chart-view/connector.js +30 -0
- package/lib/pages/chart-view/index.js +9 -0
- package/lib/pages/dataset-detail-view/connector.js +38 -0
- package/lib/pages/dataset-detail-view/dataset-detail-view-connector.test.js +42 -0
- package/lib/pages/dataset-detail-view/dataset-detail-view.js +99 -0
- package/lib/pages/dataset-detail-view/dataset-detail-view.scss +190 -0
- package/lib/pages/dataset-detail-view/dataset-detail-view.test.js +305 -0
- package/lib/pages/dataset-detail-view/index.js +9 -0
- package/lib/pages/dataset-list-view/connector.js +30 -0
- package/lib/pages/dataset-list-view/dataset-list-view.js +132 -0
- package/lib/pages/dataset-list-view/dataset-list-view.scss +242 -0
- package/lib/pages/dataset-list-view/dataset-list-view.test.js +162 -0
- package/lib/pages/dataset-list-view/index.js +9 -0
- package/lib/pages/dataset-view/connector.js +55 -0
- package/lib/pages/dataset-view/dataset-view-connector.test.js +78 -0
- package/lib/pages/dataset-view/dataset-view.js +175 -0
- package/lib/pages/dataset-view/dataset-view.scss +95 -0
- package/lib/pages/dataset-view/dataset-view.test.js +157 -0
- package/lib/pages/dataset-view/index.js +9 -0
- package/lib/pages/login-view/connector.js +25 -0
- package/lib/pages/login-view/index.js +9 -0
- package/lib/pages/login-view/login-view.js +83 -0
- package/lib/pages/login-view/login-view.scss +62 -0
- package/lib/pages/login-view/login-view.test.js +23 -0
- package/lib/pages/oauth-error-view/index.js +9 -0
- package/lib/pages/oauth-error-view/oauth-error-view.js +25 -0
- package/lib/pages/oauth-error-view/oauth-error-view.scss +13 -0
- package/lib/pages/oauth-error-view/oauth-error-view.test.js +13 -0
- package/lib/pages/oauth-view/connector.js +22 -0
- package/lib/pages/oauth-view/index.js +9 -0
- package/lib/pages/oauth-view/oauth-view.js +124 -0
- package/lib/pages/oauth-view/oauth-view.scss +7 -0
- package/lib/pages/oauth-view/oauth-view.test.js +195 -0
- package/lib/pages/query-view/connector.js +40 -0
- package/lib/pages/query-view/index.js +9 -0
- package/lib/pages/query-view/query-view.js +80 -0
- package/lib/pages/query-view/query-view.scss +39 -0
- package/lib/pages/query-view/query-view.test.js +104 -0
- package/lib/pages/user-profile-view/connector.js +39 -0
- package/lib/pages/user-profile-view/index.js +9 -0
- package/lib/pages/user-profile-view/user-profile-view.js +154 -0
- package/lib/pages/user-profile-view/user-profile-view.scss +81 -0
- package/lib/pages/user-profile-view/user-profile-view.test.js +129 -0
- package/lib/pages/visualization-view/connector.js +52 -0
- package/lib/pages/visualization-view/index.js +9 -0
- package/lib/pages/visualization-view/visualization-view-connector.test.js +62 -0
- package/lib/pages/visualization-view/visualization-view.js +128 -0
- package/lib/pages/visualization-view/visualization-view.scss +115 -0
- package/lib/pages/visualization-view/visualization-view.test.js +188 -0
- package/lib/routes.js +18 -0
- package/lib/search-params/search-params-manager.js +171 -0
- package/lib/search-params/search-params-manager.test.js +490 -0
- package/lib/store/actions.js +428 -0
- package/lib/store/dataset-selectors.js +47 -0
- package/lib/store/dataset-selectors.test.js +154 -0
- package/lib/store/query-selectors.js +53 -0
- package/lib/store/query-selectors.test.js +153 -0
- package/lib/store/reducers/index.js +20 -0
- package/lib/store/reducers/query-reducer.js +52 -0
- package/lib/store/reducers/query-reducer.test.js +89 -0
- package/lib/store/reducers/reducers.js +196 -0
- package/lib/store/reducers/reducers.test.js +309 -0
- package/lib/store/reducers/visualization-reducer.js +167 -0
- package/lib/store/reducers/visualization-reducer.test.js +426 -0
- package/lib/store/sagas/api-invoker.js +79 -0
- package/lib/store/sagas/api-invoker.test.js +139 -0
- package/lib/store/sagas/apiKey-saga.js +81 -0
- package/lib/store/sagas/apiKey-saga.test.js +57 -0
- package/lib/store/sagas/dataset-download-saga.js +43 -0
- package/lib/store/sagas/dataset-list-saga.js +49 -0
- package/lib/store/sagas/dataset-list-saga.test.js +72 -0
- package/lib/store/sagas/dataset-preview-saga.js +44 -0
- package/lib/store/sagas/dataset-query-saga.js +43 -0
- package/lib/store/sagas/dataset-recommendation-saga.js +40 -0
- package/lib/store/sagas/dataset-saga.js +50 -0
- package/lib/store/sagas/freestyle-query-saga.js +127 -0
- package/lib/store/sagas/freestyle-query-saga.test.js +145 -0
- package/lib/store/sagas/index.js +44 -0
- package/lib/store/sagas/login-saga.js +85 -0
- package/lib/store/sagas/login-saga.test.js +84 -0
- package/lib/store/sagas/logout-saga.js +96 -0
- package/lib/store/sagas/oauth-saga.js +78 -0
- package/lib/store/sagas/oauth-saga.test.js +51 -0
- package/lib/store/sagas/process-login-saga.js +62 -0
- package/lib/store/sagas/process-login-saga.test.js +83 -0
- package/lib/store/sagas/visualization-saga.js +371 -0
- package/lib/store/sagas/visualization-saga.test.js +388 -0
- package/lib/store/selectors.js +83 -0
- package/lib/store/visualization-selectors.js +85 -0
- package/lib/store/visualization-selectors.test.js +195 -0
- package/lib/styles/mixins.scss +117 -0
- package/lib/styles/variables.scss +41 -0
- package/lib/utils/file-type-utils.js +18 -0
- package/lib/utils/file-type-utils.test.js +29 -0
- package/lib/utils/geojson-utils.js +70 -0
- package/lib/utils/geojson-utils.test.js +129 -0
- package/lib/utils/http-clients.js +218 -0
- package/lib/utils/http-clients.test.js +88 -0
- package/lib/utils/index.js +34 -0
- package/lib/utils/modified-date-string-builder.js +29 -0
- package/lib/utils/modified-date-string-builder.test.js +93 -0
- package/lib/utils/query-string-builder.js +38 -0
- package/lib/utils/query-string-builder.test.js +33 -0
- package/lib/utils/recommendation-utils.js +12 -0
- package/lib/utils/recommendation-utils.test.js +9 -0
- package/package.json +172 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactRedux = require("react-redux");
|
|
8
|
+
var _chartView = _interopRequireDefault(require("./chart-view"));
|
|
9
|
+
var _querySelectors = require("../../store/query-selectors");
|
|
10
|
+
var _actions = require("../../store/actions");
|
|
11
|
+
var _visualizationSelectors = require("../../store/visualization-selectors");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
var mapStateToProps = function mapStateToProps(state) {
|
|
14
|
+
return {
|
|
15
|
+
dataSources: (0, _querySelectors.getVisualizationDataSources)(state),
|
|
16
|
+
isLoading: (0, _querySelectors.getQueryIsLoading)(state) || (0, _visualizationSelectors.visualizationLoading)(state),
|
|
17
|
+
chart: (0, _visualizationSelectors.visualizationChart)(state)
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
21
|
+
return {
|
|
22
|
+
executeQuery: function executeQuery() {
|
|
23
|
+
return dispatch((0, _actions.executeFreestyleQuery)());
|
|
24
|
+
},
|
|
25
|
+
setChartInformation: function setChartInformation(chart) {
|
|
26
|
+
return dispatch((0, _actions.setChartInformation)(chart));
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
var _default = exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_chartView.default);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _connector = _interopRequireDefault(require("./connector"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var _default = exports.default = _connector.default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactRedux = require("react-redux");
|
|
8
|
+
var _datasetDetailView = _interopRequireDefault(require("./dataset-detail-view"));
|
|
9
|
+
var _actions = require("../../store/actions");
|
|
10
|
+
var _selectors = require("../../store/selectors");
|
|
11
|
+
var _datasetSelectors = require("../../store/dataset-selectors");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
var mapStateToProps = function mapStateToProps(state) {
|
|
14
|
+
return {
|
|
15
|
+
dataset: (0, _selectors.getDataSet)(state),
|
|
16
|
+
isStreaming: (0, _datasetSelectors.isStreamingDataset)(state),
|
|
17
|
+
isIngest: (0, _datasetSelectors.isIngestDataset)(state),
|
|
18
|
+
isRemote: (0, _datasetSelectors.isRemoteDataset)(state),
|
|
19
|
+
isHost: (0, _datasetSelectors.isHostDataset)(state),
|
|
20
|
+
isCsv: (0, _datasetSelectors.isCsvDataset)(state),
|
|
21
|
+
isGeoJSON: (0, _datasetSelectors.isGeoJSONDataset)(state),
|
|
22
|
+
downloadUrl: (0, _datasetSelectors.downloadUrl)(state)
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
26
|
+
return {
|
|
27
|
+
retrieveDatasetDetails: function retrieveDatasetDetails(org_name, dataset_name) {
|
|
28
|
+
return dispatch((0, _actions.retrieveDatasetDetails)(org_name, dataset_name));
|
|
29
|
+
},
|
|
30
|
+
clearDatasetDetails: function clearDatasetDetails() {
|
|
31
|
+
return dispatch((0, _actions.clearDatasetDetails)());
|
|
32
|
+
},
|
|
33
|
+
clearDatasetPreview: function clearDatasetPreview() {
|
|
34
|
+
return dispatch((0, _actions.clearDatasetPreview)());
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
var _default = exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_datasetDetailView.default);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Provider } from 'react-redux'
|
|
2
|
+
import configureStore from 'redux-mock-store'
|
|
3
|
+
import { mount } from 'enzyme'
|
|
4
|
+
import CallToActionButton from '../../components/generic-elements/call-to-action-button'
|
|
5
|
+
import DatasetDetailView from '.'
|
|
6
|
+
|
|
7
|
+
describe('dataset view', () => {
|
|
8
|
+
let storeMocker, state
|
|
9
|
+
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
const matchMedia = jest.fn()
|
|
12
|
+
Object.defineProperty(window, 'matchMedia', {
|
|
13
|
+
writable: true,
|
|
14
|
+
value: jest.fn().mockImplementation(query => ({
|
|
15
|
+
matches: true
|
|
16
|
+
}))
|
|
17
|
+
})
|
|
18
|
+
storeMocker = configureStore([])
|
|
19
|
+
state = {
|
|
20
|
+
datasetReducer: {
|
|
21
|
+
dataset: {
|
|
22
|
+
id: '123',
|
|
23
|
+
sourceType: 'ingest',
|
|
24
|
+
fileTypes: ['CSV'],
|
|
25
|
+
sourceFormat: 'text/csv',
|
|
26
|
+
organization: {},
|
|
27
|
+
schema: [{ name: 'id', type: 'integer', description: 'id description' }]
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
},
|
|
31
|
+
presentation: { dataset_preview: {} }
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it('has a download button with the correct url', () => {
|
|
36
|
+
const store = storeMocker(state)
|
|
37
|
+
|
|
38
|
+
const subject = mount(<Provider store={store}><DatasetDetailView /></Provider>)
|
|
39
|
+
|
|
40
|
+
expect(subject.find(CallToActionButton).props().url).toBe(`${window.DISC_API_URL}/api/v1/dataset/${state.datasetReducer.dataset.id}/download/presigned_url`)
|
|
41
|
+
})
|
|
42
|
+
})
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
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); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _datasetDetails = _interopRequireDefault(require("../../components/dataset-details"));
|
|
10
|
+
var _datasetPreview = _interopRequireDefault(require("../../components/dataset-preview"));
|
|
11
|
+
var _datasetMetadata = _interopRequireDefault(require("../../components/dataset-metadata"));
|
|
12
|
+
var _datasetDictionary = _interopRequireDefault(require("../../components/dataset-dictionary"));
|
|
13
|
+
var _organization = _interopRequireDefault(require("../../components/organization"));
|
|
14
|
+
var _share = _interopRequireDefault(require("../../components/share"));
|
|
15
|
+
require("./dataset-detail-view.scss");
|
|
16
|
+
var _datasetApiDoc = _interopRequireDefault(require("../../components/dataset-api-doc"));
|
|
17
|
+
var _streamingApiDoc = _interopRequireDefault(require("../../components/streaming-api-doc"));
|
|
18
|
+
var _datasetQuality = _interopRequireDefault(require("../../components/dataset-quality"));
|
|
19
|
+
var _geojson = _interopRequireDefault(require("../../components/visualizations/geojson"));
|
|
20
|
+
var _datasetRecommendations = _interopRequireDefault(require("../../components/dataset-recommendations"));
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
23
|
+
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); } }
|
|
24
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
25
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
26
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
27
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
28
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
29
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
30
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
31
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
32
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
33
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
34
|
+
var _default = exports.default = /*#__PURE__*/function (_Component) {
|
|
35
|
+
function _default() {
|
|
36
|
+
_classCallCheck(this, _default);
|
|
37
|
+
return _callSuper(this, _default, arguments);
|
|
38
|
+
}
|
|
39
|
+
_inherits(_default, _Component);
|
|
40
|
+
return _createClass(_default, [{
|
|
41
|
+
key: "componentWillUnmount",
|
|
42
|
+
value: function componentWillUnmount() {
|
|
43
|
+
this.props.clearDatasetPreview();
|
|
44
|
+
this.props.clearDatasetDetails();
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
key: "render",
|
|
48
|
+
value: function render() {
|
|
49
|
+
var dataset = this.props.dataset;
|
|
50
|
+
if (!dataset) {
|
|
51
|
+
return /*#__PURE__*/React.createElement("div", null);
|
|
52
|
+
}
|
|
53
|
+
var _this$props = this.props,
|
|
54
|
+
isStreaming = _this$props.isStreaming,
|
|
55
|
+
isIngest = _this$props.isIngest,
|
|
56
|
+
isRemote = _this$props.isRemote,
|
|
57
|
+
isHost = _this$props.isHost,
|
|
58
|
+
isCsv = _this$props.isCsv,
|
|
59
|
+
isGeoJSON = _this$props.isGeoJSON,
|
|
60
|
+
downloadUrl = _this$props.downloadUrl;
|
|
61
|
+
var streamingExpanded = !isCsv && isStreaming;
|
|
62
|
+
var apiDocExpanded = !isCsv && !isStreaming;
|
|
63
|
+
var showDatasetPreview = isIngest || isStreaming;
|
|
64
|
+
return /*#__PURE__*/React.createElement("dataset-detail-view", null, /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
className: "left-section"
|
|
66
|
+
}, /*#__PURE__*/React.createElement(_organization.default, {
|
|
67
|
+
organization: dataset.organization
|
|
68
|
+
}), /*#__PURE__*/React.createElement(_share.default, null)), /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
className: "dataset-details right-section"
|
|
70
|
+
}, /*#__PURE__*/React.createElement(_datasetDetails.default, {
|
|
71
|
+
dataset: dataset,
|
|
72
|
+
downloadUrl: downloadUrl
|
|
73
|
+
}), (isRemote || isHost) && !isGeoJSON && /*#__PURE__*/React.createElement("div", {
|
|
74
|
+
className: "static-file-explanation"
|
|
75
|
+
}, "This dataset is hosted as a static file and cannot be previewed or queried via the API."), isGeoJSON && /*#__PURE__*/React.createElement(_geojson.default, {
|
|
76
|
+
datasetId: dataset.id
|
|
77
|
+
}), showDatasetPreview && /*#__PURE__*/React.createElement(_datasetPreview.default, {
|
|
78
|
+
datasetId: dataset.id,
|
|
79
|
+
format: isGeoJSON ? 'geojson' : 'json'
|
|
80
|
+
}), isStreaming && /*#__PURE__*/React.createElement(_streamingApiDoc.default, {
|
|
81
|
+
dataset: dataset,
|
|
82
|
+
expanded: streamingExpanded
|
|
83
|
+
}), /*#__PURE__*/React.createElement(_datasetRecommendations.default, {
|
|
84
|
+
dataset: dataset
|
|
85
|
+
}), isIngest && /*#__PURE__*/React.createElement(_datasetApiDoc.default, {
|
|
86
|
+
dataset: dataset,
|
|
87
|
+
expanded: apiDocExpanded
|
|
88
|
+
}), isIngest && /*#__PURE__*/React.createElement(_datasetQuality.default, {
|
|
89
|
+
completeness: dataset.completeness,
|
|
90
|
+
expanded: false
|
|
91
|
+
}), /*#__PURE__*/React.createElement(_datasetDictionary.default, {
|
|
92
|
+
datasetId: dataset.id,
|
|
93
|
+
schema: dataset.schema
|
|
94
|
+
}), /*#__PURE__*/React.createElement(_datasetMetadata.default, {
|
|
95
|
+
dataset: dataset
|
|
96
|
+
})));
|
|
97
|
+
}
|
|
98
|
+
}]);
|
|
99
|
+
}(_react.Component);
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
@import '../../styles/mixins.scss';
|
|
2
|
+
|
|
3
|
+
dataset-detail-view {
|
|
4
|
+
@include page-with-left-bar();
|
|
5
|
+
|
|
6
|
+
dataset-api-doc {
|
|
7
|
+
margin-top: 2.5rem
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.static-file-explanation {
|
|
11
|
+
border: 1px solid #D2D4D6;
|
|
12
|
+
padding: 1rem;
|
|
13
|
+
font-size: 1.1rem;
|
|
14
|
+
font-weight: bold;
|
|
15
|
+
text-align: center;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.resources {
|
|
19
|
+
margin-bottom: 0.75rem
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.name {
|
|
23
|
+
@include header();
|
|
24
|
+
margin-bottom: 0.5rem;
|
|
25
|
+
width: 65%;
|
|
26
|
+
font-size:1.4em;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.table-of-contents a {
|
|
30
|
+
@include link();
|
|
31
|
+
}
|
|
32
|
+
dataset-details .keywords {
|
|
33
|
+
display:block;
|
|
34
|
+
clear:both;
|
|
35
|
+
min-height:60px;
|
|
36
|
+
width:100%;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
dataset-details .keyword {
|
|
40
|
+
background:none;
|
|
41
|
+
border:none;
|
|
42
|
+
padding:0px;
|
|
43
|
+
margin:0;
|
|
44
|
+
color:#00aeef;
|
|
45
|
+
border-radius:0 !important;
|
|
46
|
+
display:block;
|
|
47
|
+
float:left;
|
|
48
|
+
}
|
|
49
|
+
dataset-details .keyword:after {
|
|
50
|
+
content:","
|
|
51
|
+
}
|
|
52
|
+
dataset-details .keyword:last-child:after {
|
|
53
|
+
content:""
|
|
54
|
+
}
|
|
55
|
+
dataset-metadata {
|
|
56
|
+
margin-bottom:2em;
|
|
57
|
+
}
|
|
58
|
+
dataset-quality .completeness-score {
|
|
59
|
+
float:left;
|
|
60
|
+
display:block;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@media only screen and (max-width: 600px) {
|
|
64
|
+
.dataset-detail-view {
|
|
65
|
+
min-width:400px;
|
|
66
|
+
padding:4%;
|
|
67
|
+
}
|
|
68
|
+
dataset-view .header {
|
|
69
|
+
display:none;
|
|
70
|
+
}
|
|
71
|
+
.left-section, .right-section {
|
|
72
|
+
width:100%;
|
|
73
|
+
float:left;
|
|
74
|
+
clear:both;
|
|
75
|
+
display:block;
|
|
76
|
+
}
|
|
77
|
+
dataset-organization .logo {
|
|
78
|
+
display:none;
|
|
79
|
+
}
|
|
80
|
+
share-zone {
|
|
81
|
+
display:none;
|
|
82
|
+
}
|
|
83
|
+
.download-button {
|
|
84
|
+
display:none;
|
|
85
|
+
}
|
|
86
|
+
dataset-details .keywords {
|
|
87
|
+
word-wrap: break-word;
|
|
88
|
+
}
|
|
89
|
+
dataset-detail-view .name, dataset-organization .name {
|
|
90
|
+
font-size:1rem;
|
|
91
|
+
line-height:1.4;
|
|
92
|
+
color:#999999;
|
|
93
|
+
font-weight:normal;
|
|
94
|
+
}
|
|
95
|
+
dataset-organization .organization-header {
|
|
96
|
+
display:none;
|
|
97
|
+
}
|
|
98
|
+
dataset-details .name {
|
|
99
|
+
font-size:1.5rem;
|
|
100
|
+
line-height: 1.5rem;
|
|
101
|
+
width:100%;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
dataset-details .keyword {
|
|
105
|
+
background:none;
|
|
106
|
+
border:none;
|
|
107
|
+
padding:0px;
|
|
108
|
+
margin:0;
|
|
109
|
+
color:#00aeef;
|
|
110
|
+
}
|
|
111
|
+
dataset-details .keyword:after {
|
|
112
|
+
content:","
|
|
113
|
+
}
|
|
114
|
+
.preview-header, collapsable-box .title {
|
|
115
|
+
font-size:1.3rem !important;
|
|
116
|
+
text-transform:uppercase;
|
|
117
|
+
}
|
|
118
|
+
dataset-organization .description {
|
|
119
|
+
display:none;
|
|
120
|
+
}
|
|
121
|
+
api-example .example-table {
|
|
122
|
+
font-size:0.8em;
|
|
123
|
+
line-height:1.2;
|
|
124
|
+
}
|
|
125
|
+
api-example .parameter-example {
|
|
126
|
+
word-wrap: break-word;
|
|
127
|
+
white-space: normal;
|
|
128
|
+
display:table-cell;
|
|
129
|
+
}
|
|
130
|
+
api-example .example-element {
|
|
131
|
+
display: table-cell;
|
|
132
|
+
padding: 10px;
|
|
133
|
+
vertical-align: middle;
|
|
134
|
+
font-size:12px;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
@media only screen and (max-width: 1000px) {
|
|
139
|
+
dataset-organization .name {
|
|
140
|
+
font-size:1rem;
|
|
141
|
+
line-height:1;
|
|
142
|
+
}
|
|
143
|
+
dataset-organization .description {
|
|
144
|
+
font-size:.9rem;
|
|
145
|
+
line-height:1.2;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
@media only screen and (max-width: 830px) {
|
|
149
|
+
dataset-detail-view,.dataset-detail-view {
|
|
150
|
+
min-width:auto;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
@media print {
|
|
156
|
+
body, html {
|
|
157
|
+
width: 100%;
|
|
158
|
+
height: initial !important;
|
|
159
|
+
overflow: initial !important;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.streaming-api-doc,
|
|
163
|
+
.dataset-api-doc,
|
|
164
|
+
.dataset-dictionary {
|
|
165
|
+
display: block;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.dataset-metadata {
|
|
169
|
+
break-inside: avoid;
|
|
170
|
+
display: block;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
header,
|
|
174
|
+
footer,
|
|
175
|
+
.tab-area,
|
|
176
|
+
.left-section,
|
|
177
|
+
.buttons,
|
|
178
|
+
.collapse-icon,
|
|
179
|
+
.geo-json-visualization,
|
|
180
|
+
#dataset-preview,
|
|
181
|
+
.dataset-recommendations,
|
|
182
|
+
.dataset-quality,
|
|
183
|
+
.view-link {
|
|
184
|
+
display: none !important;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.main-app-element {
|
|
188
|
+
margin-top: 0 !important;
|
|
189
|
+
}
|
|
190
|
+
}
|