Skip to content

Commit

Permalink
Merge pull request #118 from alan-wu/mapviewer-1.1.0
Browse files Browse the repository at this point in the history
MapViewer 1.1.0 release
  • Loading branch information
alan-wu authored May 29, 2024
2 parents 7602dd4 + 6567e1d commit 41ea2cc
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 60 deletions.
20 changes: 16 additions & 4 deletions components/MapViewer/MapViewer.client.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
<template>
<div class="mapClass">
<MapContent class="map" ref="map" :state="state" :starting-map="startingMap" :options="options"
:share-link="shareLink" @updateShareLinkRequested="$emit('updateShareLinkRequested')" @isReady="$emit('isReady')" />
<MapContent
class="map"
ref="map"
:state="state"
:starting-map="startingMap"
:options="options"
:share-link="shareLink"
@updateShareLinkRequested="$emit('updateShareLinkRequested')"
@isReady="$emit('isReady')"
@trackEvent="onTrackEvent"
/>
</div>
</template>

<script>
import { MapContent } from "@abi-software/mapintegratedvuer"
export default {
name: 'MapViewer',
components: {
Expand Down Expand Up @@ -48,6 +57,9 @@
getInstance: function(){
return this.$refs.map;
},
onTrackEvent: function(eventData) {
this.$gtm.trackEvent(eventData);
},
},
}
</script>
Expand All @@ -65,7 +77,7 @@
box-shadow: 0 1px 8px 0 rgba(0, 0, 0, 0.06);
.map-icon {
color: #8300bf !important;
color: #8300bf;
}
.background-popper.el-popover.el-popper,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"sitemap": "^7.1.1"
},
"dependencies": {
"@abi-software/mapintegratedvuer": "1.0.4",
"@abi-software/mapintegratedvuer": "1.1.0",
"@abi-software/plotvuer": "1.0.0",
"@abi-software/simulationvuer": "1.0.0",
"@element-plus/nuxt": "^1.0.6",
Expand Down
24 changes: 20 additions & 4 deletions tests/cypress/e2e/homepage.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ describe('Homepage', { testIsolation: false }, function () {

})

beforeEach(function () {
cy.intercept('**/query?**').as('query')
})

it('Navigation Bar', function () {
// Check for navigation bar
cy.get('.mobile-navigation > :nth-child(1) > :nth-child(1) > a').should('contain', 'Data & Models').and('have.attr', 'href', '/data')
Expand All @@ -32,8 +36,12 @@ describe('Homepage', { testIsolation: false }, function () {
cy.wrap($cat).should('have.attr', 'href').and('contain', 'selectedFacetIds')
})
cy.get('@category').first().click()

cy.wait('@query', { timeout: 20000 })
cy.waitForLoadingMask()

cy.url().should('contain', 'data?type=dataset&selectedFacetIds=')
cy.visit('')
cy.go('back')

cy.waitForLoadingMask()

Expand Down Expand Up @@ -69,9 +77,13 @@ describe('Homepage', { testIsolation: false }, function () {

// Check for button function
cy.get(':nth-child(1) > .feature-container > .button-link > .el-button').click()

cy.wait('@query', { timeout: 20000 })
cy.waitForLoadingMask()

cy.url().should('contain', 'data?type=dataset')
cy.get('.mobile-navigation > :nth-child(1) > :nth-child(1) > a', { timeout: 30000 }).should('have.class', 'active')
cy.visit('')
cy.go('back')

cy.waitForLoadingMask()

Expand Down Expand Up @@ -101,9 +113,13 @@ describe('Homepage', { testIsolation: false }, function () {
cy.get(':nth-child(2) > .card-container > .subpage-row > :nth-child(2) > .dataset-name').then(($link) => {
const title = $link.text().replace('\n', '').trim()
cy.wrap($link).siblings('.button-link').click()
cy.contains(title, { timeout: 30000 }).should('exist')

cy.wait('@query', { timeout: 20000 })
cy.waitForLoadingMask()

cy.get('.el-col-sm-16 > .heading2').should('contain', title)
})
cy.visit('')
cy.go('back')

cy.waitForLoadingMask()

Expand Down
18 changes: 9 additions & 9 deletions tests/cypress/e2e/mapsviewer.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@ describe('Maps Viewer', { testIsolation: false }, function () {
taxonModels.forEach((model, index) => {

it(`Provenance card for ${model}`, function () {

cy.wait(['@flatmap', '@query', '@dataset_info', '@datasets'], { timeout: 20000 })
cy.waitForLoadingMask()

if (index === 0) {

cy.wait('@flatmap', { timeout: 20000 })
cy.waitForLoadingMask()

loadedModels.add('Rat')
}

// Switch to the second flatmap
cy.get('.el-select.select-box.el-tooltip__trigger.el-tooltip__trigger').click()
cy.get('.el-select.select-box.el-tooltip__trigger.el-tooltip__trigger', { timeout: 30000 }).click()
cy.get('.el-select-dropdown__item').should('be.visible')
cy.get('.el-select-dropdown__item:visible').contains(new RegExp(model, 'i')).click({ force: true })

if (!loadedModels.has(model)) {

cy.wait('@flatmap', { timeout: 20000 })
cy.wait(['@flatmap', '@query', '@dataset_info', '@datasets'], { timeout: 20000 })
cy.waitForLoadingMask()

loadedModels.add(model)
Expand All @@ -73,14 +73,14 @@ describe('Maps Viewer', { testIsolation: false }, function () {

it(`From 2D ${threeDSyncView}, open 3D map for synchronised view and Search within display`, function () {

cy.wait('@flatmap', { timeout: 20000 })
cy.wait(['@flatmap', '@query', '@dataset_info', '@datasets'], { timeout: 20000 })
cy.waitForLoadingMask()

// Switch to the human related flatmap
cy.get('.el-select.select-box.el-tooltip__trigger.el-tooltip__trigger').click()
cy.get('.el-select.select-box.el-tooltip__trigger.el-tooltip__trigger', { timeout: 30000 }).click()
cy.get('.el-select-dropdown__item').contains(new RegExp(threeDSyncView, 'i')).click({ force: true })

cy.wait('@flatmap', { timeout: 20000 })
cy.wait(['@flatmap', '@query', '@dataset_info', '@datasets'], { timeout: 20000 })
cy.waitForLoadingMask()

// Open the 3D view in a split viewer
Expand Down
2 changes: 2 additions & 0 deletions tests/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Cypress.on('uncaught:exception', (err, runnable) => {
return false
if (err.message.includes("Cannot destructure property 'type' of 'vnode' as it is null"))
return false
if (err.message.includes("Cannot read properties of undefined (reading 'receiveSynchronisedEvent')"))
return false
// // For legacy dataset
// if (err.message.includes('ObjectID does not exist'))
// return false
Expand Down
Loading

0 comments on commit 41ea2cc

Please sign in to comment.