Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AUS-3889 Improve labelling in popups #242

Merged
merged 2 commits into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/app/modalwindow/querier/querier.modal.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ <h2 style="margin-top:10px;">No results found, try zooming to improve accuracy</
<!-- BEGIN card-header -->
<div class="card-header">
<h4 class="card-title">
<a (click)="transformToHtml(doc)" class="accordion-link" data-toggle="collapse" href="#doc-collapse{{i}}">
{{doc.key}}&nbsp;<i *ngIf="transformingToHtml[doc.key] && doc.expanded" class="fa fa-spinner fa-spin"></i>
<a (click)="transformToHtml(doc)" *ngIf="doc.node_name != null" class="accordion-link" data-toggle="collapse" href="#doc-collapse{{i}}">
{{doc.layer.name}} : {{doc.node_name}}&nbsp;<i *ngIf="transformingToHtml[doc.key] && doc.expanded" class="fa fa-spinner fa-spin"></i>
</a>
<a (click)="transformToHtml(doc)" *ngIf="doc.node_name == null" class="accordion-link" data-toggle="collapse" href="#doc-collapse{{i}}">
{{doc.layer.name}}&nbsp;<i *ngIf="transformingToHtml[doc.key] && doc.expanded" class="fa fa-spinner fa-spin"></i>
</a>
</h4>
</div>
Expand Down
28 changes: 28 additions & 0 deletions src/app/modalwindow/querier/querier.modal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,34 @@ export class QuerierModalComponent implements OnInit {

// Look for changes and update UI after brief delay
public onDataChange(): void {
let htmldata = []
let Expression=/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/;
let objExp=new RegExp(Expression);
for (let i = 0; i < this.docs.length; i++) {
var doc = new DOMParser().parseFromString(this.docs[i].raw, "text/xml");
console.log(doc)
if (doc.getElementsByTagName('gml:name').length != 0) {
for (let html in doc.getElementsByTagName('gml:name')) {
if(!objExp.test(doc.getElementsByTagName('gml:name')[html].innerHTML)) {
htmldata.push(doc.getElementsByTagName('gml:name')[html].innerHTML)
}
}
} else if (doc.getElementsByTagName('gsmlp:name').length != 0) {
for (let html in doc.getElementsByTagName('gsmlp:name')) {
if(!objExp.test(doc.getElementsByTagName('gsmlp:name')[html].innerHTML)) {
htmldata.push(doc.getElementsByTagName('gsmlp:name')[html].innerHTML)
}
}
} else if (doc.getElementsByTagName('null:name').length != 0) {
for (let html in doc.getElementsByTagName('null:name')) {
if(!objExp.test(doc.getElementsByTagName('null:name')[html].innerHTML)) {
htmldata.push(doc.getElementsByTagName('null:name')[html].innerHTML)
}
}
}
this.docs[i]['node_name'] = htmldata[i]

}
setTimeout(() => {
this.changeDetectorRef.detectChanges();
}, 50);
Expand Down