Skip to content

Commit

Permalink
Merge branch 'data-dictionary-preview' of https://github.com/Manya-te…
Browse files Browse the repository at this point in the history
…ch/annotation_tool into data-dictionary-preview
  • Loading branch information
Manya-tech committed Apr 27, 2024
2 parents 1cdc30d + f9d9e46 commit 67528a0
Show file tree
Hide file tree
Showing 13 changed files with 236 additions and 151 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up node env
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
node-version: 18

Expand All @@ -25,7 +25,7 @@ jobs:
run: yarn generate

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
20 changes: 20 additions & 0 deletions .github/workflows/handle_external_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Label pull requests from forks

on:
pull_request_target:
types: [opened]

jobs:
handle_external_pr:
# Only run this entire workflow if the PR was opened from a forked repo
# The reasoning is that both bots and external contributors have to make
# a fork of the repo before they can open a PR because they don't have
# write access to the repo.
if: github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest

steps:
- name: Label pull request with "_community"
run: gh pr edit ${{ github.event.pull_request.number }} -R ${{ github.repository }} --add-label "_community"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/test_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up node env
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
node-version: 16

Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Neurobagel Project, Oriagmi Lab, McGill University.
Copyright (c) 2022 - Neurobagel Project, Origami Lab, McGill University.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
8 changes: 5 additions & 3 deletions components/annot-explanation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
{{ uiText.cardTitle }}
</b-card-header>
<b-card-body>
<b-card-text><ul>
<li v-for="(sentence, index) in explanationText.split('.')" :key="index">
<b-card-text>
<ul>
<li v-for="(sentence, index) in explanationText.split('.')" :key="index">
{{ sentence }}.
</li>
</ul></b-card-text>
</ul>
</b-card-text>
</b-card-body>
</b-card>

Expand Down
4 changes: 3 additions & 1 deletion components/tool-navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
alt="Neurobagel Logo"
class="nav-logo" />
<div class="nav-title-and-subtitle">
{{ uiText.toolName }} <b-badge v-b-tooltip.hover.right="'This tool is under active development. Please report any requests or issues on GitHub.'" class="badge">beta</b-badge>
{{ uiText.toolName }} <b-badge v-b-tooltip.hover.right="'This tool is under active development. Please report any requests or issues on GitHub.'" class="badge">
beta
</b-badge>

<br />
<p class="nav-subtitle">
Expand Down
12 changes: 12 additions & 0 deletions cypress/component/home_page.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ describe("The Home page", () => {
cy.get("[data-cy='data-dictionary-selector']").should("be.visible").contains("Choose file");
});

it("Shows a warning about not being able to reuse annotations in the data dictionary", () => {
cy.mount(homePage, {

mocks: { $store: store },
stubs: stubs,
plugins: ["bootstrap-vue"]
});

cy.get("[data-cy='cannot-reuse-annotations-button']").should('be.visible').contains("Cannot reuse annotations");
});

it("Correctly displays previews of the loaded data", () => {

// Act
Expand Down Expand Up @@ -136,4 +147,5 @@ describe("The Home page", () => {
});
cy.get("[data-cy='data-dictionary-selector']").contains("example_short.json");
});

});
22 changes: 22 additions & 0 deletions cypress/e2e/page/index-pagetests.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,28 @@ describe("Tests on the index page via store interaction", () => {
// 3. Assert that categorization nav item and next button are *still* enabled
cy.assertNextPageAccess("categorization", true);
});

it("A big red warning is shown next to the data dictionary button to say: can't use Annotations", () => {

// 1. Assert that categorization nav item and next button are disabled
cy.assertNextPageAccess("categorization", false);

// 2. Select data table file
cy.get("[data-cy='data-table-selector']")
.contains("Choose file")
.selectFile(dataFolder + p_dataset.data_table);

// 3. Assert that categorization nav item and next button are enabled
cy.assertNextPageAccess("categorization", true);

// 4. Select participants dictionary
cy.get("[data-cy='data-dictionary-selector']")
.contains("Choose file")
.selectFile(dataFolder + p_dataset.data_dictionary);

// 3. Assert that categorization nav item and next button are *still* enabled
cy.assertNextPageAccess("categorization", true);
});
});
});
});
6 changes: 6 additions & 0 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ export default {
script: [
{
src: 'https://w.appzi.io/w.js?token=YVTHd'
},
{
src: 'https://plausible.neurobagel.org/js/script.js',
'data-domain': 'annotate.neurobagel.org',
async: 'async',
defer: 'defer'
}
],
htmlAttrs: {
Expand Down
Loading

0 comments on commit 67528a0

Please sign in to comment.