forked from dasch-swiss/beol
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
component for location res, linking locations, adding number of manus…
…cript
- Loading branch information
Showing
9 changed files
with
272 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<div class="container"> | ||
<menu> | ||
<li> | ||
<button mat-stroked-button class="previousBtn" (click)="location.back()"> | ||
<mat-icon>arrow_back</mat-icon>Previous | ||
</button> | ||
</li> | ||
<li> | ||
<button mat-stroked-button class="share-res" (click)="openDialog(resource.readResource.versionArkUrl)"> | ||
<mat-icon>share</mat-icon>Citation Link | ||
</button> | ||
</li> | ||
</menu> | ||
|
||
<main> | ||
<h1 mat-card-subtitle>{{resource?.readResource.resourceClassLabel}}</h1> | ||
<h2>{{resource?.readResource.label}}</h2> | ||
|
||
<section mat-line *ngFor="let prop of resource?.readResource.properties | keyvalue"> | ||
<h3>{{prop.value[0].propertyLabel}}</h3> | ||
<ul> | ||
<li *ngFor="let val of prop.value"> | ||
<ng-container *ngIf="val.type === dspConstants.GeonameValue">{{val.strval}}</ng-container> | ||
<ng-container *ngIf="val.type === dspConstants.TextValue">{{val.strval}}</ng-container> | ||
<ng-container *ngIf="val.type === dspConstants.UriValue"> | ||
<a [href]="val.strval">{{val.strval}}</a> | ||
</ng-container> | ||
</li> | ||
</ul> | ||
</section> | ||
</main> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
@import "src/app/dsp-ui-lib/style/responsive"; | ||
|
||
.container { | ||
display: flex; | ||
flex-direction: column; | ||
|
||
menu { | ||
list-style: none; | ||
margin-inline-start: 2rem; | ||
margin-inline-end: 2rem; | ||
margin-block-start: 0; | ||
margin-block-end: 0; | ||
padding-inline-start: 0; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
|
||
.previousBtn { | ||
margin-inline-start: 0!important; | ||
} | ||
} | ||
|
||
main { | ||
margin-inline-start: 14rem; | ||
margin-inline-end: 14rem; | ||
max-width: 1000px; | ||
align-content: center; | ||
} | ||
} | ||
|
||
@media(max-width: map-get($grid-breakpoints, tablet)) { | ||
.container { | ||
main { | ||
margin-inline-start: 6rem; | ||
margin-inline-end: 6rem; | ||
} | ||
} | ||
} | ||
|
||
@media(max-width: map-get($grid-breakpoints, phone)) { | ||
.container { | ||
main { | ||
margin-inline-start: 2rem; | ||
margin-inline-end: 2rem; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { LocationComponent } from './location.component'; | ||
|
||
describe('LocationComponent', () => { | ||
let component: LocationComponent; | ||
let fixture: ComponentFixture<LocationComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ LocationComponent ] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(LocationComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import {Component, Inject} from '@angular/core'; | ||
import {BeolCompoundResource, BeolResource} from '../beol-resource'; | ||
import {Constants, KnoraApiConnection, ResourceClassAndPropertyDefinitions} from '@dasch-swiss/dsp-js'; | ||
import {Subscription} from 'rxjs'; | ||
import {AppInitService, DspApiConnectionToken} from '../../dsp-ui-lib/core'; | ||
import {ActivatedRoute} from '@angular/router'; | ||
import {IncomingService} from '../../services/incoming.service'; | ||
import {BeolService} from '../../services/beol.service'; | ||
import {Location} from '@angular/common'; | ||
import {MatDialog} from '@angular/material/dialog'; | ||
import {ArkUrlDialogComponent} from '../../dialog/ark-url-dialog.component'; | ||
|
||
@Component({ | ||
selector: 'app-location', | ||
templateUrl: './location.component.html', | ||
styleUrls: ['./location.component.scss'] | ||
}) | ||
export class LocationComponent extends BeolResource { | ||
|
||
iri: string; | ||
resource: BeolCompoundResource; | ||
ontologyInfo: ResourceClassAndPropertyDefinitions; | ||
incomingStillImageRepresentationCurrentOffset: number; // last offset requested for `this.resource.incomingStillImageRepresentations` | ||
isLoading = true; | ||
errorMessage: any; | ||
dspConstants = Constants; | ||
navigationSubscription: Subscription; | ||
|
||
propIris; | ||
|
||
constructor( | ||
@Inject(DspApiConnectionToken) protected _dspApiConnection: KnoraApiConnection, | ||
private _appInitService: AppInitService, | ||
protected _route: ActivatedRoute, | ||
protected _incomingService: IncomingService, | ||
protected _beolService: BeolService, | ||
public location: Location, | ||
public dialog: MatDialog | ||
) { | ||
super(_dspApiConnection, _route, _incomingService, _beolService); | ||
} | ||
|
||
initProps() { | ||
} | ||
|
||
/** | ||
* Display incoming links as clickable links | ||
* | ||
* @param resIri | ||
* @param resType | ||
* @param res | ||
*/ | ||
showIncomingRes(resIri, resType, res) { | ||
this._beolService.routeByResourceType(resType, resIri, res); | ||
} | ||
|
||
openDialog(arkURL: string) { | ||
this.dialog.open(ArkUrlDialogComponent, { | ||
hasBackdrop: true, | ||
width: '600px', | ||
data: { | ||
arkURL: arkURL | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.