Skip to content

Commit

Permalink
AUS-3908 Improve "Info" panel layer metadata display
Browse files Browse the repository at this point in the history
  • Loading branch information
vjf committed Apr 5, 2023
1 parent 874aff7 commit c992d71
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<p><b>Title: </b>{{cswRecord.name}}</p>
<p><b>Abstract: </b>{{cswRecord.description}}</p>
<p><b>Contact org: </b>{{cswRecord.contactOrg}}</p>
<p *ngIf="cswRecord.funderOrg !== 'Unknown'"><b>Funder: </b>{{cswRecord.funderOrg}}</p>
<p *ngIf="cswRecord.funderOrg && cswRecord.funderOrg !== 'Unknown'"><b>Funder: </b>{{cswRecord.funderOrg}}</p>
<p *ngIf='cleanConstraints(cswRecord.constraints).length > 0'><b>Constraints: </b>{{cleanConstraints(cswRecord.constraints)}}</p>
<p *ngIf='selectConstraints(layer.capabilityRecords, cswRecord.accessConstraints).length > 0'><b>Access Constraints: </b>{{selectConstraints(layer.capabilityRecords, cswRecord.accessConstraints)}}</p>
<p><b>Info URL: </b><a target="_blank" href="{{cswRecord.recordInfoUrl}}">Link to Geonetwork Record</a></p>
<p *ngIf="cswRecord.recordInfoUrl && cswRecord.recordInfoUrl.length > 0"><b>Info URL: </b><a target="_blank" href="{{cswRecord.recordInfoUrl}}">Link to Geonetwork Record</a></p>
<div *ngFor="let onlineResource of cswRecord.onlineResources">
<p *ngIf="onlineResource.type==='DOI'">
<span class="label label-default"><b>DOI Name: </b></span> {{onlineResource.name}}<br>
Expand All @@ -14,8 +14,8 @@
<p *ngIf="onlineResource.type!=='Unsupported' && onlineResource.type!=='DOI'">
<span *ngIf="isGetCapabilitiesType(onlineResource)" class="label label-default"><b>{{onlineResource.type}}: </b></span>
<a *ngIf="isGetCapabilitiesType(onlineResource)" target="_blank" href="{{ onlineResourceGetCapabilitiesUrl(onlineResource) }}">{{onlineResource.type}} GetCapabilities Info</a>
<span *ngIf="!isGetCapabilitiesType(onlineResource)" class="label label-default"><b>{{onlineResource.name.split('_').join(' ')}}: </b></span>
<a *ngIf="!isGetCapabilitiesType(onlineResource)" target="_blank" href="{{ onlineResource.url }}">{{ onlineResource.url }}</a>
<span *ngIf="!isGetCapabilitiesType(onlineResource) && onlineResource.url" class="label label-default"><b>{{onlineResource.name.split('_').join(' ')}}: </b></span>
<a *ngIf="!isGetCapabilitiesType(onlineResource)" target="_blank" href="{{ removeProxy(onlineResource.url) }}">{{ removeProxy(onlineResource.url) }}</a>
</p>
</div>
<p *ngIf="wmsUrl!==undefined">
Expand Down
12 changes: 12 additions & 0 deletions src/app/menupanel/common/infopanel/subpanel/subpanel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@ export class InfoPanelSubComponent implements OnChanges {
return onlineResource.type === 'WMS' || onlineResource.type === 'WFS' || onlineResource.type === 'WCS' || onlineResource.type === 'CSW';
}

/** Removes proxy from URL for display purposes
*
* e.g. "http://localhost:8080/getViaProxy.do?url=https://raw.githubusercontent.com/CesiumGS/cesium/main/Apps/SampleData/kml/bikeRide.kml"
* get converted to "https://raw.githubusercontent.com/CesiumGS/cesium/main/Apps/SampleData/kml/bikeRide.kml"
*
* @param url URL which may be prepended with a reference to the proxy
* @returns URL without the proxy part
*/
public removeProxy(url: string): string {
return url.replace(/^.+getViaProxy\.do\?url=/, "");
}

/**
* Create a WMS/WFS/WCS/CSW GetCapabilities URL from the provided OnlineResource
*
Expand Down

0 comments on commit c992d71

Please sign in to comment.