refactor/icons #295
@@ -29,12 +29,17 @@ async def get_institution_by_id(
|
||||
raw_oa_institution_id=institution_id,
|
||||
source=[
|
||||
"id",
|
||||
"ror",
|
||||
"display_name",
|
||||
"country_code",
|
||||
"type",
|
||||
"homepage_url",
|
||||
"display_name_alternatives",
|
||||
"works_count",
|
||||
"cited_by_count",
|
||||
"geo",
|
||||
"summary_stats",
|
||||
"associated_institutions",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ from pydantic_core import to_jsonable_python
|
||||
|
||||
from inse.models.openalex.author_counts_by_year_inner import AuthorCountsByYearInner
|
||||
from inse.models.openalex.author_summary_stats import AuthorSummaryStats
|
||||
from inse.models.openalex.dehydrated_institution import DehydratedInstitution
|
||||
from inse.models.openalex.institution_geo import InstitutionGeo
|
||||
from inse.models.openalex.institution_ids import InstitutionIds
|
||||
|
||||
@@ -51,9 +52,10 @@ class Institution(BaseModel):
|
||||
ids: InstitutionIds | None = None
|
||||
counts_by_year: list[AuthorCountsByYearInner] | None = Field(default=None, description="`works_count` and `cited_by_count` for each of the last ten years.")
|
||||
works_api_url: StrictStr | None = Field(default=None, description="A URL that will get you a list of all works affiliated with this institution.")
|
||||
associated_institutions: list[DehydratedInstitution] | None = Field(default=None, description="Associated institutions list.")
|
||||
created_date: date | None = Field(default=None, description="When this institution was added to OpenAlex (ISO 8601 date).")
|
||||
updated_date: datetime | None = Field(default=None, description="When this institution was last updated (ISO 8601 datetime).")
|
||||
__properties: ClassVar[list[str]] = ["id", "ror", "display_name", "country_code", "type", "homepage_url", "image_url", "image_thumbnail_url", "display_name_acronyms", "display_name_alternatives", "works_count", "cited_by_count", "summary_stats", "geo", "lineage", "ids", "counts_by_year", "works_api_url", "created_date", "updated_date"]
|
||||
__properties: ClassVar[list[str]] = ["id", "ror", "display_name", "country_code", "type", "homepage_url", "image_url", "image_thumbnail_url", "display_name_acronyms", "display_name_alternatives", "works_count", "cited_by_count", "summary_stats", "geo", "lineage", "ids", "counts_by_year", "works_api_url", "associated_institutions", "created_date", "updated_date"]
|
||||
|
||||
@field_validator('type')
|
||||
def type_validate_enum(cls, value):
|
||||
@@ -151,6 +153,7 @@ class Institution(BaseModel):
|
||||
"ids": InstitutionIds.from_dict(obj["ids"]) if obj.get("ids") is not None else None,
|
||||
"counts_by_year": [AuthorCountsByYearInner.from_dict(_item) for _item in obj["counts_by_year"]] if obj.get("counts_by_year") is not None else None,
|
||||
"works_api_url": obj.get("works_api_url"),
|
||||
"associated_institutions": [DehydratedInstitution.from_dict(_item) for _item in obj["associated_institutions"]] if obj.get("associated_institutions") is not None else None,
|
||||
"created_date": obj.get("created_date"),
|
||||
"updated_date": obj.get("updated_date")
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Innovation Search Engine API
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
@@ -11,31 +11,31 @@ import { InstitutionIds } from './institutionIds';
|
||||
import { AuthorCountsByYearInner } from './authorCountsByYearInner';
|
||||
import { AuthorSummaryStats } from './authorSummaryStats';
|
||||
import { InstitutionGeo } from './institutionGeo';
|
||||
|
||||
import { DehydratedInstitution } from './dehydratedInstitution';
|
||||
|
||||
/**
|
||||
* A university, research organization, or other affiliation
|
||||
*/
|
||||
export interface Institution {
|
||||
id?: string | null;
|
||||
ror?: string | null;
|
||||
display_name?: string | null;
|
||||
country_code?: string | null;
|
||||
type?: string | null;
|
||||
homepage_url?: string | null;
|
||||
image_url?: string | null;
|
||||
image_thumbnail_url?: string | null;
|
||||
display_name_acronyms?: Array<string> | null;
|
||||
display_name_alternatives?: Array<string> | null;
|
||||
works_count?: number | null;
|
||||
cited_by_count?: number | null;
|
||||
summary_stats?: AuthorSummaryStats | null;
|
||||
geo?: InstitutionGeo | null;
|
||||
lineage?: Array<string> | null;
|
||||
ids?: InstitutionIds | null;
|
||||
counts_by_year?: Array<AuthorCountsByYearInner> | null;
|
||||
works_api_url?: string | null;
|
||||
created_date?: string | null;
|
||||
updated_date?: string | null;
|
||||
export interface Institution {
|
||||
id?: string | null;
|
||||
ror?: string | null;
|
||||
display_name?: string | null;
|
||||
country_code?: string | null;
|
||||
type?: string | null;
|
||||
homepage_url?: string | null;
|
||||
image_url?: string | null;
|
||||
image_thumbnail_url?: string | null;
|
||||
display_name_acronyms?: Array<string> | null;
|
||||
display_name_alternatives?: Array<string> | null;
|
||||
works_count?: number | null;
|
||||
cited_by_count?: number | null;
|
||||
summary_stats?: AuthorSummaryStats | null;
|
||||
geo?: InstitutionGeo | null;
|
||||
lineage?: Array<string> | null;
|
||||
ids?: InstitutionIds | null;
|
||||
counts_by_year?: Array<AuthorCountsByYearInner> | null;
|
||||
works_api_url?: string | null;
|
||||
associated_institutions?: Array<DehydratedInstitution> | null;
|
||||
created_date?: string | null;
|
||||
updated_date?: string | null;
|
||||
}
|
||||
|
||||
|
||||
@@ -243,334 +243,334 @@
|
||||
</section>
|
||||
|
||||
@if (selectedAnalyticalInstitutionId) {
|
||||
@if (
|
||||
euProjectStatusesLoading ||
|
||||
bmbfProjectStatusesLoading ||
|
||||
dfgProjectStatusesLoading ||
|
||||
euProjectStatusesError ||
|
||||
bmbfProjectStatusesError ||
|
||||
dfgProjectStatusesError ||
|
||||
(euProjectStatuses && bmbfProjectStatuses && dfgProjectStatuses)
|
||||
) {
|
||||
<section class="topic-heatmap-section">
|
||||
<header class="topic-heatmap-header">
|
||||
<div>
|
||||
<h2>Projektstatus nach Fördergeber</h2>
|
||||
<p>
|
||||
Laufende, kommende und abgeschlossene EU-, Bund- und DFG-Projekte
|
||||
Ihrer Organisation.
|
||||
</p>
|
||||
</div>
|
||||
@if (euProjectStatuses && bmbfProjectStatuses && dfgProjectStatuses) {
|
||||
<div class="project-status-summary">
|
||||
<span>
|
||||
EU:
|
||||
{{
|
||||
euProjectStatuses.ongoing +
|
||||
euProjectStatuses.upcoming +
|
||||
euProjectStatuses.completed | number
|
||||
}}
|
||||
</span>
|
||||
<span>
|
||||
Bund:
|
||||
{{
|
||||
bmbfProjectStatuses.ongoing +
|
||||
bmbfProjectStatuses.upcoming +
|
||||
bmbfProjectStatuses.completed | number
|
||||
}}
|
||||
</span>
|
||||
<span>
|
||||
DFG:
|
||||
{{
|
||||
dfgProjectStatuses.ongoing +
|
||||
dfgProjectStatuses.upcoming +
|
||||
dfgProjectStatuses.completed | number
|
||||
}}
|
||||
</span>
|
||||
@if (
|
||||
euProjectStatusesLoading ||
|
||||
bmbfProjectStatusesLoading ||
|
||||
dfgProjectStatusesLoading ||
|
||||
euProjectStatusesError ||
|
||||
bmbfProjectStatusesError ||
|
||||
dfgProjectStatusesError ||
|
||||
(euProjectStatuses && bmbfProjectStatuses && dfgProjectStatuses)
|
||||
) {
|
||||
<section class="topic-heatmap-section">
|
||||
<header class="topic-heatmap-header">
|
||||
<div>
|
||||
<h2>Projektstatus nach Fördergeber</h2>
|
||||
<p>
|
||||
Laufende, kommende und abgeschlossene EU-, Bund- und DFG-Projekte
|
||||
Ihrer Organisation.
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
</header>
|
||||
@if (euProjectStatuses && bmbfProjectStatuses && dfgProjectStatuses) {
|
||||
<div class="project-status-summary">
|
||||
<span>
|
||||
EU:
|
||||
{{
|
||||
euProjectStatuses.ongoing +
|
||||
euProjectStatuses.upcoming +
|
||||
euProjectStatuses.completed | number
|
||||
}}
|
||||
</span>
|
||||
<span>
|
||||
Bund:
|
||||
{{
|
||||
bmbfProjectStatuses.ongoing +
|
||||
bmbfProjectStatuses.upcoming +
|
||||
bmbfProjectStatuses.completed | number
|
||||
}}
|
||||
</span>
|
||||
<span>
|
||||
DFG:
|
||||
{{
|
||||
dfgProjectStatuses.ongoing +
|
||||
dfgProjectStatuses.upcoming +
|
||||
dfgProjectStatuses.completed | number
|
||||
}}
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
</header>
|
||||
|
||||
@if (
|
||||
euProjectStatusesLoading ||
|
||||
bmbfProjectStatusesLoading ||
|
||||
dfgProjectStatusesLoading
|
||||
) {
|
||||
<div class="project-status-loading" role="status" aria-live="polite">
|
||||
<app-loading
|
||||
text="Projektstatus wird geladen …"
|
||||
[icon]="STACKED_BAR_CHART_ICON"
|
||||
size="64"
|
||||
diameter="64"></app-loading>
|
||||
</div>
|
||||
} @else if (
|
||||
euProjectStatusesError &&
|
||||
bmbfProjectStatusesError &&
|
||||
dfgProjectStatusesError
|
||||
) {
|
||||
<p class="statistics-error">
|
||||
Der Status der EU-, Bund- und DFG-Projekte konnte nicht geladen
|
||||
werden.
|
||||
</p>
|
||||
} @else if (
|
||||
euProjectStatuses && bmbfProjectStatuses && dfgProjectStatuses
|
||||
) {
|
||||
@if (
|
||||
euProjectStatusesError ||
|
||||
bmbfProjectStatusesError ||
|
||||
euProjectStatusesLoading ||
|
||||
bmbfProjectStatusesLoading ||
|
||||
dfgProjectStatusesLoading
|
||||
) {
|
||||
<div class="project-status-loading" role="status" aria-live="polite">
|
||||
<app-loading
|
||||
text="Projektstatus wird geladen …"
|
||||
[icon]="STACKED_BAR_CHART_ICON"
|
||||
size="64"
|
||||
diameter="64"></app-loading>
|
||||
</div>
|
||||
} @else if (
|
||||
euProjectStatusesError &&
|
||||
bmbfProjectStatusesError &&
|
||||
dfgProjectStatusesError
|
||||
) {
|
||||
<p class="statistics-error">
|
||||
Projektstatusdaten für {{ failedProjectStatusSources() }} konnten
|
||||
nicht geladen werden. Die übrigen Daten werden weiterhin
|
||||
angezeigt.
|
||||
Der Status der EU-, Bund- und DFG-Projekte konnte nicht geladen
|
||||
werden.
|
||||
</p>
|
||||
} @else if (
|
||||
euProjectStatuses && bmbfProjectStatuses && dfgProjectStatuses
|
||||
) {
|
||||
@if (
|
||||
euProjectStatusesError ||
|
||||
bmbfProjectStatusesError ||
|
||||
dfgProjectStatusesError
|
||||
) {
|
||||
<p class="statistics-error">
|
||||
Projektstatusdaten für {{ failedProjectStatusSources() }} konnten
|
||||
nicht geladen werden. Die übrigen Daten werden weiterhin
|
||||
angezeigt.
|
||||
</p>
|
||||
}
|
||||
<app-eu-project-status-chart
|
||||
[statuses]="euProjectStatuses"
|
||||
[bmbfStatuses]="bmbfProjectStatuses"
|
||||
[dfgStatuses]="dfgProjectStatuses"></app-eu-project-status-chart>
|
||||
}
|
||||
<app-eu-project-status-chart
|
||||
[statuses]="euProjectStatuses"
|
||||
[bmbfStatuses]="bmbfProjectStatuses"
|
||||
[dfgStatuses]="dfgProjectStatuses"></app-eu-project-status-chart>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
|
||||
@if (topicTreemapLoading || topicTreemapError || hasTopicTreemapData()) {
|
||||
<section class="topic-heatmap-section">
|
||||
<header class="topic-heatmap-header">
|
||||
<div>
|
||||
<h2>Field Treemap</h2>
|
||||
<p>Publikationen Ihrer Organisation nach Field.</p>
|
||||
</div>
|
||||
</header>
|
||||
@if (topicTreemapLoading || topicTreemapError || hasTopicTreemapData()) {
|
||||
<section class="topic-heatmap-section">
|
||||
<header class="topic-heatmap-header">
|
||||
<div>
|
||||
<h2>Field Treemap</h2>
|
||||
<p>Publikationen Ihrer Organisation nach Field.</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@if (topicTreemapLoading) {
|
||||
<div class="topic-heatmap-loading" role="status" aria-live="polite">
|
||||
<app-loading
|
||||
text="Treemap-Daten für den gewählten Zeitraum werden geladen …"
|
||||
[icon]="ACCOUNT_TREE_ICON"
|
||||
size="72"
|
||||
diameter="72"></app-loading>
|
||||
</div>
|
||||
} @else if (topicTreemapError) {
|
||||
<p class="statistics-error">
|
||||
Die Field-Treemap konnte nicht geladen werden.
|
||||
</p>
|
||||
} @else {
|
||||
<app-topic-treemap
|
||||
[data]="topicTreemap"
|
||||
[selectedNodeId]="selectedTopicTreemapNode"
|
||||
(selectedNodeIdChange)="onTopicTreemapNodeChange($event)"
|
||||
(topicSelect)="onTopicTreemapTopicSelect($event)">
|
||||
</app-topic-treemap>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
|
||||
@if (dfgTopicsLoading || dfgTopicsError || dfgProjectTopics) {
|
||||
<section class="topic-heatmap-section">
|
||||
<header class="topic-heatmap-header">
|
||||
<div>
|
||||
<h2>DFG-Projekt-Topics</h2>
|
||||
<p>
|
||||
Gematchte DFG-Projekte nach Field, Subfield und Topic. Ein Klick auf
|
||||
ein Topic zeigt die zugehörigen Keywords.
|
||||
</p>
|
||||
</div>
|
||||
@if (dfgProjectTopics) {
|
||||
<p class="dfg-topic-summary">
|
||||
{{ dfgProjectTopics.matched_project_count | number }} von
|
||||
{{ dfgProjectTopics.project_count | number }} Projekten gematcht
|
||||
@if (topicTreemapLoading) {
|
||||
<div class="topic-heatmap-loading" role="status" aria-live="polite">
|
||||
<app-loading
|
||||
text="Treemap-Daten für den gewählten Zeitraum werden geladen …"
|
||||
[icon]="ACCOUNT_TREE_ICON"
|
||||
size="72"
|
||||
diameter="72"></app-loading>
|
||||
</div>
|
||||
} @else if (topicTreemapError) {
|
||||
<p class="statistics-error">
|
||||
Die Field-Treemap konnte nicht geladen werden.
|
||||
</p>
|
||||
} @else {
|
||||
<app-topic-treemap
|
||||
[data]="topicTreemap"
|
||||
[selectedNodeId]="selectedTopicTreemapNode"
|
||||
(selectedNodeIdChange)="onTopicTreemapNodeChange($event)"
|
||||
(topicSelect)="onTopicTreemapTopicSelect($event)">
|
||||
</app-topic-treemap>
|
||||
}
|
||||
</header>
|
||||
</section>
|
||||
}
|
||||
|
||||
@if (dfgTopicsLoading) {
|
||||
<div class="topic-heatmap-loading" role="status" aria-live="polite">
|
||||
<app-loading
|
||||
text="DFG-Topics werden geladen …"
|
||||
[icon]="ACCOUNT_TREE_ICON"
|
||||
size="72"
|
||||
diameter="72"></app-loading>
|
||||
</div>
|
||||
} @else if (dfgTopicsError) {
|
||||
<p class="statistics-error">
|
||||
Die DFG-Topic-Treemap konnte nicht geladen werden.
|
||||
</p>
|
||||
} @else {
|
||||
<app-topic-treemap
|
||||
[data]="dfgTopicTreemap"
|
||||
[selectedNodeId]="selectedDfgTopicTreemapNode"
|
||||
countLabel="DFG-Projekte"
|
||||
[showCountInTooltip]="false"
|
||||
(selectedNodeIdChange)="onDfgTopicTreemapNodeChange($event)"
|
||||
(topicSelect)="onDfgTopicTreemapTopicSelect($event)">
|
||||
</app-topic-treemap>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
@if (dfgTopicsLoading || dfgTopicsError || dfgProjectTopics) {
|
||||
<section class="topic-heatmap-section">
|
||||
<header class="topic-heatmap-header">
|
||||
<div>
|
||||
<h2>DFG-Projekt-Topics</h2>
|
||||
<p>
|
||||
Gematchte DFG-Projekte nach Field, Subfield und Topic. Ein Klick
|
||||
auf ein Topic zeigt die zugehörigen Keywords.
|
||||
</p>
|
||||
</div>
|
||||
@if (dfgProjectTopics) {
|
||||
<p class="dfg-topic-summary">
|
||||
{{ dfgProjectTopics.matched_project_count | number }} von
|
||||
{{ dfgProjectTopics.project_count | number }} Projekten gematcht
|
||||
</p>
|
||||
}
|
||||
</header>
|
||||
|
||||
@if (euTopicsLoading || euTopicsError || euProjectTopics) {
|
||||
<section class="topic-heatmap-section">
|
||||
<header class="topic-heatmap-header">
|
||||
<div>
|
||||
<h2>EU-Projekt-Topics</h2>
|
||||
<p>
|
||||
Gematchte EU-Projekte nach Field, Subfield und Topic. Ein Klick auf
|
||||
ein Topic zeigt die zugehörigen Keywords.
|
||||
</p>
|
||||
</div>
|
||||
@if (euProjectTopics) {
|
||||
<p class="dfg-topic-summary">
|
||||
{{ euProjectTopics.matched_project_count | number }} von
|
||||
{{ euProjectTopics.project_count | number }} Projekten gematcht
|
||||
@if (dfgTopicsLoading) {
|
||||
<div class="topic-heatmap-loading" role="status" aria-live="polite">
|
||||
<app-loading
|
||||
text="DFG-Topics werden geladen …"
|
||||
[icon]="ACCOUNT_TREE_ICON"
|
||||
size="72"
|
||||
diameter="72"></app-loading>
|
||||
</div>
|
||||
} @else if (dfgTopicsError) {
|
||||
<p class="statistics-error">
|
||||
Die DFG-Topic-Treemap konnte nicht geladen werden.
|
||||
</p>
|
||||
} @else {
|
||||
<app-topic-treemap
|
||||
[data]="dfgTopicTreemap"
|
||||
[selectedNodeId]="selectedDfgTopicTreemapNode"
|
||||
countLabel="DFG-Projekte"
|
||||
[showCountInTooltip]="false"
|
||||
(selectedNodeIdChange)="onDfgTopicTreemapNodeChange($event)"
|
||||
(topicSelect)="onDfgTopicTreemapTopicSelect($event)">
|
||||
</app-topic-treemap>
|
||||
}
|
||||
</header>
|
||||
</section>
|
||||
}
|
||||
|
||||
@if (euTopicsLoading) {
|
||||
<div class="topic-heatmap-loading" role="status" aria-live="polite">
|
||||
<app-loading
|
||||
text="EU-Topics werden geladen …"
|
||||
[icon]="ACCOUNT_TREE_ICON"
|
||||
size="72"
|
||||
diameter="72"></app-loading>
|
||||
</div>
|
||||
} @else if (euTopicsError) {
|
||||
<p class="statistics-error">
|
||||
Die EU-Topic-Treemap konnte nicht geladen werden.
|
||||
</p>
|
||||
} @else {
|
||||
<app-topic-treemap
|
||||
[data]="euTopicTreemap"
|
||||
[selectedNodeId]="selectedEuTopicTreemapNode"
|
||||
countLabel="EU-Projekte"
|
||||
[showCountInTooltip]="false"
|
||||
(selectedNodeIdChange)="onEuTopicTreemapNodeChange($event)"
|
||||
(topicSelect)="onEuTopicTreemapTopicSelect($event)">
|
||||
</app-topic-treemap>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
@if (euTopicsLoading || euTopicsError || euProjectTopics) {
|
||||
<section class="topic-heatmap-section">
|
||||
<header class="topic-heatmap-header">
|
||||
<div>
|
||||
<h2>EU-Projekt-Topics</h2>
|
||||
<p>
|
||||
Gematchte EU-Projekte nach Field, Subfield und Topic. Ein Klick
|
||||
auf ein Topic zeigt die zugehörigen Keywords.
|
||||
</p>
|
||||
</div>
|
||||
@if (euProjectTopics) {
|
||||
<p class="dfg-topic-summary">
|
||||
{{ euProjectTopics.matched_project_count | number }} von
|
||||
{{ euProjectTopics.project_count | number }} Projekten gematcht
|
||||
</p>
|
||||
}
|
||||
</header>
|
||||
|
||||
@if (bundTopicsLoading || bundTopicsError || bundProjectTopics) {
|
||||
<section class="topic-heatmap-section">
|
||||
<header class="topic-heatmap-header">
|
||||
<div>
|
||||
<h2>BUND-Projekt-Topics</h2>
|
||||
<p>
|
||||
Gematchte BUND-Projekte nach Field, Subfield und Topic. Ein Klick
|
||||
auf ein Topic zeigt die zugehörigen Keywords.
|
||||
</p>
|
||||
</div>
|
||||
@if (bundProjectTopics) {
|
||||
<p class="dfg-topic-summary">
|
||||
{{ bundProjectTopics.matched_project_count | number }} von
|
||||
{{ bundProjectTopics.project_count | number }} Projekten gematcht
|
||||
@if (euTopicsLoading) {
|
||||
<div class="topic-heatmap-loading" role="status" aria-live="polite">
|
||||
<app-loading
|
||||
text="EU-Topics werden geladen …"
|
||||
[icon]="ACCOUNT_TREE_ICON"
|
||||
size="72"
|
||||
diameter="72"></app-loading>
|
||||
</div>
|
||||
} @else if (euTopicsError) {
|
||||
<p class="statistics-error">
|
||||
Die EU-Topic-Treemap konnte nicht geladen werden.
|
||||
</p>
|
||||
} @else {
|
||||
<app-topic-treemap
|
||||
[data]="euTopicTreemap"
|
||||
[selectedNodeId]="selectedEuTopicTreemapNode"
|
||||
countLabel="EU-Projekte"
|
||||
[showCountInTooltip]="false"
|
||||
(selectedNodeIdChange)="onEuTopicTreemapNodeChange($event)"
|
||||
(topicSelect)="onEuTopicTreemapTopicSelect($event)">
|
||||
</app-topic-treemap>
|
||||
}
|
||||
</header>
|
||||
</section>
|
||||
}
|
||||
|
||||
@if (bundTopicsLoading) {
|
||||
<div class="topic-heatmap-loading" role="status" aria-live="polite">
|
||||
<app-loading
|
||||
text="BUND-Topics werden geladen …"
|
||||
[icon]="ACCOUNT_TREE_ICON"
|
||||
size="72"
|
||||
diameter="72"></app-loading>
|
||||
</div>
|
||||
} @else if (bundTopicsError) {
|
||||
<p class="statistics-error">
|
||||
Die BUND-Topic-Treemap konnte nicht geladen werden.
|
||||
</p>
|
||||
} @else {
|
||||
<app-topic-treemap
|
||||
[data]="bundTopicTreemap"
|
||||
[selectedNodeId]="selectedBundTopicTreemapNode"
|
||||
countLabel="BUND-Projekte"
|
||||
[showCountInTooltip]="false"
|
||||
(selectedNodeIdChange)="onBundTopicTreemapNodeChange($event)"
|
||||
(topicSelect)="onBundTopicTreemapTopicSelect($event)">
|
||||
</app-topic-treemap>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
@if (bundTopicsLoading || bundTopicsError || bundProjectTopics) {
|
||||
<section class="topic-heatmap-section">
|
||||
<header class="topic-heatmap-header">
|
||||
<div>
|
||||
<h2>BUND-Projekt-Topics</h2>
|
||||
<p>
|
||||
Gematchte BUND-Projekte nach Field, Subfield und Topic. Ein Klick
|
||||
auf ein Topic zeigt die zugehörigen Keywords.
|
||||
</p>
|
||||
</div>
|
||||
@if (bundProjectTopics) {
|
||||
<p class="dfg-topic-summary">
|
||||
{{ bundProjectTopics.matched_project_count | number }} von
|
||||
{{ bundProjectTopics.project_count | number }} Projekten gematcht
|
||||
</p>
|
||||
}
|
||||
</header>
|
||||
|
||||
@if (topAuthorsLoading || topAuthorsError || hasTopAuthorData()) {
|
||||
<section class="top-authors-section">
|
||||
<header class="top-authors-header">
|
||||
<div>
|
||||
<h2>Top 10 Personen</h2>
|
||||
<p>
|
||||
Nach Anzahl der Works, DFG-Projekte, Patente und News Ihrer
|
||||
Organisation.
|
||||
@if (bundTopicsLoading) {
|
||||
<div class="topic-heatmap-loading" role="status" aria-live="polite">
|
||||
<app-loading
|
||||
text="BUND-Topics werden geladen …"
|
||||
[icon]="ACCOUNT_TREE_ICON"
|
||||
size="72"
|
||||
diameter="72"></app-loading>
|
||||
</div>
|
||||
} @else if (bundTopicsError) {
|
||||
<p class="statistics-error">
|
||||
Die BUND-Topic-Treemap konnte nicht geladen werden.
|
||||
</p>
|
||||
</div>
|
||||
</header>
|
||||
} @else {
|
||||
<app-topic-treemap
|
||||
[data]="bundTopicTreemap"
|
||||
[selectedNodeId]="selectedBundTopicTreemapNode"
|
||||
countLabel="BUND-Projekte"
|
||||
[showCountInTooltip]="false"
|
||||
(selectedNodeIdChange)="onBundTopicTreemapNodeChange($event)"
|
||||
(topicSelect)="onBundTopicTreemapTopicSelect($event)">
|
||||
</app-topic-treemap>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
|
||||
@if (topAuthorsError) {
|
||||
<p class="statistics-error">
|
||||
Die Autorenstatistiken konnten nicht geladen werden.
|
||||
</p>
|
||||
} @else {
|
||||
<div class="top-authors-grid" [class.loading]="topAuthorsLoading">
|
||||
@for (dataset of visibleTopAuthorDatasets(); track dataset.title) {
|
||||
<article class="top-authors-chart">
|
||||
<h3>
|
||||
<mat-icon>{{ dataset.icon }}</mat-icon
|
||||
>{{ dataset.title }}
|
||||
</h3>
|
||||
@for (
|
||||
entry of dataset.entries;
|
||||
track entry.id || entry.name;
|
||||
let rank = $index
|
||||
) {
|
||||
<div class="author-bar-row">
|
||||
<span class="author-rank">{{ rank + 1 }}</span>
|
||||
<div class="author-bar-content">
|
||||
<div class="author-bar-label">
|
||||
@if (entry.id) {
|
||||
<a
|
||||
class="author-name author-link"
|
||||
[routerLink]="authorLink(dataset, entry)"
|
||||
[queryParams]="authorQueryParams(dataset, entry)"
|
||||
[appComponentTooltip]="AuthorTooltipComponent"
|
||||
[tooltipInputs]="{ authorId: entry.id }"
|
||||
[tooltipMaxWidth]="'500px'"
|
||||
[title]="authorDisplayName(dataset, entry)">
|
||||
{{ authorDisplayName(dataset, entry) }}
|
||||
</a>
|
||||
} @else {
|
||||
@if (topAuthorsLoading || topAuthorsError || hasTopAuthorData()) {
|
||||
<section class="top-authors-section">
|
||||
<header class="top-authors-header">
|
||||
<div>
|
||||
<h2>Top 10 Personen</h2>
|
||||
<p>
|
||||
Nach Anzahl der Works, DFG-Projekte, Patente und News Ihrer
|
||||
Organisation.
|
||||
</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@if (topAuthorsError) {
|
||||
<p class="statistics-error">
|
||||
Die Autorenstatistiken konnten nicht geladen werden.
|
||||
</p>
|
||||
} @else {
|
||||
<div class="top-authors-grid" [class.loading]="topAuthorsLoading">
|
||||
@for (dataset of visibleTopAuthorDatasets(); track dataset.title) {
|
||||
<article class="top-authors-chart">
|
||||
<h3>
|
||||
<mat-icon>{{ dataset.icon }}</mat-icon
|
||||
>{{ dataset.title }}
|
||||
</h3>
|
||||
@for (
|
||||
entry of dataset.entries;
|
||||
track entry.id || entry.name;
|
||||
let rank = $index
|
||||
) {
|
||||
<div class="author-bar-row">
|
||||
<span class="author-rank">{{ rank + 1 }}</span>
|
||||
<div class="author-bar-content">
|
||||
<div class="author-bar-label">
|
||||
@if (entry.id) {
|
||||
<a
|
||||
class="author-name author-link"
|
||||
[routerLink]="authorLink(dataset, entry)"
|
||||
[queryParams]="authorQueryParams(dataset, entry)"
|
||||
[appComponentTooltip]="AuthorTooltipComponent"
|
||||
[tooltipInputs]="{ authorId: entry.id }"
|
||||
[tooltipMaxWidth]="'500px'"
|
||||
[title]="authorDisplayName(dataset, entry)">
|
||||
{{ authorDisplayName(dataset, entry) }}
|
||||
</a>
|
||||
} @else {
|
||||
<span
|
||||
class="author-name"
|
||||
[title]="authorDisplayName(dataset, entry)">
|
||||
{{ authorDisplayName(dataset, entry) }}
|
||||
</span>
|
||||
}
|
||||
<strong>{{ entry.count | number }}</strong>
|
||||
</div>
|
||||
<div class="author-bar-track">
|
||||
<span
|
||||
class="author-name"
|
||||
[title]="authorDisplayName(dataset, entry)">
|
||||
{{ authorDisplayName(dataset, entry) }}
|
||||
</span>
|
||||
}
|
||||
<strong>{{ entry.count | number }}</strong>
|
||||
</div>
|
||||
<div class="author-bar-track">
|
||||
<span
|
||||
class="author-bar-fill"
|
||||
[style.width.%]="
|
||||
authorBarWidth(dataset.entries, entry.count)
|
||||
"></span>
|
||||
class="author-bar-fill"
|
||||
[style.width.%]="
|
||||
authorBarWidth(dataset.entries, entry.count)
|
||||
"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
} @empty {
|
||||
<p class="empty-chart">
|
||||
{{
|
||||
topAuthorsLoading
|
||||
? 'Wird geladen …'
|
||||
: 'Keine Daten vorhanden.'
|
||||
}}
|
||||
</p>
|
||||
}
|
||||
</article>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
} @empty {
|
||||
<p class="empty-chart">
|
||||
{{
|
||||
topAuthorsLoading
|
||||
? 'Wird geladen …'
|
||||
: 'Keine Daten vorhanden.'
|
||||
}}
|
||||
</p>
|
||||
}
|
||||
</article>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -223,9 +223,11 @@ export class DashboardComponent implements OnInit, AfterViewInit {
|
||||
const restoredAnalyticalInstitution =
|
||||
restoredInstitution === 'all' ? '' : restoredInstitution;
|
||||
if (
|
||||
restoredAnalyticalInstitution !== this.selectedAnalyticalInstitutionId
|
||||
restoredAnalyticalInstitution !==
|
||||
this.selectedAnalyticalInstitutionId
|
||||
) {
|
||||
this.selectedAnalyticalInstitutionId = restoredAnalyticalInstitution;
|
||||
this.selectedAnalyticalInstitutionId =
|
||||
restoredAnalyticalInstitution;
|
||||
this.reloadAnalyticalData();
|
||||
}
|
||||
},
|
||||
@@ -1003,7 +1005,9 @@ export class DashboardComponent implements OnInit, AfterViewInit {
|
||||
};
|
||||
}
|
||||
|
||||
private loadTopicTreemap(analyticalRequestId = this.analyticalRequestId): void {
|
||||
private loadTopicTreemap(
|
||||
analyticalRequestId = this.analyticalRequestId,
|
||||
): void {
|
||||
if (this.dashboardFromYear > this.dashboardToYear) {
|
||||
this.topicTreemapLoading = false;
|
||||
this.topicTreemapError = true;
|
||||
|
||||
+166
@@ -0,0 +1,166 @@
|
||||
<div class="institution-overview">
|
||||
<mat-card class="institution-overview-card" appearance="outlined">
|
||||
<!-- Header Section -->
|
||||
<div class="overview-header">
|
||||
<div class="avatar-col">
|
||||
<div class="institution-avatar" [class]="typeInfo().badgeClass">
|
||||
<mat-icon>{{ typeInfo().icon }}</mat-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="identity-col">
|
||||
<div class="title-row">
|
||||
<h1 class="institution-name">{{ displayName() }}</h1>
|
||||
<span [class]="'type-badge ' + typeInfo().badgeClass">
|
||||
<mat-icon class="badge-icon">{{ typeInfo().icon }}</mat-icon>
|
||||
{{ typeInfo().label }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="meta-row">
|
||||
@if (locationText()) {
|
||||
<div class="meta-item location-item">
|
||||
@if (countryCode()) {
|
||||
<app-country-flag
|
||||
[countryCode]="countryCode()!"
|
||||
[height]="14"
|
||||
[bordered]="false" />
|
||||
}
|
||||
<span>{{ locationText() }}</span>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (homepageUrl()) {
|
||||
<a
|
||||
class="meta-link"
|
||||
[href]="homepageUrl()!"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
matTooltip="Offizielle Webseite öffnen">
|
||||
<mat-icon>{{ LANGUAGE_ICON }}</mat-icon>
|
||||
<span>Webseite</span>
|
||||
<mat-icon class="external-icon">{{ OPEN_IN_NEW_ICON }}</mat-icon>
|
||||
</a>
|
||||
}
|
||||
|
||||
@if (rorUrl()) {
|
||||
<a
|
||||
class="meta-link ror-link"
|
||||
[href]="rorUrl()!"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
matTooltip="ROR-Register öffnen">
|
||||
<span class="ror-tag">ROR</span>
|
||||
<mat-icon class="external-icon">{{ OPEN_IN_NEW_ICON }}</mat-icon>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Key Metrics Section -->
|
||||
<div class="metrics-row">
|
||||
@if (worksCount() !== null && worksCount() !== undefined) {
|
||||
<div class="stat-card">
|
||||
<div class="stat-icon-wrapper pub-icon">
|
||||
<mat-icon>{{ PUBLICATION_ICON }}</mat-icon>
|
||||
</div>
|
||||
<div class="stat-content">
|
||||
<span class="stat-value">{{
|
||||
worksCount() | number: undefined : 'de'
|
||||
}}</span>
|
||||
<span class="stat-label">Publikationen</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (citedByCount() !== null && citedByCount() !== undefined) {
|
||||
<div class="stat-card">
|
||||
<div class="stat-icon-wrapper cite-icon">
|
||||
<mat-icon>{{ CITATION_ICON }}</mat-icon>
|
||||
</div>
|
||||
<div class="stat-content">
|
||||
<span class="stat-value">{{
|
||||
citedByCount() | number: undefined : 'de'
|
||||
}}</span>
|
||||
<span class="stat-label">Zitationen</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (hIndex() !== null && hIndex() !== undefined) {
|
||||
<div class="stat-card">
|
||||
<div class="stat-icon-wrapper hindex-icon">
|
||||
<mat-icon>{{ TRENDING_UP_ICON }}</mat-icon>
|
||||
</div>
|
||||
<div class="stat-content">
|
||||
<span class="stat-value">{{ hIndex() }}</span>
|
||||
<span class="stat-label">h-Index</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<!-- Alternative Names / Acronyms -->
|
||||
@if (alternatives().length > 0) {
|
||||
<mat-divider />
|
||||
<div class="details-section">
|
||||
<h4 class="section-title">Alternative Bezeichnungen</h4>
|
||||
<div class="alternatives-list">
|
||||
@for (alt of visibleAlternatives(); track alt) {
|
||||
<span class="alternative-chip">{{ alt }}</span>
|
||||
}
|
||||
@if (hasMoreAlternatives()) {
|
||||
<button
|
||||
mat-button
|
||||
class="expand-btn"
|
||||
(click)="toggleAlternatives()">
|
||||
{{
|
||||
showAllAlternatives()
|
||||
? 'Weniger anzeigen'
|
||||
: '+' + (alternatives().length - 4) + ' weitere'
|
||||
}}
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- Associated Institutions -->
|
||||
@if (associatedInstitutions().length > 0) {
|
||||
<mat-divider />
|
||||
<div class="details-section">
|
||||
<h4 class="section-title">
|
||||
Assoziierte Institutionen
|
||||
<span class="section-count"
|
||||
>({{ associatedInstitutions().length }})</span
|
||||
>
|
||||
</h4>
|
||||
<div class="associated-chips-container">
|
||||
@for (
|
||||
assoc of visibleAssociatedInstitutions();
|
||||
track assoc.id ?? assoc.display_name ?? $index
|
||||
) {
|
||||
<div class="associated-chip-wrapper">
|
||||
<app-institution-chip
|
||||
[institution]="assoc"
|
||||
[showIcon]="true"
|
||||
size="normal"
|
||||
[isClickable]="true"
|
||||
(handleChipClick)="navigateToInstitution(assoc)" />
|
||||
</div>
|
||||
}
|
||||
@if (hasMoreAssociated()) {
|
||||
<button mat-button class="expand-btn" (click)="toggleAssociated()">
|
||||
{{
|
||||
showAllAssociated()
|
||||
? 'Weniger anzeigen'
|
||||
: '+' + (associatedInstitutions().length - 10) + ' weitere'
|
||||
}}
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</mat-card>
|
||||
</div>
|
||||
+346
@@ -0,0 +1,346 @@
|
||||
.institution-overview {
|
||||
width: 100%;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.institution-overview-card {
|
||||
padding: 1.5rem;
|
||||
background: var(--sg-surface);
|
||||
border: 1px solid var(--sg-border);
|
||||
border-radius: 12px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.25rem;
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
/* --- Header & Avatar --- */
|
||||
.overview-header {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 1.25rem;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.avatar-col {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.institution-avatar {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
border-radius: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: var(--sg-surface-container-high, rgba(0, 0, 0, 0.04));
|
||||
border: 1px solid var(--sg-border);
|
||||
color: var(--sg-primary);
|
||||
|
||||
mat-icon {
|
||||
font-size: 34px;
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
&.type-education {
|
||||
background: rgba(33, 150, 243, 0.1);
|
||||
color: #1976d2;
|
||||
border-color: rgba(33, 150, 243, 0.25);
|
||||
}
|
||||
|
||||
&.type-healthcare {
|
||||
background: rgba(233, 30, 99, 0.1);
|
||||
color: #c2185b;
|
||||
border-color: rgba(233, 30, 99, 0.25);
|
||||
}
|
||||
|
||||
&.type-facility {
|
||||
background: rgba(156, 39, 176, 0.1);
|
||||
color: #7b1fa2;
|
||||
border-color: rgba(156, 39, 176, 0.25);
|
||||
}
|
||||
|
||||
&.type-company {
|
||||
background: rgba(255, 152, 0, 0.1);
|
||||
color: #f57c00;
|
||||
border-color: rgba(255, 152, 0, 0.25);
|
||||
}
|
||||
|
||||
&.type-government {
|
||||
background: rgba(0, 150, 136, 0.1);
|
||||
color: #00796b;
|
||||
border-color: rgba(0, 150, 136, 0.25);
|
||||
}
|
||||
}
|
||||
|
||||
.identity-col {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.title-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.75rem;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
.institution-name {
|
||||
font-size: 1.6rem;
|
||||
font-weight: 700;
|
||||
color: var(--sg-text-primary);
|
||||
margin: 0;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.type-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
padding: 0.25rem 0.65rem;
|
||||
border-radius: 9999px;
|
||||
background: var(--sg-surface-container-high, rgba(0, 0, 0, 0.05));
|
||||
color: var(--sg-text-secondary);
|
||||
border: 1px solid var(--sg-border);
|
||||
|
||||
.badge-icon {
|
||||
font-size: 14px;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
&.type-education {
|
||||
background: rgba(33, 150, 243, 0.1);
|
||||
color: #1565c0;
|
||||
border-color: rgba(33, 150, 243, 0.3);
|
||||
}
|
||||
|
||||
&.type-healthcare {
|
||||
background: rgba(233, 30, 99, 0.1);
|
||||
color: #ad1457;
|
||||
border-color: rgba(233, 30, 99, 0.3);
|
||||
}
|
||||
|
||||
&.type-facility {
|
||||
background: rgba(156, 39, 176, 0.1);
|
||||
color: #6a1b9a;
|
||||
border-color: rgba(156, 39, 176, 0.3);
|
||||
}
|
||||
|
||||
&.type-company {
|
||||
background: rgba(255, 152, 0, 0.1);
|
||||
color: #e65100;
|
||||
border-color: rgba(255, 152, 0, 0.3);
|
||||
}
|
||||
|
||||
&.type-government {
|
||||
background: rgba(0, 150, 136, 0.1);
|
||||
color: #004d40;
|
||||
border-color: rgba(0, 150, 136, 0.3);
|
||||
}
|
||||
}
|
||||
|
||||
.meta-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 1rem;
|
||||
font-size: 0.875rem;
|
||||
color: var(--sg-text-secondary);
|
||||
|
||||
@media (max-width: 768px) {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
.meta-item {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
}
|
||||
|
||||
.meta-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
color: var(--sg-primary);
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
transition: opacity 0.2s;
|
||||
|
||||
mat-icon {
|
||||
font-size: 16px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.external-icon {
|
||||
font-size: 13px;
|
||||
width: 13px;
|
||||
height: 13px;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
opacity: 0.85;
|
||||
}
|
||||
}
|
||||
|
||||
.ror-tag {
|
||||
background: var(--sg-primary);
|
||||
color: #ffffff;
|
||||
font-size: 0.65rem;
|
||||
font-weight: 700;
|
||||
padding: 1px 4px;
|
||||
border-radius: 4px;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
/* --- Metrics Grid --- */
|
||||
.metrics-row {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
||||
gap: 0.85rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.85rem;
|
||||
padding: 0.85rem 1rem;
|
||||
background: var(--sg-surface-container-low, rgba(0, 0, 0, 0.02));
|
||||
border: 1px solid var(--sg-border);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.stat-icon-wrapper {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
|
||||
mat-icon {
|
||||
font-size: 20px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
&.pub-icon {
|
||||
background: rgba(33, 150, 243, 0.12);
|
||||
color: #1976d2;
|
||||
}
|
||||
|
||||
&.cite-icon {
|
||||
background: rgba(156, 39, 176, 0.12);
|
||||
color: #7b1fa2;
|
||||
}
|
||||
|
||||
&.hindex-icon {
|
||||
background: rgba(76, 175, 80, 0.12);
|
||||
color: #2e7d32;
|
||||
}
|
||||
}
|
||||
|
||||
.stat-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 1.15rem;
|
||||
font-weight: 700;
|
||||
color: var(--sg-text-primary);
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 0.75rem;
|
||||
color: var(--sg-text-secondary);
|
||||
}
|
||||
|
||||
/* --- Section Lists --- */
|
||||
.details-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.65rem;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.45rem;
|
||||
font-size: 0.85rem;
|
||||
font-weight: 600;
|
||||
color: var(--sg-text-secondary);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
margin: 0;
|
||||
|
||||
mat-icon {
|
||||
font-size: 16px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
color: var(--sg-primary);
|
||||
}
|
||||
|
||||
.section-count {
|
||||
font-weight: normal;
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
|
||||
.alternatives-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.alternative-chip {
|
||||
font-size: 0.8rem;
|
||||
padding: 0.3rem 0.7rem;
|
||||
background: var(--sg-surface-container-high, rgba(0, 0, 0, 0.04));
|
||||
border: 1px solid var(--sg-border);
|
||||
border-radius: 6px;
|
||||
color: var(--sg-text-primary);
|
||||
}
|
||||
|
||||
.expand-btn {
|
||||
font-size: 0.75rem;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
padding: 0 0.5rem;
|
||||
color: var(--sg-primary);
|
||||
}
|
||||
|
||||
.associated-chips-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.65rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.associated-chip-wrapper {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
+216
@@ -0,0 +1,216 @@
|
||||
import { Component, computed, inject, input, signal } from '@angular/core';
|
||||
import { Router, RouterModule } from '@angular/router';
|
||||
import { DecimalPipe } from '@angular/common';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatChipsModule } from '@angular/material/chips';
|
||||
import { MatDividerModule } from '@angular/material/divider';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
import { DehydratedInstitution, Institution } from '../../../../api';
|
||||
import { CountryFlagComponent } from '../../../../shared/ui/country-flag/country-flag.component';
|
||||
import { AppInstitutionChipComponent } from '../../../../shared/ui/app-institution-chip/app-institution-chip.component';
|
||||
import {
|
||||
APARTMENT_ICON,
|
||||
BUSINESS_ICON,
|
||||
CITATION_ICON,
|
||||
FUNDING_ICON,
|
||||
INSTITUTION_ICON,
|
||||
LANGUAGE_ICON,
|
||||
LIBRARY_BOOKS_ICON,
|
||||
LOCAL_HOSPITAL_ICON,
|
||||
OPEN_IN_NEW_ICON,
|
||||
PAID_ICON,
|
||||
PUBLICATION_ICON,
|
||||
SCHOOL_ICON,
|
||||
SCIENCE_ICON,
|
||||
TRENDING_UP_ICON,
|
||||
VOLUNTEER_ACTIVISM_ICON,
|
||||
} from '../../../../shared/ui/icons';
|
||||
|
||||
interface InstitutionTypeInfo {
|
||||
label: string;
|
||||
icon: string;
|
||||
badgeClass: string;
|
||||
}
|
||||
|
||||
const INSTITUTION_TYPE_MAP: Record<string, InstitutionTypeInfo> = {
|
||||
education: {
|
||||
label: 'Bildung / Hochschule',
|
||||
icon: SCHOOL_ICON,
|
||||
badgeClass: 'type-education',
|
||||
},
|
||||
healthcare: {
|
||||
label: 'Klinik / Gesundheit',
|
||||
icon: LOCAL_HOSPITAL_ICON,
|
||||
badgeClass: 'type-healthcare',
|
||||
},
|
||||
company: {
|
||||
label: 'Unternehmen',
|
||||
icon: BUSINESS_ICON,
|
||||
badgeClass: 'type-company',
|
||||
},
|
||||
facility: {
|
||||
label: 'Forschungseinrichtung',
|
||||
icon: SCIENCE_ICON,
|
||||
badgeClass: 'type-facility',
|
||||
},
|
||||
government: {
|
||||
label: 'Staatliche Einrichtung',
|
||||
icon: FUNDING_ICON,
|
||||
badgeClass: 'type-government',
|
||||
},
|
||||
nonprofit: {
|
||||
label: 'Gemeinnützige Organisation',
|
||||
icon: VOLUNTEER_ACTIVISM_ICON,
|
||||
badgeClass: 'type-nonprofit',
|
||||
},
|
||||
archive: {
|
||||
label: 'Archiv / Bibliothek',
|
||||
icon: LIBRARY_BOOKS_ICON,
|
||||
badgeClass: 'type-archive',
|
||||
},
|
||||
funder: {
|
||||
label: 'Förderorganisation',
|
||||
icon: PAID_ICON,
|
||||
badgeClass: 'type-funder',
|
||||
},
|
||||
other: {
|
||||
label: 'Sonstige Institution',
|
||||
icon: INSTITUTION_ICON,
|
||||
badgeClass: 'type-other',
|
||||
},
|
||||
};
|
||||
|
||||
@Component({
|
||||
selector: 'app-institution-overview',
|
||||
imports: [
|
||||
RouterModule,
|
||||
DecimalPipe,
|
||||
MatCardModule,
|
||||
MatIconModule,
|
||||
MatButtonModule,
|
||||
MatChipsModule,
|
||||
MatDividerModule,
|
||||
MatTooltipModule,
|
||||
CountryFlagComponent,
|
||||
AppInstitutionChipComponent,
|
||||
],
|
||||
templateUrl: './institution-overview.component.html',
|
||||
styleUrl: './institution-overview.component.scss',
|
||||
})
|
||||
export class InstitutionOverviewComponent {
|
||||
private readonly router = inject(Router);
|
||||
|
||||
readonly PUBLICATION_ICON = PUBLICATION_ICON;
|
||||
readonly CITATION_ICON = CITATION_ICON;
|
||||
readonly TRENDING_UP_ICON = TRENDING_UP_ICON;
|
||||
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
|
||||
readonly LANGUAGE_ICON = LANGUAGE_ICON;
|
||||
|
||||
institution = input.required<Institution>();
|
||||
|
||||
showAllAlternatives = signal<boolean>(false);
|
||||
|
||||
displayName = computed(() => {
|
||||
const inst = this.institution();
|
||||
return (
|
||||
inst.display_name?.trim() ||
|
||||
inst.display_name_alternatives?.[0]?.trim() ||
|
||||
'Unbekannte Institution'
|
||||
);
|
||||
});
|
||||
|
||||
typeInfo = computed<InstitutionTypeInfo>(() => {
|
||||
const typeKey = this.institution().type?.toLowerCase() ?? 'other';
|
||||
return (
|
||||
INSTITUTION_TYPE_MAP[typeKey] ?? {
|
||||
label: 'Institution',
|
||||
icon: APARTMENT_ICON,
|
||||
badgeClass: 'type-other',
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
locationText = computed(() => {
|
||||
const geo = this.institution().geo;
|
||||
if (!geo) return null;
|
||||
const parts = [geo.city, geo.country].filter(Boolean);
|
||||
return parts.length > 0 ? parts.join(', ') : null;
|
||||
});
|
||||
|
||||
countryCode = computed(() => {
|
||||
return (
|
||||
this.institution().geo?.country_code ??
|
||||
this.institution().country_code ??
|
||||
null
|
||||
);
|
||||
});
|
||||
|
||||
alternatives = computed(() => {
|
||||
return this.institution().display_name_alternatives ?? [];
|
||||
});
|
||||
|
||||
visibleAlternatives = computed(() => {
|
||||
const alts = this.alternatives();
|
||||
if (this.showAllAlternatives()) return alts;
|
||||
return alts.slice(0, 4);
|
||||
});
|
||||
|
||||
hasMoreAlternatives = computed(() => {
|
||||
return this.alternatives().length > 4;
|
||||
});
|
||||
|
||||
worksCount = computed(() => this.institution().works_count);
|
||||
citedByCount = computed(() => this.institution().cited_by_count);
|
||||
hIndex = computed(() => this.institution().summary_stats?.h_index);
|
||||
|
||||
associatedInstitutions = computed<DehydratedInstitution[]>(() => {
|
||||
const list = this.institution().associated_institutions ?? [];
|
||||
const seen = new Set<string>();
|
||||
const unique: DehydratedInstitution[] = [];
|
||||
for (const item of list) {
|
||||
const key = item.id || item.display_name || JSON.stringify(item);
|
||||
if (!seen.has(key)) {
|
||||
seen.add(key);
|
||||
unique.push(item);
|
||||
}
|
||||
}
|
||||
return unique;
|
||||
});
|
||||
|
||||
showAllAssociated = signal<boolean>(false);
|
||||
|
||||
visibleAssociatedInstitutions = computed(() => {
|
||||
const list = this.associatedInstitutions();
|
||||
if (this.showAllAssociated()) return list;
|
||||
return list.slice(0, 10);
|
||||
});
|
||||
|
||||
hasMoreAssociated = computed(() => {
|
||||
return this.associatedInstitutions().length > 10;
|
||||
});
|
||||
|
||||
homepageUrl = computed(() => this.institution().homepage_url);
|
||||
rorUrl = computed(() => this.institution().ror);
|
||||
|
||||
toggleAlternatives(): void {
|
||||
this.showAllAlternatives.update((v) => !v);
|
||||
}
|
||||
|
||||
toggleAssociated(): void {
|
||||
this.showAllAssociated.update((v) => !v);
|
||||
}
|
||||
|
||||
navigateToInstitution(assoc: DehydratedInstitution): void {
|
||||
const cleanId = this.stripOpenAlexId(assoc.id);
|
||||
if (cleanId) {
|
||||
this.router.navigate(['/institution', cleanId]);
|
||||
}
|
||||
}
|
||||
|
||||
stripOpenAlexId(id: string | null | undefined): string | undefined {
|
||||
if (!id) return undefined;
|
||||
return id.replace('https://openalex.org/', '');
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,5 @@
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
<h1>{{ institution().display_name }}</h1>
|
||||
<mat-card appearance="outlined">
|
||||
<mat-card-content>
|
||||
<p>{{ institution().homepage_url }}</p>
|
||||
<p>{{ institution().display_name_alternatives }}</p>
|
||||
<p>And many more useful details...</p>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div class="institution-container">
|
||||
<app-institution-overview [institution]="institution()" />
|
||||
<app-link-tab-nav-bar [links]="_links()" [tabPanel]="tabPanel" />
|
||||
</div>
|
||||
<mat-tab-nav-panel #tabPanel>
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
.container {
|
||||
.institution-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
margin: 0 1rem;
|
||||
margin: 1rem;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Component, computed, input } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { Institution } from '../../api';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatTabsModule } from '@angular/material/tabs';
|
||||
import { InstitutionOverviewComponent } from './components/institution-overview/institution-overview.component';
|
||||
import {
|
||||
LinkTabNavBarComponent,
|
||||
LinkTabNavBarItem,
|
||||
@@ -15,7 +15,12 @@ import {
|
||||
|
||||
@Component({
|
||||
selector: 'app-institution',
|
||||
imports: [MatCardModule, MatTabsModule, RouterModule, LinkTabNavBarComponent],
|
||||
imports: [
|
||||
InstitutionOverviewComponent,
|
||||
LinkTabNavBarComponent,
|
||||
MatTabsModule,
|
||||
RouterModule,
|
||||
],
|
||||
templateUrl: './institution.component.html',
|
||||
styleUrl: './institution.component.scss',
|
||||
})
|
||||
|
||||
@@ -33,33 +33,35 @@
|
||||
}
|
||||
</mat-card-content>
|
||||
|
||||
<mat-divider />
|
||||
@if (this.rawOaAuthorId()) {
|
||||
<mat-divider />
|
||||
|
||||
<mat-card-footer>
|
||||
<mat-card-actions class="card-actions">
|
||||
<a
|
||||
class="card-action"
|
||||
[routerLink]="['/person', this.rawOaAuthorId()]"
|
||||
matButton="outlined">
|
||||
<mat-icon>{{ INFO_ICON }}</mat-icon>
|
||||
Übersicht
|
||||
</a>
|
||||
<a
|
||||
class="card-action"
|
||||
[routerLink]="['/person', this.rawOaAuthorId(), 'publications']"
|
||||
matButton="outlined">
|
||||
<mat-icon>{{ PUBLICATION_ICON }}</mat-icon>
|
||||
Publikationen
|
||||
</a>
|
||||
@if (this.showProjects()) {
|
||||
<mat-card-footer>
|
||||
<mat-card-actions class="card-actions">
|
||||
<a
|
||||
class="card-action"
|
||||
[routerLink]="['/person', this.rawOaAuthorId(), 'projects']"
|
||||
[routerLink]="['/person', this.rawOaAuthorId()]"
|
||||
matButton="outlined">
|
||||
<mat-icon>{{ PROJECT_ICON }}</mat-icon>
|
||||
Projekte
|
||||
<mat-icon>{{ INFO_ICON }}</mat-icon>
|
||||
Übersicht
|
||||
</a>
|
||||
}
|
||||
</mat-card-actions>
|
||||
</mat-card-footer>
|
||||
<a
|
||||
class="card-action"
|
||||
[routerLink]="['/person', this.rawOaAuthorId(), 'publications']"
|
||||
matButton="outlined">
|
||||
<mat-icon>{{ PUBLICATION_ICON }}</mat-icon>
|
||||
Publikationen
|
||||
</a>
|
||||
@if (this.showProjects()) {
|
||||
<a
|
||||
class="card-action"
|
||||
[routerLink]="['/person', this.rawOaAuthorId(), 'projects']"
|
||||
matButton="outlined">
|
||||
<mat-icon>{{ PROJECT_ICON }}</mat-icon>
|
||||
Projekte
|
||||
</a>
|
||||
}
|
||||
</mat-card-actions>
|
||||
</mat-card-footer>
|
||||
}
|
||||
</mat-card>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
class="author-chip"
|
||||
[appComponentTooltip]="AuthorTooltipComponent"
|
||||
[tooltipInputs]="{ author: _author(), authorId: rawOaAuthorId() }"
|
||||
[tooltipDisabled]="isTooltipDisabled()"
|
||||
[tooltipMaxWidth]="'500px'"
|
||||
(keydown)="_onChipClick($event)"
|
||||
(click)="_onChipClick($event)">
|
||||
|
||||
@@ -54,6 +54,20 @@ export class AppAuthorChipComponent {
|
||||
size = input<'normal' | 'mini'>('normal');
|
||||
isMiniSize = computed(() => this.size() === 'mini');
|
||||
|
||||
tooltipDisabled = input<boolean>(false);
|
||||
hasValidAuthor = computed(() => {
|
||||
const rawId = this.rawOaAuthorId();
|
||||
return Boolean(
|
||||
rawId &&
|
||||
rawId.trim().length > 0 &&
|
||||
rawId !== 'undefined' &&
|
||||
rawId !== 'null',
|
||||
);
|
||||
});
|
||||
isTooltipDisabled = computed(() => {
|
||||
return this.tooltipDisabled() || !this.hasValidAuthor();
|
||||
});
|
||||
|
||||
constructor() {
|
||||
effect(() => {
|
||||
const author = this.author();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@let author = this._author();
|
||||
|
||||
@if (author) {
|
||||
@if (author && hasValidId()) {
|
||||
<app-author-card [author]="author" />
|
||||
}
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
import { Component, effect, inject, input, signal } from '@angular/core';
|
||||
import {
|
||||
Component,
|
||||
computed,
|
||||
effect,
|
||||
inject,
|
||||
input,
|
||||
signal,
|
||||
} from '@angular/core';
|
||||
import { Author, AuthorsV2Service } from '../../../api';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
@@ -27,9 +34,16 @@ export class AppAuthorTooltipComponent {
|
||||
author = input<Author | null | undefined>(undefined);
|
||||
|
||||
_author = signal<Author | undefined>(undefined);
|
||||
|
||||
_isLoading = signal<boolean>(false);
|
||||
|
||||
hasValidId = computed(() => {
|
||||
const a = this._author();
|
||||
const id = this.authorId() ?? a?.id;
|
||||
return Boolean(
|
||||
id && id.trim().length > 0 && id !== 'undefined' && id !== 'null',
|
||||
);
|
||||
});
|
||||
|
||||
constructor() {
|
||||
effect(() => {
|
||||
const authorObj = this.author();
|
||||
|
||||
@@ -8,46 +8,76 @@
|
||||
">
|
||||
<mat-card-header>
|
||||
<mat-card-title>{{ displayName() }}</mat-card-title>
|
||||
<mat-card-subtitle class="city-country">
|
||||
{{ institution().geo?.city }},
|
||||
{{ institution().geo?.country }}
|
||||
@if (institution().geo?.country_code) {
|
||||
<app-country-flag
|
||||
[countryCode]="institution().geo?.country_code"
|
||||
[height]="10"
|
||||
[bordered]="false"
|
||||
style="margin-left: 6px" />
|
||||
}
|
||||
</mat-card-subtitle>
|
||||
@if (locationText()) {
|
||||
<mat-card-subtitle class="city-country">
|
||||
<span>{{ locationText() }}</span>
|
||||
@if (countryCode()) {
|
||||
<app-country-flag
|
||||
[countryCode]="countryCode()!"
|
||||
[height]="10"
|
||||
[bordered]="false"
|
||||
style="margin-left: 6px" />
|
||||
}
|
||||
</mat-card-subtitle>
|
||||
}
|
||||
</mat-card-header>
|
||||
|
||||
<mat-divider />
|
||||
|
||||
<mat-card-content class="metrics">
|
||||
<div class="metric-item">
|
||||
<mat-icon>{{ PUBLICATION_ICON }}</mat-icon>
|
||||
<span
|
||||
>{{
|
||||
institution().works_count | number: undefined : 'de'
|
||||
}}
|
||||
Publikationen</span
|
||||
>
|
||||
</div>
|
||||
<div class="metric-item">
|
||||
<mat-icon>{{ CITATION_ICON }}</mat-icon>
|
||||
<span
|
||||
>{{
|
||||
institution().cited_by_count | number: undefined : 'de'
|
||||
}}
|
||||
Zitationen</span
|
||||
>
|
||||
</div>
|
||||
@if (
|
||||
institution().works_count !== null &&
|
||||
institution().works_count !== undefined
|
||||
) {
|
||||
<div class="metric-item">
|
||||
<mat-icon>{{ PUBLICATION_ICON }}</mat-icon>
|
||||
<span
|
||||
>{{
|
||||
institution().works_count | number: undefined : 'de'
|
||||
}}
|
||||
Publikationen</span
|
||||
>
|
||||
</div>
|
||||
}
|
||||
@if (
|
||||
institution().cited_by_count !== null &&
|
||||
institution().cited_by_count !== undefined
|
||||
) {
|
||||
<div class="metric-item">
|
||||
<mat-icon>{{ CITATION_ICON }}</mat-icon>
|
||||
<span
|
||||
>{{
|
||||
institution().cited_by_count | number: undefined : 'de'
|
||||
}}
|
||||
Zitationen</span
|
||||
>
|
||||
</div>
|
||||
}
|
||||
@if (
|
||||
institution().summary_stats?.h_index !== null &&
|
||||
institution().summary_stats?.h_index !== undefined
|
||||
) {
|
||||
<div class="metric-item">
|
||||
<mat-icon>{{ TRENDING_UP_ICON }}</mat-icon>
|
||||
<span>h-Index: {{ institution().summary_stats?.h_index }}</span>
|
||||
</div>
|
||||
}
|
||||
</mat-card-content>
|
||||
|
||||
<mat-divider />
|
||||
|
||||
<mat-card-footer>
|
||||
<mat-card-actions class="card-actions">
|
||||
@if (institution().id) {
|
||||
<a
|
||||
class="card-action"
|
||||
[routerLink]="['/institution', stripOpenAlexId(institution().id)]"
|
||||
matButton="outlined"
|
||||
(click)="$event.stopPropagation()">
|
||||
<mat-icon>{{ INFO_ICON }}</mat-icon>
|
||||
Übersicht
|
||||
</a>
|
||||
}
|
||||
<a
|
||||
class="card-action"
|
||||
[routerLink]="[
|
||||
|
||||
@@ -18,8 +18,10 @@ import { CountryFlagComponent } from '../country-flag/country-flag.component';
|
||||
|
||||
import {
|
||||
CITATION_ICON,
|
||||
INFO_ICON,
|
||||
PROJECT_ICON,
|
||||
PUBLICATION_ICON,
|
||||
TRENDING_UP_ICON,
|
||||
VERIFIED_ICON,
|
||||
} from '../icons';
|
||||
|
||||
@@ -42,6 +44,8 @@ export class AppInstitutionCardComponent {
|
||||
readonly CITATION_ICON = CITATION_ICON;
|
||||
readonly PROJECT_ICON = PROJECT_ICON;
|
||||
readonly VERIFIED_ICON = VERIFIED_ICON;
|
||||
readonly INFO_ICON = INFO_ICON;
|
||||
readonly TRENDING_UP_ICON = TRENDING_UP_ICON;
|
||||
|
||||
private readonly authService = inject(AuthService);
|
||||
private readonly patentsApi = inject(PatentsService);
|
||||
@@ -58,6 +62,21 @@ export class AppInstitutionCardComponent {
|
||||
return 'Unbekannte Institution';
|
||||
});
|
||||
|
||||
locationText = computed(() => {
|
||||
const geo = this.institution().geo;
|
||||
if (!geo) return null;
|
||||
const parts = [geo.city, geo.country].filter(Boolean);
|
||||
return parts.length > 0 ? parts.join(', ') : null;
|
||||
});
|
||||
|
||||
countryCode = computed(() => {
|
||||
return (
|
||||
this.institution().geo?.country_code ??
|
||||
this.institution().country_code ??
|
||||
null
|
||||
);
|
||||
});
|
||||
|
||||
private readonly isOwnInstitutionSignal = signal(false);
|
||||
isOwnInstitution = this.isOwnInstitutionSignal.asReadonly();
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
institution: _institution(),
|
||||
institutionId: rawOaInstitutionId(),
|
||||
}"
|
||||
[tooltipDisabled]="isTooltipDisabled()"
|
||||
[tooltipMaxWidth]="'500px'"
|
||||
(keydown)="_onChipClick($event)"
|
||||
(click)="_onChipClick($event)">
|
||||
|
||||
@@ -7,11 +7,16 @@ import {
|
||||
output,
|
||||
signal,
|
||||
} from '@angular/core';
|
||||
import { Institution, InstitutionsV2Service } from '../../../api';
|
||||
import {
|
||||
DehydratedInstitution,
|
||||
Institution,
|
||||
InstitutionsV2Service,
|
||||
} from '../../../api';
|
||||
import { AppInstitutionTooltipComponent } from '../app-institution-tooltip/app-institution-tooltip.component';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatChipsModule } from '@angular/material/chips';
|
||||
import { ComponentTooltipDirective } from '../../../directives/component-tooltip.directive';
|
||||
import { INSTITUTION_ICON } from '../icons';
|
||||
|
||||
@Component({
|
||||
host: {
|
||||
@@ -33,22 +38,40 @@ export class AppInstitutionChipComponent {
|
||||
isSelected = input<boolean>(false);
|
||||
|
||||
isClickable = input<boolean>(false);
|
||||
handleChipClick = output<Institution>();
|
||||
handleChipClick = output<Institution | DehydratedInstitution>();
|
||||
|
||||
showIcon = input<boolean>(false);
|
||||
icon = input<string>('apartment');
|
||||
icon = input<string>(INSTITUTION_ICON);
|
||||
|
||||
institution = input<Institution | undefined>(undefined);
|
||||
institution = input<Institution | DehydratedInstitution | undefined>(
|
||||
undefined,
|
||||
);
|
||||
rawOaInstitutionId = computed(() => {
|
||||
return this.stripOpenAlexId(this.institution()?.id);
|
||||
});
|
||||
institutionId = input<string | undefined>(undefined);
|
||||
|
||||
_institution = signal<Institution | undefined>(undefined);
|
||||
_institution = signal<Institution | DehydratedInstitution | undefined>(
|
||||
undefined,
|
||||
);
|
||||
|
||||
size = input<'normal' | 'mini'>('normal');
|
||||
isMiniSize = computed(() => this.size() === 'mini');
|
||||
|
||||
tooltipDisabled = input<boolean>(false);
|
||||
hasValidInstitution = computed(() => {
|
||||
const rawId = this.rawOaInstitutionId() ?? this.institutionId();
|
||||
return Boolean(
|
||||
rawId &&
|
||||
rawId.trim().length > 0 &&
|
||||
rawId !== 'undefined' &&
|
||||
rawId !== 'null',
|
||||
);
|
||||
});
|
||||
isTooltipDisabled = computed(() => {
|
||||
return this.tooltipDisabled() || !this.hasValidInstitution();
|
||||
});
|
||||
|
||||
constructor() {
|
||||
effect(() => {
|
||||
const institution = this.institution();
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
@let institution = this._institution();
|
||||
|
||||
@if (institution) {
|
||||
@if (institution && hasValidId()) {
|
||||
<app-institution-card [institution]="institution" />
|
||||
}
|
||||
|
||||
+42
-10
@@ -1,5 +1,16 @@
|
||||
import { Component, effect, inject, input, signal } from '@angular/core';
|
||||
import { Institution, InstitutionsV2Service } from '../../../api';
|
||||
import {
|
||||
Component,
|
||||
computed,
|
||||
effect,
|
||||
inject,
|
||||
input,
|
||||
signal,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
DehydratedInstitution,
|
||||
Institution,
|
||||
InstitutionsV2Service,
|
||||
} from '../../../api';
|
||||
import { AppInstitutionCardComponent } from '../app-institution-card/app-institution-card.component';
|
||||
|
||||
@Component({
|
||||
@@ -12,24 +23,42 @@ export class AppInstitutionTooltipComponent {
|
||||
private readonly institutionsService = inject(InstitutionsV2Service);
|
||||
|
||||
institutionId = input<string | null | undefined>(undefined);
|
||||
institution = input<Institution | null | undefined>(undefined);
|
||||
institution = input<Institution | DehydratedInstitution | null | undefined>(
|
||||
undefined,
|
||||
);
|
||||
|
||||
_institution = signal<Institution | undefined>(undefined);
|
||||
|
||||
_isLoading = signal<boolean>(false);
|
||||
|
||||
hasValidId = computed(() => {
|
||||
const inst = this._institution();
|
||||
const id = this.institutionId() ?? inst?.id;
|
||||
return Boolean(
|
||||
id && id.trim().length > 0 && id !== 'undefined' && id !== 'null',
|
||||
);
|
||||
});
|
||||
|
||||
constructor() {
|
||||
effect(() => {
|
||||
const institutionObj = this.institution();
|
||||
const institutionId = this.institutionId() ?? institutionObj?.id;
|
||||
|
||||
if (institutionObj) {
|
||||
this._institution.set(institutionObj);
|
||||
this._isLoading.set(false);
|
||||
}
|
||||
const hasCompleteMetrics = Boolean(
|
||||
institutionObj &&
|
||||
(institutionObj as Institution).works_count !== undefined &&
|
||||
(institutionObj as Institution).works_count !== null &&
|
||||
(institutionObj as Institution).cited_by_count !== undefined &&
|
||||
(institutionObj as Institution).cited_by_count !== null,
|
||||
);
|
||||
|
||||
if (institutionId) {
|
||||
if (hasCompleteMetrics && institutionObj) {
|
||||
this._institution.set(institutionObj as Institution);
|
||||
this._isLoading.set(false);
|
||||
} else if (institutionId) {
|
||||
const cleanId = institutionId.replace('https://openalex.org/', '');
|
||||
if (institutionObj) {
|
||||
this._institution.set(institutionObj as Institution);
|
||||
}
|
||||
this._isLoading.set(true);
|
||||
this.institutionsService.getInstitutionById2(cleanId).subscribe({
|
||||
next: (fetchedInst) => {
|
||||
@@ -43,7 +72,10 @@ export class AppInstitutionTooltipComponent {
|
||||
this._isLoading.set(false);
|
||||
},
|
||||
});
|
||||
} else if (!institutionObj) {
|
||||
} else if (institutionObj) {
|
||||
this._institution.set(institutionObj as Institution);
|
||||
this._isLoading.set(false);
|
||||
} else {
|
||||
this._institution.set(undefined);
|
||||
this._isLoading.set(false);
|
||||
}
|
||||
|
||||
+27
-10
@@ -11,23 +11,40 @@ import { AppPublicationCardComponent } from '../app-publication-card/app-publica
|
||||
export class AppPublicationTooltipComponent {
|
||||
private readonly worksService = inject(WorksV2Service);
|
||||
|
||||
workId = input.required<string>();
|
||||
workId = input<string | null | undefined>(undefined);
|
||||
work = input<Work | null | undefined>(undefined);
|
||||
|
||||
_work = signal<Work | undefined>(undefined);
|
||||
|
||||
_isLoading = signal<boolean>(false);
|
||||
|
||||
constructor() {
|
||||
effect(() => {
|
||||
const workId = this.workId();
|
||||
if (!workId) {
|
||||
this._work.set(undefined);
|
||||
}
|
||||
this._isLoading.set(true);
|
||||
this.worksService.getWorkById(workId).subscribe((work) => {
|
||||
this._work.set(work);
|
||||
const workObj = this.work();
|
||||
const workId = this.workId() ?? workObj?.id;
|
||||
|
||||
if (workObj) {
|
||||
this._work.set(workObj);
|
||||
this._isLoading.set(false);
|
||||
});
|
||||
}
|
||||
|
||||
if (workId) {
|
||||
this._isLoading.set(true);
|
||||
this.worksService.getWorkById(workId).subscribe({
|
||||
next: (fetchedWork) => {
|
||||
this._work.set({
|
||||
...workObj,
|
||||
...fetchedWork,
|
||||
});
|
||||
this._isLoading.set(false);
|
||||
},
|
||||
error: () => {
|
||||
this._isLoading.set(false);
|
||||
},
|
||||
});
|
||||
} else if (!workObj) {
|
||||
this._work.set(undefined);
|
||||
this._isLoading.set(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,31 +1,35 @@
|
||||
// ============================================================================
|
||||
// 1. Core Domain & Entity Icons
|
||||
// ============================================================================
|
||||
export const ACCOUNT_BALANCE_ICON = 'account_balance' as const;
|
||||
export const ACCOUNT_CIRCLE_ICON = 'account_circle' as const;
|
||||
|
||||
export const BOOKMARK_ICON = 'bookmark' as const;
|
||||
export const BOOKMARKS_ICON = 'bookmarks' as const;
|
||||
export const COMPANY_CONNECTION_ICON = 'business' as const;
|
||||
export const DASHBOARD_ICON = 'dashboard' as const;
|
||||
export const FUNDING_ICON = 'account_balance' as const;
|
||||
export const GROUPS_ICON = 'groups' as const;
|
||||
export const INSTITUTION_ICON = 'school' as const;
|
||||
export const INSTITUTION_ICON = 'apartment' as const; //was 'school'
|
||||
export const JOBS_ICON = 'sync' as const;
|
||||
export const KEYWORDS_ICON = 'join_left' as const;
|
||||
export const NEWS_ICON = 'newspaper' as const;
|
||||
export const NO_ACCOUNTS_ICON = 'no_accounts' as const;
|
||||
export const ORGANIZATIONS_ICON = 'domain' as const;
|
||||
export const OVERVIEW_ICON = 'visibility' as const;
|
||||
export const PATENT_ICON = 'workspace_premium' as const;
|
||||
export const PERSON_CHECK_ICON = 'person_check' as const;
|
||||
export const PERSON_CHECK_ICON = 'person_check' as const; // person check and person look the same to me
|
||||
export const PERSON_ICON = 'person' as const;
|
||||
export const PERSON_OFF_ICON = 'person_off' as const;
|
||||
export const PERSONS_ICON = 'groups' as const;
|
||||
export const GROUPS_ICON = PERSONS_ICON; // TODO
|
||||
export const PROJECT_ICON = 'work' as const;
|
||||
export const PUBLICATION_ICON = 'menu_book' as const;
|
||||
export const MENU_BOOK_ICON = 'menu_book' as const;
|
||||
export const MENU_BOOK_ICON = PUBLICATION_ICON; // TODO
|
||||
export const TOPIC_ICON = 'topic' as const;
|
||||
|
||||
export const OVERVIEW_ICON = 'visibility' as const;
|
||||
|
||||
export const NO_ACCOUNTS_ICON = 'no_accounts' as const;
|
||||
export const PERSON_OFF_ICON = 'person_off' as const; // person off and no accounts look similar
|
||||
|
||||
export const ACCOUNT_BALANCE_ICON = FUNDING_ICON; // TODO
|
||||
export const ACCOUNT_CIRCLE_ICON = 'account_circle' as const; //Person Icon in company-connections
|
||||
export const COMPANY_CONNECTION_ICON = 'business' as const;
|
||||
|
||||
// ============================================================================
|
||||
// 2. Navigation, Layout & Hierarchy Icons
|
||||
// ============================================================================
|
||||
@@ -44,7 +48,7 @@ export const MENU_ICON = 'menu' as const;
|
||||
export const NETWORK_ICON = 'share' as const;
|
||||
export const NORTH_EAST_ICON = 'north_east' as const;
|
||||
export const OPEN_IN_NEW_ICON = 'open_in_new' as const;
|
||||
export const SUBFIELD_ICON = 'folder_open' as const;
|
||||
|
||||
export const UNFOLD_LESS_ICON = 'unfold_less' as const;
|
||||
export const UNFOLD_MORE_ICON = 'unfold_more' as const;
|
||||
|
||||
@@ -94,15 +98,15 @@ export const TUNE_ICON = 'tune' as const;
|
||||
// ============================================================================
|
||||
export const BOOKMARK_BORDER_ICON = 'bookmark_border' as const;
|
||||
export const CHECK_ICON = 'check' as const;
|
||||
export const CHECK_CIRCLE_ICON = 'check_circle' as const;
|
||||
export const CHECK_CIRCLE_ICON = 'check_circle' as const; // similar to check but with circle
|
||||
export const CIRCLE_ICON = 'circle' as const;
|
||||
export const CLOUD_OFF_ICON = 'cloud_off' as const;
|
||||
export const ERROR_ICON = 'error' as const;
|
||||
export const ERROR_OUTLINE_ICON = 'error_outline' as const;
|
||||
export const FACT_CHECK_ICON = 'fact_check' as const;
|
||||
export const HELP_ICON = 'help' as const;
|
||||
export const HELP_ICON = 'help' as const; // same as info but with question mark
|
||||
export const INFO_ICON = 'info' as const;
|
||||
export const INFO_OUTLINE_ICON = 'info_outline' as const;
|
||||
export const INFO_OUTLINE_ICON = 'info_outline' as const; // same as info but inverted
|
||||
export const RULE_ICON = 'rule' as const;
|
||||
export const STAR_ICON = 'star' as const;
|
||||
export const VERIFIED_ICON = 'verified' as const;
|
||||
@@ -135,7 +139,7 @@ export const TRENDING_UP_ICON = 'trending_up' as const;
|
||||
// 7. Other
|
||||
// ============================================================================
|
||||
export const APARTMENT_ICON = 'apartment' as const;
|
||||
export const ARTICLE_ICON = 'article' as const;
|
||||
export const ARTICLE_ICON = PUBLICATION_ICON; // was 'article' (TODO change in some components like dashboard)
|
||||
export const ASSIGNMENT_ICON = 'assignment' as const;
|
||||
export const ATTACH_MONEY_ICON = 'attach_money' as const;
|
||||
export const BIOTECH_ICON = 'biotech' as const;
|
||||
@@ -154,17 +158,17 @@ export const EURO_ICON = 'euro_symbol' as const;
|
||||
export const FILE_PRESENT_ICON = 'file_present' as const;
|
||||
export const FLAG_ICON = 'flag' as const;
|
||||
export const GAVEL_ICON = 'gavel' as const;
|
||||
export const GROUP_ICON = 'group' as const;
|
||||
export const GROUP_ICON = PERSONS_ICON; //TODO (was 'group')
|
||||
export const IMAGE_ICON = 'image' as const;
|
||||
export const INSERT_DRIVE_FILE_ICON = 'insert_drive_file' as const;
|
||||
export const INTERESTS_ICON = 'interests' as const;
|
||||
export const LABEL_ICON = 'label' as const;
|
||||
export const INTERESTS_ICON = KEYWORDS_ICON; // was 'interests'
|
||||
export const LABEL_ICON = TOPIC_ICON; //TODO
|
||||
export const LANGUAGE_ICON = 'language' as const;
|
||||
export const LIBRARY_BOOKS_ICON = 'library_books' as const;
|
||||
export const LOCATION_ICON = 'location_on' as const;
|
||||
export const MORE_INFO_ICON = 'more_info' as const;
|
||||
export const PAID_ICON = 'paid' as const;
|
||||
export const PEOPLE_ICON = 'people' as const;
|
||||
export const PEOPLE_ICON = PERSONS_ICON; //TODO (was 'people')
|
||||
export const PICTURE_AS_PDF_ICON = 'picture_as_pdf' as const;
|
||||
export const PUBLIC_ICON = 'public' as const;
|
||||
export const SCIENCE_ICON = 'science' as const;
|
||||
@@ -173,5 +177,7 @@ export const TAG_ICON = 'tag' as const;
|
||||
export const TEXT_FIELDS_ICON = 'text_fields' as const;
|
||||
export const TRANSLATE_ICON = 'translate' as const;
|
||||
export const VOLUNTEER_ACTIVISM_ICON = 'volunteer_activism' as const;
|
||||
export const WORK_ICON = 'work' as const;
|
||||
export const SCHOOL_ICON = 'school' as const;
|
||||
export const LOCAL_HOSPITAL_ICON = 'local_hospital' as const;
|
||||
export const WORK_ICON = PROJECT_ICON; // TODO
|
||||
export const WORK_OUTLINE_ICON = 'work_outline' as const;
|
||||
|
||||
@@ -5,9 +5,7 @@
|
||||
[routerLink]="link.path"
|
||||
[queryParams]="link.queryParams"
|
||||
[queryParamsHandling]="link.queryParamsHandling"
|
||||
routerLinkActive
|
||||
#rla="routerLinkActive"
|
||||
[active]="rla.isActive"
|
||||
[active]="activeLink() === link"
|
||||
[disabled]="link.disabled">
|
||||
<div class="link-tab-nav-bar-item">
|
||||
@if (link.icon) {
|
||||
|
||||
Reference in New Issue
Block a user