@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,242 @@
|
|
|
1
|
+
@import "../../styles/variables.scss";
|
|
2
|
+
@import "../../styles/mixins.scss";
|
|
3
|
+
|
|
4
|
+
dataset-list-view {
|
|
5
|
+
@include page-with-left-bar();
|
|
6
|
+
|
|
7
|
+
main-app-element {
|
|
8
|
+
overflow-x: hidden;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.paginator {
|
|
12
|
+
// margin-top: 2rem;
|
|
13
|
+
//width:100%;
|
|
14
|
+
min-width: 322px;
|
|
15
|
+
margin: 0px auto;
|
|
16
|
+
display: block;
|
|
17
|
+
text-align: center;
|
|
18
|
+
padding-top: 20px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.paginator-container {
|
|
22
|
+
width: 100%;
|
|
23
|
+
text-align: center;
|
|
24
|
+
margin-bottom: 20px;
|
|
25
|
+
display: block;
|
|
26
|
+
float: left;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.list-header {
|
|
30
|
+
@include flex-row();
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
width: 100%;
|
|
33
|
+
border-bottom: 2px dotted $medium-grey;
|
|
34
|
+
padding: 2rem 0;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
|
|
37
|
+
.sort-by {
|
|
38
|
+
float: right;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.result-count {
|
|
42
|
+
font-weight: bold;
|
|
43
|
+
font-size: 1.25rem;
|
|
44
|
+
float: left;
|
|
45
|
+
|
|
46
|
+
h1 {
|
|
47
|
+
font-size: 1.25rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
#home {
|
|
51
|
+
display: block;
|
|
52
|
+
margin-top: 15px;
|
|
53
|
+
font-size: 14px;
|
|
54
|
+
color: $dark-blue;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
#home:visited {
|
|
58
|
+
color: $dark-blue;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.sort-select {
|
|
63
|
+
height: 2.25rem;
|
|
64
|
+
width: 18rem;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
select-element .selector {
|
|
68
|
+
border-radius: 4px;
|
|
69
|
+
border: 1px solid #d2d4d6;
|
|
70
|
+
outline: 0;
|
|
71
|
+
color: $dark-gray;
|
|
72
|
+
|
|
73
|
+
&:focus {
|
|
74
|
+
color: $almost-black;
|
|
75
|
+
border: 1px solid $almost-black;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.search {
|
|
81
|
+
height: 2.75rem;
|
|
82
|
+
width: 100%;
|
|
83
|
+
clear: both;
|
|
84
|
+
float: left;
|
|
85
|
+
display: block;
|
|
86
|
+
margin-bottom: 24px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
loading-element {
|
|
91
|
+
@include default-loading-icon();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.login-section {
|
|
96
|
+
width: 100%;
|
|
97
|
+
float: left;
|
|
98
|
+
clear: both;
|
|
99
|
+
display: block;
|
|
100
|
+
margin-top: 25px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.api-checkbox {
|
|
104
|
+
margin: 20px 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.api-checkbox .checkbox {
|
|
108
|
+
float: left;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
error-component {
|
|
112
|
+
text-align: center;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@media only screen and (max-width: 768px) {
|
|
116
|
+
data-card .logo {
|
|
117
|
+
display: none;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@media only screen and (max-width: 600px) {
|
|
122
|
+
|
|
123
|
+
dataset-list-view {
|
|
124
|
+
// min-width:360px;
|
|
125
|
+
// padding:4%;
|
|
126
|
+
display: -webkit-box;
|
|
127
|
+
display: -moz-box;
|
|
128
|
+
display: -ms-flexbox;
|
|
129
|
+
display: -webkit-flex;
|
|
130
|
+
display: flex;
|
|
131
|
+
-webkit-box-orient: vertical;
|
|
132
|
+
-moz-box-orient: vertical;
|
|
133
|
+
-webkit-flex-direction: column;
|
|
134
|
+
-ms-flex-direction: column;
|
|
135
|
+
flex-direction: column;
|
|
136
|
+
/* optional */
|
|
137
|
+
-webkit-box-align: start;
|
|
138
|
+
-moz-box-align: start;
|
|
139
|
+
-ms-flex-align: start;
|
|
140
|
+
-webkit-align-items: flex-start;
|
|
141
|
+
align-items: flex-start;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
login-zone {
|
|
145
|
+
float: left;
|
|
146
|
+
margin-bottom: 0 !important;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.login-section {
|
|
150
|
+
margin-top: 10px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.user-icon {
|
|
154
|
+
margin-left: -5px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
dataset-list-view .list-header,
|
|
158
|
+
dataset-list {
|
|
159
|
+
display: block;
|
|
160
|
+
float: left;
|
|
161
|
+
clear: both;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
dataset-list-view .list-header .result-count {
|
|
165
|
+
width: 100%;
|
|
166
|
+
display: block;
|
|
167
|
+
float: left;
|
|
168
|
+
clear: both;
|
|
169
|
+
margin: 0 0 14px 0;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.list-header {
|
|
173
|
+
padding-top: 10px !important;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.list-header select-element {
|
|
177
|
+
width: 100%;
|
|
178
|
+
display: block;
|
|
179
|
+
float: left;
|
|
180
|
+
clear: both;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.sort-by {
|
|
184
|
+
float: left;
|
|
185
|
+
width: 100%;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
dataset-list-view .left-section,
|
|
189
|
+
dataset-list-view .right-section {
|
|
190
|
+
width: 100%;
|
|
191
|
+
clear: both;
|
|
192
|
+
float: left;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
select-element .selector {
|
|
196
|
+
padding: 10px;
|
|
197
|
+
width: 75%;
|
|
198
|
+
border-radius: 4px;
|
|
199
|
+
border: 1px solid #d2d4d6 !important;
|
|
200
|
+
outline: none !important;
|
|
201
|
+
background-image: url(../../assets/down.png);
|
|
202
|
+
background-repeat: no-repeat;
|
|
203
|
+
background-position: 96% 50%;
|
|
204
|
+
background-size: 20px 20px;
|
|
205
|
+
color: $dark-gray;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
dataset-list-view .left-section,
|
|
209
|
+
dataset-list-view .right-section {
|
|
210
|
+
display: block;
|
|
211
|
+
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
dataset-list-view .left-section {
|
|
215
|
+
float: left;
|
|
216
|
+
clear: both;
|
|
217
|
+
margin-top: 10px;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
dataset-list-view .right-section {
|
|
221
|
+
|
|
222
|
+
clear: both;
|
|
223
|
+
float: right;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
dataset-list-view .search {
|
|
227
|
+
margin: 10px 0 20px 0;
|
|
228
|
+
clear: both;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
data-card .logo {
|
|
232
|
+
display: none;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
data-card .details {
|
|
236
|
+
width: 100%;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
main-app-element {
|
|
240
|
+
overflow-x: hidden;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { shallow } from 'enzyme'
|
|
2
|
+
import DatasetListView from './dataset-list-view'
|
|
3
|
+
import Paginator from '../../components/generic-elements/paginator'
|
|
4
|
+
import Select from '../../components/generic-elements/select'
|
|
5
|
+
import Search from '../../components/generic-elements/search'
|
|
6
|
+
import LoadingElement from '../../components/generic-elements/loading-element'
|
|
7
|
+
import FacetSidebar from '../../components/facet-sidebar'
|
|
8
|
+
import Checkbox from '../../components/generic-elements/checkbox'
|
|
9
|
+
import AlertComponent from '../../components/generic-elements/alert-component'
|
|
10
|
+
|
|
11
|
+
let subject
|
|
12
|
+
|
|
13
|
+
describe('dataset list view', () => {
|
|
14
|
+
describe('action dispatches', () => {
|
|
15
|
+
it('searches datasets with provided search text', () => {
|
|
16
|
+
const updateSearchText = jest.fn()
|
|
17
|
+
|
|
18
|
+
subject = createSubject({ searchParamsManager: { updateSearchText } })
|
|
19
|
+
subject
|
|
20
|
+
.find(Search)
|
|
21
|
+
.props()
|
|
22
|
+
.callback('my search term')
|
|
23
|
+
|
|
24
|
+
expect(updateSearchText).toHaveBeenCalledWith('my search term')
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
it('sorts datasets with provided sort field', () => {
|
|
28
|
+
const updateSortOrder = jest.fn()
|
|
29
|
+
|
|
30
|
+
subject = createSubject({ searchParamsManager: { updateSortOrder } })
|
|
31
|
+
subject
|
|
32
|
+
.find(Select)
|
|
33
|
+
.props()
|
|
34
|
+
.selectChangeCallback('stuff')
|
|
35
|
+
|
|
36
|
+
expect(updateSortOrder).toHaveBeenCalledWith('stuff')
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
it('filters datasets with the provided facets', () => {
|
|
40
|
+
const toggleFacet = jest.fn()
|
|
41
|
+
|
|
42
|
+
subject = createSubject({ searchParamsManager: { toggleFacet } })
|
|
43
|
+
subject
|
|
44
|
+
.find(FacetSidebar)
|
|
45
|
+
.props()
|
|
46
|
+
.clickHandler('organization', 'stuff')
|
|
47
|
+
|
|
48
|
+
expect(toggleFacet).toHaveBeenCalledWith('organization', 'stuff')
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
it('update search results when api accessible toggle is clicked', () => {
|
|
52
|
+
const toggleApiAccessible = jest.fn()
|
|
53
|
+
|
|
54
|
+
subject = createSubject({ searchParamsManager: { toggleApiAccessible } })
|
|
55
|
+
|
|
56
|
+
subject
|
|
57
|
+
.find(Checkbox)
|
|
58
|
+
.props()
|
|
59
|
+
.clickHandler()
|
|
60
|
+
|
|
61
|
+
expect(toggleApiAccessible).toHaveBeenCalled()
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
it('update search results when page is changed', () => {
|
|
65
|
+
const updatePage = jest.fn()
|
|
66
|
+
|
|
67
|
+
subject = createSubject({ searchParamsManager: { updatePage } })
|
|
68
|
+
subject
|
|
69
|
+
.find(Paginator)
|
|
70
|
+
.props()
|
|
71
|
+
.pageChangeCallback(9000)
|
|
72
|
+
|
|
73
|
+
expect(updatePage).toHaveBeenCalledWith(9000)
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
it('closes the alert dialog', () => {
|
|
77
|
+
const dismissFn = jest.fn()
|
|
78
|
+
|
|
79
|
+
subject = createSubject({ isGlobalError: true, globalErrorMessage: 'oops!', dismissGlobalError: dismissFn })
|
|
80
|
+
subject
|
|
81
|
+
.find(AlertComponent)
|
|
82
|
+
.props()
|
|
83
|
+
.closeFunction()
|
|
84
|
+
|
|
85
|
+
expect(dismissFn).toHaveBeenCalledTimes(1)
|
|
86
|
+
})
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
describe('renders correctly', () => {
|
|
90
|
+
it('sets the paginator total count based on the props', () => {
|
|
91
|
+
const expectedNumberOfPages = 4
|
|
92
|
+
subject = createSubject({ numberOfPages: expectedNumberOfPages })
|
|
93
|
+
expect(subject.find(Paginator).props().numberOfPages).toEqual(
|
|
94
|
+
expectedNumberOfPages
|
|
95
|
+
)
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
it('shows a loading spinner when the loading property is true', () => {
|
|
99
|
+
subject = createSubject({ isSearchLoading: true })
|
|
100
|
+
expect(subject.find(LoadingElement)).toHaveLength(1)
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
it('does not show a loading spinner when the loading property is false', () => {
|
|
104
|
+
subject = createSubject({ isSearchLoading: false })
|
|
105
|
+
expect(subject.find(LoadingElement)).toHaveLength(0)
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
it('apiAccessible is checked when supplied property is true', () => {
|
|
109
|
+
subject = createSubject({ searchParamsManager: { apiAccessible: true } })
|
|
110
|
+
expect(subject.find(Checkbox).props().selected).toBeTruthy()
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
it('apiAccessible is not checked when supplied property is false', () => {
|
|
114
|
+
subject = createSubject({ searchParamsManager: { apiAccessible: false } })
|
|
115
|
+
expect(subject.find(Checkbox).props().selected).toBeFalsy()
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
it('search component is given search text from the query params manager', () => {
|
|
119
|
+
subject = createSubject({ searchParamsManager: { searchText: 'hullo' } })
|
|
120
|
+
expect(subject.find(Search).props().defaultText).toEqual('hullo')
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
it('sort order dropdown is given the sort order from the query params manager', () => {
|
|
124
|
+
subject = createSubject({ searchParamsManager: { sortOrder: 'last_mod' } })
|
|
125
|
+
expect(subject.find(Select).props().options).toContainEqual(
|
|
126
|
+
expect.objectContaining({
|
|
127
|
+
value: 'last_mod',
|
|
128
|
+
default: true
|
|
129
|
+
})
|
|
130
|
+
)
|
|
131
|
+
})
|
|
132
|
+
})
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
function createSubject (props, queryString = '') {
|
|
136
|
+
const defaultProps = {
|
|
137
|
+
isSearchLoading: false,
|
|
138
|
+
searchMetadata: {},
|
|
139
|
+
searchResults: [],
|
|
140
|
+
numberOfPages: 2,
|
|
141
|
+
searchParamsManager: {},
|
|
142
|
+
dismissGlobalError: jest.fn()
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const defaultSearchParams = {
|
|
146
|
+
apiAccessible: true,
|
|
147
|
+
sortOrder: 'name_asc',
|
|
148
|
+
page: 1,
|
|
149
|
+
searchText: '',
|
|
150
|
+
facets: {},
|
|
151
|
+
|
|
152
|
+
toggleApiAccessible: jest.fn(),
|
|
153
|
+
updateSortOrder: jest.fn(),
|
|
154
|
+
updateSearchText: jest.fn(),
|
|
155
|
+
updatePage: jest.fn()
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const propsWithDefaults = Object.assign({}, defaultProps, props)
|
|
159
|
+
propsWithDefaults.searchParamsManager = Object.assign({}, defaultSearchParams, props.searchParamsManager)
|
|
160
|
+
|
|
161
|
+
return shallow(<DatasetListView {...propsWithDefaults} />)
|
|
162
|
+
}
|
|
@@ -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,55 @@
|
|
|
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 _datasetView = _interopRequireDefault(require("./dataset-view"));
|
|
9
|
+
var _actions = require("../../store/actions");
|
|
10
|
+
var _datasetSelectors = require("../../store/dataset-selectors");
|
|
11
|
+
var _querySelectors = require("../../store/query-selectors");
|
|
12
|
+
var _visualizationSelectors = require("../../store/visualization-selectors");
|
|
13
|
+
var _auth0Wrapper = _interopRequireDefault(require("../../auth/auth0-wrapper"));
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
var mapStateToProps = function mapStateToProps(state) {
|
|
16
|
+
return {
|
|
17
|
+
visualizationId: (0, _visualizationSelectors.visualizationID)(state),
|
|
18
|
+
query: (0, _querySelectors.getFreestyleQueryText)(state),
|
|
19
|
+
title: (0, _visualizationSelectors.visualizationTitle)(state),
|
|
20
|
+
allowedActions: (0, _visualizationSelectors.visualizationAllowedActions)(state),
|
|
21
|
+
dataset: (0, _datasetSelectors.getDataset)(state),
|
|
22
|
+
isDatasetLoaded: (0, _datasetSelectors.isDatasetLoaded)(state),
|
|
23
|
+
isRemoteDataset: (0, _datasetSelectors.isRemoteDataset)(state),
|
|
24
|
+
isHostDataset: (0, _datasetSelectors.isHostDataset)(state),
|
|
25
|
+
shouldAutoExecuteQuery: (0, _querySelectors.shouldAutoExecuteQuery)(state),
|
|
26
|
+
isSaveable: (0, _visualizationSelectors.isVisualizationSaveable)(state),
|
|
27
|
+
isSaveFailure: (0, _visualizationSelectors.visualizationSaveFailure)(state),
|
|
28
|
+
isSaveSuccess: (0, _visualizationSelectors.visualizationSaveSuccess)(state)
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
32
|
+
return {
|
|
33
|
+
save: function save(_ref) {
|
|
34
|
+
var id = _ref.id,
|
|
35
|
+
title = _ref.title,
|
|
36
|
+
query = _ref.query,
|
|
37
|
+
shouldCreateCopy = _ref.shouldCreateCopy;
|
|
38
|
+
return dispatch((0, _actions.visualizationSave)({
|
|
39
|
+
id: id,
|
|
40
|
+
title: title,
|
|
41
|
+
query: query,
|
|
42
|
+
shouldCreateCopy: shouldCreateCopy
|
|
43
|
+
}));
|
|
44
|
+
},
|
|
45
|
+
retrieveDatasetDetails: function retrieveDatasetDetails(org_name, dataset_name) {
|
|
46
|
+
return dispatch((0, _actions.retrieveDatasetDetails)(org_name, dataset_name));
|
|
47
|
+
},
|
|
48
|
+
reset: function reset() {
|
|
49
|
+
dispatch((0, _actions.visualizationReset)());
|
|
50
|
+
dispatch((0, _actions.resetQuery)());
|
|
51
|
+
dispatch((0, _actions.resetDatasetReferences)());
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
var _default = exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)((0, _auth0Wrapper.default)(_datasetView.default));
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Provider } from 'react-redux'
|
|
2
|
+
import configureStore from 'redux-mock-store'
|
|
3
|
+
import { mount } from 'enzyme'
|
|
4
|
+
import { Router } from 'react-router'
|
|
5
|
+
import { createMemoryHistory } from 'history'
|
|
6
|
+
import ConnectedDatasetView from '.'
|
|
7
|
+
import DatasetView from './dataset-view'
|
|
8
|
+
import VisualizationSaveMenuItem from '../../components/visualization-save-menu-item'
|
|
9
|
+
import { visualizationSave } from '../../store/actions'
|
|
10
|
+
import Auth0Client from '../../auth/auth0-client-provider'
|
|
11
|
+
|
|
12
|
+
const fakeAuth0Client = {
|
|
13
|
+
isAuthenticated: () => Promise.resolve(false)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
describe('visualization view', () => {
|
|
17
|
+
let storeMocker, state, store, subject
|
|
18
|
+
|
|
19
|
+
const id = 'id'
|
|
20
|
+
const tableName = 'table_name'
|
|
21
|
+
const query = 'SELECT * FROM table_name\nLIMIT 200'
|
|
22
|
+
const title = 'title'
|
|
23
|
+
const chart = { data: [], layout: {}, frames: [] }
|
|
24
|
+
|
|
25
|
+
beforeEach(() => {
|
|
26
|
+
const matchMedia = jest.fn()
|
|
27
|
+
Object.defineProperty(window, 'matchMedia', {
|
|
28
|
+
writable: true,
|
|
29
|
+
value: jest.fn().mockImplementation(query => ({
|
|
30
|
+
matches: true
|
|
31
|
+
}))
|
|
32
|
+
})
|
|
33
|
+
Auth0Client.get = jest.fn(() => Promise.resolve(fakeAuth0Client))
|
|
34
|
+
storeMocker = configureStore([])
|
|
35
|
+
state = {
|
|
36
|
+
visualization: {
|
|
37
|
+
visualization: {
|
|
38
|
+
id, title, allowedActions: [{ name: 'create_copy' }]
|
|
39
|
+
},
|
|
40
|
+
chart
|
|
41
|
+
},
|
|
42
|
+
queryReducer: { isQueryLoading: false },
|
|
43
|
+
datasetReducer: {
|
|
44
|
+
dataset: {
|
|
45
|
+
id: '123',
|
|
46
|
+
systemName: tableName,
|
|
47
|
+
organization: {}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
presentation: {}
|
|
51
|
+
}
|
|
52
|
+
store = storeMocker(state)
|
|
53
|
+
|
|
54
|
+
const fakeRouterMatch = { params: {} }
|
|
55
|
+
const fakeLocation = { search: '?selectedIndex=1' }
|
|
56
|
+
const history = createMemoryHistory()
|
|
57
|
+
subject = mount(
|
|
58
|
+
<Provider store={store}>
|
|
59
|
+
<Router history={history}>
|
|
60
|
+
<ConnectedDatasetView match={fakeRouterMatch} location={fakeLocation} />
|
|
61
|
+
</Router>
|
|
62
|
+
</Provider>
|
|
63
|
+
)
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
it('visualization allowedActions are passed to VisualizationSaveMenuItem', () => {
|
|
67
|
+
expect(subject.find(VisualizationSaveMenuItem).props().allowedActions).toEqual(['create_copy'])
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
it('dispatches the proper visualizationSave action when visualization is saved as a copy', () => {
|
|
71
|
+
const shouldCreateCopy = true
|
|
72
|
+
subject.find(DatasetView).setState({ localTitle: title })
|
|
73
|
+
|
|
74
|
+
subject.find(VisualizationSaveMenuItem).props().handleSaveOrUpdate({ shouldCreateCopy })
|
|
75
|
+
|
|
76
|
+
expect(store.getActions()).toContainEqual(visualizationSave({ id, query, title, shouldCreateCopy }))
|
|
77
|
+
})
|
|
78
|
+
})
|