Skip to content

Commit 4f8fd67

Browse files
authored
Merge pull request #64 from reactome/add-optional-search-by-refrence
Add optional search by refrence
2 parents 51d3679 + 412bbec commit 4f8fd67

File tree

7 files changed

+820
-251
lines changed

7 files changed

+820
-251
lines changed

projects/pathway-browser/src/app/details/tabs/description-tab/description-tab.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</span>
3333
</div>
3434
<div class="details-button">
35-
<a mat-button [href]="`${CONTENT_DETAIL}/${obj().stId}`" target="_blank">
35+
<a mat-button [routerLink]="`${CONTENT_DETAIL}/${obj().stId}`" target="_blank">
3636
<mat-icon class="custom-icon double-arrow" [svgIcon]="'double-arrow-right'"></mat-icon>
3737
<span class="details-label"> Details page</span>
3838
</a>
@@ -163,7 +163,7 @@
163163
<div class="label-container">{{ item.key }}</div>
164164
<div class="composition-container">
165165
@for (pe of item.value; let i = $index; track pe.dbId) {
166-
<a [href]="`${CONTENT_DETAIL}/${pe.stId}`">{{ pe.name[0] }}</a>
166+
<a [routerLink]="`${CONTENT_DETAIL}/${pe.stId}`">{{ pe.name[0] }}</a>
167167
<!-- Add separator except for last item -->
168168
@if (i < item.value.length - 1) {
169169
<span class="margin-right">,</span>
@@ -183,7 +183,7 @@
183183
<div class="label-container">{{ item.key }}</div>
184184
<div class="composition-container">
185185
@for (pe of item.value; let i = $index; track pe.dbId) {
186-
<a [href]="`${CONTENT_DETAIL}/${pe.stId}`">{{ pe.name[0] }}</a>
186+
<a [routerLink]="`${CONTENT_DETAIL}/${pe.stId}`">{{ pe.name[0] }}</a>
187187
<!-- Add separator except for last item -->
188188
@if (i < item.value.length - 1) {
189189
<span class="margin-right">,</span>
@@ -251,7 +251,7 @@
251251
@for (ie of item.data; track $index) {
252252
<div class="authorship-item">
253253
@for (author of ie.author; let i = $index; track $index) {
254-
<a [href]="`${CONTENT_DETAIL}/${author.dbId}`"
254+
<a [routerLink]="`${CONTENT_DETAIL}/${author.dbId}`"
255255
[ngClass]="{'margin-right': !author.orcidId}">
256256
{{ author.firstname }} {{ author.surname }}
257257
</a>

projects/website-angular/src/app/search/search-bar/search-bar.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@if (!advancedMode) {
1+
@if (currentMode === 'simple' || currentMode === 'reference') {
22
<form class="search-bar-container" (submit)="onSubmit($event)">
33
<input
44
type="text"
@@ -47,7 +47,7 @@
4747
}
4848
</ul>
4949
</div>
50-
} @if (advancedMode) {
50+
} @if (currentMode === 'advanced') {
5151
<button class="syntax-help-toggle" (click)="syntaxHelpOpen = !syntaxHelpOpen">
5252
<span class="material-symbols-rounded">help_outline</span>
5353
Syntax Help

projects/website-angular/src/app/search/search-bar/search-bar.component.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class SearchBarComponent implements OnChanges {
2828
private router = inject(Router);
2929
private searchService = inject(SearchService);
3030
@Input() query: string = '';
31-
@Input() advancedMode = false;
31+
@Input() currentMode: 'advanced' | 'reference' | 'simple' = 'simple';
3232
@Input() filters = false;
3333
@Output() queryChange = new EventEmitter<string>();
3434

@@ -72,7 +72,8 @@ export class SearchBarComponent implements OnChanges {
7272

7373
const params: Record<string, string | string[] | null> = {
7474
q: q,
75-
advanced: this.advancedMode ? 'true' : null,
75+
advanced: this.currentMode === 'advanced' ? 'true' : null,
76+
reference: this.currentMode === 'reference' ? 'true' : null,
7677
page: null,
7778
};
7879

@@ -114,7 +115,8 @@ export class SearchBarComponent implements OnChanges {
114115

115116
const params: Record<string, string | string[] | null> = {
116117
q: s,
117-
advanced: this.advancedMode ? 'true' : null,
118+
advanced: this.currentMode === 'advanced' ? 'true' : null,
119+
reference: this.currentMode === 'reference' ? 'true' : null,
118120
page: null,
119121
};
120122

0 commit comments

Comments
 (0)