@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.
Files changed (316) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +118 -0
  3. package/lib/ReactDiscoveryUI.js +103 -0
  4. package/lib/ReactDiscoveryUI.scss +13 -0
  5. package/lib/assets/arrow.svg +6 -0
  6. package/lib/assets/blk-database.svg +48 -0
  7. package/lib/assets/chart.svg +1 -0
  8. package/lib/assets/down.png +0 -0
  9. package/lib/assets/down.svg +1 -0
  10. package/lib/assets/folder_icon.png +0 -0
  11. package/lib/assets/folder_icon.svg +1 -0
  12. package/lib/assets/ic_arrow.svg +15 -0
  13. package/lib/assets/loadingicon.svg +57 -0
  14. package/lib/assets/no_image.png +0 -0
  15. package/lib/assets/plus.png +0 -0
  16. package/lib/assets/plus.svg +1 -0
  17. package/lib/assets/user.svg +1 -0
  18. package/lib/auth/auth0-client-provider.js +37 -0
  19. package/lib/auth/auth0-client-provider.test.js +33 -0
  20. package/lib/auth/auth0-wrapper.js +155 -0
  21. package/lib/auth/auth0-wrapper.test.js +100 -0
  22. package/lib/components/auth0-login-zone/auth0-login-zone.js +147 -0
  23. package/lib/components/auth0-login-zone/auth0-login-zone.test.js +177 -0
  24. package/lib/components/auth0-login-zone/index.js +9 -0
  25. package/lib/components/code-editor/code-editor.css +173 -0
  26. package/lib/components/code-editor/code-editor.js +64 -0
  27. package/lib/components/code-editor/index.js +9 -0
  28. package/lib/components/collapsable-box/collapsable-box.js +81 -0
  29. package/lib/components/collapsable-box/collapsable-box.scss +39 -0
  30. package/lib/components/collapsable-box/collapsable-box.test.js +87 -0
  31. package/lib/components/collapsable-box/index.js +9 -0
  32. package/lib/components/data-card/data-card.js +63 -0
  33. package/lib/components/data-card/data-card.scss +93 -0
  34. package/lib/components/data-card/data-card.test.js +74 -0
  35. package/lib/components/data-card/index.js +9 -0
  36. package/lib/components/data-view/data-view.js +194 -0
  37. package/lib/components/data-view/data-view.scss +39 -0
  38. package/lib/components/data-view/data-view.test.js +155 -0
  39. package/lib/components/data-view/index.js +9 -0
  40. package/lib/components/dataset-api-doc/api-example.js +120 -0
  41. package/lib/components/dataset-api-doc/api-example.scss +84 -0
  42. package/lib/components/dataset-api-doc/api-example.test.js +88 -0
  43. package/lib/components/dataset-api-doc/dataset-api-doc.js +117 -0
  44. package/lib/components/dataset-api-doc/dataset-api-doc.scss +8 -0
  45. package/lib/components/dataset-api-doc/dataset-api-doc.test.js +42 -0
  46. package/lib/components/dataset-api-doc/index.js +9 -0
  47. package/lib/components/dataset-details/dataset-details.js +64 -0
  48. package/lib/components/dataset-details/dataset-details.scss +58 -0
  49. package/lib/components/dataset-details/dataset-details.test.js +38 -0
  50. package/lib/components/dataset-details/index.js +9 -0
  51. package/lib/components/dataset-dictionary/dataset-dictionary.js +127 -0
  52. package/lib/components/dataset-dictionary/dataset-dictionary.scss +42 -0
  53. package/lib/components/dataset-dictionary/dataset-dictionary.test.js +286 -0
  54. package/lib/components/dataset-dictionary/index.js +9 -0
  55. package/lib/components/dataset-list/dataset-list.js +22 -0
  56. package/lib/components/dataset-list/dataset-list.scss +9 -0
  57. package/lib/components/dataset-list/dataset-list.test.js +16 -0
  58. package/lib/components/dataset-list/index.js +9 -0
  59. package/lib/components/dataset-metadata/dataset-metadata.js +169 -0
  60. package/lib/components/dataset-metadata/dataset-metadata.scss +34 -0
  61. package/lib/components/dataset-metadata/dataset-metadata.test.js +24 -0
  62. package/lib/components/dataset-metadata/index.js +9 -0
  63. package/lib/components/dataset-preview/connector.js +26 -0
  64. package/lib/components/dataset-preview/dataset-preview.js +58 -0
  65. package/lib/components/dataset-preview/dataset-preview.scss +24 -0
  66. package/lib/components/dataset-preview/dataset-preview.test.js +34 -0
  67. package/lib/components/dataset-preview/index.js +9 -0
  68. package/lib/components/dataset-quality/dataset-quality.js +56 -0
  69. package/lib/components/dataset-quality/dataset-quality.scss +24 -0
  70. package/lib/components/dataset-quality/dataset-quality.test.js +34 -0
  71. package/lib/components/dataset-quality/index.js +9 -0
  72. package/lib/components/dataset-recommendations/connector.js +24 -0
  73. package/lib/components/dataset-recommendations/dataset-recommendations.js +47 -0
  74. package/lib/components/dataset-recommendations/dataset-recommendations.scss +17 -0
  75. package/lib/components/dataset-recommendations/dataset-recommendations.test.js +37 -0
  76. package/lib/components/dataset-recommendations/index.js +9 -0
  77. package/lib/components/detail-toggle-icon/detail-toggle-icon.js +41 -0
  78. package/lib/components/detail-toggle-icon/detail-toggle-icon.scss +13 -0
  79. package/lib/components/detail-toggle-icon/detail-toggle-icon.test.js +20 -0
  80. package/lib/components/detail-toggle-icon/index.js +9 -0
  81. package/lib/components/facet-list/facet-list.js +47 -0
  82. package/lib/components/facet-list/facet-list.scss +19 -0
  83. package/lib/components/facet-list/facet-list.test.js +94 -0
  84. package/lib/components/facet-list/index.js +9 -0
  85. package/lib/components/facet-sidebar/facet-sidebar.js +101 -0
  86. package/lib/components/facet-sidebar/facet-sidebar.scss +129 -0
  87. package/lib/components/facet-sidebar/facet-sidebar.test.js +93 -0
  88. package/lib/components/facet-sidebar/index.js +9 -0
  89. package/lib/components/generic-elements/alert-component/alert-component.js +51 -0
  90. package/lib/components/generic-elements/alert-component/alert-component.scss +26 -0
  91. package/lib/components/generic-elements/alert-component/alert-component.test.js +26 -0
  92. package/lib/components/generic-elements/alert-component/index.js +9 -0
  93. package/lib/components/generic-elements/arrow-button/arrow-button.js +30 -0
  94. package/lib/components/generic-elements/arrow-button/index.js +9 -0
  95. package/lib/components/generic-elements/auto-anchoring-popover/index.js +61 -0
  96. package/lib/components/generic-elements/back-button/back-button.js +14 -0
  97. package/lib/components/generic-elements/back-button/back-button.scss +14 -0
  98. package/lib/components/generic-elements/back-button/index.js +9 -0
  99. package/lib/components/generic-elements/call-to-action-button/call-to-action-button.js +118 -0
  100. package/lib/components/generic-elements/call-to-action-button/call-to-action-button.scss +19 -0
  101. package/lib/components/generic-elements/call-to-action-button/call-to-action-button.test.js +68 -0
  102. package/lib/components/generic-elements/call-to-action-button/index.js +9 -0
  103. package/lib/components/generic-elements/chart-icon/index.js +23 -0
  104. package/lib/components/generic-elements/checkbox/checkbox.js +50 -0
  105. package/lib/components/generic-elements/checkbox/checkbox.scss +44 -0
  106. package/lib/components/generic-elements/checkbox/checkbox.test.js +71 -0
  107. package/lib/components/generic-elements/checkbox/index.js +9 -0
  108. package/lib/components/generic-elements/error-component/error-component.js +21 -0
  109. package/lib/components/generic-elements/error-component/error-component.scss +16 -0
  110. package/lib/components/generic-elements/error-component/error-component.test.js +12 -0
  111. package/lib/components/generic-elements/error-component/index.js +9 -0
  112. package/lib/components/generic-elements/folder-icon/index.js +23 -0
  113. package/lib/components/generic-elements/generated-link/generated-link.js +25 -0
  114. package/lib/components/generic-elements/generated-link/index.js +13 -0
  115. package/lib/components/generic-elements/loading-element/index.js +9 -0
  116. package/lib/components/generic-elements/loading-element/loading-element.js +22 -0
  117. package/lib/components/generic-elements/loading-element/loading-element.scss +6 -0
  118. package/lib/components/generic-elements/loading-element/loading-element.test.js +11 -0
  119. package/lib/components/generic-elements/paginator/index.js +9 -0
  120. package/lib/components/generic-elements/paginator/paginator.js +84 -0
  121. package/lib/components/generic-elements/paginator/paginator.scss +38 -0
  122. package/lib/components/generic-elements/paginator/paginator.test.js +140 -0
  123. package/lib/components/generic-elements/plus-icon/index.js +21 -0
  124. package/lib/components/generic-elements/save-indicator/index.js +9 -0
  125. package/lib/components/generic-elements/save-indicator/save-indicator.js +39 -0
  126. package/lib/components/generic-elements/save-indicator/save-indicator.scss +31 -0
  127. package/lib/components/generic-elements/save-indicator/save-indicator.test.js +89 -0
  128. package/lib/components/generic-elements/search/index.js +9 -0
  129. package/lib/components/generic-elements/search/search.js +93 -0
  130. package/lib/components/generic-elements/search/search.scss +90 -0
  131. package/lib/components/generic-elements/search/search.test.js +41 -0
  132. package/lib/components/generic-elements/select/index.js +9 -0
  133. package/lib/components/generic-elements/select/select.js +44 -0
  134. package/lib/components/generic-elements/select/select.scss +22 -0
  135. package/lib/components/generic-elements/select/select.test.js +34 -0
  136. package/lib/components/generic-elements/share-link/index.js +9 -0
  137. package/lib/components/generic-elements/share-link/share-link.js +23 -0
  138. package/lib/components/generic-elements/share-link/share-link.scss +17 -0
  139. package/lib/components/generic-elements/share-link/share-link.test.js +28 -0
  140. package/lib/components/generic-elements/sql-icon/index.js +20 -0
  141. package/lib/components/generic-elements/tab-button/index.js +9 -0
  142. package/lib/components/generic-elements/tab-button/tab-button.js +25 -0
  143. package/lib/components/generic-elements/tab-button/tab-button.scss +27 -0
  144. package/lib/components/generic-elements/visualize-button/index.js +9 -0
  145. package/lib/components/generic-elements/visualize-button/visualize-button.js +37 -0
  146. package/lib/components/generic-elements/visualize-button/visualize-button.scss +14 -0
  147. package/lib/components/login-zone/connector.js +25 -0
  148. package/lib/components/login-zone/index.js +9 -0
  149. package/lib/components/login-zone/login-svgs-and-text.js +39 -0
  150. package/lib/components/login-zone/login-zone.js +21 -0
  151. package/lib/components/login-zone/login-zone.scss +115 -0
  152. package/lib/components/login-zone/login-zone.test.js +17 -0
  153. package/lib/components/login-zone/login.js +48 -0
  154. package/lib/components/login-zone/logout.js +39 -0
  155. package/lib/components/network-loading-element/connector.js +17 -0
  156. package/lib/components/network-loading-element/index.js +9 -0
  157. package/lib/components/network-loading-element/network-loading-element.js +23 -0
  158. package/lib/components/network-loading-element/network-loading-element.scss +21 -0
  159. package/lib/components/network-loading-element/network-loading-element.test.js +34 -0
  160. package/lib/components/organization/index.js +9 -0
  161. package/lib/components/organization/organization.js +27 -0
  162. package/lib/components/organization/organization.scss +32 -0
  163. package/lib/components/protected-route/protected-route.js +101 -0
  164. package/lib/components/protected-route/protected-route.scss +4 -0
  165. package/lib/components/protected-route/protected-route.test.js +63 -0
  166. package/lib/components/query-form/index.js +9 -0
  167. package/lib/components/query-form/query-form.js +262 -0
  168. package/lib/components/query-form/query-form.scss +167 -0
  169. package/lib/components/query-form/query-form.test.js +248 -0
  170. package/lib/components/recommendation-list/index.js +9 -0
  171. package/lib/components/recommendation-list/recommendation-list.js +72 -0
  172. package/lib/components/recommendation-list/recommendation-list.scss +61 -0
  173. package/lib/components/recommendation-list/recommendation-list.test.js +38 -0
  174. package/lib/components/remote-toggle/__snapshots__/remote-toggle.test.js.snap +3 -0
  175. package/lib/components/remote-toggle/index.js +13 -0
  176. package/lib/components/remote-toggle/remote-toggle.js +35 -0
  177. package/lib/components/remote-toggle/remote-toggle.scss +0 -0
  178. package/lib/components/remote-toggle/remote-toggle.test.js +10 -0
  179. package/lib/components/share/index.js +9 -0
  180. package/lib/components/share/share.js +109 -0
  181. package/lib/components/share/share.scss +66 -0
  182. package/lib/components/streaming-api-doc/index.js +9 -0
  183. package/lib/components/streaming-api-doc/streaming-api-doc.js +76 -0
  184. package/lib/components/streaming-api-doc/streaming-api-doc.scss +23 -0
  185. package/lib/components/streaming-api-doc/streaming-api-doc.test.js +24 -0
  186. package/lib/components/tooltip/index.js +9 -0
  187. package/lib/components/tooltip/tooltip.js +17 -0
  188. package/lib/components/tooltip/tooltip.scss +16 -0
  189. package/lib/components/tooltip/tooltip.test.js +19 -0
  190. package/lib/components/visualization-list-menu-item/index.js +9 -0
  191. package/lib/components/visualization-list-menu-item/visualization-list-menu-item.js +53 -0
  192. package/lib/components/visualization-list-menu-item/visualization-list-menu-item.scss +21 -0
  193. package/lib/components/visualization-list-menu-item/visualization-list-menu-item.test.js +42 -0
  194. package/lib/components/visualization-save-menu-item/index.js +9 -0
  195. package/lib/components/visualization-save-menu-item/visualization-save-menu-item.js +101 -0
  196. package/lib/components/visualization-save-menu-item/visualization-save-menu-item.scss +37 -0
  197. package/lib/components/visualization-save-menu-item/visualization-save-menu-item.test.js +185 -0
  198. package/lib/components/visualizations/geojson/connector.js +29 -0
  199. package/lib/components/visualizations/geojson/geojson-visualization.js +151 -0
  200. package/lib/components/visualizations/geojson/geojson-visualization.scss +24 -0
  201. package/lib/components/visualizations/geojson/geojson-visualization.test.js +238 -0
  202. package/lib/components/visualizations/geojson/index.js +9 -0
  203. package/lib/pages/apikey-view/apiKey-view.test.js +204 -0
  204. package/lib/pages/apikey-view/apikey-view.js +166 -0
  205. package/lib/pages/apikey-view/apikey-view.scss +340 -0
  206. package/lib/pages/apikey-view/connector.js +31 -0
  207. package/lib/pages/apikey-view/index.js +9 -0
  208. package/lib/pages/chart-view/chart-view.js +92 -0
  209. package/lib/pages/chart-view/chart-view.scss +35 -0
  210. package/lib/pages/chart-view/chart-view.test.js +206 -0
  211. package/lib/pages/chart-view/connector.js +30 -0
  212. package/lib/pages/chart-view/index.js +9 -0
  213. package/lib/pages/dataset-detail-view/connector.js +38 -0
  214. package/lib/pages/dataset-detail-view/dataset-detail-view-connector.test.js +42 -0
  215. package/lib/pages/dataset-detail-view/dataset-detail-view.js +99 -0
  216. package/lib/pages/dataset-detail-view/dataset-detail-view.scss +190 -0
  217. package/lib/pages/dataset-detail-view/dataset-detail-view.test.js +305 -0
  218. package/lib/pages/dataset-detail-view/index.js +9 -0
  219. package/lib/pages/dataset-list-view/connector.js +30 -0
  220. package/lib/pages/dataset-list-view/dataset-list-view.js +132 -0
  221. package/lib/pages/dataset-list-view/dataset-list-view.scss +242 -0
  222. package/lib/pages/dataset-list-view/dataset-list-view.test.js +162 -0
  223. package/lib/pages/dataset-list-view/index.js +9 -0
  224. package/lib/pages/dataset-view/connector.js +55 -0
  225. package/lib/pages/dataset-view/dataset-view-connector.test.js +78 -0
  226. package/lib/pages/dataset-view/dataset-view.js +175 -0
  227. package/lib/pages/dataset-view/dataset-view.scss +95 -0
  228. package/lib/pages/dataset-view/dataset-view.test.js +157 -0
  229. package/lib/pages/dataset-view/index.js +9 -0
  230. package/lib/pages/login-view/connector.js +25 -0
  231. package/lib/pages/login-view/index.js +9 -0
  232. package/lib/pages/login-view/login-view.js +83 -0
  233. package/lib/pages/login-view/login-view.scss +62 -0
  234. package/lib/pages/login-view/login-view.test.js +23 -0
  235. package/lib/pages/oauth-error-view/index.js +9 -0
  236. package/lib/pages/oauth-error-view/oauth-error-view.js +25 -0
  237. package/lib/pages/oauth-error-view/oauth-error-view.scss +13 -0
  238. package/lib/pages/oauth-error-view/oauth-error-view.test.js +13 -0
  239. package/lib/pages/oauth-view/connector.js +22 -0
  240. package/lib/pages/oauth-view/index.js +9 -0
  241. package/lib/pages/oauth-view/oauth-view.js +124 -0
  242. package/lib/pages/oauth-view/oauth-view.scss +7 -0
  243. package/lib/pages/oauth-view/oauth-view.test.js +195 -0
  244. package/lib/pages/query-view/connector.js +40 -0
  245. package/lib/pages/query-view/index.js +9 -0
  246. package/lib/pages/query-view/query-view.js +80 -0
  247. package/lib/pages/query-view/query-view.scss +39 -0
  248. package/lib/pages/query-view/query-view.test.js +104 -0
  249. package/lib/pages/user-profile-view/connector.js +39 -0
  250. package/lib/pages/user-profile-view/index.js +9 -0
  251. package/lib/pages/user-profile-view/user-profile-view.js +154 -0
  252. package/lib/pages/user-profile-view/user-profile-view.scss +81 -0
  253. package/lib/pages/user-profile-view/user-profile-view.test.js +129 -0
  254. package/lib/pages/visualization-view/connector.js +52 -0
  255. package/lib/pages/visualization-view/index.js +9 -0
  256. package/lib/pages/visualization-view/visualization-view-connector.test.js +62 -0
  257. package/lib/pages/visualization-view/visualization-view.js +128 -0
  258. package/lib/pages/visualization-view/visualization-view.scss +115 -0
  259. package/lib/pages/visualization-view/visualization-view.test.js +188 -0
  260. package/lib/routes.js +18 -0
  261. package/lib/search-params/search-params-manager.js +171 -0
  262. package/lib/search-params/search-params-manager.test.js +490 -0
  263. package/lib/store/actions.js +428 -0
  264. package/lib/store/dataset-selectors.js +47 -0
  265. package/lib/store/dataset-selectors.test.js +154 -0
  266. package/lib/store/query-selectors.js +53 -0
  267. package/lib/store/query-selectors.test.js +153 -0
  268. package/lib/store/reducers/index.js +20 -0
  269. package/lib/store/reducers/query-reducer.js +52 -0
  270. package/lib/store/reducers/query-reducer.test.js +89 -0
  271. package/lib/store/reducers/reducers.js +196 -0
  272. package/lib/store/reducers/reducers.test.js +309 -0
  273. package/lib/store/reducers/visualization-reducer.js +167 -0
  274. package/lib/store/reducers/visualization-reducer.test.js +426 -0
  275. package/lib/store/sagas/api-invoker.js +79 -0
  276. package/lib/store/sagas/api-invoker.test.js +139 -0
  277. package/lib/store/sagas/apiKey-saga.js +81 -0
  278. package/lib/store/sagas/apiKey-saga.test.js +57 -0
  279. package/lib/store/sagas/dataset-download-saga.js +43 -0
  280. package/lib/store/sagas/dataset-list-saga.js +49 -0
  281. package/lib/store/sagas/dataset-list-saga.test.js +72 -0
  282. package/lib/store/sagas/dataset-preview-saga.js +44 -0
  283. package/lib/store/sagas/dataset-query-saga.js +43 -0
  284. package/lib/store/sagas/dataset-recommendation-saga.js +40 -0
  285. package/lib/store/sagas/dataset-saga.js +50 -0
  286. package/lib/store/sagas/freestyle-query-saga.js +127 -0
  287. package/lib/store/sagas/freestyle-query-saga.test.js +145 -0
  288. package/lib/store/sagas/index.js +44 -0
  289. package/lib/store/sagas/login-saga.js +85 -0
  290. package/lib/store/sagas/login-saga.test.js +84 -0
  291. package/lib/store/sagas/logout-saga.js +96 -0
  292. package/lib/store/sagas/oauth-saga.js +78 -0
  293. package/lib/store/sagas/oauth-saga.test.js +51 -0
  294. package/lib/store/sagas/process-login-saga.js +62 -0
  295. package/lib/store/sagas/process-login-saga.test.js +83 -0
  296. package/lib/store/sagas/visualization-saga.js +371 -0
  297. package/lib/store/sagas/visualization-saga.test.js +388 -0
  298. package/lib/store/selectors.js +83 -0
  299. package/lib/store/visualization-selectors.js +85 -0
  300. package/lib/store/visualization-selectors.test.js +195 -0
  301. package/lib/styles/mixins.scss +117 -0
  302. package/lib/styles/variables.scss +41 -0
  303. package/lib/utils/file-type-utils.js +18 -0
  304. package/lib/utils/file-type-utils.test.js +29 -0
  305. package/lib/utils/geojson-utils.js +70 -0
  306. package/lib/utils/geojson-utils.test.js +129 -0
  307. package/lib/utils/http-clients.js +218 -0
  308. package/lib/utils/http-clients.test.js +88 -0
  309. package/lib/utils/index.js +34 -0
  310. package/lib/utils/modified-date-string-builder.js +29 -0
  311. package/lib/utils/modified-date-string-builder.test.js +93 -0
  312. package/lib/utils/query-string-builder.js +38 -0
  313. package/lib/utils/query-string-builder.test.js +33 -0
  314. package/lib/utils/recommendation-utils.js +12 -0
  315. package/lib/utils/recommendation-utils.test.js +9 -0
  316. package/package.json +172 -0
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = require("react");
8
+ var _reactTooltip = _interopRequireDefault(require("react-tooltip"));
9
+ var _propTypes = _interopRequireDefault(require("prop-types"));
10
+ require("./recommendation-list.scss");
11
+ var _reactCopyToClipboard = require("react-copy-to-clipboard");
12
+ var _utils = require("../../utils");
13
+ var _FilterNone = _interopRequireDefault(require("@material-ui/icons/FilterNone"));
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
16
+ 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."); }
17
+ 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; } }
18
+ 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; }
19
+ 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; } }
20
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
21
+ var RecommendationList = function RecommendationList(props) {
22
+ var recommendations = props.recommendations;
23
+ var _useState = (0, _react.useState)(false),
24
+ _useState2 = _slicedToArray(_useState, 2),
25
+ showTooltipAsCopied = _useState2[0],
26
+ setShowTooltipAsCopied = _useState2[1];
27
+ var createHoverText = function createHoverText(systemName) {
28
+ return showTooltipAsCopied ? 'Copied!' : "Copy table name '".concat(systemName, "'");
29
+ };
30
+ var onCopyClick = function onCopyClick() {
31
+ setShowTooltipAsCopied(true);
32
+ };
33
+ var recommendationItems = function recommendationItems() {
34
+ return recommendations.map(function (recommendation) {
35
+ return /*#__PURE__*/React.createElement("div", {
36
+ key: recommendation.id
37
+ }, /*#__PURE__*/React.createElement(_reactTooltip.default, {
38
+ id: recommendation.id,
39
+ effect: "solid",
40
+ afterHide: function afterHide() {
41
+ return setShowTooltipAsCopied(false);
42
+ },
43
+ getContent: [function () {
44
+ return createHoverText(recommendation.systemName);
45
+ }]
46
+ }), /*#__PURE__*/React.createElement(_reactCopyToClipboard.CopyToClipboard, {
47
+ text: recommendation.systemName,
48
+ className: "action copy-table-name-icon",
49
+ onCopy: function onCopy() {
50
+ return onCopyClick();
51
+ }
52
+ }, /*#__PURE__*/React.createElement(_FilterNone.default, {
53
+ "data-for": recommendation.id,
54
+ "data-tip": ""
55
+ })), /*#__PURE__*/React.createElement("div", {
56
+ className: "recommendation"
57
+ }, /*#__PURE__*/React.createElement("a", {
58
+ role: "link",
59
+ href: _utils.RecommendationUtils.getDatasetUrl(recommendation),
60
+ target: "_blank",
61
+ className: "action"
62
+ }, recommendation.dataTitle)));
63
+ });
64
+ };
65
+ return /*#__PURE__*/React.createElement("recommendation-list", null, /*#__PURE__*/React.createElement("div", {
66
+ className: "list-box"
67
+ }, recommendationItems()));
68
+ };
69
+ RecommendationList.propTypes = {
70
+ recommendations: _propTypes.default.array
71
+ };
72
+ var _default = exports.default = RecommendationList;
@@ -0,0 +1,61 @@
1
+ @import "../../styles/variables.scss";
2
+ @import "../../styles/mixins.scss";
3
+
4
+ recommendation-list {
5
+ .recommendation {
6
+ line-height: 1rem;
7
+ margin-bottom: 0.7rem;
8
+ width: 85%;
9
+ display: inline-block;
10
+
11
+ a {
12
+ word-break: break-all;
13
+ }
14
+ }
15
+
16
+ .list-box {
17
+ border: 1px solid $light-grey;
18
+ max-height: 100%;
19
+ overflow-y: auto;
20
+ border: 1px solid $almost-black;
21
+ display: inline-block;
22
+ padding: 0.5em;
23
+
24
+ &::-webkit-scrollbar {
25
+ -webkit-appearance: none;
26
+ }
27
+
28
+ &::-webkit-scrollbar:vertical {
29
+ width: 11px;
30
+ }
31
+
32
+ &::-webkit-scrollbar-thumb {
33
+ border-radius: 8px;
34
+ border: 2px solid white;
35
+ background-color: $almost-black;
36
+ }
37
+ }
38
+
39
+ .copy-table-name-icon {
40
+ vertical-align: top;
41
+ margin-right: 0.4rem;
42
+ width: 10%;
43
+ height: 1.4rem;
44
+ }
45
+
46
+ .action {
47
+ color: $dark-blue;
48
+
49
+ &:hover {
50
+ color: $almost-black;
51
+ }
52
+
53
+ &:active {
54
+ color: $dark-grey;
55
+ }
56
+ }
57
+
58
+ a {
59
+ @include link();
60
+ }
61
+ }
@@ -0,0 +1,38 @@
1
+ import { mount } from 'enzyme'
2
+ import ReactTooltip from 'react-tooltip'
3
+ import RecommendationList from './recommendation-list'
4
+ import { recommendations } from '../../../test-helpers/recommendations'
5
+ import { act } from 'react-dom/test-utils'
6
+
7
+ let subject
8
+
9
+ describe('RecommendationList', () => {
10
+ describe('with data', () => {
11
+ beforeEach(() => {
12
+ subject = mount(<RecommendationList
13
+ recommendations={recommendations}
14
+ />)
15
+ })
16
+
17
+ test('returns urls for each recommended dataset', () => {
18
+ expect(subject.find('.recommendation').length).toEqual(recommendations.length)
19
+ })
20
+
21
+ test('shows tooltips with table names for copy buttons', () => {
22
+ expect(subject.contains(ReactTooltip)).toBeTruthy()
23
+ const tooltips = subject.find(ReactTooltip).map((elem) => elem.text())
24
+ expect(tooltips).toContain(`Copy table name '${recommendations[0].systemName}'`)
25
+ })
26
+
27
+ test('copy button changes tooltip text to "Copied" when it is clicked', () => {
28
+ subject.find('.copy-table-name-icon').at(0).simulate('click')
29
+ expect(subject.find(ReactTooltip).at(0).text()).toEqual('Copied!')
30
+ })
31
+
32
+ test('tooltip changes back to table name text after it disapears', () => {
33
+ subject.find('.copy-table-name-icon').at(0).simulate('click')
34
+ act(() => { subject.find(ReactTooltip).at(0).prop('afterHide')() })
35
+ expect(subject.find(ReactTooltip).at(0).text()).toEqual(`Copy table name '${recommendations[0].systemName}'`)
36
+ })
37
+ })
38
+ })
@@ -0,0 +1,3 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<RemoteToggle /> renders 1`] = `ShallowWrapper {}`;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "default", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _remoteToggle.default;
10
+ }
11
+ });
12
+ var _remoteToggle = _interopRequireDefault(require("./remote-toggle"));
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -0,0 +1,35 @@
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 = _interopRequireWildcard(require("react"));
9
+ 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); }
10
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11
+ 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); } }
12
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ 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); }
15
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
16
+ 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); }
17
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
18
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
19
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
20
+ 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); }
21
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
22
+ var RemoteToggle = /*#__PURE__*/function (_Component) {
23
+ function RemoteToggle() {
24
+ _classCallCheck(this, RemoteToggle);
25
+ return _callSuper(this, RemoteToggle, arguments);
26
+ }
27
+ _inherits(RemoteToggle, _Component);
28
+ return _createClass(RemoteToggle, [{
29
+ key: "render",
30
+ value: function render() {
31
+ return /*#__PURE__*/_react.default.createElement("div", null, "RemoteToggle");
32
+ }
33
+ }]);
34
+ }(_react.Component);
35
+ var _default = exports.default = RemoteToggle;
@@ -0,0 +1,10 @@
1
+ import React from 'react'
2
+ import { shallow } from 'enzyme'
3
+ import RemoteToggle from './remote-toggle'
4
+
5
+ describe('<RemoteToggle />', () => {
6
+ test('renders', () => {
7
+ const wrapper = shallow(<RemoteToggle />)
8
+ expect(wrapper).toMatchSnapshot()
9
+ })
10
+ })
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _share = _interopRequireDefault(require("./share"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ var _default = exports.default = _share.default;
@@ -0,0 +1,109 @@
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
+ require("./share.scss");
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _reactShare = require("react-share");
11
+ var _reactCopyToClipboard = require("react-copy-to-clipboard");
12
+ var _FileCopyOutlined = _interopRequireDefault(require("@material-ui/icons/FileCopyOutlined"));
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15
+ 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); } }
16
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
+ 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); }
19
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
20
+ 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); }
21
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
22
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
23
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
24
+ 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); }
25
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
26
+ var Share = /*#__PURE__*/function (_React$Component) {
27
+ function Share(props) {
28
+ var _this;
29
+ _classCallCheck(this, Share);
30
+ _this = _callSuper(this, Share, [props]);
31
+ _this.state = {
32
+ copyMessage: 'Copy Link'
33
+ };
34
+ return _this;
35
+ }
36
+ _inherits(Share, _React$Component);
37
+ return _createClass(Share, [{
38
+ key: "render",
39
+ value: function render() {
40
+ var _this2 = this;
41
+ var shareLocation = window.location.href;
42
+ var iconSize = 32;
43
+ var iconBgStyle = {};
44
+ return /*#__PURE__*/_react.default.createElement("share-zone", null, /*#__PURE__*/_react.default.createElement("div", {
45
+ className: "share-header"
46
+ }, "SHARE DATASET"), /*#__PURE__*/_react.default.createElement("div", {
47
+ className: "share-icons"
48
+ }, /*#__PURE__*/_react.default.createElement("div", {
49
+ "data-testid": "social-media-twitter"
50
+ }, /*#__PURE__*/_react.default.createElement(_reactShare.TwitterShareButton, {
51
+ url: shareLocation,
52
+ className: "shareButton",
53
+ additionalProps: {
54
+ 'aria-label': 'Twitter Share'
55
+ }
56
+ }, /*#__PURE__*/_react.default.createElement(_reactShare.TwitterIcon, {
57
+ iconBgStyle: iconBgStyle,
58
+ round: true,
59
+ iconFillColor: "#00aced",
60
+ size: iconSize
61
+ }))), /*#__PURE__*/_react.default.createElement("div", {
62
+ "data-testid": "social-media-facebook"
63
+ }, /*#__PURE__*/_react.default.createElement(_reactShare.FacebookShareButton, {
64
+ url: shareLocation,
65
+ className: "shareButton",
66
+ additionalProps: {
67
+ 'aria-label': 'Facebook Share'
68
+ }
69
+ }, /*#__PURE__*/_react.default.createElement(_reactShare.FacebookIcon, {
70
+ iconBgStyle: iconBgStyle,
71
+ round: true,
72
+ iconFillColor: "#3b5998",
73
+ className: "icon",
74
+ size: iconSize
75
+ }))), /*#__PURE__*/_react.default.createElement("div", {
76
+ "data-testid": "social-media-linkedin"
77
+ }, /*#__PURE__*/_react.default.createElement(_reactShare.LinkedinShareButton, {
78
+ url: shareLocation,
79
+ className: "shareButton",
80
+ additionalProps: {
81
+ 'aria-label': 'Linked In Share'
82
+ }
83
+ }, /*#__PURE__*/_react.default.createElement(_reactShare.LinkedinIcon, {
84
+ iconBgStyle: iconBgStyle,
85
+ round: true,
86
+ iconFillColor: "#3b5998",
87
+ className: "icon",
88
+ size: iconSize
89
+ })))), /*#__PURE__*/_react.default.createElement(_reactCopyToClipboard.CopyToClipboard, {
90
+ style: {
91
+ height: "".concat(iconSize, "px")
92
+ },
93
+ text: shareLocation,
94
+ onCopy: function onCopy() {
95
+ return _this2.setState({
96
+ copyMessage: 'Copied!'
97
+ });
98
+ }
99
+ }, /*#__PURE__*/_react.default.createElement("button", {
100
+ tabIndex: "0",
101
+ className: "primary-background-color clipboard button"
102
+ }, /*#__PURE__*/_react.default.createElement(_FileCopyOutlined.default, null), /*#__PURE__*/_react.default.createElement("div", {
103
+ "data-testid": "clipboard",
104
+ className: "copy"
105
+ }, this.state.copyMessage))));
106
+ }
107
+ }]);
108
+ }(_react.default.Component);
109
+ var _default = exports.default = Share;
@@ -0,0 +1,66 @@
1
+ @import '../../styles/mixins.scss';
2
+ @import '../../styles/variables.scss';
3
+
4
+ share-zone {
5
+ @include custom-element();
6
+ width: 100%;
7
+ padding: 1.125rem 0;
8
+ margin-top: 1rem;
9
+ border-top: 1px solid $light-grey;
10
+
11
+ .share-header,
12
+ .name {
13
+ @include header-small();
14
+ margin-bottom: 0.5rem;
15
+ }
16
+
17
+ .button {
18
+ text-decoration: none;
19
+ border-width: 0px;
20
+ margin-top: 0.75rem;
21
+ border-style: none;
22
+ display: flex;
23
+ align-items: center;
24
+ text-align: center;
25
+ overflow: hidden;
26
+ cursor: pointer;
27
+ border-radius: 8px;
28
+ height: 32px;
29
+ color: white;
30
+ padding: 6px;
31
+
32
+ &:hover {
33
+ color: white;
34
+ background-color: $almost-black;
35
+ text-decoration: underline;
36
+ }
37
+ }
38
+
39
+ .share-icons {
40
+ display: flex;
41
+ }
42
+
43
+ .shareButton {
44
+ margin: 0 0.5rem 0 0;
45
+ cursor: pointer;
46
+ width: 32px;
47
+ height: 32px;
48
+ border-radius: 32px;
49
+ }
50
+
51
+ .shareButton:hover {
52
+ opacity: 0.75;
53
+ }
54
+
55
+ .clipboard {
56
+ text-align: center;
57
+ display: flex;
58
+ color: white;
59
+ font-weight: bold;
60
+ font-size: 0.9rem;
61
+ height: 32px;
62
+ color: white;
63
+ display: flex;
64
+ padding: 6px;
65
+ }
66
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _streamingApiDoc = _interopRequireDefault(require("./streaming-api-doc"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ var _default = exports.default = _streamingApiDoc.default;
@@ -0,0 +1,76 @@
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
+ require("./streaming-api-doc.scss");
9
+ var _react = require("react");
10
+ var _collapsableBox = _interopRequireDefault(require("../../components/collapsable-box"));
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
13
+ 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); } }
14
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
15
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
16
+ 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); }
17
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
18
+ 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); }
19
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
20
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
21
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
22
+ 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); }
23
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
24
+ var _default = exports.default = /*#__PURE__*/function (_Component) {
25
+ function _default() {
26
+ _classCallCheck(this, _default);
27
+ return _callSuper(this, _default, arguments);
28
+ }
29
+ _inherits(_default, _Component);
30
+ return _createClass(_default, [{
31
+ key: "streamingHeader",
32
+ value: function streamingHeader() {
33
+ return /*#__PURE__*/React.createElement("div", null, "Access Operating System data through a websocket.");
34
+ }
35
+ }, {
36
+ key: "streamingBody",
37
+ value: function streamingBody() {
38
+ var dataset = this.props.dataset;
39
+ var systemName = dataset.organization.name + '__' + dataset.name;
40
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
41
+ className: "example-container"
42
+ }, /*#__PURE__*/React.createElement("div", {
43
+ className: "example-header"
44
+ }, "Example using ", /*#__PURE__*/React.createElement("a", {
45
+ role: "link",
46
+ href: "https://github.com/vi/websocat"
47
+ }, "Websocat"), " on a terminal"), /*#__PURE__*/React.createElement("div", {
48
+ className: "example-code"
49
+ }, /*#__PURE__*/React.createElement("code", null, /*#__PURE__*/React.createElement("div", null, "websocat ".concat(window.DISC_STREAMS_URL, "/socket/websocket -H='User-Agent: websocat'")), /*#__PURE__*/React.createElement("div", null, "{\"topic\": \"streaming:".concat(systemName, "\",\"event\":\"phx_join\",\"payload\":{\"api_key\":\"USER_API_KEY_HERE\"},\"ref\":\"1\"}")))), /*#__PURE__*/React.createElement("div", {
50
+ className: "example-header"
51
+ }, "Phoenix Channels clients"), /*#__PURE__*/React.createElement("div", null, "For application development, look at the ", /*#__PURE__*/React.createElement("a", {
52
+ role: "link",
53
+ href: "https://www.npmjs.com/package/phoenix",
54
+ target: "_blank"
55
+ }, "official Phoenix Javascript library"), ", or one of the ", /*#__PURE__*/React.createElement("a", {
56
+ role: "link",
57
+ href: "https://hexdocs.pm/phoenix/channels.html#client-libraries",
58
+ target: "_blank"
59
+ }, "other client libraries"))));
60
+ }
61
+ }, {
62
+ key: "render",
63
+ value: function render() {
64
+ if (!this.props.dataset) {
65
+ return /*#__PURE__*/React.createElement("streaming-api-doc", null);
66
+ }
67
+ return /*#__PURE__*/React.createElement("streaming-api-doc", {
68
+ class: "streaming-api-doc"
69
+ }, /*#__PURE__*/React.createElement(_collapsableBox.default, {
70
+ title: "Websocket Streaming Example",
71
+ headerHtml: this.streamingHeader(),
72
+ expanded: this.props.expanded
73
+ }, this.streamingBody()));
74
+ }
75
+ }]);
76
+ }(_react.Component);
@@ -0,0 +1,23 @@
1
+ @import '../../styles/mixins.scss';
2
+ @import '../../styles/variables.scss';
3
+
4
+ streaming-api-doc {
5
+ .example-container {
6
+ justify-content: space-between;
7
+ padding: 0px 20px 20px 20px
8
+ }
9
+
10
+ .example-code {
11
+ border-radius: 5px;
12
+ border: $medium-grey solid 1px;
13
+ background-color: $super-light-grey;
14
+ padding: 10px;
15
+ overflow-wrap: break-word;
16
+ word-wrap: break-word;
17
+ }
18
+
19
+ .example-header {
20
+ font-weight: bold;
21
+ padding-top: 1rem
22
+ }
23
+ }
@@ -0,0 +1,24 @@
1
+ import { render } from 'enzyme'
2
+ import StreamingApiDoc from './streaming-api-doc'
3
+
4
+ describe('streaming-api-doc element', () => {
5
+ let subject
6
+
7
+ beforeEach(() => {
8
+ const matchMedia = jest.fn()
9
+ Object.defineProperty(window, 'matchMedia', {
10
+ writable: true,
11
+ value: jest.fn().mockImplementation(query => ({
12
+ matches: true
13
+ }))
14
+ })
15
+ })
16
+
17
+ test('the example should have proper topic', () => {
18
+ subject = render(<StreamingApiDoc dataset={{ id: 'coda_stuff', name: 'data_name', organization: { name: 'org_name', sourceType: 'stream' } }} />)
19
+
20
+ expect(subject.find('.example-code').text()).toContain(
21
+ 'streaming:org_name__data_name'
22
+ )
23
+ })
24
+ })
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _tooltip = _interopRequireDefault(require("./tooltip"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ var _default = exports.default = _tooltip.default;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ require("./tooltip.scss");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ var _default = exports.default = function _default(_ref) {
11
+ var text = _ref.text;
12
+ return /*#__PURE__*/_react.default.createElement("span", {
13
+ className: "tooltip"
14
+ }, text, /*#__PURE__*/_react.default.createElement("div", {
15
+ className: "tooltip-text"
16
+ }, text));
17
+ };
@@ -0,0 +1,16 @@
1
+ @import '../../styles/variables.scss';
2
+
3
+ .tooltip-text {
4
+ visibility: hidden;
5
+ background-color: $dark-grey;
6
+ color: #fff;
7
+ text-align: center;
8
+ border-radius: 0.5rem;
9
+ padding: 0.5rem 1rem;
10
+ position: absolute;
11
+ z-index: 1;
12
+ }
13
+
14
+ .tooltip:hover .tooltip-text {
15
+ visibility: visible;
16
+ }
@@ -0,0 +1,19 @@
1
+ import { render } from 'enzyme'
2
+ import Tooltip from '.'
3
+
4
+ describe('tooltip', () => {
5
+ const text = 'LOL OMG'
6
+ let subject
7
+
8
+ beforeEach(() => {
9
+ subject = render(<Tooltip text={text} />)
10
+ })
11
+
12
+ it('contains the given text', () => {
13
+ expect(subject.text()).toContain(text)
14
+ })
15
+
16
+ it('contains the same text in a tooltip', () => {
17
+ expect(subject.find('.tooltip-text').text()).toBe(text)
18
+ })
19
+ })
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _visualizationListMenuItem = _interopRequireDefault(require("./visualization-list-menu-item"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ var _default = exports.default = _visualizationListMenuItem.default;