diff --git a/service/src/main/inse/main.py b/service/src/main/inse/main.py index 41d776c2..96f6e5a8 100644 --- a/service/src/main/inse/main.py +++ b/service/src/main/inse/main.py @@ -12,6 +12,7 @@ from fastapi.responses import RedirectResponse from fastapi.middleware.cors import CORSMiddleware from inse.collaboration_network.router import router as collaboration_network_router from inse.works.service import router as works_service_router +from inse.search.service import router as search_router from . import config from .service import router as service_router @@ -32,6 +33,7 @@ app = FastAPI( ) app.include_router(collaboration_network_router) app.include_router(works_service_router) +app.include_router(search_router) app.include_router(service_router) app.include_router(account_router) diff --git a/service/src/main/inse/search/__init__.py b/service/src/main/inse/search/__init__.py new file mode 100644 index 00000000..40a96afc --- /dev/null +++ b/service/src/main/inse/search/__init__.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- diff --git a/service/src/main/inse/search/logic.py b/service/src/main/inse/search/logic.py new file mode 100644 index 00000000..e5931bfd --- /dev/null +++ b/service/src/main/inse/search/logic.py @@ -0,0 +1,153 @@ +# -*- coding: utf-8 -*- +import logging +import hashlib +from typing import List, Optional +from fastapi import HTTPException + +from inse import util +from inse.logic import es_client +from inse.models.author import Author +from inse.models.meta import Meta +from inse.search.model import CustomAuthor, CustomAuthorsListResponse + +logger = logging.getLogger(__name__) + +def _enrich_author_data(author_data) -> Optional[CustomAuthor]: + if not author_data: + return None + if not isinstance(author_data, dict): + if hasattr(author_data, 'model_dump'): + author_data = author_data.model_dump() + elif hasattr(author_data, 'to_dict'): + author_data = author_data.to_dict() + else: + return None + author_id = author_data.get("id", "") or "" + + h = int(hashlib.md5(author_id.encode('utf-8')).hexdigest(), 16) + + + # Experimental suitability rating + suitability_score = h % 100 + if suitability_score < 15: + relevance_rating = "Sehr geeignet" + elif suitability_score < 50: + relevance_rating = "Geeignet" + else: + relevance_rating = "Möglich" + + # Resilient sanitization of IDs to protect against model type conflicts (Generated) + ids = author_data.get("ids") + if isinstance(ids, dict): + ids_copy = dict(ids) + for str_field in ["openalex", "orcid", "scopus"]: + val = ids_copy.get(str_field) + if val is not None and not isinstance(val, str): + ids_copy[str_field] = str(val) + author_data["ids"] = ids_copy + + base_author = Author.from_dict(author_data) + if not base_author: + return None + + author = CustomAuthor( + **base_author.model_dump(), + relevance_rating=relevance_rating, + ) + return author + +def advanced_search_persons( + query: Optional[str] = None, + institution_name: Optional[str] = None, + topics: Optional[List[str]] = None, + page: int = 1, + page_size: int = 10, + include: Optional[set[str]] = None, +) -> CustomAuthorsListResponse: + must_clauses = [] + filter_clauses = [] + + if query: + must_clauses.append({ + "bool": { + "should": [ + {"match_phrase": {"display_name": {"query": query, "boost": 5}}}, + {"match_phrase_prefix": {"display_name": {"query": query, "boost": 3}}}, + {"match": {"display_name": {"query": query, "fuzziness": 1}}}, + ], + "minimum_should_match": 1 + } + }) + + if institution_name: + filter_clauses.append({ + "nested": { + "path": "affiliations", + "query": { + "match_phrase": { + "affiliations.institution.display_name": institution_name + } + } + } + }) + + if topics: + for t in topics: + if t: + filter_clauses.append({ + "nested": { + "path": "topics", + "query": { + "match_phrase": { + "topics.display_name": t + } + } + } + }) + + query_body = {"bool": {}} + if must_clauses: + query_body["bool"]["must"] = must_clauses + if filter_clauses: + query_body["bool"]["filter"] = filter_clauses + if not must_clauses and not filter_clauses: + query_body["bool"]["must"] = [{"match_all": {}}] + + es_size = page_size + es_from = (page - 1) * page_size + + sort_option = [{"cited_by_count": {"order": "desc"}}, {"works_count": {"order": "desc"}}] + + try: + response = es_client.search( + index="openalex-authors", + query=query_body, + source=list(include) if include else True, + from_=es_from, + size=es_size, + sort=sort_option if not query else None, + ) + except Exception as e: + logger.error(f"Elasticsearch search failed: {str(e)}") + raise HTTPException( + status_code=500, detail=f"Elasticsearch search failed: {str(e)}" + ) + + hits = response.get("hits", {}).get("hits", []) + total_count = response.get("hits", {}).get("total", {}).get("value", 0) + + results = [] + for hit in hits: + raw_data = util.get_persons_data(hit) + custom_author = _enrich_author_data(raw_data) + if custom_author: + results.append(custom_author) + + return CustomAuthorsListResponse( + results=results, + meta=Meta( + count=total_count, + page=page, + per_page=page_size + ) + ) diff --git a/service/src/main/inse/search/model.py b/service/src/main/inse/search/model.py new file mode 100644 index 00000000..6d04a644 --- /dev/null +++ b/service/src/main/inse/search/model.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +from pydantic import BaseModel, Field +from typing import List, Optional +from inse.models.author import Author +from inse.models.meta import Meta +from inse.models.group_by_result import GroupByResult + +class CustomAuthor(Author): + relevance_rating: Optional[str] = Field(default=None, description="The relevance suitability rating.") + +class CustomAuthorsListResponse(BaseModel): + meta: Optional[Meta] = None + results: Optional[List[CustomAuthor]] = None + group_by: Optional[List[GroupByResult]] = None diff --git a/service/src/main/inse/search/service.py b/service/src/main/inse/search/service.py new file mode 100644 index 00000000..0cc6f2fa --- /dev/null +++ b/service/src/main/inse/search/service.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- +import logging +from typing import Annotated, List, Optional +from fastapi import APIRouter, Query, Depends + +from inse import database +from inse.search import model as search_model +from inse.search import logic + +logger = logging.getLogger(__name__) + +router = APIRouter( + prefix="/api/inse-service", + tags=["Persons Search"], + responses={404: {"description": "Not found"}}, +) + +@router.get( + "/persons/search-list", + operation_id="searchPersonsList", + response_model=search_model.CustomAuthorsListResponse, + summary="Searches for persons with advanced filters (Topic & Institution) and pagination.", + response_model_exclude_none=True, + tags=["Persons"], +) +def search_persons_list( + query: Annotated[ + Optional[str], Query(description="Search query (e.g., Arman AND Arzani)") + ] = None, + institution_name: Annotated[ + Optional[str], Query(alias="institutionName", description="Filter by institution name") + ] = None, + topic: Annotated[ + Optional[List[str]], Query(description="Filter by topic display names") + ] = None, + page: Annotated[ + int, Query(description="Page number (1-indexed)", ge=1) + ] = 1, + page_size: Annotated[ + int, Query(alias="pageSize", description="Results per page", ge=1, le=100) + ] = 10, + include: Annotated[ + Optional[str], + Query( + description="Comma-separated include tags", + example="topics_full,topic_share", + ), + ] = None, +): + include_set = ( + {tag.strip().lower() for tag in include.split(",") if tag.strip()} + if include + else None + ) + return logic.advanced_search_persons( + query=query, + institution_name=institution_name, + topics=topic, + page=page, + page_size=page_size, + include=include_set, + ) diff --git a/service/src/main/inse/service.py b/service/src/main/inse/service.py index 76f59946..0366996c 100644 --- a/service/src/main/inse/service.py +++ b/service/src/main/inse/service.py @@ -226,10 +226,10 @@ def count_topic_hierarchy( ) def search_persons( author_id: Annotated[ - str, Query(description="OpenAlex author ID (e.g., A5093075883)") + Optional[str], Query(description="OpenAlex author ID (e.g., A5093075883)") ] = None, query: Annotated[ - str, Query(description="Search query (e.g., Arman AND Arzani)") + Optional[str], Query(description="Search query (e.g., Arman AND Arzani)") ] = None, include: Annotated[ Optional[str], diff --git a/webapp/openapitools.json b/webapp/openapitools.json index 061602d3..7af6e36f 100644 --- a/webapp/openapitools.json +++ b/webapp/openapitools.json @@ -11,7 +11,7 @@ "additionalProperties": { "ngVersion": "21.2.14", "providedInRoot": true, - "serviceSuffix": "OpenApiService", + "serviceSuffix": "Service", "withInterfaces": true, "enumPropertyNaming": "original", "fileNaming": "kebab-case" diff --git a/webapp/src/app/api/.openapi-generator/FILES b/webapp/src/app/api/.openapi-generator/FILES index 0da98db0..87266ecf 100644 --- a/webapp/src/app/api/.openapi-generator/FILES +++ b/webapp/src/app/api/.openapi-generator/FILES @@ -4,78 +4,91 @@ README.md api.base.service.ts api.module.ts api/api.ts -api/iNSEAccountService.service.ts -api/iNSEService.service.ts +api/inse-account-service.service.ts +api/inse-account-service.serviceInterface.ts +api/inse-service.service.ts +api/inse-service.serviceInterface.ts api/items.service.ts -api/personNetwork.service.ts +api/items.serviceInterface.ts +api/person-network.service.ts +api/person-network.serviceInterface.ts +api/persons-search.service.ts +api/persons-search.serviceInterface.ts api/persons.service.ts +api/persons.serviceInterface.ts api/topics.service.ts +api/topics.serviceInterface.ts api/works.service.ts +api/works.serviceInterface.ts configuration.ts encoder.ts git_push.sh index.ts -model/accessGrant.ts -model/authAccount.ts -model/authScope.ts +model/access-grant.ts +model/auth-account.ts +model/auth-scope.ts +model/author-affiliations-inner.ts +model/author-counts-by-year-inner.ts +model/author-ids.ts +model/author-parsed-longest-name.ts +model/author-summary-stats.ts model/author.ts -model/authorAffiliationsInner.ts -model/authorCountsByYearInner.ts -model/authorIds.ts -model/authorParsedLongestName.ts -model/authorSummaryStats.ts -model/authorsListResponse.ts +model/authors-list-response.ts model/authorship.ts model/award.ts -model/collaborationNetwork.ts -model/collaborationNetworkEdge.ts -model/collaborationNetworkNode.ts -model/collaborationNetworkNodeType.ts -model/costUsd.ts -model/dehydratedAuthor.ts -model/dehydratedFunder.ts -model/dehydratedInstitution.ts -model/dehydratedSource.ts -model/filterInformation.ts -model/filterProperties.ts +model/collaboration-network-edge.ts +model/collaboration-network-node-type.ts +model/collaboration-network-node.ts +model/collaboration-network.ts +model/cost-usd.ts +model/custom-author.ts +model/custom-authors-list-response.ts +model/dehydrated-author.ts +model/dehydrated-funder.ts +model/dehydrated-institution.ts +model/dehydrated-source.ts +model/filter-information.ts +model/filter-properties.ts model/fwci.ts -model/groupByResult.ts -model/hTTPValidationError.ts -model/identityGrant.ts -model/institutionInformation.ts +model/group-by-result.ts +model/http-validation-error.ts +model/identity-grant.ts +model/institution-information.ts +model/item-create.ts +model/item-page.ts model/item.ts -model/itemCreate.ts -model/itemPage.ts model/location.ts model/meta.ts -model/model2YrMeanCitedness.ts +model/model2-yr-mean-citedness.ts model/models.ts -model/openAccess.ts -model/personBio.ts +model/open-access.ts +model/person-bio.ts model/score.ts +model/validation-error-loc-inner.ts +model/validation-error.ts model/topicCount.ts model/topicsByTime.ts model/topicsByYear.ts model/validationError.ts model/validationErrorLocInner.ts model/value.ts +model/work-biblio.ts +model/work-citation-normalized-percentile.ts +model/work-cited-by-percentile-year.ts +model/work-counts-by-year-inner.ts +model/work-has-content.ts +model/work-ids.ts +model/work-keyword.ts +model/work-mesh-inner.ts +model/work-page.ts +model/work-sustainable-development-goals-inner.ts +model/work-topic-domain.ts +model/work-topic-field.ts +model/work-topic-information.ts +model/work-topic-subfield.ts +model/work-topic.ts model/work.ts -model/workBiblio.ts -model/workCitationNormalizedPercentile.ts -model/workCitedByPercentileYear.ts -model/workCountsByYearInner.ts -model/workHasContent.ts -model/workIds.ts -model/workKeyword.ts -model/workMeshInner.ts -model/workPage.ts -model/workSustainableDevelopmentGoalsInner.ts -model/workTopic.ts -model/workTopicDomain.ts -model/workTopicField.ts -model/workTopicInformation.ts -model/workTopicSubfield.ts -model/worksListResponse.ts +model/works-list-response.ts param.ts provide-api.ts variables.ts diff --git a/webapp/src/app/api/api/api.ts b/webapp/src/app/api/api/api.ts index d9409cee..18f669bf 100644 --- a/webapp/src/app/api/api/api.ts +++ b/webapp/src/app/api/api/api.ts @@ -1,15 +1,25 @@ -export * from './iNSEAccountService.service'; -import { INSEAccountServiceService } from './iNSEAccountService.service'; -export * from './iNSEService.service'; -import { INSEServiceService } from './iNSEService.service'; +export * from './inse-account-service.service'; +import { INSEAccountServiceService } from './inse-account-service.service'; +export * from './inse-account-service.serviceInterface'; +export * from './inse-service.service'; +import { INSEServiceService } from './inse-service.service'; +export * from './inse-service.serviceInterface'; export * from './items.service'; import { ItemsService } from './items.service'; -export * from './personNetwork.service'; -import { PersonNetworkService } from './personNetwork.service'; +export * from './items.serviceInterface'; +export * from './person-network.service'; +import { PersonNetworkService } from './person-network.service'; +export * from './person-network.serviceInterface'; export * from './persons.service'; import { PersonsService } from './persons.service'; +export * from './persons.serviceInterface'; +export * from './persons-search.service'; +import { PersonsSearchService } from './persons-search.service'; +export * from './persons-search.serviceInterface'; export * from './topics.service'; import { TopicsService } from './topics.service'; +export * from './topics.serviceInterface'; export * from './works.service'; import { WorksService } from './works.service'; -export const APIS = [INSEAccountServiceService, INSEServiceService, ItemsService, PersonNetworkService, PersonsService, TopicsService, WorksService]; +export * from './works.serviceInterface'; +export const APIS = [INSEAccountServiceService, INSEServiceService, ItemsService, PersonNetworkService, PersonsService, PersonsSearchService, TopicsService, WorksService]; diff --git a/webapp/src/app/api/api/iNSEAccountService.service.ts b/webapp/src/app/api/api/inse-account-service.service.ts similarity index 96% rename from webapp/src/app/api/api/iNSEAccountService.service.ts rename to webapp/src/app/api/api/inse-account-service.service.ts index 7b43eaa5..ef79eace 100644 --- a/webapp/src/app/api/api/iNSEAccountService.service.ts +++ b/webapp/src/app/api/api/inse-account-service.service.ts @@ -17,23 +17,26 @@ import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; // @ts-ignore -import { AccessGrant } from '../model/accessGrant'; +import { AccessGrant } from '../model/access-grant'; // @ts-ignore -import { HTTPValidationError } from '../model/hTTPValidationError'; +import { HTTPValidationError } from '../model/http-validation-error'; // @ts-ignore -import { IdentityGrant } from '../model/identityGrant'; +import { IdentityGrant } from '../model/identity-grant'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; +import { + INSEAccountServiceServiceInterface +} from './inse-account-service.serviceInterface'; @Injectable({ providedIn: 'root' }) -export class INSEAccountServiceService extends BaseService { +export class INSEAccountServiceService extends BaseService implements INSEAccountServiceServiceInterface { constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { super(basePath, configuration); diff --git a/webapp/src/app/api/api/inse-account-service.serviceInterface.ts b/webapp/src/app/api/api/inse-account-service.serviceInterface.ts new file mode 100644 index 00000000..2cb6b360 --- /dev/null +++ b/webapp/src/app/api/api/inse-account-service.serviceInterface.ts @@ -0,0 +1,46 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { HttpHeaders } from '@angular/common/http'; + +import { Observable } from 'rxjs'; + +import { AccessGrant } from '../model/models'; +import { HTTPValidationError } from '../model/models'; +import { IdentityGrant } from '../model/models'; + + +import { Configuration } from '../configuration'; + + + +export interface INSEAccountServiceServiceInterface { + defaultHeaders: HttpHeaders; + configuration: Configuration; + + /** + * Get Access Grant + * + * @endpoint post /inse-account/auth/access + * @param secret + * @param account + * @param organization + */ + getAccessGrantInseAccountAuthAccessPost(secret: string, account: number, organization: number, extraHttpRequestParams?: any): Observable; + + /** + * Get Identity Grant + * + * @endpoint post /inse-account/auth/id + * @param username + * @param password + */ + getIdentityGrantInseAccountAuthIdPost(username: string, password: string, extraHttpRequestParams?: any): Observable; + +} diff --git a/webapp/src/app/api/api/iNSEService.service.ts b/webapp/src/app/api/api/inse-service.service.ts similarity index 98% rename from webapp/src/app/api/api/iNSEService.service.ts rename to webapp/src/app/api/api/inse-service.service.ts index 0fa2f5f0..80543705 100644 --- a/webapp/src/app/api/api/iNSEService.service.ts +++ b/webapp/src/app/api/api/inse-service.service.ts @@ -17,29 +17,32 @@ import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; // @ts-ignore -import { AuthorsListResponse } from '../model/authorsListResponse'; +import { AuthorsListResponse } from '../model/authors-list-response'; // @ts-ignore -import { HTTPValidationError } from '../model/hTTPValidationError'; +import { HTTPValidationError } from '../model/http-validation-error'; // @ts-ignore import { Item } from '../model/item'; // @ts-ignore -import { ItemCreate } from '../model/itemCreate'; +import { ItemCreate } from '../model/item-create'; // @ts-ignore -import { ItemPage } from '../model/itemPage'; +import { ItemPage } from '../model/item-page'; // @ts-ignore -import { PersonBio } from '../model/personBio'; +import { PersonBio } from '../model/person-bio'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; +import { + INSEServiceServiceInterface +} from './inse-service.serviceInterface'; @Injectable({ providedIn: 'root' }) -export class INSEServiceService extends BaseService { +export class INSEServiceService extends BaseService implements INSEServiceServiceInterface { constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { super(basePath, configuration); diff --git a/webapp/src/app/api/api/inse-service.serviceInterface.ts b/webapp/src/app/api/api/inse-service.serviceInterface.ts new file mode 100644 index 00000000..1326e650 --- /dev/null +++ b/webapp/src/app/api/api/inse-service.serviceInterface.ts @@ -0,0 +1,135 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { HttpHeaders } from '@angular/common/http'; + +import { Observable } from 'rxjs'; + +import { AuthorsListResponse } from '../model/models'; +import { HTTPValidationError } from '../model/models'; +import { Item } from '../model/models'; +import { ItemCreate } from '../model/models'; +import { ItemPage } from '../model/models'; +import { PersonBio } from '../model/models'; + + +import { Configuration } from '../configuration'; + + + +export interface INSEServiceServiceInterface { + defaultHeaders: HttpHeaders; + configuration: Configuration; + + /** + * Adds a new item. + * + * @endpoint post /api/inse-service/items + * @param itemCreate + */ + addItem(itemCreate: ItemCreate, extraHttpRequestParams?: any): Observable; + + /** + * Builds the topic hierarchy cache. + * + * @endpoint get /api/inse-service/topics/cache + * @param pageSize Page size for each search page. + * @param saveJson Persist cache JSON to data folder. + */ + buildTopicCache(pageSize?: number, saveJson?: boolean, extraHttpRequestParams?: any): Observable; + + /** + * Counts topic hierarchy occurrences from cache. + * + * @endpoint get /api/inse-service/topics/count + * @param topic Topic names (repeat parameter). + */ + countTopicHierarchy(topic: Array, extraHttpRequestParams?: any): Observable; + + /** + * Deletes the item with the id. + * + * @endpoint delete /api/inse-service/items/{id} + * @param id The item id. + */ + deleteItem(id: number, extraHttpRequestParams?: any): Observable; + + /** + * Generates a bio for a person by author ID. + * + * @endpoint get /api/inse-service/persons/bio + * @param authorId OpenAlex author ID (e.g., A5093075883) + * @param include Comma-separated list to include tags + */ + generatePersonBio(authorId: string, include?: string, extraHttpRequestParams?: any): Observable; + + /** + * Returns the item with the id. + * + * @endpoint get /api/inse-service/items/{id} + * @param id The item id. + */ + getItem(id: number, extraHttpRequestParams?: any): Observable; + + /** + * Returns a page of items. + * + * @endpoint get /api/inse-service/items + * @param pageOffset The page offset. + * @param pageSize The page size. + */ + getItems(pageOffset?: number, pageSize?: number, extraHttpRequestParams?: any): Observable; + + /** + * Searches for person by ID. + * + * @endpoint get /api/inse-service/person/{id} + * @param id OpenAlex author ID + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + */ + getPersonByID(id: string, include: string, extraHttpRequestParams?: any): Observable; + + /** + * Searches for persons by ID or name. + * + * @endpoint get /api/inse-service/persons/search + * @param authorId OpenAlex author ID (e.g., A5093075883) + * @param query Search query (e.g., Arman AND Arzani) + * @param include Comma-separated include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, sources, counts_by_year, works_api_url, dates, cited_by_count_boost + */ + searchPersons(authorId?: string, query?: string, include?: string, extraHttpRequestParams?: any): Observable; + + /** + * Searches for persons by institution name. + * + * @endpoint get /api/inse-service/persons/searchByInstitution + * @param institutionName Institution name (e.g., MIT, Oxford University) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + */ + searchPersonsByInstitution(institutionName: string, include: string, extraHttpRequestParams?: any): Observable; + + /** + * Searches for person by name. + * + * @endpoint get /api/inse-service/persons/searchByName + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + */ + searchPersonsByName(authorName: string, include: string, extraHttpRequestParams?: any): Observable; + + /** + * Updates the item with the id. + * + * @endpoint put /api/inse-service/items/{id} + * @param id The item id. + * @param itemCreate + */ + updateItem(id: number, itemCreate: ItemCreate, extraHttpRequestParams?: any): Observable; + +} diff --git a/webapp/src/app/api/api/items.service.ts b/webapp/src/app/api/api/items.service.ts index 69cd8e54..1d00c8c8 100644 --- a/webapp/src/app/api/api/items.service.ts +++ b/webapp/src/app/api/api/items.service.ts @@ -17,25 +17,28 @@ import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; // @ts-ignore -import { HTTPValidationError } from '../model/hTTPValidationError'; +import { HTTPValidationError } from '../model/http-validation-error'; // @ts-ignore import { Item } from '../model/item'; // @ts-ignore -import { ItemCreate } from '../model/itemCreate'; +import { ItemCreate } from '../model/item-create'; // @ts-ignore -import { ItemPage } from '../model/itemPage'; +import { ItemPage } from '../model/item-page'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; +import { + ItemsServiceInterface +} from './items.serviceInterface'; @Injectable({ providedIn: 'root' }) -export class ItemsService extends BaseService { +export class ItemsService extends BaseService implements ItemsServiceInterface { constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { super(basePath, configuration); diff --git a/webapp/src/app/api/api/items.serviceInterface.ts b/webapp/src/app/api/api/items.serviceInterface.ts new file mode 100644 index 00000000..140cbec0 --- /dev/null +++ b/webapp/src/app/api/api/items.serviceInterface.ts @@ -0,0 +1,70 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { HttpHeaders } from '@angular/common/http'; + +import { Observable } from 'rxjs'; + +import { HTTPValidationError } from '../model/models'; +import { Item } from '../model/models'; +import { ItemCreate } from '../model/models'; +import { ItemPage } from '../model/models'; + + +import { Configuration } from '../configuration'; + + + +export interface ItemsServiceInterface { + defaultHeaders: HttpHeaders; + configuration: Configuration; + + /** + * Adds a new item. + * + * @endpoint post /api/inse-service/items + * @param itemCreate + */ + addItem(itemCreate: ItemCreate, extraHttpRequestParams?: any): Observable; + + /** + * Deletes the item with the id. + * + * @endpoint delete /api/inse-service/items/{id} + * @param id The item id. + */ + deleteItem(id: number, extraHttpRequestParams?: any): Observable; + + /** + * Returns the item with the id. + * + * @endpoint get /api/inse-service/items/{id} + * @param id The item id. + */ + getItem(id: number, extraHttpRequestParams?: any): Observable; + + /** + * Returns a page of items. + * + * @endpoint get /api/inse-service/items + * @param pageOffset The page offset. + * @param pageSize The page size. + */ + getItems(pageOffset?: number, pageSize?: number, extraHttpRequestParams?: any): Observable; + + /** + * Updates the item with the id. + * + * @endpoint put /api/inse-service/items/{id} + * @param id The item id. + * @param itemCreate + */ + updateItem(id: number, itemCreate: ItemCreate, extraHttpRequestParams?: any): Observable; + +} diff --git a/webapp/src/app/api/api/personNetwork.service.ts b/webapp/src/app/api/api/person-network.service.ts similarity index 93% rename from webapp/src/app/api/api/personNetwork.service.ts rename to webapp/src/app/api/api/person-network.service.ts index b1183ff6..135a20d8 100644 --- a/webapp/src/app/api/api/personNetwork.service.ts +++ b/webapp/src/app/api/api/person-network.service.ts @@ -17,23 +17,26 @@ import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; // @ts-ignore -import { CollaborationNetwork } from '../model/collaborationNetwork'; +import { CollaborationNetwork } from '../model/collaboration-network'; // @ts-ignore -import { FilterProperties } from '../model/filterProperties'; +import { FilterProperties } from '../model/filter-properties'; // @ts-ignore -import { HTTPValidationError } from '../model/hTTPValidationError'; +import { HTTPValidationError } from '../model/http-validation-error'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; +import { + PersonNetworkServiceInterface +} from './person-network.serviceInterface'; @Injectable({ providedIn: 'root' }) -export class PersonNetworkService extends BaseService { +export class PersonNetworkService extends BaseService implements PersonNetworkServiceInterface { constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { super(basePath, configuration); diff --git a/webapp/src/app/api/api/person-network.serviceInterface.ts b/webapp/src/app/api/api/person-network.serviceInterface.ts new file mode 100644 index 00000000..58e7a1fb --- /dev/null +++ b/webapp/src/app/api/api/person-network.serviceInterface.ts @@ -0,0 +1,36 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { HttpHeaders } from '@angular/common/http'; + +import { Observable } from 'rxjs'; + +import { CollaborationNetwork } from '../model/models'; +import { FilterProperties } from '../model/models'; +import { HTTPValidationError } from '../model/models'; + + +import { Configuration } from '../configuration'; + + + +export interface PersonNetworkServiceInterface { + defaultHeaders: HttpHeaders; + configuration: Configuration; + + /** + * Get a person\'s collaboration network. + * Returns a person\'s collaboration network based on their works and co-authors. + * @endpoint post /api/person/network/{raw_user_id} + * @param rawUserId The raw user ID of the person. + * @param filterProperties + */ + getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, extraHttpRequestParams?: any): Observable; + +} diff --git a/webapp/src/app/api/api/persons-search.service.ts b/webapp/src/app/api/api/persons-search.service.ts new file mode 100644 index 00000000..a67323f8 --- /dev/null +++ b/webapp/src/app/api/api/persons-search.service.ts @@ -0,0 +1,119 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { CustomAuthorsListResponse } from '../model/custom-authors-list-response'; +// @ts-ignore +import { HTTPValidationError } from '../model/http-validation-error'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; +import { + PersonsSearchServiceInterface +} from './persons-search.serviceInterface'; + + + +@Injectable({ + providedIn: 'root' +}) +export class PersonsSearchService extends BaseService implements PersonsSearchServiceInterface { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * Searches for persons with advanced filters (Topic & Institution) and pagination. + * @endpoint get /api/inse-service/persons/search-list + * @param query Search query (e.g., Arman AND Arzani) + * @param institutionName Filter by institution name + * @param topic Filter by topic display names + * @param page Page number (1-indexed) + * @param pageSize Results per page + * @param include Comma-separated include tags + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + institutionName, 'institutionName'); + if (topic) { + topic.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'topic'); + }) + } + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'pageSize'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/search-list`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/webapp/src/app/api/api/persons-search.serviceInterface.ts b/webapp/src/app/api/api/persons-search.serviceInterface.ts new file mode 100644 index 00000000..6a747cfd --- /dev/null +++ b/webapp/src/app/api/api/persons-search.serviceInterface.ts @@ -0,0 +1,39 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { HttpHeaders } from '@angular/common/http'; + +import { Observable } from 'rxjs'; + +import { CustomAuthorsListResponse } from '../model/models'; +import { HTTPValidationError } from '../model/models'; + + +import { Configuration } from '../configuration'; + + + +export interface PersonsSearchServiceInterface { + defaultHeaders: HttpHeaders; + configuration: Configuration; + + /** + * Searches for persons with advanced filters (Topic & Institution) and pagination. + * + * @endpoint get /api/inse-service/persons/search-list + * @param query Search query (e.g., Arman AND Arzani) + * @param institutionName Filter by institution name + * @param topic Filter by topic display names + * @param page Page number (1-indexed) + * @param pageSize Results per page + * @param include Comma-separated include tags + */ + searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, extraHttpRequestParams?: any): Observable; + +} diff --git a/webapp/src/app/api/api/persons.service.ts b/webapp/src/app/api/api/persons.service.ts index 4df09d02..979d86da 100644 --- a/webapp/src/app/api/api/persons.service.ts +++ b/webapp/src/app/api/api/persons.service.ts @@ -17,23 +17,28 @@ import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; // @ts-ignore -import { AuthorsListResponse } from '../model/authorsListResponse'; +import { AuthorsListResponse } from '../model/authors-list-response'; // @ts-ignore -import { HTTPValidationError } from '../model/hTTPValidationError'; +import { CustomAuthorsListResponse } from '../model/custom-authors-list-response'; // @ts-ignore -import { PersonBio } from '../model/personBio'; +import { HTTPValidationError } from '../model/http-validation-error'; +// @ts-ignore +import { PersonBio } from '../model/person-bio'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; +import { + PersonsServiceInterface +} from './persons.serviceInterface'; @Injectable({ providedIn: 'root' }) -export class PersonsService extends BaseService { +export class PersonsService extends BaseService implements PersonsServiceInterface { constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { super(basePath, configuration); @@ -361,4 +366,80 @@ export class PersonsService extends BaseService { ); } + /** + * Searches for persons with advanced filters (Topic & Institution) and pagination. + * @endpoint get /api/inse-service/persons/search-list + * @param query Search query (e.g., Arman AND Arzani) + * @param institutionName Filter by institution name + * @param topic Filter by topic display names + * @param page Page number (1-indexed) + * @param pageSize Results per page + * @param include Comma-separated include tags + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + institutionName, 'institutionName'); + if (topic) { + topic.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'topic'); + }) + } + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'pageSize'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/search-list`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + } diff --git a/webapp/src/app/api/api/persons.serviceInterface.ts b/webapp/src/app/api/api/persons.serviceInterface.ts new file mode 100644 index 00000000..e7235d9c --- /dev/null +++ b/webapp/src/app/api/api/persons.serviceInterface.ts @@ -0,0 +1,87 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { HttpHeaders } from '@angular/common/http'; + +import { Observable } from 'rxjs'; + +import { AuthorsListResponse } from '../model/models'; +import { CustomAuthorsListResponse } from '../model/models'; +import { HTTPValidationError } from '../model/models'; +import { PersonBio } from '../model/models'; + + +import { Configuration } from '../configuration'; + + + +export interface PersonsServiceInterface { + defaultHeaders: HttpHeaders; + configuration: Configuration; + + /** + * Generates a bio for a person by author ID. + * + * @endpoint get /api/inse-service/persons/bio + * @param authorId OpenAlex author ID (e.g., A5093075883) + * @param include Comma-separated list to include tags + */ + generatePersonBio(authorId: string, include?: string, extraHttpRequestParams?: any): Observable; + + /** + * Searches for person by ID. + * + * @endpoint get /api/inse-service/person/{id} + * @param id OpenAlex author ID + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + */ + getPersonByID(id: string, include: string, extraHttpRequestParams?: any): Observable; + + /** + * Searches for persons by ID or name. + * + * @endpoint get /api/inse-service/persons/search + * @param authorId OpenAlex author ID (e.g., A5093075883) + * @param query Search query (e.g., Arman AND Arzani) + * @param include Comma-separated include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, sources, counts_by_year, works_api_url, dates, cited_by_count_boost + */ + searchPersons(authorId?: string, query?: string, include?: string, extraHttpRequestParams?: any): Observable; + + /** + * Searches for persons by institution name. + * + * @endpoint get /api/inse-service/persons/searchByInstitution + * @param institutionName Institution name (e.g., MIT, Oxford University) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + */ + searchPersonsByInstitution(institutionName: string, include: string, extraHttpRequestParams?: any): Observable; + + /** + * Searches for person by name. + * + * @endpoint get /api/inse-service/persons/searchByName + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + */ + searchPersonsByName(authorName: string, include: string, extraHttpRequestParams?: any): Observable; + + /** + * Searches for persons with advanced filters (Topic & Institution) and pagination. + * + * @endpoint get /api/inse-service/persons/search-list + * @param query Search query (e.g., Arman AND Arzani) + * @param institutionName Filter by institution name + * @param topic Filter by topic display names + * @param page Page number (1-indexed) + * @param pageSize Results per page + * @param include Comma-separated include tags + */ + searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, extraHttpRequestParams?: any): Observable; + +} diff --git a/webapp/src/app/api/api/topics.service.ts b/webapp/src/app/api/api/topics.service.ts index 68afe965..193a1b1f 100644 --- a/webapp/src/app/api/api/topics.service.ts +++ b/webapp/src/app/api/api/topics.service.ts @@ -17,19 +17,22 @@ import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; // @ts-ignore -import { HTTPValidationError } from '../model/hTTPValidationError'; +import { HTTPValidationError } from '../model/http-validation-error'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; +import { + TopicsServiceInterface +} from './topics.serviceInterface'; @Injectable({ providedIn: 'root' }) -export class TopicsService extends BaseService { +export class TopicsService extends BaseService implements TopicsServiceInterface { constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { super(basePath, configuration); diff --git a/webapp/src/app/api/api/topics.serviceInterface.ts b/webapp/src/app/api/api/topics.serviceInterface.ts new file mode 100644 index 00000000..6a60f441 --- /dev/null +++ b/webapp/src/app/api/api/topics.serviceInterface.ts @@ -0,0 +1,42 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { HttpHeaders } from '@angular/common/http'; + +import { Observable } from 'rxjs'; + +import { HTTPValidationError } from '../model/models'; + + +import { Configuration } from '../configuration'; + + + +export interface TopicsServiceInterface { + defaultHeaders: HttpHeaders; + configuration: Configuration; + + /** + * Builds the topic hierarchy cache. + * + * @endpoint get /api/inse-service/topics/cache + * @param pageSize Page size for each search page. + * @param saveJson Persist cache JSON to data folder. + */ + buildTopicCache(pageSize?: number, saveJson?: boolean, extraHttpRequestParams?: any): Observable; + + /** + * Counts topic hierarchy occurrences from cache. + * + * @endpoint get /api/inse-service/topics/count + * @param topic Topic names (repeat parameter). + */ + countTopicHierarchy(topic: Array, extraHttpRequestParams?: any): Observable; + +} diff --git a/webapp/src/app/api/api/works.service.ts b/webapp/src/app/api/api/works.service.ts index 6b6dd9fa..2a156323 100644 --- a/webapp/src/app/api/api/works.service.ts +++ b/webapp/src/app/api/api/works.service.ts @@ -9,35 +9,39 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore -import { HTTPValidationError } from '../model/hTTPValidationError'; +import { HTTPValidationError } from '../model/http-validation-error'; // @ts-ignore import { TopicsByTime } from '../model/topicsByTime'; // @ts-ignore import { WorkPage } from '../model/workPage'; // @ts-ignore -import { WorksListResponse } from '../model/worksListResponse'; +import { WorksListResponse } from '../model/works-list-response'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; +import { + WorksServiceInterface +} from './works.serviceInterface'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) -export class WorksService extends BaseService { +export class WorksService extends BaseService implements WorksServiceInterface { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) { super(basePath, configuration); } @@ -48,10 +52,10 @@ export class WorksService extends BaseService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getAllAuthorWorks(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getAllAuthorWorks(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAllAuthorWorks(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAllAuthorWorks(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getAllAuthorWorks(authorId: string, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable; + public getAllAuthorWorks(authorId: string, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable>; + public getAllAuthorWorks(authorId: string, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable>; + public getAllAuthorWorks(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable { if (authorId === null || authorId === undefined) { throw new Error('Required parameter authorId was null or undefined when calling getAllAuthorWorks.'); } @@ -84,7 +88,7 @@ export class WorksService extends BaseService { } } - let localVarPath = `/api/works/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/all`; + let localVarPath = `/api/works/${this.configuration.encodeParam({ name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/all`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { @@ -111,35 +115,35 @@ export class WorksService extends BaseService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable; + public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable>; + public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable>; + public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable { if (authorId === null || authorId === undefined) { throw new Error('Required parameter authorId was null or undefined when calling getAuthorWorks.'); } - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); + page, 'page'); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - size, 'size'); + size, 'size'); if (publicationYear) { publicationYear.forEach((element) => { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'publication_year'); + element, 'publication_year'); }) } if (type) { type.forEach((element) => { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'type'); + element, 'type'); }) } if (language) { language.forEach((element) => { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'language'); + element, 'language'); }) } @@ -171,7 +175,7 @@ export class WorksService extends BaseService { } } - let localVarPath = `/api/works/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + let localVarPath = `/api/works/${this.configuration.encodeParam({ name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { @@ -195,17 +199,17 @@ export class WorksService extends BaseService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable; + public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable>; + public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable>; + public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable { if (authorId === null || authorId === undefined) { throw new Error('Required parameter authorId was null or undefined when calling getTopicsByTimeByAuthor.'); } - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - maxTopicsPerYear, 'max_topics_per_year'); + maxTopicsPerYear, 'max_topics_per_year'); let localVarHeaders = this.defaultHeaders; @@ -235,7 +239,7 @@ export class WorksService extends BaseService { } } - let localVarPath = `/api/works/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/topics-by-time`; + let localVarPath = `/api/works/${this.configuration.encodeParam({ name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/topics-by-time`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { diff --git a/webapp/src/app/api/api/works.serviceInterface.ts b/webapp/src/app/api/api/works.serviceInterface.ts new file mode 100644 index 00000000..887bb9c3 --- /dev/null +++ b/webapp/src/app/api/api/works.serviceInterface.ts @@ -0,0 +1,48 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { HttpHeaders } from '@angular/common/http'; + +import { Observable } from 'rxjs'; + +import { HTTPValidationError } from '../model/models'; +import { WorkPage } from '../model/models'; +import { WorksListResponse } from '../model/models'; + + +import { Configuration } from '../configuration'; + + + +export interface WorksServiceInterface { + defaultHeaders: HttpHeaders; + configuration: Configuration; + + /** + * Returns all works for an author. + * + * @endpoint get /api/works/{author_id}/all + * @param authorId The author id, for example A5023888391. + */ + getAllAuthorWorks(authorId: string, extraHttpRequestParams?: any): Observable; + + /** + * Returns a page of works for an author. + * + * @endpoint get /api/works/{author_id} + * @param authorId The author id, for example A5023888391. + * @param page The page number. + * @param size The page size. + * @param publicationYear Filter by publication year. Can be repeated. + * @param type Filter by publication type. Can be repeated. + * @param language Filter by language code. Can be repeated. + */ + getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, extraHttpRequestParams?: any): Observable; + +} diff --git a/webapp/src/app/api/model/accessGrant.ts b/webapp/src/app/api/model/access-grant.ts similarity index 89% rename from webapp/src/app/api/model/accessGrant.ts rename to webapp/src/app/api/model/access-grant.ts index ad1f537a..9de129ac 100644 --- a/webapp/src/app/api/model/accessGrant.ts +++ b/webapp/src/app/api/model/access-grant.ts @@ -7,7 +7,7 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { AuthScope } from './authScope'; +import { AuthScope } from './auth-scope'; export interface AccessGrant { diff --git a/webapp/src/app/api/model/authAccount.ts b/webapp/src/app/api/model/auth-account.ts similarity index 100% rename from webapp/src/app/api/model/authAccount.ts rename to webapp/src/app/api/model/auth-account.ts diff --git a/webapp/src/app/api/model/authScope.ts b/webapp/src/app/api/model/auth-scope.ts similarity index 87% rename from webapp/src/app/api/model/authScope.ts rename to webapp/src/app/api/model/auth-scope.ts index 65ffa9b5..0d9d325d 100644 --- a/webapp/src/app/api/model/authScope.ts +++ b/webapp/src/app/api/model/auth-scope.ts @@ -7,7 +7,7 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { AuthAccount } from './authAccount'; +import { AuthAccount } from './auth-account'; export interface AuthScope { diff --git a/webapp/src/app/api/model/authorAffiliationsInner.ts b/webapp/src/app/api/model/author-affiliations-inner.ts similarity index 85% rename from webapp/src/app/api/model/authorAffiliationsInner.ts rename to webapp/src/app/api/model/author-affiliations-inner.ts index 270443ff..7d3ee92b 100644 --- a/webapp/src/app/api/model/authorAffiliationsInner.ts +++ b/webapp/src/app/api/model/author-affiliations-inner.ts @@ -7,7 +7,7 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { DehydratedInstitution } from './dehydratedInstitution'; +import { DehydratedInstitution } from './dehydrated-institution'; /** diff --git a/webapp/src/app/api/model/authorCountsByYearInner.ts b/webapp/src/app/api/model/author-counts-by-year-inner.ts similarity index 100% rename from webapp/src/app/api/model/authorCountsByYearInner.ts rename to webapp/src/app/api/model/author-counts-by-year-inner.ts diff --git a/webapp/src/app/api/model/authorIds.ts b/webapp/src/app/api/model/author-ids.ts similarity index 100% rename from webapp/src/app/api/model/authorIds.ts rename to webapp/src/app/api/model/author-ids.ts diff --git a/webapp/src/app/api/model/authorParsedLongestName.ts b/webapp/src/app/api/model/author-parsed-longest-name.ts similarity index 100% rename from webapp/src/app/api/model/authorParsedLongestName.ts rename to webapp/src/app/api/model/author-parsed-longest-name.ts diff --git a/webapp/src/app/api/model/authorSummaryStats.ts b/webapp/src/app/api/model/author-summary-stats.ts similarity index 85% rename from webapp/src/app/api/model/authorSummaryStats.ts rename to webapp/src/app/api/model/author-summary-stats.ts index 1cfc0bdb..9bdb23e8 100644 --- a/webapp/src/app/api/model/authorSummaryStats.ts +++ b/webapp/src/app/api/model/author-summary-stats.ts @@ -7,7 +7,7 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { Model2YrMeanCitedness } from './model2YrMeanCitedness'; +import { Model2YrMeanCitedness } from './model2-yr-mean-citedness'; /** diff --git a/webapp/src/app/api/model/author.ts b/webapp/src/app/api/model/author.ts index 9ba12273..8d91fe5d 100644 --- a/webapp/src/app/api/model/author.ts +++ b/webapp/src/app/api/model/author.ts @@ -7,13 +7,13 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { AuthorAffiliationsInner } from './authorAffiliationsInner'; -import { AuthorParsedLongestName } from './authorParsedLongestName'; -import { DehydratedInstitution } from './dehydratedInstitution'; -import { AuthorCountsByYearInner } from './authorCountsByYearInner'; -import { AuthorIds } from './authorIds'; -import { AuthorSummaryStats } from './authorSummaryStats'; -import { WorkTopic } from './workTopic'; +import { AuthorAffiliationsInner } from './author-affiliations-inner'; +import { AuthorParsedLongestName } from './author-parsed-longest-name'; +import { DehydratedInstitution } from './dehydrated-institution'; +import { AuthorCountsByYearInner } from './author-counts-by-year-inner'; +import { AuthorIds } from './author-ids'; +import { AuthorSummaryStats } from './author-summary-stats'; +import { WorkTopic } from './work-topic'; /** diff --git a/webapp/src/app/api/model/authorsListResponse.ts b/webapp/src/app/api/model/authors-list-response.ts similarity index 89% rename from webapp/src/app/api/model/authorsListResponse.ts rename to webapp/src/app/api/model/authors-list-response.ts index d309ae43..37a9fc2c 100644 --- a/webapp/src/app/api/model/authorsListResponse.ts +++ b/webapp/src/app/api/model/authors-list-response.ts @@ -9,7 +9,7 @@ */ import { Meta } from './meta'; import { Author } from './author'; -import { GroupByResult } from './groupByResult'; +import { GroupByResult } from './group-by-result'; /** diff --git a/webapp/src/app/api/model/authorship.ts b/webapp/src/app/api/model/authorship.ts index db3a0bf0..cd95a07b 100644 --- a/webapp/src/app/api/model/authorship.ts +++ b/webapp/src/app/api/model/authorship.ts @@ -7,8 +7,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { DehydratedInstitution } from './dehydratedInstitution'; -import { DehydratedAuthor } from './dehydratedAuthor'; +import { DehydratedInstitution } from './dehydrated-institution'; +import { DehydratedAuthor } from './dehydrated-author'; /** diff --git a/webapp/src/app/api/model/collaborationNetworkEdge.ts b/webapp/src/app/api/model/collaboration-network-edge.ts similarity index 100% rename from webapp/src/app/api/model/collaborationNetworkEdge.ts rename to webapp/src/app/api/model/collaboration-network-edge.ts diff --git a/webapp/src/app/api/model/collaborationNetworkNodeType.ts b/webapp/src/app/api/model/collaboration-network-node-type.ts similarity index 84% rename from webapp/src/app/api/model/collaborationNetworkNodeType.ts rename to webapp/src/app/api/model/collaboration-network-node-type.ts index 752e35b0..1b3c0d84 100644 --- a/webapp/src/app/api/model/collaborationNetworkNodeType.ts +++ b/webapp/src/app/api/model/collaboration-network-node-type.ts @@ -10,9 +10,9 @@ export const CollaborationNetworkNodeType = { - Author: 'author', - Institution: 'institution', - Work: 'work' + author: 'author', + institution: 'institution', + work: 'work' } as const; export type CollaborationNetworkNodeType = typeof CollaborationNetworkNodeType[keyof typeof CollaborationNetworkNodeType]; diff --git a/webapp/src/app/api/model/collaborationNetworkNode.ts b/webapp/src/app/api/model/collaboration-network-node.ts similarity index 90% rename from webapp/src/app/api/model/collaborationNetworkNode.ts rename to webapp/src/app/api/model/collaboration-network-node.ts index d37a6831..3a4542d3 100644 --- a/webapp/src/app/api/model/collaborationNetworkNode.ts +++ b/webapp/src/app/api/model/collaboration-network-node.ts @@ -7,7 +7,7 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { CollaborationNetworkNodeType } from './collaborationNetworkNodeType'; +import { CollaborationNetworkNodeType } from './collaboration-network-node-type'; export interface CollaborationNetworkNode { diff --git a/webapp/src/app/api/model/collaborationNetwork.ts b/webapp/src/app/api/model/collaboration-network.ts similarity index 79% rename from webapp/src/app/api/model/collaborationNetwork.ts rename to webapp/src/app/api/model/collaboration-network.ts index 672858af..9956ae19 100644 --- a/webapp/src/app/api/model/collaborationNetwork.ts +++ b/webapp/src/app/api/model/collaboration-network.ts @@ -7,9 +7,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { FilterInformation } from './filterInformation'; -import { CollaborationNetworkEdge } from './collaborationNetworkEdge'; -import { CollaborationNetworkNode } from './collaborationNetworkNode'; +import { FilterInformation } from './filter-information'; +import { CollaborationNetworkEdge } from './collaboration-network-edge'; +import { CollaborationNetworkNode } from './collaboration-network-node'; export interface CollaborationNetwork { diff --git a/webapp/src/app/api/model/costUsd.ts b/webapp/src/app/api/model/cost-usd.ts similarity index 100% rename from webapp/src/app/api/model/costUsd.ts rename to webapp/src/app/api/model/cost-usd.ts diff --git a/webapp/src/app/api/model/custom-author.ts b/webapp/src/app/api/model/custom-author.ts new file mode 100644 index 00000000..07000ade --- /dev/null +++ b/webapp/src/app/api/model/custom-author.ts @@ -0,0 +1,39 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { AuthorAffiliationsInner } from './author-affiliations-inner'; +import { AuthorParsedLongestName } from './author-parsed-longest-name'; +import { DehydratedInstitution } from './dehydrated-institution'; +import { AuthorCountsByYearInner } from './author-counts-by-year-inner'; +import { AuthorIds } from './author-ids'; +import { AuthorSummaryStats } from './author-summary-stats'; +import { WorkTopic } from './work-topic'; + + +export interface CustomAuthor { + id?: string | null; + orcid?: string | null; + display_name?: string | null; + display_name_alternatives?: Array | null; + longest_name?: string | null; + parsed_longest_name?: AuthorParsedLongestName | null; + works_count?: number | null; + cited_by_count?: number | null; + summary_stats?: AuthorSummaryStats | null; + affiliations?: Array | null; + last_known_institutions?: Array | null; + topics?: Array | null; + counts_by_year?: Array | null; + ids?: AuthorIds | null; + works_api_url?: string | null; + created_date?: string | null; + updated_date?: string | null; + relevance_rating?: string | null; +} + diff --git a/webapp/src/app/api/model/custom-authors-list-response.ts b/webapp/src/app/api/model/custom-authors-list-response.ts new file mode 100644 index 00000000..45aeae54 --- /dev/null +++ b/webapp/src/app/api/model/custom-authors-list-response.ts @@ -0,0 +1,20 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Meta } from './meta'; +import { CustomAuthor } from './custom-author'; +import { GroupByResult } from './group-by-result'; + + +export interface CustomAuthorsListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; +} + diff --git a/webapp/src/app/api/model/dehydratedAuthor.ts b/webapp/src/app/api/model/dehydrated-author.ts similarity index 100% rename from webapp/src/app/api/model/dehydratedAuthor.ts rename to webapp/src/app/api/model/dehydrated-author.ts diff --git a/webapp/src/app/api/model/dehydratedFunder.ts b/webapp/src/app/api/model/dehydrated-funder.ts similarity index 100% rename from webapp/src/app/api/model/dehydratedFunder.ts rename to webapp/src/app/api/model/dehydrated-funder.ts diff --git a/webapp/src/app/api/model/dehydratedInstitution.ts b/webapp/src/app/api/model/dehydrated-institution.ts similarity index 100% rename from webapp/src/app/api/model/dehydratedInstitution.ts rename to webapp/src/app/api/model/dehydrated-institution.ts diff --git a/webapp/src/app/api/model/dehydratedSource.ts b/webapp/src/app/api/model/dehydrated-source.ts similarity index 100% rename from webapp/src/app/api/model/dehydratedSource.ts rename to webapp/src/app/api/model/dehydrated-source.ts diff --git a/webapp/src/app/api/model/filterInformation.ts b/webapp/src/app/api/model/filter-information.ts similarity index 85% rename from webapp/src/app/api/model/filterInformation.ts rename to webapp/src/app/api/model/filter-information.ts index b2078376..a8e9d5dd 100644 --- a/webapp/src/app/api/model/filterInformation.ts +++ b/webapp/src/app/api/model/filter-information.ts @@ -7,8 +7,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { InstitutionInformation } from './institutionInformation'; -import { WorkTopicInformation } from './workTopicInformation'; +import { InstitutionInformation } from './institution-information'; +import { WorkTopicInformation } from './work-topic-information'; export interface FilterInformation { diff --git a/webapp/src/app/api/model/filterProperties.ts b/webapp/src/app/api/model/filter-properties.ts similarity index 100% rename from webapp/src/app/api/model/filterProperties.ts rename to webapp/src/app/api/model/filter-properties.ts diff --git a/webapp/src/app/api/model/groupByResult.ts b/webapp/src/app/api/model/group-by-result.ts similarity index 100% rename from webapp/src/app/api/model/groupByResult.ts rename to webapp/src/app/api/model/group-by-result.ts diff --git a/webapp/src/app/api/model/hTTPValidationError.ts b/webapp/src/app/api/model/http-validation-error.ts similarity index 84% rename from webapp/src/app/api/model/hTTPValidationError.ts rename to webapp/src/app/api/model/http-validation-error.ts index f624be37..a82a8f71 100644 --- a/webapp/src/app/api/model/hTTPValidationError.ts +++ b/webapp/src/app/api/model/http-validation-error.ts @@ -7,7 +7,7 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { ValidationError } from './validationError'; +import { ValidationError } from './validation-error'; export interface HTTPValidationError { diff --git a/webapp/src/app/api/model/identityGrant.ts b/webapp/src/app/api/model/identity-grant.ts similarity index 89% rename from webapp/src/app/api/model/identityGrant.ts rename to webapp/src/app/api/model/identity-grant.ts index 9ec3fe50..fd48137c 100644 --- a/webapp/src/app/api/model/identityGrant.ts +++ b/webapp/src/app/api/model/identity-grant.ts @@ -7,7 +7,7 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { AuthScope } from './authScope'; +import { AuthScope } from './auth-scope'; export interface IdentityGrant { diff --git a/webapp/src/app/api/model/institutionInformation.ts b/webapp/src/app/api/model/institution-information.ts similarity index 100% rename from webapp/src/app/api/model/institutionInformation.ts rename to webapp/src/app/api/model/institution-information.ts diff --git a/webapp/src/app/api/model/itemCreate.ts b/webapp/src/app/api/model/item-create.ts similarity index 100% rename from webapp/src/app/api/model/itemCreate.ts rename to webapp/src/app/api/model/item-create.ts diff --git a/webapp/src/app/api/model/itemPage.ts b/webapp/src/app/api/model/item-page.ts similarity index 100% rename from webapp/src/app/api/model/itemPage.ts rename to webapp/src/app/api/model/item-page.ts diff --git a/webapp/src/app/api/model/location.ts b/webapp/src/app/api/model/location.ts index f207d751..ed2aa1e2 100644 --- a/webapp/src/app/api/model/location.ts +++ b/webapp/src/app/api/model/location.ts @@ -7,7 +7,7 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { DehydratedSource } from './dehydratedSource'; +import { DehydratedSource } from './dehydrated-source'; /** diff --git a/webapp/src/app/api/model/meta.ts b/webapp/src/app/api/model/meta.ts index 8481062a..cf47d6d3 100644 --- a/webapp/src/app/api/model/meta.ts +++ b/webapp/src/app/api/model/meta.ts @@ -7,7 +7,7 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { CostUsd } from './costUsd'; +import { CostUsd } from './cost-usd'; /** diff --git a/webapp/src/app/api/model/model2YrMeanCitedness.ts b/webapp/src/app/api/model/model2-yr-mean-citedness.ts similarity index 100% rename from webapp/src/app/api/model/model2YrMeanCitedness.ts rename to webapp/src/app/api/model/model2-yr-mean-citedness.ts diff --git a/webapp/src/app/api/model/models.ts b/webapp/src/app/api/model/models.ts index 859f206d..7010515c 100644 --- a/webapp/src/app/api/model/models.ts +++ b/webapp/src/app/api/model/models.ts @@ -1,60 +1,62 @@ -export * from './accessGrant'; -export * from './authAccount'; -export * from './authScope'; +export * from './access-grant'; +export * from './auth-account'; +export * from './auth-scope'; export * from './author'; -export * from './authorAffiliationsInner'; -export * from './authorCountsByYearInner'; -export * from './authorIds'; -export * from './authorParsedLongestName'; -export * from './authorSummaryStats'; -export * from './authorsListResponse'; +export * from './author-affiliations-inner'; +export * from './author-counts-by-year-inner'; +export * from './author-ids'; +export * from './author-parsed-longest-name'; +export * from './author-summary-stats'; +export * from './authors-list-response'; export * from './authorship'; export * from './award'; -export * from './collaborationNetwork'; -export * from './collaborationNetworkEdge'; -export * from './collaborationNetworkNode'; -export * from './collaborationNetworkNodeType'; -export * from './costUsd'; -export * from './dehydratedAuthor'; -export * from './dehydratedFunder'; -export * from './dehydratedInstitution'; -export * from './dehydratedSource'; -export * from './filterInformation'; -export * from './filterProperties'; +export * from './collaboration-network'; +export * from './collaboration-network-edge'; +export * from './collaboration-network-node'; +export * from './collaboration-network-node-type'; +export * from './cost-usd'; +export * from './custom-author'; +export * from './custom-authors-list-response'; +export * from './dehydrated-author'; +export * from './dehydrated-funder'; +export * from './dehydrated-institution'; +export * from './dehydrated-source'; +export * from './filter-information'; +export * from './filter-properties'; export * from './fwci'; -export * from './groupByResult'; -export * from './hTTPValidationError'; -export * from './identityGrant'; -export * from './institutionInformation'; +export * from './group-by-result'; +export * from './http-validation-error'; +export * from './identity-grant'; +export * from './institution-information'; export * from './item'; -export * from './itemCreate'; -export * from './itemPage'; +export * from './item-create'; +export * from './item-page'; export * from './location'; export * from './meta'; -export * from './model2YrMeanCitedness'; -export * from './openAccess'; -export * from './personBio'; +export * from './model2-yr-mean-citedness'; +export * from './open-access'; +export * from './person-bio'; export * from './score'; +export * from './validation-error'; +export * from './validation-error-loc-inner'; export * from './topicCount'; export * from './topicsByTime'; export * from './topicsByYear'; -export * from './validationError'; -export * from './validationErrorLocInner'; export * from './value'; export * from './work'; -export * from './workBiblio'; -export * from './workCitationNormalizedPercentile'; -export * from './workCitedByPercentileYear'; -export * from './workCountsByYearInner'; -export * from './workHasContent'; -export * from './workIds'; -export * from './workKeyword'; -export * from './workMeshInner'; -export * from './workPage'; -export * from './workSustainableDevelopmentGoalsInner'; -export * from './workTopic'; -export * from './workTopicDomain'; -export * from './workTopicField'; -export * from './workTopicInformation'; -export * from './workTopicSubfield'; -export * from './worksListResponse'; +export * from './work-biblio'; +export * from './work-citation-normalized-percentile'; +export * from './work-cited-by-percentile-year'; +export * from './work-counts-by-year-inner'; +export * from './work-has-content'; +export * from './work-ids'; +export * from './work-keyword'; +export * from './work-mesh-inner'; +export * from './work-page'; +export * from './work-sustainable-development-goals-inner'; +export * from './work-topic'; +export * from './work-topic-domain'; +export * from './work-topic-field'; +export * from './work-topic-information'; +export * from './work-topic-subfield'; +export * from './works-list-response'; diff --git a/webapp/src/app/api/model/openAccess.ts b/webapp/src/app/api/model/open-access.ts similarity index 100% rename from webapp/src/app/api/model/openAccess.ts rename to webapp/src/app/api/model/open-access.ts diff --git a/webapp/src/app/api/model/personBio.ts b/webapp/src/app/api/model/person-bio.ts similarity index 100% rename from webapp/src/app/api/model/personBio.ts rename to webapp/src/app/api/model/person-bio.ts diff --git a/webapp/src/app/api/model/validationErrorLocInner.ts b/webapp/src/app/api/model/validation-error-loc-inner.ts similarity index 100% rename from webapp/src/app/api/model/validationErrorLocInner.ts rename to webapp/src/app/api/model/validation-error-loc-inner.ts diff --git a/webapp/src/app/api/model/validationError.ts b/webapp/src/app/api/model/validation-error.ts similarity index 82% rename from webapp/src/app/api/model/validationError.ts rename to webapp/src/app/api/model/validation-error.ts index bdbd57ad..c71e7bfa 100644 --- a/webapp/src/app/api/model/validationError.ts +++ b/webapp/src/app/api/model/validation-error.ts @@ -7,7 +7,7 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { ValidationErrorLocInner } from './validationErrorLocInner'; +import { ValidationErrorLocInner } from './validation-error-loc-inner'; export interface ValidationError { diff --git a/webapp/src/app/api/model/workBiblio.ts b/webapp/src/app/api/model/work-biblio.ts similarity index 100% rename from webapp/src/app/api/model/workBiblio.ts rename to webapp/src/app/api/model/work-biblio.ts diff --git a/webapp/src/app/api/model/workCitationNormalizedPercentile.ts b/webapp/src/app/api/model/work-citation-normalized-percentile.ts similarity index 100% rename from webapp/src/app/api/model/workCitationNormalizedPercentile.ts rename to webapp/src/app/api/model/work-citation-normalized-percentile.ts diff --git a/webapp/src/app/api/model/workCitedByPercentileYear.ts b/webapp/src/app/api/model/work-cited-by-percentile-year.ts similarity index 100% rename from webapp/src/app/api/model/workCitedByPercentileYear.ts rename to webapp/src/app/api/model/work-cited-by-percentile-year.ts diff --git a/webapp/src/app/api/model/workCountsByYearInner.ts b/webapp/src/app/api/model/work-counts-by-year-inner.ts similarity index 100% rename from webapp/src/app/api/model/workCountsByYearInner.ts rename to webapp/src/app/api/model/work-counts-by-year-inner.ts diff --git a/webapp/src/app/api/model/workHasContent.ts b/webapp/src/app/api/model/work-has-content.ts similarity index 100% rename from webapp/src/app/api/model/workHasContent.ts rename to webapp/src/app/api/model/work-has-content.ts diff --git a/webapp/src/app/api/model/workIds.ts b/webapp/src/app/api/model/work-ids.ts similarity index 100% rename from webapp/src/app/api/model/workIds.ts rename to webapp/src/app/api/model/work-ids.ts diff --git a/webapp/src/app/api/model/workKeyword.ts b/webapp/src/app/api/model/work-keyword.ts similarity index 100% rename from webapp/src/app/api/model/workKeyword.ts rename to webapp/src/app/api/model/work-keyword.ts diff --git a/webapp/src/app/api/model/workMeshInner.ts b/webapp/src/app/api/model/work-mesh-inner.ts similarity index 100% rename from webapp/src/app/api/model/workMeshInner.ts rename to webapp/src/app/api/model/work-mesh-inner.ts diff --git a/webapp/src/app/api/model/workPage.ts b/webapp/src/app/api/model/work-page.ts similarity index 100% rename from webapp/src/app/api/model/workPage.ts rename to webapp/src/app/api/model/work-page.ts diff --git a/webapp/src/app/api/model/workSustainableDevelopmentGoalsInner.ts b/webapp/src/app/api/model/work-sustainable-development-goals-inner.ts similarity index 100% rename from webapp/src/app/api/model/workSustainableDevelopmentGoalsInner.ts rename to webapp/src/app/api/model/work-sustainable-development-goals-inner.ts diff --git a/webapp/src/app/api/model/workTopicDomain.ts b/webapp/src/app/api/model/work-topic-domain.ts similarity index 100% rename from webapp/src/app/api/model/workTopicDomain.ts rename to webapp/src/app/api/model/work-topic-domain.ts diff --git a/webapp/src/app/api/model/workTopicField.ts b/webapp/src/app/api/model/work-topic-field.ts similarity index 100% rename from webapp/src/app/api/model/workTopicField.ts rename to webapp/src/app/api/model/work-topic-field.ts diff --git a/webapp/src/app/api/model/workTopicInformation.ts b/webapp/src/app/api/model/work-topic-information.ts similarity index 100% rename from webapp/src/app/api/model/workTopicInformation.ts rename to webapp/src/app/api/model/work-topic-information.ts diff --git a/webapp/src/app/api/model/workTopicSubfield.ts b/webapp/src/app/api/model/work-topic-subfield.ts similarity index 100% rename from webapp/src/app/api/model/workTopicSubfield.ts rename to webapp/src/app/api/model/work-topic-subfield.ts diff --git a/webapp/src/app/api/model/workTopic.ts b/webapp/src/app/api/model/work-topic.ts similarity index 74% rename from webapp/src/app/api/model/workTopic.ts rename to webapp/src/app/api/model/work-topic.ts index 925ead4f..87f829f2 100644 --- a/webapp/src/app/api/model/workTopic.ts +++ b/webapp/src/app/api/model/work-topic.ts @@ -8,9 +8,9 @@ * Do not edit the class manually. */ import { Score } from './score'; -import { WorkTopicDomain } from './workTopicDomain'; -import { WorkTopicSubfield } from './workTopicSubfield'; -import { WorkTopicField } from './workTopicField'; +import { WorkTopicDomain } from './work-topic-domain'; +import { WorkTopicSubfield } from './work-topic-subfield'; +import { WorkTopicField } from './work-topic-field'; /** diff --git a/webapp/src/app/api/model/work.ts b/webapp/src/app/api/model/work.ts index 07d94a1c..b84cc7b6 100644 --- a/webapp/src/app/api/model/work.ts +++ b/webapp/src/app/api/model/work.ts @@ -7,22 +7,22 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { DehydratedFunder } from './dehydratedFunder'; +import { DehydratedFunder } from './dehydrated-funder'; import { Authorship } from './authorship'; -import { OpenAccess } from './openAccess'; -import { WorkIds } from './workIds'; -import { WorkSustainableDevelopmentGoalsInner } from './workSustainableDevelopmentGoalsInner'; -import { WorkTopic } from './workTopic'; -import { WorkCountsByYearInner } from './workCountsByYearInner'; -import { WorkKeyword } from './workKeyword'; -import { WorkCitationNormalizedPercentile } from './workCitationNormalizedPercentile'; +import { OpenAccess } from './open-access'; +import { WorkIds } from './work-ids'; +import { WorkSustainableDevelopmentGoalsInner } from './work-sustainable-development-goals-inner'; +import { WorkTopic } from './work-topic'; +import { WorkCountsByYearInner } from './work-counts-by-year-inner'; +import { WorkKeyword } from './work-keyword'; +import { WorkCitationNormalizedPercentile } from './work-citation-normalized-percentile'; import { Award } from './award'; import { Fwci } from './fwci'; -import { WorkMeshInner } from './workMeshInner'; -import { WorkCitedByPercentileYear } from './workCitedByPercentileYear'; -import { WorkHasContent } from './workHasContent'; +import { WorkMeshInner } from './work-mesh-inner'; +import { WorkCitedByPercentileYear } from './work-cited-by-percentile-year'; +import { WorkHasContent } from './work-has-content'; import { Location } from './location'; -import { WorkBiblio } from './workBiblio'; +import { WorkBiblio } from './work-biblio'; /** diff --git a/webapp/src/app/api/model/worksListResponse.ts b/webapp/src/app/api/model/works-list-response.ts similarity index 89% rename from webapp/src/app/api/model/worksListResponse.ts rename to webapp/src/app/api/model/works-list-response.ts index a65d3849..cf03bd2e 100644 --- a/webapp/src/app/api/model/worksListResponse.ts +++ b/webapp/src/app/api/model/works-list-response.ts @@ -9,7 +9,7 @@ */ import { Meta } from './meta'; import { Work } from './work'; -import { GroupByResult } from './groupByResult'; +import { GroupByResult } from './group-by-result'; /** diff --git a/webapp/src/app/modules/person-list/person-list.component.html b/webapp/src/app/modules/person-list/person-list.component.html index 0b3fdf33..8ed59457 100644 --- a/webapp/src/app/modules/person-list/person-list.component.html +++ b/webapp/src/app/modules/person-list/person-list.component.html @@ -1,65 +1,226 @@ -@let persons = state.persons(); -@let results = persons.results ?? []; -@if (!isPersonsLoading()) { - - -

