Skip to content
Snippets Groups Projects
Unverified Commit 7ab209d6 authored by xgui3783's avatar xgui3783 Committed by GitHub
Browse files

Merge pull request #1139 from FZJ-INM1-BDA/hotfix_parcSel

bugfix: change parc in different tmpl spc
parents c6973a8a 9ca47ccf
No related branches found
No related tags found
No related merge requests found
# v2.6.3
## Bugfixes
- Fixed an issue where inter-space selection of parcellation was not possible.
......@@ -44,6 +44,10 @@
- [ ] Explore in other templates exists, and has MNI152 and big brain
- [ ] clicking on the respective space will load julich 2.9 in that space
- [ ] the navigation should be preserved
- [ ] switching template/parc
- [ ] mni152 julich brain 29 (big brain) -> big brain julich brain 29
- [ ] mni152 julich brain 29 (cortical layer) -> big brain cortical layer
- [ ] mni152 long bundle (dismiss) -> mni152 julich brain 29
- [ ] in big brain v2.9 (or latest)
- [ ] high res hoc1, hoc2, hoc3, lam1-6 are visible
- [ ] pli dataset [link](https://siibra-explorer.apps.hbp.eu/staging/?templateSelected=Big+Brain+%28Histology%29&parcellationSelected=Grey%2FWhite+matter&cNavigation=0.0.0.-W000.._eCwg.2-FUe3._-s_W.2_evlu..7LIx..1uaTK.Bq5o~.lKmo~..NBW&previewingDatasetFiles=%5B%7B%22datasetId%22%3A%22minds%2Fcore%2Fdataset%2Fv1.0.0%2Fb08a7dbc-7c75-4ce7-905b-690b2b1e8957%22%2C%22filename%22%3A%22Overlay+of+data+modalities%22%7D%5D)
......
......@@ -16,13 +16,6 @@ markdown_extensions:
plugins:
- search
# - errandkun:
# extract_path: docs/autogen_images
# external_resources:
# - type: github
# owner: fzj-inm1-bda
# repo: interactive-viewer
# workflow_name: e2e
pages:
- Home: 'index.md'
......@@ -40,6 +33,7 @@ pages:
- Fetching datasets: 'advanced/datasets.md'
- Display non-atlas volumes: 'advanced/otherVolumes.md'
- Release notes:
- v2.6.3: 'releases/v2.6.3.md'
- v2.6.2: 'releases/v2.6.2.md'
- v2.6.1: 'releases/v2.6.1.md'
- v2.6.0: 'releases/v2.6.0.md'
......
{
"name": "interactive-viewer",
"version": "2.6.2",
"version": "2.6.3",
"description": "HBP interactive atlas viewer. Integrating KG query, dataset previews & more. Based on humanbrainproject/nehuba & google/neuroglancer. Built with angular",
"scripts": {
"build-aot": "ng build && node ./third_party/matomo/processMatomo.js",
......
import { CommonModule } from "@angular/common"
import { ComponentFixture, TestBed } from "@angular/core/testing"
import { NoopAnimationsModule } from "@angular/platform-browser/animations"
import { MockStore, provideMockStore } from "@ngrx/store/testing"
import { ComponentsModule } from "src/components"
import { viewerStateSelectTemplateWithId, viewerStateToggleLayer } from "src/services/state/viewerState.store.helper"
import { AngularMaterialModule } from "src/sharedModules"
import { QuickTourModule } from "src/ui/quickTour"
import { GetGroupedParcPipe } from "../pipes/getGroupedParc.pipe"
import { GetIndividualParcPipe } from "../pipes/getIndividualParc.pipe"
import { GetNonbaseParcPipe } from "../pipes/getNonBaseParc.pipe"
import { AtlasLayerSelector } from "./atlasLayerSelector.component"
describe("> atlasLayerSelector.component.ts", () => {
describe("> AtlasLayerSelector", () => {
let fixture: ComponentFixture<AtlasLayerSelector>
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
CommonModule,
AngularMaterialModule,
NoopAnimationsModule,
QuickTourModule,
ComponentsModule,
],
declarations: [
AtlasLayerSelector,
GetIndividualParcPipe,
GetNonbaseParcPipe,
GetGroupedParcPipe,
],
providers: [
provideMockStore()
]
}).compileComponents()
})
it("> can be init", () => {
fixture = TestBed.createComponent(AtlasLayerSelector)
expect(fixture).toBeTruthy()
})
describe("> methods", () => {
beforeEach(() => {
fixture = TestBed.createComponent(AtlasLayerSelector)
})
describe("> selectParcellationWithName", () => {
let tmplSupportParcPipeTransform: jasmine.Spy
let storeDispatchSpy: jasmine.Spy
const dummySelectedTmpl = {
"this": "obj"
}
const dummyParc = {
"foo": "bar",
"availableIn": [{
"baz": "yoo"
}]
}
beforeEach(() => {
tmplSupportParcPipeTransform = spyOn(fixture.componentInstance['currTmplSupportParcPipe'], 'transform')
const store = TestBed.inject(MockStore)
storeDispatchSpy = spyOn(store, 'dispatch')
fixture.componentInstance['selectedTemplate'] = dummySelectedTmpl
})
afterEach(() => {
if (tmplSupportParcPipeTransform) {
tmplSupportParcPipeTransform.calls.reset()
}
})
it("> calls pipe.transform", () => {
tmplSupportParcPipeTransform.and.returnValue(true)
fixture.componentInstance.selectParcellationWithName(dummyParc)
expect(tmplSupportParcPipeTransform).toHaveBeenCalledWith(dummySelectedTmpl, dummyParc)
expect(storeDispatchSpy).toHaveBeenCalledTimes(1)
})
const tmplChgReqParam = [true, false]
for (const tmplChgReq of tmplChgReqParam) {
describe(`> tmplChgReq: ${tmplChgReq}`, () => {
it("> expect the correct type of method to be called", () => {
tmplSupportParcPipeTransform.and.returnValue(!tmplChgReq)
fixture.componentInstance.selectParcellationWithName(dummyParc)
const allArgs = storeDispatchSpy.calls.allArgs()
expect(allArgs.length).toEqual(1)
expect(allArgs[0].length).toEqual(1)
const action = allArgs[0][0]
const expectedAction = tmplChgReq
? viewerStateSelectTemplateWithId
: viewerStateToggleLayer
expect(action.type).toEqual(expectedAction.type)
})
})
}
})
})
})
})
......@@ -134,12 +134,13 @@ export class AtlasLayerSelector implements OnInit, OnDestroy {
private currTmplSupportParcPipe = new CurrentTmplSupportsParcPipe()
selectParcellationWithName(layer: any) {
const tmplChangeReq = this.currTmplSupportParcPipe.transform(this.selectedTemplate, layer)
const tmplChangeReq = !this.currTmplSupportParcPipe.transform(this.selectedTemplate, layer)
if (!tmplChangeReq) {
this.store$.dispatch(
viewerStateToggleLayer({ payload: layer })
)
} else {
this.showOverlayIntent$.next(true)
this.store$.dispatch(
viewerStateSelectTemplateWithId({
payload: layer.availableIn[0],
......
......@@ -10,7 +10,7 @@ import { AtlaslayerTooltipPipe } from "./pipes/atlasLayerTooltip.pipe";
import { ComponentsModule } from "src/components";
import { GetNonbaseParcPipe } from "./pipes/getNonBaseParc.pipe";
import { GetIndividualParcPipe } from "./pipes/getIndividualParc.pipe";
import { getGroupedParcPipe } from "./pipes/getGroupedParc.pipe";
import { GetGroupedParcPipe } from "./pipes/getGroupedParc.pipe";
import { CurrentTmplSupportsParcPipe } from "./pipes/currTmplSupportsParc.pipe";
import { GroupParcSelectedPipe } from "./pipes/groupParcSelected.pipe";
import { GetPreviewUrlPipe } from "./pipes/getPreviewUrl.pipe";
......@@ -36,7 +36,7 @@ import { SiibraExplorerTemplateModule } from "../template";
AtlaslayerTooltipPipe,
GetNonbaseParcPipe,
GetIndividualParcPipe,
getGroupedParcPipe,
GetGroupedParcPipe,
CurrentTmplSupportsParcPipe,
GroupParcSelectedPipe,
CurrParcSupportsTmplPipe,
......
......@@ -12,7 +12,7 @@ export class CurrParcSupportsTmplPipe implements PipeTransform{
* buggy. says julich brain v290 is not supported in fsaverage
* related to https://github.com/FZJ-INM1-BDA/siibra-python/issues/98
*/
const parcSupportTmpl = (p: any) => !!(tmpl.availableIn || []).find(tmplP => tmplP['@id'] === p['@id'])
const parcSupportTmpl = (p: any) => !!(tmpl.availableIn || []).find(tmplP => tmplP['@id'] === p && p['@id'])
return Array.isArray(parc)
? parc.some(parcSupportTmpl)
: parcSupportTmpl(parc)
......
......@@ -8,7 +8,7 @@ type TReturn = {
name: 'getGroupedParc',
pure: true
})
export class getGroupedParcPipe implements PipeTransform{
export class GetGroupedParcPipe implements PipeTransform{
public transform(arr: any[]):TReturn{
const returnObj: TReturn = {}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment