-
Notifications
You must be signed in to change notification settings - Fork 0
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
Apply links to browse taxon -page [closes #696] #755
Conversation
@@ -145,7 +145,8 @@ | |||
</span> | |||
</ng-template> | |||
<ng-template let-row="row" #taxonScientificNameLink> | |||
<a *ngIf="row.scientificName" title="{{row.scientificName}}" [routerLink]="['/taxon/' + row.id] | localize"> | |||
<a *ngIf="row.scientificName" title="{{row.scientificName}}" | |||
[routerLink]="['/taxon/' + (row.id.includes('http') ? row.id.split('/').pop() : row.id)] | localize"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is highly suspicious. Why is the id
property an url? Sounds like the data needs to be parsed earlier to parse the id out of the url...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. I found a code block from species-list.component.ts
now which seems to transform ID to url for some reason. I deleted it now, and it doesn't return url from ID anymore.
@@ -1,9 +1,11 @@ | |||
<ol class="breadcrumb" *ngIf="informalGroup && informalGroup.id"> | |||
<li routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}"> | |||
<a (click)="informalGroupSelect.emit()" tabindex="0" role="button" luKeyboardClickable>{{ 'observation.active.informalTaxonGroupAll' | translate }}</a> | |||
<a [routerLink]="'/taxon/browse'" (click)="informalGroupSelect.emit()" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use click events on a
elements, this creates a collision with default browser behavior (you can actually visually see some weirdness if you compare how the informal group select behaves on dev.laji.fi vs this branch). The component needs to be refactored to remove the informalGroupSelect
event entirely from both informal-list
and informal-list-breadcrumb
. Instead, add a queryparams change listener, and use that to update the "search query"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to subscribe to query params now, is it the type of change listener that you meant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
https://696.dev.laji.fi/taxon/browse?informalGroupFilters=MVL.343
#696
Three changes: