Skip to content

Commit

Permalink
refactor the table content and the order of components
Browse files Browse the repository at this point in the history
  • Loading branch information
Sepideh Alassi committed Apr 4, 2024
1 parent 29ad447 commit 03f6026
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 22 deletions.
32 changes: 16 additions & 16 deletions src/app/resource/manuscript-entry/manuscript-entry.component.html
Expand Up @@ -35,34 +35,32 @@ <h4>Pages</h4>
</li>
</ul>
</section>
</aside>

<main>

<section *ngIf="props?.title[0]">
<h4 class="subheading-2">{{props?.title[0].propertyLabel}}</h4>
<read-text-value [valueObject]="props?.title[0]" [bindEvents]="false" [resource]="resource.readResource">
</read-text-value>
</section>

<section *ngIf="props?.manuscriptEntryOf[0]">
<h4 class="subheading-2">{{props?.manuscriptEntryOf[0].propertyLabel}}</h4>
<dsp-link-value [displayValue]="props?.manuscriptEntryOf[0]" [parentResource]="resource.readResource"
[propIri]="props?.manuscriptEntryOf[0].property" (referredResourceClicked)="resLinkClicked($event)" [mode]="'read'"></dsp-link-value>
</section>

<section *ngIf="props?.seqnum[0]">
<h4 class="subheading-2">Manuscript number</h4>
<p>{{props.seqnum[0].int}}</p>
</section>
</aside>

<main>

<section *ngIf="props?.title[0]" class="title center">
<p>
<read-text-value [valueObject]="props?.title[0]" [bindEvents]="false" [resource]="resource.readResource">
</read-text-value>
</p>
</section>
<ng-container *ngIf="isPartOfReisbuechlein">
<section *ngIf="pages$ | async as page" class="transcription-btn">
<mat-card class="intro-card" appearance="outlined" (click)="goToFirstPageTranscription(page.resources[0].id)">
<mat-card-content>Transcription</mat-card-content>
</mat-card>
</section>

<dsp-progress-indicator *ngIf="isJouneryLoading" [color]="'#D88958'">isJouneryLoading</dsp-progress-indicator>
<ng-container *ngIf="journey$ | async as journey">
<section *ngIf="journey.results.bindings.length > 0">
<h4>Journey</h4>
Expand Down Expand Up @@ -90,7 +88,11 @@ <h4>Journey</h4>
</table>
</section>
</ng-container>

<dsp-progress-indicator *ngIf="isMapLoading" [color]="'#D88958'">isJouneryLoading</dsp-progress-indicator>
<ng-container *ngIf="mapCoordinates$ | async as coordinates">
<app-map *ngIf="coordinates.results.bindings.length > 0" [mapData]="coordinates"></app-map>
</ng-container>
<dsp-progress-indicator *ngIf="isStageLoading" [color]="'#D88958'">isJouneryLoading</dsp-progress-indicator>
<ng-container *ngIf="stages$ | async as stages">
<section *ngIf="stages.results.bindings.length > 0">
<h4>Stages</h4>
Expand Down Expand Up @@ -119,9 +121,7 @@ <h4>Stages</h4>
</section>
</ng-container>

<ng-container *ngIf="mapCoordinates$ | async as coordinates">
<app-map *ngIf="coordinates.results.bindings.length > 0" [mapData]="coordinates"></app-map>
</ng-container>


</ng-container>

Expand Down
Expand Up @@ -42,6 +42,9 @@ export class ManuscriptEntryComponent extends BeolResource {
ontologyInfo: ResourceClassAndPropertyDefinitions;
incomingStillImageRepresentationCurrentOffset: number; // last offset requested for `this.resource.incomingStillImageRepresentations`
isLoading = true;
isJouneryLoading = true
isStageLoading = true
isMapLoading = true
errorMessage: any;
dspConstants = Constants;
navigationSubscription: Subscription;
Expand Down Expand Up @@ -149,17 +152,22 @@ export class ManuscriptEntryComponent extends BeolResource {
.pipe(
map((data: DataGraphDB) => this.addURI(data))
);
this.isJouneryLoading = false
}

private getStages() {
this.stages$ = this._beolService.getStages(this.iri)
.pipe(
map((data: DataGraphDB) => this.addURI(data)),
);
this.isStageLoading = false
}

private getMapCoordinates() {
this.mapCoordinates$ = this._beolService.make_coordinates_query(this.iri);

this.isMapLoading = false

}

goToLocation(resIri) {
Expand Down
16 changes: 10 additions & 6 deletions src/app/services/beol.service.ts
Expand Up @@ -710,7 +710,7 @@ export class BeolService {
PREFIX ofn:<http://www.ontotext.com/sparql/functions/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?From ?FromIri ?To ?ToIri ?Departure ?Arrival ?End ?Duration
SELECT ?From ?FromIri ?To ?ToIri ?Departure ?Arrival ?Duration_Journey ?Stay_End ?Duration_Stay
WHERE {
BIND (<< ?person trip-onto:hasJourney ?journey>> AS ?journeyTriple)
BIND(<${entryIri}> AS ?entryIRI)
Expand All @@ -731,11 +731,15 @@ export class BeolService {
BIND(fn:concat(?arr_calendar, " ", STR(?ArrivalDate)) AS ?Arrival)
?journeyTriple trip-onto:hasEndDate ?EndDate .
<< ?journeyTriple trip-onto:hasEndDate ?EndDate >> trip-onto:calendar ?end_calendar .
BIND(fn:concat(?end_calendar, " ", STR(?EndDate)) AS ?End)
BIND(ofn:days-from-duration(?EndDate-?ArrivalDate) AS ?duration_d)
BIND(ofn:years-from-duration(?EndDate-?ArrivalDate) AS ?duration_y)
BIND(ofn:months-from-duration(?EndDate-?ArrivalDate) AS ?duration_m)
BIND(fn:concat( STR(?duration_y *365+ ?duration_m*30 + ?duration_d), " days") AS ?Duration)
BIND(fn:concat(?end_calendar, " ", STR(?EndDate)) AS ?Stay_End)
BIND(ofn:days-from-duration(?EndDate-?ArrivalDate) AS ?duration_s_d)
BIND(ofn:years-from-duration(?EndDate-?ArrivalDate) AS ?duration_s_y)
BIND(ofn:months-from-duration(?EndDate-?ArrivalDate) AS ?duration_s_m)
BIND(fn:concat( STR(?duration_s_y *365+ ?duration_s_m*30 + ?duration_s_d), " days") AS ?Duration_Stay)
BIND(ofn:days-from-duration(?DepartureDate-?ArrivalDate) AS ?duration_d)
BIND(ofn:years-from-duration(?DepartureDate-?ArrivalDate) AS ?duration_y)
BIND(ofn:months-from-duration(?DepartureDate-?ArrivalDate) AS ?duration_m)
BIND(fn:concat( STR(?duration_y *365+ ?duration_m*30 + ?duration_d), " days") AS ?Duration_Journey)
SERVICE <${this._appInitService.config['fusekiUrl']}> {
?FromIri rdfs:label ?From .
?ToIri rdfs:label ?To .
Expand Down

0 comments on commit 03f6026

Please sign in to comment.