Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #520 - region menu title dataset status #521

Merged
merged 4 commits into from
May 28, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions e2e/src/layout/viewerCtxMenu.prod.e2e-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ const dict = {
}
]
}
},
"Big Brain (Histology)": {
"Cytoarchitectonic Maps": {
tests:[
{
position: [440,200],
expectedLabelName: 'Area hOc1 (V1, 17, CalcS)',
expectedLabelStatus: '(fully mapped)'
}
]
}
}
}

Expand Down Expand Up @@ -41,6 +52,28 @@ describe('> viewerCtxMenu', () => {
expect(visible).toBeTrue()
})

it('> Title includes region status', async () => {
const { tests } = dict[templateName][parcellationName]
const { expectedLabelStatus, expectedLabelName } = tests[0]
await iavPage.wait(500)
if (expectedLabelStatus) {
const fullMenuText = await iavPage.getText(`[aria-label="${ARIA_LABELS.CONTEXT_MENU}"]`)
const titleStatusText = await fullMenuText.substr(0, fullMenuText.indexOf('Brain region'))
expect(titleStatusText.trim()).toEqual(`${expectedLabelName} ${expectedLabelStatus}`)
fsdavid marked this conversation as resolved.
Show resolved Hide resolved
}
})

it('> Title do not includes region status', async () => {
const { tests } = dict[templateName][parcellationName]
const { expectedLabelStatus, expectedLabelName } = tests[0]
await iavPage.wait(500)
if (!expectedLabelStatus) {
const fullMenuText = await iavPage.getText(`[aria-label="${ARIA_LABELS.CONTEXT_MENU}"]`)
const titleStatusText = await fullMenuText.substr(0, fullMenuText.indexOf('Brain region'))
expect(titleStatusText.trim()).toEqual(expectedLabelName)
fsdavid marked this conversation as resolved.
Show resolved Hide resolved
}
})

it('> pos does not change when click inside', async () => {
const { x: xBefore, y: yBefore, height: hBefore } = await iavPage.isAt(`[aria-label="${ARIA_LABELS.CONTEXT_MENU}"]`)
await iavPage.click(`[aria-label="${ARIA_LABELS.SHOW_IN_OTHER_REF_SPACE}"]`)
Expand Down
25 changes: 13 additions & 12 deletions src/ui/parcellationRegion/regionMenu/regionMenu.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<mat-card-title>
<div class="position-relative region-name">
{{ region.name }}
<small *ngIf="region.status"> ({{region.status}})</small>
</div>
</mat-card-title>
<mat-card-subtitle>
Expand All @@ -10,12 +11,12 @@
Brain region
</span>
</mat-card-subtitle>

<mat-card-content>
<mat-divider></mat-divider>

<ng-template #safeHarbour>

<!-- enlarged region actions -->
<mat-grid-list cols="2" rowHeight="6rem" gutterSize="0px">

Expand All @@ -29,7 +30,7 @@
<span iav-v-button-text>Select</span>
</iav-v-button>
</mat-grid-tile>

<mat-grid-tile>
<iav-v-button
class="h-100 w-100"
Expand All @@ -39,7 +40,7 @@
<span iav-v-button-text>Navigate</span>
</iav-v-button>
</mat-grid-tile>

<ng-container *ngFor="let originDataset of (region.originDatasets || [])">
<mat-grid-tile class="iv-custom-comp">
<iav-v-button
Expand All @@ -53,8 +54,8 @@
<span iav-v-button-text [class]="previewDirective.active ? 'iv-custom-comp primary' : ''">Probability Map {{ previewDirective.active }}</span>
</iav-v-button>
</mat-grid-tile>
</ng-container>
</ng-container>

<mat-grid-tile>
<iav-v-button *ngIf="hasConnectivity"
class="h-100 w-100"
Expand All @@ -69,7 +70,7 @@
<i class="fas fa-chevron-down" iav-v-button-footer></i>
</iav-v-button>
</mat-grid-tile>

<mat-grid-tile>
<iav-v-button *ngIf="sameRegionTemplate.length"
class="h-100 w-100"
Expand All @@ -83,7 +84,7 @@
<span iav-v-button-text>Change template</span>
<i class="fas fa-chevron-down" iav-v-button-footer></i>
</iav-v-button>
</mat-grid-tile>
</mat-grid-tile>
</mat-grid-list>
</ng-template>

Expand All @@ -110,7 +111,7 @@
Select
</div>
</mat-list-item>

<!-- position -->
<mat-list-item *ngIf="region?.position" (click)="navigateToRegion()" mat-ripple>
<mat-icon scaled-down fontSet="fas" fontIcon="fa-map-marked-alt" mat-list-icon></mat-icon>
Expand Down Expand Up @@ -154,7 +155,7 @@
</div>
<mat-icon fontSet="fas" [fontIcon]="connectivitySwitch.switchState ? 'fa-chevron-up' : 'fa-chevron-down'"></mat-icon>
</mat-list-item>

<!-- connectivity -->
<mat-list-item *ngIf="connectivitySwitch.switchState" mat-ripple (click)="showConnectivity(region.name)">
<mat-icon fontSet="fas" fontIcon="fa-none" mat-list-icon></mat-icon>
Expand Down Expand Up @@ -196,7 +197,7 @@
</div>
</mat-list-item>
</div>

</div>
</mat-list>
</mat-card-content>
Expand Down