From 1e96698e145fab25c23e369372d55d8bdea42834 Mon Sep 17 00:00:00 2001 From: Ivan Moreno Date: Fri, 15 Sep 2023 12:33:45 +0200 Subject: [PATCH] Add GeoParquet link to Data Catalog (#16453) --- NEWS.md | 1 + .../pages/Data/CatalogDatasetSummary.vue | 24 +++++++++++++++++++ .../new-dashboard/utils/catalog/geoparquet.js | 9 +++++++ package.json | 2 +- script/ci/known_hosts | 4 +++- 5 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 lib/assets/javascripts/new-dashboard/utils/catalog/geoparquet.js diff --git a/NEWS.md b/NEWS.md index 0c097761286e..387048884979 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,7 @@ Development - None yet ### Features +* Display GeoParquet link in Catalog [16453](https://github.com/CartoDB/cartodb/pull/16453) * Display notifications about the new CARTO platform release [16352](https://github.com/CartoDB/cartodb/pull/16352) * Upgrade to deck.gl 8.5.6 [16338](https://github.com/CartoDB/cartodb/pull/16338) * Update DO Catalog dependencies and some changes to use bundle on CARTO Workspace [#16325](https://github.com/CartoDB/cartodb/pull/16325) diff --git a/lib/assets/javascripts/new-dashboard/pages/Data/CatalogDatasetSummary.vue b/lib/assets/javascripts/new-dashboard/pages/Data/CatalogDatasetSummary.vue index 4b7a94d9d829..eaeb3ae36e84 100644 --- a/lib/assets/javascripts/new-dashboard/pages/Data/CatalogDatasetSummary.vue +++ b/lib/assets/javascripts/new-dashboard/pages/Data/CatalogDatasetSummary.vue @@ -101,6 +101,17 @@

+
  • +

    + GeoParquet +

    +

    + Download +

    +
  • @@ -112,6 +123,7 @@ import { temporalAggregationName } from 'new-dashboard/utils/catalog/temporal-ag import { geometryTypeName } from 'new-dashboard/utils/catalog/geometry-type-name'; import { updateFrequencyName } from 'new-dashboard/utils/catalog/update-frequency-name'; import { sendCustomDimensions } from 'new-dashboard/utils/catalog/custom-dimensions-ga'; +import { checkGeoparquetBucket } from 'new-dashboard/utils/catalog/geoparquet'; import CatalogMapPreview from 'new-dashboard/components/Catalog/CatalogMapPreview'; export default { @@ -119,6 +131,12 @@ export default { components: { CatalogMapPreview }, + data () { + return { + hasGeoparquetAvailable: false, + geoparquetUrl: undefined + }; + }, watch: { dataset: { handler (value) { @@ -169,10 +187,16 @@ export default { id: this.$route.params.entity_id, type: this.$route.params.entity_type }); + }, + async checkIfGeoparquetBucketExists () { + const { ok, url } = await checkGeoparquetBucket(this.$route.params.entity_id); + this.hasGeoparquetAvailable = ok; + this.geoparquetUrl = url; } }, mounted () { this.fetchKeyVariables(); + this.checkIfGeoparquetBucketExists(); } }; diff --git a/lib/assets/javascripts/new-dashboard/utils/catalog/geoparquet.js b/lib/assets/javascripts/new-dashboard/utils/catalog/geoparquet.js new file mode 100644 index 000000000000..40a040cdfbac --- /dev/null +++ b/lib/assets/javascripts/new-dashboard/utils/catalog/geoparquet.js @@ -0,0 +1,9 @@ +export async function checkGeoparquetBucket (dataset) { + try { + const url = `https://storage.googleapis.com/geoparquet/carto/${dataset}.parquet`; + const response = await fetch(url, { method: 'HEAD' }); + return { ok: response.ok, url }; + } catch (e) { + return { ok: false }; + } +} diff --git a/package.json b/package.json index f6378b3a2c4d..f281603d3da1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cartodb-ui", - "version": "1.0.0-assets.274-15", + "version": "1.0.0-assets.274-16", "description": "CARTO UI frontend", "repository": { "type": "git", diff --git a/script/ci/known_hosts b/script/ci/known_hosts index 1bae52b8991a..fc1cf6629bf5 100644 --- a/script/ci/known_hosts +++ b/script/ci/known_hosts @@ -1 +1,3 @@ -github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== +|1|ueDZd5nj+jew6gJuR6J043fBwRc=|+HaH18kuYx21mjgs1Uz/SWRhQEY= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg= +|1|0RrLFzimw+0ZVQNhDVHeUHbG1xk=|MdpZry4/IdRdz3jpEKPAPiDEWmA= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg= +|1|IU85mbarZxbwrbxBhbXKiI7hSuw=|FXKLY4UBpBGMLAB0WDDeijtQ7u0= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=