Page MenuHomec4science

tln-information.component.ts
No OneTemporary

File Metadata

Created
Sat, Jun 1, 06:50

tln-information.component.ts

import { Component, Inject, OnInit } from '@angular/core';
import { Router, ActivatedRoute, Params } from '@angular/router';
import { MAT_BOTTOM_SHEET_DATA, MatBottomSheetRef} from '@angular/material/bottom-sheet';
import { ManuscriptUnity, NavigationPage} from '../models';
import { Mapping, RouteReader } from '../route-reader';
import { RouteUpdater } from '../route-updater';
import { TlnTextGeneticOrder} from '../datatypes/text_version';
import { TLN_PAGE_PARAM, TLN_MANUSCRIPT_PARAM, TLN_TEXT_GENETIC_ORDER_PARAM, TLN_CROSSREF_ROUTE } from '../constants';
import { TlnViewerNavigation } from '../tln-viewer-navigation/tln-viewer-navigation.component';
import { PositionalStyleMarkup, StyleSheetDef, StandoffMarkupSettings} from '../../lib/ngx-mat-standoff-markup.component';
import { TlnPositionalStyleMarkup, TlnFilteredPositionalStyleMarkup } from '../datatypes/positional-markup';
export interface ParentInformation {
geneticOrders: TlnTextGeneticOrder[];
page: NavigationPage;
manuscript_iri: string;
parentActivatedRoute?: ActivatedRoute;
}
@Component({
selector: 'app-tln-information',
templateUrl: './tln-information.component.html',
styleUrls: ['./tln-information.component.css']
})
export class TlnInformationComponent extends RouteUpdater implements OnInit {
/**
* IRI of the current page
**/
current_iri: string;
/**
* the current page
**/
current_page: NavigationPage;
/**
* the data handler of this component that retrieves
* data and instantiates it according to their proper
* datatypes.
**/
geneticOrders: TlnTextGeneticOrder[] = [];
current_manuscript_iri: string;
current_genetic_order: string;
protected currentRoute: string = TLN_CROSSREF_ROUTE;
protected mapping: Mapping = {
current_iri: { param: TLN_PAGE_PARAM, type: "string" },
current_manuscript_iri: { param: TLN_MANUSCRIPT_PARAM, type: "string" },
current_genetic_order: { param: TLN_TEXT_GENETIC_ORDER_PARAM, type: "string" }
}
constructor(@Inject(MAT_BOTTOM_SHEET_DATA) private data: ParentInformation, private bottomSheetRef: MatBottomSheetRef<TlnViewerNavigation>, protected router: Router, protected activatedRoute: ActivatedRoute ){
super(router, activatedRoute);
this.current_page = data.page;
this.geneticOrders = data.geneticOrders;
this.current_manuscript_iri = data.manuscript_iri;
}
ngOnInit() {
super.ngOnInit();
}
private openCrossRef(geneticOrder: TlnTextGeneticOrder){
this.current_genetic_order = geneticOrder.id;
this.current_iri = <string>this.current_page.id
this.updateParams();
}
}

Event Timeline