diff --git a/NEWS.md b/NEWS.md index 81c0246c76..292e1a6d58 100644 --- a/NEWS.md +++ b/NEWS.md @@ -72,6 +72,7 @@ sudo make install - Updated robots.txt to allow Google access to our datasets [#16148](https://github.com/CartoDB/cartodb/pull/16148) - In the Data Catalog, fixed baseurl as it added an extra `/` on the queries from public pages [#16148](https://github.com/CartoDB/cartodb/pull/16148) - Added dynamic meta title and canonical link to improve SEO in public pages for the Spatial Data Catalog [#16157](https://github.com/CartoDB/cartodb/pull/16157) +- Fixed error that added multiple canonical links in the Spatial Data Catalog [#16160](https://github.com/CartoDB/cartodb/pull/16160) 4.44.0 (2020-11-20) ------------------- diff --git a/lib/assets/javascripts/do-catalog/router.js b/lib/assets/javascripts/do-catalog/router.js index 307c77058b..b91971be10 100644 --- a/lib/assets/javascripts/do-catalog/router.js +++ b/lib/assets/javascripts/do-catalog/router.js @@ -71,10 +71,15 @@ router.beforeEach((to, _, next) => { }); function addCanonical (canonicalUrl) { - const link = document.createElement('link'); - link.setAttribute('rel', 'canonical'); - link.setAttribute('href', canonicalUrl); - document.head.appendChild(link); + const canonicalLink = document.head.querySelector('link[rel="canonical"]'); + if (canonicalLink) { + canonicalLink.setAttribute('href', canonicalUrl); + } else { + const link = document.createElement('link'); + link.setAttribute('rel', 'canonical'); + link.setAttribute('href', canonicalUrl); + document.head.appendChild(link); + } } router.afterEach(to => { diff --git a/package-lock.json b/package-lock.json index 5210291b66..7da6d27dcb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "cartodb-ui", - "version": "1.0.0-assets.224", + "version": "1.0.0-assets.225", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4bd7dcbb74..b2e54bbd3e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cartodb-ui", - "version": "1.0.0-assets.224", + "version": "1.0.0-assets.225", "description": "CARTO UI frontend", "repository": { "type": "git", diff --git a/script/ci/cloudbuild-new-pr-pg11.yaml b/script/ci/cloudbuild-new-pr-pg11.yaml index cad0f33f4a..f13bcb325c 100644 --- a/script/ci/cloudbuild-new-pr-pg11.yaml +++ b/script/ci/cloudbuild-new-pr-pg11.yaml @@ -75,11 +75,11 @@ steps: - -cx - | docker pull gcr.io/cartodb-on-gcp-main-artifacts/builder:${_BRANCH_TAG} - if [ ! -z "$?" ] - then + if [ $? -ne 0 ] + then docker pull gcr.io/cartodb-on-gcp-main-artifacts/builder:latest docker tag gcr.io/cartodb-on-gcp-main-artifacts/builder:latest gcr.io/cartodb-on-gcp-main-artifacts/builder:${_BRANCH_TAG} - fi + fi docker build --build-arg COMPILE_ASSETS=false --build-arg BUNDLE_JOBS=16 -t gcr.io/cartodb-on-gcp-main-artifacts/builder:current -t gcr.io/cartodb-on-gcp-main-artifacts/builder:${_BRANCH_TAG} -t gcr.io/cartodb-on-gcp-main-artifacts/builder:${SHORT_SHA} -t gcr.io/cartodb-on-gcp-main-artifacts/builder:${_BRANCH_TAG}--${SHORT_SHA} --cache-from gcr.io/cartodb-on-gcp-main-artifacts/builder:${_BRANCH_TAG} . # Run tests diff --git a/script/ci/cloudbuild-new-pr-pg12.yaml b/script/ci/cloudbuild-new-pr-pg12.yaml index a33975424c..4f69151674 100644 --- a/script/ci/cloudbuild-new-pr-pg12.yaml +++ b/script/ci/cloudbuild-new-pr-pg12.yaml @@ -75,8 +75,8 @@ steps: - -cx - | docker pull gcr.io/cartodb-on-gcp-main-artifacts/builder:${_BRANCH_TAG} - if [ ! -z "$?" ] - then + if [ $? -ne 0 ] + then docker pull gcr.io/cartodb-on-gcp-main-artifacts/builder:latest docker tag gcr.io/cartodb-on-gcp-main-artifacts/builder:latest gcr.io/cartodb-on-gcp-main-artifacts/builder:${_BRANCH_TAG} fi @@ -102,7 +102,7 @@ steps: - name: gcr.io/cloud-builders/docker args: ['exec', '-i', 'builder_1', 'bash', '-c', '/cartodb/runParallelTests.sh 24' ] - timeout: 2700s + timeout: 3000s substitutions: _BRANCH_TAG: ${BRANCH_NAME//\//-}