diff --git a/docs/releases/v2.12.6.md b/docs/releases/v2.12.6.md new file mode 100644 index 0000000000000000000000000000000000000000..124061e96ca78f2ca9fd06317bb4cf935737df32 --- /dev/null +++ b/docs/releases/v2.12.6.md @@ -0,0 +1,6 @@ +# v2.12.6 + +## Bugfixes + +- fix URL encoded annotations +- improved reliability of URL encoding of viewer state \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 3ff6048f486849482bca9b326b24a851d34e7921..ebdcbd0ed1c925dd926f359bbd022607608656d7 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -33,6 +33,7 @@ nav: - Fetching datasets: 'advanced/datasets.md' - Display non-atlas volumes: 'advanced/otherVolumes.md' - Release notes: + - v2.12.6: 'releases/v2.12.6.md' - v2.12.5: 'releases/v2.12.5.md' - v2.12.4: 'releases/v2.12.4.md' - v2.12.3: 'releases/v2.12.3.md' diff --git a/package.json b/package.json index 2612b896200971ccb34e0cff9cb34476ae98178e..d066d32f33f443421e24461733340dff55d73a8d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "siibra-explorer", - "version": "2.12.5", + "version": "2.12.6", "description": "siibra-explorer - explore brain atlases. Based on humanbrainproject/nehuba & google/neuroglancer. Built with angular", "scripts": { "lint": "eslint src --ext .ts", diff --git a/src/atlasComponents/userAnnotations/tools/service.ts b/src/atlasComponents/userAnnotations/tools/service.ts index 9ef8d363ac2a1201e28854b1b940d44967f5def6..5fa7acf9251d3ced3358c2284d670b05ddaca300 100644 --- a/src/atlasComponents/userAnnotations/tools/service.ts +++ b/src/atlasComponents/userAnnotations/tools/service.ts @@ -260,6 +260,7 @@ export class ModularUserAnnotationToolService implements OnDestroy{ #voxelSize = this.store.pipe( select(atlasSelection.selectors.selectedTemplate), + filter(v => !!v), switchMap(tmpl => translateV3Entities.translateSpaceToVolumeImage(tmpl)), map(volImages => { if (volImages.length === 0) { diff --git a/src/atlasComponents/userAnnotations/tools/type.ts b/src/atlasComponents/userAnnotations/tools/type.ts index d54b231afd55ca503430125855acdc6701c3fb72..a100ebcf4953a89fedc55df1c5880db5b2e13b05 100644 --- a/src/atlasComponents/userAnnotations/tools/type.ts +++ b/src/atlasComponents/userAnnotations/tools/type.ts @@ -336,7 +336,12 @@ export abstract class IAnnotationGeometry extends Highlightable { constructor(spec?: TBaseAnnotationGeomtrySpec){ super() this.id = spec && spec.id || getUuid() - this.space = spec?.space + + // older version of annotations were made with at_id as key + // fallback + const spaceId = spec?.space?.id || spec?.space?.['@id'] + + this.space = spaceId && { id: spaceId } this.name = spec?.name this.desc = spec?.desc } diff --git a/src/routerModule/effects.ts b/src/routerModule/effects.ts index ec7c34de0744bcc94464d7f248534a582f17745b..4ef7d676e5169ecd6c579a186c41d6cf0b72a81e 100644 --- a/src/routerModule/effects.ts +++ b/src/routerModule/effects.ts @@ -67,7 +67,11 @@ export class RouterEffects { return generalActions.generalApplyState({ state }) - }) + }), + switchMap(ac => from([ + ac, + generalActions.routeParseComplete() + ])) )) onRouteUpdate$ = createEffect(() => this.#atlasesLoaded$.pipe( diff --git a/src/state/actions.ts b/src/state/actions.ts index 67b9df55d8b833dd18ae0029b9ab6a90f08e7172..c6801c1328660ee66b4c319f17dec6a52189d318 100644 --- a/src/state/actions.ts +++ b/src/state/actions.ts @@ -15,6 +15,10 @@ export const generalApplyState = createAction( }>() ) +export const routeParseComplete = createAction( + `${nameSpace} routeParseComplete` +) + export const noop = createAction( `${nameSpace} noop` ) \ No newline at end of file diff --git a/src/state/index.ts b/src/state/index.ts index aa9964ec9c0a69f063874b6a8b65382a72e2025c..77c5f08d0fe4d4976c063f2581586e6461fc49ff 100644 --- a/src/state/index.ts +++ b/src/state/index.ts @@ -31,6 +31,34 @@ function debug(reducer: ActionReducer<MainState>): ActionReducer<MainState> { }; } +function gateKeepUntilRouteParseComplete(reducer: ActionReducer<MainState>): ActionReducer<MainState>{ + let completeFlag = false + const actions = [] + return function(state, action) { + const isSystem = action.type.includes("@ngrx") + if (completeFlag || isSystem) { + return reducer(state, action) + } + + let _state = state + if (action.type === routeParseComplete.type) { + while (actions.length > 0) { + const _action = actions.shift() // FIFO + _state = reducer(_state, _action) + } + completeFlag = true + return reducer(_state, action) + } + + if (action.type === generalApplyState.type) { + + return reducer(state, action) + } + actions.push(action) + return reducer(state, noop) + } +} + function generalApplyStateReducer(reducer: ActionReducer<MainState>): ActionReducer<MainState> { return function(_state, action) { let state = _state @@ -55,6 +83,7 @@ export const RootStoreModule = StoreModule.forRoot({ [atlasAppearance.nameSpace]: atlasAppearance.reducer, },{ metaReducers: [ + gateKeepUntilRouteParseComplete, generalApplyStateReducer, // debug, ] @@ -77,7 +106,7 @@ export function getStoreEffects() { } import { MainState } from "./const" -import { generalApplyState } from "./actions" +import { generalApplyState, routeParseComplete, noop } from "./actions" export { MainState }