diff --git a/docs/releases/v2.3.9.md b/docs/releases/v2.3.9.md new file mode 100644 index 0000000000000000000000000000000000000000..510ef7cf02181199f427e52b6c65a1d425dbab4d --- /dev/null +++ b/docs/releases/v2.3.9.md @@ -0,0 +1,5 @@ +# v2.3.9 + +## Bugfixes + +- Explore in other templates sometimes bugs out. \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 089276c5fcdbc8e0f4974dcc15cf73715e568fb5..27dd11a403f9284d8af0b43c58e46daf5add7310 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -40,6 +40,7 @@ pages: - Fetching datasets: 'advanced/datasets.md' - Display non-atlas volumes: 'advanced/otherVolumes.md' - Release notes: + - v2.3.9: 'releases/v2.3.9.md' - v2.3.8: 'releases/v2.3.8.md' - v2.3.7: 'releases/v2.3.7.md' - v2.3.6: 'releases/v2.3.6.md' diff --git a/package.json b/package.json index 4675362b803379ed634c94bffa4c3079865154f8..ddaadebbe0ea2ab790f981de88e332c41e144b67 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "interactive-viewer", - "version": "2.3.8", + "version": "2.3.9", "description": "HBP interactive atlas viewer. Integrating KG query, dataset previews & more. Based on humanbrainproject/nehuba & google/neuroglancer. Built with angular.io", "scripts": { "dev-server-export": "webpack-dev-server --config webpack.export.js", diff --git a/src/res/ext/bigbrain.json b/src/res/ext/bigbrain.json index 17f945dfa8a71f454288d1d95679cd25bb0795ab..22556883653d752f26da1a8cd644d808279810dd 100644 --- a/src/res/ext/bigbrain.json +++ b/src/res/ext/bigbrain.json @@ -852,7 +852,6 @@ "ngId": "v3v", "status": "fully mapped", "labelIndex": 1, - "position": [], "rgb": [ 83, 179, @@ -908,7 +907,6 @@ "ngId": "v5", "status": "fully mapped", "labelIndex": 1, - "position": [], "rgb": [ 255, 0, @@ -962,7 +960,6 @@ "ngId": "LGB-lam1", "status": "fully mapped", "labelIndex": 1, - "position": [], "rgb": [ 255, 255, @@ -991,7 +988,6 @@ "ngId": "LGB-lam2", "status": "fully mapped", "labelIndex": 1, - "position": [], "rgb": [ 222, 74, @@ -1020,7 +1016,6 @@ "ngId": "LGB-lam3", "status": "fully mapped", "labelIndex": 1, - "position": [], "rgb": [ 132, 90, @@ -1049,7 +1044,6 @@ "ngId": "LGB-lam4", "status": "fully mapped", "labelIndex": 1, - "position": [], "rgb": [ 41, 123, @@ -1078,7 +1072,6 @@ "ngId": "LGB-lam5", "status": "fully mapped", "labelIndex": 1, - "position": [], "rgb": [ 82, 214, @@ -1107,7 +1100,6 @@ "ngId": "LGB-lam6", "status": "fully mapped", "labelIndex": 1, - "position": [], "rgb": [ 99, 231, @@ -1141,7 +1133,6 @@ "ngId": "v5", "status": "fully mapped", "labelIndex": 1, - "position": [], "rgb": [ 255, 0, @@ -1186,7 +1177,6 @@ "ngId": "LGB-lam1", "status": "fully mapped", "labelIndex": 1, - "position": [], "rgb": [ 255, 255, @@ -1206,7 +1196,6 @@ "ngId": "LGB-lam2", "status": "fully mapped", "labelIndex": 1, - "position": [], "rgb": [ 222, 74, @@ -1226,7 +1215,6 @@ "ngId": "LGB-lam3", "status": "fully mapped", "labelIndex": 1, - "position": [], "rgb": [ 132, 90, @@ -1246,7 +1234,6 @@ "ngId": "LGB-lam4", "status": "fully mapped", "labelIndex": 1, - "position": [], "rgb": [ 41, 123, @@ -1266,7 +1253,6 @@ "ngId": "LGB-lam5", "status": "fully mapped", "labelIndex": 1, - "position": [], "rgb": [ 82, 214, @@ -1286,7 +1272,6 @@ "ngId": "LGB-lam6", "status": "fully mapped", "labelIndex": 1, - "position": [], "rgb": [ 99, 231, diff --git a/src/ui/parcellationRegion/region.base.spec.ts b/src/ui/parcellationRegion/region.base.spec.ts index 44695ff6b769b6f6dbb6a057a226e7b2ac0333da..c2fba7c31109839e617538b27f924a29aa5bd6f3 100644 --- a/src/ui/parcellationRegion/region.base.spec.ts +++ b/src/ui/parcellationRegion/region.base.spec.ts @@ -1,5 +1,6 @@ import { TestBed } from '@angular/core/testing' import { MockStore, provideMockStore } from '@ngrx/store/testing' +import { viewerStateNewViewer } from 'src/services/state/viewerState/actions' import { RegionBase, regionInOtherTemplateSelector, getRegionParentParcRefSpace } from './region.base' /** @@ -449,19 +450,20 @@ describe('> region.base.ts', () => { }) describe('> RegionBase', () => { + let regionBase: RegionBase + let mockStore: MockStore beforeEach(() => { TestBed.configureTestingModule({ providers: [ provideMockStore() ] }) + mockStore = TestBed.inject(MockStore) + mockStore.overrideSelector(regionInOtherTemplateSelector, []) + mockStore.overrideSelector(getRegionParentParcRefSpace, { template: null, parcellation: null }) }) describe('> position', () => { - let regionBase: RegionBase beforeEach(() => { - const mockStore = TestBed.inject(MockStore) - mockStore.overrideSelector(regionInOtherTemplateSelector, []) - mockStore.overrideSelector(getRegionParentParcRefSpace, { template: null, parcellation: null }) regionBase = new RegionBase(mockStore) }) it('> does not populate if position property is absent', () => { @@ -526,5 +528,85 @@ describe('> region.base.ts', () => { expect(regionBase.position).toBeTruthy() }) }) + + describe('> changeView', () => { + const fakeTmpl = { + name: 'fakeTmpl' + } + const fakeParc = { + name: 'fakeParc' + } + beforeEach(() => { + regionBase = new RegionBase(mockStore) + }) + + describe('> if sameRegion has position attribute', () => { + let dispatchSpy: jasmine.Spy + + beforeEach(() => { + dispatchSpy = spyOn(mockStore, 'dispatch') + }) + afterEach(() => { + dispatchSpy.calls.reset() + }) + it('> malformed position is not an array > do not pass position', () => { + + regionBase.changeView({ + template: fakeTmpl, + parcellation: fakeParc, + region: { + position: 'hello wolrd' + } + }) + + expect(dispatchSpy).toHaveBeenCalledWith( + viewerStateNewViewer({ + selectTemplate: fakeTmpl, + selectParcellation: fakeParc, + navigation: {} + }) + ) + }) + + it('> malformed position is an array of incorrect size > do not pass position', () => { + + regionBase.changeView({ + template: fakeTmpl, + parcellation: fakeParc, + region: { + position: [] + } + }) + + expect(dispatchSpy).toHaveBeenCalledWith( + viewerStateNewViewer({ + selectTemplate: fakeTmpl, + selectParcellation: fakeParc, + navigation: {} + }) + ) + }) + + it('> correct position > pass position', () => { + regionBase.changeView({ + template: fakeTmpl, + parcellation: fakeParc, + region: { + position: [1,2,3] + } + }) + + expect(dispatchSpy).toHaveBeenCalledWith( + viewerStateNewViewer({ + selectTemplate: fakeTmpl, + selectParcellation: fakeParc, + navigation: { + position: [1,2,3] + } + }) + ) + }) + }) + }) }) }) diff --git a/src/ui/parcellationRegion/region.base.ts b/src/ui/parcellationRegion/region.base.ts index 35c33e9c60bbb820e47e3b86841f37a14ec224eb..27a83cdf571b58c71d8de51e91de805e7332c77d 100644 --- a/src/ui/parcellationRegion/region.base.ts +++ b/src/ui/parcellationRegion/region.base.ts @@ -169,6 +169,9 @@ export class RegionBase { region } = sameRegion const { position } = region + const navigation = Array.isArray(position) && position.length === 3 + ? { position } + : { } this.closeRegionMenu.emit() /** @@ -178,9 +181,7 @@ export class RegionBase { this.store$.dispatch(viewerStateNewViewer ({ selectTemplate: template, selectParcellation: parcellation, - navigation: { - position - }, + navigation, })) }