{{ results.length }} Ergebnisse

-
-
- +
+
+ +
+ - @for (person of results; track person.id) { + + @if (activeFilters.length) { +
+ Aktive Filter: +
+ @for (filter of activeFilters; track filter.value) { + + {{ filter.label }} + + + } + +
+
+ } - - @if (person.id){ - +
+ {{ resultRange() }} -
+
+
+ Sortierung: +
+ +
+
+
+
-
- person +
+
+ {{ total | number: "1.0-0" }} Personen gefunden + Sortiert nach Publikationen und Zitierungen +
+ + @if (loading) { +
+ +
+ } @else if (sortedPersons.length) { +
+ @for (person of sortedPersons; track person.id) { +
+
+ +
+ {{ getInitials(person.display_name) }} +
+
+
+ @if (person.relevance_rating) { + + {{ person.relevance_rating }} + + } +
- -
-

{{ person.display_name }}

-

{{ getDistinguishingId(person) }}

- @if (person.affiliations!=undefined){ -

- {{ person.affiliations[0]?.institution?.display_name }} -

- } - - -

- Works: {{ person.works_count }} · - Citations: {{ person.cited_by_count }} -

- -
- @for (t of person.topics; track t) { - {{ t.display_name }} - } -
- -
- +

{{ person.display_name }}

+

{{ institution(person) }}

+

{{ getDistinguishingId(person) }}

+

+ Works: {{ person.works_count }} · + Citations: {{ person.cited_by_count }} +

+
+
+
+ @for (topic of topics(person); track topic) { + {{ topic }} + } +
+
- - } - - - } - - -} @else { - - -
+ }
- - -} \ No newline at end of file + } @else { +
+ person_search +

Keine Personen gefunden

+

Versuchen Sie einen anderen Suchbegriff oder passen Sie die Filter an.

+
+ } + + + @if (totalPages > 1) { +
+ + +
+ @for (p of pageList; track p) { + + } +
+ + +
+ } +
+
+ + + + +
+
\ No newline at end of file diff --git a/webapp/src/app/modules/person-list/person-list.component.scss b/webapp/src/app/modules/person-list/person-list.component.scss index 10174b2e..097911a1 100644 --- a/webapp/src/app/modules/person-list/person-list.component.scss +++ b/webapp/src/app/modules/person-list/person-list.component.scss @@ -1,78 +1,657 @@ -.result-count { - margin: 0 0 12px; - font-size: 14px; - color: #666; +.person-list-page { + padding: 24px; + background: var(--sg-background); + min-height: 100vh; } -.person-card { - width: 100%; - height: 100%; - padding: 12px; - border-radius: 16px; +.layout-container { + display: grid; + grid-template-columns: 1fr 280px; + gap: 24px; + align-items: start; + max-width: 1200px; + margin: 0 auto; } -.card-content { - display: flex; - align-items: center; - gap: 16px; - height: 100%; -} - -.avatar { - display: flex; - justify-content: center; - align-items: center; -} - -.avatar-icon { - font-size: 48px; - width: 48px; - height: 48px; - color: #9e9e9e; -} - -.info { +.results-column { display: flex; flex-direction: column; - gap: 4px; + gap: 20px; + min-width: 0; } -.name { - margin: 0; -} - -.person-id { - font-size: 11px; - color: #aaa; - margin: 0; -} - -.affiliation { - color: #666; - margin: 0; -} - -.stats { - font-size: 12px; - color: #888; -} - -.topics { +.page-header { display: flex; + justify-content: space-between; + align-items: center; + gap: 16px; + + h1 { + margin: 0; + font-size: 26px; + font-weight: 700; + color: var(--sg-text); + } + + p { + margin: 4px 0 0; + color: var(--sg-text-muted); + font-size: 14px; + } +} + +.selection-summary { + display: flex; + align-items: center; + gap: 12px; + padding: 8px 12px; + background: var(--sg-surface); + border: 1px solid var(--sg-border); + border-radius: var(--sg-radius-sm); + + strong { + display: block; + font-size: 11px; + color: var(--sg-text-muted); + text-transform: uppercase; + } + + span { + font-size: 13px; + font-weight: 600; + color: var(--sg-primary); + } +} + +.active-filters-row { + display: flex; + align-items: center; + gap: 10px; + background: var(--sg-surface); + padding: 8px 16px; + border: 1px solid var(--sg-border); + border-radius: var(--sg-radius-sm); + flex-wrap: wrap; + font-size: 13px; +} + +.active-filters-label { + font-weight: 600; + color: var(--sg-text-muted); +} + +.chips-container { + display: flex; + align-items: center; gap: 6px; flex-wrap: wrap; } -.topic-chip { - font-size: 12px; -} -.loading { - display: flex; - justify-content: center; +.filter-chip { + display: inline-flex; align-items: center; + gap: 4px; + padding: 2px 8px; + background: var(--sg-surface-soft); + border: 1px solid var(--sg-border-strong); + border-radius: 12px; + font-size: 11px; + font-weight: 600; + color: var(--sg-text); + button { + border: none; + background: transparent; + cursor: pointer; + padding: 0; + display: flex; + color: var(--sg-text-soft); + + &:hover { + color: var(--sg-text); + } + + mat-icon { + font-size: 12px; + width: 12px; + height: 12px; + } + } +} + +.clear-all-btn { + border: none; + background: transparent; + cursor: pointer; + font-size: 11px; + font-weight: 600; + color: var(--sg-warning); + text-decoration: underline; +} + +.toolbar { + display: flex; + justify-content: space-between; + align-items: center; + border-bottom: 1px solid var(--sg-border); + padding-bottom: 12px; +} + +.result-count { + font-size: 13px; + color: var(--sg-text-muted); +} + +.sort-selector { + display: flex; + align-items: center; + gap: 8px; + font-size: 13px; + color: var(--sg-text-muted); + + select { + background: var(--sg-surface); + border: 1px solid var(--sg-border-strong); + border-radius: var(--sg-radius-sm); + padding: 6px 12px; + font-size: 13px; + color: var(--sg-text); + outline: none; + cursor: pointer; + } +} + +.person-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); + gap: 20px; +} + +.person-card { + background: var(--sg-surface); + border: 1px solid var(--sg-border); + border-radius: var(--sg-radius-sm); + box-shadow: var(--sg-shadow-sm); + display: flex; + flex-direction: column; + transition: transform 0.15s ease, box-shadow 0.15s ease; + + &:hover { + transform: translateY(-2px); + box-shadow: var(--sg-shadow-md); + } +} + +.card-header { + padding: 16px; + display: flex; + gap: 12px; + border-bottom: 1px solid var(--sg-surface-soft); + + .avatar { + width: 40px; + height: 40px; + border-radius: 50%; + background: var(--sg-primary-soft); + color: var(--sg-primary); + font-size: 14px; + font-weight: 700; + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + border: 1px solid var(--sg-border); + } + + .header-main { + flex-grow: 1; + min-width: 0; + } +} + +.rating-and-bookmark { + display: flex; + justify-content: space-between; + align-items: center; +} + +.suitability-badge { + font-size: 10px; + font-weight: 700; + padding: 2px 6px; + border-radius: 8px; + text-transform: uppercase; + + &.very-suitable { + background: var(--sg-success-soft); + color: var(--sg-success); + } + + &.suitable { + background: var(--sg-warning-soft); + color: var(--sg-warning); + } + + &.possible { + background: var(--sg-primary-soft); + color: var(--sg-text-muted); + } +} + +.bookmark-btn { + border: none; + background: transparent; + cursor: pointer; + padding: 2px; + color: var(--sg-text-soft); + + &:hover { + color: var(--sg-primary); + } + + &.bookmarked { + color: #e53935; + } + + mat-icon { + font-size: 18px; + width: 18px; + height: 18px; + } +} + +.person-name { + margin: 6px 0 2px; + font-size: 16px; + font-weight: 600; + color: var(--sg-text); +} + +.institution { + margin: 0; + font-size: 12px; + color: var(--sg-text-muted); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.person-id { + margin: 2px 0 0; + font-size: 10px; + color: var(--sg-text-soft); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.stats { + margin: 4px 0 0; + font-size: 12px; + color: var(--sg-text-muted); +} + +.card-body { + padding: 16px; + flex-grow: 1; + display: flex; + flex-direction: column; + gap: 12px; + justify-content: space-between; +} + +.experience-list { + list-style: none; + padding: 0; + margin: 0; + + li { + font-size: 12px; + color: var(--sg-text-muted); + position: relative; + padding-left: 12px; + margin-bottom: 4px; + + &::before { + content: "•"; + position: absolute; + left: 0; + color: var(--sg-text-soft); + } + } +} + +.topic-row { + display: flex; + flex-wrap: wrap; + gap: 4px; +} + +.topic-tag { + background: var(--sg-surface-soft); + border: 1px solid var(--sg-border); + color: var(--sg-text-muted); + font-size: 10px; + font-weight: 600; + padding: 2px 6px; + border-radius: 4px; +} + +.card-footer { + padding: 10px 12px; + border-top: 1px solid var(--sg-border); + background: var(--sg-surface-muted); +} + +.action-buttons { + display: flex; + gap: 6px; +} + +.action-btn { + flex: 1; + display: flex; + align-items: center; + justify-content: center; + gap: 4px; + padding: 6px; + background: var(--sg-surface); + border: 1px solid var(--sg-border-strong); + border-radius: var(--sg-radius-sm); + color: var(--sg-text-muted); + font-size: 10px; + font-weight: 600; + text-decoration: none; + + mat-icon { + font-size: 12px; + width: 12px; + height: 12px; + } + + &:hover { + background: var(--sg-primary-soft); + color: var(--sg-primary); + } +} + +.empty-state { + display: flex; + flex-direction: column; + align-items: center; + padding: 48px 16px; + background: var(--sg-surface); + border: 1px dashed var(--sg-border); + border-radius: var(--sg-radius-sm); + color: var(--sg-text-muted); + + mat-icon { + font-size: 36px; + width: 36px; + height: 36px; + margin-bottom: 12px; + } + + h2 { + margin: 0 0 4px; + font-size: 16px; + } + + p { + margin: 0; + font-size: 13px; + } +} + +.custom-pagination { + display: flex; + align-items: center; + justify-content: center; + gap: 12px; + padding-top: 16px; +} + +.paginator-btn { + display: flex; + align-items: center; + gap: 4px; + padding: 6px 12px; + background: var(--sg-surface); + border: 1px solid var(--sg-border); + border-radius: var(--sg-radius-sm); + color: var(--sg-text); + font-size: 12px; + font-weight: 600; + cursor: pointer; + + mat-icon { + font-size: 16px; + width: 16px; + height: 16px; + } + + &:hover:not(:disabled) { + background: var(--sg-surface-soft); + } + + &:disabled { + opacity: 0.5; + cursor: not-allowed; + } +} + +.page-numbers { + display: flex; + gap: 4px; +} + +.page-number-btn { + width: 32px; + height: 32px; + border-radius: 50%; + border: none; + background: transparent; + color: var(--sg-text-muted); + font-size: 12px; + font-weight: 600; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + + &:hover { + background: var(--sg-surface-soft); + } + + &.active { + background: var(--sg-primary); + color: #fff; + } +} + +.filters-sidebar { + background: var(--sg-surface); + border: 1px solid var(--sg-border); + border-radius: var(--sg-radius-sm); + padding: 16px; + box-shadow: var(--sg-shadow-sm); + display: flex; + flex-direction: column; + gap: 16px; + position: sticky; + top: 16px; +} + +.sidebar-header { + display: flex; + align-items: center; + gap: 8px; + padding-bottom: 12px; + border-bottom: 1px solid var(--sg-border); + + mat-icon { + color: var(--sg-primary); + font-size: 20px; + width: 20px; + height: 20px; + } + + h2 { + margin: 0; + font-size: 16px; + font-weight: 700; + } +} + +.filter-section { + display: flex; + flex-direction: column; + gap: 8px; +} + +.filter-section-title { + margin: 0; + font-size: 11px; + font-weight: 700; + color: var(--sg-text-muted); + text-transform: uppercase; +} + +.topic-search-wrapper { + position: relative; + display: flex; + align-items: center; + background: var(--sg-surface-soft); + border: 1px solid var(--sg-border); + border-radius: var(--sg-radius-sm); + padding: 4px 8px; + + mat-icon { + font-size: 16px; + width: 16px; + height: 16px; + color: var(--sg-text-soft); + } + + input { + border: none; + background: transparent; + outline: none; + font-size: 12px; + color: var(--sg-text); + flex-grow: 1; + margin-left: 6px; + } + + .clear-topic-search { + border: none; + background: transparent; + cursor: pointer; + display: flex; + color: var(--sg-text-soft); + + mat-icon { + font-size: 14px; + width: 14px; + height: 14px; + } + } +} + +.checkbox-list { + display: flex; + flex-direction: column; + gap: 8px; +} + +.checkbox-label { + display: flex; + align-items: center; + gap: 8px; + cursor: pointer; + + input[type="checkbox"] { + accent-color: var(--sg-primary); + width: 15px; + height: 15px; + cursor: pointer; + } + + .checkbox-text { + font-size: 12px; + color: var(--sg-text); + } +} + +.show-more-btn { + display: flex; + align-items: center; + gap: 2px; + background: transparent; + border: none; + cursor: pointer; + color: var(--sg-text-muted); + font-size: 11px; + font-weight: 700; + padding: 2px 0; + + mat-icon { + font-size: 14px; + width: 14px; + height: 14px; + } +} + +.sidebar-footer { + padding-top: 12px; + border-top: 1px solid var(--sg-border); +} + +.submit-btn { width: 100%; - min-height: 300px; + background: var(--sg-primary); + color: #fff; + border: none; + border-radius: var(--sg-radius-sm); + padding: 10px; + font-size: 13px; + font-weight: 700; + cursor: pointer; + transition: background 0.15s; - padding: 2rem; + &:hover:not(:disabled) { + background: var(--sg-primary-strong); + } + + &:disabled { + opacity: 0.5; + cursor: not-allowed; + } +} + +@media (max-width: 1024px) { + .layout-container { + grid-template-columns: 1fr; + } + + .filters-sidebar { + position: static; + } +} + +@media (max-width: 640px) { + .person-list-page { + padding: 12px; + } + + .page-header { + flex-direction: column; + align-items: flex-start; + } + + .toolbar { + flex-direction: column; + align-items: flex-start; + gap: 8px; + } } \ No newline at end of file diff --git a/webapp/src/app/modules/person-list/person-list.component.ts b/webapp/src/app/modules/person-list/person-list.component.ts index ad002537..74e4b8d5 100644 --- a/webapp/src/app/modules/person-list/person-list.component.ts +++ b/webapp/src/app/modules/person-list/person-list.component.ts @@ -1,135 +1,358 @@ -import { Component, computed, inject, signal, DestroyRef } from '@angular/core'; -import { Router } from '@angular/router'; -import { toObservable } from '@angular/core/rxjs-interop'; +import { Component, inject, signal, DestroyRef } from '@angular/core'; +import { Router, RouterLink, ActivatedRoute } from '@angular/router'; +import { CommonModule } from '@angular/common'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; -import { MatGridListModule } from '@angular/material/grid-list'; -import { MatCardModule } from '@angular/material/card'; +import { FormControl, ReactiveFormsModule } from '@angular/forms'; + import { MatIconModule } from '@angular/material/icon'; -import { MatChipsModule } from '@angular/material/chips'; -import { MatProgressSpinner } from '@angular/material/progress-spinner'; -import { Author, AuthorsListResponse, PersonsService } from '../../api'; +import { MatPaginatorModule } from '@angular/material/paginator'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatButtonModule } from '@angular/material/button'; + +import { CustomAuthor, PersonsSearchService } from '../../api'; import { SharedStateService } from '../../shared/services/shared-state.service'; -import { distinctUntilChanged, switchMap, tap, finalize } from 'rxjs'; +import { PaginationService } from '../../shared/services/pagination.service'; +import { finalize } from 'rxjs'; @Component({ selector: 'app-person-list', imports: [ - MatCardModule, - MatChipsModule, - MatGridListModule, + CommonModule, + RouterLink, + ReactiveFormsModule, MatIconModule, - MatProgressSpinner, + MatPaginatorModule, + MatProgressSpinnerModule, + MatFormFieldModule, + MatInputModule, + MatButtonModule, ], templateUrl: './person-list.component.html', styleUrl: './person-list.component.scss', }) export class PersonListComponent { private readonly router = inject(Router); - private readonly personsService = inject(PersonsService); + private readonly route = inject(ActivatedRoute); + private readonly personsSearchService = inject(PersonsSearchService); private readonly destroyRef = inject(DestroyRef); public readonly state = inject(SharedStateService); + public readonly paginationService = inject(PaginationService); private readonly defaultIncludes = - 'display_name,works_count,cited_by_count,topics,orcid'; - private readonly defaultInstitutionName = 'University of Duisburg-Essen'; + 'display_name,works_count,cited_by_count,topics,orcid,relevance_rating,affiliations'; + + readonly loadingState = signal(false); + persons: CustomAuthor[] = []; + total = 0; + currentPage = 1; + + // Selected filter states + selectedTopics = new Set(); + + // Filter checklists + readonly defaultTopics = [ + 'Artificial Intelligence', + 'Big Data and Business Intelligence', + 'Topic Modeling', + 'Entrepreneurship Studies and Influences', + 'Complex Network Analysis Techniques', + 'Semantic Web and Ontologies', + 'Machine Learning', + 'Data Science', + 'Nachhaltigkeit', + 'Entrepreneurship' + ]; + + // Forms + sortControl = new FormControl('relevance', { nonNullable: true }); + topicSearchControl = new FormControl('', { nonNullable: true }); + institutionControl = new FormControl('', { nonNullable: true }); + showAllTopics = false; + + // Bookmarking + bookmarkedIds = new Set(); - readonly isPersonsLoading = signal(false); constructor() { - toObservable(this.state.searchValue) - .pipe( - distinctUntilChanged(), - tap(() => { - this.state.hasSearched.set(false); - this.isPersonsLoading.set(true); - }), - switchMap((value) => - value - ? this.personsService - .searchPersonsByName(value, this.defaultIncludes) - .pipe( - tap((result) => { - this.state.persons.set(this.sortByRanking(result)); - this.state.hasSearched.set(true); - }), - ) - : this.personsService - .searchPersonsByInstitution( - this.defaultInstitutionName, - this.defaultIncludes, - ) - .pipe( - tap((result) => { - this.state.persons.set(this.sortByRanking(result)); - }), - ), - ), - finalize(() => this.isPersonsLoading.set(false)), - takeUntilDestroyed(this.destroyRef), - ) - .subscribe({ - next: () => this.isPersonsLoading.set(false), - error: (err) => { - console.error('Error loading persons:', err); - this.isPersonsLoading.set(false); - }, + // Subscribe to route query parameters to trigger searches + this.route.queryParams + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe((params) => { + const query = params['query'] || ''; + const page = params['page'] ? Number.parseInt(params['page'], 10) : 1; + const pageSize = params['pageSize'] ? Number.parseInt(params['pageSize'], 10) : 10; + const institutionName = params['institutionName'] || ''; + + const topics = this.parseQueryParamArray(params['topic']); + + this.selectedTopics = new Set(topics); + this.currentPage = page; + this.paginationService.selection = pageSize; + + // Sync search box & institution input + if (this.state.searchValue() !== query) { + this.state.searchValue.set(query || null); + } + if (this.institutionControl.value !== institutionName) { + this.institutionControl.setValue(institutionName); + } + + this.load(query, page, pageSize, topics, institutionName); }); } - // navigation - navigateID(id: string): void { - this.router.navigate(['/person', id]); - } + load( + query?: string, + page: number = 1, + pageSize: number = 10, + topics?: string[], + institutionName?: string + ): void { + this.loadingState.set(true); - // sorting logic - sortByRanking(response: AuthorsListResponse): AuthorsListResponse { - if (!response.results) return response; - - return { - ...response, - results: [...response.results].sort((personA, personB) => { - const rankDiff = this.getSortRank(personA) - this.getSortRank(personB); - if (rankDiff !== 0) { - return rankDiff; + this.personsSearchService.searchPersonsList( + query || undefined, + institutionName || undefined, + topics?.length ? topics : undefined, + page, + pageSize, + this.defaultIncludes + ) + .pipe( + finalize(() => this.loadingState.set(false)), + takeUntilDestroyed(this.destroyRef) + ) + .subscribe({ + next: (response) => { + this.persons = (response.results ?? []) as CustomAuthor[]; + this.total = response.meta?.count ?? 0; + }, + error: (err) => { + console.error('Error loading persons:', err); } - return this.getWorksCount(personB) - this.getWorksCount(personA); - }), - }; + }); } - getWorksCount(person: Author): number { - return person.works_count ?? 0; - } - - getSortRank(person: Author): number { - if (this.hasInstitution(person) && this.hasOrcid(person)) return 0; - if (this.hasInstitution(person)) return 1; - if (this.hasOrcid(person)) return 2; - return 3; - } - - hasInstitution(person: Author): boolean { - if (!person.affiliations) { - return false; + // Getters for filtered results + get sortedPersons(): CustomAuthor[] { + const sorted = [...this.persons]; + const val = this.sortControl.value; + if (val === 'works') { + return sorted.sort((a, b) => (b.works_count ?? 0) - (a.works_count ?? 0)); + } else if (val === 'citations') { + return sorted.sort((a, b) => (b.cited_by_count ?? 0) - (a.cited_by_count ?? 0)); } - for (const affiliation of person.affiliations) { - if (affiliation.institution) { - return true; - } + return sorted; // relevance (Elasticsearch default order) + } + + get loading(): boolean { + return this.loadingState(); + } + + // Topics checklist processing + get topicsList(): string[] { + const set = new Set(this.defaultTopics); + this.persons.forEach(p => { + p.topics?.forEach(t => { + if (t.display_name) set.add(t.display_name); + }); + }); + return Array.from(set); + } + + get filteredTopicsList(): string[] { + const filter = this.topicSearchControl.value.toLowerCase().trim(); + let list = this.topicsList; + if (filter) { + list = list.filter(t => t.toLowerCase().includes(filter)); } - return false; + return this.showAllTopics ? list : list.slice(0, 5); } - hasOrcid(person: Author): boolean { - const ids = person.ids as { orcid?: string } | null | undefined; - return !!ids?.orcid; + toggleShowAllTopics(): void { + this.showAllTopics = !this.showAllTopics; } - getDistinguishingId(person: Author): string { - const ids = person.ids as { orcid?: string } | null | undefined; - const orcid = ids?.orcid; + // Filter selection checks + isTopicSelected(topic: string): boolean { + return this.selectedTopics.has(topic); + } - return orcid - ? 'ORCID: ' + orcid.replace('https://orcid.org/', '') - : 'OpenAlexID: ' + person.id; + toggleTopic(topic: string): void { + if (this.selectedTopics.has(topic)) { + this.selectedTopics.delete(topic); + } else { + this.selectedTopics.add(topic); + } + this.applySidebarFilters(); + } + + // Active filters tags row + get activeFilters(): Array<{ category: string, value: string, label: string }> { + const list: Array<{ category: string, value: string, label: string }> = []; + this.selectedTopics.forEach(t => { + list.push({ category: 'topic', value: t, label: t }); + }); + if (this.institutionControl.value) { + list.push({ + category: 'institutionName', + value: this.institutionControl.value, + label: `Institution: ${this.institutionControl.value}` + }); + } + return list; + } + + removeFilter(filter: { category: string, value: string }): void { + if (filter.category === 'topic') { + this.selectedTopics.delete(filter.value); + } else if (filter.category === 'institutionName') { + this.institutionControl.setValue(''); + } + this.applySidebarFilters(); + } + + clearAllFilters(): void { + this.selectedTopics.clear(); + this.institutionControl.setValue(''); + this.applySidebarFilters(); + } + + applySidebarFilters(): void { + this.router.navigate([], { + queryParams: { + topic: this.selectedTopics.size ? Array.from(this.selectedTopics) : null, + institutionName: this.institutionControl.value || null, + page: 1, + }, + queryParamsHandling: 'merge', + }); + } + + // Pagination custom calculation + get totalPages(): number { + return Math.max(1, Math.ceil(this.total / this.paginationService.selection)); + } + + get pageList(): number[] { + const list: number[] = []; + const maxPagesToShow = 5; + let start = Math.max(1, this.currentPage - 2); + let end = Math.min(this.totalPages, start + maxPagesToShow - 1); + + if (end - start + 1 < maxPagesToShow) { + start = Math.max(1, end - maxPagesToShow + 1); + } + + for (let i = start; i <= end; i++) { + list.push(i); + } + return list; + } + + isFirstPage(): boolean { + return this.currentPage === 1; + } + + isLastPage(): boolean { + return this.currentPage >= this.totalPages; + } + + prevPage(): void { + if (!this.isFirstPage()) { + this.goToPage(this.currentPage - 1); + } + } + + nextPage(): void { + if (!this.isLastPage()) { + this.goToPage(this.currentPage + 1); + } + } + + goToPage(p: number): void { + this.router.navigate([], { + queryParams: { page: p }, + queryParamsHandling: 'merge' + }); + } + + resultRange(): string { + if (!this.total || !this.persons.length) return '0-0 von 0 Personen'; + const start = (this.currentPage - 1) * this.paginationService.selection + 1; + const end = start + this.persons.length - 1; + return `${start}-${end} von ${this.total} Personen`; + } + + // Model parsing / UI Helpers + institution(person: CustomAuthor): string { + return ( + person.affiliations?.[0]?.institution?.display_name || + person.last_known_institutions?.[0]?.display_name || + 'Unbekannte Institution' + ); + } + + topics(person: CustomAuthor): string[] { + return (person.topics ?? []) + .map((t) => t.display_name) + .filter((name): name is string => !!name) + .slice(0, 3); + } + + getInitials(name: string | null | undefined): string { + if (!name) return 'U'; + const cleanName = name.replace(/Prof\.|Dr\.|M\.Sc\./g, '').trim(); + const parts = cleanName.split(' '); + const first = parts[0]?.[0] || ''; + const last = parts[parts.length - 1]?.[0] || ''; + return (first + last).toUpperCase(); + } + + getRatingClass(rating: string | null | undefined): string { + const r = (rating || '').toLowerCase(); + if (r === 'sehr geeignet') return 'very-suitable'; + if (r === 'geeignet') return 'suitable'; + return 'possible'; + } + + // Bookmarks + toggleBookmark(person: CustomAuthor): void { + if (!person.id) return; + if (this.bookmarkedIds.has(person.id)) { + this.bookmarkedIds.delete(person.id); + } else { + this.bookmarkedIds.add(person.id); + } + } + + isBookmarked(person: CustomAuthor): boolean { + return !!person.id && this.bookmarkedIds.has(person.id); + } + + clearSearch(): void { + this.state.searchValue.set(null); + this.router.navigate([], { + queryParams: { query: null, page: 1 }, + queryParamsHandling: 'merge', + }); + } + + getDistinguishingId(person: CustomAuthor): string { + if (!person) return ''; + if (person.orcid) { + return person.orcid.replace('https://orcid.org/', ''); + } + if (person.id) { + return person.id.replace('https://openalex.org/', ''); + } + return ''; + } + + private parseQueryParamArray(val: any): string[] { + if (!val) return []; + if (Array.isArray(val)) return val; + return [val]; } } diff --git a/webapp/src/app/modules/person/person.component.html b/webapp/src/app/modules/person/person.component.html index 04a4c7a9..a5245a5e 100644 --- a/webapp/src/app/modules/person/person.component.html +++ b/webapp/src/app/modules/person/person.component.html @@ -1,4 +1,4 @@ -@if (isPersonLoading()){ +@if (!isPersonLoading()){
diff --git a/webapp/src/app/shared/services/credential.service.ts b/webapp/src/app/shared/services/credential.service.ts index 912ad4be..e75f73c8 100644 --- a/webapp/src/app/shared/services/credential.service.ts +++ b/webapp/src/app/shared/services/credential.service.ts @@ -1,6 +1,9 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; -import { BehaviorSubject, Observable, takeWhile } from 'rxjs'; +//import { BehaviorSubject, Observable, takeWhile } from 'rxjs'; +import { filter, take, map } from 'rxjs/operators'; //TODO: review by arman +import { Observable, of } from 'rxjs'; // review +import { BehaviorSubject } from 'rxjs'; //review export interface AuthAccount { i: number; @@ -161,22 +164,55 @@ export class CredentialService { this.validating.next(false); } + + //review: arman (generated fix) public getBearerToken(): Observable { - return new Observable((observer) => { - if (this.validating.value) { - this.validating.pipe(takeWhile((validating) => validating)).subscribe({ - complete: () => observer.next(this.accessToken.value ? this.accessToken.value.grant.access_token : undefined) - }); - } else if (!this.accessToken.value) { - observer.next(undefined); - } else if (Date.now() < this.accessToken.value.expiration) { - observer.next(this.accessToken.value.grant.access_token); - } else { - this.refreshAccessToken(this.identityToken.value!); - this.validating.pipe(takeWhile((validating) => validating)).subscribe({ - complete: () => observer.next(this.accessToken.value ? this.accessToken.value.grant.access_token : undefined) - }); + // 1. If we have a valid access token, return it immediately and complete. + if (this.accessToken.value && Date.now() < this.accessToken.value.expiration) { + return of(this.accessToken.value.grant.access_token); + } + + // 2. If we don't have a token, and we ARE NOT currently validating, trigger a refresh. + if (!this.validating.value) { + if (!this.identityToken.value) { + return of(undefined); // No identity token to refresh with. } - }); + this.refreshAccessToken(this.identityToken.value); + } + + // 3. Wait for the validation to finish, then return the resulting token. + return this.validating.pipe( + filter(isValidating => !isValidating), // Wait until validating becomes false + take(1), // Take exactly 1 emission and then automatically complete() + map(() => this.accessToken.value ? this.accessToken.value.grant.access_token : undefined) + ); } + /* Old version with added complete statements to resolve loading spinner issue + public getBearerToken(): Observable { + return new Observable((observer) => { + if (this.validating.value) { + this.validating.pipe(takeWhile((validating) => validating)).subscribe({ + complete: () => { + observer.next(this.accessToken.value ? this.accessToken.value.grant.access_token : undefined); + observer.complete(); // added complete + } + }); + } else if (!this.accessToken.value) { + observer.next(undefined); + observer.complete(); // added complete + } else if (Date.now() < this.accessToken.value.expiration) { + observer.next(this.accessToken.value.grant.access_token); + observer.complete(); // added complete + } else { + this.refreshAccessToken(this.identityToken.value!); + this.validating.pipe(takeWhile((validating) => validating)).subscribe({ + complete: () => { + observer.next(this.accessToken.value ? this.accessToken.value.grant.access_token : undefined); + observer.complete(); // added complete + } + }); + } + }); + } + */ } diff --git a/webapp/src/app/shared/ui/app-layout/app-layout.component.ts b/webapp/src/app/shared/ui/app-layout/app-layout.component.ts index f0292ee7..d92dd9f2 100644 --- a/webapp/src/app/shared/ui/app-layout/app-layout.component.ts +++ b/webapp/src/app/shared/ui/app-layout/app-layout.component.ts @@ -67,12 +67,12 @@ export class AppLayoutComponent implements OnInit, OnDestroy { this.router.navigate(['/']); } startSearch(){ - console.log("updated to", this.searchValue.value,this.router.url) - - if (this.router.url.startsWith('/persons')) { - this.router.navigate(['/persons']); - } - this.state.searchValue.set(this.searchValue.value); + const query = this.searchValue.value || null; + this.state.searchValue.set(query); + this.router.navigate(['/persons'], { + queryParams: { query, page: 1 }, + queryParamsHandling: 'merge', + }); } navigateBack(){ this.location.back() diff --git a/webapp/src/app/shared/ui/app-menu/app-menu.component.html b/webapp/src/app/shared/ui/app-menu/app-menu.component.html index fc6632aa..caea0f1d 100644 --- a/webapp/src/app/shared/ui/app-menu/app-menu.component.html +++ b/webapp/src/app/shared/ui/app-menu/app-menu.component.html @@ -19,6 +19,7 @@ diff --git a/webapp/src/app/shared/ui/app-menu/app-menu.component.ts b/webapp/src/app/shared/ui/app-menu/app-menu.component.ts index 70c0ba5e..85d9fc63 100644 --- a/webapp/src/app/shared/ui/app-menu/app-menu.component.ts +++ b/webapp/src/app/shared/ui/app-menu/app-menu.component.ts @@ -21,7 +21,13 @@ import { CredentialService } from '../../services/credential.service'; export class AppMenuComponent { navItems = [ { label: 'Dashboard', icon: 'dashboard', route: '/items', disabled: false }, - { label: 'Personen', icon: 'groups', route: '/persons', disabled: false }, + { + label: 'Personen', + icon: 'groups', + route: '/persons', + queryParams: { institutionName: 'University of Duisburg-Essen' }, + disabled: false, + }, ]; constructor(public credentialService: CredentialService) {}