diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml new file mode 100644 index 00000000..c8ea3b21 --- /dev/null +++ b/.github/workflows/cypress.yml @@ -0,0 +1,83 @@ +name: Cypress Tests +run-name: "Cypress E2E testing for SPARC Portal" + +on: + workflow_dispatch: + pull_request_target: + types: [opened, synchronize, reopened] + branches: [master, main] + +env: + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} + ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} + ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} + ALGOLIA_INDEX: ${{ secrets.ALGOLIA_INDEX }} + AWS_USER_POOL_ID: ${{ secrets.AWS_USER_POOL_ID }} + AWS_USER_POOL_WEB_CLIENT_ID: ${{ secrets.AWS_USER_POOL_WEB_CLIENT_ID }} + BIOLUCIDA_PASSWORD: ${{ secrets.BIOLUCIDA_PASSWORD }} + BIOLUCIDA_USERNAME: ${{ secrets.BIOLUCIDA_USERNAME }} + BITLY_ACCESS_TOKEN: ${{ secrets.BITLY_ACCESS_TOKEN }} + BLACKFYNN_API_SECRET: ${{ secrets.BLACKFYNN_API_SECRET }} + BLACKFYNN_API_TOKEN: ${{ secrets.BLACKFYNN_API_TOKEN }} + BLACKFYNN_CONCEPTS_API_HOST: ${{ secrets.BLACKFYNN_CONCEPTS_API_HOST }} + CTF_API_HOST: ${{ secrets.CTF_API_HOST }} + CTF_CDA_ACCESS_TOKEN: ${{ secrets.CTF_CDA_ACCESS_TOKEN }} + CTF_SPACE_ID: ${{ secrets.CTF_SPACE_ID }} + DEPLOY_ENV: ${{ secrets.DEPLOY_ENV }} + DISABLE_REDIRECT_SSL: ${{ secrets.DISABLE_REDIRECT_SSL }} + FLATMAP_API_HOST: ${{ secrets.FLATMAP_API_HOST }} + LOGIN_API_URL: ${{ secrets.LOGIN_API_URL }} + NODE_ENV: ${{ secrets.NODE_ENV }} + NPM_CONFIG_PRODUCTION: ${{ secrets.NPM_CONFIG_PRODUCTION }} + OSPARC_HOST: ${{ secrets.OSPARC_HOST }} + PORTAL_API_HOST: ${{ secrets.PORTAL_API_HOST }} + RECAPTCHA_SECRET_KEY: ${{ secrets.RECAPTCHA_SECRET_KEY }} + RECAPTCHA_SITE_KEY: ${{ secrets.RECAPTCHA_SITE_KEY }} + ROOT_URL: ${{ secrets.ROOT_URL }} + SHOW_FUNDING_FACET: ${{ secrets.SHOW_FUNDING_FACET }} + SHOW_HIERARCHAL_FACETS: ${{ secrets.SHOW_HIERARCHAL_FACETS }} + SHOW_LOGIN_FEATURE: ${{ secrets.SHOW_LOGIN_FEATURE }} + SHOW_METRICS: ${{ secrets.SHOW_METRICS }} + SHOW_OSPARC_TAB: ${{ secrets.SHOW_OSPARC_TAB }} + SHOW_TIMESERIES_VIEWER: ${{ secrets.SHOW_TIMESERIES_VIEWER }} + SPARC_PORTAL_USER_ID: ${{ secrets.SPARC_PORTAL_USER_ID }} + SPARC_PORTAL_USER_SECRET: ${{ secrets.SPARC_PORTAL_USER_SECRET }} + +jobs: + e2e-testing: + runs-on: ubuntu-latest + steps: + - run: echo "event name is:" ${{ github.event_name }} + - uses: actions-cool/check-user-permission@main + if: github.event_name == 'pull_request_target' + id: checkUser + with: + require: 'write' + username: ${{ github.event.pull_request.user.name }} + - name: Checkout + if: github.event_name == 'pull_request_target' && steps.checkUser.outputs.require-result == 'true' + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + - name: Checkout + if: github.event_name == 'workflow_dispatch' + uses: actions/checkout@v3 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 14.17.6 + - name: Run e2e tests + if: github.event_name == 'workflow_dispatch' || steps.checkUser.outputs.require-result == 'true' + uses: cypress-io/github-action@v6 + with: + build: yarn build + start: yarn start + wait-on: ${{ secrets.ROOT_URL }} + command: yarn test-run-e2e + - name: Skip tests + if: github.event_name == 'pull_request_target' && steps.checkUser.outputs.require-result == 'false' + uses: actions/github-script@v3 + with: + script: | + core.setFailed('Pull request is opened by an user without write permission, tests are skipped for security reason') diff --git a/.gitignore b/.gitignore index 0a43ecae..c2c5154b 100644 --- a/.gitignore +++ b/.gitignore @@ -109,3 +109,6 @@ sw.* # Certifact files .certs/ + +test/cypress/videos +test/cypress/downloads diff --git a/assets/3d-map.png b/assets/3d-map.png new file mode 100644 index 00000000..80657ac6 Binary files /dev/null and b/assets/3d-map.png differ diff --git a/assets/_layout.scss b/assets/_layout.scss index 78041da8..3e7d8198 100644 --- a/assets/_layout.scss +++ b/assets/_layout.scss @@ -17,8 +17,4 @@ border: 1px solid #dcdfe6; margin: 1em 0; padding: 1em; - @media (min-width: 48em) { - margin: 2.5em 0; - padding: 2em; -} } diff --git a/assets/_viewer.scss b/assets/_viewer.scss index 08313759..55c13da8 100644 --- a/assets/_viewer.scss +++ b/assets/_viewer.scss @@ -4,6 +4,7 @@ border-bottom: 1px solid #dbdfe6; flex-direction: column; font-size: 0.875em; + line-height: 1.5rem; display: flex; padding: 1rem 0.625rem; @media (min-width: 48em) { diff --git a/assets/ac-map.png b/assets/ac-map.png new file mode 100644 index 00000000..bf93767a Binary files /dev/null and b/assets/ac-map.png differ diff --git a/assets/fc-map.png b/assets/fc-map.png new file mode 100644 index 00000000..bed5df88 Binary files /dev/null and b/assets/fc-map.png differ diff --git a/assets/sparcLogoFast.gif b/assets/sparcLogoFast.gif new file mode 100644 index 00000000..b64cc659 Binary files /dev/null and b/assets/sparcLogoFast.gif differ diff --git a/components/AlternativeSearchResults/AlternativeSearchResultsNews.vue b/components/AlternativeSearchResults/AlternativeSearchResultsNews.vue new file mode 100644 index 00000000..a1e5dcb4 --- /dev/null +++ b/components/AlternativeSearchResults/AlternativeSearchResultsNews.vue @@ -0,0 +1,123 @@ + + + + + diff --git a/components/AlternativeSearchResults/AlternativeSearchResultsResources.vue b/components/AlternativeSearchResults/AlternativeSearchResultsResources.vue new file mode 100644 index 00000000..fdc343e3 --- /dev/null +++ b/components/AlternativeSearchResults/AlternativeSearchResultsResources.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/components/BfDownloadFile/BfDownloadFile.vue b/components/BfDownloadFile/BfDownloadFile.vue index 9e0b5c08..35da6e68 100644 --- a/components/BfDownloadFile/BfDownloadFile.vue +++ b/components/BfDownloadFile/BfDownloadFile.vue @@ -65,6 +65,7 @@ - diff --git a/components/CallToAction/CallToAction.vue b/components/CallToAction/CallToAction.vue new file mode 100644 index 00000000..e742dea5 --- /dev/null +++ b/components/CallToAction/CallToAction.vue @@ -0,0 +1,29 @@ + + + + diff --git a/components/Charts/BarChart.vue b/components/Charts/BarChart.vue new file mode 100644 index 00000000..547cce78 --- /dev/null +++ b/components/Charts/BarChart.vue @@ -0,0 +1,25 @@ + diff --git a/components/CitationDetails/CitationDetails.vue b/components/CitationDetails/CitationDetails.vue index b8eb960c..679a114d 100644 --- a/components/CitationDetails/CitationDetails.vue +++ b/components/CitationDetails/CitationDetails.vue @@ -10,7 +10,7 @@ option of different formats, under the Cite tab of each dataset page. For more Information, please see our Help page @@ -134,6 +134,20 @@ export default { */ handleCitationCopy: function(citationType) { this.$copyText(citationType.citationText).then(() => { + this.$gtm.push({ + event: 'interaction_event', + event_name: 'copy_citation_button_click', + dataset_id: this.$route.params.datasetId, + citation_type: citationType.label, + category: "", + version_id: "", + doi: "", + location: "", + files: "", + file_name: "", + file_path: "", + file_type: "", + }) this.$message( successMessage( `${citationType.label} citation copied to clipboard.` diff --git a/components/CommunitySpotlight/CommunitySpotlightItem.vue b/components/CommunitySpotlight/CommunitySpotlightItem.vue index d311cb1a..76336d83 100644 --- a/components/CommunitySpotlight/CommunitySpotlightItem.vue +++ b/components/CommunitySpotlight/CommunitySpotlightItem.vue @@ -1,36 +1,31 @@