From c3865a8660a3e4418f290e56b0406595ab0b009e Mon Sep 17 00:00:00 2001 From: Kazgatari <56477241+Kazgatari@users.noreply.github.com> Date: Sat, 6 Jun 2026 12:45:31 +0200 Subject: [PATCH] remove openalex_id, change publication & citation to german --- service/src/main/inse/persons/logic.py | 29 +++++++++---------- service/src/main/inse/util.py | 9 +++--- .../person-list/person-list.component.html | 15 ++++------ .../person-list/person-list.component.scss | 10 ++++--- .../person-list/person-list.component.ts | 3 -- .../app/modules/person/person.component.html | 8 ----- .../app/modules/person/person.component.ts | 1 - 7 files changed, 29 insertions(+), 46 deletions(-) diff --git a/service/src/main/inse/persons/logic.py b/service/src/main/inse/persons/logic.py index 64a649f1..a4dc5c0f 100644 --- a/service/src/main/inse/persons/logic.py +++ b/service/src/main/inse/persons/logic.py @@ -51,11 +51,10 @@ def search_persons( # Resilient sanitization of IDs to protect against model regeneration type conflicts (#Generated) ids = source_copy.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) + ids_copy = {} + orcid_val = ids.get("orcid") + if orcid_val: + ids_copy["orcid"] = str(orcid_val) source_copy["ids"] = ids_copy author = Author.from_dict(source_copy) @@ -257,11 +256,10 @@ def search_persons_autocomplete(author_name: str, limit: Optional[int] = 5, incl # Resilient sanitization of IDs to protect against model regeneration type conflicts (#Generated) ids = source_copy.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) + ids_copy = {} + orcid_val = ids.get("orcid") + if orcid_val: + ids_copy["orcid"] = str(orcid_val) source_copy["ids"] = ids_copy for key,value in fields.items(): @@ -325,7 +323,7 @@ def _enrich_author_data(author_data) -> Optional[CustomAuthor]: else: return None author_id = author_data.get("id", "") or "" - + # Not implemented yet h = int(hashlib.md5(author_id.encode('utf-8')).hexdigest(), 16) @@ -341,11 +339,10 @@ def _enrich_author_data(author_data) -> Optional[CustomAuthor]: # Resilient sanitization of IDs to protect against model type conflicts (Generated) TODO: multiple code occurrences (e.g. in util.py) => refactor into seperate utility function (if required, after all merges) 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) + ids_copy = {} + orcid_val = ids.get("orcid") + if orcid_val: + ids_copy["orcid"] = str(orcid_val) author_data["ids"] = ids_copy base_author = Author.from_dict(author_data) diff --git a/service/src/main/inse/util.py b/service/src/main/inse/util.py index da4fc410..645e2235 100644 --- a/service/src/main/inse/util.py +++ b/service/src/main/inse/util.py @@ -28,11 +28,10 @@ def get_persons_data(hit:dict): # Resilient sanitization of IDs to protect against model regeneration type conflicts (#Generated) ids = source_copy.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) + ids_copy = {} + orcid_val = ids.get("orcid") + if orcid_val: + ids_copy["orcid"] = str(orcid_val) source_copy["ids"] = ids_copy author = Author.from_dict(source_copy) 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 f4aa67e2..2b9d5f40 100644 --- a/webapp/src/app/modules/person-list/person-list.component.html +++ b/webapp/src/app/modules/person-list/person-list.component.html @@ -97,8 +97,8 @@

{{ getDistinguishingId(person) }}

- Works: {{ person.works_count }} · - Citations: {{ person.cited_by_count }} + Publikationen: {{ person.works_count }} · + Zitationen: {{ person.cited_by_count }}

@@ -184,9 +184,7 @@ } - @@ -220,16 +218,15 @@ style="font-size: 12px; color: var(--sg-text);">Seit - + Jahr @if (filterYearControl.hasError('min')) { - Jahr muss ≥ 1900 sein + Jahr muss ≥ 1900 sein } @if (filterYearControl.hasError('max')) { - Zukünftige Jahre sind nicht erlaubt + Zukünftige Jahre sind nicht erlaubt } 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 c37d656b..2c0c5e8f 100644 --- a/webapp/src/app/modules/person-list/person-list.component.scss +++ b/webapp/src/app/modules/person-list/person-list.component.scss @@ -271,7 +271,7 @@ .institution { display: flex; align-items: center; - gap:15px; + gap: 15px; margin: 0; font-size: 12px; color: var(--sg-text-muted); @@ -279,10 +279,12 @@ text-overflow: ellipsis; white-space: nowrap; } -.flag-img{ + +.flag-img { border: 1px solid; vertical-align: -10px; } + .person-id { margin: 2px 0 0; font-size: 10px; @@ -294,7 +296,7 @@ .stats { margin: 4px 0 0; - font-size: 12px; + font-size: 10px; color: var(--sg-text-muted); } @@ -661,4 +663,4 @@ 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 61ee4647..6be52be4 100644 --- a/webapp/src/app/modules/person-list/person-list.component.ts +++ b/webapp/src/app/modules/person-list/person-list.component.ts @@ -402,9 +402,6 @@ export class PersonListComponent { if (person.orcid) { return person.orcid.replace('https://orcid.org/', ''); } - if (person.id) { - return person.id.replace('https://openalex.org/', ''); - } return ''; } diff --git a/webapp/src/app/modules/person/person.component.html b/webapp/src/app/modules/person/person.component.html index a5245a5e..f70aaabc 100644 --- a/webapp/src/app/modules/person/person.component.html +++ b/webapp/src/app/modules/person/person.component.html @@ -32,14 +32,6 @@ mail uni-email@uni-due.de - - @if (openAlexId()) { -
- person - {{ openAlexId() }} -
- } - @if (orcid()) {
verified diff --git a/webapp/src/app/modules/person/person.component.ts b/webapp/src/app/modules/person/person.component.ts index de495b6d..33578084 100644 --- a/webapp/src/app/modules/person/person.component.ts +++ b/webapp/src/app/modules/person/person.component.ts @@ -121,7 +121,6 @@ readonly personBio = toSignal( this.orcid() ? `https://orcid.org/${this.orcid()}` : null, ); readonly worksApiUrl = computed(() => this.person()?.works_api_url ?? null); - readonly openAlexId = computed(() => this.person()?.id ?? null); readonly topicsFull = computed( () => this.person()?.topics ?? [],