diff --git a/docs/releases/v2.6.3.md b/docs/releases/v2.6.3.md new file mode 100644 index 0000000000000000000000000000000000000000..eb412372db38cd0f28fb4aabac6c2f2e56fab199 --- /dev/null +++ b/docs/releases/v2.6.3.md @@ -0,0 +1,6 @@ +# v2.6.3 + +## Bugfixes + +- Fixed an issue where inter-space selection of parcellation was not possible. + diff --git a/e2e/checklist.md b/e2e/checklist.md index 3c0cbe0a538168ea49aeff84877386c05826459b..66a6cb964f93e573b02ddc31de65f0f12da1e3e8 100644 --- a/e2e/checklist.md +++ b/e2e/checklist.md @@ -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) diff --git a/mkdocs.yml b/mkdocs.yml index 01b07eb3b9759e89e7fe1fb66ec0b143a1b97c04..cab1a74d9e8a1b66fbb0973d13a80b963a6c5d20 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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' diff --git a/package.json b/package.json index 70b5d8a08c41ad69cf3fbfd2c8d95a4523064619..b14053107f5e2e9d41b303667692ea69022ed7e9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "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", diff --git a/src/atlasComponents/uiSelectors/atlasLayerSelector/atlasLayerSelector.component.spec.ts b/src/atlasComponents/uiSelectors/atlasLayerSelector/atlasLayerSelector.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..730f7b258819bf92a3a678976bead30a75817452 --- /dev/null +++ b/src/atlasComponents/uiSelectors/atlasLayerSelector/atlasLayerSelector.component.spec.ts @@ -0,0 +1,100 @@ +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) + }) + }) + } + }) + }) + }) +}) diff --git a/src/atlasComponents/uiSelectors/atlasLayerSelector/atlasLayerSelector.component.ts b/src/atlasComponents/uiSelectors/atlasLayerSelector/atlasLayerSelector.component.ts index 1752a7d5f686fbd441993f3a33898f9b194b0744..9fbca8cce700ba9ef5bef01581a618e451308df3 100644 --- a/src/atlasComponents/uiSelectors/atlasLayerSelector/atlasLayerSelector.component.ts +++ b/src/atlasComponents/uiSelectors/atlasLayerSelector/atlasLayerSelector.component.ts @@ -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], diff --git a/src/atlasComponents/uiSelectors/module.ts b/src/atlasComponents/uiSelectors/module.ts index 384dc294ca684560a8d8b0cf7f71d85b7fb488f4..b6994ea3003f3dbe9815b2986507cd7fdeea20a5 100644 --- a/src/atlasComponents/uiSelectors/module.ts +++ b/src/atlasComponents/uiSelectors/module.ts @@ -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, diff --git a/src/atlasComponents/uiSelectors/pipes/currParcSupportsTmpl.pipe.ts b/src/atlasComponents/uiSelectors/pipes/currParcSupportsTmpl.pipe.ts index 77fd66327ee0a4fa5bd004d46474d9ff5a95fb0a..dcdf13d404ba747a5ce65f9f1bbe6fb08189b196 100644 --- a/src/atlasComponents/uiSelectors/pipes/currParcSupportsTmpl.pipe.ts +++ b/src/atlasComponents/uiSelectors/pipes/currParcSupportsTmpl.pipe.ts @@ -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) diff --git a/src/atlasComponents/uiSelectors/pipes/getGroupedParc.pipe.ts b/src/atlasComponents/uiSelectors/pipes/getGroupedParc.pipe.ts index 683d9d7904e588d64d734118723b60f577f20b7b..cd98f91a417520f57af7f9ae9952ffd134716a8f 100644 --- a/src/atlasComponents/uiSelectors/pipes/getGroupedParc.pipe.ts +++ b/src/atlasComponents/uiSelectors/pipes/getGroupedParc.pipe.ts @@ -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 = {}