From 01c7914b6ffc8bf0e5328e62032c6a91d486fdd5 Mon Sep 17 00:00:00 2001 From: Arman Jahanpour <77515879+rmanaem@users.noreply.github.com> Date: Tue, 5 Dec 2023 19:28:11 -0500 Subject: [PATCH 1/2] [MNT] Updated help text and category explanations of the annotation page (#654) * Added `next-page` instructions for annotation page * Updated categories explanation text * Removd the warning about using back button from README.md * Fixed typo * Added comment for `explanation` field of categories state object --- README.md | 3 --- components/annot-explanation.vue | 6 +++++- components/next-page.vue | 2 +- store/index.js | 9 +++++---- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index bc4b6163..11bb2fbc 100644 --- a/README.md +++ b/README.md @@ -83,9 +83,6 @@ See the [Nuxt documentation](https://nuxtjs.org/deployments/github-pages/) for m There are two means of moving forward to the next step in the annotation tool's workflow: (1) the navbar at the top right of the screen which features the page names, and (2) the next page buttons on the bottom right of each page. -:warning: Do not use the browser back/forward buttons for navigation as this is currently a limitation of the tool -that may lead to breaking the workflow. - Certain criteria for each page need to be be met in order to move forward. Instructions are offered above the next page button. Once the criteria have been met navbar and next page button will turn from gray to green. ## Testing diff --git a/components/annot-explanation.vue b/components/annot-explanation.vue index d2a0b2fa..abe54b41 100644 --- a/components/annot-explanation.vue +++ b/components/annot-explanation.vue @@ -7,7 +7,11 @@ {{ uiText.cardTitle }} - {{ explanationText }} + diff --git a/components/next-page.vue b/components/next-page.vue index 1749254d..b7dfcf38 100644 --- a/components/next-page.vue +++ b/components/next-page.vue @@ -59,7 +59,7 @@ "home": "", "categorization": "One column must be categorized as 'Subject ID' and all assessment tools must be grouped to proceed", - "annotation": "" + "annotation": "One categroized column must be annotated to proceed" } } }; diff --git a/store/index.js b/store/index.js index 8d429144..7e9dee76 100644 --- a/store/index.js +++ b/store/index.js @@ -27,6 +27,7 @@ export const state = () => ({ "Diagnosis": diagnosisTerms }, + // The explanation strings for each category, will be split by '.' and turned into bullet points in the annot-explanation component categories: { "Subject ID": { @@ -36,25 +37,25 @@ export const state = () => ({ "Age": { componentName: "annot-continuous-values", - explanation: "This is an explanation for how to annotate age.", + explanation: "Review the annotated columns for Age. Mark missing values. Select a transformation heuristic, check the preview, and finalize the harmonization", identifier: "nb:Age" }, "Sex": { componentName: "annot-categorical", - explanation: "This is an explanation for how to annotate sex.", + explanation: "Review the annotated columns for Sex. Mark missing values. Annotate each unique value from the dropdown, and finalize the harmonization", identifier: "nb:Sex" }, "Diagnosis": { componentName: "annot-categorical", - explanation: "This is an explanation for how to annotate diagnosis.", + explanation: "Review the annotated columns for Diagnosis. Mark missing values. Annotate each unique value from the dropdown, and finalize the harmonization", identifier: "nb:Diagnosis" }, "Assessment Tool": { componentName: "annot-tool-groups", - explanation: "This is an explanation for how to annotate a tool.", + explanation: "Review the annotated columns for Assessment Tool. Mark missing values for each tool", identifier: "nb:AssessmentTool" } }, From 76bd290c7160bfeb535e8d2724f60ec2eb496e2b Mon Sep 17 00:00:00 2001 From: Sebastian Urchs Date: Sat, 9 Dec 2023 19:00:42 -0500 Subject: [PATCH 2/2] Delete .github/workflows/add_pr2project.yml (#656) --- .github/workflows/add_pr2project.yml | 155 --------------------------- 1 file changed, 155 deletions(-) delete mode 100644 .github/workflows/add_pr2project.yml diff --git a/.github/workflows/add_pr2project.yml b/.github/workflows/add_pr2project.yml deleted file mode 100644 index f25a1c09..00000000 --- a/.github/workflows/add_pr2project.yml +++ /dev/null @@ -1,155 +0,0 @@ -# This workflow adds a PR in this repository to the main Neurobagel project (#1) -# when and if it is labeled with a label of interest. -# Currently our labels of interest are -# - _bot -# - _community -# -# Once added to the project, we also set the custom field "Status" to "Community" -# for the PR. This in effect adds the PR to our main board in the "Community" column. - -name: PR automation -on: - pull_request: - types: [ labeled ] - -jobs: - add2project: - runs-on: ubuntu-latest - steps: - - name: Check if label of interest is applied - id: preview_label_check - uses: docker://agilepathway/pull-request-label-checker:latest - with: - any_of: _bot,_community - repo_token: ${{ secrets.NB_PROJECT_PAT }} - allow_failure: true - - - name: Detect if PR is in project - if: steps.preview_label_check.outputs.label_check == 'success' - id: in_project - env: - GH_TOKEN: ${{ secrets.NB_PROJECT_PAT }} - run: | - gh pr view ${{ github.event.pull_request.html_url }} --json projectItems | jq -r '.projectItems[].title' | grep Neurobagel - continue-on-error: true - - - name: Add PR to Project - if: steps.in_project.outcome == 'failure' && steps.preview_label_check.outputs.label_check == 'success' - uses: actions/add-to-project@main - with: - project-url: https://github.com/orgs/neurobagel/projects/1 - github-token: ${{ secrets.NB_PROJECT_PAT }} - - # Note that in contrast to the graphical github UI, - # once a PR (or other item) is added to a github project, - # project related changes are no longer applied directly to the PR - # but instead to the project card that contains the PR. - # Once the PR is added to the project (and thus has a project card) - # we therefore have to search for the node id of the containing project card - # and then set the Status and Community option on the project card. - # - # This step expects to find the id of the (parent) project card - # and will fail (crashing the entire workflow) otherwise - - name: Find project card container - if: steps.preview_label_check.outputs.label_check == 'success' - id: find_container - env: - GH_TOKEN: ${{ secrets.NB_PROJECT_PAT }} - run: | - out=$(newCursor="" - while true; do - - response=$(gh api graphql -f query='{ - organization(login: "neurobagel") { - projectV2(number: 1) { - items(first: 100, orderBy: {field: POSITION, direction: DESC}, after: "'"${newCursor}"'") { - edges { - cursor - node { - content { - ... on PullRequest { - childID: id - } - } - parentID: id - } - } - } - } - } - }') - - # Because we may not be able to find the parent ID in the first 100 items - # we have to keep advancing the cursor to move through the list - # Note: we use 100 items to balance speed and API limits, might have to be changed - while read -r pID cID cursor; do - - if [ "$cID" == "${{ github.event.pull_request.node_id }}" ]; - then - echo $pID; - exit 0; - fi - newCursor="$cursor" - # Note: we need to use the here string - # to avoid running the while loop in a subshell that would not let us access newCursor - # after the while loop has finished - # see: https://tldp.org/LDP/abs/html/subshells.html - done <<< $(echo "$response" | jq -r '.data.organization.projectV2.items.edges[] | "\(.node.parentID) \(.node.content.childID) \(.cursor)"') - - if [ ! -n "$newCursor" ]; then - # We have passed through the entire list of items - # and didn't find the project card for our PR. - # Something is wrong and we will now crash the workflow. - exit 1; - fi - done - ) - echo "parent_id=${out}" >> $GITHUB_OUTPUT - - # This step expects a custom field called "Status" - # with an option called "Community" to exist in the project. - # We need their IDs as input for our later call to the API - # to move our PR project card to the "Community" column. - # - # We make them available to other steps in this job - # by writing them to the GITHUB_OUTPUT environment variable. - # see: https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs - - name: Get IDs for Status field and Community option - if: steps.preview_label_check.outputs.label_check == 'success' - id: get_id - env: - GH_TOKEN: ${{ secrets.NB_PROJECT_PAT }} - FIELD: "Status" - OPTION: "Community" - run: | - response=$(gh api graphql -f query='{ - organization(login: "neurobagel") { - projectV2(number: 1) { - field(name: "'"${FIELD}"'") { - ... on ProjectV2SingleSelectField { - fieldID: id - options(names: "'"${OPTION}"'") { - optionID: id - } - } - } - } - } - }' | jq '.data.organization.projectV2.field | "\(.fieldID) \(.options[0].optionID)"') - read fieldID optionID <<< "${response//\"}" - - echo "fieldID=${fieldID}" >> $GITHUB_OUTPUT - echo "optionID=${optionID}" >> $GITHUB_OUTPUT - - - name: Set "Status" of PR to "Community" - if: steps.preview_label_check.outputs.label_check == 'success' - env: - GH_TOKEN: ${{ secrets.NB_PROJECT_PAT }} - run: | - gh api graphql -f query='mutation { - updateProjectV2ItemFieldValue( - input: {projectId: "PVT_kwDOBaeejM4AAQiP", itemId: "${{ steps.find_container.outputs.parent_id }}", fieldId: "${{ steps.get_id.outputs.fieldID }}", value: {singleSelectOptionId: "${{ steps.get_id.outputs.optionID }}"}} - ) { - clientMutationId - } - }'