diff --git a/nietzsche-beta-app/src/app/services/navigation-service.service.ts b/nietzsche-beta-app/src/app/services/navigation-service.service.ts index 0bd8e5d..8bf1ee2 100644 --- a/nietzsche-beta-app/src/app/services/navigation-service.service.ts +++ b/nietzsche-beta-app/src/app/services/navigation-service.service.ts @@ -1,86 +1,87 @@ import {Injectable} from '@angular/core'; import {TlnQueryParams, NavTreeDef } from '../models/models'; import * as _ from 'lodash'; import {Subscription} from 'rxjs'; import {ActivatedRoute, Params, Router} from '@angular/router'; @Injectable() export class NavigationServiceService { queryParams: TlnQueryParams; queryParamSubscription: Subscription; constructor( private router: Router, private activatedRoute: ActivatedRoute ) { // service is listening to all changes this.queryParamSubscription = this.activatedRoute.queryParams.subscribe( (queryParams: Params ) => { this.queryParams = new TlnQueryParams( queryParams.navBarOpenState, queryParams.navTabIndex, queryParams.manuscript, queryParams.page, queryParams.selectedLines, queryParams.selectedWords, queryParams.viewMode, queryParams.fullscreen, queryParams.zoom ); }); } navigationTreeDefs: NavTreeDef[] = [ { id: 0, isActive: true, label: 'Manuskripte', qParam: 'manuscript', description: '', entries: [], apiDef: { type: 0, // rdf baseUrl: 'https://nietzsche.fuseki.services.dasch.swiss/nietzsche',//'http://fuseki.nie-ine.ch/nietzsche-rw/query', dataArray: 'results.bindings', query: 'manuscripts.rq', mapping: { // maps the properties of the reponse to tha NavTabDef properties, which are displayed id: 'manuscript.value', // Short id, iri in most cases iri: 'manuscript.value', // iri type: 'type.value', label: 'title.value', } } }, { id: 1, isActive: false, label: 'Seiten', qParam: 'page', description: '', entries: [], apiDef: { type: 0, // rdf //baseUrl: 'http://fuseki.nie-ine.ch/nietzsche-rw/query', baseUrl: 'https://nietzsche.fuseki.services.dasch.swiss/nietzsche',//'http://fuseki.nie-ine.ch/nietzsche-rw/query', dataArray: 'results.bindings', query: 'getPageData.rq', mapping: { id: 'page.value', // Short id, iri in most cases iri: 'page.value', // iri label: 'pageNumber.value', thumb: 'thumb.value', - idx: 'pageNumber.value' + idx: 'pageNumber.value', + svg: 'svgFileName.value' } } } ]; /** * updateRoute * routes to the active url with the actual or passed query params of this class. */ updateRoute(qParams?: TlnQueryParams) { const activeUrl = this.router.url.split('?')[0]; // seems workaroundish, but actually safe & secure; no other suitable solution at hand if (qParams) { this.router.navigate([activeUrl], { queryParams: qParams }); } else { this.router.navigate([activeUrl], { queryParams: this.queryParams }); } } }