diff --git a/service/src/main/inse/company_connections/search_client.py b/service/src/main/inse/company_connections/search_client.py
index 80934c96..4516f4f7 100644
--- a/service/src/main/inse/company_connections/search_client.py
+++ b/service/src/main/inse/company_connections/search_client.py
@@ -22,14 +22,13 @@ class CompanyConnectionsSearchClient:
self.base_url = (
base_url
or config.settings.elasticsearch_url
- or config.settings.openalex_works_search_base_url
+ or ""
).rstrip("/")
self.api_key = (
api_key
if api_key is not None
else config.settings.elasticsearch_api_key
- or config.settings.openalex_works_api_key
- )
+)
self.openalex_index = openalex_index
self.handelsregister_index = handelsregister_index
self.timeout = timeout
diff --git a/service/src/main/inse/config.py b/service/src/main/inse/config.py
index a5ab3a47..cdb123a1 100644
--- a/service/src/main/inse/config.py
+++ b/service/src/main/inse/config.py
@@ -26,22 +26,18 @@ class Settings(BaseSettings):
auth_disabled: bool = False
auth_standalone: bool = True
auth_secret: str = "change-me-to-a-secure-secret-key"
- # OpenAlex works search config
- openalex_works_search_base_url: str = "https://project.nes.uni-due.de/elastic"
# IMPORTANT: wildcard * needed to query all work indices
openalex_works_search_index: str = "openalex-works*"
- openalex_works_api_key: str = (
- "am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ=="
- )
openalex_works_search_timeout_seconds: float = 30.0
# OpenAlex public API config
openalex_api_base_url: str = "https://api.openalex.org"
openalex_api_key: Optional[str] = None
openalex_api_timeout_seconds: float = 30.0
- # Patent elasticsearch config
+
+ # Patent Elasticsearch config
patent_elasticsearch_url: str = "https://inse.nes.uni-due.de/elastic"
- patent_elasticsearch_api_key: str = ""
+ patent_elasticsearch_api_key: Optional[str] = None
# LLM config
@@ -52,8 +48,8 @@ class Settings(BaseSettings):
# Sentence Transformers config
sentence_transformers_model_name: str = "paraphrase-multilingual-mpnet-base-v2"
- # elasticsearch config
- elasticsearch_url: Optional[str] = None
+ # Elasticsearch config
+ elasticsearch_url: str = "https://project.nes.uni-due.de/elastic"
elasticsearch_api_key: Optional[str] = None
elasticsearch_inse_url: Optional[str] = None
elasticsearch_inse_api_key: Optional[str] = None
@@ -66,9 +62,6 @@ class Settings(BaseSettings):
{"url": "http://localhost:8000", "description": "Local development server"},
]
- elasticsearch_inse_url: Optional[str] = None
- elasticsearch_inse_api_key: Optional[str] = None
-
logging_level: str = "DEBUG"
diff --git a/service/src/main/inse/funders/elastic_search_client.py b/service/src/main/inse/funders/elastic_search_client.py
index 126fa319..a411cb0a 100644
--- a/service/src/main/inse/funders/elastic_search_client.py
+++ b/service/src/main/inse/funders/elastic_search_client.py
@@ -23,9 +23,9 @@ class FundedPublicationsSearchClient:
timeout: float | None = None,
transport: httpx.AsyncBaseTransport | None = None,
):
- self.base_url = (base_url or config.settings.openalex_works_search_base_url).rstrip("/")
+ self.base_url = (base_url or config.settings.elasticsearch_url or "").rstrip("/")
self.index = index or config.settings.openalex_works_search_index
- self.api_key = api_key if api_key is not None else config.settings.openalex_works_api_key
+ self.api_key = api_key if api_key is not None else config.settings.elasticsearch_api_key
self.timeout = timeout if timeout is not None else config.settings.openalex_works_search_timeout_seconds
self.transport = transport
diff --git a/service/src/main/inse/works/search_client.py b/service/src/main/inse/works/search_client.py
index 36b1b3bb..fe60c665 100644
--- a/service/src/main/inse/works/search_client.py
+++ b/service/src/main/inse/works/search_client.py
@@ -26,12 +26,13 @@ class OpenAlexWorksSearchClient:
timeout: float | None = None,
transport: httpx.AsyncBaseTransport | None = None,
):
- self.base_url = (base_url or config.settings.openalex_works_search_base_url).rstrip("/")
+ self.base_url = (base_url or config.settings.elasticsearch_url or "").rstrip("/")
self.index = index or config.settings.openalex_works_search_index
- self.api_key = api_key if api_key is not None else config.settings.openalex_works_api_key
+ self.api_key = api_key if api_key is not None else config.settings.elasticsearch_api_key
self.timeout = timeout if timeout is not None else config.settings.openalex_works_search_timeout_seconds
self.transport = transport
+
def author_works_query(
self,
author_id: str,
diff --git a/webapp/src/app/modules/institutions/institutions.component.html b/webapp/src/app/modules/institutions/institutions.component.html
index 4702d7fe..ce12b7ed 100644
--- a/webapp/src/app/modules/institutions/institutions.component.html
+++ b/webapp/src/app/modules/institutions/institutions.component.html
@@ -4,34 +4,19 @@
-
- Suche nach Namen
-
- search
-
-
+
-
+
-
+
@@ -106,11 +91,7 @@
-
-
+
diff --git a/webapp/src/app/modules/institutions/institutions.component.scss b/webapp/src/app/modules/institutions/institutions.component.scss
index 95ff7534..47a6389e 100644
--- a/webapp/src/app/modules/institutions/institutions.component.scss
+++ b/webapp/src/app/modules/institutions/institutions.component.scss
@@ -41,10 +41,6 @@
}
}
-mat-paginator {
- background-color: var(--sg-background);
-}
-
.card {
padding: 0.5rem;
background-color: var(--sg-background);
diff --git a/webapp/src/app/modules/institutions/institutions.component.ts b/webapp/src/app/modules/institutions/institutions.component.ts
index e2449349..18eea25f 100644
--- a/webapp/src/app/modules/institutions/institutions.component.ts
+++ b/webapp/src/app/modules/institutions/institutions.component.ts
@@ -1,26 +1,28 @@
-import { Component, effect, input, signal } from '@angular/core';
+import { Component, input } from '@angular/core';
import { Institution, InstitutionPage } from '../../api';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
-import { MatInputModule } from '@angular/material/input';
-import { ActivatedRoute, Router, RouterModule } from '@angular/router';
-import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
+import { RouterModule } from '@angular/router';
import { MatIconModule } from '@angular/material/icon';
-import { DebounceDirective } from '../../directives/debounce.directive';
-import { MatPaginator, PageEvent } from '@angular/material/paginator';
import { MatDividerModule } from '@angular/material/divider';
+import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component';
+import {
+ QueryParamSelectorComponent,
+ SelectorOption,
+} from '../../shared/ui/query-param-selector/query-param-selector.component';
+import { QueryParamInputComponent } from '../../shared/ui/query-param-input/query-param-input.component';
@Component({
selector: 'app-institutions',
imports: [
MatButtonModule,
MatCardModule,
- MatInputModule,
MatIconModule,
- DebounceDirective,
- MatPaginator,
MatDividerModule,
RouterModule,
+ QueryParamPaginatorComponent,
+ QueryParamSelectorComponent,
+ QueryParamInputComponent,
],
templateUrl: './institutions.component.html',
styleUrl: './institutions.component.scss',
@@ -28,74 +30,21 @@ import { MatDividerModule } from '@angular/material/divider';
export class InstitutionsComponent {
institutionPage = input.required();
- urlSearchTerm = signal('');
- urlSortBy = signal('relevance');
- urlSortingOrder = signal('desc');
-
- constructor(
- private readonly activatedRoute: ActivatedRoute,
- private readonly router: Router,
- ) {
- this.activatedRoute.queryParams
- .pipe(takeUntilDestroyed())
- .subscribe((params) => {
- this.urlSearchTerm.set(params['search'] || '');
- this.urlSortBy.set(params['sort_by'] || 'relevance');
- this.urlSortingOrder.set(params['sorting_order'] || 'desc');
- });
-
- effect(() => {
- const searchTerm = this.urlSearchTerm();
- this.router.navigate([], {
- queryParams: { search: searchTerm },
- queryParamsHandling: 'merge',
- });
- });
- }
-
- handleSearchTermChange(newTerm: string): void {
- this.router.navigate([], {
- queryParams: { search: newTerm },
- queryParamsHandling: 'merge',
- });
- }
-
- clearSearchTerm(): void {
- this.router.navigate([], {
- queryParams: { search: null },
- queryParamsHandling: 'merge',
- });
- }
-
- handlePageChange(event: PageEvent): void {
- this.router.navigate([], {
- queryParams: { page: event.pageIndex, size: event.pageSize },
- queryParamsHandling: 'merge',
- });
- }
+ sortingOptions: SelectorOption[] = [
+ { value: 'relevance', display_name: 'Relevanz' },
+ { value: 'name', display_name: 'Name' },
+ { value: 'works_count', display_name: 'Anzahl Publikationen' },
+ { value: 'citations_count', display_name: 'Anzahl Zitationen' },
+ ];
+ sortingDirectionOptions: SelectorOption[] = [
+ { value: 'asc', display_name: 'Aufsteigend' },
+ { value: 'desc', display_name: 'Absteigend' },
+ ];
extractInstitutionId(institution: Institution): string {
return institution.id?.split('/').pop() ?? '';
}
- handleSortFieldChange(event: Event): void {
- const selectElement = event.target as HTMLSelectElement;
- const sortField = selectElement.value;
- this.router.navigate([], {
- queryParams: { sort_by: sortField },
- queryParamsHandling: 'merge',
- });
- }
-
- handleSortOrderChange(event: Event): void {
- const selectElement = event.target as HTMLSelectElement;
- const sortOrder = selectElement.value;
- this.router.navigate([], {
- queryParams: { sorting_order: sortOrder },
- queryParamsHandling: 'merge',
- });
- }
-
getDisplayName(institution: Institution): string {
const primary = institution.display_name?.trim();
if (primary && primary.length > 0) return primary;
diff --git a/webapp/src/app/modules/projects/projects.component.html b/webapp/src/app/modules/projects/projects.component.html
index 8d2a3884..0ae1e25c 100644
--- a/webapp/src/app/modules/projects/projects.component.html
+++ b/webapp/src/app/modules/projects/projects.component.html
@@ -4,19 +4,11 @@
-
- Suche nach Namen
-
- search
-
-
+
+
-
+
-
+
@@ -102,11 +91,7 @@
-
-
+
diff --git a/webapp/src/app/modules/projects/projects.component.ts b/webapp/src/app/modules/projects/projects.component.ts
index 4fc6f46d..effdc3f4 100644
--- a/webapp/src/app/modules/projects/projects.component.ts
+++ b/webapp/src/app/modules/projects/projects.component.ts
@@ -1,33 +1,34 @@
-import { Component, effect, input, signal } from '@angular/core';
+import { Component, input, signal } from '@angular/core';
import { FundingProject, FundingProjectPage, ProjectType } from '../../api';
import { MatDividerModule } from '@angular/material/divider';
-import { MatFormFieldModule } from '@angular/material/form-field';
-import { DebounceDirective } from '../../directives/debounce.directive';
import { MatIconModule } from '@angular/material/icon';
import { MatCardModule } from '@angular/material/card';
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
-import { MatPaginator, PageEvent } from '@angular/material/paginator';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
-import { MatInputModule } from '@angular/material/input';
import { MatButtonModule } from '@angular/material/button';
import { DatePipe, UpperCasePipe } from '@angular/common';
import { MatChipListboxChange, MatChipsModule } from '@angular/material/chips';
+import { QueryParamInputComponent } from '../../shared/ui/query-param-input/query-param-input.component';
+import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component';
+import {
+ QueryParamSelectorComponent,
+ SelectorOption,
+} from '../../shared/ui/query-param-selector/query-param-selector.component';
@Component({
selector: 'app-projects',
imports: [
MatDividerModule,
- MatFormFieldModule,
- DebounceDirective,
MatIconModule,
MatCardModule,
RouterModule,
- MatPaginator,
- MatInputModule,
MatButtonModule,
UpperCasePipe,
DatePipe,
MatChipsModule,
+ QueryParamInputComponent,
+ QueryParamPaginatorComponent,
+ QueryParamSelectorComponent,
],
templateUrl: './projects.component.html',
styleUrl: './projects.component.scss',
@@ -35,11 +36,14 @@ import { MatChipListboxChange, MatChipsModule } from '@angular/material/chips';
export class ProjectsComponent {
fundingProjectPage = input.required();
- urlSearchTerm = signal('');
- urlSortBy = signal('relevance');
- urlSortingOrder = signal('desc');
urlChips = signal(['eu', 'bund', 'dfg']);
+ sortingOptions: SelectorOption[] = [{ value: 'title', display_name: 'Name' }];
+ sortingDirectionOptions: SelectorOption[] = [
+ { value: 'asc', display_name: 'Aufsteigend' },
+ { value: 'desc', display_name: 'Absteigend' },
+ ];
+
constructor(
private readonly activatedRoute: ActivatedRoute,
private readonly router: Router,
@@ -47,60 +51,10 @@ export class ProjectsComponent {
this.activatedRoute.queryParams
.pipe(takeUntilDestroyed())
.subscribe((params) => {
- this.urlSearchTerm.set(params['search'] || '');
- this.urlSortBy.set(params['sort_by'] || 'relevance');
- this.urlSortingOrder.set(params['sorting_order'] || 'desc');
this.urlChips.set(
(params['selected_project_types'] || 'eu,bund,dfg').split(','),
);
});
-
- effect(() => {
- const searchTerm = this.urlSearchTerm();
- this.router.navigate([], {
- queryParams: { search: searchTerm },
- queryParamsHandling: 'merge',
- });
- });
- }
-
- handleSearchTermChange(newTerm: string): void {
- this.router.navigate([], {
- queryParams: { search: newTerm, page: 0, size: 10 },
- queryParamsHandling: 'merge',
- });
- }
-
- clearSearchTerm(): void {
- this.router.navigate([], {
- queryParams: { search: null },
- queryParamsHandling: 'merge',
- });
- }
-
- handlePageChange(event: PageEvent): void {
- this.router.navigate([], {
- queryParams: { page: event.pageIndex, size: event.pageSize },
- queryParamsHandling: 'merge',
- });
- }
-
- handleSortFieldChange(event: Event): void {
- const selectElement = event.target as HTMLSelectElement;
- const sortField = selectElement.value;
- this.router.navigate([], {
- queryParams: { sort_by: sortField },
- queryParamsHandling: 'merge',
- });
- }
-
- handleSortOrderChange(event: Event): void {
- const selectElement = event.target as HTMLSelectElement;
- const sortOrder = selectElement.value;
- this.router.navigate([], {
- queryParams: { sorting_order: sortOrder },
- queryParamsHandling: 'merge',
- });
}
handleChipBoxChange(change: MatChipListboxChange): void {
diff --git a/webapp/src/app/shared/ui/query-param-input/query-param-input.component.html b/webapp/src/app/shared/ui/query-param-input/query-param-input.component.html
new file mode 100644
index 00000000..8ce973c0
--- /dev/null
+++ b/webapp/src/app/shared/ui/query-param-input/query-param-input.component.html
@@ -0,0 +1,13 @@
+
+ {{ this.label() }}
+
+ search
+
+
diff --git a/webapp/src/app/shared/ui/query-param-input/query-param-input.component.scss b/webapp/src/app/shared/ui/query-param-input/query-param-input.component.scss
new file mode 100644
index 00000000..e69de29b
diff --git a/webapp/src/app/shared/ui/query-param-input/query-param-input.component.ts b/webapp/src/app/shared/ui/query-param-input/query-param-input.component.ts
new file mode 100644
index 00000000..85d396f1
--- /dev/null
+++ b/webapp/src/app/shared/ui/query-param-input/query-param-input.component.ts
@@ -0,0 +1,63 @@
+import { Component, computed, inject, input, output } from '@angular/core';
+import { MatFormFieldModule } from '@angular/material/form-field';
+import { DebounceDirective } from '../../../directives/debounce.directive';
+import { MatInputModule } from '@angular/material/input';
+import { MatButtonModule } from '@angular/material/button';
+import { MatIconModule } from '@angular/material/icon';
+import { ActivatedRoute, Router } from '@angular/router';
+import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
+import { FormsModule } from '@angular/forms';
+
+@Component({
+ selector: 'app-query-param-input',
+ imports: [
+ FormsModule,
+ MatInputModule,
+ MatButtonModule,
+ MatIconModule,
+ MatFormFieldModule,
+ DebounceDirective,
+ ],
+ templateUrl: './query-param-input.component.html',
+ styleUrl: './query-param-input.component.scss',
+})
+export class QueryParamInputComponent {
+ queryParamKey = input.required();
+ queryParamPageKey = input('page');
+ label = input('Suchen');
+ debounceTime = input(300);
+ handleValueChange = output();
+
+ private readonly activatedRouter = inject(ActivatedRoute);
+ private readonly router = inject(Router);
+
+ private readonly queryParams = toSignal(
+ this.activatedRouter.queryParams.pipe(takeUntilDestroyed()),
+ );
+
+ _urlValue = computed(() => {
+ const params = this.queryParams();
+ const key = this.queryParamKey();
+
+ return params && key ? params[key] || '' : '';
+ });
+
+ clearInput(): void {
+ this.router.navigate([], {
+ queryParams: { [this.queryParamKey()]: null },
+ queryParamsHandling: 'merge',
+ });
+ }
+
+ _handleValueChange(newValue: string): void {
+ this.handleValueChange?.emit(newValue);
+
+ this.router.navigate([], {
+ queryParams: {
+ [this.queryParamKey()]: newValue || null,
+ [this.queryParamPageKey()]: 0,
+ },
+ queryParamsHandling: 'merge',
+ });
+ }
+}
diff --git a/webapp/src/app/shared/ui/query-param-paginator/query-param-paginator.component.html b/webapp/src/app/shared/ui/query-param-paginator/query-param-paginator.component.html
new file mode 100644
index 00000000..ea5f4947
--- /dev/null
+++ b/webapp/src/app/shared/ui/query-param-paginator/query-param-paginator.component.html
@@ -0,0 +1,6 @@
+
diff --git a/webapp/src/app/shared/ui/query-param-paginator/query-param-paginator.component.scss b/webapp/src/app/shared/ui/query-param-paginator/query-param-paginator.component.scss
new file mode 100644
index 00000000..bb582c94
--- /dev/null
+++ b/webapp/src/app/shared/ui/query-param-paginator/query-param-paginator.component.scss
@@ -0,0 +1,3 @@
+mat-paginator {
+ background-color: var(--sg-background);
+}
diff --git a/webapp/src/app/shared/ui/query-param-paginator/query-param-paginator.component.ts b/webapp/src/app/shared/ui/query-param-paginator/query-param-paginator.component.ts
new file mode 100644
index 00000000..63a0bd8f
--- /dev/null
+++ b/webapp/src/app/shared/ui/query-param-paginator/query-param-paginator.component.ts
@@ -0,0 +1,52 @@
+import { Component, computed, inject, input, output } from '@angular/core';
+import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
+import { MatPaginatorModule, PageEvent } from '@angular/material/paginator';
+import { ActivatedRoute, Router } from '@angular/router';
+
+@Component({
+ selector: 'app-query-param-paginator',
+ imports: [MatPaginatorModule],
+ templateUrl: './query-param-paginator.component.html',
+ styleUrl: './query-param-paginator.component.scss',
+})
+export class QueryParamPaginatorComponent {
+ queryParamPageKey = input('page');
+ queryParamSizeKey = input('size');
+ pageSizeOptions = input([10, 25, 50]);
+
+ total = input.required();
+
+ handlePageChange = output();
+
+ private readonly activatedRoute = inject(ActivatedRoute);
+ private readonly router = inject(Router);
+
+ private readonly queryParams = toSignal(
+ this.activatedRoute.queryParams.pipe(takeUntilDestroyed()),
+ );
+
+ _urlPage = computed(() => {
+ const params = this.queryParams();
+ const key = this.queryParamPageKey();
+
+ return params && key ? +params[key] || 0 : 0;
+ });
+
+ _urlSize = computed(() => {
+ const params = this.queryParams();
+ const key = this.queryParamSizeKey();
+
+ return params && key ? +params[key] || 10 : 10;
+ });
+
+ _handlePageChange(event: PageEvent): void {
+ this.handlePageChange?.emit(event);
+ this.router.navigate([], {
+ queryParams: {
+ [this.queryParamPageKey()]: event.pageIndex || null,
+ [this.queryParamSizeKey()]: event.pageSize || null,
+ },
+ queryParamsHandling: 'merge',
+ });
+ }
+}
diff --git a/webapp/src/app/shared/ui/query-param-selector/query-param-selector.component.html b/webapp/src/app/shared/ui/query-param-selector/query-param-selector.component.html
new file mode 100644
index 00000000..0f6dcd9b
--- /dev/null
+++ b/webapp/src/app/shared/ui/query-param-selector/query-param-selector.component.html
@@ -0,0 +1,5 @@
+
diff --git a/webapp/src/app/shared/ui/query-param-selector/query-param-selector.component.scss b/webapp/src/app/shared/ui/query-param-selector/query-param-selector.component.scss
new file mode 100644
index 00000000..d1990896
--- /dev/null
+++ b/webapp/src/app/shared/ui/query-param-selector/query-param-selector.component.scss
@@ -0,0 +1,10 @@
+select {
+ padding: 0.75rem;
+ border: 1px solid var(--sg-border);
+ border-radius: var(--sg-radius-sm);
+ font-size: 1rem;
+}
+
+select:hover {
+ cursor: pointer;
+}
diff --git a/webapp/src/app/shared/ui/query-param-selector/query-param-selector.component.ts b/webapp/src/app/shared/ui/query-param-selector/query-param-selector.component.ts
new file mode 100644
index 00000000..caa3f7bf
--- /dev/null
+++ b/webapp/src/app/shared/ui/query-param-selector/query-param-selector.component.ts
@@ -0,0 +1,46 @@
+import { Component, computed, inject, input, output } from '@angular/core';
+import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
+import { FormsModule } from '@angular/forms';
+import { ActivatedRoute, Router } from '@angular/router';
+
+export type SelectorOption = {
+ value: string;
+ display_name: string;
+};
+
+@Component({
+ selector: 'app-query-param-selector',
+ imports: [FormsModule],
+ templateUrl: './query-param-selector.component.html',
+ styleUrl: './query-param-selector.component.scss',
+})
+export class QueryParamSelectorComponent {
+ options = input.required();
+ queryParamKey = input.required();
+ handleSelectionChange = output();
+
+ private readonly activatedRoute = inject(ActivatedRoute);
+ private readonly router = inject(Router);
+
+ private readonly queryParams = toSignal(
+ this.activatedRoute.queryParams.pipe(takeUntilDestroyed()),
+ );
+
+ _urlValue = computed(() => {
+ const params = this.queryParams();
+ const key = this.queryParamKey();
+
+ return params && key ? params[key] || '' : '';
+ });
+
+ _handleSelectionChange(event: Event): void {
+ const newValue = (event.target as HTMLSelectElement).value;
+
+ this.router.navigate([], {
+ queryParams: { [this.queryParamKey()]: newValue },
+ queryParamsHandling: 'merge',
+ });
+
+ this.handleSelectionChange.emit(event);
+ }
+}