disable the organization badge view for users not from own org
This commit is contained in:
@@ -42,7 +42,7 @@ VERIFIED_PERSONS_INDEX = "orgminer_verified_persons_ude"
|
||||
VERIFIED_PERSONS_INSTITUTION_ID = DEFAULT_INSTITUTION_ID
|
||||
VERIFIED_PERSON_FIELDS = [
|
||||
"openalex_id",
|
||||
"org_name",
|
||||
"organization",
|
||||
"org_uri",
|
||||
"org_hierarchy_path",
|
||||
"verified_at",
|
||||
@@ -73,7 +73,7 @@ async def get_verified_organizations(author_id: str) -> list[VerifiedOrganizatio
|
||||
},
|
||||
"sort": [
|
||||
{"verified_at": {"order": "desc", "missing": "_last"}},
|
||||
{"org_name.keyword": {"order": "asc", "missing": "_last"}},
|
||||
{"organization.keyword": {"order": "asc", "missing": "_last"}},
|
||||
],
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ async def get_verified_organizations(author_id: str) -> list[VerifiedOrganizatio
|
||||
for hit in data.get("hits", {}).get("hits", []):
|
||||
source = hit.get("_source") or {}
|
||||
org_uri = normalize_org_uri(source.get("org_uri"))
|
||||
org_name = (source.get("org_name") or "").strip()
|
||||
org_name = (source.get("organization") or "").strip()
|
||||
key = org_uri or org_name.casefold()
|
||||
if not key:
|
||||
continue
|
||||
|
||||
@@ -1,217 +1,231 @@
|
||||
<app-page-container>
|
||||
@if (!isPersonLoading()) {
|
||||
<section class="person-hero">
|
||||
<div class="profile-card">
|
||||
<div class="profile-avatar">{{ initials() }}</div>
|
||||
<div class="profile-main">
|
||||
<div class="name-line">
|
||||
<span>Person</span>
|
||||
<h1>{{ displayName() }}</h1>
|
||||
<button
|
||||
type="button"
|
||||
class="profile-bookmark-button"
|
||||
[class.bookmarked]="bookmarkService.isBookmarked(person()?.id)"
|
||||
[attr.aria-label]="
|
||||
bookmarkService.isBookmarked(person()?.id)
|
||||
? 'Bookmark entfernen'
|
||||
: 'Person bookmarken'
|
||||
"
|
||||
[matTooltip]="
|
||||
bookmarkService.isBookmarked(person()?.id)
|
||||
? 'Bookmark entfernen'
|
||||
: 'Person bookmarken'
|
||||
"
|
||||
(click)="toggleBookmark()">
|
||||
<mat-icon>{{
|
||||
bookmarkService.isBookmarked(person()?.id)
|
||||
? BOOKMARK_ICON
|
||||
: BOOKMARK_BORDER_ICON
|
||||
}}</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
@if (resolvedInstitution() || verifiedOrganizations().length > 0) {
|
||||
<div class="institution-line">
|
||||
@if (resolvedInstitution(); as inst) {
|
||||
<app-institution-chip
|
||||
[institution]="inst"
|
||||
size="normal"
|
||||
[showIcon]="true"
|
||||
[isClickable]="false" />
|
||||
@if (secondaryInstitutions().length > 0) {
|
||||
<button
|
||||
type="button"
|
||||
class="more-institutions-btn"
|
||||
[appComponentTooltip]="PersonInstitutionTooltipListComponent"
|
||||
[tooltipInputs]="{ institutions: secondaryInstitutions() }"
|
||||
[attr.aria-label]="
|
||||
secondaryInstitutions().length + ' weitere Institutionen'
|
||||
">
|
||||
<mat-icon class="more-info-icon">{{ MORE_INFO_ICON }}</mat-icon>
|
||||
<span class="count-text"
|
||||
>+{{ secondaryInstitutions().length }}</span
|
||||
>
|
||||
</button>
|
||||
@if (!isPersonLoading()) {
|
||||
<section class="person-hero">
|
||||
<div class="profile-card">
|
||||
<div class="profile-avatar">{{ initials() }}</div>
|
||||
<div class="profile-main">
|
||||
<div class="name-line">
|
||||
<span>Person</span>
|
||||
<h1>{{ displayName() }}</h1>
|
||||
<button
|
||||
type="button"
|
||||
class="profile-bookmark-button"
|
||||
[class.bookmarked]="bookmarkService.isBookmarked(person()?.id)"
|
||||
[attr.aria-label]="
|
||||
bookmarkService.isBookmarked(person()?.id)
|
||||
? 'Bookmark entfernen'
|
||||
: 'Person bookmarken'
|
||||
"
|
||||
[matTooltip]="
|
||||
bookmarkService.isBookmarked(person()?.id)
|
||||
? 'Bookmark entfernen'
|
||||
: 'Person bookmarken'
|
||||
"
|
||||
(click)="toggleBookmark()">
|
||||
<mat-icon>{{
|
||||
bookmarkService.isBookmarked(person()?.id)
|
||||
? BOOKMARK_ICON
|
||||
: BOOKMARK_BORDER_ICON
|
||||
}}</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
@if (
|
||||
resolvedInstitution() ||
|
||||
(canOpenVerifiedOrganizationHierarchy() &&
|
||||
verifiedOrganizations().length > 0)
|
||||
) {
|
||||
<div class="institution-line">
|
||||
@if (resolvedInstitution(); as inst) {
|
||||
<app-institution-chip
|
||||
[institution]="inst"
|
||||
size="normal"
|
||||
[showIcon]="true"
|
||||
[isClickable]="false" />
|
||||
@if (secondaryInstitutions().length > 0) {
|
||||
<button
|
||||
type="button"
|
||||
class="more-institutions-btn"
|
||||
[appComponentTooltip]="
|
||||
PersonInstitutionTooltipListComponent
|
||||
"
|
||||
[tooltipInputs]="{ institutions: secondaryInstitutions() }"
|
||||
[attr.aria-label]="
|
||||
secondaryInstitutions().length + ' weitere Institutionen'
|
||||
">
|
||||
<mat-icon class="more-info-icon">{{
|
||||
MORE_INFO_ICON
|
||||
}}</mat-icon>
|
||||
<span class="count-text"
|
||||
>+{{ secondaryInstitutions().length }}</span
|
||||
>
|
||||
</button>
|
||||
}
|
||||
}
|
||||
}
|
||||
@for (org of verifiedOrganizations(); track $index) {
|
||||
@if (canOpenOrganizationHierarchy(org)) {
|
||||
<button
|
||||
type="button"
|
||||
class="verified-org-chip"
|
||||
@if (canOpenVerifiedOrganizationHierarchy()) {
|
||||
@for (org of verifiedOrganizations(); track $index) {
|
||||
@if (canOpenOrganizationHierarchy(org)) {
|
||||
<button
|
||||
type="button"
|
||||
class="verified-org-chip"
|
||||
[matTooltip]="
|
||||
'Verifizierte Organisation: ' +
|
||||
org.org_name +
|
||||
' – Hierarchie öffnen'
|
||||
"
|
||||
matTooltipPosition="right"
|
||||
[matTooltipShowDelay]="250"
|
||||
[attr.aria-label]="
|
||||
'Verifizierte Organisation: ' +
|
||||
org.org_name +
|
||||
'. Hierarchie öffnen.'
|
||||
"
|
||||
(click)="openOrganizationHierarchy(org)">
|
||||
<mat-icon>{{ VERIFIED_ICON }}</mat-icon>
|
||||
<span>{{ org.org_name }}</span>
|
||||
</button>
|
||||
} @else {
|
||||
<span
|
||||
class="verified-org-chip static"
|
||||
[matTooltip]="
|
||||
'Verifizierte Organisation: ' + org.org_name
|
||||
"
|
||||
matTooltipPosition="right"
|
||||
[matTooltipShowDelay]="250">
|
||||
<mat-icon>{{ VERIFIED_ICON }}</mat-icon>
|
||||
<span>{{ org.org_name }}</span>
|
||||
</span>
|
||||
}
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@if (
|
||||
worksCount() !== null ||
|
||||
citedByCount() !== null ||
|
||||
h_index() !== null
|
||||
) {
|
||||
<span class="stats-line">
|
||||
@if (worksCount() !== null) {
|
||||
<span class="stat-item">
|
||||
<mat-icon class="stat-icon">{{ PUBLICATION_ICON }}</mat-icon>
|
||||
{{ worksCount() | number }} Publikationen
|
||||
</span>
|
||||
}
|
||||
@if (worksCount() !== null && citedByCount() !== null) {
|
||||
·
|
||||
}
|
||||
@if (citedByCount() !== null) {
|
||||
<span class="stat-item">
|
||||
<mat-icon class="stat-icon">{{ CITATION_ICON }}</mat-icon>
|
||||
{{ citedByCount() | number }} Zitationen
|
||||
</span>
|
||||
}
|
||||
@if (
|
||||
(worksCount() !== null || citedByCount() !== null) &&
|
||||
h_index() !== null
|
||||
) {
|
||||
·
|
||||
}
|
||||
@if (h_index() !== null) {
|
||||
<span
|
||||
class="stat-item has-tooltip"
|
||||
[matTooltip]="
|
||||
'Verifizierte Organisation: ' +
|
||||
org.org_name +
|
||||
' – Hierarchie öffnen'
|
||||
'Der h-Index beträgt ' +
|
||||
h_index() +
|
||||
': ' +
|
||||
h_index() +
|
||||
' Publikationen wurden jeweils mindestens ' +
|
||||
h_index() +
|
||||
'-mal zitiert.'
|
||||
"
|
||||
matTooltipPosition="right"
|
||||
[matTooltipShowDelay]="250"
|
||||
[attr.aria-label]="
|
||||
'Verifizierte Organisation: ' +
|
||||
org.org_name +
|
||||
'. Hierarchie öffnen.'
|
||||
"
|
||||
(click)="openOrganizationHierarchy(org)">
|
||||
<mat-icon>{{ VERIFIED_ICON }}</mat-icon>
|
||||
<span>{{ org.org_name }}</span>
|
||||
</button>
|
||||
} @else {
|
||||
<span
|
||||
class="verified-org-chip static"
|
||||
[matTooltip]="'Verifizierte Organisation: ' + org.org_name"
|
||||
[matTooltipShowDelay]="250">
|
||||
<mat-icon class="stat-icon">{{ TRENDING_UP_ICON }}</mat-icon>
|
||||
h-Index {{ h_index() }}
|
||||
</span>
|
||||
}
|
||||
</span>
|
||||
}
|
||||
@if (displayCareerStage() || orcid()) {
|
||||
<div class="meta-line">
|
||||
<app-career-stage-chip
|
||||
[careerStage]="displayCareerStage()"
|
||||
[activeYears]="person()?.career_metrics?.active_years" />
|
||||
@if (orcid(); as orcidId) {
|
||||
<a
|
||||
class="orcid-chip"
|
||||
[href]="orcidUrl()"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
matTooltip="ORCID-Profil öffnen"
|
||||
matTooltipPosition="right"
|
||||
[matTooltipShowDelay]="250">
|
||||
<mat-icon>{{ VERIFIED_ICON }}</mat-icon>
|
||||
<span>{{ org.org_name }}</span>
|
||||
</span>
|
||||
{{ orcidId }}
|
||||
</a>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@if (
|
||||
worksCount() !== null || citedByCount() !== null || h_index() !== null
|
||||
) {
|
||||
<span class="stats-line">
|
||||
@if (worksCount() !== null) {
|
||||
<span class="stat-item">
|
||||
<mat-icon class="stat-icon">{{ PUBLICATION_ICON }}</mat-icon>
|
||||
{{ worksCount() | number }} Publikationen
|
||||
</span>
|
||||
}
|
||||
@if (worksCount() !== null && citedByCount() !== null) {
|
||||
·
|
||||
}
|
||||
@if (citedByCount() !== null) {
|
||||
<span class="stat-item">
|
||||
<mat-icon class="stat-icon">{{ CITATION_ICON }}</mat-icon>
|
||||
{{ citedByCount() | number }} Zitationen
|
||||
</span>
|
||||
}
|
||||
@if (
|
||||
(worksCount() !== null || citedByCount() !== null) &&
|
||||
h_index() !== null
|
||||
) {
|
||||
·
|
||||
}
|
||||
@if (h_index() !== null) {
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<aside class="sidebar">
|
||||
<div class="bio-card">
|
||||
@if (isBioLoading()) {
|
||||
<app-loading
|
||||
text="Biografie wird geladen..."
|
||||
[icon]="DESCRIPTION_ICON"
|
||||
[size]="150"
|
||||
[diameter]="150"></app-loading>
|
||||
} @else if (personBio() != null) {
|
||||
<div class="bio-header">
|
||||
<h3>Biografie</h3>
|
||||
<span
|
||||
class="stat-item has-tooltip"
|
||||
[matTooltip]="
|
||||
'Der h-Index beträgt ' +
|
||||
h_index() +
|
||||
': ' +
|
||||
h_index() +
|
||||
' Publikationen wurden jeweils mindestens ' +
|
||||
h_index() +
|
||||
'-mal zitiert.'
|
||||
"
|
||||
matTooltipPosition="right"
|
||||
class="ai-badge"
|
||||
matTooltip="Diese Biografie wurde automatisch mit KI erstellt und kann Fehler enthalten."
|
||||
matTooltipPosition="above"
|
||||
[matTooltipShowDelay]="250">
|
||||
<mat-icon class="stat-icon">{{ TRENDING_UP_ICON }}</mat-icon>
|
||||
h-Index {{ h_index() }}
|
||||
<mat-icon>{{ AI_GENERATED_ICON }}</mat-icon>
|
||||
KI-generiert
|
||||
</span>
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
<p>{{ personBio() }}</p>
|
||||
}
|
||||
</div>
|
||||
</aside>
|
||||
<app-person-interesting
|
||||
[topics]="primaryTopicCounts()"
|
||||
[loading]="isTopicsLoading()"
|
||||
[personName]="personName()"
|
||||
[personPublicationsLink]="personPublicationsLink()"
|
||||
(tagClick)="onInterestingTagClick($event)"></app-person-interesting>
|
||||
</section>
|
||||
@if (this.links()) {
|
||||
<app-link-tab-nav-bar
|
||||
#navBar
|
||||
[links]="links()"
|
||||
[tabPanel]="tabPanel"></app-link-tab-nav-bar>
|
||||
}
|
||||
} @else {
|
||||
<app-loading
|
||||
text="Person wird geladen..."
|
||||
[icon]="PERSON_ICON"
|
||||
[size]="150"
|
||||
[diameter]="150"></app-loading>
|
||||
}
|
||||
<mat-tab-nav-panel #tabPanel class="person-panel">
|
||||
@let activeLink = this.activeLink();
|
||||
@if (activeLink) {
|
||||
<div class="description-container">
|
||||
@if (activeLink.label) {
|
||||
<h5>{{ activeLink.label }}</h5>
|
||||
}
|
||||
@if (displayCareerStage() || orcid()) {
|
||||
<div class="meta-line">
|
||||
<app-career-stage-chip
|
||||
[careerStage]="displayCareerStage()"
|
||||
[activeYears]="person()?.career_metrics?.active_years" />
|
||||
@if (orcid(); as orcidId) {
|
||||
<a
|
||||
class="orcid-chip"
|
||||
[href]="orcidUrl()"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
matTooltip="ORCID-Profil öffnen"
|
||||
matTooltipPosition="right"
|
||||
[matTooltipShowDelay]="250">
|
||||
<mat-icon>{{ VERIFIED_ICON }}</mat-icon>
|
||||
{{ orcidId }}
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
@if (activeLink.description) {
|
||||
<span class="description">{{ activeLink.description }}</span>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
<div class="content">
|
||||
<router-outlet></router-outlet>
|
||||
</div>
|
||||
<aside class="sidebar">
|
||||
<div class="bio-card">
|
||||
@if (isBioLoading()) {
|
||||
<app-loading
|
||||
text="Biografie wird geladen..."
|
||||
[icon]="DESCRIPTION_ICON"
|
||||
[size]="150"
|
||||
[diameter]="150"></app-loading>
|
||||
} @else if (personBio() != null) {
|
||||
<div class="bio-header">
|
||||
<h3>Biografie</h3>
|
||||
<span
|
||||
class="ai-badge"
|
||||
matTooltip="Diese Biografie wurde automatisch mit KI erstellt und kann Fehler enthalten."
|
||||
matTooltipPosition="above"
|
||||
[matTooltipShowDelay]="250">
|
||||
<mat-icon>{{ AI_GENERATED_ICON }}</mat-icon>
|
||||
KI-generiert
|
||||
</span>
|
||||
</div>
|
||||
<p>{{ personBio() }}</p>
|
||||
}
|
||||
</div>
|
||||
</aside>
|
||||
<app-person-interesting
|
||||
[topics]="primaryTopicCounts()"
|
||||
[loading]="isTopicsLoading()"
|
||||
[personName]="personName()"
|
||||
[personPublicationsLink]="personPublicationsLink()"
|
||||
(tagClick)="onInterestingTagClick($event)"></app-person-interesting>
|
||||
</section>
|
||||
@if (this.links()) {
|
||||
<app-link-tab-nav-bar
|
||||
#navBar
|
||||
[links]="links()"
|
||||
[tabPanel]="tabPanel"></app-link-tab-nav-bar>
|
||||
}
|
||||
} @else {
|
||||
<app-loading
|
||||
text="Person wird geladen..."
|
||||
[icon]="PERSON_ICON"
|
||||
[size]="150"
|
||||
[diameter]="150"></app-loading>
|
||||
}
|
||||
<mat-tab-nav-panel #tabPanel class="person-panel">
|
||||
@let activeLink = this.activeLink();
|
||||
@if (activeLink) {
|
||||
<div class="description-container">
|
||||
@if (activeLink.label) {
|
||||
<h5>{{ activeLink.label }}</h5>
|
||||
}
|
||||
@if (activeLink.description) {
|
||||
<span class="description">{{ activeLink.description }}</span>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
<div class="content">
|
||||
<router-outlet></router-outlet>
|
||||
</div>
|
||||
</mat-tab-nav-panel>
|
||||
</mat-tab-nav-panel>
|
||||
</app-page-container>
|
||||
|
||||
@@ -79,9 +79,7 @@ import {
|
||||
import { PageContainerComponent } from '../../shared/ui/page-container/page-container.component';
|
||||
|
||||
/** Accepts raw and full-URL OpenAlex IDs, e.g. `I123` or `.../I123`. */
|
||||
const normalizeInstitutionId = (
|
||||
value: string | null | undefined,
|
||||
): string =>
|
||||
const normalizeInstitutionId = (value: string | null | undefined): string =>
|
||||
(value ?? '')
|
||||
.trim()
|
||||
.replace(/^https:\/\/openalex\.org\//i, '')
|
||||
|
||||
Reference in New Issue
Block a user