Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</span>
</div>
<div class="details-button">
<a mat-button [href]="`${CONTENT_DETAIL}/${obj().stId}`" target="_blank">
<a mat-button [routerLink]="`${CONTENT_DETAIL}/${obj().stId}`" target="_blank">
<mat-icon class="custom-icon double-arrow" [svgIcon]="'double-arrow-right'"></mat-icon>
<span class="details-label"> Details page</span>
</a>
Expand Down Expand Up @@ -163,7 +163,7 @@
<div class="label-container">{{ item.key }}</div>
<div class="composition-container">
@for (pe of item.value; let i = $index; track pe.dbId) {
<a [href]="`${CONTENT_DETAIL}/${pe.stId}`">{{ pe.name[0] }}</a>
<a [routerLink]="`${CONTENT_DETAIL}/${pe.stId}`">{{ pe.name[0] }}</a>
<!-- Add separator except for last item -->
@if (i < item.value.length - 1) {
<span class="margin-right">,</span>
Expand All @@ -183,7 +183,7 @@
<div class="label-container">{{ item.key }}</div>
<div class="composition-container">
@for (pe of item.value; let i = $index; track pe.dbId) {
<a [href]="`${CONTENT_DETAIL}/${pe.stId}`">{{ pe.name[0] }}</a>
<a [routerLink]="`${CONTENT_DETAIL}/${pe.stId}`">{{ pe.name[0] }}</a>
<!-- Add separator except for last item -->
@if (i < item.value.length - 1) {
<span class="margin-right">,</span>
Expand Down Expand Up @@ -251,7 +251,7 @@
@for (ie of item.data; track $index) {
<div class="authorship-item">
@for (author of ie.author; let i = $index; track $index) {
<a [href]="`${CONTENT_DETAIL}/${author.dbId}`"
<a [routerLink]="`${CONTENT_DETAIL}/${author.dbId}`"
[ngClass]="{'margin-right': !author.orcidId}">
{{ author.firstname }} {{ author.surname }}
</a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@if (!advancedMode) {
@if (currentMode === 'simple' || currentMode === 'reference') {
<form class="search-bar-container" (submit)="onSubmit($event)">
<input
type="text"
Expand Down Expand Up @@ -47,7 +47,7 @@
}
</ul>
</div>
} @if (advancedMode) {
} @if (currentMode === 'advanced') {
<button class="syntax-help-toggle" (click)="syntaxHelpOpen = !syntaxHelpOpen">
<span class="material-symbols-rounded">help_outline</span>
Syntax Help
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class SearchBarComponent implements OnChanges {
private router = inject(Router);
private searchService = inject(SearchService);
@Input() query: string = '';
@Input() advancedMode = false;
@Input() currentMode: 'advanced' | 'reference' | 'simple' = 'simple';
@Input() filters = false;
@Output() queryChange = new EventEmitter<string>();

Expand Down Expand Up @@ -72,7 +72,8 @@ export class SearchBarComponent implements OnChanges {

const params: Record<string, string | string[] | null> = {
q: q,
advanced: this.advancedMode ? 'true' : null,
advanced: this.currentMode === 'advanced' ? 'true' : null,
reference: this.currentMode === 'reference' ? 'true' : null,
page: null,
};

Expand Down Expand Up @@ -114,7 +115,8 @@ export class SearchBarComponent implements OnChanges {

const params: Record<string, string | string[] | null> = {
q: s,
advanced: this.advancedMode ? 'true' : null,
advanced: this.currentMode === 'advanced' ? 'true' : null,
reference: this.currentMode === 'reference' ? 'true' : null,
page: null,
};

Expand Down
Loading