Compare commits
35
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8be0ae8aa | ||
|
|
17e0909d69 | ||
|
|
3aa4c478f6 | ||
|
|
9ef9e334fd | ||
|
|
a40aca3dbe | ||
|
|
95662119b1 | ||
|
|
5b59aca4e6 | ||
|
|
83c809983c | ||
|
|
f5cd79a718 | ||
|
|
81b7e04b66 | ||
|
|
25cf39ff69 | ||
|
|
9a6bae2df4 | ||
|
|
6eb159cc03 | ||
|
|
6b7a036128 | ||
|
|
da70af9163 | ||
|
|
09e5af0016 | ||
|
|
203d9cb6d4 | ||
|
|
dde38bb680 | ||
|
|
6e7a8237ef | ||
|
|
c8e5a65f5d | ||
|
|
a6c4668d13 | ||
|
|
dbe8f2449a | ||
|
|
9c593a0d09 | ||
|
|
df5f131320 | ||
|
|
2f22240d94 | ||
|
|
77095c8549 | ||
|
|
c733442300 | ||
|
|
8d7323a387 | ||
|
|
6a6ec8662c | ||
|
|
c70e6bf489 | ||
|
|
82fa2e816b | ||
|
|
fbcee778d2 | ||
|
|
1758227f1e | ||
|
|
545f38bc3d | ||
|
|
c8fa70e7f0 |
@@ -213,6 +213,7 @@ async def change_password(
|
|||||||
operation_id="canFetchGdprRelevantData",
|
operation_id="canFetchGdprRelevantData",
|
||||||
)
|
)
|
||||||
async def can_fetch_gdpr_relevant_data(
|
async def can_fetch_gdpr_relevant_data(
|
||||||
|
session: SessionDep,
|
||||||
access_token: Annotated[
|
access_token: Annotated[
|
||||||
AccessTokenMetadata,
|
AccessTokenMetadata,
|
||||||
auth_service.CurrentUserAccessTokenPayloadDep,
|
auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
@@ -227,6 +228,7 @@ async def can_fetch_gdpr_relevant_data(
|
|||||||
] = None,
|
] = None,
|
||||||
) -> bool:
|
) -> bool:
|
||||||
return await auth_service.can_fetch_gdpr_relevant_data(
|
return await auth_service.can_fetch_gdpr_relevant_data(
|
||||||
|
session=session,
|
||||||
access_token=access_token,
|
access_token=access_token,
|
||||||
raw_oa_author_id=raw_oa_author_id,
|
raw_oa_author_id=raw_oa_author_id,
|
||||||
raw_oa_institution_id=raw_oa_institution_id,
|
raw_oa_institution_id=raw_oa_institution_id,
|
||||||
|
|||||||
@@ -1467,6 +1467,7 @@ def change_password(
|
|||||||
|
|
||||||
|
|
||||||
async def can_fetch_gdpr_relevant_data(
|
async def can_fetch_gdpr_relevant_data(
|
||||||
|
session: Session,
|
||||||
access_token: AccessTokenMetadata,
|
access_token: AccessTokenMetadata,
|
||||||
raw_oa_author_id: str | None = None,
|
raw_oa_author_id: str | None = None,
|
||||||
raw_oa_institution_id: str | None = None,
|
raw_oa_institution_id: str | None = None,
|
||||||
@@ -1493,40 +1494,71 @@ async def can_fetch_gdpr_relevant_data(
|
|||||||
logger.debug("No OpenAlex author ID or institution ID provided")
|
logger.debug("No OpenAlex author ID or institution ID provided")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
effective_institution_id = access_token.effective_institution_id
|
institution_ids = list(
|
||||||
# Current user does not belong to any institution
|
session.exec(
|
||||||
if not effective_institution_id:
|
select(OrganizationInstitution.openalex_institution_id)
|
||||||
|
.where(
|
||||||
|
OrganizationInstitution.organization_id
|
||||||
|
== access_token.effective_organization_id
|
||||||
|
)
|
||||||
|
.order_by(OrganizationInstitution.position)
|
||||||
|
).all()
|
||||||
|
)
|
||||||
|
if not institution_ids and access_token.effective_institution_id:
|
||||||
|
institution_ids = [access_token.effective_institution_id]
|
||||||
|
|
||||||
|
if not institution_ids:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"Current user does not belong to any institution, cannot fetch GDPR-relevant data"
|
"Current user does not belong to any institution, cannot fetch GDPR-relevant data"
|
||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Current user belongs to an institution, but the request is for a different institution
|
from inse.organization_management import service as organization_service
|
||||||
|
|
||||||
|
association_groups = await organization_service.resolve_institution_associations(
|
||||||
|
institution_ids
|
||||||
|
)
|
||||||
|
organization_institution_ids = set(institution_ids)
|
||||||
|
for group in association_groups:
|
||||||
|
organization_institution_ids.add(group.id.rstrip("/").split("/")[-1])
|
||||||
|
organization_institution_ids.update(
|
||||||
|
association.id.rstrip("/").split("/")[-1]
|
||||||
|
for association in group.associated_institutions
|
||||||
|
)
|
||||||
|
|
||||||
|
requested_institution_id = (
|
||||||
|
raw_oa_institution_id.rstrip("/").split("/")[-1]
|
||||||
|
if raw_oa_institution_id
|
||||||
|
else None
|
||||||
|
)
|
||||||
if (
|
if (
|
||||||
raw_oa_institution_id
|
requested_institution_id
|
||||||
and effective_institution_id
|
and requested_institution_id not in organization_institution_ids
|
||||||
and raw_oa_institution_id != effective_institution_id
|
|
||||||
):
|
):
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"Current user belongs to institution %s, but request is for institution %s, cannot fetch GDPR-relevant data",
|
"Current user belongs to institution %s, but request is for institution %s, cannot fetch GDPR-relevant data",
|
||||||
effective_institution_id,
|
organization_institution_ids,
|
||||||
raw_oa_institution_id,
|
requested_institution_id,
|
||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Current user belongs to an institution, but request is for author not belonging to that institution
|
# Current user belongs to an institution, but request is for author not belonging to that institution
|
||||||
if raw_oa_author_id:
|
if raw_oa_author_id:
|
||||||
author_belongs_to_institution = (
|
for institution_id in organization_institution_ids:
|
||||||
await authors_service.author_currently_belongs_to_institution(
|
if await authors_service.author_currently_belongs_to_institution(
|
||||||
raw_oa_author_id or "", effective_institution_id
|
raw_oa_author_id, institution_id
|
||||||
)
|
):
|
||||||
)
|
logger.debug(
|
||||||
|
"Author %s belongs to organization institution %s",
|
||||||
|
raw_oa_author_id,
|
||||||
|
institution_id,
|
||||||
|
)
|
||||||
|
return True
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"Author %s belongs to institution %s: %s",
|
"Author %s does not belong to any organization institution %s",
|
||||||
raw_oa_author_id,
|
raw_oa_author_id,
|
||||||
effective_institution_id,
|
organization_institution_ids,
|
||||||
author_belongs_to_institution,
|
|
||||||
)
|
)
|
||||||
return author_belongs_to_institution
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import datetime as _dt
|
import datetime as _dt
|
||||||
import uuid
|
import uuid
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
from unittest.mock import AsyncMock, patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from fastapi import HTTPException, Response
|
from fastapi import HTTPException, Response
|
||||||
@@ -14,11 +15,16 @@ from inse.auth.model import (
|
|||||||
Account,
|
Account,
|
||||||
IdTokenMetadata,
|
IdTokenMetadata,
|
||||||
Organization,
|
Organization,
|
||||||
|
OrganizationInstitution,
|
||||||
RefreshTokenMetadata,
|
RefreshTokenMetadata,
|
||||||
Secret,
|
Secret,
|
||||||
SecretPurpose,
|
SecretPurpose,
|
||||||
UserRole,
|
UserRole,
|
||||||
)
|
)
|
||||||
|
from inse.organization_management.model import (
|
||||||
|
InstitutionAssociation,
|
||||||
|
InstitutionAssociationsResponse,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture()
|
@pytest.fixture()
|
||||||
@@ -81,6 +87,74 @@ def test_hash_and_verify_password():
|
|||||||
assert auth_service._verify_password("wrong", h) is False
|
assert auth_service._verify_password("wrong", h) is False
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.anyio
|
||||||
|
async def test_gdpr_access_allows_every_organization_institution(in_memory_session):
|
||||||
|
org, account = create_org_and_account(
|
||||||
|
in_memory_session, "multi-institution@example.com", "pw"
|
||||||
|
)
|
||||||
|
in_memory_session.add_all(
|
||||||
|
[
|
||||||
|
OrganizationInstitution(
|
||||||
|
organization_id=org.id,
|
||||||
|
openalex_institution_id="I111",
|
||||||
|
position=0,
|
||||||
|
),
|
||||||
|
OrganizationInstitution(
|
||||||
|
organization_id=org.id,
|
||||||
|
openalex_institution_id="I222",
|
||||||
|
position=1,
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
in_memory_session.commit()
|
||||||
|
token = AccessTokenMetadata(
|
||||||
|
real_account_id=account.id,
|
||||||
|
expires_at=_dt.datetime.now(_dt.UTC) + timedelta(hours=1),
|
||||||
|
user_fingerprint_hash="fingerprint",
|
||||||
|
effective_account_id=account.id,
|
||||||
|
effective_organization_id=org.id,
|
||||||
|
effective_institution_id="I111",
|
||||||
|
)
|
||||||
|
|
||||||
|
associations = [
|
||||||
|
InstitutionAssociationsResponse(
|
||||||
|
id="I111",
|
||||||
|
display_name="Root institution",
|
||||||
|
associated_institutions=[
|
||||||
|
InstitutionAssociation(
|
||||||
|
id="I333",
|
||||||
|
display_name="Child institution",
|
||||||
|
relationship="child",
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
InstitutionAssociationsResponse(
|
||||||
|
id="I222",
|
||||||
|
display_name="Second institution",
|
||||||
|
associated_institutions=[],
|
||||||
|
),
|
||||||
|
]
|
||||||
|
with patch(
|
||||||
|
"inse.organization_management.service.resolve_institution_associations",
|
||||||
|
new=AsyncMock(return_value=associations),
|
||||||
|
):
|
||||||
|
assert await auth_service.can_fetch_gdpr_relevant_data(
|
||||||
|
session=in_memory_session,
|
||||||
|
access_token=token,
|
||||||
|
raw_oa_institution_id="https://openalex.org/I222",
|
||||||
|
)
|
||||||
|
assert await auth_service.can_fetch_gdpr_relevant_data(
|
||||||
|
session=in_memory_session,
|
||||||
|
access_token=token,
|
||||||
|
raw_oa_institution_id="I333",
|
||||||
|
)
|
||||||
|
assert not await auth_service.can_fetch_gdpr_relevant_data(
|
||||||
|
session=in_memory_session,
|
||||||
|
access_token=token,
|
||||||
|
raw_oa_institution_id="I444",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_request_otk_and_login_flow(in_memory_session, settings_backup):
|
def test_request_otk_and_login_flow(in_memory_session, settings_backup):
|
||||||
config_module.settings.token_hmac_key = "test-hmac-key"
|
config_module.settings.token_hmac_key = "test-hmac-key"
|
||||||
config_module.settings.token_issuer_id = "test-issuer"
|
config_module.settings.token_issuer_id = "test-issuer"
|
||||||
@@ -113,7 +187,9 @@ def test_request_otk_and_login_flow(in_memory_session, settings_backup):
|
|||||||
assert login_result.id_token.real_account_id == acc.id
|
assert login_result.id_token.real_account_id == acc.id
|
||||||
|
|
||||||
raw_id_token = _get_cookie_value(response, auth_service.ID_TOKEN_COOKIE_KEY)
|
raw_id_token = _get_cookie_value(response, auth_service.ID_TOKEN_COOKIE_KEY)
|
||||||
payload = auth_service._verify_id_token(raw_id_token=raw_id_token, session=in_memory_session)
|
payload = auth_service._verify_id_token(
|
||||||
|
raw_id_token=raw_id_token, session=in_memory_session
|
||||||
|
)
|
||||||
assert payload[auth_service.REAL_ACCOUNT_ID_KEY] == str(acc.id)
|
assert payload[auth_service.REAL_ACCOUNT_ID_KEY] == str(acc.id)
|
||||||
|
|
||||||
|
|
||||||
@@ -175,7 +251,9 @@ def test_access_and_refresh_token_flow(in_memory_session, settings_backup):
|
|||||||
)
|
)
|
||||||
assert isinstance(access_response.access_token, AccessTokenMetadata)
|
assert isinstance(access_response.access_token, AccessTokenMetadata)
|
||||||
|
|
||||||
raw_refresh_token = _get_cookie_value(response, auth_service.REFRESH_TOKEN_COOKIE_KEY)
|
raw_refresh_token = _get_cookie_value(
|
||||||
|
response, auth_service.REFRESH_TOKEN_COOKIE_KEY
|
||||||
|
)
|
||||||
refresh_payload = auth_service._verify_refresh_token(
|
refresh_payload = auth_service._verify_refresh_token(
|
||||||
raw_refresh_token=raw_refresh_token,
|
raw_refresh_token=raw_refresh_token,
|
||||||
session=in_memory_session,
|
session=in_memory_session,
|
||||||
@@ -185,9 +263,7 @@ def test_access_and_refresh_token_flow(in_memory_session, settings_backup):
|
|||||||
effective_account_id=uuid.UUID(
|
effective_account_id=uuid.UUID(
|
||||||
refresh_payload[auth_service.EFFECTIVE_ACCOUNT_ID_KEY]
|
refresh_payload[auth_service.EFFECTIVE_ACCOUNT_ID_KEY]
|
||||||
),
|
),
|
||||||
expires_at=_dt.datetime.fromtimestamp(
|
expires_at=_dt.datetime.fromtimestamp(refresh_payload["exp"], tz=_dt.UTC),
|
||||||
refresh_payload["exp"], tz=_dt.UTC
|
|
||||||
),
|
|
||||||
epoch=refresh_payload[auth_service.EPOCH_KEY],
|
epoch=refresh_payload[auth_service.EPOCH_KEY],
|
||||||
effective_role=UserRole(refresh_payload[auth_service.EFFECTIVE_ROLE_KEY]),
|
effective_role=UserRole(refresh_payload[auth_service.EFFECTIVE_ROLE_KEY]),
|
||||||
effective_organization_id=uuid.UUID(
|
effective_organization_id=uuid.UUID(
|
||||||
@@ -240,7 +316,9 @@ def test_access_and_refresh_token_preserve_multiple_roles(
|
|||||||
UserRole.USER.value,
|
UserRole.USER.value,
|
||||||
]
|
]
|
||||||
|
|
||||||
raw_refresh_token = _get_cookie_value(response, auth_service.REFRESH_TOKEN_COOKIE_KEY)
|
raw_refresh_token = _get_cookie_value(
|
||||||
|
response, auth_service.REFRESH_TOKEN_COOKIE_KEY
|
||||||
|
)
|
||||||
refresh_payload = auth_service._verify_refresh_token(
|
refresh_payload = auth_service._verify_refresh_token(
|
||||||
raw_refresh_token=raw_refresh_token,
|
raw_refresh_token=raw_refresh_token,
|
||||||
session=in_memory_session,
|
session=in_memory_session,
|
||||||
@@ -634,7 +712,6 @@ def test_get_account_epoch_not_found(in_memory_session):
|
|||||||
auth_service._get_account_epoch(in_memory_session, random_id)
|
auth_service._get_account_epoch(in_memory_session, random_id)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def test_request_password_reset_creates_secret(in_memory_session, settings_backup):
|
def test_request_password_reset_creates_secret(in_memory_session, settings_backup):
|
||||||
email = "reset@example.com"
|
email = "reset@example.com"
|
||||||
password = "oldpw123"
|
password = "oldpw123"
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
|
|
||||||
|
class DashboardInstitution(BaseModel):
|
||||||
|
id: str
|
||||||
|
display_name: str
|
||||||
|
|
||||||
|
|
||||||
class DashboardStatistics(BaseModel):
|
class DashboardStatistics(BaseModel):
|
||||||
institution_id: str
|
institution_id: str
|
||||||
organization_name: str
|
organization_name: str
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import asyncio
|
||||||
|
|
||||||
from inse.institutions.institutions_search_client import InstitutionsSearchClient
|
from inse.institutions.institutions_search_client import InstitutionsSearchClient
|
||||||
from inse.projects import service as projects_service
|
from inse.projects import service as projects_service
|
||||||
from inse.projects.model import EuCordisProjectType
|
from inse.projects.model import EuCordisProjectType
|
||||||
@@ -10,21 +12,53 @@ from .common import (
|
|||||||
from .model import DashboardStatisticValue
|
from .model import DashboardStatisticValue
|
||||||
|
|
||||||
|
|
||||||
|
def _institution_ids(value: str | list[str]) -> list[str]:
|
||||||
|
return value if isinstance(value, list) else [value]
|
||||||
|
|
||||||
|
|
||||||
|
def _scope_id(institution_ids: list[str]) -> str:
|
||||||
|
return (
|
||||||
|
_normalize_institution_id(institution_ids[0])
|
||||||
|
if len(institution_ids) == 1
|
||||||
|
else "all"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
async def _institution_aliases(institution_ids: list[str]) -> list[str]:
|
||||||
|
client = InstitutionsSearchClient()
|
||||||
|
aliases = await asyncio.gather(
|
||||||
|
*(
|
||||||
|
client.get_institution_aliases_by_oa_institution_id(
|
||||||
|
_raw_institution_id(institution_id)
|
||||||
|
)
|
||||||
|
for institution_id in institution_ids
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return list(dict.fromkeys(alias for group in aliases for alias in group))
|
||||||
|
|
||||||
|
|
||||||
async def get_dashboard_eu_projects(
|
async def get_dashboard_eu_projects(
|
||||||
institution_id: str,
|
institution_id: str | list[str],
|
||||||
organization_name: str,
|
organization_name: str,
|
||||||
from_year: int | None = None,
|
from_year: int | None = None,
|
||||||
to_year: int | None = None,
|
to_year: int | None = None,
|
||||||
) -> DashboardStatisticValue:
|
) -> DashboardStatisticValue:
|
||||||
normalized_id = _normalize_institution_id(institution_id)
|
institution_ids = _institution_ids(institution_id)
|
||||||
period = _dashboard_period(from_year, to_year)
|
period = _dashboard_period(from_year, to_year)
|
||||||
|
multiple_institutions = len(institution_ids) > 1
|
||||||
projects = await projects_service.search_eu_cordis_projects(
|
projects = await projects_service.search_eu_cordis_projects(
|
||||||
institutions_search_client=InstitutionsSearchClient(),
|
institutions_search_client=InstitutionsSearchClient(),
|
||||||
raw_oa_institution_id=_raw_institution_id(normalized_id),
|
raw_oa_institution_id=(
|
||||||
|
None if multiple_institutions else _raw_institution_id(institution_ids[0])
|
||||||
|
),
|
||||||
author_id=None,
|
author_id=None,
|
||||||
author_ids=None,
|
author_ids=None,
|
||||||
organization_ids=None,
|
organization_ids=None,
|
||||||
organization_names=None,
|
organization_names=(
|
||||||
|
await _institution_aliases(institution_ids)
|
||||||
|
if multiple_institutions
|
||||||
|
else None
|
||||||
|
),
|
||||||
project_types=list(EuCordisProjectType),
|
project_types=list(EuCordisProjectType),
|
||||||
keywords=None,
|
keywords=None,
|
||||||
topic_ids=None,
|
topic_ids=None,
|
||||||
@@ -45,24 +79,27 @@ async def get_dashboard_eu_projects(
|
|||||||
fuzzy=False,
|
fuzzy=False,
|
||||||
)
|
)
|
||||||
return DashboardStatisticValue(
|
return DashboardStatisticValue(
|
||||||
institution_id=normalized_id,
|
institution_id=_scope_id(institution_ids),
|
||||||
organization_name=organization_name,
|
organization_name=organization_name,
|
||||||
value=projects.total,
|
value=projects.total,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
async def get_dashboard_bmbf_projects(
|
async def get_dashboard_bmbf_projects(
|
||||||
institution_id: str,
|
institution_id: str | list[str],
|
||||||
organization_name: str,
|
organization_name: str,
|
||||||
from_year: int | None = None,
|
from_year: int | None = None,
|
||||||
to_year: int | None = None,
|
to_year: int | None = None,
|
||||||
) -> DashboardStatisticValue:
|
) -> DashboardStatisticValue:
|
||||||
normalized_id = _normalize_institution_id(institution_id)
|
institution_ids = _institution_ids(institution_id)
|
||||||
period = _dashboard_period(from_year, to_year)
|
period = _dashboard_period(from_year, to_year)
|
||||||
|
multiple_institutions = len(institution_ids) > 1
|
||||||
projects = await projects_service.search_bund_projects_with_filters(
|
projects = await projects_service.search_bund_projects_with_filters(
|
||||||
institutions_search_client=InstitutionsSearchClient(),
|
institutions_search_client=InstitutionsSearchClient(),
|
||||||
executing_agency=None,
|
executing_agency=None,
|
||||||
raw_oa_institution_id=_raw_institution_id(normalized_id),
|
raw_oa_institution_id=(
|
||||||
|
None if multiple_institutions else _raw_institution_id(institution_ids[0])
|
||||||
|
),
|
||||||
title=None,
|
title=None,
|
||||||
keywords=None,
|
keywords=None,
|
||||||
funding_arts=None,
|
funding_arts=None,
|
||||||
@@ -78,25 +115,33 @@ async def get_dashboard_bmbf_projects(
|
|||||||
sort_by="id",
|
sort_by="id",
|
||||||
sort_direction="asc",
|
sort_direction="asc",
|
||||||
fuzzy=False,
|
fuzzy=False,
|
||||||
|
oa_institution_aliases=(
|
||||||
|
await _institution_aliases(institution_ids)
|
||||||
|
if multiple_institutions
|
||||||
|
else None
|
||||||
|
),
|
||||||
)
|
)
|
||||||
return DashboardStatisticValue(
|
return DashboardStatisticValue(
|
||||||
institution_id=normalized_id,
|
institution_id=_scope_id(institution_ids),
|
||||||
organization_name=organization_name,
|
organization_name=organization_name,
|
||||||
value=projects.total,
|
value=projects.total,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
async def get_dashboard_dfg_projects(
|
async def get_dashboard_dfg_projects(
|
||||||
institution_id: str,
|
institution_id: str | list[str],
|
||||||
organization_name: str,
|
organization_name: str,
|
||||||
from_year: int | None = None,
|
from_year: int | None = None,
|
||||||
to_year: int | None = None,
|
to_year: int | None = None,
|
||||||
) -> DashboardStatisticValue:
|
) -> DashboardStatisticValue:
|
||||||
normalized_id = _normalize_institution_id(institution_id)
|
institution_ids = _institution_ids(institution_id)
|
||||||
period = _dashboard_period(from_year, to_year)
|
period = _dashboard_period(from_year, to_year)
|
||||||
|
multiple_institutions = len(institution_ids) > 1
|
||||||
projects = await projects_service.get_dfg_projects(
|
projects = await projects_service.get_dfg_projects(
|
||||||
institutions_search_client=InstitutionsSearchClient(),
|
institutions_search_client=InstitutionsSearchClient(),
|
||||||
raw_oa_institution_id=_raw_institution_id(normalized_id),
|
raw_oa_institution_id=(
|
||||||
|
None if multiple_institutions else _raw_institution_id(institution_ids[0])
|
||||||
|
),
|
||||||
author_id=None,
|
author_id=None,
|
||||||
author_filter_ids=None,
|
author_filter_ids=None,
|
||||||
institution_ids=None,
|
institution_ids=None,
|
||||||
@@ -114,9 +159,14 @@ async def get_dashboard_dfg_projects(
|
|||||||
sort_direction="asc",
|
sort_direction="asc",
|
||||||
fuzzy=False,
|
fuzzy=False,
|
||||||
skip_enrichment=True,
|
skip_enrichment=True,
|
||||||
|
institution_aliases=(
|
||||||
|
await _institution_aliases(institution_ids)
|
||||||
|
if multiple_institutions
|
||||||
|
else None
|
||||||
|
),
|
||||||
)
|
)
|
||||||
return DashboardStatisticValue(
|
return DashboardStatisticValue(
|
||||||
institution_id=normalized_id,
|
institution_id=_scope_id(institution_ids),
|
||||||
organization_name=organization_name,
|
organization_name=organization_name,
|
||||||
value=projects.total,
|
value=projects.total,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ from .project_statistics_service import (
|
|||||||
get_dashboard_dfg_projects,
|
get_dashboard_dfg_projects,
|
||||||
get_dashboard_eu_projects,
|
get_dashboard_eu_projects,
|
||||||
)
|
)
|
||||||
|
from .project_ids_service import _get_dfg_project_ids_from_projects_service
|
||||||
|
|
||||||
|
|
||||||
def _status_count(aggregations: dict[str, Any], status_name: str) -> int:
|
def _status_count(aggregations: dict[str, Any], status_name: str) -> int:
|
||||||
@@ -77,13 +78,22 @@ async def get_dashboard_eu_project_statuses(
|
|||||||
to_year: int | None = None,
|
to_year: int | None = None,
|
||||||
) -> EuProjectStatusStatistics:
|
) -> EuProjectStatusStatistics:
|
||||||
normalized_id = _normalize_institution_id(institution_id)
|
normalized_id = _normalize_institution_id(institution_id)
|
||||||
aliases = await _institution_aliases(normalized_id, organization_name)
|
|
||||||
project_ids = await _eu_project_ids_for_aliases(aliases)
|
|
||||||
total = (
|
total = (
|
||||||
await get_dashboard_eu_projects(
|
await get_dashboard_eu_projects(
|
||||||
normalized_id, organization_name, from_year=from_year, to_year=to_year
|
normalized_id, organization_name, from_year=from_year, to_year=to_year
|
||||||
)
|
)
|
||||||
).value
|
).value
|
||||||
|
if total == 0:
|
||||||
|
return EuProjectStatusStatistics(
|
||||||
|
institution_id=normalized_id,
|
||||||
|
organization_name=organization_name,
|
||||||
|
ongoing=0,
|
||||||
|
upcoming=0,
|
||||||
|
completed=0,
|
||||||
|
)
|
||||||
|
|
||||||
|
aliases = await _institution_aliases(normalized_id, organization_name)
|
||||||
|
project_ids = await _eu_project_ids_for_aliases(aliases)
|
||||||
if not project_ids:
|
if not project_ids:
|
||||||
return EuProjectStatusStatistics(
|
return EuProjectStatusStatistics(
|
||||||
institution_id=normalized_id,
|
institution_id=normalized_id,
|
||||||
@@ -152,6 +162,20 @@ async def get_dashboard_bmbf_project_statuses(
|
|||||||
to_year: int | None = None,
|
to_year: int | None = None,
|
||||||
) -> BmbfProjectStatusStatistics:
|
) -> BmbfProjectStatusStatistics:
|
||||||
normalized_id = _normalize_institution_id(institution_id)
|
normalized_id = _normalize_institution_id(institution_id)
|
||||||
|
total = (
|
||||||
|
await get_dashboard_bmbf_projects(
|
||||||
|
normalized_id, organization_name, from_year=from_year, to_year=to_year
|
||||||
|
)
|
||||||
|
).value
|
||||||
|
if total == 0:
|
||||||
|
return BmbfProjectStatusStatistics(
|
||||||
|
institution_id=normalized_id,
|
||||||
|
organization_name=organization_name,
|
||||||
|
ongoing=0,
|
||||||
|
upcoming=0,
|
||||||
|
completed=0,
|
||||||
|
)
|
||||||
|
|
||||||
aliases = await _institution_aliases(normalized_id, organization_name)
|
aliases = await _institution_aliases(normalized_id, organization_name)
|
||||||
period = _dashboard_period(from_year, to_year)
|
period = _dashboard_period(from_year, to_year)
|
||||||
filters = [_alias_match_query("Zuwendungsempfänger", aliases)]
|
filters = [_alias_match_query("Zuwendungsempfänger", aliases)]
|
||||||
@@ -171,11 +195,6 @@ async def get_dashboard_bmbf_project_statuses(
|
|||||||
cluster=ESCluster.INSE,
|
cluster=ESCluster.INSE,
|
||||||
)
|
)
|
||||||
aggregations = response.get("aggregations", {})
|
aggregations = response.get("aggregations", {})
|
||||||
total = (
|
|
||||||
await get_dashboard_bmbf_projects(
|
|
||||||
normalized_id, organization_name, from_year=from_year, to_year=to_year
|
|
||||||
)
|
|
||||||
).value
|
|
||||||
ongoing, upcoming, completed = reconcile_status_counts(
|
ongoing, upcoming, completed = reconcile_status_counts(
|
||||||
total,
|
total,
|
||||||
int(aggregations.get("ongoing", {}).get("doc_count", 0)),
|
int(aggregations.get("ongoing", {}).get("doc_count", 0)),
|
||||||
@@ -199,12 +218,25 @@ async def get_dashboard_dfg_project_statuses(
|
|||||||
) -> DfgProjectStatusStatistics:
|
) -> DfgProjectStatusStatistics:
|
||||||
normalized_id = _normalize_institution_id(institution_id)
|
normalized_id = _normalize_institution_id(institution_id)
|
||||||
period = _dashboard_period(from_year, to_year)
|
period = _dashboard_period(from_year, to_year)
|
||||||
project_ids = await _get_dfg_project_ids_for_institution(normalized_id)
|
|
||||||
total = (
|
total = (
|
||||||
await get_dashboard_dfg_projects(
|
await get_dashboard_dfg_projects(
|
||||||
normalized_id, organization_name, from_year=from_year, to_year=to_year
|
normalized_id, organization_name, from_year=from_year, to_year=to_year
|
||||||
)
|
)
|
||||||
).value
|
).value
|
||||||
|
if total == 0:
|
||||||
|
return DfgProjectStatusStatistics(
|
||||||
|
institution_id=normalized_id,
|
||||||
|
organization_name=organization_name,
|
||||||
|
ongoing=0,
|
||||||
|
upcoming=0,
|
||||||
|
completed=0,
|
||||||
|
)
|
||||||
|
|
||||||
|
project_ids = await _get_dfg_project_ids_from_projects_service(
|
||||||
|
normalized_id,
|
||||||
|
from_year=from_year,
|
||||||
|
to_year=to_year,
|
||||||
|
)
|
||||||
if not project_ids:
|
if not project_ids:
|
||||||
return DfgProjectStatusStatistics(
|
return DfgProjectStatusStatistics(
|
||||||
institution_id=normalized_id,
|
institution_id=normalized_id,
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ from inse.tags import Tags
|
|||||||
from .model import (
|
from .model import (
|
||||||
BmbfProjectStatusStatistics,
|
BmbfProjectStatusStatistics,
|
||||||
BundProjectTopics,
|
BundProjectTopics,
|
||||||
|
DashboardInstitution,
|
||||||
DashboardStatistics,
|
DashboardStatistics,
|
||||||
DashboardStatisticValue,
|
DashboardStatisticValue,
|
||||||
DfgProjectStatusStatistics,
|
DfgProjectStatusStatistics,
|
||||||
@@ -23,10 +24,13 @@ from .model import (
|
|||||||
TopicWordCloud,
|
TopicWordCloud,
|
||||||
)
|
)
|
||||||
from .service import (
|
from .service import (
|
||||||
|
get_dashboard_analytical_institution,
|
||||||
|
get_dashboard_institutions,
|
||||||
get_dashboard_organization,
|
get_dashboard_organization,
|
||||||
get_dashboard_patents,
|
get_dashboard_patents,
|
||||||
get_dashboard_persons,
|
get_dashboard_persons,
|
||||||
get_dashboard_publications,
|
get_dashboard_publications,
|
||||||
|
get_dashboard_statistic_institution_ids,
|
||||||
get_dashboard_statistics,
|
get_dashboard_statistics,
|
||||||
get_topic_heatmap,
|
get_topic_heatmap,
|
||||||
get_topic_word_cloud,
|
get_topic_word_cloud,
|
||||||
@@ -56,6 +60,19 @@ from .top_authors_service import (
|
|||||||
router = APIRouter(prefix="/api/dashboard", tags=[Tags.DASHBOARD])
|
router = APIRouter(prefix="/api/dashboard", tags=[Tags.DASHBOARD])
|
||||||
|
|
||||||
|
|
||||||
|
@router.get(
|
||||||
|
"/institutions",
|
||||||
|
operation_id="getDashboardInstitutions",
|
||||||
|
response_model=list[DashboardInstitution],
|
||||||
|
)
|
||||||
|
async def dashboard_institutions(
|
||||||
|
session: Session = Depends(get_session),
|
||||||
|
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
|
) -> list[DashboardInstitution]:
|
||||||
|
organization = get_dashboard_organization(session, access_token)
|
||||||
|
return await get_dashboard_institutions(session, organization)
|
||||||
|
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/statistics",
|
"/statistics",
|
||||||
operation_id="getDashboardStatistics",
|
operation_id="getDashboardStatistics",
|
||||||
@@ -78,14 +95,18 @@ async def dashboard_statistics(
|
|||||||
response_model=DashboardStatisticValue,
|
response_model=DashboardStatisticValue,
|
||||||
)
|
)
|
||||||
async def dashboard_publications(
|
async def dashboard_publications(
|
||||||
|
institution_id: str | None = Query(default=None),
|
||||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
session: Session = Depends(get_session),
|
session: Session = Depends(get_session),
|
||||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
) -> DashboardStatisticValue:
|
) -> DashboardStatisticValue:
|
||||||
organization = get_dashboard_organization(session, access_token)
|
organization = get_dashboard_organization(session, access_token)
|
||||||
|
institution_ids = await get_dashboard_statistic_institution_ids(
|
||||||
|
session, organization, institution_id
|
||||||
|
)
|
||||||
return await get_dashboard_publications(
|
return await get_dashboard_publications(
|
||||||
organization.openalex_institution_id,
|
institution_ids,
|
||||||
organization.name,
|
organization.name,
|
||||||
from_year=from_year,
|
from_year=from_year,
|
||||||
to_year=to_year,
|
to_year=to_year,
|
||||||
@@ -98,14 +119,18 @@ async def dashboard_publications(
|
|||||||
response_model=DashboardStatisticValue,
|
response_model=DashboardStatisticValue,
|
||||||
)
|
)
|
||||||
async def dashboard_persons(
|
async def dashboard_persons(
|
||||||
|
institution_id: str | None = Query(default=None),
|
||||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
session: Session = Depends(get_session),
|
session: Session = Depends(get_session),
|
||||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
) -> DashboardStatisticValue:
|
) -> DashboardStatisticValue:
|
||||||
organization = get_dashboard_organization(session, access_token)
|
organization = get_dashboard_organization(session, access_token)
|
||||||
|
institution_ids = await get_dashboard_statistic_institution_ids(
|
||||||
|
session, organization, institution_id
|
||||||
|
)
|
||||||
return await get_dashboard_persons(
|
return await get_dashboard_persons(
|
||||||
organization.openalex_institution_id,
|
institution_ids,
|
||||||
organization.name,
|
organization.name,
|
||||||
from_year=from_year,
|
from_year=from_year,
|
||||||
to_year=to_year,
|
to_year=to_year,
|
||||||
@@ -118,14 +143,18 @@ async def dashboard_persons(
|
|||||||
response_model=DashboardStatisticValue,
|
response_model=DashboardStatisticValue,
|
||||||
)
|
)
|
||||||
async def dashboard_patents(
|
async def dashboard_patents(
|
||||||
|
institution_id: str | None = Query(default=None),
|
||||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
session: Session = Depends(get_session),
|
session: Session = Depends(get_session),
|
||||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
) -> DashboardStatisticValue:
|
) -> DashboardStatisticValue:
|
||||||
organization = get_dashboard_organization(session, access_token)
|
organization = get_dashboard_organization(session, access_token)
|
||||||
|
institution_ids = await get_dashboard_statistic_institution_ids(
|
||||||
|
session, organization, institution_id
|
||||||
|
)
|
||||||
return await get_dashboard_patents(
|
return await get_dashboard_patents(
|
||||||
organization.openalex_institution_id,
|
institution_ids,
|
||||||
organization.name,
|
organization.name,
|
||||||
from_year=from_year,
|
from_year=from_year,
|
||||||
to_year=to_year,
|
to_year=to_year,
|
||||||
@@ -138,14 +167,18 @@ async def dashboard_patents(
|
|||||||
response_model=DashboardStatisticValue,
|
response_model=DashboardStatisticValue,
|
||||||
)
|
)
|
||||||
async def dashboard_eu_projects(
|
async def dashboard_eu_projects(
|
||||||
|
institution_id: str | None = Query(default=None),
|
||||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
session: Session = Depends(get_session),
|
session: Session = Depends(get_session),
|
||||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
) -> DashboardStatisticValue:
|
) -> DashboardStatisticValue:
|
||||||
organization = get_dashboard_organization(session, access_token)
|
organization = get_dashboard_organization(session, access_token)
|
||||||
|
institution_ids = await get_dashboard_statistic_institution_ids(
|
||||||
|
session, organization, institution_id
|
||||||
|
)
|
||||||
return await get_dashboard_eu_projects(
|
return await get_dashboard_eu_projects(
|
||||||
organization.openalex_institution_id,
|
institution_ids,
|
||||||
organization.name,
|
organization.name,
|
||||||
from_year=from_year,
|
from_year=from_year,
|
||||||
to_year=to_year,
|
to_year=to_year,
|
||||||
@@ -158,15 +191,21 @@ async def dashboard_eu_projects(
|
|||||||
response_model=EuProjectStatusStatistics,
|
response_model=EuProjectStatusStatistics,
|
||||||
)
|
)
|
||||||
async def dashboard_eu_project_statuses(
|
async def dashboard_eu_project_statuses(
|
||||||
|
institution_id: str | None = Query(default=None),
|
||||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
session: Session = Depends(get_session),
|
session: Session = Depends(get_session),
|
||||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
) -> EuProjectStatusStatistics:
|
) -> EuProjectStatusStatistics:
|
||||||
organization = get_dashboard_organization(session, access_token)
|
organization = get_dashboard_organization(session, access_token)
|
||||||
|
selected_institution_id, selected_institution_name = (
|
||||||
|
await get_dashboard_analytical_institution(
|
||||||
|
session, organization, institution_id
|
||||||
|
)
|
||||||
|
)
|
||||||
return await get_dashboard_eu_project_statuses(
|
return await get_dashboard_eu_project_statuses(
|
||||||
organization.openalex_institution_id,
|
selected_institution_id,
|
||||||
organization.name,
|
selected_institution_name,
|
||||||
from_year=from_year,
|
from_year=from_year,
|
||||||
to_year=to_year,
|
to_year=to_year,
|
||||||
)
|
)
|
||||||
@@ -178,14 +217,18 @@ async def dashboard_eu_project_statuses(
|
|||||||
response_model=DashboardStatisticValue,
|
response_model=DashboardStatisticValue,
|
||||||
)
|
)
|
||||||
async def dashboard_bmbf_projects(
|
async def dashboard_bmbf_projects(
|
||||||
|
institution_id: str | None = Query(default=None),
|
||||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
session: Session = Depends(get_session),
|
session: Session = Depends(get_session),
|
||||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
) -> DashboardStatisticValue:
|
) -> DashboardStatisticValue:
|
||||||
organization = get_dashboard_organization(session, access_token)
|
organization = get_dashboard_organization(session, access_token)
|
||||||
|
institution_ids = await get_dashboard_statistic_institution_ids(
|
||||||
|
session, organization, institution_id
|
||||||
|
)
|
||||||
return await get_dashboard_bmbf_projects(
|
return await get_dashboard_bmbf_projects(
|
||||||
organization.openalex_institution_id,
|
institution_ids,
|
||||||
organization.name,
|
organization.name,
|
||||||
from_year=from_year,
|
from_year=from_year,
|
||||||
to_year=to_year,
|
to_year=to_year,
|
||||||
@@ -198,15 +241,21 @@ async def dashboard_bmbf_projects(
|
|||||||
response_model=BmbfProjectStatusStatistics,
|
response_model=BmbfProjectStatusStatistics,
|
||||||
)
|
)
|
||||||
async def dashboard_bmbf_project_statuses(
|
async def dashboard_bmbf_project_statuses(
|
||||||
|
institution_id: str | None = Query(default=None),
|
||||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
session: Session = Depends(get_session),
|
session: Session = Depends(get_session),
|
||||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
) -> BmbfProjectStatusStatistics:
|
) -> BmbfProjectStatusStatistics:
|
||||||
organization = get_dashboard_organization(session, access_token)
|
organization = get_dashboard_organization(session, access_token)
|
||||||
|
selected_institution_id, selected_institution_name = (
|
||||||
|
await get_dashboard_analytical_institution(
|
||||||
|
session, organization, institution_id
|
||||||
|
)
|
||||||
|
)
|
||||||
return await get_dashboard_bmbf_project_statuses(
|
return await get_dashboard_bmbf_project_statuses(
|
||||||
organization.openalex_institution_id,
|
selected_institution_id,
|
||||||
organization.name,
|
selected_institution_name,
|
||||||
from_year=from_year,
|
from_year=from_year,
|
||||||
to_year=to_year,
|
to_year=to_year,
|
||||||
)
|
)
|
||||||
@@ -218,14 +267,18 @@ async def dashboard_bmbf_project_statuses(
|
|||||||
response_model=DashboardStatisticValue,
|
response_model=DashboardStatisticValue,
|
||||||
)
|
)
|
||||||
async def dashboard_dfg_projects(
|
async def dashboard_dfg_projects(
|
||||||
|
institution_id: str | None = Query(default=None),
|
||||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
session: Session = Depends(get_session),
|
session: Session = Depends(get_session),
|
||||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
) -> DashboardStatisticValue:
|
) -> DashboardStatisticValue:
|
||||||
organization = get_dashboard_organization(session, access_token)
|
organization = get_dashboard_organization(session, access_token)
|
||||||
|
institution_ids = await get_dashboard_statistic_institution_ids(
|
||||||
|
session, organization, institution_id
|
||||||
|
)
|
||||||
return await get_dashboard_dfg_projects(
|
return await get_dashboard_dfg_projects(
|
||||||
organization.openalex_institution_id,
|
institution_ids,
|
||||||
organization.name,
|
organization.name,
|
||||||
from_year=from_year,
|
from_year=from_year,
|
||||||
to_year=to_year,
|
to_year=to_year,
|
||||||
@@ -238,15 +291,21 @@ async def dashboard_dfg_projects(
|
|||||||
response_model=DfgProjectStatusStatistics,
|
response_model=DfgProjectStatusStatistics,
|
||||||
)
|
)
|
||||||
async def dashboard_dfg_project_statuses(
|
async def dashboard_dfg_project_statuses(
|
||||||
|
institution_id: str | None = Query(default=None),
|
||||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
session: Session = Depends(get_session),
|
session: Session = Depends(get_session),
|
||||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
) -> DfgProjectStatusStatistics:
|
) -> DfgProjectStatusStatistics:
|
||||||
organization = get_dashboard_organization(session, access_token)
|
organization = get_dashboard_organization(session, access_token)
|
||||||
|
selected_institution_id, selected_institution_name = (
|
||||||
|
await get_dashboard_analytical_institution(
|
||||||
|
session, organization, institution_id
|
||||||
|
)
|
||||||
|
)
|
||||||
return await get_dashboard_dfg_project_statuses(
|
return await get_dashboard_dfg_project_statuses(
|
||||||
organization.openalex_institution_id,
|
selected_institution_id,
|
||||||
organization.name,
|
selected_institution_name,
|
||||||
from_year=from_year,
|
from_year=from_year,
|
||||||
to_year=to_year,
|
to_year=to_year,
|
||||||
)
|
)
|
||||||
@@ -258,15 +317,21 @@ async def dashboard_dfg_project_statuses(
|
|||||||
response_model=DfgProjectTopics,
|
response_model=DfgProjectTopics,
|
||||||
)
|
)
|
||||||
async def dashboard_dfg_project_topics(
|
async def dashboard_dfg_project_topics(
|
||||||
|
institution_id: str | None = Query(default=None),
|
||||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
session: Session = Depends(get_session),
|
session: Session = Depends(get_session),
|
||||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
) -> DfgProjectTopics:
|
) -> DfgProjectTopics:
|
||||||
organization = get_dashboard_organization(session, access_token)
|
organization = get_dashboard_organization(session, access_token)
|
||||||
|
selected_institution_id, selected_institution_name = (
|
||||||
|
await get_dashboard_analytical_institution(
|
||||||
|
session, organization, institution_id
|
||||||
|
)
|
||||||
|
)
|
||||||
return await get_dashboard_dfg_topics(
|
return await get_dashboard_dfg_topics(
|
||||||
organization.openalex_institution_id,
|
selected_institution_id,
|
||||||
organization.name,
|
selected_institution_name,
|
||||||
from_year=from_year,
|
from_year=from_year,
|
||||||
to_year=to_year,
|
to_year=to_year,
|
||||||
)
|
)
|
||||||
@@ -278,15 +343,21 @@ async def dashboard_dfg_project_topics(
|
|||||||
response_model=EuProjectTopics,
|
response_model=EuProjectTopics,
|
||||||
)
|
)
|
||||||
async def dashboard_eu_project_topics(
|
async def dashboard_eu_project_topics(
|
||||||
|
institution_id: str | None = Query(default=None),
|
||||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
session: Session = Depends(get_session),
|
session: Session = Depends(get_session),
|
||||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
) -> EuProjectTopics:
|
) -> EuProjectTopics:
|
||||||
organization = get_dashboard_organization(session, access_token)
|
organization = get_dashboard_organization(session, access_token)
|
||||||
|
selected_institution_id, selected_institution_name = (
|
||||||
|
await get_dashboard_analytical_institution(
|
||||||
|
session, organization, institution_id
|
||||||
|
)
|
||||||
|
)
|
||||||
return await get_dashboard_eu_topics(
|
return await get_dashboard_eu_topics(
|
||||||
organization.openalex_institution_id,
|
selected_institution_id,
|
||||||
organization.name,
|
selected_institution_name,
|
||||||
from_year=from_year,
|
from_year=from_year,
|
||||||
to_year=to_year,
|
to_year=to_year,
|
||||||
)
|
)
|
||||||
@@ -298,15 +369,21 @@ async def dashboard_eu_project_topics(
|
|||||||
response_model=BundProjectTopics,
|
response_model=BundProjectTopics,
|
||||||
)
|
)
|
||||||
async def dashboard_bund_project_topics(
|
async def dashboard_bund_project_topics(
|
||||||
|
institution_id: str | None = Query(default=None),
|
||||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
session: Session = Depends(get_session),
|
session: Session = Depends(get_session),
|
||||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
) -> BundProjectTopics:
|
) -> BundProjectTopics:
|
||||||
organization = get_dashboard_organization(session, access_token)
|
organization = get_dashboard_organization(session, access_token)
|
||||||
|
selected_institution_id, selected_institution_name = (
|
||||||
|
await get_dashboard_analytical_institution(
|
||||||
|
session, organization, institution_id
|
||||||
|
)
|
||||||
|
)
|
||||||
return await get_dashboard_bund_topics(
|
return await get_dashboard_bund_topics(
|
||||||
organization.openalex_institution_id,
|
selected_institution_id,
|
||||||
organization.name,
|
selected_institution_name,
|
||||||
from_year=from_year,
|
from_year=from_year,
|
||||||
to_year=to_year,
|
to_year=to_year,
|
||||||
)
|
)
|
||||||
@@ -322,15 +399,21 @@ async def dashboard_top_authors(
|
|||||||
default="all_time",
|
default="all_time",
|
||||||
pattern="^(all_time|last_5_years)$",
|
pattern="^(all_time|last_5_years)$",
|
||||||
),
|
),
|
||||||
|
institution_id: str | None = Query(default=None),
|
||||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
session: Session = Depends(get_session),
|
session: Session = Depends(get_session),
|
||||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
) -> TopAuthorStatistics:
|
) -> TopAuthorStatistics:
|
||||||
organization = get_dashboard_organization(session, access_token)
|
organization = get_dashboard_organization(session, access_token)
|
||||||
|
selected_institution_id, selected_institution_name = (
|
||||||
|
await get_dashboard_analytical_institution(
|
||||||
|
session, organization, institution_id
|
||||||
|
)
|
||||||
|
)
|
||||||
return await get_top_authors(
|
return await get_top_authors(
|
||||||
organization.openalex_institution_id,
|
selected_institution_id,
|
||||||
organization.name,
|
selected_institution_name,
|
||||||
works_period=works_period,
|
works_period=works_period,
|
||||||
from_year=from_year,
|
from_year=from_year,
|
||||||
to_year=to_year,
|
to_year=to_year,
|
||||||
@@ -346,14 +429,18 @@ async def dashboard_top_work_authors(
|
|||||||
works_period: Literal["all_time", "last_5_years"] = Query(
|
works_period: Literal["all_time", "last_5_years"] = Query(
|
||||||
default="all_time", pattern="^(all_time|last_5_years)$"
|
default="all_time", pattern="^(all_time|last_5_years)$"
|
||||||
),
|
),
|
||||||
|
institution_id: str | None = Query(default=None),
|
||||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
session: Session = Depends(get_session),
|
session: Session = Depends(get_session),
|
||||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
) -> TopAuthorAnalysis:
|
) -> TopAuthorAnalysis:
|
||||||
organization = get_dashboard_organization(session, access_token)
|
organization = get_dashboard_organization(session, access_token)
|
||||||
|
selected_institution_id, _ = await get_dashboard_analytical_institution(
|
||||||
|
session, organization, institution_id
|
||||||
|
)
|
||||||
return await get_top_work_authors(
|
return await get_top_work_authors(
|
||||||
organization.openalex_institution_id, works_period, from_year, to_year
|
selected_institution_id, works_period, from_year, to_year
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -363,14 +450,20 @@ async def dashboard_top_work_authors(
|
|||||||
response_model=TopAuthorAnalysis,
|
response_model=TopAuthorAnalysis,
|
||||||
)
|
)
|
||||||
async def dashboard_top_project_authors(
|
async def dashboard_top_project_authors(
|
||||||
|
institution_id: str | None = Query(default=None),
|
||||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
session: Session = Depends(get_session),
|
session: Session = Depends(get_session),
|
||||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
) -> TopAuthorAnalysis:
|
) -> TopAuthorAnalysis:
|
||||||
organization = get_dashboard_organization(session, access_token)
|
organization = get_dashboard_organization(session, access_token)
|
||||||
|
selected_institution_id, selected_institution_name = (
|
||||||
|
await get_dashboard_analytical_institution(
|
||||||
|
session, organization, institution_id
|
||||||
|
)
|
||||||
|
)
|
||||||
return await get_top_project_authors(
|
return await get_top_project_authors(
|
||||||
organization.openalex_institution_id, organization.name, from_year, to_year
|
selected_institution_id, selected_institution_name, from_year, to_year
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -380,14 +473,18 @@ async def dashboard_top_project_authors(
|
|||||||
response_model=TopAuthorAnalysis,
|
response_model=TopAuthorAnalysis,
|
||||||
)
|
)
|
||||||
async def dashboard_top_eu_project_authors(
|
async def dashboard_top_eu_project_authors(
|
||||||
|
institution_id: str | None = Query(default=None),
|
||||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
session: Session = Depends(get_session),
|
session: Session = Depends(get_session),
|
||||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
) -> TopAuthorAnalysis:
|
) -> TopAuthorAnalysis:
|
||||||
organization = get_dashboard_organization(session, access_token)
|
organization = get_dashboard_organization(session, access_token)
|
||||||
|
selected_institution_id, _ = await get_dashboard_analytical_institution(
|
||||||
|
session, organization, institution_id
|
||||||
|
)
|
||||||
return await get_top_eu_project_authors(
|
return await get_top_eu_project_authors(
|
||||||
organization.openalex_institution_id, from_year, to_year
|
selected_institution_id, from_year, to_year
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -397,14 +494,18 @@ async def dashboard_top_eu_project_authors(
|
|||||||
response_model=TopAuthorAnalysis,
|
response_model=TopAuthorAnalysis,
|
||||||
)
|
)
|
||||||
async def dashboard_top_patent_authors(
|
async def dashboard_top_patent_authors(
|
||||||
|
institution_id: str | None = Query(default=None),
|
||||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
session: Session = Depends(get_session),
|
session: Session = Depends(get_session),
|
||||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
) -> TopAuthorAnalysis:
|
) -> TopAuthorAnalysis:
|
||||||
organization = get_dashboard_organization(session, access_token)
|
organization = get_dashboard_organization(session, access_token)
|
||||||
|
selected_institution_id, _ = await get_dashboard_analytical_institution(
|
||||||
|
session, organization, institution_id
|
||||||
|
)
|
||||||
return await get_top_patent_authors(
|
return await get_top_patent_authors(
|
||||||
organization.openalex_institution_id, from_year, to_year
|
selected_institution_id, from_year, to_year
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -414,14 +515,18 @@ async def dashboard_top_patent_authors(
|
|||||||
response_model=TopAuthorAnalysis,
|
response_model=TopAuthorAnalysis,
|
||||||
)
|
)
|
||||||
async def dashboard_top_news_authors(
|
async def dashboard_top_news_authors(
|
||||||
|
institution_id: str | None = Query(default=None),
|
||||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
session: Session = Depends(get_session),
|
session: Session = Depends(get_session),
|
||||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
) -> TopAuthorAnalysis:
|
) -> TopAuthorAnalysis:
|
||||||
organization = get_dashboard_organization(session, access_token)
|
organization = get_dashboard_organization(session, access_token)
|
||||||
|
selected_institution_id, _ = await get_dashboard_analytical_institution(
|
||||||
|
session, organization, institution_id
|
||||||
|
)
|
||||||
return await get_top_news_authors(
|
return await get_top_news_authors(
|
||||||
organization.openalex_institution_id, from_year, to_year
|
selected_institution_id, from_year, to_year
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -431,6 +536,7 @@ async def dashboard_top_news_authors(
|
|||||||
response_model=TopicHeatmap,
|
response_model=TopicHeatmap,
|
||||||
)
|
)
|
||||||
async def dashboard_topic_heatmap(
|
async def dashboard_topic_heatmap(
|
||||||
|
institution_id: str | None = Query(default=None),
|
||||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
limit: int = Query(default=25, ge=1, le=50),
|
limit: int = Query(default=25, ge=1, le=50),
|
||||||
@@ -438,9 +544,14 @@ async def dashboard_topic_heatmap(
|
|||||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
) -> TopicHeatmap:
|
) -> TopicHeatmap:
|
||||||
organization = get_dashboard_organization(session, access_token)
|
organization = get_dashboard_organization(session, access_token)
|
||||||
|
selected_institution_id, selected_institution_name = (
|
||||||
|
await get_dashboard_analytical_institution(
|
||||||
|
session, organization, institution_id
|
||||||
|
)
|
||||||
|
)
|
||||||
return await get_topic_heatmap(
|
return await get_topic_heatmap(
|
||||||
institution_id=organization.openalex_institution_id,
|
institution_id=selected_institution_id,
|
||||||
organization_name=organization.name,
|
organization_name=selected_institution_name,
|
||||||
from_year=from_year,
|
from_year=from_year,
|
||||||
to_year=to_year,
|
to_year=to_year,
|
||||||
limit=limit,
|
limit=limit,
|
||||||
@@ -454,6 +565,7 @@ async def dashboard_topic_heatmap(
|
|||||||
)
|
)
|
||||||
async def dashboard_topic_word_cloud(
|
async def dashboard_topic_word_cloud(
|
||||||
topic_id: str = Query(alias="topicId", min_length=1),
|
topic_id: str = Query(alias="topicId", min_length=1),
|
||||||
|
institution_id: str | None = Query(default=None),
|
||||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||||
limit: int = Query(default=30, ge=1, le=100),
|
limit: int = Query(default=30, ge=1, le=100),
|
||||||
@@ -461,8 +573,11 @@ async def dashboard_topic_word_cloud(
|
|||||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||||
) -> TopicWordCloud:
|
) -> TopicWordCloud:
|
||||||
organization = get_dashboard_organization(session, access_token)
|
organization = get_dashboard_organization(session, access_token)
|
||||||
|
selected_institution_id, _ = await get_dashboard_analytical_institution(
|
||||||
|
session, organization, institution_id
|
||||||
|
)
|
||||||
return await get_topic_word_cloud(
|
return await get_topic_word_cloud(
|
||||||
institution_id=organization.openalex_institution_id,
|
institution_id=selected_institution_id,
|
||||||
topic_id=topic_id,
|
topic_id=topic_id,
|
||||||
from_year=from_year,
|
from_year=from_year,
|
||||||
to_year=to_year,
|
to_year=to_year,
|
||||||
|
|||||||
@@ -3,13 +3,17 @@ import logging
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from fastapi import HTTPException, status
|
from fastapi import HTTPException, status
|
||||||
from sqlmodel import Session
|
from sqlmodel import Session, select
|
||||||
|
|
||||||
from inse import config
|
from inse import config
|
||||||
from inse.auth.model import AccessToken, Organization
|
from inse.auth.model import AccessToken, Organization, OrganizationInstitution
|
||||||
|
from inse.authors.institution_membership_query import (
|
||||||
|
build_institution_membership_query,
|
||||||
|
)
|
||||||
from inse.institutions.v2 import service as institutions_v2_service
|
from inse.institutions.v2 import service as institutions_v2_service
|
||||||
from inse.integrations import elasticsearch
|
from inse.integrations import elasticsearch
|
||||||
from inse.model import ESCluster, ESIndex
|
from inse.model import ESCluster, ESIndex
|
||||||
|
from inse.organization_management import service as organization_management_service
|
||||||
from inse.patents.org.elastic_search_client import OrgPatentsSearchClient
|
from inse.patents.org.elastic_search_client import OrgPatentsSearchClient
|
||||||
from inse.persons import service as persons_service
|
from inse.persons import service as persons_service
|
||||||
from inse.works.v2 import service as works_v2_service
|
from inse.works.v2 import service as works_v2_service
|
||||||
@@ -22,6 +26,7 @@ from .common import (
|
|||||||
raw_institution_id as _raw_institution_id,
|
raw_institution_id as _raw_institution_id,
|
||||||
)
|
)
|
||||||
from .model import (
|
from .model import (
|
||||||
|
DashboardInstitution,
|
||||||
DashboardStatistics,
|
DashboardStatistics,
|
||||||
DashboardStatisticValue,
|
DashboardStatisticValue,
|
||||||
TopicHeatmap,
|
TopicHeatmap,
|
||||||
@@ -45,6 +50,92 @@ TOPIC_WORD_CLOUD_LIMIT = 30
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
async def get_dashboard_institutions(
|
||||||
|
session: Session,
|
||||||
|
organization: Organization,
|
||||||
|
) -> list[DashboardInstitution]:
|
||||||
|
rows = session.exec(
|
||||||
|
select(OrganizationInstitution)
|
||||||
|
.where(OrganizationInstitution.organization_id == organization.id)
|
||||||
|
.order_by(OrganizationInstitution.position)
|
||||||
|
).all()
|
||||||
|
institution_ids = [row.openalex_institution_id for row in rows]
|
||||||
|
if not institution_ids and organization.openalex_institution_id:
|
||||||
|
institution_ids = [_raw_institution_id(organization.openalex_institution_id)]
|
||||||
|
if not institution_ids:
|
||||||
|
return []
|
||||||
|
|
||||||
|
association_groups = (
|
||||||
|
await organization_management_service.resolve_institution_associations(
|
||||||
|
institution_ids
|
||||||
|
)
|
||||||
|
)
|
||||||
|
institutions: dict[str, DashboardInstitution] = {}
|
||||||
|
for group in association_groups:
|
||||||
|
root_id = _raw_institution_id(group.id)
|
||||||
|
institutions[root_id] = DashboardInstitution(
|
||||||
|
id=root_id,
|
||||||
|
display_name=group.display_name,
|
||||||
|
)
|
||||||
|
for association in group.associated_institutions:
|
||||||
|
association_id = _raw_institution_id(association.id)
|
||||||
|
institutions.setdefault(
|
||||||
|
association_id,
|
||||||
|
DashboardInstitution(
|
||||||
|
id=association_id,
|
||||||
|
display_name=association.display_name,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
return list(institutions.values())
|
||||||
|
|
||||||
|
|
||||||
|
async def get_dashboard_statistic_institution_ids(
|
||||||
|
session: Session,
|
||||||
|
organization: Organization,
|
||||||
|
selected_institution_id: str | None,
|
||||||
|
) -> list[str]:
|
||||||
|
institutions = await get_dashboard_institutions(session, organization)
|
||||||
|
institution_ids = [institution.id for institution in institutions]
|
||||||
|
if selected_institution_id in (None, "all"):
|
||||||
|
return institution_ids
|
||||||
|
|
||||||
|
selected_id = _raw_institution_id(selected_institution_id)
|
||||||
|
if selected_id not in institution_ids:
|
||||||
|
raise HTTPException(
|
||||||
|
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
|
||||||
|
detail="Institution is not associated with this organization.",
|
||||||
|
)
|
||||||
|
return [selected_id]
|
||||||
|
|
||||||
|
|
||||||
|
async def get_dashboard_analytical_institution(
|
||||||
|
session: Session,
|
||||||
|
organization: Organization,
|
||||||
|
selected_institution_id: str | None,
|
||||||
|
) -> tuple[str, str]:
|
||||||
|
if selected_institution_id in (None, "all"):
|
||||||
|
return organization.openalex_institution_id, organization.name
|
||||||
|
|
||||||
|
selected_id = _raw_institution_id(selected_institution_id)
|
||||||
|
institutions = await get_dashboard_institutions(session, organization)
|
||||||
|
for institution in institutions:
|
||||||
|
if institution.id == selected_id:
|
||||||
|
return selected_id, institution.display_name
|
||||||
|
|
||||||
|
raise HTTPException(
|
||||||
|
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
|
||||||
|
detail="Institution is not associated with this organization.",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _statistic_scope_id(institution_ids: list[str]) -> str:
|
||||||
|
return (
|
||||||
|
_normalize_institution_id(institution_ids[0])
|
||||||
|
if len(institution_ids) == 1
|
||||||
|
else "all"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def _publication_year_filter(period: DashboardPeriod) -> dict[str, Any] | None:
|
def _publication_year_filter(period: DashboardPeriod) -> dict[str, Any] | None:
|
||||||
from_year, to_year = period
|
from_year, to_year = period
|
||||||
year_range: dict[str, int] = {}
|
year_range: dict[str, int] = {}
|
||||||
@@ -104,12 +195,15 @@ async def get_dashboard_statistics(
|
|||||||
|
|
||||||
|
|
||||||
async def get_dashboard_publications(
|
async def get_dashboard_publications(
|
||||||
institution_id: str,
|
institution_id: str | list[str],
|
||||||
organization_name: str,
|
organization_name: str,
|
||||||
from_year: int | None = None,
|
from_year: int | None = None,
|
||||||
to_year: int | None = None,
|
to_year: int | None = None,
|
||||||
) -> DashboardStatisticValue:
|
) -> DashboardStatisticValue:
|
||||||
normalized_id = _normalize_institution_id(institution_id)
|
institution_ids = (
|
||||||
|
institution_id if isinstance(institution_id, list) else [institution_id]
|
||||||
|
)
|
||||||
|
normalized_ids = [_normalize_institution_id(value) for value in institution_ids]
|
||||||
period = _dashboard_period(from_year, to_year)
|
period = _dashboard_period(from_year, to_year)
|
||||||
publication_years: list[int] = []
|
publication_years: list[int] = []
|
||||||
if period != (None, None):
|
if period != (None, None):
|
||||||
@@ -120,67 +214,94 @@ async def get_dashboard_publications(
|
|||||||
works = await works_v2_service.get_works(
|
works = await works_v2_service.get_works(
|
||||||
page=0,
|
page=0,
|
||||||
size=1,
|
size=1,
|
||||||
institution_ids=[normalized_id],
|
institution_ids=normalized_ids,
|
||||||
publication_years=publication_years,
|
publication_years=publication_years,
|
||||||
)
|
)
|
||||||
return DashboardStatisticValue(
|
return DashboardStatisticValue(
|
||||||
institution_id=normalized_id,
|
institution_id=_statistic_scope_id(institution_ids),
|
||||||
organization_name=organization_name,
|
organization_name=organization_name,
|
||||||
value=works.total,
|
value=works.total,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
async def get_dashboard_persons(
|
async def get_dashboard_persons(
|
||||||
institution_id: str,
|
institution_id: str | list[str],
|
||||||
organization_name: str,
|
organization_name: str,
|
||||||
from_year: int | None = None,
|
from_year: int | None = None,
|
||||||
to_year: int | None = None,
|
to_year: int | None = None,
|
||||||
) -> DashboardStatisticValue:
|
) -> DashboardStatisticValue:
|
||||||
normalized_id = _normalize_institution_id(institution_id)
|
institution_ids = institution_id if isinstance(institution_id, list) else [institution_id]
|
||||||
|
normalized_ids = [_normalize_institution_id(value) for value in institution_ids]
|
||||||
period = _dashboard_period(from_year, to_year)
|
period = _dashboard_period(from_year, to_year)
|
||||||
if (period[0] is None) != (period[1] is None):
|
if (period[0] is None) != (period[1] is None):
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
|
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
|
||||||
detail="from_year and to_year must either both be provided or both omitted.",
|
detail="from_year and to_year must either both be provided or both omitted.",
|
||||||
)
|
)
|
||||||
persons = await persons_service.search_persons_list(
|
if len(normalized_ids) == 1:
|
||||||
query=None,
|
persons = await persons_service.search_persons_list(
|
||||||
institution_id=normalized_id,
|
query=None,
|
||||||
sort_by=None,
|
institution_id=normalized_ids[0],
|
||||||
sort_order=None,
|
sort_by=None,
|
||||||
topic=None,
|
sort_order=None,
|
||||||
page=1,
|
topic=None,
|
||||||
page_size=1,
|
page=1,
|
||||||
include="",
|
page_size=1,
|
||||||
year_filter_enabled=period[0] is not None,
|
include="",
|
||||||
filter_mode="between" if period[0] is not None else None,
|
year_filter_enabled=period[0] is not None,
|
||||||
filter_year=period[0],
|
filter_mode="between" if period[0] is not None else None,
|
||||||
filter_year_to=period[1],
|
filter_year=period[0],
|
||||||
|
filter_year_to=period[1],
|
||||||
|
)
|
||||||
|
return DashboardStatisticValue(
|
||||||
|
institution_id=normalized_ids[0],
|
||||||
|
organization_name=organization_name,
|
||||||
|
value=int(persons.meta.count or 0) if persons.meta else 0,
|
||||||
|
)
|
||||||
|
|
||||||
|
membership_queries = [
|
||||||
|
build_institution_membership_query(
|
||||||
|
institution_id=value,
|
||||||
|
year_mode="between" if period[0] is not None else "all",
|
||||||
|
year=period[0],
|
||||||
|
year_to=period[1],
|
||||||
|
)
|
||||||
|
for value in normalized_ids
|
||||||
|
]
|
||||||
|
value = await elasticsearch.count(
|
||||||
|
index="openalex-authors",
|
||||||
|
query={
|
||||||
|
"bool": {
|
||||||
|
"should": membership_queries,
|
||||||
|
"minimum_should_match": 1,
|
||||||
|
}
|
||||||
|
},
|
||||||
)
|
)
|
||||||
return DashboardStatisticValue(
|
return DashboardStatisticValue(
|
||||||
institution_id=normalized_id,
|
institution_id=_statistic_scope_id(institution_ids),
|
||||||
organization_name=organization_name,
|
organization_name=organization_name,
|
||||||
value=int(persons.meta.count or 0) if persons.meta else 0,
|
value=value,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
async def get_dashboard_patents(
|
async def get_dashboard_patents(
|
||||||
institution_id: str,
|
institution_id: str | list[str],
|
||||||
organization_name: str,
|
organization_name: str,
|
||||||
from_year: int | None = None,
|
from_year: int | None = None,
|
||||||
to_year: int | None = None,
|
to_year: int | None = None,
|
||||||
) -> DashboardStatisticValue:
|
) -> DashboardStatisticValue:
|
||||||
normalized_id = _normalize_institution_id(institution_id)
|
institution_ids = institution_id if isinstance(institution_id, list) else [institution_id]
|
||||||
|
normalized_ids = [_normalize_institution_id(value) for value in institution_ids]
|
||||||
period = _dashboard_period(from_year, to_year)
|
period = _dashboard_period(from_year, to_year)
|
||||||
_, total = await OrgPatentsSearchClient().search_by_institution(
|
_, total = await OrgPatentsSearchClient().search_by_institution(
|
||||||
normalized_id,
|
normalized_ids,
|
||||||
page=0,
|
page=0,
|
||||||
size=0,
|
size=0,
|
||||||
from_year=period[0],
|
from_year=period[0],
|
||||||
to_year=period[1],
|
to_year=period[1],
|
||||||
)
|
)
|
||||||
return DashboardStatisticValue(
|
return DashboardStatisticValue(
|
||||||
institution_id=normalized_id,
|
institution_id=_statistic_scope_id(institution_ids),
|
||||||
organization_name=organization_name,
|
organization_name=organization_name,
|
||||||
value=total,
|
value=total,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -8,8 +8,15 @@ from fastapi import HTTPException
|
|||||||
from sqlmodel import Session, SQLModel, create_engine
|
from sqlmodel import Session, SQLModel, create_engine
|
||||||
|
|
||||||
from inse import config
|
from inse import config
|
||||||
from inse.auth.model import AccessToken, Organization, UserRole
|
from inse.auth.model import (
|
||||||
|
AccessToken,
|
||||||
|
Organization,
|
||||||
|
OrganizationInstitution,
|
||||||
|
UserRole,
|
||||||
|
)
|
||||||
from inse.dashboard.service import (
|
from inse.dashboard.service import (
|
||||||
|
get_dashboard_analytical_institution,
|
||||||
|
get_dashboard_institutions,
|
||||||
get_dashboard_organization,
|
get_dashboard_organization,
|
||||||
get_dashboard_persons,
|
get_dashboard_persons,
|
||||||
get_dashboard_publications,
|
get_dashboard_publications,
|
||||||
@@ -22,8 +29,13 @@ from inse.dashboard.common import (
|
|||||||
)
|
)
|
||||||
from inse.dashboard.bund_topics_service import get_dashboard_bund_topics
|
from inse.dashboard.bund_topics_service import get_dashboard_bund_topics
|
||||||
from inse.dashboard.eu_topics_service import get_dashboard_eu_topics
|
from inse.dashboard.eu_topics_service import get_dashboard_eu_topics
|
||||||
from inse.dashboard.model import TopAuthor
|
from inse.dashboard.model import DashboardStatisticValue, TopAuthor
|
||||||
from inse.dashboard.project_status_service import reconcile_status_counts
|
from inse.dashboard.project_status_service import (
|
||||||
|
get_dashboard_bmbf_project_statuses,
|
||||||
|
get_dashboard_dfg_project_statuses,
|
||||||
|
get_dashboard_eu_project_statuses,
|
||||||
|
reconcile_status_counts,
|
||||||
|
)
|
||||||
from inse.dashboard.project_ids_service import (
|
from inse.dashboard.project_ids_service import (
|
||||||
_get_dfg_project_ids_from_projects_service,
|
_get_dfg_project_ids_from_projects_service,
|
||||||
)
|
)
|
||||||
@@ -42,6 +54,10 @@ from inse.exceptions import ElasticsearchException
|
|||||||
from inse.model import ESIndex
|
from inse.model import ESIndex
|
||||||
from inse.models.openalex.institution import Institution
|
from inse.models.openalex.institution import Institution
|
||||||
from inse.models.openalex.meta import Meta
|
from inse.models.openalex.meta import Meta
|
||||||
|
from inse.organization_management.model import (
|
||||||
|
InstitutionAssociation,
|
||||||
|
InstitutionAssociationsResponse,
|
||||||
|
)
|
||||||
from inse.persons.model import CustomAuthorsListResponse
|
from inse.persons.model import CustomAuthorsListResponse
|
||||||
from inse.projects.model import (
|
from inse.projects.model import (
|
||||||
BundProjectPage,
|
BundProjectPage,
|
||||||
@@ -116,6 +132,100 @@ def test_project_status_counts_match_authoritative_total():
|
|||||||
assert reconcile_status_counts(7, 4, 2, 3) == (2, 2, 3)
|
assert reconcile_status_counts(7, 4, 2, 3) == (2, 2, 3)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.anyio
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
("status_loader", "count_loader", "extra_dependency"),
|
||||||
|
[
|
||||||
|
(
|
||||||
|
get_dashboard_eu_project_statuses,
|
||||||
|
"get_dashboard_eu_projects",
|
||||||
|
"_institution_aliases",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
get_dashboard_bmbf_project_statuses,
|
||||||
|
"get_dashboard_bmbf_projects",
|
||||||
|
"_institution_aliases",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
get_dashboard_dfg_project_statuses,
|
||||||
|
"get_dashboard_dfg_projects",
|
||||||
|
"_get_dfg_project_ids_from_projects_service",
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
async def test_project_status_zero_count_is_not_an_error(
|
||||||
|
status_loader, count_loader, extra_dependency
|
||||||
|
):
|
||||||
|
zero_count = DashboardStatisticValue(
|
||||||
|
institution_id=ORG_INSTITUTION_ID,
|
||||||
|
organization_name="Example University",
|
||||||
|
value=0,
|
||||||
|
)
|
||||||
|
with (
|
||||||
|
patch(
|
||||||
|
f"inse.dashboard.project_status_service.{count_loader}",
|
||||||
|
new=AsyncMock(return_value=zero_count),
|
||||||
|
),
|
||||||
|
patch(
|
||||||
|
f"inse.dashboard.project_status_service.{extra_dependency}",
|
||||||
|
new=AsyncMock(side_effect=AssertionError("must not be called")),
|
||||||
|
),
|
||||||
|
):
|
||||||
|
result = await status_loader(ORG_INSTITUTION_ID, "Example University")
|
||||||
|
|
||||||
|
assert result.ongoing == 0
|
||||||
|
assert result.upcoming == 0
|
||||||
|
assert result.completed == 0
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.anyio
|
||||||
|
async def test_dfg_project_status_uses_card_project_ids_and_total():
|
||||||
|
card_total = DashboardStatisticValue(
|
||||||
|
institution_id=ORG_INSTITUTION_ID,
|
||||||
|
organization_name="University Hospital Essen",
|
||||||
|
value=24,
|
||||||
|
)
|
||||||
|
status_aggregations = {
|
||||||
|
"aggregations": {
|
||||||
|
"projects_nested": {
|
||||||
|
"selected_projects": {
|
||||||
|
"ongoing": {"projects": {"value": 7}},
|
||||||
|
"completed": {"projects": {"value": 17}},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
with (
|
||||||
|
patch(
|
||||||
|
"inse.dashboard.project_status_service.get_dashboard_dfg_projects",
|
||||||
|
new=AsyncMock(return_value=card_total),
|
||||||
|
),
|
||||||
|
patch(
|
||||||
|
"inse.dashboard.project_status_service._get_dfg_project_ids_from_projects_service",
|
||||||
|
new=AsyncMock(
|
||||||
|
return_value=[str(project_id) for project_id in range(1, 25)]
|
||||||
|
),
|
||||||
|
) as project_ids_loader,
|
||||||
|
patch(
|
||||||
|
"inse.dashboard.project_status_service.elasticsearch.search",
|
||||||
|
new=AsyncMock(return_value=status_aggregations),
|
||||||
|
),
|
||||||
|
):
|
||||||
|
result = await get_dashboard_dfg_project_statuses(
|
||||||
|
ORG_INSTITUTION_ID,
|
||||||
|
"University Hospital Essen",
|
||||||
|
)
|
||||||
|
|
||||||
|
project_ids_loader.assert_awaited_once_with(
|
||||||
|
ORG_INSTITUTION_ID,
|
||||||
|
from_year=None,
|
||||||
|
to_year=None,
|
||||||
|
)
|
||||||
|
assert result.ongoing == 7
|
||||||
|
assert result.completed == 17
|
||||||
|
assert result.ongoing + result.upcoming + result.completed == 24
|
||||||
|
|
||||||
|
|
||||||
def test_project_status_period_uses_interval_overlap():
|
def test_project_status_period_uses_interval_overlap():
|
||||||
assert _project_boundary_year_filter(
|
assert _project_boundary_year_filter(
|
||||||
"startDate", "endDate", (2022, 2026), "iso"
|
"startDate", "endDate", (2022, 2026), "iso"
|
||||||
@@ -971,11 +1081,11 @@ def test_eu_author_count_groups_multiple_publications_by_project_id():
|
|||||||
works_response,
|
works_response,
|
||||||
doi_project_ids,
|
doi_project_ids,
|
||||||
ORG_INSTITUTION_ID,
|
ORG_INSTITUTION_ID,
|
||||||
{"https://openalex.org/A5007170803"},
|
|
||||||
)
|
)
|
||||||
|
|
||||||
assert [author.model_dump() for author in result] == [
|
assert [author.model_dump() for author in result] == [
|
||||||
{"id": "A5007170803", "name": "Marcus Example", "count": 1}
|
{"id": "A999", "name": "External Example", "count": 1},
|
||||||
|
{"id": "A5007170803", "name": "Marcus Example", "count": 1},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@@ -1618,6 +1728,161 @@ def test_get_dashboard_organization_uses_effective_organization():
|
|||||||
assert result.openalex_institution_id == "I456"
|
assert result.openalex_institution_id == "I456"
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.anyio
|
||||||
|
async def test_dashboard_institutions_include_openalex_associations():
|
||||||
|
engine = create_engine("sqlite://", connect_args={"check_same_thread": False})
|
||||||
|
SQLModel.metadata.create_all(engine)
|
||||||
|
|
||||||
|
with Session(engine) as session:
|
||||||
|
organization = Organization(
|
||||||
|
name="Example University",
|
||||||
|
openalex_institution_id="I123",
|
||||||
|
)
|
||||||
|
session.add(organization)
|
||||||
|
session.commit()
|
||||||
|
session.refresh(organization)
|
||||||
|
session.add(
|
||||||
|
OrganizationInstitution(
|
||||||
|
organization_id=organization.id,
|
||||||
|
openalex_institution_id="I123",
|
||||||
|
position=0,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
session.commit()
|
||||||
|
|
||||||
|
associations = [
|
||||||
|
InstitutionAssociationsResponse(
|
||||||
|
id="I123",
|
||||||
|
display_name="Main institution",
|
||||||
|
associated_institutions=[
|
||||||
|
InstitutionAssociation(
|
||||||
|
id="I456",
|
||||||
|
display_name="Child institution",
|
||||||
|
relationship="child",
|
||||||
|
),
|
||||||
|
InstitutionAssociation(
|
||||||
|
id="I789",
|
||||||
|
display_name="Related institution",
|
||||||
|
relationship="related",
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
]
|
||||||
|
with patch(
|
||||||
|
"inse.dashboard.service.organization_management_service."
|
||||||
|
"resolve_institution_associations",
|
||||||
|
new=AsyncMock(return_value=associations),
|
||||||
|
):
|
||||||
|
result = await get_dashboard_institutions(session, organization)
|
||||||
|
|
||||||
|
assert [institution.model_dump() for institution in result] == [
|
||||||
|
{"id": "I123", "display_name": "Main institution"},
|
||||||
|
{"id": "I456", "display_name": "Child institution"},
|
||||||
|
{"id": "I789", "display_name": "Related institution"},
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.anyio
|
||||||
|
async def test_dashboard_analytical_institution_all_uses_root_organization():
|
||||||
|
engine = create_engine("sqlite://", connect_args={"check_same_thread": False})
|
||||||
|
SQLModel.metadata.create_all(engine)
|
||||||
|
|
||||||
|
with Session(engine) as session:
|
||||||
|
organization = Organization(
|
||||||
|
name="Example University",
|
||||||
|
openalex_institution_id="I123",
|
||||||
|
)
|
||||||
|
session.add(organization)
|
||||||
|
session.commit()
|
||||||
|
session.refresh(organization)
|
||||||
|
|
||||||
|
result = await get_dashboard_analytical_institution(
|
||||||
|
session,
|
||||||
|
organization,
|
||||||
|
"all",
|
||||||
|
)
|
||||||
|
|
||||||
|
assert result == ("I123", "Example University")
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.anyio
|
||||||
|
async def test_dashboard_analytical_institution_uses_selected_tab_institution():
|
||||||
|
engine = create_engine("sqlite://", connect_args={"check_same_thread": False})
|
||||||
|
SQLModel.metadata.create_all(engine)
|
||||||
|
|
||||||
|
with Session(engine) as session:
|
||||||
|
organization = Organization(
|
||||||
|
name="Example University",
|
||||||
|
openalex_institution_id="I123",
|
||||||
|
)
|
||||||
|
session.add(organization)
|
||||||
|
session.commit()
|
||||||
|
session.refresh(organization)
|
||||||
|
session.add(
|
||||||
|
OrganizationInstitution(
|
||||||
|
organization_id=organization.id,
|
||||||
|
openalex_institution_id="I123",
|
||||||
|
position=0,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
session.commit()
|
||||||
|
|
||||||
|
associations = [
|
||||||
|
InstitutionAssociationsResponse(
|
||||||
|
id="I123",
|
||||||
|
display_name="Main institution",
|
||||||
|
associated_institutions=[
|
||||||
|
InstitutionAssociation(
|
||||||
|
id="I456",
|
||||||
|
display_name="Child institution",
|
||||||
|
relationship="child",
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
]
|
||||||
|
with patch(
|
||||||
|
"inse.dashboard.service.organization_management_service."
|
||||||
|
"resolve_institution_associations",
|
||||||
|
new=AsyncMock(return_value=associations),
|
||||||
|
):
|
||||||
|
result = await get_dashboard_analytical_institution(
|
||||||
|
session,
|
||||||
|
organization,
|
||||||
|
"https://openalex.org/I456",
|
||||||
|
)
|
||||||
|
|
||||||
|
assert result == ("I456", "Child institution")
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.anyio
|
||||||
|
async def test_dashboard_analytical_institution_rejects_unassociated_selection():
|
||||||
|
engine = create_engine("sqlite://", connect_args={"check_same_thread": False})
|
||||||
|
SQLModel.metadata.create_all(engine)
|
||||||
|
|
||||||
|
with Session(engine) as session:
|
||||||
|
organization = Organization(
|
||||||
|
name="Example University",
|
||||||
|
openalex_institution_id="I123",
|
||||||
|
)
|
||||||
|
session.add(organization)
|
||||||
|
session.commit()
|
||||||
|
session.refresh(organization)
|
||||||
|
|
||||||
|
with patch(
|
||||||
|
"inse.dashboard.service.organization_management_service."
|
||||||
|
"resolve_institution_associations",
|
||||||
|
new=AsyncMock(return_value=[]),
|
||||||
|
):
|
||||||
|
with pytest.raises(HTTPException) as exc_info:
|
||||||
|
await get_dashboard_analytical_institution(
|
||||||
|
session,
|
||||||
|
organization,
|
||||||
|
"I999",
|
||||||
|
)
|
||||||
|
|
||||||
|
assert exc_info.value.status_code == 422
|
||||||
|
|
||||||
|
|
||||||
def test_get_dashboard_organization_rejects_missing_openalex_id():
|
def test_get_dashboard_organization_rejects_missing_openalex_id():
|
||||||
engine = create_engine("sqlite://", connect_args={"check_same_thread": False})
|
engine = create_engine("sqlite://", connect_args={"check_same_thread": False})
|
||||||
SQLModel.metadata.create_all(engine)
|
SQLModel.metadata.create_all(engine)
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ async def get_top_authors(
|
|||||||
"eu_projects",
|
"eu_projects",
|
||||||
_top_eu_project_publication_authors(
|
_top_eu_project_publication_authors(
|
||||||
normalized_id,
|
normalized_id,
|
||||||
authors,
|
|
||||||
from_year=period[0],
|
from_year=period[0],
|
||||||
to_year=period[1],
|
to_year=period[1],
|
||||||
),
|
),
|
||||||
@@ -152,12 +151,10 @@ async def get_top_eu_project_authors(
|
|||||||
) -> TopAuthorAnalysis:
|
) -> TopAuthorAnalysis:
|
||||||
normalized_id = _normalize_institution_id(institution_id)
|
normalized_id = _normalize_institution_id(institution_id)
|
||||||
period = _period(from_year=from_year, to_year=to_year)
|
period = _period(from_year=from_year, to_year=to_year)
|
||||||
authors = await _safe_institution_authors(normalized_id)
|
|
||||||
return TopAuthorAnalysis(
|
return TopAuthorAnalysis(
|
||||||
institution_id=normalized_id,
|
institution_id=normalized_id,
|
||||||
authors=await _top_eu_project_publication_authors(
|
authors=await _top_eu_project_publication_authors(
|
||||||
normalized_id,
|
normalized_id,
|
||||||
authors,
|
|
||||||
from_year=period[0],
|
from_year=period[0],
|
||||||
to_year=period[1],
|
to_year=period[1],
|
||||||
),
|
),
|
||||||
@@ -825,18 +822,9 @@ async def _top_patent_authors(
|
|||||||
|
|
||||||
async def _top_eu_project_publication_authors(
|
async def _top_eu_project_publication_authors(
|
||||||
institution_id: str,
|
institution_id: str,
|
||||||
institution_authors: list[dict[str, Any]],
|
|
||||||
from_year: int | None = None,
|
from_year: int | None = None,
|
||||||
to_year: int | None = None,
|
to_year: int | None = None,
|
||||||
) -> list[TopAuthor]:
|
) -> list[TopAuthor]:
|
||||||
institution_author_ids = {
|
|
||||||
author_id
|
|
||||||
for author in institution_authors
|
|
||||||
if (author_id := _normalize_author_id(author.get("id")))
|
|
||||||
}
|
|
||||||
if not institution_author_ids:
|
|
||||||
return []
|
|
||||||
|
|
||||||
# Candidate discovery is deliberately all-time. The selected period is
|
# Candidate discovery is deliberately all-time. The selected period is
|
||||||
# applied to each person's authoritative project count below. Otherwise a
|
# applied to each person's authoritative project count below. Otherwise a
|
||||||
# person can disappear merely because their recent projects have no linked
|
# person can disappear merely because their recent projects have no linked
|
||||||
@@ -889,7 +877,6 @@ async def _top_eu_project_publication_authors(
|
|||||||
works_response,
|
works_response,
|
||||||
doi_project_ids,
|
doi_project_ids,
|
||||||
institution_id,
|
institution_id,
|
||||||
institution_author_ids,
|
|
||||||
limit=None,
|
limit=None,
|
||||||
)
|
)
|
||||||
ranked = await _count_eu_projects_for_candidates(
|
ranked = await _count_eu_projects_for_candidates(
|
||||||
@@ -976,7 +963,6 @@ def _openalex_work_authors_by_eu_projects(
|
|||||||
response: dict[str, Any],
|
response: dict[str, Any],
|
||||||
doi_project_ids: dict[str, set[str]],
|
doi_project_ids: dict[str, set[str]],
|
||||||
institution_id: str,
|
institution_id: str,
|
||||||
institution_author_ids: set[str],
|
|
||||||
limit: int | None = TOP_AUTHOR_LIMIT,
|
limit: int | None = TOP_AUTHOR_LIMIT,
|
||||||
) -> list[TopAuthor]:
|
) -> list[TopAuthor]:
|
||||||
# Count unique CORDIS projects per author, not publications. Multiple works
|
# Count unique CORDIS projects per author, not publications. Multiple works
|
||||||
@@ -999,11 +985,7 @@ def _openalex_work_authors_by_eu_projects(
|
|||||||
author = authorship.get("author") or {}
|
author = authorship.get("author") or {}
|
||||||
author_id = _normalize_author_id(author.get("id"))
|
author_id = _normalize_author_id(author.get("id"))
|
||||||
author_name = str(author.get("display_name") or "").strip()
|
author_name = str(author.get("display_name") or "").strip()
|
||||||
if (
|
if not author_id or not author_name:
|
||||||
not author_id
|
|
||||||
or author_id not in institution_author_ids
|
|
||||||
or not author_name
|
|
||||||
):
|
|
||||||
continue
|
continue
|
||||||
author_project_ids[author_id].update(project_ids)
|
author_project_ids[author_id].update(project_ids)
|
||||||
author_names.setdefault(author_id, author_name)
|
author_names.setdefault(author_id, author_name)
|
||||||
|
|||||||
@@ -352,6 +352,12 @@ async def get_institution_associations(
|
|||||||
institution_ids: list[str],
|
institution_ids: list[str],
|
||||||
) -> list[InstitutionAssociationsResponse]:
|
) -> list[InstitutionAssociationsResponse]:
|
||||||
_require_super_admin(access_token)
|
_require_super_admin(access_token)
|
||||||
|
return await resolve_institution_associations(institution_ids)
|
||||||
|
|
||||||
|
|
||||||
|
async def resolve_institution_associations(
|
||||||
|
institution_ids: list[str],
|
||||||
|
) -> list[InstitutionAssociationsResponse]:
|
||||||
clean_ids = _normalize_institution_ids(institution_ids)
|
clean_ids = _normalize_institution_ids(institution_ids)
|
||||||
if not clean_ids:
|
if not clean_ids:
|
||||||
return []
|
return []
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ class OrgPatentsSearchClient:
|
|||||||
|
|
||||||
async def search_by_institution(
|
async def search_by_institution(
|
||||||
self,
|
self,
|
||||||
institution_id: str,
|
institution_id: str | list[str],
|
||||||
match_type: MatchTypeFilter = "all",
|
match_type: MatchTypeFilter = "all",
|
||||||
page: int = 0,
|
page: int = 0,
|
||||||
size: int = DEFAULT_PAGE_SIZE,
|
size: int = DEFAULT_PAGE_SIZE,
|
||||||
@@ -259,8 +259,16 @@ class OrgPatentsSearchClient:
|
|||||||
from_year: int | None = None,
|
from_year: int | None = None,
|
||||||
to_year: int | None = None,
|
to_year: int | None = None,
|
||||||
) -> tuple[list[OrgPatentEntry], int]:
|
) -> tuple[list[OrgPatentEntry], int]:
|
||||||
short_id = institution_id.replace("https://openalex.org/", "").upper()
|
institution_ids = (
|
||||||
filters: list[dict[str, Any]] = [{"term": {"institution_id": short_id}}]
|
institution_id if isinstance(institution_id, list) else [institution_id]
|
||||||
|
)
|
||||||
|
short_ids = [
|
||||||
|
value.replace("https://openalex.org/", "").upper()
|
||||||
|
for value in institution_ids
|
||||||
|
]
|
||||||
|
filters: list[dict[str, Any]] = [
|
||||||
|
{"terms": {"institution_id": short_ids}}
|
||||||
|
]
|
||||||
|
|
||||||
if match_type == "institution":
|
if match_type == "institution":
|
||||||
filters.append({"terms": {"match_type": ["institution", "both"]}})
|
filters.append({"terms": {"match_type": ["institution", "both"]}})
|
||||||
|
|||||||
@@ -528,6 +528,9 @@ async def get_person_by_id(
|
|||||||
career_metrics=career_metrics,
|
career_metrics=career_metrics,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if custom_author.topics:
|
||||||
|
await enrich_topic_descriptions(custom_author.topics)
|
||||||
|
|
||||||
return CustomAuthorsListResponse(results=[custom_author])
|
return CustomAuthorsListResponse(results=[custom_author])
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -508,7 +508,7 @@ def _eu_sort_field(sort_by: str) -> str:
|
|||||||
"id": "id",
|
"id": "id",
|
||||||
"project_type": "_index",
|
"project_type": "_index",
|
||||||
}
|
}
|
||||||
return mapping.get(sort_by, "title.keyword")
|
return mapping.get(sort_by, "")
|
||||||
|
|
||||||
|
|
||||||
async def get_eu_project_ids_by_organization_filters(
|
async def get_eu_project_ids_by_organization_filters(
|
||||||
@@ -959,7 +959,7 @@ async def search_eu_cordis_projects(
|
|||||||
framework_programmes: list[str] | None = None,
|
framework_programmes: list[str] | None = None,
|
||||||
funding_schemes: list[str] | None = None,
|
funding_schemes: list[str] | None = None,
|
||||||
statuses: list[str] | None = None,
|
statuses: list[str] | None = None,
|
||||||
sort_by: str = "title",
|
sort_by: str = "",
|
||||||
sort_direction: str = "asc",
|
sort_direction: str = "asc",
|
||||||
fuzzy: bool = False,
|
fuzzy: bool = False,
|
||||||
skip_enrichment: bool = False,
|
skip_enrichment: bool = False,
|
||||||
|
|||||||
@@ -364,7 +364,7 @@ async def search_dfg_projects(
|
|||||||
title: str | None = None,
|
title: str | None = None,
|
||||||
funding_start_years: list[str] | None = None,
|
funding_start_years: list[str] | None = None,
|
||||||
funding_end_years: list[str] | None = None,
|
funding_end_years: list[str] | None = None,
|
||||||
sort_by: str = "id",
|
sort_by: str = "",
|
||||||
sort_direction: str = "asc",
|
sort_direction: str = "asc",
|
||||||
fuzzy: bool = False,
|
fuzzy: bool = False,
|
||||||
skip_enrichment: bool = False,
|
skip_enrichment: bool = False,
|
||||||
@@ -435,64 +435,89 @@ async def search_dfg_projects(
|
|||||||
|
|
||||||
elif keywords:
|
elif keywords:
|
||||||
keyword_clauses = []
|
keyword_clauses = []
|
||||||
|
#Add highlighting for the title and abstract fields
|
||||||
|
title_abstract_query = {
|
||||||
|
"bool": {
|
||||||
|
"should": [
|
||||||
|
{
|
||||||
|
"multi_match": {
|
||||||
|
"query": keyword,
|
||||||
|
"fields": ["title_de", "title_en", "abstract_de", "abstract_en"],
|
||||||
|
"type": "phrase_prefix",
|
||||||
|
"max_expansions": 100,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for keyword in keywords if keyword.strip()
|
||||||
|
],
|
||||||
|
"minimum_should_match": 1,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
body["highlight"] = {
|
||||||
|
"fragment_size": 200,
|
||||||
|
"number_of_fragments": 0,
|
||||||
|
"pre_tags": ["<em>"],
|
||||||
|
"post_tags": ["</em>"],
|
||||||
|
"require_field_match": True,
|
||||||
|
"fields": {
|
||||||
|
"title_de": {"highlight_query": title_abstract_query},
|
||||||
|
"title_en": {"highlight_query": title_abstract_query},
|
||||||
|
"abstract_de": {"highlight_query": title_abstract_query},
|
||||||
|
"abstract_en": {"highlight_query": title_abstract_query},
|
||||||
|
},
|
||||||
|
}
|
||||||
for keyword in keywords:
|
for keyword in keywords:
|
||||||
if keyword.strip() == "":
|
if keyword.strip() == "":
|
||||||
continue
|
continue
|
||||||
keyword_clauses.append(
|
keyword_clauses.append({
|
||||||
{
|
|
||||||
"bool": {
|
"bool": {
|
||||||
"should": [
|
"should": [
|
||||||
{
|
{
|
||||||
"multi_match": {
|
"multi_match": {
|
||||||
"query": keyword,
|
"query": keyword,
|
||||||
"fields": [
|
"fields": ["title_de^4", "title_en^4", "abstract_de^2", "abstract_en^2"],
|
||||||
"title_de",
|
|
||||||
"title_en",
|
|
||||||
"abstract_de",
|
|
||||||
"abstract_en",
|
|
||||||
],
|
|
||||||
"type": "phrase_prefix",
|
"type": "phrase_prefix",
|
||||||
"max_expansions": 100,
|
"max_expansions": 100,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nested": {
|
"nested": {
|
||||||
"path": "subject_classifications",
|
"path": "subject_classifications",
|
||||||
"query": {
|
"query": {
|
||||||
"multi_match": {
|
"multi_match": {
|
||||||
"query": keyword,
|
"query": keyword,
|
||||||
"fields": [
|
"fields": [
|
||||||
"subject_classifications.fach",
|
"subject_classifications.fach^4",
|
||||||
"subject_classifications.fachkollegium",
|
"subject_classifications.fachkollegium^4",
|
||||||
"subject_classifications.fachgebiet",
|
"subject_classifications.fachgebiet^4",
|
||||||
"subject_classifications.fachgebiet_de",
|
"subject_classifications.fachgebiet_de^4",
|
||||||
"subject_classifications.wissenschaftsbereich",
|
"subject_classifications.wissenschaftsbereich^4",
|
||||||
],
|
],
|
||||||
"type": "phrase_prefix",
|
"type": "phrase_prefix",
|
||||||
"max_expansions": 100,
|
"max_expansions": 100,
|
||||||
}
|
|
||||||
},
|
|
||||||
"inner_hits": {
|
|
||||||
"name": keyword,
|
|
||||||
"highlight": {
|
|
||||||
"fields": {
|
|
||||||
"subject_classifications.fach": {},
|
|
||||||
"subject_classifications.fachkollegium": {},
|
|
||||||
"subject_classifications.fachgebiet": {},
|
|
||||||
"subject_classifications.fachgebiet_de": {},
|
|
||||||
"subject_classifications.wissenschaftsbereich": {},
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
"inner_hits": {
|
||||||
}
|
"name": keyword,
|
||||||
},
|
"highlight": {
|
||||||
|
"fields": {
|
||||||
|
"subject_classifications.fach": {},
|
||||||
|
"subject_classifications.fachkollegium": {},
|
||||||
|
"subject_classifications.fachgebiet": {},
|
||||||
|
"subject_classifications.fachgebiet_de": {},
|
||||||
|
"subject_classifications.wissenschaftsbereich": {},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
],
|
],
|
||||||
"minimum_should_match": 1,
|
"minimum_should_match": 1,
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
)
|
|
||||||
if keyword_clauses:
|
if keyword_clauses:
|
||||||
must_clauses.append({"bool": {"should": keyword_clauses, "minimum_should_match": 1}})
|
must_clauses.append({"bool": {"should": keyword_clauses, "minimum_should_match": 1}})
|
||||||
|
|
||||||
# === Additional independent filters (applied regardless of fuzzy/keyword mode) ===
|
# === Additional independent filters (applied regardless of fuzzy/keyword mode) ===
|
||||||
if filter_topic_ids:
|
if filter_topic_ids:
|
||||||
@@ -634,25 +659,13 @@ async def search_dfg_projects(
|
|||||||
elif sort_by == "professional_classification":
|
elif sort_by == "professional_classification":
|
||||||
sort_config = {"subject_area_de.keyword": {"order": sort_direction}}
|
sort_config = {"subject_area_de.keyword": {"order": sort_direction}}
|
||||||
else:
|
else:
|
||||||
sort_config = {"id": {"order": sort_direction}}
|
sort_config = {"_score": {"order": "desc"}}
|
||||||
|
|
||||||
body["sort"] = [sort_config]
|
body["sort"] = [sort_config]
|
||||||
|
|
||||||
#Add highlighting for the title and abstract fields
|
|
||||||
body["highlight"] = {
|
|
||||||
"fields": {
|
|
||||||
"title_de": {},
|
|
||||||
"title_en": {},
|
|
||||||
"abstract_de": {},
|
|
||||||
"abstract_en": {},
|
|
||||||
},
|
|
||||||
"pre_tags": ["<em>"],
|
|
||||||
"post_tags": ["</em>"],
|
|
||||||
"require_field_match": True,
|
|
||||||
}
|
|
||||||
# print(f"Executing DFG project search with body: {json.dumps(body, indent=2)}")
|
# print(f"Executing DFG project search with body: {json.dumps(body, indent=2)}")
|
||||||
# === Execute Search ===
|
# === Execute Search ===
|
||||||
# print(f"Executing DFG project search with body: {body}")
|
print(f"Executing DFG project search with body: {body}")
|
||||||
response = await elasticsearch.search(
|
response = await elasticsearch.search(
|
||||||
index=ESIndex.DFG_PROJECTS,
|
index=ESIndex.DFG_PROJECTS,
|
||||||
body=body,
|
body=body,
|
||||||
@@ -909,7 +922,7 @@ async def search_bund_projects_with_filters(
|
|||||||
countries: list[str] | None = None,
|
countries: list[str] | None = None,
|
||||||
page: int = 0,
|
page: int = 0,
|
||||||
size: int = 10,
|
size: int = 10,
|
||||||
sort_by: str = "title",
|
sort_by: str = "",
|
||||||
sort_direction: str = "asc",
|
sort_direction: str = "asc",
|
||||||
fuzzy: bool = False,
|
fuzzy: bool = False,
|
||||||
skip_topic_enrichment: bool = False,
|
skip_topic_enrichment: bool = False,
|
||||||
@@ -993,19 +1006,31 @@ async def search_bund_projects_with_filters(
|
|||||||
|
|
||||||
elif keywords:
|
elif keywords:
|
||||||
keyword_clauses = []
|
keyword_clauses = []
|
||||||
|
#Add highlighting for the title and abstract fields
|
||||||
|
body["highlight"] = {
|
||||||
|
"fields": {
|
||||||
|
"Verbundprojekt": {},
|
||||||
|
"Thema": {},
|
||||||
|
"Zuwendungsempfänger": {},
|
||||||
|
"Ausführende Stelle": {},
|
||||||
|
},
|
||||||
|
"pre_tags": ["<em>"],
|
||||||
|
"post_tags": ["</em>"],
|
||||||
|
"require_field_match": True,
|
||||||
|
}
|
||||||
for kw in keywords:
|
for kw in keywords:
|
||||||
if kw.strip() == "":
|
if kw.strip() == "":
|
||||||
continue
|
continue
|
||||||
keyword_clauses.append({
|
keyword_clauses.append({
|
||||||
"multi_match": {
|
"multi_match": {
|
||||||
"query": kw,
|
"query": kw,
|
||||||
"fields": ["Verbundprojekt","Thema"], # searching title/acronym field
|
"fields": ["Verbundprojekt^4","Thema^4"],
|
||||||
"type": "phrase_prefix",
|
"type": "phrase_prefix",
|
||||||
"max_expansions": 100,
|
"max_expansions": 100,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if keyword_clauses:
|
if keyword_clauses:
|
||||||
must_clauses.append({"bool": {"must": keyword_clauses}})
|
must_clauses.append({"bool": {"should": keyword_clauses, "minimum_should_match": 1}})
|
||||||
|
|
||||||
# === Additional independent filters (applied regardless of fuzzy/keyword mode) ===
|
# === Additional independent filters (applied regardless of fuzzy/keyword mode) ===
|
||||||
if filter_topic_ids:
|
if filter_topic_ids:
|
||||||
@@ -1071,7 +1096,7 @@ async def search_bund_projects_with_filters(
|
|||||||
sort_direction = sort_direction.strip().lower()
|
sort_direction = sort_direction.strip().lower()
|
||||||
if sort_direction not in ("asc", "desc"):
|
if sort_direction not in ("asc", "desc"):
|
||||||
sort_direction = "asc"
|
sort_direction = "asc"
|
||||||
|
sort_config = {}
|
||||||
if sort_by == "title":
|
if sort_by == "title":
|
||||||
sort_config = {"Verbundprojekt.keyword": {"order": sort_direction}}
|
sort_config = {"Verbundprojekt.keyword": {"order": sort_direction}}
|
||||||
elif sort_by == "funding_start":
|
elif sort_by == "funding_start":
|
||||||
@@ -1079,22 +1104,9 @@ async def search_bund_projects_with_filters(
|
|||||||
elif sort_by == "funding_end":
|
elif sort_by == "funding_end":
|
||||||
sort_config = {"funding_end": {"order": sort_direction}}
|
sort_config = {"funding_end": {"order": sort_direction}}
|
||||||
else:
|
else:
|
||||||
# Fallback to project ID
|
sort_config = "_score"
|
||||||
sort_config = {"Förderkennzeichen.keyword": {"order": sort_direction}}
|
|
||||||
|
|
||||||
body["sort"] = [sort_config]
|
body["sort"] = [sort_config]
|
||||||
#Add highlighting for the title and abstract fields
|
|
||||||
body["highlight"] = {
|
|
||||||
"fields": {
|
|
||||||
"Verbundprojekt": {},
|
|
||||||
"Thema": {},
|
|
||||||
"Zuwendungsempfänger": {},
|
|
||||||
"Ausführende Stelle": {},
|
|
||||||
},
|
|
||||||
"pre_tags": ["<em>"],
|
|
||||||
"post_tags": ["</em>"],
|
|
||||||
"require_field_match": True,
|
|
||||||
}
|
|
||||||
# print(f"Executing BUND project search with body: {json.dumps(body, indent=2)}")
|
# print(f"Executing BUND project search with body: {json.dumps(body, indent=2)}")
|
||||||
# === Execute Search ===
|
# === Execute Search ===
|
||||||
response = await elasticsearch.search(
|
response = await elasticsearch.search(
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ from inse.projects.model import (
|
|||||||
SortDirection,
|
SortDirection,
|
||||||
)
|
)
|
||||||
from inse.tags import Tags
|
from inse.tags import Tags
|
||||||
|
from inse.database import SessionDep
|
||||||
from inse.auth.service import can_fetch_gdpr_relevant_data
|
from inse.auth.service import can_fetch_gdpr_relevant_data
|
||||||
from fastapi import HTTPException as HttpException
|
from fastapi import HTTPException as HttpException
|
||||||
|
|
||||||
@@ -78,26 +79,36 @@ async def search_bund_projects(
|
|||||||
"model": DfgProjectPage,
|
"model": DfgProjectPage,
|
||||||
},
|
},
|
||||||
status.HTTP_404_NOT_FOUND: {"description": "Institution not found"},
|
status.HTTP_404_NOT_FOUND: {"description": "Institution not found"},
|
||||||
status.HTTP_403_FORBIDDEN: {"description": "Access denied for the provided institution ID"},
|
status.HTTP_403_FORBIDDEN: {
|
||||||
|
"description": "Access denied for the provided institution ID"
|
||||||
|
},
|
||||||
},
|
},
|
||||||
response_model_by_alias=False,
|
response_model_by_alias=False,
|
||||||
)
|
)
|
||||||
async def get_dfg_projects(
|
async def get_dfg_projects(
|
||||||
access_token_metadata: Annotated[AccessTokenMetadata, CurrentUserAccessTokenPayloadDep],
|
session: SessionDep,
|
||||||
|
access_token_metadata: Annotated[
|
||||||
|
AccessTokenMetadata, CurrentUserAccessTokenPayloadDep
|
||||||
|
],
|
||||||
institutions_search_client: Annotated[
|
institutions_search_client: Annotated[
|
||||||
InstitutionsSearchClient, Depends(get_institutions_search_client)
|
InstitutionsSearchClient, Depends(get_institutions_search_client)
|
||||||
],
|
],
|
||||||
raw_oa_institution_id: Annotated[
|
raw_oa_institution_id: Annotated[
|
||||||
str | None, Query(description="The openalex institution ID to filter by.")
|
str | None, Query(description="The openalex institution ID to filter by.")
|
||||||
] = None,
|
] = None,
|
||||||
author_id: Annotated[str | None, Query(description="The openalex author ID to filter by.")] = None,
|
author_id: Annotated[
|
||||||
author_filter_ids: Annotated[list[str] | None, Query(description="The dfg author IDs to filter by.")] = None,
|
str | None, Query(description="The openalex author ID to filter by.")
|
||||||
institution_ids: Annotated[list[str] | None, Query(description="The institution IDs to filter by.")] = None,
|
|
||||||
title: Annotated[
|
|
||||||
str | None, Query(description="The title to filter by.")
|
|
||||||
] = None,
|
] = None,
|
||||||
|
author_filter_ids: Annotated[
|
||||||
|
list[str] | None, Query(description="The dfg author IDs to filter by.")
|
||||||
|
] = None,
|
||||||
|
institution_ids: Annotated[
|
||||||
|
list[str] | None, Query(description="The institution IDs to filter by.")
|
||||||
|
] = None,
|
||||||
|
title: Annotated[str | None, Query(description="The title to filter by.")] = None,
|
||||||
keywords: Annotated[
|
keywords: Annotated[
|
||||||
list[str] | None, Query(description="Raw keywords to search in title/abstract/subject fields.")
|
list[str] | None,
|
||||||
|
Query(description="Raw keywords to search in title/abstract/subject fields."),
|
||||||
] = None,
|
] = None,
|
||||||
topic_ids: Annotated[
|
topic_ids: Annotated[
|
||||||
list[str] | None, Query(description="The openalex topic IDs to filter by.")
|
list[str] | None, Query(description="The openalex topic IDs to filter by.")
|
||||||
@@ -106,23 +117,27 @@ async def get_dfg_projects(
|
|||||||
list[str] | None,
|
list[str] | None,
|
||||||
Query(
|
Query(
|
||||||
description="Additional topic IDs to merge into the fuzzy topic-id resolution "
|
description="Additional topic IDs to merge into the fuzzy topic-id resolution "
|
||||||
"(union with topic_ids). Only used when fuzzy=True."
|
"(union with topic_ids). Only used when fuzzy=True."
|
||||||
),
|
),
|
||||||
] = None,
|
] = None,
|
||||||
funding_start_years: Annotated[list[str] | None, Query(description="The funding start years to filter by.")] = None,
|
funding_start_years: Annotated[
|
||||||
funding_end_years: Annotated[list[str] | None, Query(description="The funding end years to filter by.")] = None,
|
list[str] | None, Query(description="The funding start years to filter by.")
|
||||||
|
] = None,
|
||||||
|
funding_end_years: Annotated[
|
||||||
|
list[str] | None, Query(description="The funding end years to filter by.")
|
||||||
|
] = None,
|
||||||
page: Annotated[int, Query(description="The page number.", ge=0)] = 0,
|
page: Annotated[int, Query(description="The page number.", ge=0)] = 0,
|
||||||
size: Annotated[int, Query(description="The page size.", ge=1)] = 20,
|
size: Annotated[int, Query(description="The page size.", ge=1)] = 20,
|
||||||
sort_by: Annotated[str, Query(description="The field to sort by.")] = "title",
|
sort_by: Annotated[str, Query(description="The field to sort by.")] = "",
|
||||||
sort_direction: Annotated[
|
sort_direction: Annotated[
|
||||||
str, Query(description="The sort direction (asc or desc).")
|
str, Query(description="The sort direction (asc or desc).")
|
||||||
] = "asc",
|
] = "asc",
|
||||||
fuzzy: Annotated[
|
fuzzy: Annotated[
|
||||||
bool,
|
bool,
|
||||||
Query(description="Use topic_id resolution if True, otherwise use raw keyword search."),
|
Query(
|
||||||
|
description="Use topic_id resolution if True, otherwise use raw keyword search."
|
||||||
|
),
|
||||||
] = False,
|
] = False,
|
||||||
|
|
||||||
) -> DfgProjectPage:
|
) -> DfgProjectPage:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"Received request to get DFG projects for author_id=%s, author_filter_ids=%s, "
|
"Received request to get DFG projects for author_id=%s, author_filter_ids=%s, "
|
||||||
@@ -144,8 +159,13 @@ async def get_dfg_projects(
|
|||||||
sort_direction,
|
sort_direction,
|
||||||
fuzzy,
|
fuzzy,
|
||||||
)
|
)
|
||||||
if (author_id or raw_oa_institution_id):
|
if author_id or raw_oa_institution_id:
|
||||||
is_allowed = await can_fetch_gdpr_relevant_data(access_token = access_token_metadata, raw_oa_author_id = author_id, raw_oa_institution_id = raw_oa_institution_id)
|
is_allowed = await can_fetch_gdpr_relevant_data(
|
||||||
|
session=session,
|
||||||
|
access_token=access_token_metadata,
|
||||||
|
raw_oa_author_id=author_id,
|
||||||
|
raw_oa_institution_id=raw_oa_institution_id,
|
||||||
|
)
|
||||||
if not is_allowed:
|
if not is_allowed:
|
||||||
raise HttpException(
|
raise HttpException(
|
||||||
status_code=403,
|
status_code=403,
|
||||||
@@ -170,6 +190,7 @@ async def get_dfg_projects(
|
|||||||
fuzzy=fuzzy,
|
fuzzy=fuzzy,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/dfg/{id}",
|
"/dfg/{id}",
|
||||||
summary="Get a single DFG project.",
|
summary="Get a single DFG project.",
|
||||||
@@ -204,12 +225,17 @@ async def get_single_dfg_project(
|
|||||||
"model": BundProjectPage,
|
"model": BundProjectPage,
|
||||||
},
|
},
|
||||||
status.HTTP_404_NOT_FOUND: {"description": "Institution not found"},
|
status.HTTP_404_NOT_FOUND: {"description": "Institution not found"},
|
||||||
status.HTTP_403_FORBIDDEN: {"description": "Access denied for the provided institution ID"},
|
status.HTTP_403_FORBIDDEN: {
|
||||||
|
"description": "Access denied for the provided institution ID"
|
||||||
|
},
|
||||||
},
|
},
|
||||||
response_model_by_alias=False,
|
response_model_by_alias=False,
|
||||||
)
|
)
|
||||||
async def search_bund_projects(
|
async def search_bund_projects(
|
||||||
access_token_metadata: Annotated[AccessTokenMetadata, CurrentUserAccessTokenPayloadDep],
|
session: SessionDep,
|
||||||
|
access_token_metadata: Annotated[
|
||||||
|
AccessTokenMetadata, CurrentUserAccessTokenPayloadDep
|
||||||
|
],
|
||||||
institutions_search_client: Annotated[
|
institutions_search_client: Annotated[
|
||||||
InstitutionsSearchClient, Depends(get_institutions_search_client)
|
InstitutionsSearchClient, Depends(get_institutions_search_client)
|
||||||
],
|
],
|
||||||
@@ -255,18 +281,25 @@ async def search_bund_projects(
|
|||||||
] = None,
|
] = None,
|
||||||
page: Annotated[int, Query(description="The page number.", ge=0)] = 0,
|
page: Annotated[int, Query(description="The page number.", ge=0)] = 0,
|
||||||
size: Annotated[int, Query(description="The page size.", ge=1)] = 20,
|
size: Annotated[int, Query(description="The page size.", ge=1)] = 20,
|
||||||
sort_by: Annotated[str, Query(description="Sort field.")] = "title",
|
sort_by: Annotated[str, Query(description="Sort field.")] = "",
|
||||||
sort_direction: Annotated[
|
sort_direction: Annotated[
|
||||||
str,
|
str,
|
||||||
Query(description="Sort direction: asc or desc."),
|
Query(description="Sort direction: asc or desc."),
|
||||||
] = "asc",
|
] = "asc",
|
||||||
fuzzy: Annotated[
|
fuzzy: Annotated[
|
||||||
bool,
|
bool,
|
||||||
Query(description="Use OpenAlex topic-id resolution if true, otherwise raw keyword search."),
|
Query(
|
||||||
|
description="Use OpenAlex topic-id resolution if true, otherwise raw keyword search."
|
||||||
|
),
|
||||||
] = False,
|
] = False,
|
||||||
) -> BundProjectPage:
|
) -> BundProjectPage:
|
||||||
if (raw_oa_institution_id):
|
if raw_oa_institution_id:
|
||||||
is_allowed = await can_fetch_gdpr_relevant_data(access_token = access_token_metadata, raw_oa_author_id = None, raw_oa_institution_id = raw_oa_institution_id)
|
is_allowed = await can_fetch_gdpr_relevant_data(
|
||||||
|
session=session,
|
||||||
|
access_token=access_token_metadata,
|
||||||
|
raw_oa_author_id=None,
|
||||||
|
raw_oa_institution_id=raw_oa_institution_id,
|
||||||
|
)
|
||||||
if not is_allowed:
|
if not is_allowed:
|
||||||
raise HttpException(
|
raise HttpException(
|
||||||
status_code=403,
|
status_code=403,
|
||||||
@@ -288,9 +321,10 @@ async def search_bund_projects(
|
|||||||
size=size,
|
size=size,
|
||||||
sort_by=sort_by,
|
sort_by=sort_by,
|
||||||
sort_direction=sort_direction,
|
sort_direction=sort_direction,
|
||||||
fuzzy=fuzzy
|
fuzzy=fuzzy,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/bund/{id}",
|
"/bund/{id}",
|
||||||
summary="Get a single BUND project.",
|
summary="Get a single BUND project.",
|
||||||
@@ -313,6 +347,7 @@ async def get_single_bund_project(
|
|||||||
project_id=id,
|
project_id=id,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
########
|
########
|
||||||
from inse.projects.model import EuCordisProjectSearchPage, EuCordisProjectType
|
from inse.projects.model import EuCordisProjectSearchPage, EuCordisProjectType
|
||||||
from inse.projects.service import search_eu_cordis_projects
|
from inse.projects.service import search_eu_cordis_projects
|
||||||
@@ -334,12 +369,17 @@ from inse.projects.service import search_eu_cordis_projects
|
|||||||
"model": EuCordisProjectSearchPage,
|
"model": EuCordisProjectSearchPage,
|
||||||
},
|
},
|
||||||
status.HTTP_404_NOT_FOUND: {"description": "Institution not found"},
|
status.HTTP_404_NOT_FOUND: {"description": "Institution not found"},
|
||||||
status.HTTP_403_FORBIDDEN: {"description": "Access denied for the provided institution ID"},
|
status.HTTP_403_FORBIDDEN: {
|
||||||
|
"description": "Access denied for the provided institution ID"
|
||||||
|
},
|
||||||
},
|
},
|
||||||
response_model_by_alias=False,
|
response_model_by_alias=False,
|
||||||
)
|
)
|
||||||
async def search_eu_cordis_projects_endpoint(
|
async def search_eu_cordis_projects_endpoint(
|
||||||
access_token_metadata: Annotated[AccessTokenMetadata, CurrentUserAccessTokenPayloadDep],
|
session: SessionDep,
|
||||||
|
access_token_metadata: Annotated[
|
||||||
|
AccessTokenMetadata, CurrentUserAccessTokenPayloadDep
|
||||||
|
],
|
||||||
institutions_search_client: Annotated[
|
institutions_search_client: Annotated[
|
||||||
InstitutionsSearchClient, Depends(get_institutions_search_client)
|
InstitutionsSearchClient, Depends(get_institutions_search_client)
|
||||||
],
|
],
|
||||||
@@ -353,15 +393,21 @@ async def search_eu_cordis_projects_endpoint(
|
|||||||
] = None,
|
] = None,
|
||||||
author_ids: Annotated[
|
author_ids: Annotated[
|
||||||
list[str] | None,
|
list[str] | None,
|
||||||
Query(description="Additional OpenAlex author IDs to filter by. All selected authors must match."),
|
Query(
|
||||||
|
description="Additional OpenAlex author IDs to filter by. All selected authors must match."
|
||||||
|
),
|
||||||
] = None,
|
] = None,
|
||||||
organization_ids: Annotated[
|
organization_ids: Annotated[
|
||||||
list[str] | None,
|
list[str] | None,
|
||||||
Query(description="CORDIS organisation IDs. All selected organizations must match."),
|
Query(
|
||||||
|
description="CORDIS organisation IDs. All selected organizations must match."
|
||||||
|
),
|
||||||
] = None,
|
] = None,
|
||||||
organization_names: Annotated[
|
organization_names: Annotated[
|
||||||
list[str] | None,
|
list[str] | None,
|
||||||
Query(description="CORDIS organization names. All selected organizations must match."),
|
Query(
|
||||||
|
description="CORDIS organization names. All selected organizations must match."
|
||||||
|
),
|
||||||
] = None,
|
] = None,
|
||||||
project_types: Annotated[
|
project_types: Annotated[
|
||||||
list[EuCordisProjectType] | None,
|
list[EuCordisProjectType] | None,
|
||||||
@@ -409,16 +455,17 @@ async def search_eu_cordis_projects_endpoint(
|
|||||||
] = None,
|
] = None,
|
||||||
page: Annotated[int, Query(description="The page number.", ge=0)] = 0,
|
page: Annotated[int, Query(description="The page number.", ge=0)] = 0,
|
||||||
size: Annotated[int, Query(description="The page size.", ge=1)] = 20,
|
size: Annotated[int, Query(description="The page size.", ge=1)] = 20,
|
||||||
sort_by: Annotated[str, Query(description="Sort field.")] = "title",
|
sort_by: Annotated[str, Query(description="Sort field.")] = "",
|
||||||
sort_direction: Annotated[
|
sort_direction: Annotated[
|
||||||
str,
|
str,
|
||||||
Query(description="Sort direction: asc or desc."),
|
Query(description="Sort direction: asc or desc."),
|
||||||
] = "asc",
|
] = "asc",
|
||||||
fuzzy: Annotated[
|
fuzzy: Annotated[
|
||||||
bool,
|
bool,
|
||||||
Query(description="Use OpenAlex topic-id resolution if true, otherwise raw keyword search."),
|
Query(
|
||||||
|
description="Use OpenAlex topic-id resolution if true, otherwise raw keyword search."
|
||||||
|
),
|
||||||
] = False,
|
] = False,
|
||||||
|
|
||||||
) -> EuCordisProjectSearchPage:
|
) -> EuCordisProjectSearchPage:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"Received EU CORDIS search request: raw_oa_institution_id=%s, "
|
"Received EU CORDIS search request: raw_oa_institution_id=%s, "
|
||||||
@@ -450,8 +497,13 @@ async def search_eu_cordis_projects_endpoint(
|
|||||||
sort_direction,
|
sort_direction,
|
||||||
fuzzy,
|
fuzzy,
|
||||||
)
|
)
|
||||||
if (author_id or raw_oa_institution_id):
|
if author_id or raw_oa_institution_id:
|
||||||
is_allowed = await can_fetch_gdpr_relevant_data(access_token = access_token_metadata, raw_oa_author_id = author_id, raw_oa_institution_id = raw_oa_institution_id)
|
is_allowed = await can_fetch_gdpr_relevant_data(
|
||||||
|
session=session,
|
||||||
|
access_token=access_token_metadata,
|
||||||
|
raw_oa_author_id=author_id,
|
||||||
|
raw_oa_institution_id=raw_oa_institution_id,
|
||||||
|
)
|
||||||
if not is_allowed:
|
if not is_allowed:
|
||||||
raise HttpException(
|
raise HttpException(
|
||||||
status_code=403,
|
status_code=403,
|
||||||
@@ -482,6 +534,7 @@ async def search_eu_cordis_projects_endpoint(
|
|||||||
fuzzy=fuzzy,
|
fuzzy=fuzzy,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/eu/{id}",
|
"/eu/{id}",
|
||||||
summary="Get a single EU Cordis project.",
|
summary="Get a single EU Cordis project.",
|
||||||
@@ -494,27 +547,29 @@ async def search_eu_cordis_projects_endpoint(
|
|||||||
},
|
},
|
||||||
status.HTTP_404_NOT_FOUND: {
|
status.HTTP_404_NOT_FOUND: {
|
||||||
"description": "Project not found",
|
"description": "Project not found",
|
||||||
"model": EuCordisProjectResponse
|
"model": EuCordisProjectResponse,
|
||||||
},
|
},
|
||||||
status.HTTP_500_INTERNAL_SERVER_ERROR: {
|
status.HTTP_500_INTERNAL_SERVER_ERROR: {
|
||||||
"description": "Internal server error",
|
"description": "Internal server error",
|
||||||
"model": EuCordisProjectResponse
|
"model": EuCordisProjectResponse,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
async def get_single_eu_cordis_project(
|
async def get_single_eu_cordis_project(
|
||||||
id: Annotated[str, Path(description="The ID of the EU Cordis project to retrieve.")],
|
id: Annotated[
|
||||||
|
str, Path(description="The ID of the EU Cordis project to retrieve.")
|
||||||
|
],
|
||||||
) -> EuCordisProjectResponse:
|
) -> EuCordisProjectResponse:
|
||||||
"""
|
"""
|
||||||
Get a single EU Cordis project by ID.
|
Get a single EU Cordis project by ID.
|
||||||
Returns a wrapper response containing the project data or error information.
|
Returns a wrapper response containing the project data or error information.
|
||||||
"""
|
"""
|
||||||
logger.debug(f"Received request to get single EU Cordis project for id={id}")
|
logger.debug(f"Received request to get single EU Cordis project for id={id}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Get the project from the service
|
# Get the project from the service
|
||||||
project = await projects_service.get_single_eu_cordis_project(project_id=id)
|
project = await projects_service.get_single_eu_cordis_project(project_id=id)
|
||||||
|
|
||||||
# Check if project exists
|
# Check if project exists
|
||||||
if project is None:
|
if project is None:
|
||||||
logger.warning(f"Project with ID {id} not found")
|
logger.warning(f"Project with ID {id} not found")
|
||||||
@@ -522,9 +577,9 @@ async def get_single_eu_cordis_project(
|
|||||||
success=False,
|
success=False,
|
||||||
project_type=None,
|
project_type=None,
|
||||||
eu_project_data=None,
|
eu_project_data=None,
|
||||||
error=f"Project with ID {id} not found"
|
error=f"Project with ID {id} not found",
|
||||||
)
|
)
|
||||||
|
|
||||||
# Determine the project type
|
# Determine the project type
|
||||||
if isinstance(project, Fp7ProjectDetails):
|
if isinstance(project, Fp7ProjectDetails):
|
||||||
project_type = "fp7"
|
project_type = "fp7"
|
||||||
@@ -539,24 +594,21 @@ async def get_single_eu_cordis_project(
|
|||||||
success=False,
|
success=False,
|
||||||
project_type=None,
|
project_type=None,
|
||||||
eu_project_data=None,
|
eu_project_data=None,
|
||||||
error=f"Unknown project type for ID {id}"
|
error=f"Unknown project type for ID {id}",
|
||||||
)
|
)
|
||||||
|
|
||||||
# Return success with the project data
|
# Return success with the project data
|
||||||
return EuCordisProjectResponse(
|
return EuCordisProjectResponse(
|
||||||
success=True,
|
success=True, project_type=project_type, eu_project_data=project, error=None
|
||||||
project_type=project_type,
|
|
||||||
eu_project_data=project,
|
|
||||||
error=None
|
|
||||||
)
|
)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error retrieving project with ID {id}: {e!s}", exc_info=True)
|
logger.error(f"Error retrieving project with ID {id}: {e!s}", exc_info=True)
|
||||||
return EuCordisProjectResponse(
|
return EuCordisProjectResponse(
|
||||||
success=False,
|
success=False,
|
||||||
project_type=None,
|
project_type=None,
|
||||||
eu_project_data=None,
|
eu_project_data=None,
|
||||||
error=f"Internal server error: {e!s}"
|
error=f"Internal server error: {e!s}",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -623,7 +675,9 @@ async def get_institution_bund_projects_funding_over_time(
|
|||||||
] = None,
|
] = None,
|
||||||
fuzzy: Annotated[
|
fuzzy: Annotated[
|
||||||
bool,
|
bool,
|
||||||
Query(description="Use OpenAlex topic-id resolution if true, otherwise raw keyword search."),
|
Query(
|
||||||
|
description="Use OpenAlex topic-id resolution if true, otherwise raw keyword search."
|
||||||
|
),
|
||||||
] = False,
|
] = False,
|
||||||
) -> InstitutionFunderSummary:
|
) -> InstitutionFunderSummary:
|
||||||
return await projects_service.get_institution_bund_projects_funding_over_time(
|
return await projects_service.get_institution_bund_projects_funding_over_time(
|
||||||
@@ -674,15 +728,21 @@ async def get_institution_cordis_eu_projects_funding_over_time(
|
|||||||
] = None,
|
] = None,
|
||||||
author_ids: Annotated[
|
author_ids: Annotated[
|
||||||
list[str] | None,
|
list[str] | None,
|
||||||
Query(description="Additional OpenAlex author IDs to filter by. All selected authors must match."),
|
Query(
|
||||||
|
description="Additional OpenAlex author IDs to filter by. All selected authors must match."
|
||||||
|
),
|
||||||
] = None,
|
] = None,
|
||||||
organization_ids: Annotated[
|
organization_ids: Annotated[
|
||||||
list[str] | None,
|
list[str] | None,
|
||||||
Query(description="CORDIS organisation IDs. All selected organizations must match."),
|
Query(
|
||||||
|
description="CORDIS organisation IDs. All selected organizations must match."
|
||||||
|
),
|
||||||
] = None,
|
] = None,
|
||||||
organization_names: Annotated[
|
organization_names: Annotated[
|
||||||
list[str] | None,
|
list[str] | None,
|
||||||
Query(description="CORDIS organization names. All selected organizations must match."),
|
Query(
|
||||||
|
description="CORDIS organization names. All selected organizations must match."
|
||||||
|
),
|
||||||
] = None,
|
] = None,
|
||||||
project_types: Annotated[
|
project_types: Annotated[
|
||||||
list[EuCordisProjectType] | None,
|
list[EuCordisProjectType] | None,
|
||||||
@@ -730,7 +790,9 @@ async def get_institution_cordis_eu_projects_funding_over_time(
|
|||||||
] = None,
|
] = None,
|
||||||
fuzzy: Annotated[
|
fuzzy: Annotated[
|
||||||
bool,
|
bool,
|
||||||
Query(description="Use OpenAlex topic-id resolution if true, otherwise raw keyword search."),
|
Query(
|
||||||
|
description="Use OpenAlex topic-id resolution if true, otherwise raw keyword search."
|
||||||
|
),
|
||||||
] = False,
|
] = False,
|
||||||
) -> InstitutionFunderSummary:
|
) -> InstitutionFunderSummary:
|
||||||
return await projects_service.get_institution_cordis_eu_projects_funding_over_time(
|
return await projects_service.get_institution_cordis_eu_projects_funding_over_time(
|
||||||
@@ -777,9 +839,7 @@ async def search_projects(
|
|||||||
description="The set of project types to filter by (e.g., 'bund', 'eu', 'dfg'). If not provided, projects of all types will be included."
|
description="The set of project types to filter by (e.g., 'bund', 'eu', 'dfg'). If not provided, projects of all types will be included."
|
||||||
),
|
),
|
||||||
] = None,
|
] = None,
|
||||||
title: Annotated[
|
title: Annotated[str | None, Query(description="The title to filter by.")] = None,
|
||||||
str | None, Query(description="The title to filter by.")
|
|
||||||
] = None,
|
|
||||||
sort_by: Annotated[
|
sort_by: Annotated[
|
||||||
ProjectsSortBy, Query(description="The field to sort by.")
|
ProjectsSortBy, Query(description="The field to sort by.")
|
||||||
] = ProjectsSortBy.TITLE,
|
] = ProjectsSortBy.TITLE,
|
||||||
@@ -794,4 +854,4 @@ async def search_projects(
|
|||||||
title=title,
|
title=title,
|
||||||
sort_by=sort_by,
|
sort_by=sort_by,
|
||||||
sort_direction=sort_direction,
|
sort_direction=sort_direction,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -184,12 +184,13 @@ async def get_dfg_projects(
|
|||||||
funding_end_years: list[str] | None,
|
funding_end_years: list[str] | None,
|
||||||
page: int,
|
page: int,
|
||||||
size: int,
|
size: int,
|
||||||
sort_by: str = "topic",
|
sort_by: str = "",
|
||||||
sort_direction: str = "asc",
|
sort_direction: str = "asc",
|
||||||
fuzzy: bool = False,
|
fuzzy: bool = False,
|
||||||
skip_enrichment: bool = False,
|
skip_enrichment: bool = False,
|
||||||
active_from_year: int | None = None,
|
active_from_year: int | None = None,
|
||||||
active_to_year: int | None = None,
|
active_to_year: int | None = None,
|
||||||
|
institution_aliases: list[str] | None = None,
|
||||||
) -> DfgProjectPage:
|
) -> DfgProjectPage:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"Fetching DFG projects for author_id=%s, author_filter_ids=%s, "
|
"Fetching DFG projects for author_id=%s, author_filter_ids=%s, "
|
||||||
@@ -251,18 +252,18 @@ async def get_dfg_projects(
|
|||||||
"No author names found for author_filter_ids=%s",
|
"No author names found for author_filter_ids=%s",
|
||||||
author_filter_ids_int,
|
author_filter_ids_int,
|
||||||
)
|
)
|
||||||
institution_aliases = []
|
resolved_institution_aliases = list(institution_aliases or [])
|
||||||
if raw_oa_institution_id:
|
if raw_oa_institution_id:
|
||||||
if institutions_search_client is None:
|
if institutions_search_client is None:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"institutions_search_client must be provided when raw_oa_institution_id is set"
|
"institutions_search_client must be provided when raw_oa_institution_id is set"
|
||||||
)
|
)
|
||||||
institution_aliases = (
|
resolved_institution_aliases.extend(
|
||||||
await institutions_search_client.get_institution_aliases_by_oa_institution_id(
|
await institutions_search_client.get_institution_aliases_by_oa_institution_id(
|
||||||
raw_oa_institution_id
|
raw_oa_institution_id
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if not institution_aliases:
|
if not resolved_institution_aliases:
|
||||||
return DfgProjectPage(
|
return DfgProjectPage(
|
||||||
elements=[],
|
elements=[],
|
||||||
page=page,
|
page=page,
|
||||||
@@ -272,7 +273,7 @@ async def get_dfg_projects(
|
|||||||
return await projects_search_client.search_dfg_projects(
|
return await projects_search_client.search_dfg_projects(
|
||||||
page=page,
|
page=page,
|
||||||
size=size,
|
size=size,
|
||||||
institution_aliases=institution_aliases,
|
institution_aliases=resolved_institution_aliases,
|
||||||
project_ids=author_project_ids,
|
project_ids=author_project_ids,
|
||||||
names=filter_names or [],
|
names=filter_names or [],
|
||||||
institution_ids=institution_ids_int,
|
institution_ids=institution_ids_int,
|
||||||
@@ -460,13 +461,14 @@ async def search_bund_projects_with_filters(
|
|||||||
countries: list[str] | None,
|
countries: list[str] | None,
|
||||||
page: int,
|
page: int,
|
||||||
size: int,
|
size: int,
|
||||||
sort_by: str = "title",
|
sort_by: str = "",
|
||||||
sort_direction: str = "asc",
|
sort_direction: str = "asc",
|
||||||
fuzzy: bool = False,
|
fuzzy: bool = False,
|
||||||
active_from_year: int | None = None,
|
active_from_year: int | None = None,
|
||||||
active_to_year: int | None = None,
|
active_to_year: int | None = None,
|
||||||
|
oa_institution_aliases: list[str] | None = None,
|
||||||
) -> BundProjectPage:
|
) -> BundProjectPage:
|
||||||
institution_aliases = []
|
institution_aliases = list(oa_institution_aliases or [])
|
||||||
if raw_oa_institution_id:
|
if raw_oa_institution_id:
|
||||||
if institutions_search_client is None:
|
if institutions_search_client is None:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
@@ -670,7 +672,7 @@ async def search_eu_cordis_projects(
|
|||||||
framework_programmes: list[str] | None = None,
|
framework_programmes: list[str] | None = None,
|
||||||
funding_schemes: list[str] | None = None,
|
funding_schemes: list[str] | None = None,
|
||||||
statuses: list[str] | None = None,
|
statuses: list[str] | None = None,
|
||||||
sort_by: str = "title",
|
sort_by: str = "",
|
||||||
sort_direction: str = "asc",
|
sort_direction: str = "asc",
|
||||||
fuzzy: bool = False,
|
fuzzy: bool = False,
|
||||||
skip_enrichment: bool = False,
|
skip_enrichment: bool = False,
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ from inse.models.openalex.topics_by_time import TopicsByTime
|
|||||||
from inse.models.openalex.topics_by_year import TopicsByYear
|
from inse.models.openalex.topics_by_year import TopicsByYear
|
||||||
from inse.models.openalex.work import Work
|
from inse.models.openalex.work import Work
|
||||||
from inse.models.openalex.work_page import WorkPage
|
from inse.models.openalex.work_page import WorkPage
|
||||||
|
from inse.models.openalex.work_topic import WorkTopic
|
||||||
|
from inse.models.openalex.work_topic_domain import WorkTopicDomain
|
||||||
|
from inse.models.openalex.work_topic_field import WorkTopicField
|
||||||
|
from inse.models.openalex.work_topic_subfield import WorkTopicSubfield
|
||||||
from inse.models.openalex.works_list_response import WorksListResponse
|
from inse.models.openalex.works_list_response import WorksListResponse
|
||||||
|
|
||||||
from .search_client import OpenAlexWorksSearchClient
|
from .search_client import OpenAlexWorksSearchClient
|
||||||
@@ -235,26 +239,39 @@ async def get_work(
|
|||||||
return elements[0]
|
return elements[0]
|
||||||
|
|
||||||
|
|
||||||
async def enrich_topic_descriptions(topics: list) -> None:
|
async def enrich_topic_descriptions(topics: list[WorkTopic]) -> None:
|
||||||
"""Batch-fill missing descriptions on dehydrated topics.
|
"""Batch-fill missing hierarchy metadata and descriptions on dehydrated topics.
|
||||||
|
|
||||||
OpenAlex work and author documents carry dehydrated topics without a
|
OpenAlex work and author documents carry dehydrated topics without a
|
||||||
description, so we batch-load the details from the openalex-topics index.
|
description, subfield, field, or domain, so we batch-load the details from
|
||||||
|
the openalex-topics index.
|
||||||
"""
|
"""
|
||||||
pending = [topic for topic in topics if topic.id and not topic.description]
|
pending = [
|
||||||
|
topic
|
||||||
|
for topic in topics
|
||||||
|
if topic.id and (not topic.description or not topic.var_field or not topic.domain)
|
||||||
|
]
|
||||||
|
|
||||||
if not pending:
|
if not pending:
|
||||||
return
|
return
|
||||||
|
|
||||||
details = await _get_topic_details(list({topic.id for topic in pending}))
|
details = await _get_topic_details(list({topic.id for topic in pending}))
|
||||||
|
|
||||||
if not details:
|
if not details:
|
||||||
return
|
return
|
||||||
|
|
||||||
for topic in pending:
|
for topic in pending:
|
||||||
info = details.get(topic.id)
|
info = details.get(topic.id)
|
||||||
if info:
|
if not info:
|
||||||
|
continue
|
||||||
|
|
||||||
|
if not topic.description:
|
||||||
topic.description = info.get("description")
|
topic.description = info.get("description")
|
||||||
|
if not topic.subfield and info.get("subfield"):
|
||||||
|
topic.subfield = WorkTopicSubfield.from_dict(info["subfield"])
|
||||||
|
if not topic.var_field and info.get("field"):
|
||||||
|
topic.var_field = WorkTopicField.from_dict(info["field"])
|
||||||
|
if not topic.domain and info.get("domain"):
|
||||||
|
topic.domain = WorkTopicDomain.from_dict(info["domain"])
|
||||||
|
|
||||||
|
|
||||||
async def _enrich_work_topic_descriptions(works: list[Work]) -> None:
|
async def _enrich_work_topic_descriptions(works: list[Work]) -> None:
|
||||||
|
|||||||
Generated
+88
@@ -712,6 +712,53 @@ wheels = [
|
|||||||
{ url = "https://files.pythonhosted.org/packages/df/b2/87e62e8c3e2f4b32e5fe99e0b86d576da1312593b39f47d8ceef365e95ed/packaging-26.2-py3-none-any.whl", hash = "sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e", size = 100195, upload-time = "2026-04-24T20:15:22.081Z" },
|
{ url = "https://files.pythonhosted.org/packages/df/b2/87e62e8c3e2f4b32e5fe99e0b86d576da1312593b39f47d8ceef365e95ed/packaging-26.2-py3-none-any.whl", hash = "sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e", size = 100195, upload-time = "2026-04-24T20:15:22.081Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pandas"
|
||||||
|
version = "2.3.3"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "numpy" },
|
||||||
|
{ name = "python-dateutil" },
|
||||||
|
{ name = "pytz" },
|
||||||
|
{ name = "tzdata" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/33/01/d40b85317f86cf08d853a4f495195c73815fdf205eef3993821720274518/pandas-2.3.3.tar.gz", hash = "sha256:e05e1af93b977f7eafa636d043f9f94c7ee3ac81af99c13508215942e64c993b", size = 4495223, upload-time = "2025-09-29T23:34:51.853Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/9c/fb/231d89e8637c808b997d172b18e9d4a4bc7bf31296196c260526055d1ea0/pandas-2.3.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:6d21f6d74eb1725c2efaa71a2bfc661a0689579b58e9c0ca58a739ff0b002b53", size = 11597846, upload-time = "2025-09-29T23:19:48.856Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/5c/bd/bf8064d9cfa214294356c2d6702b716d3cf3bb24be59287a6a21e24cae6b/pandas-2.3.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:3fd2f887589c7aa868e02632612ba39acb0b8948faf5cc58f0850e165bd46f35", size = 10729618, upload-time = "2025-09-29T23:39:08.659Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/57/56/cf2dbe1a3f5271370669475ead12ce77c61726ffd19a35546e31aa8edf4e/pandas-2.3.3-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ecaf1e12bdc03c86ad4a7ea848d66c685cb6851d807a26aa245ca3d2017a1908", size = 11737212, upload-time = "2025-09-29T23:19:59.765Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/e5/63/cd7d615331b328e287d8233ba9fdf191a9c2d11b6af0c7a59cfcec23de68/pandas-2.3.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b3d11d2fda7eb164ef27ffc14b4fcab16a80e1ce67e9f57e19ec0afaf715ba89", size = 12362693, upload-time = "2025-09-29T23:20:14.098Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/a6/de/8b1895b107277d52f2b42d3a6806e69cfef0d5cf1d0ba343470b9d8e0a04/pandas-2.3.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a68e15f780eddf2b07d242e17a04aa187a7ee12b40b930bfdd78070556550e98", size = 12771002, upload-time = "2025-09-29T23:20:26.76Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/87/21/84072af3187a677c5893b170ba2c8fbe450a6ff911234916da889b698220/pandas-2.3.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:371a4ab48e950033bcf52b6527eccb564f52dc826c02afd9a1bc0ab731bba084", size = 13450971, upload-time = "2025-09-29T23:20:41.344Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/86/41/585a168330ff063014880a80d744219dbf1dd7a1c706e75ab3425a987384/pandas-2.3.3-cp312-cp312-win_amd64.whl", hash = "sha256:a16dcec078a01eeef8ee61bf64074b4e524a2a3f4b3be9326420cabe59c4778b", size = 10992722, upload-time = "2025-09-29T23:20:54.139Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/cd/4b/18b035ee18f97c1040d94debd8f2e737000ad70ccc8f5513f4eefad75f4b/pandas-2.3.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:56851a737e3470de7fa88e6131f41281ed440d29a9268dcbf0002da5ac366713", size = 11544671, upload-time = "2025-09-29T23:21:05.024Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/31/94/72fac03573102779920099bcac1c3b05975c2cb5f01eac609faf34bed1ca/pandas-2.3.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:bdcd9d1167f4885211e401b3036c0c8d9e274eee67ea8d0758a256d60704cfe8", size = 10680807, upload-time = "2025-09-29T23:21:15.979Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/16/87/9472cf4a487d848476865321de18cc8c920b8cab98453ab79dbbc98db63a/pandas-2.3.3-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e32e7cc9af0f1cc15548288a51a3b681cc2a219faa838e995f7dc53dbab1062d", size = 11709872, upload-time = "2025-09-29T23:21:27.165Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/15/07/284f757f63f8a8d69ed4472bfd85122bd086e637bf4ed09de572d575a693/pandas-2.3.3-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:318d77e0e42a628c04dc56bcef4b40de67918f7041c2b061af1da41dcff670ac", size = 12306371, upload-time = "2025-09-29T23:21:40.532Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/33/81/a3afc88fca4aa925804a27d2676d22dcd2031c2ebe08aabd0ae55b9ff282/pandas-2.3.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:4e0a175408804d566144e170d0476b15d78458795bb18f1304fb94160cabf40c", size = 12765333, upload-time = "2025-09-29T23:21:55.77Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/8d/0f/b4d4ae743a83742f1153464cf1a8ecfafc3ac59722a0b5c8602310cb7158/pandas-2.3.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:93c2d9ab0fc11822b5eece72ec9587e172f63cff87c00b062f6e37448ced4493", size = 13418120, upload-time = "2025-09-29T23:22:10.109Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/4f/c7/e54682c96a895d0c808453269e0b5928a07a127a15704fedb643e9b0a4c8/pandas-2.3.3-cp313-cp313-win_amd64.whl", hash = "sha256:f8bfc0e12dc78f777f323f55c58649591b2cd0c43534e8355c51d3fede5f4dee", size = 10993991, upload-time = "2025-09-29T23:25:04.889Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/f9/ca/3f8d4f49740799189e1395812f3bf23b5e8fc7c190827d55a610da72ce55/pandas-2.3.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:75ea25f9529fdec2d2e93a42c523962261e567d250b0013b16210e1d40d7c2e5", size = 12048227, upload-time = "2025-09-29T23:22:24.343Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/0e/5a/f43efec3e8c0cc92c4663ccad372dbdff72b60bdb56b2749f04aa1d07d7e/pandas-2.3.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:74ecdf1d301e812db96a465a525952f4dde225fdb6d8e5a521d47e1f42041e21", size = 11411056, upload-time = "2025-09-29T23:22:37.762Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/46/b1/85331edfc591208c9d1a63a06baa67b21d332e63b7a591a5ba42a10bb507/pandas-2.3.3-cp313-cp313t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6435cb949cb34ec11cc9860246ccb2fdc9ecd742c12d3304989017d53f039a78", size = 11645189, upload-time = "2025-09-29T23:22:51.688Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/44/23/78d645adc35d94d1ac4f2a3c4112ab6f5b8999f4898b8cdf01252f8df4a9/pandas-2.3.3-cp313-cp313t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:900f47d8f20860de523a1ac881c4c36d65efcb2eb850e6948140fa781736e110", size = 12121912, upload-time = "2025-09-29T23:23:05.042Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/53/da/d10013df5e6aaef6b425aa0c32e1fc1f3e431e4bcabd420517dceadce354/pandas-2.3.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:a45c765238e2ed7d7c608fc5bc4a6f88b642f2f01e70c0c23d2224dd21829d86", size = 12712160, upload-time = "2025-09-29T23:23:28.57Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/bd/17/e756653095a083d8a37cbd816cb87148debcfcd920129b25f99dd8d04271/pandas-2.3.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:c4fc4c21971a1a9f4bdb4c73978c7f7256caa3e62b323f70d6cb80db583350bc", size = 13199233, upload-time = "2025-09-29T23:24:24.876Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/04/fd/74903979833db8390b73b3a8a7d30d146d710bd32703724dd9083950386f/pandas-2.3.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:ee15f284898e7b246df8087fc82b87b01686f98ee67d85a17b7ab44143a3a9a0", size = 11540635, upload-time = "2025-09-29T23:25:52.486Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/21/00/266d6b357ad5e6d3ad55093a7e8efc7dd245f5a842b584db9f30b0f0a287/pandas-2.3.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1611aedd912e1ff81ff41c745822980c49ce4a7907537be8692c8dbc31924593", size = 10759079, upload-time = "2025-09-29T23:26:33.204Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/ca/05/d01ef80a7a3a12b2f8bbf16daba1e17c98a2f039cbc8e2f77a2c5a63d382/pandas-2.3.3-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6d2cefc361461662ac48810cb14365a365ce864afe85ef1f447ff5a1e99ea81c", size = 11814049, upload-time = "2025-09-29T23:27:15.384Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/15/b2/0e62f78c0c5ba7e3d2c5945a82456f4fac76c480940f805e0b97fcbc2f65/pandas-2.3.3-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ee67acbbf05014ea6c763beb097e03cd629961c8a632075eeb34247120abcb4b", size = 12332638, upload-time = "2025-09-29T23:27:51.625Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/c5/33/dd70400631b62b9b29c3c93d2feee1d0964dc2bae2e5ad7a6c73a7f25325/pandas-2.3.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:c46467899aaa4da076d5abc11084634e2d197e9460643dd455ac3db5856b24d6", size = 12886834, upload-time = "2025-09-29T23:28:21.289Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/d3/18/b5d48f55821228d0d2692b34fd5034bb185e854bdb592e9c640f6290e012/pandas-2.3.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:6253c72c6a1d990a410bc7de641d34053364ef8bcd3126f7e7450125887dffe3", size = 13409925, upload-time = "2025-09-29T23:28:58.261Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/a6/3d/124ac75fcd0ecc09b8fdccb0246ef65e35b012030defb0e0eba2cbbbe948/pandas-2.3.3-cp314-cp314-win_amd64.whl", hash = "sha256:1b07204a219b3b7350abaae088f451860223a52cfb8a6c53358e7948735158e5", size = 11109071, upload-time = "2025-09-29T23:32:27.484Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/89/9c/0e21c895c38a157e0faa1fb64587a9226d6dd46452cac4532d80c3c4a244/pandas-2.3.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:2462b1a365b6109d275250baaae7b760fd25c726aaca0054649286bcfbb3e8ec", size = 12048504, upload-time = "2025-09-29T23:29:31.47Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/d7/82/b69a1c95df796858777b68fbe6a81d37443a33319761d7c652ce77797475/pandas-2.3.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:0242fe9a49aa8b4d78a4fa03acb397a58833ef6199e9aa40a95f027bb3a1b6e7", size = 11410702, upload-time = "2025-09-29T23:29:54.591Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/f9/88/702bde3ba0a94b8c73a0181e05144b10f13f29ebfc2150c3a79062a8195d/pandas-2.3.3-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a21d830e78df0a515db2b3d2f5570610f5e6bd2e27749770e8bb7b524b89b450", size = 11634535, upload-time = "2025-09-29T23:30:21.003Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/a4/1e/1bac1a839d12e6a82ec6cb40cda2edde64a2013a66963293696bbf31fbbb/pandas-2.3.3-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2e3ebdb170b5ef78f19bfb71b0dc5dc58775032361fa188e814959b74d726dd5", size = 12121582, upload-time = "2025-09-29T23:30:43.391Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/44/91/483de934193e12a3b1d6ae7c8645d083ff88dec75f46e827562f1e4b4da6/pandas-2.3.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:d051c0e065b94b7a3cea50eb1ec32e912cd96dba41647eb24104b6c6c14c5788", size = 12699963, upload-time = "2025-09-29T23:31:10.009Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/70/44/5191d2e4026f86a2a109053e194d3ba7a31a2d10a9c2348368c63ed4e85a/pandas-2.3.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:3869faf4bd07b3b66a9f462417d0ca3a9df29a9f6abd5d0d0dbab15dac7abe87", size = 13202175, upload-time = "2025-09-29T23:31:59.173Z" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pluggy"
|
name = "pluggy"
|
||||||
version = "1.6.0"
|
version = "1.6.0"
|
||||||
@@ -823,6 +870,18 @@ wheels = [
|
|||||||
{ url = "https://files.pythonhosted.org/packages/f0/d7/a812a0bd0f5160823e647524488cc9734f93782f2c273b8f77e8afc60a37/pytest-8.1.2-py3-none-any.whl", hash = "sha256:6c06dc309ff46a05721e6fd48e492a775ed8165d2ecdf57f156a80c7e95bb142", size = 337456, upload-time = "2024-04-26T18:05:15.452Z" },
|
{ url = "https://files.pythonhosted.org/packages/f0/d7/a812a0bd0f5160823e647524488cc9734f93782f2c273b8f77e8afc60a37/pytest-8.1.2-py3-none-any.whl", hash = "sha256:6c06dc309ff46a05721e6fd48e492a775ed8165d2ecdf57f156a80c7e95bb142", size = 337456, upload-time = "2024-04-26T18:05:15.452Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "python-dateutil"
|
||||||
|
version = "2.9.0.post0"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "six" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/66/c0/0c8b6ad9f17a802ee498c46e004a0eb49bc148f2fd230864601a86dcf6db/python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", size = 342432, upload-time = "2024-03-01T18:36:20.211Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892, upload-time = "2024-03-01T18:36:18.57Z" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "python-dotenv"
|
name = "python-dotenv"
|
||||||
version = "1.2.2"
|
version = "1.2.2"
|
||||||
@@ -841,6 +900,15 @@ wheels = [
|
|||||||
{ url = "https://files.pythonhosted.org/packages/8f/cb/769cfc37177252872a45a71f3fbdde9d51b471a3f3c14bfe95dde3407386/python_multipart-0.0.29-py3-none-any.whl", hash = "sha256:2ddcc971cef266225f54f552d8fa10bcfbb1f14446caec199060daac59ff2d69", size = 29640, upload-time = "2026-05-17T17:29:45.69Z" },
|
{ url = "https://files.pythonhosted.org/packages/8f/cb/769cfc37177252872a45a71f3fbdde9d51b471a3f3c14bfe95dde3407386/python_multipart-0.0.29-py3-none-any.whl", hash = "sha256:2ddcc971cef266225f54f552d8fa10bcfbb1f14446caec199060daac59ff2d69", size = 29640, upload-time = "2026-05-17T17:29:45.69Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pytz"
|
||||||
|
version = "2026.3.post1"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/fb/48/fb042503b6ca6cd271261dc559fd6432f7d8c713153e9ec5c591af4dfc1c/pytz-2026.3.post1.tar.gz", hash = "sha256:2211d3fcf9a797d3405cac96ac7f61d80e6a644f72a3309607282fe8a2010c5d", size = 319745, upload-time = "2026-07-25T15:12:07.385Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/0f/7b/39c34ca613b0b198cb866466651b26b045e2009864c5183c979a3b83f383/pytz-2026.3.post1-py2.py3-none-any.whl", hash = "sha256:dd95840dd199baea12d9cc096a1d452caa6596a1c1e4b5f3dbd1541855d5e815", size = 508283, upload-time = "2026-07-25T15:12:05.782Z" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pyyaml"
|
name = "pyyaml"
|
||||||
version = "6.0.3"
|
version = "6.0.3"
|
||||||
@@ -1143,6 +1211,7 @@ dependencies = [
|
|||||||
{ name = "fastapi" },
|
{ name = "fastapi" },
|
||||||
{ name = "httpx" },
|
{ name = "httpx" },
|
||||||
{ name = "openai" },
|
{ name = "openai" },
|
||||||
|
{ name = "pandas" },
|
||||||
{ name = "pydantic" },
|
{ name = "pydantic" },
|
||||||
{ name = "pydantic-settings" },
|
{ name = "pydantic-settings" },
|
||||||
{ name = "pyjwt" },
|
{ name = "pyjwt" },
|
||||||
@@ -1165,6 +1234,7 @@ requires-dist = [
|
|||||||
{ name = "fastapi", specifier = "~=0.115.0" },
|
{ name = "fastapi", specifier = "~=0.115.0" },
|
||||||
{ name = "httpx", specifier = "~=0.27.0" },
|
{ name = "httpx", specifier = "~=0.27.0" },
|
||||||
{ name = "openai", specifier = "~=2.41.0" },
|
{ name = "openai", specifier = "~=2.41.0" },
|
||||||
|
{ name = "pandas", specifier = "~=2.3.3" },
|
||||||
{ name = "pydantic", specifier = "~=2.7.1" },
|
{ name = "pydantic", specifier = "~=2.7.1" },
|
||||||
{ name = "pydantic-settings", specifier = "~=2.2.1" },
|
{ name = "pydantic-settings", specifier = "~=2.2.1" },
|
||||||
{ name = "pyjwt", specifier = "~=2.8.0" },
|
{ name = "pyjwt", specifier = "~=2.8.0" },
|
||||||
@@ -1196,6 +1266,15 @@ wheels = [
|
|||||||
{ url = "https://files.pythonhosted.org/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", size = 9755, upload-time = "2023-10-24T04:13:38.866Z" },
|
{ url = "https://files.pythonhosted.org/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", size = 9755, upload-time = "2023-10-24T04:13:38.866Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "six"
|
||||||
|
version = "1.17.0"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81", size = 34031, upload-time = "2024-12-04T17:35:28.174Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050, upload-time = "2024-12-04T17:35:26.475Z" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sniffio"
|
name = "sniffio"
|
||||||
version = "1.3.1"
|
version = "1.3.1"
|
||||||
@@ -1441,6 +1520,15 @@ wheels = [
|
|||||||
{ url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" },
|
{ url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tzdata"
|
||||||
|
version = "2026.3"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/92/ff/5a28bdfd8c3ebec42564ac7d0e54ca3db65044a9314a97f9564fa7a1e926/tzdata-2026.3.tar.gz", hash = "sha256:4a1518b8993086a7982523e071643f3c0e5f213e75b21318e78bcabfff9d1415", size = 198674, upload-time = "2026-07-10T08:50:37.887Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/e5/6d/b53b99a9f2766d095985947a5782f1702cabb129a34f7a802d7197af832f/tzdata-2026.3-py2.py3-none-any.whl", hash = "sha256:dc096730c87af6cab1b171c9d532be840741ff5d459015e7f6947bd7d7e54931", size = 348168, upload-time = "2026-07-10T08:50:36.46Z" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "uvicorn"
|
name = "uvicorn"
|
||||||
version = "0.29.0"
|
version = "0.29.0"
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
<mat-dialog-actions align="end">
|
<mat-dialog-actions align="end">
|
||||||
<button mat-button type="button" (click)="close()">Abbrechen</button>
|
<button mat-button type="button" (click)="close()">Abbrechen</button>
|
||||||
<button mat-flat-button color="primary" type="button" (click)="submit()">
|
<button mat-flat-button color="primary" type="button" (click)="submit()">
|
||||||
<mat-icon>save</mat-icon>
|
<mat-icon>{{ SAVE_ICON }}</mat-icon>
|
||||||
Speichern
|
Speichern
|
||||||
</button>
|
</button>
|
||||||
</mat-dialog-actions>
|
</mat-dialog-actions>
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import {
|
|||||||
InseAccountManagementModelOrganizationProfile,
|
InseAccountManagementModelOrganizationProfile,
|
||||||
UserRole,
|
UserRole,
|
||||||
} from '../../api';
|
} from '../../api';
|
||||||
|
import { SAVE_ICON } from '../../shared/ui/icons';
|
||||||
|
|
||||||
export type AccountDialogMode = 'create' | 'edit';
|
export type AccountDialogMode = 'create' | 'edit';
|
||||||
|
|
||||||
@@ -71,6 +72,8 @@ export type AccountDialogResult =
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class AccountDialogComponent {
|
export class AccountDialogComponent {
|
||||||
|
readonly SAVE_ICON = SAVE_ICON;
|
||||||
|
|
||||||
private readonly dialogRef =
|
private readonly dialogRef =
|
||||||
inject<
|
inject<
|
||||||
MatDialogRef<AccountDialogComponent, AccountDialogResult | undefined>
|
MatDialogRef<AccountDialogComponent, AccountDialogResult | undefined>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
type="button"
|
type="button"
|
||||||
matTooltip="Neuen Account anlegen"
|
matTooltip="Neuen Account anlegen"
|
||||||
(click)="startCreate()">
|
(click)="startCreate()">
|
||||||
<mat-icon>person_add</mat-icon>
|
<mat-icon>{{ PERSON_ADD_ICON }}</mat-icon>
|
||||||
Neuer Account
|
Neuer Account
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
type="button"
|
type="button"
|
||||||
aria-label="Bearbeiten"
|
aria-label="Bearbeiten"
|
||||||
(click)="startEdit(row)">
|
(click)="startEdit(row)">
|
||||||
<mat-icon>edit</mat-icon>
|
<mat-icon>{{ EDIT_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
aria-label="Impersonate"
|
aria-label="Impersonate"
|
||||||
[disabled]="!canImpersonate(row)"
|
[disabled]="!canImpersonate(row)"
|
||||||
(click)="impersonate(row)">
|
(click)="impersonate(row)">
|
||||||
<mat-icon>switch_account</mat-icon>
|
<mat-icon>{{ SWITCH_ACCOUNT_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
@@ -84,7 +84,9 @@
|
|||||||
[attr.aria-label]="row.activated ? 'Deaktivieren' : 'Aktivieren'"
|
[attr.aria-label]="row.activated ? 'Deaktivieren' : 'Aktivieren'"
|
||||||
[disabled]="row.is_current || row.deleted"
|
[disabled]="row.is_current || row.deleted"
|
||||||
(click)="toggleAccountActivation(row)">
|
(click)="toggleAccountActivation(row)">
|
||||||
<mat-icon>{{ row.activated ? 'person_off' : 'person_check' }}</mat-icon>
|
<mat-icon>{{
|
||||||
|
row.activated ? PERSON_OFF_ICON : PERSON_CHECK_ICON
|
||||||
|
}}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
@@ -92,7 +94,7 @@
|
|||||||
aria-label="Deaktivieren"
|
aria-label="Deaktivieren"
|
||||||
[disabled]="row.is_current || row.deleted"
|
[disabled]="row.is_current || row.deleted"
|
||||||
(click)="deleteAccount(row)">
|
(click)="deleteAccount(row)">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>{{ DELETE_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|||||||
@@ -44,6 +44,14 @@ import {
|
|||||||
UserRole,
|
UserRole,
|
||||||
} from '../../api';
|
} from '../../api';
|
||||||
import { StatusPipe } from '../../shared/pipes/status.pipe';
|
import { StatusPipe } from '../../shared/pipes/status.pipe';
|
||||||
|
import {
|
||||||
|
DELETE_ICON,
|
||||||
|
EDIT_ICON,
|
||||||
|
PERSON_ADD_ICON,
|
||||||
|
PERSON_CHECK_ICON,
|
||||||
|
PERSON_OFF_ICON,
|
||||||
|
SWITCH_ACCOUNT_ICON,
|
||||||
|
} from '../../shared/ui/icons';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-accounts',
|
selector: 'app-accounts',
|
||||||
@@ -71,6 +79,13 @@ import { StatusPipe } from '../../shared/pipes/status.pipe';
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class AccountsComponent implements OnInit {
|
export class AccountsComponent implements OnInit {
|
||||||
|
readonly PERSON_ADD_ICON = PERSON_ADD_ICON;
|
||||||
|
readonly EDIT_ICON = EDIT_ICON;
|
||||||
|
readonly SWITCH_ACCOUNT_ICON = SWITCH_ACCOUNT_ICON;
|
||||||
|
readonly PERSON_CHECK_ICON = PERSON_CHECK_ICON;
|
||||||
|
readonly PERSON_OFF_ICON = PERSON_OFF_ICON;
|
||||||
|
readonly DELETE_ICON = DELETE_ICON;
|
||||||
|
|
||||||
protected readonly credentialService = inject(CredentialService);
|
protected readonly credentialService = inject(CredentialService);
|
||||||
private readonly snackBar = inject(MatSnackBar);
|
private readonly snackBar = inject(MatSnackBar);
|
||||||
private readonly router = inject(Router);
|
private readonly router = inject(Router);
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
"
|
"
|
||||||
(click)="showPassword = !showPassword">
|
(click)="showPassword = !showPassword">
|
||||||
<mat-icon>{{
|
<mat-icon>{{
|
||||||
showPassword ? 'visibility' : 'visibility_off'
|
showPassword ? VISIBILITY_ICON : VISIBILITY_OFF_ICON
|
||||||
}}</mat-icon>
|
}}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
@if (credentialsForm.controls.password.hasError('required')) {
|
@if (credentialsForm.controls.password.hasError('required')) {
|
||||||
@@ -91,7 +91,7 @@
|
|||||||
} @else {
|
} @else {
|
||||||
<form class="login-form" [formGroup]="otkForm" (ngSubmit)="login()">
|
<form class="login-form" [formGroup]="otkForm" (ngSubmit)="login()">
|
||||||
<div class="code-intro">
|
<div class="code-intro">
|
||||||
<mat-icon>mark_email_unread</mat-icon>
|
<mat-icon>{{ EMAIL_UNREAD_ICON }}</mat-icon>
|
||||||
<div>
|
<div>
|
||||||
<strong>Code eingeben</strong>
|
<strong>Code eingeben</strong>
|
||||||
<span>
|
<span>
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
class="expiry"
|
class="expiry"
|
||||||
[class.expiry--expired]="codeExpiresIn === 0"
|
[class.expiry--expired]="codeExpiresIn === 0"
|
||||||
aria-live="polite">
|
aria-live="polite">
|
||||||
<mat-icon>timer</mat-icon>
|
<mat-icon>{{ TIMER_ICON }}</mat-icon>
|
||||||
@if (codeExpiresIn > 0) {
|
@if (codeExpiresIn > 0) {
|
||||||
<span>Code läuft in {{ formatCountdown() }} ab.</span>
|
<span>Code läuft in {{ formatCountdown() }} ab.</span>
|
||||||
} @else {
|
} @else {
|
||||||
|
|||||||
@@ -15,6 +15,12 @@ import { finalize, Subscription } from 'rxjs';
|
|||||||
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
|
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
|
||||||
import { Router, RouterLink } from '@angular/router';
|
import { Router, RouterLink } from '@angular/router';
|
||||||
import { HttpErrorResponse } from '@angular/common/http';
|
import { HttpErrorResponse } from '@angular/common/http';
|
||||||
|
import {
|
||||||
|
EMAIL_UNREAD_ICON,
|
||||||
|
TIMER_ICON,
|
||||||
|
VISIBILITY_ICON,
|
||||||
|
VISIBILITY_OFF_ICON,
|
||||||
|
} from '../../shared/ui/icons';
|
||||||
|
|
||||||
type LoginStep = 'credentials' | 'otk';
|
type LoginStep = 'credentials' | 'otk';
|
||||||
|
|
||||||
@@ -35,6 +41,11 @@ type LoginStep = 'credentials' | 'otk';
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class AppLoginComponent implements OnDestroy {
|
export class AppLoginComponent implements OnDestroy {
|
||||||
|
readonly EMAIL_UNREAD_ICON = EMAIL_UNREAD_ICON;
|
||||||
|
readonly TIMER_ICON = TIMER_ICON;
|
||||||
|
readonly VISIBILITY_ICON = VISIBILITY_ICON;
|
||||||
|
readonly VISIBILITY_OFF_ICON = VISIBILITY_OFF_ICON;
|
||||||
|
|
||||||
credentialsForm = new FormGroup({
|
credentialsForm = new FormGroup({
|
||||||
email: new FormControl<string>('', [Validators.required, Validators.email]),
|
email: new FormControl<string>('', [Validators.required, Validators.email]),
|
||||||
password: new FormControl<string>('', [
|
password: new FormControl<string>('', [
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<p>Gespeicherte Personen für den schnellen Zugriff.</p>
|
<p>Gespeicherte Personen für den schnellen Zugriff.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="bookmark-count">
|
<div class="bookmark-count">
|
||||||
<mat-icon>bookmarks</mat-icon>
|
<mat-icon>{{ BOOKMARKS_ICON }}</mat-icon>
|
||||||
<strong>{{ persons().length }}</strong>
|
<strong>{{ persons().length }}</strong>
|
||||||
<span>Personen</span>
|
<span>Personen</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
@if (loading()) {
|
@if (loading()) {
|
||||||
<app-loading
|
<app-loading
|
||||||
text="Bookmarks werden geladen …"
|
text="Bookmarks werden geladen …"
|
||||||
icon="bookmarks"
|
[icon]="BOOKMARKS_ICON"
|
||||||
[size]="60"
|
[size]="60"
|
||||||
[diameter]="60" />
|
[diameter]="60" />
|
||||||
} @else if (persons().length) {
|
} @else if (persons().length) {
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
</section>
|
</section>
|
||||||
} @else {
|
} @else {
|
||||||
<section class="empty-state">
|
<section class="empty-state">
|
||||||
<mat-icon>bookmark_border</mat-icon>
|
<mat-icon>{{ BOOKMARK_BORDER_ICON }}</mat-icon>
|
||||||
<h2>Noch keine Bookmarks</h2>
|
<h2>Noch keine Bookmarks</h2>
|
||||||
<p>
|
<p>
|
||||||
Speichere Personen über das Bookmark-Symbol auf einer Personenkarte.
|
Speichere Personen über das Bookmark-Symbol auf einer Personenkarte.
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { CustomAuthor, PersonsService } from '../../api';
|
|||||||
import { BookmarkService } from '../../shared/services/bookmark.service';
|
import { BookmarkService } from '../../shared/services/bookmark.service';
|
||||||
import { PersonCardComponent } from '../person-card/person-card.component';
|
import { PersonCardComponent } from '../person-card/person-card.component';
|
||||||
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
|
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
|
||||||
|
import { BOOKMARKS_ICON, BOOKMARK_BORDER_ICON } from '../../shared/ui/icons';
|
||||||
|
|
||||||
const PERSON_INCLUDE_TAGS =
|
const PERSON_INCLUDE_TAGS =
|
||||||
'display_name,works_count,cited_by_count,summary_stats,ids,' +
|
'display_name,works_count,cited_by_count,summary_stats,ids,' +
|
||||||
@@ -22,6 +23,9 @@ const PERSON_INCLUDE_TAGS =
|
|||||||
styleUrl: './bookmarks.component.scss',
|
styleUrl: './bookmarks.component.scss',
|
||||||
})
|
})
|
||||||
export class BookmarksComponent {
|
export class BookmarksComponent {
|
||||||
|
readonly BOOKMARKS_ICON = BOOKMARKS_ICON;
|
||||||
|
readonly BOOKMARK_BORDER_ICON = BOOKMARK_BORDER_ICON;
|
||||||
|
|
||||||
readonly bookmarkService = inject(BookmarkService);
|
readonly bookmarkService = inject(BookmarkService);
|
||||||
private readonly personsService = inject(PersonsService);
|
private readonly personsService = inject(PersonsService);
|
||||||
private readonly destroyRef = inject(DestroyRef);
|
private readonly destroyRef = inject(DestroyRef);
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
@if (visible()) {
|
@if (visible()) {
|
||||||
<mat-card appearance="outlined" class="research-profile-card">
|
<mat-card appearance="outlined" class="research-profile-card">
|
||||||
<mat-card-header class="profile-header">
|
<mat-card-header class="profile-header">
|
||||||
<mat-icon class="profile-icon">science</mat-icon>
|
<mat-icon class="profile-icon">{{ SCIENCE_ICON }}</mat-icon>
|
||||||
<div class="profile-heading">
|
<div class="profile-heading">
|
||||||
<mat-card-title>Forschungsprofil</mat-card-title>
|
<mat-card-title>Forschungsprofil</mat-card-title>
|
||||||
<mat-card-subtitle>
|
<mat-card-subtitle>
|
||||||
|
|||||||
+3
@@ -11,6 +11,7 @@ import {
|
|||||||
AuthorCategoryPieComponent,
|
AuthorCategoryPieComponent,
|
||||||
buildAuthorCategoryLegend,
|
buildAuthorCategoryLegend,
|
||||||
} from './author-category-pie.component';
|
} from './author-category-pie.component';
|
||||||
|
import { SCIENCE_ICON } from '../../../shared/ui/icons';
|
||||||
|
|
||||||
export interface ResearchProfileAuthor {
|
export interface ResearchProfileAuthor {
|
||||||
authorId: string;
|
authorId: string;
|
||||||
@@ -36,6 +37,8 @@ interface AuthorOrientationView {
|
|||||||
styleUrl: './author-research-profile.component.scss',
|
styleUrl: './author-research-profile.component.scss',
|
||||||
})
|
})
|
||||||
export class AuthorResearchProfileComponent {
|
export class AuthorResearchProfileComponent {
|
||||||
|
readonly SCIENCE_ICON = SCIENCE_ICON;
|
||||||
|
|
||||||
private readonly chartTheme = inject(ChartThemeService);
|
private readonly chartTheme = inject(ChartThemeService);
|
||||||
|
|
||||||
authors = input.required<ResearchProfileAuthor[]>();
|
authors = input.required<ResearchProfileAuthor[]>();
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<div class="meta-row">
|
<div class="meta-row">
|
||||||
<span class="meta-label">Betrachteter Zeitraum:</span>
|
<span class="meta-label">Betrachteter Zeitraum:</span>
|
||||||
<app-chip color="secondary">
|
<app-chip color="secondary">
|
||||||
<mat-icon>date_range</mat-icon>
|
<mat-icon>{{ DATE_RANGE_ICON }}</mat-icon>
|
||||||
{{ span.from }}–{{ span.to }}
|
{{ span.from }}–{{ span.to }}
|
||||||
</app-chip>
|
</app-chip>
|
||||||
</div>
|
</div>
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
]"
|
]"
|
||||||
title="Zur Autor:innen-Seite">
|
title="Zur Autor:innen-Seite">
|
||||||
{{ author.name }}
|
{{ author.name }}
|
||||||
<mat-icon>open_in_new</mat-icon>
|
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
|
||||||
</a>
|
</a>
|
||||||
</app-chip>
|
</app-chip>
|
||||||
}
|
}
|
||||||
@@ -181,7 +181,7 @@
|
|||||||
]"
|
]"
|
||||||
title="Zur Autor:innen-Seite">
|
title="Zur Autor:innen-Seite">
|
||||||
{{ author.name }}
|
{{ author.name }}
|
||||||
<mat-icon>open_in_new</mat-icon>
|
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
|
||||||
</a>
|
</a>
|
||||||
</app-chip>
|
</app-chip>
|
||||||
</th>
|
</th>
|
||||||
@@ -198,7 +198,7 @@
|
|||||||
<mat-icon
|
<mat-icon
|
||||||
class="icon-small name-match-star"
|
class="icon-small name-match-star"
|
||||||
aria-hidden="true">
|
aria-hidden="true">
|
||||||
star
|
{{ STAR_ICON }}
|
||||||
</mat-icon>
|
</mat-icon>
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
@@ -257,7 +257,7 @@
|
|||||||
</div>
|
</div>
|
||||||
@if (hasNameMatchedRow(rows)) {
|
@if (hasNameMatchedRow(rows)) {
|
||||||
<p class="name-match-note">
|
<p class="name-match-note">
|
||||||
<mat-icon class="icon-small">star</mat-icon>
|
<mat-icon class="icon-small">{{ STAR_ICON }}</mat-icon>
|
||||||
Diese Kennzahlen basieren auf einem automatischen Namensabgleich mit
|
Diese Kennzahlen basieren auf einem automatischen Namensabgleich mit
|
||||||
externen Quellen, wodurch es in Einzelfällen zu Fehlzuordnungen kommen
|
externen Quellen, wodurch es in Einzelfällen zu Fehlzuordnungen kommen
|
||||||
kann.
|
kann.
|
||||||
|
|||||||
@@ -29,6 +29,11 @@ import { ChipComponent } from '../../shared/ui/chip/chip.component';
|
|||||||
import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component';
|
import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component';
|
||||||
import { ChartThemeService } from '../../shared/services/chart-theme.service';
|
import { ChartThemeService } from '../../shared/services/chart-theme.service';
|
||||||
import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
|
import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
|
||||||
|
import {
|
||||||
|
DATE_RANGE_ICON,
|
||||||
|
OPEN_IN_NEW_ICON,
|
||||||
|
STAR_ICON,
|
||||||
|
} from '../../shared/ui/icons';
|
||||||
import {
|
import {
|
||||||
AUTHOR_COLORS,
|
AUTHOR_COLORS,
|
||||||
OTHER_COLOR,
|
OTHER_COLOR,
|
||||||
@@ -135,6 +140,10 @@ interface SegmentDef {
|
|||||||
styleUrl: './compare-authors.component.scss',
|
styleUrl: './compare-authors.component.scss',
|
||||||
})
|
})
|
||||||
export class CompareAuthorsComponent implements OnInit {
|
export class CompareAuthorsComponent implements OnInit {
|
||||||
|
readonly DATE_RANGE_ICON = DATE_RANGE_ICON;
|
||||||
|
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
|
||||||
|
readonly STAR_ICON = STAR_ICON;
|
||||||
|
|
||||||
private readonly route = inject(ActivatedRoute);
|
private readonly route = inject(ActivatedRoute);
|
||||||
private readonly rankingService = inject(RankingService);
|
private readonly rankingService = inject(RankingService);
|
||||||
private readonly topicsService = inject(TopicsService);
|
private readonly topicsService = inject(TopicsService);
|
||||||
|
|||||||
@@ -0,0 +1,91 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
import {
|
||||||
|
HttpTestingController,
|
||||||
|
provideHttpClientTesting,
|
||||||
|
} from '@angular/common/http/testing';
|
||||||
|
import { provideHttpClient } from '@angular/common/http';
|
||||||
|
|
||||||
|
import { DashboardStatisticsService } from './dashboard-statistics.service';
|
||||||
|
|
||||||
|
describe('DashboardStatisticsService', () => {
|
||||||
|
let service: DashboardStatisticsService;
|
||||||
|
let httpMock: HttpTestingController;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
providers: [
|
||||||
|
DashboardStatisticsService,
|
||||||
|
provideHttpClient(),
|
||||||
|
provideHttpClientTesting(),
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
service = TestBed.inject(DashboardStatisticsService);
|
||||||
|
httpMock = TestBed.inject(HttpTestingController);
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
httpMock.verify();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('sends the selected institution and period for lower project status requests', () => {
|
||||||
|
service
|
||||||
|
.getEuProjectStatuses({ fromYear: 2024, toYear: 2026 }, 'I456')
|
||||||
|
.subscribe();
|
||||||
|
|
||||||
|
const request = httpMock.expectOne((req) => {
|
||||||
|
return req.url === '/api/dashboard/projects/eu/status';
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(request.request.params.get('institution_id')).toBe('I456');
|
||||||
|
expect(request.request.params.get('from_year')).toBe('2024');
|
||||||
|
expect(request.request.params.get('to_year')).toBe('2026');
|
||||||
|
|
||||||
|
request.flush({
|
||||||
|
institution_id: 'https://openalex.org/I456',
|
||||||
|
organization_name: 'Selected institution',
|
||||||
|
ongoing: 1,
|
||||||
|
upcoming: 0,
|
||||||
|
completed: 2,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('sends only the active institution for a topic treemap request', () => {
|
||||||
|
service.getTopicTreemap(2024, 2026, 'I789').subscribe();
|
||||||
|
|
||||||
|
const request = httpMock.expectOne((req) => {
|
||||||
|
return req.url === '/api/dashboard/topic-heatmap';
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(request.request.params.get('institution_id')).toBe('I789');
|
||||||
|
expect(request.request.params.get('from_year')).toBe('2024');
|
||||||
|
expect(request.request.params.get('to_year')).toBe('2026');
|
||||||
|
|
||||||
|
request.flush({
|
||||||
|
institution_id: 'https://openalex.org/I789',
|
||||||
|
organization_name: 'Selected institution',
|
||||||
|
years: [],
|
||||||
|
fields: [],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('keeps all as the default lower-dashboard institution scope', () => {
|
||||||
|
service.getBundProjectTopics().subscribe();
|
||||||
|
|
||||||
|
const request = httpMock.expectOne((req) => {
|
||||||
|
return req.url === '/api/dashboard/projects/bund/topics';
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(request.request.params.get('institution_id')).toBe('all');
|
||||||
|
expect(request.request.params.has('from_year')).toBeFalse();
|
||||||
|
expect(request.request.params.has('to_year')).toBeFalse();
|
||||||
|
|
||||||
|
request.flush({
|
||||||
|
institution_id: 'https://openalex.org/I123',
|
||||||
|
organization_name: 'Root organization',
|
||||||
|
project_count: 0,
|
||||||
|
matched_project_count: 0,
|
||||||
|
topics: [],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -10,6 +10,11 @@ export interface DashboardPeriodBounds {
|
|||||||
toYear?: number;
|
toYear?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface DashboardInstitution {
|
||||||
|
id: string;
|
||||||
|
display_name: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface DashboardStatistics {
|
export interface DashboardStatistics {
|
||||||
institution_id: string;
|
institution_id: string;
|
||||||
organization_name: string;
|
organization_name: string;
|
||||||
@@ -116,6 +121,12 @@ export class DashboardStatisticsService {
|
|||||||
private readonly httpClient = inject(HttpClient);
|
private readonly httpClient = inject(HttpClient);
|
||||||
private readonly apiConfiguration = inject(Configuration, { optional: true });
|
private readonly apiConfiguration = inject(Configuration, { optional: true });
|
||||||
|
|
||||||
|
getInstitutions(): Observable<DashboardInstitution[]> {
|
||||||
|
return this.httpClient.get<DashboardInstitution[]>(
|
||||||
|
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/institutions`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
getStatistics(): Observable<DashboardStatistics> {
|
getStatistics(): Observable<DashboardStatistics> {
|
||||||
return this.httpClient.get<DashboardStatistics>(
|
return this.httpClient.get<DashboardStatistics>(
|
||||||
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/statistics`,
|
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/statistics`,
|
||||||
@@ -124,120 +135,133 @@ export class DashboardStatisticsService {
|
|||||||
|
|
||||||
getPublicationCount(
|
getPublicationCount(
|
||||||
period: DashboardPeriodBounds = {},
|
period: DashboardPeriodBounds = {},
|
||||||
|
institutionId = 'all',
|
||||||
): Observable<DashboardStatisticValue> {
|
): Observable<DashboardStatisticValue> {
|
||||||
return this.httpClient.get<DashboardStatisticValue>(
|
return this.httpClient.get<DashboardStatisticValue>(
|
||||||
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/statistics/publications`,
|
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/statistics/publications`,
|
||||||
{ params: this.periodParams(period) },
|
{ params: this.statisticParams(period, institutionId) },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getPersonCount(
|
getPersonCount(
|
||||||
period: DashboardPeriodBounds = {},
|
period: DashboardPeriodBounds = {},
|
||||||
|
institutionId = 'all',
|
||||||
): Observable<DashboardStatisticValue> {
|
): Observable<DashboardStatisticValue> {
|
||||||
return this.httpClient.get<DashboardStatisticValue>(
|
return this.httpClient.get<DashboardStatisticValue>(
|
||||||
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/statistics/persons`,
|
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/statistics/persons`,
|
||||||
{ params: this.periodParams(period) },
|
{ params: this.statisticParams(period, institutionId) },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getPatentCount(
|
getPatentCount(
|
||||||
period: DashboardPeriodBounds = {},
|
period: DashboardPeriodBounds = {},
|
||||||
|
institutionId = 'all',
|
||||||
): Observable<DashboardStatisticValue> {
|
): Observable<DashboardStatisticValue> {
|
||||||
return this.httpClient.get<DashboardStatisticValue>(
|
return this.httpClient.get<DashboardStatisticValue>(
|
||||||
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/statistics/patents`,
|
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/statistics/patents`,
|
||||||
{ params: this.periodParams(period) },
|
{ params: this.statisticParams(period, institutionId) },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getEuProjectCount(
|
getEuProjectCount(
|
||||||
period: DashboardPeriodBounds = {},
|
period: DashboardPeriodBounds = {},
|
||||||
|
institutionId = 'all',
|
||||||
): Observable<DashboardStatisticValue> {
|
): Observable<DashboardStatisticValue> {
|
||||||
return this.httpClient.get<DashboardStatisticValue>(
|
return this.httpClient.get<DashboardStatisticValue>(
|
||||||
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/statistics/projects/eu`,
|
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/statistics/projects/eu`,
|
||||||
{ params: this.periodParams(period) },
|
{ params: this.statisticParams(period, institutionId) },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getEuProjectStatuses(
|
getEuProjectStatuses(
|
||||||
period: DashboardPeriodBounds = {},
|
period: DashboardPeriodBounds = {},
|
||||||
|
institutionId = 'all',
|
||||||
): Observable<EuProjectStatusStatistics> {
|
): Observable<EuProjectStatusStatistics> {
|
||||||
return this.httpClient.get<EuProjectStatusStatistics>(
|
return this.httpClient.get<EuProjectStatusStatistics>(
|
||||||
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/projects/eu/status`,
|
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/projects/eu/status`,
|
||||||
{ params: this.periodParams(period) },
|
{ params: this.analyticalParams(period, institutionId) },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getBmbfProjectStatuses(
|
getBmbfProjectStatuses(
|
||||||
period: DashboardPeriodBounds = {},
|
period: DashboardPeriodBounds = {},
|
||||||
|
institutionId = 'all',
|
||||||
): Observable<BmbfProjectStatusStatistics> {
|
): Observable<BmbfProjectStatusStatistics> {
|
||||||
return this.httpClient.get<BmbfProjectStatusStatistics>(
|
return this.httpClient.get<BmbfProjectStatusStatistics>(
|
||||||
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/projects/bmbf/status`,
|
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/projects/bmbf/status`,
|
||||||
{ params: this.periodParams(period) },
|
{ params: this.analyticalParams(period, institutionId) },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getDfgProjectStatuses(
|
getDfgProjectStatuses(
|
||||||
period: DashboardPeriodBounds = {},
|
period: DashboardPeriodBounds = {},
|
||||||
|
institutionId = 'all',
|
||||||
): Observable<DfgProjectStatusStatistics> {
|
): Observable<DfgProjectStatusStatistics> {
|
||||||
return this.httpClient.get<DfgProjectStatusStatistics>(
|
return this.httpClient.get<DfgProjectStatusStatistics>(
|
||||||
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/projects/dfg/status`,
|
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/projects/dfg/status`,
|
||||||
{ params: this.periodParams(period) },
|
{ params: this.analyticalParams(period, institutionId) },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getBmbfProjectCount(
|
getBmbfProjectCount(
|
||||||
period: DashboardPeriodBounds = {},
|
period: DashboardPeriodBounds = {},
|
||||||
|
institutionId = 'all',
|
||||||
): Observable<DashboardStatisticValue> {
|
): Observable<DashboardStatisticValue> {
|
||||||
return this.httpClient.get<DashboardStatisticValue>(
|
return this.httpClient.get<DashboardStatisticValue>(
|
||||||
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/statistics/projects/bmbf`,
|
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/statistics/projects/bmbf`,
|
||||||
{ params: this.periodParams(period) },
|
{ params: this.statisticParams(period, institutionId) },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getDfgProjectCount(
|
getDfgProjectCount(
|
||||||
period: DashboardPeriodBounds = {},
|
period: DashboardPeriodBounds = {},
|
||||||
|
institutionId = 'all',
|
||||||
): Observable<DashboardStatisticValue> {
|
): Observable<DashboardStatisticValue> {
|
||||||
return this.httpClient.get<DashboardStatisticValue>(
|
return this.httpClient.get<DashboardStatisticValue>(
|
||||||
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/statistics/projects/dfg`,
|
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/statistics/projects/dfg`,
|
||||||
{ params: this.periodParams(period) },
|
{ params: this.statisticParams(period, institutionId) },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getDfgProjectTopics(
|
getDfgProjectTopics(
|
||||||
period: DashboardPeriodBounds = {},
|
period: DashboardPeriodBounds = {},
|
||||||
|
institutionId = 'all',
|
||||||
): Observable<DfgProjectTopics> {
|
): Observable<DfgProjectTopics> {
|
||||||
return this.httpClient.get<DfgProjectTopics>(
|
return this.httpClient.get<DfgProjectTopics>(
|
||||||
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/projects/dfg/topics`,
|
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/projects/dfg/topics`,
|
||||||
{ params: this.periodParams(period) },
|
{ params: this.analyticalParams(period, institutionId) },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getEuProjectTopics(
|
getEuProjectTopics(
|
||||||
period: DashboardPeriodBounds = {},
|
period: DashboardPeriodBounds = {},
|
||||||
|
institutionId = 'all',
|
||||||
): Observable<EuProjectTopics> {
|
): Observable<EuProjectTopics> {
|
||||||
return this.httpClient.get<EuProjectTopics>(
|
return this.httpClient.get<EuProjectTopics>(
|
||||||
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/projects/eu/topics`,
|
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/projects/eu/topics`,
|
||||||
{ params: this.periodParams(period) },
|
{ params: this.analyticalParams(period, institutionId) },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getBundProjectTopics(
|
getBundProjectTopics(
|
||||||
period: DashboardPeriodBounds = {},
|
period: DashboardPeriodBounds = {},
|
||||||
|
institutionId = 'all',
|
||||||
): Observable<BundProjectTopics> {
|
): Observable<BundProjectTopics> {
|
||||||
return this.httpClient.get<BundProjectTopics>(
|
return this.httpClient.get<BundProjectTopics>(
|
||||||
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/projects/bund/topics`,
|
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/projects/bund/topics`,
|
||||||
{ params: this.periodParams(period) },
|
{ params: this.analyticalParams(period, institutionId) },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getTopAuthors(
|
getTopAuthors(
|
||||||
period: DashboardPeriodBounds = {},
|
period: DashboardPeriodBounds = {},
|
||||||
|
institutionId = 'all',
|
||||||
): Observable<TopAuthorStatistics> {
|
): Observable<TopAuthorStatistics> {
|
||||||
const analysis = (source: string) =>
|
const analysis = (source: string) =>
|
||||||
this.httpClient
|
this.httpClient
|
||||||
.get<TopAuthorAnalysis>(
|
.get<TopAuthorAnalysis>(
|
||||||
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/top-authors/${source}`,
|
`${this.apiConfiguration?.basePath ?? ''}/api/dashboard/top-authors/${source}`,
|
||||||
{ params: this.periodParams(period) },
|
{ params: this.analyticalParams(period, institutionId) },
|
||||||
)
|
)
|
||||||
.pipe(catchError(() => of(null)));
|
.pipe(catchError(() => of(null)));
|
||||||
|
|
||||||
@@ -271,8 +295,11 @@ export class DashboardStatisticsService {
|
|||||||
getTopicTreemap(
|
getTopicTreemap(
|
||||||
fromYear?: number,
|
fromYear?: number,
|
||||||
toYear?: number,
|
toYear?: number,
|
||||||
|
institutionId = 'all',
|
||||||
): Observable<TopicTreemapData> {
|
): Observable<TopicTreemapData> {
|
||||||
const params: Record<string, number> = {};
|
const params: Record<string, string | number> = {
|
||||||
|
institution_id: institutionId,
|
||||||
|
};
|
||||||
if (fromYear !== undefined) params['from_year'] = fromYear;
|
if (fromYear !== undefined) params['from_year'] = fromYear;
|
||||||
if (toYear !== undefined) params['to_year'] = toYear;
|
if (toYear !== undefined) params['to_year'] = toYear;
|
||||||
|
|
||||||
@@ -286,8 +313,12 @@ export class DashboardStatisticsService {
|
|||||||
topicId: string,
|
topicId: string,
|
||||||
fromYear?: number,
|
fromYear?: number,
|
||||||
toYear?: number,
|
toYear?: number,
|
||||||
|
institutionId = 'all',
|
||||||
): Observable<TopicWordCloud> {
|
): Observable<TopicWordCloud> {
|
||||||
const params: Record<string, string | number> = { topicId };
|
const params: Record<string, string | number> = {
|
||||||
|
topicId,
|
||||||
|
institution_id: institutionId,
|
||||||
|
};
|
||||||
if (fromYear !== undefined) params['from_year'] = fromYear;
|
if (fromYear !== undefined) params['from_year'] = fromYear;
|
||||||
if (toYear !== undefined) params['to_year'] = toYear;
|
if (toYear !== undefined) params['to_year'] = toYear;
|
||||||
return this.httpClient.get<TopicWordCloud>(
|
return this.httpClient.get<TopicWordCloud>(
|
||||||
@@ -302,4 +333,24 @@ export class DashboardStatisticsService {
|
|||||||
if (period.toYear !== undefined) params['to_year'] = period.toYear;
|
if (period.toYear !== undefined) params['to_year'] = period.toYear;
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private statisticParams(
|
||||||
|
period: DashboardPeriodBounds,
|
||||||
|
institutionId: string,
|
||||||
|
): Record<string, string | number> {
|
||||||
|
return {
|
||||||
|
...this.periodParams(period),
|
||||||
|
institution_id: institutionId,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private analyticalParams(
|
||||||
|
period: DashboardPeriodBounds,
|
||||||
|
institutionId: string,
|
||||||
|
): Record<string, string | number> {
|
||||||
|
return {
|
||||||
|
...this.periodParams(period),
|
||||||
|
institution_id: institutionId,
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,25 @@
|
|||||||
(endYearChange)="onDashboardPeriodRangeChange()">
|
(endYearChange)="onDashboardPeriodRangeChange()">
|
||||||
</app-year-range-slider>
|
</app-year-range-slider>
|
||||||
</div>
|
</div>
|
||||||
|
<mat-form-field
|
||||||
|
class="dashboard-institution-filter"
|
||||||
|
appearance="outline"
|
||||||
|
subscriptSizing="dynamic">
|
||||||
|
<mat-label>Institution</mat-label>
|
||||||
|
<mat-select
|
||||||
|
[value]="selectedDashboardInstitutionId"
|
||||||
|
[disabled]="
|
||||||
|
dashboardInstitutionsLoading || dashboardInstitutions.length === 0
|
||||||
|
"
|
||||||
|
(selectionChange)="onDashboardInstitutionChange($event.value)">
|
||||||
|
<mat-option value="all">Alle Institutionen</mat-option>
|
||||||
|
@for (institution of dashboardInstitutions; track institution.id) {
|
||||||
|
<mat-option [value]="institution.id">
|
||||||
|
{{ institution.display_name }}
|
||||||
|
</mat-option>
|
||||||
|
}
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="statistics-grid" aria-label="Kennzahlen">
|
<section class="statistics-grid" aria-label="Kennzahlen">
|
||||||
@@ -44,7 +63,7 @@
|
|||||||
matTooltip="Anzahl der Publikationen im ausgewählten Zeitraum"
|
matTooltip="Anzahl der Publikationen im ausgewählten Zeitraum"
|
||||||
matTooltipPosition="above">
|
matTooltipPosition="above">
|
||||||
<div class="statistics-icon statistics-icon--publications">
|
<div class="statistics-icon statistics-icon--publications">
|
||||||
<mat-icon>menu_book</mat-icon>
|
<mat-icon>{{ MENU_BOOK_ICON }}</mat-icon>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span>Publikationen</span>
|
<span>Publikationen</span>
|
||||||
@@ -66,7 +85,7 @@
|
|||||||
matTooltip="Anzahl der Personen im ausgewählten Zeitraum"
|
matTooltip="Anzahl der Personen im ausgewählten Zeitraum"
|
||||||
matTooltipPosition="above">
|
matTooltipPosition="above">
|
||||||
<div class="statistics-icon statistics-icon--persons">
|
<div class="statistics-icon statistics-icon--persons">
|
||||||
<mat-icon>groups</mat-icon>
|
<mat-icon>{{ GROUPS_ICON }}</mat-icon>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span>Personen</span>
|
<span>Personen</span>
|
||||||
@@ -111,7 +130,7 @@
|
|||||||
matTooltip="Anzahl der laufenden, abgeschlossenen und kommenden EU-Projekte im ausgewählten Zeitraum"
|
matTooltip="Anzahl der laufenden, abgeschlossenen und kommenden EU-Projekte im ausgewählten Zeitraum"
|
||||||
matTooltipPosition="above">
|
matTooltipPosition="above">
|
||||||
<div class="statistics-icon statistics-icon--eu-projects">
|
<div class="statistics-icon statistics-icon--eu-projects">
|
||||||
<mat-icon>public</mat-icon>
|
<mat-icon>{{ PUBLIC_ICON }}</mat-icon>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span>EU-Projekte</span>
|
<span>EU-Projekte</span>
|
||||||
@@ -133,7 +152,7 @@
|
|||||||
matTooltip="Anzahl der laufenden, abgeschlossenen und kommenden Bund-Projekte im ausgewählten Zeitraum"
|
matTooltip="Anzahl der laufenden, abgeschlossenen und kommenden Bund-Projekte im ausgewählten Zeitraum"
|
||||||
matTooltipPosition="above">
|
matTooltipPosition="above">
|
||||||
<div class="statistics-icon statistics-icon--bund-projects">
|
<div class="statistics-icon statistics-icon--bund-projects">
|
||||||
<mat-icon>account_balance</mat-icon>
|
<mat-icon>{{ ACCOUNT_BALANCE_ICON }}</mat-icon>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span>Bund-Projekte</span>
|
<span>Bund-Projekte</span>
|
||||||
@@ -155,7 +174,7 @@
|
|||||||
matTooltip="Anzahl der laufenden, abgeschlossenen und kommenden DFG-Projekte im ausgewählten Zeitraum"
|
matTooltip="Anzahl der laufenden, abgeschlossenen und kommenden DFG-Projekte im ausgewählten Zeitraum"
|
||||||
matTooltipPosition="above">
|
matTooltipPosition="above">
|
||||||
<div class="statistics-icon statistics-icon--dfg-projects">
|
<div class="statistics-icon statistics-icon--dfg-projects">
|
||||||
<mat-icon>science</mat-icon>
|
<mat-icon>{{ SCIENCE_ICON }}</mat-icon>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span>DFG-Projekte</span>
|
<span>DFG-Projekte</span>
|
||||||
@@ -174,6 +193,56 @@
|
|||||||
<p class="statistics-error">Die Kennzahlen konnten nicht geladen werden.</p>
|
<p class="statistics-error">Die Kennzahlen konnten nicht geladen werden.</p>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<section
|
||||||
|
class="dashboard-institution-tabs"
|
||||||
|
aria-label="Institutionen für Analysebereiche">
|
||||||
|
<h2>Institution auswählen</h2>
|
||||||
|
<div class="dashboard-institution-tab-bar">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="dashboard-institution-tab-arrow"
|
||||||
|
[class.is-hidden]="!canScrollAnalyticalInstitutionTabsLeft"
|
||||||
|
[disabled]="!canScrollAnalyticalInstitutionTabsLeft"
|
||||||
|
aria-label="Vorherige Institutionen anzeigen"
|
||||||
|
(click)="scrollAnalyticalInstitutionTabs(-1)">
|
||||||
|
<mat-icon>chevron_left</mat-icon>
|
||||||
|
</button>
|
||||||
|
<div
|
||||||
|
#analyticalInstitutionTabList
|
||||||
|
class="dashboard-institution-tab-list sg-tab-nav"
|
||||||
|
role="tablist"
|
||||||
|
(scroll)="updateAnalyticalInstitutionTabScrollState()">
|
||||||
|
@for (institution of dashboardInstitutions; track institution.id) {
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
role="tab"
|
||||||
|
[attr.aria-selected]="
|
||||||
|
selectedAnalyticalInstitutionId === institution.id
|
||||||
|
"
|
||||||
|
[class.active]="selectedAnalyticalInstitutionId === institution.id"
|
||||||
|
(click)="onAnalyticalInstitutionChange(institution.id)">
|
||||||
|
{{ institution.display_name }}
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="dashboard-institution-tab-arrow"
|
||||||
|
[class.is-hidden]="!canScrollAnalyticalInstitutionTabsRight"
|
||||||
|
[disabled]="!canScrollAnalyticalInstitutionTabsRight"
|
||||||
|
aria-label="Weitere Institutionen anzeigen"
|
||||||
|
(click)="scrollAnalyticalInstitutionTabs(1)">
|
||||||
|
<mat-icon>chevron_right</mat-icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
@if (dashboardInstitutionsError) {
|
||||||
|
<p class="statistics-error">
|
||||||
|
Die Institutionen konnten nicht geladen werden.
|
||||||
|
</p>
|
||||||
|
}
|
||||||
|
</section>
|
||||||
|
|
||||||
|
@if (selectedAnalyticalInstitutionId) {
|
||||||
@if (
|
@if (
|
||||||
euProjectStatusesLoading ||
|
euProjectStatusesLoading ||
|
||||||
bmbfProjectStatusesLoading ||
|
bmbfProjectStatusesLoading ||
|
||||||
@@ -230,13 +299,13 @@
|
|||||||
<div class="project-status-loading" role="status" aria-live="polite">
|
<div class="project-status-loading" role="status" aria-live="polite">
|
||||||
<app-loading
|
<app-loading
|
||||||
text="Projektstatus wird geladen …"
|
text="Projektstatus wird geladen …"
|
||||||
icon="stacked_bar_chart"
|
[icon]="STACKED_BAR_CHART_ICON"
|
||||||
size="64"
|
size="64"
|
||||||
diameter="64"></app-loading>
|
diameter="64"></app-loading>
|
||||||
</div>
|
</div>
|
||||||
} @else if (
|
} @else if (
|
||||||
euProjectStatusesError ||
|
euProjectStatusesError &&
|
||||||
bmbfProjectStatusesError ||
|
bmbfProjectStatusesError &&
|
||||||
dfgProjectStatusesError
|
dfgProjectStatusesError
|
||||||
) {
|
) {
|
||||||
<p class="statistics-error">
|
<p class="statistics-error">
|
||||||
@@ -246,6 +315,17 @@
|
|||||||
} @else if (
|
} @else if (
|
||||||
euProjectStatuses && bmbfProjectStatuses && dfgProjectStatuses
|
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
|
<app-eu-project-status-chart
|
||||||
[statuses]="euProjectStatuses"
|
[statuses]="euProjectStatuses"
|
||||||
[bmbfStatuses]="bmbfProjectStatuses"
|
[bmbfStatuses]="bmbfProjectStatuses"
|
||||||
@@ -267,7 +347,7 @@
|
|||||||
<div class="topic-heatmap-loading" role="status" aria-live="polite">
|
<div class="topic-heatmap-loading" role="status" aria-live="polite">
|
||||||
<app-loading
|
<app-loading
|
||||||
text="Treemap-Daten für den gewählten Zeitraum werden geladen …"
|
text="Treemap-Daten für den gewählten Zeitraum werden geladen …"
|
||||||
icon="account_tree"
|
[icon]="ACCOUNT_TREE_ICON"
|
||||||
size="72"
|
size="72"
|
||||||
diameter="72"></app-loading>
|
diameter="72"></app-loading>
|
||||||
</div>
|
</div>
|
||||||
@@ -308,7 +388,7 @@
|
|||||||
<div class="topic-heatmap-loading" role="status" aria-live="polite">
|
<div class="topic-heatmap-loading" role="status" aria-live="polite">
|
||||||
<app-loading
|
<app-loading
|
||||||
text="DFG-Topics werden geladen …"
|
text="DFG-Topics werden geladen …"
|
||||||
icon="account_tree"
|
[icon]="ACCOUNT_TREE_ICON"
|
||||||
size="72"
|
size="72"
|
||||||
diameter="72"></app-loading>
|
diameter="72"></app-loading>
|
||||||
</div>
|
</div>
|
||||||
@@ -351,7 +431,7 @@
|
|||||||
<div class="topic-heatmap-loading" role="status" aria-live="polite">
|
<div class="topic-heatmap-loading" role="status" aria-live="polite">
|
||||||
<app-loading
|
<app-loading
|
||||||
text="EU-Topics werden geladen …"
|
text="EU-Topics werden geladen …"
|
||||||
icon="account_tree"
|
[icon]="ACCOUNT_TREE_ICON"
|
||||||
size="72"
|
size="72"
|
||||||
diameter="72"></app-loading>
|
diameter="72"></app-loading>
|
||||||
</div>
|
</div>
|
||||||
@@ -394,7 +474,7 @@
|
|||||||
<div class="topic-heatmap-loading" role="status" aria-live="polite">
|
<div class="topic-heatmap-loading" role="status" aria-live="polite">
|
||||||
<app-loading
|
<app-loading
|
||||||
text="BUND-Topics werden geladen …"
|
text="BUND-Topics werden geladen …"
|
||||||
icon="account_tree"
|
[icon]="ACCOUNT_TREE_ICON"
|
||||||
size="72"
|
size="72"
|
||||||
diameter="72"></app-loading>
|
diameter="72"></app-loading>
|
||||||
</div>
|
</div>
|
||||||
@@ -492,4 +572,5 @@
|
|||||||
}
|
}
|
||||||
</section>
|
</section>
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -41,10 +41,16 @@
|
|||||||
.dashboard-period-slider {
|
.dashboard-period-slider {
|
||||||
width: 280px;
|
width: 280px;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-institution-filter {
|
||||||
|
width: 280px;
|
||||||
|
max-width: 100%;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 720px) {
|
@media (max-width: 720px) {
|
||||||
|
.dashboard-institution-filter,
|
||||||
.dashboard-period-slider {
|
.dashboard-period-slider {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
@@ -146,6 +152,120 @@
|
|||||||
color: var(--sg-error);
|
color: var(--sg-error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dashboard-institution-tabs {
|
||||||
|
margin: -0.25rem 0 2rem;
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
margin: 0 0 0.75rem;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
line-height: 1.25;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-institution-tab-bar {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 40px minmax(0, 1fr) 40px;
|
||||||
|
align-items: stretch;
|
||||||
|
border-bottom: 1px solid var(--sg-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-institution-tab-arrow {
|
||||||
|
display: grid;
|
||||||
|
width: 40px;
|
||||||
|
height: 48px;
|
||||||
|
padding: 0;
|
||||||
|
place-items: center;
|
||||||
|
border: 0;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--sg-text-muted);
|
||||||
|
cursor: pointer;
|
||||||
|
transition:
|
||||||
|
color 0.15s ease,
|
||||||
|
background-color 0.15s ease,
|
||||||
|
opacity 0.15s ease;
|
||||||
|
|
||||||
|
&:hover:not(:disabled) {
|
||||||
|
background: var(--sg-option-hover);
|
||||||
|
color: var(--sg-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus-visible {
|
||||||
|
outline-offset: -3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:disabled {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.is-hidden {
|
||||||
|
visibility: hidden;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-institution-tab-list {
|
||||||
|
display: flex;
|
||||||
|
overflow-x: auto;
|
||||||
|
overflow-y: hidden;
|
||||||
|
border-bottom: 0;
|
||||||
|
background: transparent;
|
||||||
|
scrollbar-width: none;
|
||||||
|
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
position: relative;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
min-width: 120px;
|
||||||
|
height: 48px;
|
||||||
|
padding: 0 16px;
|
||||||
|
border: 0;
|
||||||
|
border-radius: 0;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--sg-text-muted);
|
||||||
|
cursor: pointer;
|
||||||
|
font: inherit;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 48px;
|
||||||
|
text-align: center;
|
||||||
|
white-space: nowrap;
|
||||||
|
transition:
|
||||||
|
color 0.15s ease,
|
||||||
|
background-color 0.15s ease;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
border-top: 3px solid transparent;
|
||||||
|
background: transparent;
|
||||||
|
content: '';
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: var(--sg-option-hover);
|
||||||
|
color: var(--sg-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus-visible {
|
||||||
|
outline: 3px solid var(--sg-card-hover-border);
|
||||||
|
outline-offset: -3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
color: var(--sg-blue-highlight);
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
border-top-color: var(--sg-blue-highlight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.top-authors-section {
|
.top-authors-section {
|
||||||
margin-bottom: 2.5rem;
|
margin-bottom: 2.5rem;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,33 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import {
|
||||||
|
AfterViewInit,
|
||||||
|
Component,
|
||||||
|
ElementRef,
|
||||||
|
HostListener,
|
||||||
|
OnInit,
|
||||||
|
ViewChild,
|
||||||
|
} from '@angular/core';
|
||||||
import { DecimalPipe } from '@angular/common';
|
import { DecimalPipe } from '@angular/common';
|
||||||
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||||
import { MatIconModule } from '@angular/material/icon';
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
|
import { MatSelectModule } from '@angular/material/select';
|
||||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||||
import { Observable, finalize } from 'rxjs';
|
import { Observable, finalize } from 'rxjs';
|
||||||
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
|
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { ComponentTooltipDirective } from '../../directives/component-tooltip.directive';
|
import { ComponentTooltipDirective } from '../../directives/component-tooltip.directive';
|
||||||
import { AppAuthorTooltipComponent } from '../../shared/ui/app-author-tooltip/app-author-tooltip.component';
|
import { AppAuthorTooltipComponent } from '../../shared/ui/app-author-tooltip/app-author-tooltip.component';
|
||||||
import { PATENT_ICON } from '../../shared/ui/icons';
|
import {
|
||||||
|
ACCOUNT_BALANCE_ICON,
|
||||||
|
ACCOUNT_TREE_ICON,
|
||||||
|
ARTICLE_ICON,
|
||||||
|
DESCRIPTION_ICON,
|
||||||
|
GROUPS_ICON,
|
||||||
|
MENU_BOOK_ICON,
|
||||||
|
PATENT_ICON,
|
||||||
|
PUBLIC_ICON,
|
||||||
|
SCIENCE_ICON,
|
||||||
|
STACKED_BAR_CHART_ICON,
|
||||||
|
} from '../../shared/ui/icons';
|
||||||
import { EuProjectStatusChartComponent } from './eu-project-status-chart/eu-project-status-chart.component';
|
import { EuProjectStatusChartComponent } from './eu-project-status-chart/eu-project-status-chart.component';
|
||||||
import { YearRangeSliderComponent } from '../../shared/ui/year-range-slider/year-range-slider.component';
|
import { YearRangeSliderComponent } from '../../shared/ui/year-range-slider/year-range-slider.component';
|
||||||
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
|
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
|
||||||
@@ -23,6 +43,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
BmbfProjectStatusStatistics,
|
BmbfProjectStatusStatistics,
|
||||||
BundProjectTopics,
|
BundProjectTopics,
|
||||||
|
DashboardInstitution,
|
||||||
DashboardPeriodBounds,
|
DashboardPeriodBounds,
|
||||||
DashboardStatisticValue,
|
DashboardStatisticValue,
|
||||||
DashboardStatistics,
|
DashboardStatistics,
|
||||||
@@ -61,7 +82,9 @@ type DashboardPeriodMode =
|
|||||||
selector: 'dashboard',
|
selector: 'dashboard',
|
||||||
imports: [
|
imports: [
|
||||||
DecimalPipe,
|
DecimalPipe,
|
||||||
|
MatFormFieldModule,
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
|
MatSelectModule,
|
||||||
MatTooltipModule,
|
MatTooltipModule,
|
||||||
ComponentTooltipDirective,
|
ComponentTooltipDirective,
|
||||||
RouterLink,
|
RouterLink,
|
||||||
@@ -73,9 +96,20 @@ type DashboardPeriodMode =
|
|||||||
templateUrl: './dashboard.component.html',
|
templateUrl: './dashboard.component.html',
|
||||||
styleUrl: './dashboard.component.scss',
|
styleUrl: './dashboard.component.scss',
|
||||||
})
|
})
|
||||||
export class DashboardComponent implements OnInit {
|
export class DashboardComponent implements OnInit, AfterViewInit {
|
||||||
|
@ViewChild('analyticalInstitutionTabList')
|
||||||
|
private analyticalInstitutionTabList?: ElementRef<HTMLElement>;
|
||||||
|
|
||||||
readonly AuthorTooltipComponent = AppAuthorTooltipComponent;
|
readonly AuthorTooltipComponent = AppAuthorTooltipComponent;
|
||||||
readonly patentIcon = PATENT_ICON;
|
readonly patentIcon = PATENT_ICON;
|
||||||
|
readonly MENU_BOOK_ICON = MENU_BOOK_ICON;
|
||||||
|
readonly GROUPS_ICON = GROUPS_ICON;
|
||||||
|
readonly PUBLIC_ICON = PUBLIC_ICON;
|
||||||
|
readonly ACCOUNT_BALANCE_ICON = ACCOUNT_BALANCE_ICON;
|
||||||
|
readonly SCIENCE_ICON = SCIENCE_ICON;
|
||||||
|
readonly STACKED_BAR_CHART_ICON = STACKED_BAR_CHART_ICON;
|
||||||
|
readonly ACCOUNT_TREE_ICON = ACCOUNT_TREE_ICON;
|
||||||
|
|
||||||
statistics?: Partial<DashboardStatistics>;
|
statistics?: Partial<DashboardStatistics>;
|
||||||
statisticsLoading = false;
|
statisticsLoading = false;
|
||||||
statisticsError = false;
|
statisticsError = false;
|
||||||
@@ -128,12 +162,20 @@ export class DashboardComponent implements OnInit {
|
|||||||
dashboardPeriodMode: DashboardPeriodMode = 'all_time';
|
dashboardPeriodMode: DashboardPeriodMode = 'all_time';
|
||||||
dashboardFromYear = this.topicTreemapMinYear;
|
dashboardFromYear = this.topicTreemapMinYear;
|
||||||
dashboardToYear = this.topicTreemapMaxYear;
|
dashboardToYear = this.topicTreemapMaxYear;
|
||||||
|
dashboardInstitutions: DashboardInstitution[] = [];
|
||||||
|
selectedDashboardInstitutionId = 'all';
|
||||||
|
selectedAnalyticalInstitutionId = '';
|
||||||
|
dashboardInstitutionsLoading = false;
|
||||||
|
dashboardInstitutionsError = false;
|
||||||
|
canScrollAnalyticalInstitutionTabsLeft = false;
|
||||||
|
canScrollAnalyticalInstitutionTabsRight = false;
|
||||||
selectedTopicTreemapNode?: string;
|
selectedTopicTreemapNode?: string;
|
||||||
selectedDfgTopicTreemapNode?: string;
|
selectedDfgTopicTreemapNode?: string;
|
||||||
selectedEuTopicTreemapNode?: string;
|
selectedEuTopicTreemapNode?: string;
|
||||||
selectedBundTopicTreemapNode?: string;
|
selectedBundTopicTreemapNode?: string;
|
||||||
private topicTreemapReloadQueued = false;
|
private topicTreemapReloadQueued = false;
|
||||||
private topicTreemapRequestId = 0;
|
private topicTreemapRequestId = 0;
|
||||||
|
private analyticalRequestId = 0;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private statisticsService: DashboardStatisticsService,
|
private statisticsService: DashboardStatisticsService,
|
||||||
@@ -144,43 +186,83 @@ export class DashboardComponent implements OnInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.restoreDashboardPeriodState();
|
this.restoreDashboardPeriodState();
|
||||||
|
this.loadDashboardInstitutions();
|
||||||
this.loadStatistics();
|
this.loadStatistics();
|
||||||
this.loadTopAuthors();
|
}
|
||||||
this.loadTopicTreemap();
|
|
||||||
this.loadDfgProjectTopics();
|
ngAfterViewInit(): void {
|
||||||
this.loadEuProjectTopics();
|
setTimeout(() => this.updateAnalyticalInstitutionTabScrollState());
|
||||||
this.loadBundProjectTopics();
|
}
|
||||||
this.loadEuProjectStatuses();
|
|
||||||
this.loadBmbfProjectStatuses();
|
@HostListener('window:resize')
|
||||||
this.loadDfgProjectStatuses();
|
onWindowResize(): void {
|
||||||
|
this.updateAnalyticalInstitutionTabScrollState();
|
||||||
|
}
|
||||||
|
|
||||||
|
private loadDashboardInstitutions(): void {
|
||||||
|
this.dashboardInstitutionsLoading = true;
|
||||||
|
this.dashboardInstitutionsError = false;
|
||||||
|
this.statisticsService
|
||||||
|
.getInstitutions()
|
||||||
|
.pipe(finalize(() => (this.dashboardInstitutionsLoading = false)))
|
||||||
|
.subscribe({
|
||||||
|
next: (institutions) => {
|
||||||
|
this.dashboardInstitutions = institutions;
|
||||||
|
setTimeout(() => this.updateAnalyticalInstitutionTabScrollState());
|
||||||
|
const requestedInstitution =
|
||||||
|
this.route.snapshot.queryParamMap.get('institution') ?? 'all';
|
||||||
|
const restoredInstitution = institutions.some(
|
||||||
|
(institution) => institution.id === requestedInstitution,
|
||||||
|
)
|
||||||
|
? requestedInstitution
|
||||||
|
: 'all';
|
||||||
|
if (restoredInstitution !== this.selectedDashboardInstitutionId) {
|
||||||
|
this.selectedDashboardInstitutionId = restoredInstitution;
|
||||||
|
this.loadStatistics();
|
||||||
|
}
|
||||||
|
const restoredAnalyticalInstitution =
|
||||||
|
restoredInstitution === 'all' ? '' : restoredInstitution;
|
||||||
|
if (
|
||||||
|
restoredAnalyticalInstitution !== this.selectedAnalyticalInstitutionId
|
||||||
|
) {
|
||||||
|
this.selectedAnalyticalInstitutionId = restoredAnalyticalInstitution;
|
||||||
|
this.reloadAnalyticalData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: () => {
|
||||||
|
this.dashboardInstitutions = [];
|
||||||
|
this.dashboardInstitutionsError = true;
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private loadStatistics(): void {
|
private loadStatistics(): void {
|
||||||
this.statisticsError = false;
|
this.statisticsError = false;
|
||||||
const period = this.selectedPeriodBounds();
|
const period = this.selectedPeriodBounds();
|
||||||
|
const institutionId = this.selectedDashboardInstitutionId;
|
||||||
this.loadStatistic(
|
this.loadStatistic(
|
||||||
'publications',
|
'publications',
|
||||||
this.statisticsService.getPublicationCount(period),
|
this.statisticsService.getPublicationCount(period, institutionId),
|
||||||
);
|
);
|
||||||
this.loadStatistic(
|
this.loadStatistic(
|
||||||
'persons',
|
'persons',
|
||||||
this.statisticsService.getPersonCount(period),
|
this.statisticsService.getPersonCount(period, institutionId),
|
||||||
);
|
);
|
||||||
this.loadStatistic(
|
this.loadStatistic(
|
||||||
'patents',
|
'patents',
|
||||||
this.statisticsService.getPatentCount(period),
|
this.statisticsService.getPatentCount(period, institutionId),
|
||||||
);
|
);
|
||||||
this.loadStatistic(
|
this.loadStatistic(
|
||||||
'eu_projects',
|
'eu_projects',
|
||||||
this.statisticsService.getEuProjectCount(period),
|
this.statisticsService.getEuProjectCount(period, institutionId),
|
||||||
);
|
);
|
||||||
this.loadStatistic(
|
this.loadStatistic(
|
||||||
'bmbf_projects',
|
'bmbf_projects',
|
||||||
this.statisticsService.getBmbfProjectCount(period),
|
this.statisticsService.getBmbfProjectCount(period, institutionId),
|
||||||
);
|
);
|
||||||
this.loadStatistic(
|
this.loadStatistic(
|
||||||
'dfg_projects',
|
'dfg_projects',
|
||||||
this.statisticsService.getDfgProjectCount(period),
|
this.statisticsService.getDfgProjectCount(period, institutionId),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,26 +274,30 @@ export class DashboardComponent implements OnInit {
|
|||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
title: 'Publikationen',
|
title: 'Publikationen',
|
||||||
icon: 'menu_book',
|
icon: MENU_BOOK_ICON,
|
||||||
entries: this.topAuthors?.works ?? [],
|
entries: this.topAuthors?.works ?? [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'EU-Projekte',
|
title: 'EU-Projekte',
|
||||||
icon: 'public',
|
icon: PUBLIC_ICON,
|
||||||
entries: this.topAuthors?.eu_projects ?? [],
|
entries: this.topAuthors?.eu_projects ?? [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Patente',
|
title: 'Patente',
|
||||||
icon: 'description',
|
icon: DESCRIPTION_ICON,
|
||||||
entries: this.topAuthors?.patents ?? [],
|
entries: this.topAuthors?.patents ?? [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'DFG Projekte',
|
title: 'DFG Projekte',
|
||||||
icon: 'account_tree',
|
icon: ACCOUNT_TREE_ICON,
|
||||||
entries: this.topAuthors?.projects ?? [],
|
entries: this.topAuthors?.projects ?? [],
|
||||||
stripAuthorTitle: true,
|
stripAuthorTitle: true,
|
||||||
},
|
},
|
||||||
{ title: 'News', icon: 'article', entries: this.topAuthors?.news ?? [] },
|
{
|
||||||
|
title: 'News',
|
||||||
|
icon: ARTICLE_ICON,
|
||||||
|
entries: this.topAuthors?.news ?? [],
|
||||||
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,11 +420,22 @@ export class DashboardComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
institutionRouteId(): string {
|
institutionRouteId(): string {
|
||||||
return (
|
const selectedInstitutionId = this.routeableInstitutionId(
|
||||||
this.statistics?.institution_id?.replace('https://openalex.org/', '') ??
|
this.selectedDashboardInstitutionId,
|
||||||
this.topAuthors?.institution_id?.replace('https://openalex.org/', '') ??
|
|
||||||
''
|
|
||||||
);
|
);
|
||||||
|
if (selectedInstitutionId) return selectedInstitutionId;
|
||||||
|
|
||||||
|
return this.routeableInstitutionId(this.dashboardInstitutions[0]?.id) ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
private routeableInstitutionId(institutionId?: string | null): string | null {
|
||||||
|
const normalizedInstitutionId = institutionId
|
||||||
|
?.replace('https://openalex.org/', '')
|
||||||
|
.trim();
|
||||||
|
|
||||||
|
return normalizedInstitutionId && normalizedInstitutionId !== 'all'
|
||||||
|
? normalizedInstitutionId
|
||||||
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
personListQueryParams(): PersonListQueryParams {
|
personListQueryParams(): PersonListQueryParams {
|
||||||
@@ -365,6 +462,65 @@ export class DashboardComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onDashboardInstitutionChange(institutionId: string): void {
|
||||||
|
this.selectedDashboardInstitutionId = institutionId;
|
||||||
|
const analyticalInstitutionId =
|
||||||
|
institutionId === 'all' ? '' : institutionId;
|
||||||
|
const analyticalInstitutionChanged =
|
||||||
|
analyticalInstitutionId !== this.selectedAnalyticalInstitutionId;
|
||||||
|
this.selectedAnalyticalInstitutionId = analyticalInstitutionId;
|
||||||
|
this.updateDashboardPeriodUrl();
|
||||||
|
this.loadStatistics();
|
||||||
|
if (analyticalInstitutionChanged) {
|
||||||
|
if (analyticalInstitutionId) {
|
||||||
|
this.reloadAnalyticalData();
|
||||||
|
} else {
|
||||||
|
// Invalidate pending requests when "Alle Institutionen" is selected.
|
||||||
|
this.analyticalRequestId += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onAnalyticalInstitutionChange(institutionId: string): void {
|
||||||
|
if (institutionId === this.selectedAnalyticalInstitutionId) return;
|
||||||
|
this.selectedAnalyticalInstitutionId = institutionId;
|
||||||
|
this.updateDashboardPeriodUrl();
|
||||||
|
this.reloadAnalyticalData();
|
||||||
|
}
|
||||||
|
|
||||||
|
scrollAnalyticalInstitutionTabs(direction: -1 | 1): void {
|
||||||
|
const tabList = this.analyticalInstitutionTabList?.nativeElement;
|
||||||
|
if (!tabList) return;
|
||||||
|
|
||||||
|
tabList.scrollBy({
|
||||||
|
left: direction * Math.floor(tabList.clientWidth * 0.75),
|
||||||
|
behavior: 'smooth',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
updateAnalyticalInstitutionTabScrollState(): void {
|
||||||
|
const tabList = this.analyticalInstitutionTabList?.nativeElement;
|
||||||
|
if (!tabList) {
|
||||||
|
this.canScrollAnalyticalInstitutionTabsLeft = false;
|
||||||
|
this.canScrollAnalyticalInstitutionTabsRight = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const maxScrollLeft = tabList.scrollWidth - tabList.clientWidth;
|
||||||
|
this.canScrollAnalyticalInstitutionTabsLeft = tabList.scrollLeft > 1;
|
||||||
|
this.canScrollAnalyticalInstitutionTabsRight =
|
||||||
|
tabList.scrollLeft < maxScrollLeft - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
failedProjectStatusSources(): string {
|
||||||
|
const sources = [
|
||||||
|
this.euProjectStatusesError ? 'EU' : undefined,
|
||||||
|
this.bmbfProjectStatusesError ? 'Bund' : undefined,
|
||||||
|
this.dfgProjectStatusesError ? 'DFG' : undefined,
|
||||||
|
].filter((source): source is string => source !== undefined);
|
||||||
|
return sources.join(' und ');
|
||||||
|
}
|
||||||
|
|
||||||
onTopicTreemapNodeChange(nodeId: string | undefined): void {
|
onTopicTreemapNodeChange(nodeId: string | undefined): void {
|
||||||
this.selectedTopicTreemapNode = nodeId;
|
this.selectedTopicTreemapNode = nodeId;
|
||||||
this.updateDashboardPeriodUrl();
|
this.updateDashboardPeriodUrl();
|
||||||
@@ -468,6 +624,7 @@ export class DashboardComponent implements OnInit {
|
|||||||
...topic,
|
...topic,
|
||||||
fromYear: period.fromYear,
|
fromYear: period.fromYear,
|
||||||
toYear: period.toYear,
|
toYear: period.toYear,
|
||||||
|
institutionId: this.selectedAnalyticalInstitutionId,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -532,6 +689,8 @@ export class DashboardComponent implements OnInit {
|
|||||||
dfgTreemapNode: this.selectedDfgTopicTreemapNode ?? null,
|
dfgTreemapNode: this.selectedDfgTopicTreemapNode ?? null,
|
||||||
euTreemapNode: this.selectedEuTopicTreemapNode ?? null,
|
euTreemapNode: this.selectedEuTopicTreemapNode ?? null,
|
||||||
bundTreemapNode: this.selectedBundTopicTreemapNode ?? null,
|
bundTreemapNode: this.selectedBundTopicTreemapNode ?? null,
|
||||||
|
institution: this.selectedDashboardInstitutionId,
|
||||||
|
analyticalInstitution: this.selectedAnalyticalInstitutionId || null,
|
||||||
},
|
},
|
||||||
queryParamsHandling: 'merge',
|
queryParamsHandling: 'merge',
|
||||||
replaceUrl: true,
|
replaceUrl: true,
|
||||||
@@ -558,14 +717,23 @@ export class DashboardComponent implements OnInit {
|
|||||||
|
|
||||||
private reloadPeriodData(): void {
|
private reloadPeriodData(): void {
|
||||||
this.loadStatistics();
|
this.loadStatistics();
|
||||||
this.loadTopAuthors();
|
this.reloadAnalyticalData();
|
||||||
this.loadTopicTreemap();
|
}
|
||||||
this.loadDfgProjectTopics();
|
|
||||||
this.loadEuProjectTopics();
|
private reloadAnalyticalData(): void {
|
||||||
this.loadBundProjectTopics();
|
if (!this.selectedAnalyticalInstitutionId) return;
|
||||||
this.loadEuProjectStatuses();
|
const requestId = ++this.analyticalRequestId;
|
||||||
this.loadBmbfProjectStatuses();
|
this.euProjectStatuses = undefined;
|
||||||
this.loadDfgProjectStatuses();
|
this.bmbfProjectStatuses = undefined;
|
||||||
|
this.dfgProjectStatuses = undefined;
|
||||||
|
this.loadTopAuthors(requestId);
|
||||||
|
this.loadTopicTreemap(requestId);
|
||||||
|
this.loadDfgProjectTopics(requestId);
|
||||||
|
this.loadEuProjectTopics(requestId);
|
||||||
|
this.loadBundProjectTopics(requestId);
|
||||||
|
this.loadEuProjectStatuses(requestId);
|
||||||
|
this.loadBmbfProjectStatuses(requestId);
|
||||||
|
this.loadDfgProjectStatuses(requestId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private loadStatistic(
|
private loadStatistic(
|
||||||
@@ -613,149 +781,269 @@ export class DashboardComponent implements OnInit {
|
|||||||
this.statistics = nextStatistics;
|
this.statistics = nextStatistics;
|
||||||
}
|
}
|
||||||
|
|
||||||
private loadTopAuthors(): void {
|
private loadTopAuthors(requestId = this.analyticalRequestId): void {
|
||||||
this.topAuthorsLoading = true;
|
this.topAuthorsLoading = true;
|
||||||
this.topAuthorsError = false;
|
this.topAuthorsError = false;
|
||||||
this.statisticsService
|
this.statisticsService
|
||||||
.getTopAuthors(this.selectedPeriodBounds())
|
.getTopAuthors(
|
||||||
.pipe(finalize(() => (this.topAuthorsLoading = false)))
|
this.selectedPeriodBounds(),
|
||||||
|
this.selectedAnalyticalInstitutionId,
|
||||||
|
)
|
||||||
|
.pipe(
|
||||||
|
finalize(() => {
|
||||||
|
if (requestId === this.analyticalRequestId) {
|
||||||
|
this.topAuthorsLoading = false;
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
)
|
||||||
.subscribe({
|
.subscribe({
|
||||||
next: (statistics) => {
|
next: (statistics) => {
|
||||||
this.topAuthors = statistics;
|
if (requestId === this.analyticalRequestId) {
|
||||||
|
this.topAuthors = statistics;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error: () => {
|
error: () => {
|
||||||
this.topAuthorsError = true;
|
if (requestId === this.analyticalRequestId) {
|
||||||
|
this.topAuthorsError = true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private loadDfgProjectTopics(): void {
|
private loadDfgProjectTopics(requestId = this.analyticalRequestId): void {
|
||||||
this.dfgTopicsLoading = true;
|
this.dfgTopicsLoading = true;
|
||||||
this.dfgTopicsError = false;
|
this.dfgTopicsError = false;
|
||||||
this.statisticsService
|
this.statisticsService
|
||||||
.getDfgProjectTopics(this.selectedPeriodBounds())
|
.getDfgProjectTopics(
|
||||||
.pipe(finalize(() => (this.dfgTopicsLoading = false)))
|
this.selectedPeriodBounds(),
|
||||||
|
this.selectedAnalyticalInstitutionId,
|
||||||
|
)
|
||||||
|
.pipe(
|
||||||
|
finalize(() => {
|
||||||
|
if (requestId === this.analyticalRequestId) {
|
||||||
|
this.dfgTopicsLoading = false;
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
)
|
||||||
.subscribe({
|
.subscribe({
|
||||||
next: (topics) => {
|
next: (topics) => {
|
||||||
this.dfgProjectTopics = topics;
|
if (requestId === this.analyticalRequestId) {
|
||||||
this.dfgTopicTreemap = this.buildDfgTopicTreemapData(topics);
|
this.dfgProjectTopics = topics;
|
||||||
|
this.dfgTopicTreemap = this.buildDfgTopicTreemapData(topics);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error: () => {
|
error: () => {
|
||||||
this.dfgTopicsError = true;
|
if (requestId === this.analyticalRequestId) {
|
||||||
|
this.dfgTopicsError = true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private loadEuProjectTopics(): void {
|
private loadEuProjectTopics(requestId = this.analyticalRequestId): void {
|
||||||
this.euTopicsLoading = true;
|
this.euTopicsLoading = true;
|
||||||
this.euTopicsError = false;
|
this.euTopicsError = false;
|
||||||
this.statisticsService
|
this.statisticsService
|
||||||
.getEuProjectTopics(this.selectedPeriodBounds())
|
.getEuProjectTopics(
|
||||||
.pipe(finalize(() => (this.euTopicsLoading = false)))
|
this.selectedPeriodBounds(),
|
||||||
|
this.selectedAnalyticalInstitutionId,
|
||||||
|
)
|
||||||
|
.pipe(
|
||||||
|
finalize(() => {
|
||||||
|
if (requestId === this.analyticalRequestId) {
|
||||||
|
this.euTopicsLoading = false;
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
)
|
||||||
.subscribe({
|
.subscribe({
|
||||||
next: (topics) => {
|
next: (topics) => {
|
||||||
this.euProjectTopics = topics;
|
if (requestId === this.analyticalRequestId) {
|
||||||
this.euTopicTreemap = this.buildDfgTopicTreemapData(topics);
|
this.euProjectTopics = topics;
|
||||||
|
this.euTopicTreemap = this.buildDfgTopicTreemapData(topics);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error: () => {
|
error: () => {
|
||||||
this.euTopicsError = true;
|
if (requestId === this.analyticalRequestId) {
|
||||||
|
this.euTopicsError = true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private loadBundProjectTopics(): void {
|
private loadBundProjectTopics(requestId = this.analyticalRequestId): void {
|
||||||
this.bundTopicsLoading = true;
|
this.bundTopicsLoading = true;
|
||||||
this.bundTopicsError = false;
|
this.bundTopicsError = false;
|
||||||
this.statisticsService
|
this.statisticsService
|
||||||
.getBundProjectTopics(this.selectedPeriodBounds())
|
.getBundProjectTopics(
|
||||||
.pipe(finalize(() => (this.bundTopicsLoading = false)))
|
this.selectedPeriodBounds(),
|
||||||
|
this.selectedAnalyticalInstitutionId,
|
||||||
|
)
|
||||||
|
.pipe(
|
||||||
|
finalize(() => {
|
||||||
|
if (requestId === this.analyticalRequestId) {
|
||||||
|
this.bundTopicsLoading = false;
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
)
|
||||||
.subscribe({
|
.subscribe({
|
||||||
next: (topics) => {
|
next: (topics) => {
|
||||||
this.bundProjectTopics = topics;
|
if (requestId === this.analyticalRequestId) {
|
||||||
this.bundTopicTreemap = this.buildDfgTopicTreemapData(topics);
|
this.bundProjectTopics = topics;
|
||||||
|
this.bundTopicTreemap = this.buildDfgTopicTreemapData(topics);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error: () => {
|
error: () => {
|
||||||
this.bundTopicsError = true;
|
if (requestId === this.analyticalRequestId) {
|
||||||
|
this.bundTopicsError = true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private loadEuProjectStatuses(): void {
|
private loadEuProjectStatuses(requestId = this.analyticalRequestId): void {
|
||||||
this.euProjectStatusesLoading = true;
|
this.euProjectStatusesLoading = true;
|
||||||
this.euProjectStatusesError = false;
|
this.euProjectStatusesError = false;
|
||||||
this.statisticsService
|
this.statisticsService
|
||||||
.getEuProjectStatuses(this.selectedPeriodBounds())
|
.getEuProjectStatuses(
|
||||||
.pipe(finalize(() => (this.euProjectStatusesLoading = false)))
|
this.selectedPeriodBounds(),
|
||||||
|
this.selectedAnalyticalInstitutionId,
|
||||||
|
)
|
||||||
|
.pipe(
|
||||||
|
finalize(() => {
|
||||||
|
if (requestId === this.analyticalRequestId) {
|
||||||
|
this.euProjectStatusesLoading = false;
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
)
|
||||||
.subscribe({
|
.subscribe({
|
||||||
next: (statuses) => {
|
next: (statuses) => {
|
||||||
this.euProjectStatuses = statuses;
|
if (requestId === this.analyticalRequestId) {
|
||||||
|
this.euProjectStatuses = statuses;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error: () => {
|
error: () => {
|
||||||
this.euProjectStatusesError = true;
|
if (requestId === this.analyticalRequestId) {
|
||||||
|
this.euProjectStatusesError = true;
|
||||||
|
this.euProjectStatuses = this.emptyProjectStatuses();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private loadBmbfProjectStatuses(): void {
|
private loadBmbfProjectStatuses(requestId = this.analyticalRequestId): void {
|
||||||
this.bmbfProjectStatusesLoading = true;
|
this.bmbfProjectStatusesLoading = true;
|
||||||
this.bmbfProjectStatusesError = false;
|
this.bmbfProjectStatusesError = false;
|
||||||
this.statisticsService
|
this.statisticsService
|
||||||
.getBmbfProjectStatuses(this.selectedPeriodBounds())
|
.getBmbfProjectStatuses(
|
||||||
.pipe(finalize(() => (this.bmbfProjectStatusesLoading = false)))
|
this.selectedPeriodBounds(),
|
||||||
|
this.selectedAnalyticalInstitutionId,
|
||||||
|
)
|
||||||
|
.pipe(
|
||||||
|
finalize(() => {
|
||||||
|
if (requestId === this.analyticalRequestId) {
|
||||||
|
this.bmbfProjectStatusesLoading = false;
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
)
|
||||||
.subscribe({
|
.subscribe({
|
||||||
next: (statuses) => {
|
next: (statuses) => {
|
||||||
this.bmbfProjectStatuses = statuses;
|
if (requestId === this.analyticalRequestId) {
|
||||||
|
this.bmbfProjectStatuses = statuses;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error: () => {
|
error: () => {
|
||||||
this.bmbfProjectStatusesError = true;
|
if (requestId === this.analyticalRequestId) {
|
||||||
|
this.bmbfProjectStatusesError = true;
|
||||||
|
this.bmbfProjectStatuses = this.emptyProjectStatuses();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private loadDfgProjectStatuses(): void {
|
private loadDfgProjectStatuses(requestId = this.analyticalRequestId): void {
|
||||||
this.dfgProjectStatusesLoading = true;
|
this.dfgProjectStatusesLoading = true;
|
||||||
this.dfgProjectStatusesError = false;
|
this.dfgProjectStatusesError = false;
|
||||||
this.statisticsService
|
this.statisticsService
|
||||||
.getDfgProjectStatuses(this.selectedPeriodBounds())
|
.getDfgProjectStatuses(
|
||||||
.pipe(finalize(() => (this.dfgProjectStatusesLoading = false)))
|
this.selectedPeriodBounds(),
|
||||||
|
this.selectedAnalyticalInstitutionId,
|
||||||
|
)
|
||||||
|
.pipe(
|
||||||
|
finalize(() => {
|
||||||
|
if (requestId === this.analyticalRequestId) {
|
||||||
|
this.dfgProjectStatusesLoading = false;
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
)
|
||||||
.subscribe({
|
.subscribe({
|
||||||
next: (statuses) => {
|
next: (statuses) => {
|
||||||
this.dfgProjectStatuses = statuses;
|
if (requestId === this.analyticalRequestId) {
|
||||||
|
this.dfgProjectStatuses = statuses;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error: () => {
|
error: () => {
|
||||||
this.dfgProjectStatusesError = true;
|
if (requestId === this.analyticalRequestId) {
|
||||||
|
this.dfgProjectStatusesError = true;
|
||||||
|
this.dfgProjectStatuses = this.emptyProjectStatuses();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private loadTopicTreemap(): void {
|
private emptyProjectStatuses(): EuProjectStatusStatistics {
|
||||||
|
const institution = this.dashboardInstitutions.find(
|
||||||
|
({ id }) => id === this.selectedAnalyticalInstitutionId,
|
||||||
|
);
|
||||||
|
return {
|
||||||
|
institution_id: this.selectedAnalyticalInstitutionId,
|
||||||
|
organization_name: institution?.display_name ?? '',
|
||||||
|
ongoing: 0,
|
||||||
|
upcoming: 0,
|
||||||
|
completed: 0,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private loadTopicTreemap(analyticalRequestId = this.analyticalRequestId): void {
|
||||||
if (this.dashboardFromYear > this.dashboardToYear) {
|
if (this.dashboardFromYear > this.dashboardToYear) {
|
||||||
this.topicTreemapLoading = false;
|
this.topicTreemapLoading = false;
|
||||||
this.topicTreemapError = true;
|
this.topicTreemapError = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const requestId = ++this.topicTreemapRequestId;
|
const treemapRequestId = ++this.topicTreemapRequestId;
|
||||||
const period = this.selectedPeriodBounds();
|
const period = this.selectedPeriodBounds();
|
||||||
this.topicTreemapLoading = true;
|
this.topicTreemapLoading = true;
|
||||||
this.topicTreemapError = false;
|
this.topicTreemapError = false;
|
||||||
this.statisticsService
|
this.statisticsService
|
||||||
.getTopicTreemap(period.fromYear, period.toYear)
|
.getTopicTreemap(
|
||||||
|
period.fromYear,
|
||||||
|
period.toYear,
|
||||||
|
this.selectedAnalyticalInstitutionId,
|
||||||
|
)
|
||||||
.pipe(
|
.pipe(
|
||||||
finalize(() => {
|
finalize(() => {
|
||||||
if (requestId === this.topicTreemapRequestId) {
|
if (
|
||||||
|
analyticalRequestId === this.analyticalRequestId &&
|
||||||
|
treemapRequestId === this.topicTreemapRequestId
|
||||||
|
) {
|
||||||
this.topicTreemapLoading = false;
|
this.topicTreemapLoading = false;
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.subscribe({
|
.subscribe({
|
||||||
next: (treemap) => {
|
next: (treemap) => {
|
||||||
if (requestId === this.topicTreemapRequestId) {
|
if (
|
||||||
|
analyticalRequestId === this.analyticalRequestId &&
|
||||||
|
treemapRequestId === this.topicTreemapRequestId
|
||||||
|
) {
|
||||||
this.topicTreemap = treemap;
|
this.topicTreemap = treemap;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: () => {
|
error: () => {
|
||||||
if (requestId === this.topicTreemapRequestId) {
|
if (
|
||||||
|
analyticalRequestId === this.analyticalRequestId &&
|
||||||
|
treemapRequestId === this.topicTreemapRequestId
|
||||||
|
) {
|
||||||
this.topicTreemapError = true;
|
this.topicTreemapError = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
+17
-17
@@ -22,7 +22,7 @@
|
|||||||
type="button"
|
type="button"
|
||||||
aria-label="Dialog schließen"
|
aria-label="Dialog schließen"
|
||||||
mat-dialog-close>
|
mat-dialog-close>
|
||||||
<mat-icon>close</mat-icon>
|
<mat-icon>{{ CLOSE_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<span
|
<span
|
||||||
class="topic-context-icon topic-context-icon--field"
|
class="topic-context-icon topic-context-icon--field"
|
||||||
aria-hidden="true">
|
aria-hidden="true">
|
||||||
<mat-icon>category</mat-icon>
|
<mat-icon>{{ CATEGORY_ICON }}</mat-icon>
|
||||||
</span>
|
</span>
|
||||||
<span class="topic-context-copy">
|
<span class="topic-context-copy">
|
||||||
<span class="topic-context-label">Field</span>
|
<span class="topic-context-label">Field</span>
|
||||||
@@ -41,14 +41,14 @@
|
|||||||
}}</strong>
|
}}</strong>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<mat-icon class="topic-context-arrow" aria-hidden="true"
|
<mat-icon class="topic-context-arrow" aria-hidden="true">{{
|
||||||
>chevron_right</mat-icon
|
CHEVRON_RIGHT_ICON
|
||||||
>
|
}}</mat-icon>
|
||||||
<div class="topic-context-item">
|
<div class="topic-context-item">
|
||||||
<span
|
<span
|
||||||
class="topic-context-icon topic-context-icon--subfield"
|
class="topic-context-icon topic-context-icon--subfield"
|
||||||
aria-hidden="true">
|
aria-hidden="true">
|
||||||
<mat-icon>account_tree</mat-icon>
|
<mat-icon>{{ ACCOUNT_TREE_ICON }}</mat-icon>
|
||||||
</span>
|
</span>
|
||||||
<span class="topic-context-copy">
|
<span class="topic-context-copy">
|
||||||
<span class="topic-context-label">Subfield</span>
|
<span class="topic-context-label">Subfield</span>
|
||||||
@@ -57,14 +57,14 @@
|
|||||||
}}</strong>
|
}}</strong>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<mat-icon class="topic-context-arrow" aria-hidden="true"
|
<mat-icon class="topic-context-arrow" aria-hidden="true">{{
|
||||||
>chevron_right</mat-icon
|
CHEVRON_RIGHT_ICON
|
||||||
>
|
}}</mat-icon>
|
||||||
<div class="topic-context-item topic-context-item--topic">
|
<div class="topic-context-item topic-context-item--topic">
|
||||||
<span
|
<span
|
||||||
class="topic-context-icon topic-context-icon--topic"
|
class="topic-context-icon topic-context-icon--topic"
|
||||||
aria-hidden="true">
|
aria-hidden="true">
|
||||||
<mat-icon>label</mat-icon>
|
<mat-icon>{{ LABEL_ICON }}</mat-icon>
|
||||||
</span>
|
</span>
|
||||||
<span class="topic-context-copy">
|
<span class="topic-context-copy">
|
||||||
<span class="topic-context-label">Topic</span>
|
<span class="topic-context-label">Topic</span>
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
@if (loading) {
|
@if (loading) {
|
||||||
<div class="word-cloud-state">
|
<div class="word-cloud-state">
|
||||||
<span class="state-icon state-icon--loading" aria-hidden="true">
|
<span class="state-icon state-icon--loading" aria-hidden="true">
|
||||||
<mat-icon>hourglass_top</mat-icon>
|
<mat-icon>{{ HOURGLASS_ICON }}</mat-icon>
|
||||||
</span>
|
</span>
|
||||||
<strong>Wordcloud wird erstellt</strong>
|
<strong>Wordcloud wird erstellt</strong>
|
||||||
<span>Die wichtigsten Keywords werden geladen …</span>
|
<span>Die wichtigsten Keywords werden geladen …</span>
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
} @else if (loadFailed) {
|
} @else if (loadFailed) {
|
||||||
<div class="word-cloud-state word-cloud-state--error">
|
<div class="word-cloud-state word-cloud-state--error">
|
||||||
<span class="state-icon" aria-hidden="true"
|
<span class="state-icon" aria-hidden="true"
|
||||||
><mat-icon>cloud_off</mat-icon></span
|
><mat-icon>{{ CLOUD_OFF_ICON }}</mat-icon></span
|
||||||
>
|
>
|
||||||
<strong>Wordcloud nicht verfügbar</strong>
|
<strong>Wordcloud nicht verfügbar</strong>
|
||||||
<span>Die Keywords konnten nicht geladen werden.</span>
|
<span>Die Keywords konnten nicht geladen werden.</span>
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
} @else if (words.length) {
|
} @else if (words.length) {
|
||||||
<div class="keyword-toolbar" aria-label="Ausgewählte Keywords">
|
<div class="keyword-toolbar" aria-label="Ausgewählte Keywords">
|
||||||
<div class="keyword-toolbar-label">
|
<div class="keyword-toolbar-label">
|
||||||
<mat-icon aria-hidden="true">tune</mat-icon>
|
<mat-icon aria-hidden="true">{{ TUNE_ICON }}</mat-icon>
|
||||||
<span>
|
<span>
|
||||||
<strong>Keyword-Auswahl</strong>
|
<strong>Keyword-Auswahl</strong>
|
||||||
<small
|
<small
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
[attr.aria-label]="word.name + ' aus Auswahl entfernen'"
|
[attr.aria-label]="word.name + ' aus Auswahl entfernen'"
|
||||||
(click)="toggleWord(word)">
|
(click)="toggleWord(word)">
|
||||||
{{ word.name }}
|
{{ word.name }}
|
||||||
<mat-icon aria-hidden="true">close</mat-icon>
|
<mat-icon aria-hidden="true">{{ CLOSE_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
} @empty {
|
} @empty {
|
||||||
<span class="keyword-selection-empty">Noch nichts ausgewählt</span>
|
<span class="keyword-selection-empty">Noch nichts ausgewählt</span>
|
||||||
@@ -157,7 +157,7 @@
|
|||||||
? $event.preventDefault()
|
? $event.preventDefault()
|
||||||
: closeForSearchNavigation()
|
: closeForSearchNavigation()
|
||||||
">
|
">
|
||||||
<mat-icon aria-hidden="true">manage_search</mat-icon>
|
<mat-icon aria-hidden="true">{{ MANAGE_SEARCH_ICON }}</mat-icon>
|
||||||
Suche in Keywords
|
Suche in Keywords
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
@@ -178,7 +178,7 @@
|
|||||||
? $event.preventDefault()
|
? $event.preventDefault()
|
||||||
: closeForSearchNavigation()
|
: closeForSearchNavigation()
|
||||||
">
|
">
|
||||||
<mat-icon aria-hidden="true">search</mat-icon>
|
<mat-icon aria-hidden="true">{{ SEARCH_ICON }}</mat-icon>
|
||||||
Suche in Themen
|
Suche in Themen
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -208,7 +208,7 @@
|
|||||||
} @else {
|
} @else {
|
||||||
<div class="word-cloud-state">
|
<div class="word-cloud-state">
|
||||||
<span class="state-icon" aria-hidden="true"
|
<span class="state-icon" aria-hidden="true"
|
||||||
><mat-icon>search_off</mat-icon></span
|
><mat-icon>{{ SEARCH_OFF_ICON }}</mat-icon></span
|
||||||
>
|
>
|
||||||
<strong>Keine Keywords gefunden</strong>
|
<strong>Keine Keywords gefunden</strong>
|
||||||
<span
|
<span
|
||||||
|
|||||||
+27
@@ -14,6 +14,19 @@ import {
|
|||||||
DashboardStatisticsService,
|
DashboardStatisticsService,
|
||||||
TopicWordCloudWord,
|
TopicWordCloudWord,
|
||||||
} from '../dashboard-statistics.service';
|
} from '../dashboard-statistics.service';
|
||||||
|
import {
|
||||||
|
ACCOUNT_TREE_ICON,
|
||||||
|
CATEGORY_ICON,
|
||||||
|
CHEVRON_RIGHT_ICON,
|
||||||
|
CLOSE_ICON,
|
||||||
|
CLOUD_OFF_ICON,
|
||||||
|
HOURGLASS_ICON,
|
||||||
|
LABEL_ICON,
|
||||||
|
MANAGE_SEARCH_ICON,
|
||||||
|
SEARCH_ICON,
|
||||||
|
SEARCH_OFF_ICON,
|
||||||
|
TUNE_ICON,
|
||||||
|
} from '../../../shared/ui/icons';
|
||||||
|
|
||||||
export interface TopicWordCloudDialogData {
|
export interface TopicWordCloudDialogData {
|
||||||
topicId: string;
|
topicId: string;
|
||||||
@@ -22,6 +35,7 @@ export interface TopicWordCloudDialogData {
|
|||||||
subfieldName?: string;
|
subfieldName?: string;
|
||||||
fromYear?: number;
|
fromYear?: number;
|
||||||
toYear?: number;
|
toYear?: number;
|
||||||
|
institutionId?: string;
|
||||||
words?: TopicWordCloudWord[];
|
words?: TopicWordCloudWord[];
|
||||||
source?: 'publications' | 'dfg' | 'eu' | 'bund';
|
source?: 'publications' | 'dfg' | 'eu' | 'bund';
|
||||||
}
|
}
|
||||||
@@ -46,6 +60,18 @@ interface DisplayWord extends TopicWordCloudWord {
|
|||||||
styleUrl: './topic-wordcloud-dialog.component.scss',
|
styleUrl: './topic-wordcloud-dialog.component.scss',
|
||||||
})
|
})
|
||||||
export class TopicWordCloudDialogComponent {
|
export class TopicWordCloudDialogComponent {
|
||||||
|
readonly CLOSE_ICON = CLOSE_ICON;
|
||||||
|
readonly CATEGORY_ICON = CATEGORY_ICON;
|
||||||
|
readonly CHEVRON_RIGHT_ICON = CHEVRON_RIGHT_ICON;
|
||||||
|
readonly ACCOUNT_TREE_ICON = ACCOUNT_TREE_ICON;
|
||||||
|
readonly LABEL_ICON = LABEL_ICON;
|
||||||
|
readonly HOURGLASS_ICON = HOURGLASS_ICON;
|
||||||
|
readonly CLOUD_OFF_ICON = CLOUD_OFF_ICON;
|
||||||
|
readonly TUNE_ICON = TUNE_ICON;
|
||||||
|
readonly MANAGE_SEARCH_ICON = MANAGE_SEARCH_ICON;
|
||||||
|
readonly SEARCH_ICON = SEARCH_ICON;
|
||||||
|
readonly SEARCH_OFF_ICON = SEARCH_OFF_ICON;
|
||||||
|
|
||||||
readonly data = inject<TopicWordCloudDialogData>(MAT_DIALOG_DATA);
|
readonly data = inject<TopicWordCloudDialogData>(MAT_DIALOG_DATA);
|
||||||
private readonly dialogRef = inject(
|
private readonly dialogRef = inject(
|
||||||
MatDialogRef<TopicWordCloudDialogComponent>,
|
MatDialogRef<TopicWordCloudDialogComponent>,
|
||||||
@@ -82,6 +108,7 @@ export class TopicWordCloudDialogComponent {
|
|||||||
this.data.topicId,
|
this.data.topicId,
|
||||||
this.data.fromYear,
|
this.data.fromYear,
|
||||||
this.data.toYear,
|
this.data.toYear,
|
||||||
|
this.data.institutionId,
|
||||||
)
|
)
|
||||||
.pipe(takeUntilDestroyed(this.destroyRef))
|
.pipe(takeUntilDestroyed(this.destroyRef))
|
||||||
.subscribe({
|
.subscribe({
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
aria-describedby="error-message">
|
aria-describedby="error-message">
|
||||||
<mat-card-content class="error-content">
|
<mat-card-content class="error-content">
|
||||||
<div class="icon-wrapper" aria-hidden="true">
|
<div class="icon-wrapper" aria-hidden="true">
|
||||||
<mat-icon class="error-icon">warning</mat-icon>
|
<mat-icon class="error-icon">{{ WARNING_ICON }}</mat-icon>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span class="status-code"> Fehler {{ error().statusCode }} </span>
|
<span class="status-code"> Fehler {{ error().statusCode }} </span>
|
||||||
@@ -34,12 +34,12 @@
|
|||||||
color="primary"
|
color="primary"
|
||||||
type="button"
|
type="button"
|
||||||
(click)="goBack()">
|
(click)="goBack()">
|
||||||
<mat-icon aria-hidden="true">arrow_back</mat-icon>
|
<mat-icon aria-hidden="true">{{ ARROW_BACK_ICON }}</mat-icon>
|
||||||
Zurück
|
Zurück
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<a mat-button routerLink="/" aria-label="Zur Startseite">
|
<a mat-button routerLink="/" aria-label="Zur Startseite">
|
||||||
<mat-icon aria-hidden="true">home</mat-icon>
|
<mat-icon aria-hidden="true">{{ HOME_ICON }}</mat-icon>
|
||||||
Startseite
|
Startseite
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -14,6 +14,12 @@ import { MatExpansionModule } from '@angular/material/expansion';
|
|||||||
import { MatIconModule } from '@angular/material/icon';
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
import { ErrorService, ErrorState } from '../../shared/services/error.service';
|
import { ErrorService, ErrorState } from '../../shared/services/error.service';
|
||||||
import { RouterLink } from '@angular/router';
|
import { RouterLink } from '@angular/router';
|
||||||
|
import {
|
||||||
|
ARROW_BACK_ICON,
|
||||||
|
HOME_ICON,
|
||||||
|
WARNING_ICON,
|
||||||
|
} from '../../shared/ui/icons';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-error-page',
|
selector: 'app-error-page',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
@@ -28,6 +34,10 @@ import { RouterLink } from '@angular/router';
|
|||||||
styleUrl: './error-page.component.scss',
|
styleUrl: './error-page.component.scss',
|
||||||
})
|
})
|
||||||
export class ErrorPageComponent {
|
export class ErrorPageComponent {
|
||||||
|
readonly WARNING_ICON = WARNING_ICON;
|
||||||
|
readonly ARROW_BACK_ICON = ARROW_BACK_ICON;
|
||||||
|
readonly HOME_ICON = HOME_ICON;
|
||||||
|
|
||||||
readonly routeStatusCode = input(500, { transform: numberAttribute });
|
readonly routeStatusCode = input(500, { transform: numberAttribute });
|
||||||
readonly routeTitle = input('Da ist was schiefgelaufen');
|
readonly routeTitle = input('Da ist was schiefgelaufen');
|
||||||
readonly routeMessage = input(
|
readonly routeMessage = input(
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<div class="login-form">
|
<div class="login-form">
|
||||||
<div class="code-intro">
|
<div class="code-intro">
|
||||||
<mat-icon>
|
<mat-icon>
|
||||||
{{ rateLimited() ? 'hourglass_empty' : 'mark_email_unread' }}
|
{{ rateLimited() ? HOURGLASS_EMPTY_ICON : EMAIL_UNREAD_ICON }}
|
||||||
</mat-icon>
|
</mat-icon>
|
||||||
<div>
|
<div>
|
||||||
@if (rateLimited()) {
|
@if (rateLimited()) {
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
@if (errorMessage()) {
|
@if (errorMessage()) {
|
||||||
<div class="code-intro">
|
<div class="code-intro">
|
||||||
<mat-icon>error_outline</mat-icon>
|
<mat-icon>{{ ERROR_OUTLINE_ICON }}</mat-icon>
|
||||||
<div>
|
<div>
|
||||||
<strong>Fehler</strong>
|
<strong>Fehler</strong>
|
||||||
<span>{{ errorMessage() }}</span>
|
<span>{{ errorMessage() }}</span>
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
@if (errorMessage()) {
|
@if (errorMessage()) {
|
||||||
<div class="code-intro">
|
<div class="code-intro">
|
||||||
<mat-icon>error_outline</mat-icon>
|
<mat-icon>{{ ERROR_OUTLINE_ICON }}</mat-icon>
|
||||||
<div>
|
<div>
|
||||||
<strong>Fehler</strong>
|
<strong>Fehler</strong>
|
||||||
<span>{{ errorMessage() }}</span>
|
<span>{{ errorMessage() }}</span>
|
||||||
|
|||||||
@@ -13,6 +13,11 @@ import { MatInputModule } from '@angular/material/input';
|
|||||||
import { MatIconModule } from '@angular/material/icon';
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
import { CredentialService } from '../../shared/services/credential.service';
|
import { CredentialService } from '../../shared/services/credential.service';
|
||||||
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
|
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
|
||||||
|
import {
|
||||||
|
EMAIL_UNREAD_ICON,
|
||||||
|
ERROR_OUTLINE_ICON,
|
||||||
|
HOURGLASS_EMPTY_ICON,
|
||||||
|
} from '../../shared/ui/icons';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-forgot-password',
|
selector: 'app-forgot-password',
|
||||||
@@ -30,6 +35,10 @@ import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class ForgotPasswordComponent {
|
export class ForgotPasswordComponent {
|
||||||
|
readonly HOURGLASS_EMPTY_ICON = HOURGLASS_EMPTY_ICON;
|
||||||
|
readonly EMAIL_UNREAD_ICON = EMAIL_UNREAD_ICON;
|
||||||
|
readonly ERROR_OUTLINE_ICON = ERROR_OUTLINE_ICON;
|
||||||
|
|
||||||
private readonly credentialService = inject(CredentialService);
|
private readonly credentialService = inject(CredentialService);
|
||||||
private readonly snackBar = inject(MatSnackBar);
|
private readonly snackBar = inject(MatSnackBar);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
@if (loading) {
|
@if (loading) {
|
||||||
<app-loading
|
<app-loading
|
||||||
text="Patentdaten werden geladen..."
|
text="Patentdaten werden geladen..."
|
||||||
icon="workspace_premium"
|
[icon]="PATENT_ICON"
|
||||||
[size]="150"
|
[size]="150"
|
||||||
[diameter]="150" />
|
[diameter]="150" />
|
||||||
} @else if (error) {
|
} @else if (error) {
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
<mat-form-field
|
<mat-form-field
|
||||||
class="patents-toolbar-field"
|
class="patents-toolbar-field"
|
||||||
subscriptSizing="dynamic">
|
subscriptSizing="dynamic">
|
||||||
<mat-icon matPrefix fontIcon="rule"></mat-icon>
|
<mat-icon matPrefix [fontIcon]="RULE_ICON"></mat-icon>
|
||||||
<mat-select
|
<mat-select
|
||||||
[value]="activeMatchType"
|
[value]="activeMatchType"
|
||||||
(selectionChange)="setMatchType($event.value)">
|
(selectionChange)="setMatchType($event.value)">
|
||||||
@@ -36,23 +36,13 @@
|
|||||||
<mat-option value="both">Beides</mat-option>
|
<mat-option value="both">Beides</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
<app-source-filter
|
||||||
|
[value]="activeFilter"
|
||||||
|
(valueChange)="setFilter($event)" />
|
||||||
<mat-form-field
|
<mat-form-field
|
||||||
class="patents-toolbar-field"
|
class="patents-toolbar-field"
|
||||||
subscriptSizing="dynamic">
|
subscriptSizing="dynamic">
|
||||||
<mat-icon matPrefix fontIcon="filter_alt"></mat-icon>
|
<mat-icon matPrefix [fontIcon]="SORT_ICON"></mat-icon>
|
||||||
<mat-select
|
|
||||||
[value]="activeFilter"
|
|
||||||
(selectionChange)="setFilter($event.value)">
|
|
||||||
<mat-select-trigger>Filter nach Quelle</mat-select-trigger>
|
|
||||||
<mat-option value="all">Alle</mat-option>
|
|
||||||
<mat-option value="EPO">EPO</mat-option>
|
|
||||||
<mat-option value="USPTO">USPTO</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</mat-form-field>
|
|
||||||
<mat-form-field
|
|
||||||
class="patents-toolbar-field"
|
|
||||||
subscriptSizing="dynamic">
|
|
||||||
<mat-icon matPrefix fontIcon="sort"></mat-icon>
|
|
||||||
<mat-select
|
<mat-select
|
||||||
[value]="sortColumn"
|
[value]="sortColumn"
|
||||||
(selectionChange)="setSort($event.value)">
|
(selectionChange)="setSort($event.value)">
|
||||||
@@ -165,7 +155,7 @@
|
|||||||
<span class="patent-detail-action__label"
|
<span class="patent-detail-action__label"
|
||||||
>Patentdetails anzeigen</span
|
>Patentdetails anzeigen</span
|
||||||
>
|
>
|
||||||
<mat-icon aria-hidden="true">chevron_right</mat-icon>
|
<mat-icon aria-hidden="true">{{ CHEVRON_RIGHT_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<p class="patent-detail-hint">
|
<p class="patent-detail-hint">
|
||||||
Abstract, Erfinder, Anmelder und IPC/CPC-Klassifikation
|
Abstract, Erfinder, Anmelder und IPC/CPC-Klassifikation
|
||||||
|
|||||||
@@ -17,6 +17,14 @@ import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-pagina
|
|||||||
import { ComponentTooltipDirective } from '../../directives/component-tooltip.directive';
|
import { ComponentTooltipDirective } from '../../directives/component-tooltip.directive';
|
||||||
import { AppAuthorTooltipComponent } from '../../shared/ui/app-author-tooltip/app-author-tooltip.component';
|
import { AppAuthorTooltipComponent } from '../../shared/ui/app-author-tooltip/app-author-tooltip.component';
|
||||||
import { PatentTableComponent } from '../../shared/ui/patent-table/patent-table.component';
|
import { PatentTableComponent } from '../../shared/ui/patent-table/patent-table.component';
|
||||||
|
import { SourceFilterComponent } from '../../shared/ui/source-filter/source-filter.component';
|
||||||
|
import {
|
||||||
|
CHEVRON_RIGHT_ICON,
|
||||||
|
FILTER_ICON,
|
||||||
|
PATENT_ICON,
|
||||||
|
RULE_ICON,
|
||||||
|
SORT_ICON,
|
||||||
|
} from '../../shared/ui/icons';
|
||||||
|
|
||||||
type SortColumn = 'title' | 'publication_year' | 'source' | 'match_type';
|
type SortColumn = 'title' | 'publication_year' | 'source' | 'match_type';
|
||||||
type SortDirection = 'asc' | 'desc';
|
type SortDirection = 'asc' | 'desc';
|
||||||
@@ -35,11 +43,18 @@ type OrgPatentMatchTypeFilter = 'all' | 'institution' | 'name' | 'both';
|
|||||||
QueryParamPaginatorComponent,
|
QueryParamPaginatorComponent,
|
||||||
ComponentTooltipDirective,
|
ComponentTooltipDirective,
|
||||||
PatentTableComponent,
|
PatentTableComponent,
|
||||||
|
SourceFilterComponent,
|
||||||
],
|
],
|
||||||
templateUrl: './institution-patents.component.html',
|
templateUrl: './institution-patents.component.html',
|
||||||
styleUrl: './institution-patents.component.scss',
|
styleUrl: './institution-patents.component.scss',
|
||||||
})
|
})
|
||||||
export class InstitutionPatentsComponent implements OnInit {
|
export class InstitutionPatentsComponent implements OnInit {
|
||||||
|
readonly PATENT_ICON = PATENT_ICON;
|
||||||
|
readonly RULE_ICON = RULE_ICON;
|
||||||
|
readonly FILTER_ICON = FILTER_ICON;
|
||||||
|
readonly SORT_ICON = SORT_ICON;
|
||||||
|
readonly CHEVRON_RIGHT_ICON = CHEVRON_RIGHT_ICON;
|
||||||
|
|
||||||
readonly AuthorTooltipComponent = AppAuthorTooltipComponent;
|
readonly AuthorTooltipComponent = AppAuthorTooltipComponent;
|
||||||
private route = inject(ActivatedRoute);
|
private route = inject(ActivatedRoute);
|
||||||
private router = inject(Router);
|
private router = inject(Router);
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
|
|
||||||
<ng-template #euProjectActionsTmp let-row>
|
<ng-template #euProjectActionsTmp let-row>
|
||||||
<a mat-icon-button color="primary" [routerLink]="['/projects/eu', row.id]">
|
<a mat-icon-button color="primary" [routerLink]="['/projects/eu', row.id]">
|
||||||
<mat-icon>open_in_new</mat-icon>
|
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
|
||||||
</a>
|
</a>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
mat-icon-button
|
mat-icon-button
|
||||||
color="primary"
|
color="primary"
|
||||||
[routerLink]="['/projects/bund', row.id]">
|
[routerLink]="['/projects/bund', row.id]">
|
||||||
<mat-icon>open_in_new</mat-icon>
|
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
|
||||||
</a>
|
</a>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ import {
|
|||||||
LinkTabNavBarComponent,
|
LinkTabNavBarComponent,
|
||||||
LinkTabNavBarItem,
|
LinkTabNavBarItem,
|
||||||
} from '../../shared/ui/link-tab-nav-bar/link-tab-nav-bar.component';
|
} from '../../shared/ui/link-tab-nav-bar/link-tab-nav-bar.component';
|
||||||
|
import { OPEN_IN_NEW_ICON } from '../../shared/ui/icons';
|
||||||
|
|
||||||
type BundProjectRow = {
|
type BundProjectRow = {
|
||||||
id: string;
|
id: string;
|
||||||
topic: string;
|
topic: string;
|
||||||
@@ -71,6 +73,8 @@ type EuProjectRow = {
|
|||||||
styleUrl: './institution-projects.component.scss',
|
styleUrl: './institution-projects.component.scss',
|
||||||
})
|
})
|
||||||
export class InstitutionProjectsComponent implements OnInit {
|
export class InstitutionProjectsComponent implements OnInit {
|
||||||
|
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
|
||||||
|
|
||||||
fundingStartTmp = viewChild.required<TemplateRef<any>>('fundingStartTmp');
|
fundingStartTmp = viewChild.required<TemplateRef<any>>('fundingStartTmp');
|
||||||
fundingEndTmp = viewChild.required<TemplateRef<any>>('fundingEndTmp');
|
fundingEndTmp = viewChild.required<TemplateRef<any>>('fundingEndTmp');
|
||||||
fundingAmountTmp = viewChild.required<TemplateRef<any>>('fundingAmountTmp');
|
fundingAmountTmp = viewChild.required<TemplateRef<any>>('fundingAmountTmp');
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
} from '../../shared/ui/card-search/card-search.component';
|
} from '../../shared/ui/card-search/card-search.component';
|
||||||
import { FilterObserver } from '../../shared/ui/selected-filters/selected-filters.component';
|
import { FilterObserver } from '../../shared/ui/selected-filters/selected-filters.component';
|
||||||
import { AppInstitutionCardComponent } from '../../shared/ui/app-institution-card/app-institution-card.component';
|
import { AppInstitutionCardComponent } from '../../shared/ui/app-institution-card/app-institution-card.component';
|
||||||
|
import { SEARCH_ICON } from '../../shared/ui/icons';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-institutions',
|
selector: 'app-institutions',
|
||||||
@@ -35,7 +36,7 @@ export class InstitutionsComponent {
|
|||||||
{
|
{
|
||||||
id: 'name',
|
id: 'name',
|
||||||
queryParamKey: 'search',
|
queryParamKey: 'search',
|
||||||
icon: 'search',
|
icon: SEARCH_ICON,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
@if (runsLoading() && runs().length === 0) {
|
@if (runsLoading() && runs().length === 0) {
|
||||||
<app-loading
|
<app-loading
|
||||||
text="Läufe werden geladen …"
|
text="Läufe werden geladen …"
|
||||||
icon="history"
|
[icon]="HISTORY_ICON"
|
||||||
[size]="48"
|
[size]="48"
|
||||||
[diameter]="48" />
|
[diameter]="48" />
|
||||||
} @else if (runsError()) {
|
} @else if (runsError()) {
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
type="button"
|
type="button"
|
||||||
[disabled]="selectedRunId() == null"
|
[disabled]="selectedRunId() == null"
|
||||||
(click)="downloadLogs()">
|
(click)="downloadLogs()">
|
||||||
<mat-icon>download</mat-icon>
|
<mat-icon>{{ DOWNLOAD_ICON }}</mat-icon>
|
||||||
Herunterladen
|
Herunterladen
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
matTooltipPosition="above"
|
matTooltipPosition="above"
|
||||||
[disabled]="loading() || runsLoading()"
|
[disabled]="loading() || runsLoading()"
|
||||||
(click)="loadRuns()">
|
(click)="loadRuns()">
|
||||||
<mat-icon>refresh</mat-icon>
|
<mat-icon>{{ REFRESH_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
@if (loading() && !logs()) {
|
@if (loading() && !logs()) {
|
||||||
<app-loading
|
<app-loading
|
||||||
text="Logs werden geladen …"
|
text="Logs werden geladen …"
|
||||||
icon="description"
|
[icon]="DESCRIPTION_ICON"
|
||||||
[size]="48"
|
[size]="48"
|
||||||
[diameter]="48" />
|
[diameter]="48" />
|
||||||
} @else {
|
} @else {
|
||||||
|
|||||||
@@ -29,6 +29,12 @@ import {
|
|||||||
formatUtcDateAsLocal,
|
formatUtcDateAsLocal,
|
||||||
statusMeta,
|
statusMeta,
|
||||||
} from '../jobs.utils';
|
} from '../jobs.utils';
|
||||||
|
import {
|
||||||
|
DESCRIPTION_ICON,
|
||||||
|
DOWNLOAD_ICON,
|
||||||
|
HISTORY_ICON,
|
||||||
|
REFRESH_ICON,
|
||||||
|
} from '../../../shared/ui/icons';
|
||||||
|
|
||||||
export interface JobLogsDialogData {
|
export interface JobLogsDialogData {
|
||||||
task: BackgroundJobTask;
|
task: BackgroundJobTask;
|
||||||
@@ -51,6 +57,11 @@ export interface JobLogsDialogData {
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class JobLogsDialogComponent implements OnInit {
|
export class JobLogsDialogComponent implements OnInit {
|
||||||
|
readonly HISTORY_ICON = HISTORY_ICON;
|
||||||
|
readonly DOWNLOAD_ICON = DOWNLOAD_ICON;
|
||||||
|
readonly REFRESH_ICON = REFRESH_ICON;
|
||||||
|
readonly DESCRIPTION_ICON = DESCRIPTION_ICON;
|
||||||
|
|
||||||
private readonly dialogRef = inject(MatDialogRef<JobLogsDialogComponent>);
|
private readonly dialogRef = inject(MatDialogRef<JobLogsDialogComponent>);
|
||||||
private readonly backgroundJobsService = inject(BackgroundJobsService);
|
private readonly backgroundJobsService = inject(BackgroundJobsService);
|
||||||
private readonly destroyRef = inject(DestroyRef);
|
private readonly destroyRef = inject(DestroyRef);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
type="button"
|
type="button"
|
||||||
class="new-job-button"
|
class="new-job-button"
|
||||||
(click)="openCreateDialog()">
|
(click)="openCreateDialog()">
|
||||||
<mat-icon>add</mat-icon>
|
<mat-icon>{{ ADD_ICON }}</mat-icon>
|
||||||
Neuer Job
|
Neuer Job
|
||||||
</button>
|
</button>
|
||||||
</header>
|
</header>
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
matTooltip="Docker-Status aktualisieren"
|
matTooltip="Docker-Status aktualisieren"
|
||||||
[disabled]="dockerHealthLoading()"
|
[disabled]="dockerHealthLoading()"
|
||||||
(click)="refreshDockerHealth()">
|
(click)="refreshDockerHealth()">
|
||||||
<mat-icon>refresh</mat-icon>
|
<mat-icon>{{ REFRESH_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
matTooltip="Nexus-Status aktualisieren"
|
matTooltip="Nexus-Status aktualisieren"
|
||||||
[disabled]="registryHealthLoading()"
|
[disabled]="registryHealthLoading()"
|
||||||
(click)="refreshRegistryHealth()">
|
(click)="refreshRegistryHealth()">
|
||||||
<mat-icon>refresh</mat-icon>
|
<mat-icon>{{ REFRESH_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
matTooltipPosition="above"
|
matTooltipPosition="above"
|
||||||
[disabled]="row.status === 'running' || row.status === 'stopping'"
|
[disabled]="row.status === 'running' || row.status === 'stopping'"
|
||||||
(click)="openEditDialog(row)">
|
(click)="openEditDialog(row)">
|
||||||
<mat-icon>edit</mat-icon>
|
<mat-icon>{{ EDIT_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<div class="task-name-text">
|
<div class="task-name-text">
|
||||||
<strong>{{ row.name }}</strong>
|
<strong>{{ row.name }}</strong>
|
||||||
@@ -191,7 +191,7 @@
|
|||||||
matTooltip="Jobs aktualisieren"
|
matTooltip="Jobs aktualisieren"
|
||||||
matTooltipPosition="above"
|
matTooltipPosition="above"
|
||||||
(click)="refreshTasks()">
|
(click)="refreshTasks()">
|
||||||
<mat-icon>refresh</mat-icon>
|
<mat-icon>{{ REFRESH_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
@@ -206,7 +206,7 @@
|
|||||||
matTooltipPosition="above"
|
matTooltipPosition="above"
|
||||||
[disabled]="row.status === 'running' || row.status === 'stopping'"
|
[disabled]="row.status === 'running' || row.status === 'stopping'"
|
||||||
(click)="runNow(row)">
|
(click)="runNow(row)">
|
||||||
<mat-icon>play_arrow</mat-icon>
|
<mat-icon>{{ PLAY_ARROW_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
@@ -216,7 +216,7 @@
|
|||||||
matTooltipPosition="above"
|
matTooltipPosition="above"
|
||||||
[disabled]="row.status !== 'running'"
|
[disabled]="row.status !== 'running'"
|
||||||
(click)="stopNow(row)">
|
(click)="stopNow(row)">
|
||||||
<mat-icon>stop</mat-icon>
|
<mat-icon>{{ STOP_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
@@ -226,7 +226,7 @@
|
|||||||
matTooltipPosition="above"
|
matTooltipPosition="above"
|
||||||
[disabled]="!row.last_run"
|
[disabled]="!row.last_run"
|
||||||
(click)="openLogsDialog(row)">
|
(click)="openLogsDialog(row)">
|
||||||
<mat-icon>description</mat-icon>
|
<mat-icon>{{ DESCRIPTION_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
@@ -235,7 +235,7 @@
|
|||||||
matTooltip="Zeitplan bearbeiten"
|
matTooltip="Zeitplan bearbeiten"
|
||||||
matTooltipPosition="above"
|
matTooltipPosition="above"
|
||||||
(click)="openScheduleDialog(row)">
|
(click)="openScheduleDialog(row)">
|
||||||
<mat-icon>edit_calendar</mat-icon>
|
<mat-icon>{{ EDIT_CALENDAR_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
@@ -255,7 +255,7 @@
|
|||||||
diameter="18"
|
diameter="18"
|
||||||
mode="indeterminate"></mat-progress-spinner>
|
mode="indeterminate"></mat-progress-spinner>
|
||||||
} @else {
|
} @else {
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>{{ DELETE_ICON }}</mat-icon>
|
||||||
}
|
}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -58,6 +58,16 @@ import {
|
|||||||
TaskEditDialogComponent,
|
TaskEditDialogComponent,
|
||||||
TaskEditDialogData,
|
TaskEditDialogData,
|
||||||
} from './task-edit-dialog/task-edit-dialog.component';
|
} from './task-edit-dialog/task-edit-dialog.component';
|
||||||
|
import {
|
||||||
|
ADD_ICON,
|
||||||
|
DELETE_ICON,
|
||||||
|
DESCRIPTION_ICON,
|
||||||
|
EDIT_CALENDAR_ICON,
|
||||||
|
EDIT_ICON,
|
||||||
|
PLAY_ARROW_ICON,
|
||||||
|
REFRESH_ICON,
|
||||||
|
STOP_ICON,
|
||||||
|
} from '../../shared/ui/icons';
|
||||||
|
|
||||||
const MAX_IDLE_POLL_WAIT_MS = 60000;
|
const MAX_IDLE_POLL_WAIT_MS = 60000;
|
||||||
|
|
||||||
@@ -79,6 +89,15 @@ const MAX_IDLE_POLL_WAIT_MS = 60000;
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class JobsComponent implements OnInit {
|
export class JobsComponent implements OnInit {
|
||||||
|
readonly ADD_ICON = ADD_ICON;
|
||||||
|
readonly REFRESH_ICON = REFRESH_ICON;
|
||||||
|
readonly EDIT_ICON = EDIT_ICON;
|
||||||
|
readonly PLAY_ARROW_ICON = PLAY_ARROW_ICON;
|
||||||
|
readonly STOP_ICON = STOP_ICON;
|
||||||
|
readonly DESCRIPTION_ICON = DESCRIPTION_ICON;
|
||||||
|
readonly EDIT_CALENDAR_ICON = EDIT_CALENDAR_ICON;
|
||||||
|
readonly DELETE_ICON = DELETE_ICON;
|
||||||
|
|
||||||
private readonly dialog = inject(MatDialog);
|
private readonly dialog = inject(MatDialog);
|
||||||
private readonly snackBar = inject(MatSnackBar);
|
private readonly snackBar = inject(MatSnackBar);
|
||||||
private readonly backgroundJobsService = inject(BackgroundJobsService);
|
private readonly backgroundJobsService = inject(BackgroundJobsService);
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
import { JobRun } from '../../api';
|
import { JobRun } from '../../api';
|
||||||
|
import {
|
||||||
|
CHECK_CIRCLE_ICON,
|
||||||
|
ERROR_ICON,
|
||||||
|
JOBS_ICON,
|
||||||
|
SCHEDULE_ICON,
|
||||||
|
STOP_CIRCLE_ICON,
|
||||||
|
} from '../../shared/ui/icons';
|
||||||
|
|
||||||
export interface StatusMeta {
|
export interface StatusMeta {
|
||||||
label: string;
|
label: string;
|
||||||
@@ -7,28 +14,32 @@ export interface StatusMeta {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const STATUS_META: Record<string, StatusMeta> = {
|
const STATUS_META: Record<string, StatusMeta> = {
|
||||||
running: { label: 'Läuft', icon: 'sync', cssClass: 'task-status--running' },
|
running: {
|
||||||
|
label: 'Läuft',
|
||||||
|
icon: JOBS_ICON,
|
||||||
|
cssClass: 'task-status--running',
|
||||||
|
},
|
||||||
stopping: {
|
stopping: {
|
||||||
label: 'Wird gestoppt',
|
label: 'Wird gestoppt',
|
||||||
icon: 'stop_circle',
|
icon: STOP_CIRCLE_ICON,
|
||||||
cssClass: 'task-status--running',
|
cssClass: 'task-status--running',
|
||||||
},
|
},
|
||||||
succeeded: {
|
succeeded: {
|
||||||
label: 'Erfolgreich',
|
label: 'Erfolgreich',
|
||||||
icon: 'check_circle',
|
icon: CHECK_CIRCLE_ICON,
|
||||||
cssClass: 'task-status--success',
|
cssClass: 'task-status--success',
|
||||||
},
|
},
|
||||||
failed: {
|
failed: {
|
||||||
label: 'Fehlgeschlagen',
|
label: 'Fehlgeschlagen',
|
||||||
icon: 'error',
|
icon: ERROR_ICON,
|
||||||
cssClass: 'task-status--failed',
|
cssClass: 'task-status--failed',
|
||||||
},
|
},
|
||||||
stopped: {
|
stopped: {
|
||||||
label: 'Gestoppt',
|
label: 'Gestoppt',
|
||||||
icon: 'stop_circle',
|
icon: STOP_CIRCLE_ICON,
|
||||||
cssClass: 'task-status--stopped',
|
cssClass: 'task-status--stopped',
|
||||||
},
|
},
|
||||||
idle: { label: 'Bereit', icon: 'schedule', cssClass: 'task-status--idle' },
|
idle: { label: 'Bereit', icon: SCHEDULE_ICON, cssClass: 'task-status--idle' },
|
||||||
};
|
};
|
||||||
|
|
||||||
export function statusMeta(status: string): StatusMeta {
|
export function statusMeta(status: string): StatusMeta {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
matSuffix
|
matSuffix
|
||||||
class="field-info"
|
class="field-info"
|
||||||
matTooltip="Eindeutiger Anzeigename des Jobs, z.B. „News-Themen-Mapping (Testlauf)“."
|
matTooltip="Eindeutiger Anzeigename des Jobs, z.B. „News-Themen-Mapping (Testlauf)“."
|
||||||
>info_outline</mat-icon
|
>{{ INFO_OUTLINE_ICON }}</mat-icon
|
||||||
>
|
>
|
||||||
@if (form.controls.name.invalid) {
|
@if (form.controls.name.invalid) {
|
||||||
<mat-error>Bitte einen Namen eingeben.</mat-error>
|
<mat-error>Bitte einen Namen eingeben.</mat-error>
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
matSuffix
|
matSuffix
|
||||||
class="field-info"
|
class="field-info"
|
||||||
matTooltip="Wird beim Start direkt im Container ausgeführt — wie in einem Terminal, z.B. „python sync.py --update-keywords --target-index docker-job_test“. Leer = Standard-Befehl des Images."
|
matTooltip="Wird beim Start direkt im Container ausgeführt — wie in einem Terminal, z.B. „python sync.py --update-keywords --target-index docker-job_test“. Leer = Standard-Befehl des Images."
|
||||||
>info_outline</mat-icon
|
>{{ INFO_OUTLINE_ICON }}</mat-icon
|
||||||
>
|
>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
matSuffix
|
matSuffix
|
||||||
class="field-info"
|
class="field-info"
|
||||||
matTooltip="Docker-Image für den Job. Tippen filtert die aus Nexus verfügbaren Images; du kannst auch einen eigenen Wert eingeben. Images aus unserer Registry (docker.nes.uni-due.de) erhalten die INSE-Zugangsdaten (Elasticsearch/LLM) automatisch, fremde Images nicht."
|
matTooltip="Docker-Image für den Job. Tippen filtert die aus Nexus verfügbaren Images; du kannst auch einen eigenen Wert eingeben. Images aus unserer Registry (docker.nes.uni-due.de) erhalten die INSE-Zugangsdaten (Elasticsearch/LLM) automatisch, fremde Images nicht."
|
||||||
>info_outline</mat-icon
|
>{{ INFO_OUTLINE_ICON }}</mat-icon
|
||||||
>
|
>
|
||||||
@if (form.controls.image.invalid && form.controls.image.touched) {
|
@if (form.controls.image.invalid && form.controls.image.touched) {
|
||||||
<mat-error>Bitte ein Image auswählen oder eingeben.</mat-error>
|
<mat-error>Bitte ein Image auswählen oder eingeben.</mat-error>
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
matSuffix
|
matSuffix
|
||||||
class="field-info"
|
class="field-info"
|
||||||
matTooltip="Freitext für die Job-Tabelle: Was macht der Job, was sollte man vor dem Start wissen?"
|
matTooltip="Freitext für die Job-Tabelle: Was macht der Job, was sollte man vor dem Start wissen?"
|
||||||
>info_outline</mat-icon
|
>{{ INFO_OUTLINE_ICON }}</mat-icon
|
||||||
>
|
>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
matSuffix
|
matSuffix
|
||||||
class="field-info"
|
class="field-info"
|
||||||
matTooltip="Reine Anzeige-Info in der Tabelle. In welchen Index der Job wirklich schreibt, bestimmt allein der Befehl (z.B. --target-index / --output-index)."
|
matTooltip="Reine Anzeige-Info in der Tabelle. In welchen Index der Job wirklich schreibt, bestimmt allein der Befehl (z.B. --target-index / --output-index)."
|
||||||
>info_outline</mat-icon
|
>{{ INFO_OUTLINE_ICON }}</mat-icon
|
||||||
>
|
>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
matSuffix
|
matSuffix
|
||||||
class="field-info"
|
class="field-info"
|
||||||
matTooltip="Zusätzliche Umgebungsvariablen für den Container, eine pro Zeile im Format KEY=value. Das Standard-Image bekommt die INSE-Zugangsdaten (Elasticsearch/LLM) automatisch — hier ist nur Spezielles nötig."
|
matTooltip="Zusätzliche Umgebungsvariablen für den Container, eine pro Zeile im Format KEY=value. Das Standard-Image bekommt die INSE-Zugangsdaten (Elasticsearch/LLM) automatisch — hier ist nur Spezielles nötig."
|
||||||
>info_outline</mat-icon
|
>{{ INFO_OUTLINE_ICON }}</mat-icon
|
||||||
>
|
>
|
||||||
<mat-hint>Eine Variable pro Zeile im Format KEY=value.</mat-hint>
|
<mat-hint>Eine Variable pro Zeile im Format KEY=value.</mat-hint>
|
||||||
@if (form.controls.env.hasError('invalidEnv')) {
|
@if (form.controls.env.hasError('invalidEnv')) {
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
type="button"
|
type="button"
|
||||||
[disabled]="creating()"
|
[disabled]="creating()"
|
||||||
(click)="submit()">
|
(click)="submit()">
|
||||||
<mat-icon>add</mat-icon>
|
<mat-icon>{{ ADD_ICON }}</mat-icon>
|
||||||
Anlegen
|
Anlegen
|
||||||
</button>
|
</button>
|
||||||
</mat-dialog-actions>
|
</mat-dialog-actions>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import { MatIconModule } from '@angular/material/icon';
|
|||||||
import { MatInputModule } from '@angular/material/input';
|
import { MatInputModule } from '@angular/material/input';
|
||||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||||
import { BackgroundJobTask, BackgroundJobsService } from '../../../api';
|
import { BackgroundJobTask, BackgroundJobsService } from '../../../api';
|
||||||
|
import { ADD_ICON, INFO_OUTLINE_ICON } from '../../../shared/ui/icons';
|
||||||
|
|
||||||
const ENV_LINE_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*=.*$/;
|
const ENV_LINE_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*=.*$/;
|
||||||
|
|
||||||
@@ -36,6 +37,9 @@ const ENV_LINE_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*=.*$/;
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class TaskCreateDialogComponent implements OnInit {
|
export class TaskCreateDialogComponent implements OnInit {
|
||||||
|
readonly INFO_OUTLINE_ICON = INFO_OUTLINE_ICON;
|
||||||
|
readonly ADD_ICON = ADD_ICON;
|
||||||
|
|
||||||
private readonly dialogRef =
|
private readonly dialogRef =
|
||||||
inject<
|
inject<
|
||||||
MatDialogRef<TaskCreateDialogComponent, BackgroundJobTask | undefined>
|
MatDialogRef<TaskCreateDialogComponent, BackgroundJobTask | undefined>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
matSuffix
|
matSuffix
|
||||||
class="field-info"
|
class="field-info"
|
||||||
matTooltip="Eindeutiger Anzeigename des Jobs, z.B. „News-Themen-Mapping (Testlauf)“."
|
matTooltip="Eindeutiger Anzeigename des Jobs, z.B. „News-Themen-Mapping (Testlauf)“."
|
||||||
>info_outline</mat-icon
|
>{{ INFO_OUTLINE_ICON }}</mat-icon
|
||||||
>
|
>
|
||||||
@if (form.controls.name.invalid) {
|
@if (form.controls.name.invalid) {
|
||||||
<mat-error>Bitte einen Namen eingeben.</mat-error>
|
<mat-error>Bitte einen Namen eingeben.</mat-error>
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
matSuffix
|
matSuffix
|
||||||
class="field-info"
|
class="field-info"
|
||||||
matTooltip="Wird beim Start direkt im Container ausgeführt — wie in einem Terminal, z.B. „python sync.py --update-keywords --target-index docker-job_test“. Leer = Standard-Befehl des Images."
|
matTooltip="Wird beim Start direkt im Container ausgeführt — wie in einem Terminal, z.B. „python sync.py --update-keywords --target-index docker-job_test“. Leer = Standard-Befehl des Images."
|
||||||
>info_outline</mat-icon
|
>{{ INFO_OUTLINE_ICON }}</mat-icon
|
||||||
>
|
>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
matSuffix
|
matSuffix
|
||||||
class="field-info"
|
class="field-info"
|
||||||
matTooltip="Docker-Image für den Job. Tippen filtert die aus Nexus verfügbaren Images; du kannst auch einen eigenen Wert eingeben. Images aus unserer Registry (docker.nes.uni-due.de) erhalten die INSE-Zugangsdaten (Elasticsearch/LLM) automatisch, fremde Images nicht."
|
matTooltip="Docker-Image für den Job. Tippen filtert die aus Nexus verfügbaren Images; du kannst auch einen eigenen Wert eingeben. Images aus unserer Registry (docker.nes.uni-due.de) erhalten die INSE-Zugangsdaten (Elasticsearch/LLM) automatisch, fremde Images nicht."
|
||||||
>info_outline</mat-icon
|
>{{ INFO_OUTLINE_ICON }}</mat-icon
|
||||||
>
|
>
|
||||||
@if (form.controls.image.invalid && form.controls.image.touched) {
|
@if (form.controls.image.invalid && form.controls.image.touched) {
|
||||||
<mat-error>Bitte ein Image auswählen oder eingeben.</mat-error>
|
<mat-error>Bitte ein Image auswählen oder eingeben.</mat-error>
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
matSuffix
|
matSuffix
|
||||||
class="field-info"
|
class="field-info"
|
||||||
matTooltip="Freitext für die Job-Tabelle: Was macht der Job, was sollte man vor dem Start wissen?"
|
matTooltip="Freitext für die Job-Tabelle: Was macht der Job, was sollte man vor dem Start wissen?"
|
||||||
>info_outline</mat-icon
|
>{{ INFO_OUTLINE_ICON }}</mat-icon
|
||||||
>
|
>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
matSuffix
|
matSuffix
|
||||||
class="field-info"
|
class="field-info"
|
||||||
matTooltip="Reine Anzeige-Info in der Tabelle. In welchen Index der Job wirklich schreibt, bestimmt allein der Befehl (z.B. --target-index / --output-index)."
|
matTooltip="Reine Anzeige-Info in der Tabelle. In welchen Index der Job wirklich schreibt, bestimmt allein der Befehl (z.B. --target-index / --output-index)."
|
||||||
>info_outline</mat-icon
|
>{{ INFO_OUTLINE_ICON }}</mat-icon
|
||||||
>
|
>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
matSuffix
|
matSuffix
|
||||||
class="field-info"
|
class="field-info"
|
||||||
matTooltip="Zusätzliche Umgebungsvariablen für den Container, eine pro Zeile im Format KEY=value. Das Standard-Image bekommt die INSE-Zugangsdaten (Elasticsearch/LLM) automatisch — hier ist nur Spezielles nötig."
|
matTooltip="Zusätzliche Umgebungsvariablen für den Container, eine pro Zeile im Format KEY=value. Das Standard-Image bekommt die INSE-Zugangsdaten (Elasticsearch/LLM) automatisch — hier ist nur Spezielles nötig."
|
||||||
>info_outline</mat-icon
|
>{{ INFO_OUTLINE_ICON }}</mat-icon
|
||||||
>
|
>
|
||||||
<mat-hint>Eine Variable pro Zeile im Format KEY=value.</mat-hint>
|
<mat-hint>Eine Variable pro Zeile im Format KEY=value.</mat-hint>
|
||||||
@if (form.controls.env.hasError('invalidEnv')) {
|
@if (form.controls.env.hasError('invalidEnv')) {
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
type="button"
|
type="button"
|
||||||
[disabled]="saving()"
|
[disabled]="saving()"
|
||||||
(click)="submit()">
|
(click)="submit()">
|
||||||
<mat-icon>save</mat-icon>
|
<mat-icon>{{ SAVE_ICON }}</mat-icon>
|
||||||
Speichern
|
Speichern
|
||||||
</button>
|
</button>
|
||||||
</mat-dialog-actions>
|
</mat-dialog-actions>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import { MatIconModule } from '@angular/material/icon';
|
|||||||
import { MatInputModule } from '@angular/material/input';
|
import { MatInputModule } from '@angular/material/input';
|
||||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||||
import { BackgroundJobTask, BackgroundJobsService } from '../../../api';
|
import { BackgroundJobTask, BackgroundJobsService } from '../../../api';
|
||||||
|
import { INFO_OUTLINE_ICON, SAVE_ICON } from '../../../shared/ui/icons';
|
||||||
|
|
||||||
const ENV_LINE_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*=.*$/;
|
const ENV_LINE_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*=.*$/;
|
||||||
|
|
||||||
@@ -44,6 +45,9 @@ export interface TaskEditDialogData {
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class TaskEditDialogComponent implements OnInit {
|
export class TaskEditDialogComponent implements OnInit {
|
||||||
|
readonly INFO_OUTLINE_ICON = INFO_OUTLINE_ICON;
|
||||||
|
readonly SAVE_ICON = SAVE_ICON;
|
||||||
|
|
||||||
private readonly dialogRef =
|
private readonly dialogRef =
|
||||||
inject<
|
inject<
|
||||||
MatDialogRef<TaskEditDialogComponent, BackgroundJobTask | undefined>
|
MatDialogRef<TaskEditDialogComponent, BackgroundJobTask | undefined>
|
||||||
|
|||||||
+1
-1
@@ -123,7 +123,7 @@
|
|||||||
<mat-dialog-actions align="end">
|
<mat-dialog-actions align="end">
|
||||||
<button mat-button type="button" (click)="close()">Abbrechen</button>
|
<button mat-button type="button" (click)="close()">Abbrechen</button>
|
||||||
<button mat-flat-button color="primary" type="button" (click)="submit()">
|
<button mat-flat-button color="primary" type="button" (click)="submit()">
|
||||||
<mat-icon>save</mat-icon>
|
<mat-icon>{{ SAVE_ICON }}</mat-icon>
|
||||||
Speichern
|
Speichern
|
||||||
</button>
|
</button>
|
||||||
</mat-dialog-actions>
|
</mat-dialog-actions>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import { MatInputModule } from '@angular/material/input';
|
|||||||
import { MatSelectModule } from '@angular/material/select';
|
import { MatSelectModule } from '@angular/material/select';
|
||||||
import { BackgroundJobTask } from '../../../api';
|
import { BackgroundJobTask } from '../../../api';
|
||||||
import { formatUtcDateAsLocal } from '../jobs.utils';
|
import { formatUtcDateAsLocal } from '../jobs.utils';
|
||||||
|
import { SAVE_ICON } from '../../../shared/ui/icons';
|
||||||
|
|
||||||
export interface TaskScheduleDialogData {
|
export interface TaskScheduleDialogData {
|
||||||
task: BackgroundJobTask;
|
task: BackgroundJobTask;
|
||||||
@@ -127,6 +128,8 @@ function toTime(hour: string, minute: string): string {
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class TaskScheduleDialogComponent {
|
export class TaskScheduleDialogComponent {
|
||||||
|
readonly SAVE_ICON = SAVE_ICON;
|
||||||
|
|
||||||
private readonly dialogRef =
|
private readonly dialogRef =
|
||||||
inject<
|
inject<
|
||||||
MatDialogRef<
|
MatDialogRef<
|
||||||
|
|||||||
+6
-16
@@ -1,7 +1,7 @@
|
|||||||
@if (loading()) {
|
@if (loading()) {
|
||||||
<app-loading
|
<app-loading
|
||||||
text="Patentdaten werden geladen..."
|
text="Patentdaten werden geladen..."
|
||||||
icon="workspace_premium"
|
[icon]="PATENT_ICON"
|
||||||
[size]="150"
|
[size]="150"
|
||||||
[diameter]="150" />
|
[diameter]="150" />
|
||||||
} @else if (error()) {
|
} @else if (error()) {
|
||||||
@@ -13,23 +13,13 @@
|
|||||||
<div class="patents-content">
|
<div class="patents-content">
|
||||||
<div class="patents-list">
|
<div class="patents-list">
|
||||||
<div class="patents-list-toolbar">
|
<div class="patents-list-toolbar">
|
||||||
|
<app-source-filter
|
||||||
|
[value]="activeFilter()"
|
||||||
|
(valueChange)="setFilter($event)" />
|
||||||
<mat-form-field
|
<mat-form-field
|
||||||
class="patents-toolbar-field"
|
class="patents-toolbar-field"
|
||||||
subscriptSizing="dynamic">
|
subscriptSizing="dynamic">
|
||||||
<mat-icon matPrefix fontIcon="filter_alt"></mat-icon>
|
<mat-icon matPrefix [fontIcon]="SORT_ICON"></mat-icon>
|
||||||
<mat-select
|
|
||||||
[value]="activeFilter()"
|
|
||||||
(selectionChange)="setFilter($event.value)">
|
|
||||||
<mat-select-trigger>Filter nach Quelle</mat-select-trigger>
|
|
||||||
<mat-option value="all">Alle</mat-option>
|
|
||||||
<mat-option value="EPO">EPO</mat-option>
|
|
||||||
<mat-option value="USPTO">USPTO</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</mat-form-field>
|
|
||||||
<mat-form-field
|
|
||||||
class="patents-toolbar-field"
|
|
||||||
subscriptSizing="dynamic">
|
|
||||||
<mat-icon matPrefix fontIcon="sort"></mat-icon>
|
|
||||||
<mat-select
|
<mat-select
|
||||||
[value]="sortColumn()"
|
[value]="sortColumn()"
|
||||||
(selectionChange)="setSort($event.value)">
|
(selectionChange)="setSort($event.value)">
|
||||||
@@ -99,7 +89,7 @@
|
|||||||
<span class="patent-detail-action__label"
|
<span class="patent-detail-action__label"
|
||||||
>Patentdetails anzeigen</span
|
>Patentdetails anzeigen</span
|
||||||
>
|
>
|
||||||
<mat-icon aria-hidden="true">chevron_right</mat-icon>
|
<mat-icon aria-hidden="true">{{ CHEVRON_RIGHT_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<p class="patent-detail-hint">
|
<p class="patent-detail-hint">
|
||||||
Abstract, Erfinder, Anmelder und IPC/CPC-Klassifikation
|
Abstract, Erfinder, Anmelder und IPC/CPC-Klassifikation
|
||||||
|
|||||||
@@ -23,6 +23,13 @@ import {
|
|||||||
} from '../../patent-detail/patent-detail.utils';
|
} from '../../patent-detail/patent-detail.utils';
|
||||||
import { KeywordPatentMappingStatus } from '../../../api';
|
import { KeywordPatentMappingStatus } from '../../../api';
|
||||||
import { PatentTableComponent } from '../../../shared/ui/patent-table/patent-table.component';
|
import { PatentTableComponent } from '../../../shared/ui/patent-table/patent-table.component';
|
||||||
|
import { SourceFilterComponent } from '../../../shared/ui/source-filter/source-filter.component';
|
||||||
|
import {
|
||||||
|
CHEVRON_RIGHT_ICON,
|
||||||
|
FILTER_ICON,
|
||||||
|
PATENT_ICON,
|
||||||
|
SORT_ICON,
|
||||||
|
} from '../../../shared/ui/icons';
|
||||||
|
|
||||||
type SourceFilter = 'all' | 'EPO' | 'USPTO';
|
type SourceFilter = 'all' | 'EPO' | 'USPTO';
|
||||||
type SortColumn = 'title' | 'publication_year' | 'source';
|
type SortColumn = 'title' | 'publication_year' | 'source';
|
||||||
@@ -43,11 +50,17 @@ function isValidSortColumn(value: string | null): value is SortColumn {
|
|||||||
LoadingComponent,
|
LoadingComponent,
|
||||||
QueryParamPaginatorComponent,
|
QueryParamPaginatorComponent,
|
||||||
PatentTableComponent,
|
PatentTableComponent,
|
||||||
|
SourceFilterComponent,
|
||||||
],
|
],
|
||||||
templateUrl: './keywords-patents.component.html',
|
templateUrl: './keywords-patents.component.html',
|
||||||
styleUrl: './keywords-patents.component.scss',
|
styleUrl: './keywords-patents.component.scss',
|
||||||
})
|
})
|
||||||
export class KeywordsPatentsComponent {
|
export class KeywordsPatentsComponent {
|
||||||
|
readonly PATENT_ICON = PATENT_ICON;
|
||||||
|
readonly FILTER_ICON = FILTER_ICON;
|
||||||
|
readonly SORT_ICON = SORT_ICON;
|
||||||
|
readonly CHEVRON_RIGHT_ICON = CHEVRON_RIGHT_ICON;
|
||||||
|
|
||||||
private readonly route = inject(ActivatedRoute);
|
private readonly route = inject(ActivatedRoute);
|
||||||
private readonly router = inject(Router);
|
private readonly router = inject(Router);
|
||||||
private readonly queryParams = toSignal(this.route.queryParams);
|
private readonly queryParams = toSignal(this.route.queryParams);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
[color]="isExtracting() ? 'warn' : 'primary'"
|
[color]="isExtracting() ? 'warn' : 'primary'"
|
||||||
(click)="onExtractKeywordsClick()">
|
(click)="onExtractKeywordsClick()">
|
||||||
<mat-icon>
|
<mat-icon>
|
||||||
{{ isExtracting() ? 'close' : 'troubleshoot' }}
|
{{ isExtracting() ? CLOSE_ICON : TROUBLESHOOT_ICON }}
|
||||||
</mat-icon>
|
</mat-icon>
|
||||||
{{ isExtracting() ? 'Abbrechen' : 'Keywords extrahieren' }}
|
{{ isExtracting() ? 'Abbrechen' : 'Keywords extrahieren' }}
|
||||||
</button>
|
</button>
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
class="extract-btn"
|
class="extract-btn"
|
||||||
(click)="onExtractKeywordsClick()">
|
(click)="onExtractKeywordsClick()">
|
||||||
<mat-icon>
|
<mat-icon>
|
||||||
{{ isExtracting() ? 'close' : 'troubleshoot' }}
|
{{ isExtracting() ? CLOSE_ICON : TROUBLESHOOT_ICON }}
|
||||||
</mat-icon>
|
</mat-icon>
|
||||||
{{ isExtracting() ? 'Abbrechen' : 'Keywords extrahieren' }}
|
{{ isExtracting() ? 'Abbrechen' : 'Keywords extrahieren' }}
|
||||||
</button>
|
</button>
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
class="extract-btn"
|
class="extract-btn"
|
||||||
(click)="onExtractKeywordsClick()">
|
(click)="onExtractKeywordsClick()">
|
||||||
<mat-icon>
|
<mat-icon>
|
||||||
{{ isExtracting() ? 'close' : 'troubleshoot' }}
|
{{ isExtracting() ? CLOSE_ICON : TROUBLESHOOT_ICON }}
|
||||||
</mat-icon>
|
</mat-icon>
|
||||||
{{ isExtracting() ? 'Abbrechen' : 'Keywords extrahieren' }}
|
{{ isExtracting() ? 'Abbrechen' : 'Keywords extrahieren' }}
|
||||||
</button>
|
</button>
|
||||||
@@ -113,7 +113,7 @@
|
|||||||
(click)="deselectAll()"
|
(click)="deselectAll()"
|
||||||
[disabled]="isExtracting()"
|
[disabled]="isExtracting()"
|
||||||
matTooltip="Alle extrahierten Keywords abwählen">
|
matTooltip="Alle extrahierten Keywords abwählen">
|
||||||
<mat-icon>select_all</mat-icon>
|
<mat-icon>{{ SELECT_ALL_ICON }}</mat-icon>
|
||||||
<span>Alle abwählen</span>
|
<span>Alle abwählen</span>
|
||||||
</button>
|
</button>
|
||||||
} @else {
|
} @else {
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
[disabled]="isExtracting()"
|
[disabled]="isExtracting()"
|
||||||
(click)="selectAll()"
|
(click)="selectAll()"
|
||||||
matTooltip="Alle extrahierten Keywords auswählen">
|
matTooltip="Alle extrahierten Keywords auswählen">
|
||||||
<mat-icon>select_all</mat-icon>
|
<mat-icon>{{ SELECT_ALL_ICON }}</mat-icon>
|
||||||
<span>Alle auswählen</span>
|
<span>Alle auswählen</span>
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
@@ -133,7 +133,7 @@
|
|||||||
[disabled]="isExtracting()"
|
[disabled]="isExtracting()"
|
||||||
(click)="clearKeywords()"
|
(click)="clearKeywords()"
|
||||||
matTooltip="Alle extrahierten Keywords löschen">
|
matTooltip="Alle extrahierten Keywords löschen">
|
||||||
<mat-icon>delete_outline</mat-icon>
|
<mat-icon>{{ DELETE_OUTLINE_ICON }}</mat-icon>
|
||||||
<span>Alle löschen</span>
|
<span>Alle löschen</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -147,14 +147,14 @@
|
|||||||
[disabled]="isExtracting()"
|
[disabled]="isExtracting()"
|
||||||
value="llm"
|
value="llm"
|
||||||
matTooltip="Extrahierte Keywords">
|
matTooltip="Extrahierte Keywords">
|
||||||
<mat-icon>text_fields</mat-icon>
|
<mat-icon>{{ TEXT_FIELDS_ICON }}</mat-icon>
|
||||||
<span>Extrahierte Keywords</span>
|
<span>Extrahierte Keywords</span>
|
||||||
</mat-button-toggle>
|
</mat-button-toggle>
|
||||||
<mat-button-toggle
|
<mat-button-toggle
|
||||||
[disabled]="isExtracting()"
|
[disabled]="isExtracting()"
|
||||||
value="topic"
|
value="topic"
|
||||||
matTooltip="Die Abbildung der extrahierten Keywords auf die bekannten Themenbereiche">
|
matTooltip="Die Abbildung der extrahierten Keywords auf die bekannten Themenbereiche">
|
||||||
<mat-icon>account_tree</mat-icon>
|
<mat-icon>{{ ACCOUNT_TREE_ICON }}</mat-icon>
|
||||||
<span>Ähnliche Themen</span>
|
<span>Ähnliche Themen</span>
|
||||||
</mat-button-toggle>
|
</mat-button-toggle>
|
||||||
</mat-button-toggle-group>
|
</mat-button-toggle-group>
|
||||||
@@ -233,7 +233,7 @@
|
|||||||
color="warn"
|
color="warn"
|
||||||
aria-label="Manuelles Keyword entfernen"
|
aria-label="Manuelles Keyword entfernen"
|
||||||
(click)="removeManualKeyword(keyword)">
|
(click)="removeManualKeyword(keyword)">
|
||||||
<mat-icon>cancel</mat-icon>
|
<mat-icon>{{ CANCEL_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@@ -265,7 +265,10 @@
|
|||||||
<div class="table-body">
|
<div class="table-body">
|
||||||
<div class="table-col broad-col">
|
<div class="table-col broad-col">
|
||||||
@if (isExtracting() && broadKeywords().length === 0) {
|
@if (isExtracting() && broadKeywords().length === 0) {
|
||||||
<app-loading icon="manage_search" [size]="60" [diameter]="60" />
|
<app-loading
|
||||||
|
[icon]="MANAGE_SEARCH_ICON"
|
||||||
|
[size]="60"
|
||||||
|
[diameter]="60" />
|
||||||
} @else {
|
} @else {
|
||||||
<ng-container
|
<ng-container
|
||||||
*ngTemplateOutlet="
|
*ngTemplateOutlet="
|
||||||
@@ -280,7 +283,10 @@
|
|||||||
|
|
||||||
<div class="table-col coarse-col">
|
<div class="table-col coarse-col">
|
||||||
@if (isExtracting() && coarseKeywords().length === 0) {
|
@if (isExtracting() && coarseKeywords().length === 0) {
|
||||||
<app-loading icon="manage_search" [size]="60" [diameter]="60" />
|
<app-loading
|
||||||
|
[icon]="MANAGE_SEARCH_ICON"
|
||||||
|
[size]="60"
|
||||||
|
[diameter]="60" />
|
||||||
} @else {
|
} @else {
|
||||||
<ng-container
|
<ng-container
|
||||||
*ngTemplateOutlet="
|
*ngTemplateOutlet="
|
||||||
@@ -295,7 +301,10 @@
|
|||||||
|
|
||||||
<div class="table-col fine-col thick-border">
|
<div class="table-col fine-col thick-border">
|
||||||
@if (isExtracting() && fineKeywords().length === 0) {
|
@if (isExtracting() && fineKeywords().length === 0) {
|
||||||
<app-loading icon="manage_search" [size]="60" [diameter]="60" />
|
<app-loading
|
||||||
|
[icon]="MANAGE_SEARCH_ICON"
|
||||||
|
[size]="60"
|
||||||
|
[diameter]="60" />
|
||||||
} @else {
|
} @else {
|
||||||
<ng-container
|
<ng-container
|
||||||
*ngTemplateOutlet="
|
*ngTemplateOutlet="
|
||||||
@@ -323,7 +332,10 @@
|
|||||||
</ng-template>
|
</ng-template>
|
||||||
<div class="mobile-tab-panel">
|
<div class="mobile-tab-panel">
|
||||||
@if (isExtracting() && broadKeywords().length === 0) {
|
@if (isExtracting() && broadKeywords().length === 0) {
|
||||||
<app-loading icon="manage_search" [size]="60" [diameter]="60" />
|
<app-loading
|
||||||
|
[icon]="MANAGE_SEARCH_ICON"
|
||||||
|
[size]="60"
|
||||||
|
[diameter]="60" />
|
||||||
} @else {
|
} @else {
|
||||||
<ng-container
|
<ng-container
|
||||||
*ngTemplateOutlet="
|
*ngTemplateOutlet="
|
||||||
@@ -344,7 +356,10 @@
|
|||||||
</ng-template>
|
</ng-template>
|
||||||
<div class="mobile-tab-panel">
|
<div class="mobile-tab-panel">
|
||||||
@if (isExtracting() && coarseKeywords().length === 0) {
|
@if (isExtracting() && coarseKeywords().length === 0) {
|
||||||
<app-loading icon="manage_search" [size]="60" [diameter]="60" />
|
<app-loading
|
||||||
|
[icon]="MANAGE_SEARCH_ICON"
|
||||||
|
[size]="60"
|
||||||
|
[diameter]="60" />
|
||||||
} @else {
|
} @else {
|
||||||
<ng-container
|
<ng-container
|
||||||
*ngTemplateOutlet="
|
*ngTemplateOutlet="
|
||||||
@@ -365,7 +380,10 @@
|
|||||||
</ng-template>
|
</ng-template>
|
||||||
<div class="mobile-tab-panel">
|
<div class="mobile-tab-panel">
|
||||||
@if (isExtracting() && fineKeywords().length === 0) {
|
@if (isExtracting() && fineKeywords().length === 0) {
|
||||||
<app-loading icon="manage_search" [size]="60" [diameter]="60" />
|
<app-loading
|
||||||
|
[icon]="MANAGE_SEARCH_ICON"
|
||||||
|
[size]="60"
|
||||||
|
[diameter]="60" />
|
||||||
} @else {
|
} @else {
|
||||||
<ng-container
|
<ng-container
|
||||||
*ngTemplateOutlet="
|
*ngTemplateOutlet="
|
||||||
@@ -394,7 +412,7 @@
|
|||||||
<!-- @if (isExtracting() && !keywordsExist()) {
|
<!-- @if (isExtracting() && !keywordsExist()) {
|
||||||
<app-loading
|
<app-loading
|
||||||
text="{{ statusMessage() }}"
|
text="{{ statusMessage() }}"
|
||||||
icon="manage_search"
|
[icon]="MANAGE_SEARCH_ICON"
|
||||||
[size]="200"
|
[size]="200"
|
||||||
[diameter]="200" />
|
[diameter]="200" />
|
||||||
} -->
|
} -->
|
||||||
@@ -425,7 +443,7 @@
|
|||||||
class="search-btn"
|
class="search-btn"
|
||||||
[disabled]="isSearchDisabled()"
|
[disabled]="isSearchDisabled()"
|
||||||
(click)="search()">
|
(click)="search()">
|
||||||
<mat-icon>search</mat-icon>
|
<mat-icon>{{ SEARCH_ICON }}</mat-icon>
|
||||||
Suchen
|
Suchen
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -55,6 +55,17 @@ import { A11yModule } from '@angular/cdk/a11y';
|
|||||||
import { DomSanitizer } from '@angular/platform-browser';
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
import { SearchResultsPayload } from './search-results/search-results-state.service';
|
import { SearchResultsPayload } from './search-results/search-results-state.service';
|
||||||
import { clearPatentsCache } from './patent-search.utils';
|
import { clearPatentsCache } from './patent-search.utils';
|
||||||
|
import {
|
||||||
|
ACCOUNT_TREE_ICON,
|
||||||
|
CANCEL_ICON,
|
||||||
|
CLOSE_ICON,
|
||||||
|
DELETE_OUTLINE_ICON,
|
||||||
|
MANAGE_SEARCH_ICON,
|
||||||
|
SEARCH_ICON,
|
||||||
|
SELECT_ALL_ICON,
|
||||||
|
TEXT_FIELDS_ICON,
|
||||||
|
TROUBLESHOOT_ICON,
|
||||||
|
} from '../../shared/ui/icons';
|
||||||
type InputMode = 'url' | 'text' | 'file';
|
type InputMode = 'url' | 'text' | 'file';
|
||||||
type KeywordCategory = 'broad' | 'coarse' | 'fine' | 'manual';
|
type KeywordCategory = 'broad' | 'coarse' | 'fine' | 'manual';
|
||||||
type KeywordView = 'llm' | 'topic';
|
type KeywordView = 'llm' | 'topic';
|
||||||
@@ -89,6 +100,16 @@ type KeywordPatentLevel = 'broad' | 'coarse' | 'fine' | 'custom';
|
|||||||
styleUrl: './keywords-search.component.scss',
|
styleUrl: './keywords-search.component.scss',
|
||||||
})
|
})
|
||||||
export class KeywordsSearchComponent {
|
export class KeywordsSearchComponent {
|
||||||
|
readonly CLOSE_ICON = CLOSE_ICON;
|
||||||
|
readonly TROUBLESHOOT_ICON = TROUBLESHOOT_ICON;
|
||||||
|
readonly SELECT_ALL_ICON = SELECT_ALL_ICON;
|
||||||
|
readonly DELETE_OUTLINE_ICON = DELETE_OUTLINE_ICON;
|
||||||
|
readonly TEXT_FIELDS_ICON = TEXT_FIELDS_ICON;
|
||||||
|
readonly ACCOUNT_TREE_ICON = ACCOUNT_TREE_ICON;
|
||||||
|
readonly CANCEL_ICON = CANCEL_ICON;
|
||||||
|
readonly MANAGE_SEARCH_ICON = MANAGE_SEARCH_ICON;
|
||||||
|
readonly SEARCH_ICON = SEARCH_ICON;
|
||||||
|
|
||||||
private readonly formBuilder = inject(FormBuilder);
|
private readonly formBuilder = inject(FormBuilder);
|
||||||
private readonly sanitizer = inject(DomSanitizer);
|
private readonly sanitizer = inject(DomSanitizer);
|
||||||
private readonly route = inject(ActivatedRoute);
|
private readonly route = inject(ActivatedRoute);
|
||||||
|
|||||||
+8
-8
@@ -6,7 +6,7 @@
|
|||||||
[options]="relevanceOptions"
|
[options]="relevanceOptions"
|
||||||
[queryParamKey]="keywordsNewsQueryParamKeys.relevance"
|
[queryParamKey]="keywordsNewsQueryParamKeys.relevance"
|
||||||
label="Relevanz"
|
label="Relevanz"
|
||||||
icon="check_circle"
|
[icon]="CHECK_CIRCLE_ICON"
|
||||||
[multiple]="true" />
|
[multiple]="true" />
|
||||||
|
|
||||||
<app-query-param-selector
|
<app-query-param-selector
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
[options]="sortOrderOptions"
|
[options]="sortOrderOptions"
|
||||||
[queryParamKey]="keywordsNewsQueryParamKeys.sortOrder"
|
[queryParamKey]="keywordsNewsQueryParamKeys.sortOrder"
|
||||||
label="Sortierung"
|
label="Sortierung"
|
||||||
icon="sort" />
|
[icon]="SORT_ICON" />
|
||||||
</app-filter-card>
|
</app-filter-card>
|
||||||
|
|
||||||
<app-year-range-slider
|
<app-year-range-slider
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
type="button"
|
type="button"
|
||||||
(click)="resetFilters()"
|
(click)="resetFilters()"
|
||||||
aria-label="Filter zurücksetzen">
|
aria-label="Filter zurücksetzen">
|
||||||
<mat-icon>filter_alt_off</mat-icon>
|
<mat-icon>{{ FILTER_OFF_ICON }}</mat-icon>
|
||||||
<span>Zurücksetzen</span>
|
<span>Zurücksetzen</span>
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
expanded ? 'Textstelle ausblenden' : 'Textstelle anzeigen'
|
expanded ? 'Textstelle ausblenden' : 'Textstelle anzeigen'
|
||||||
">
|
">
|
||||||
<mat-icon class="expand-icon" [class.is-expanded]="expanded">
|
<mat-icon class="expand-icon" [class.is-expanded]="expanded">
|
||||||
expand_more
|
{{ EXPAND_MORE_ICON }}
|
||||||
</mat-icon>
|
</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
@@ -110,12 +110,12 @@
|
|||||||
<ng-template #relevanceTmp let-article>
|
<ng-template #relevanceTmp let-article>
|
||||||
@if (article.relevant === true) {
|
@if (article.relevant === true) {
|
||||||
<span class="relevance-badge is-relevant">
|
<span class="relevance-badge is-relevant">
|
||||||
<mat-icon>check_circle</mat-icon>
|
<mat-icon>{{ CHECK_CIRCLE_ICON }}</mat-icon>
|
||||||
Relevant
|
Relevant
|
||||||
</span>
|
</span>
|
||||||
} @else if (article.relevant === false) {
|
} @else if (article.relevant === false) {
|
||||||
<span class="relevance-badge not-relevant">
|
<span class="relevance-badge not-relevant">
|
||||||
<mat-icon>cancel</mat-icon>
|
<mat-icon>{{ CANCEL_ICON }}</mat-icon>
|
||||||
Nicht relevant
|
Nicht relevant
|
||||||
</span>
|
</span>
|
||||||
} @else {
|
} @else {
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
class="relevance-badge undetermined"
|
class="relevance-badge undetermined"
|
||||||
[matTooltip]="relevanceHelp"
|
[matTooltip]="relevanceHelp"
|
||||||
matTooltipPosition="above">
|
matTooltipPosition="above">
|
||||||
<mat-icon>help</mat-icon>
|
<mat-icon>{{ HELP_ICON }}</mat-icon>
|
||||||
Nicht bestimmt
|
Nicht bestimmt
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
@@ -167,7 +167,7 @@
|
|||||||
[routerLink]="['/news', article.id]"
|
[routerLink]="['/news', article.id]"
|
||||||
matTooltip="Details anzeigen"
|
matTooltip="Details anzeigen"
|
||||||
(click)="$event.stopPropagation()">
|
(click)="$event.stopPropagation()">
|
||||||
<mat-icon>open_in_new</mat-icon>
|
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
|
||||||
</a>
|
</a>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
|
|||||||
+17
@@ -32,6 +32,15 @@ import { NEWS_MIN_YEAR } from '../../../../shared/ui/news-card/news-card.compone
|
|||||||
import { keywordsNewsQueryParamKeys } from '../../../../resolvers/keywords-news-page.resolver';
|
import { keywordsNewsQueryParamKeys } from '../../../../resolvers/keywords-news-page.resolver';
|
||||||
import { SearchResultsStateService } from '../search-results-state.service';
|
import { SearchResultsStateService } from '../search-results-state.service';
|
||||||
import { YearRangeSliderComponent } from '../../../../shared/ui/year-range-slider/year-range-slider.component';
|
import { YearRangeSliderComponent } from '../../../../shared/ui/year-range-slider/year-range-slider.component';
|
||||||
|
import {
|
||||||
|
CANCEL_ICON,
|
||||||
|
CHECK_CIRCLE_ICON,
|
||||||
|
EXPAND_MORE_ICON,
|
||||||
|
FILTER_OFF_ICON,
|
||||||
|
HELP_ICON,
|
||||||
|
OPEN_IN_NEW_ICON,
|
||||||
|
SORT_ICON,
|
||||||
|
} from '../../../../shared/ui/icons';
|
||||||
import {
|
import {
|
||||||
keywordTooltip,
|
keywordTooltip,
|
||||||
splitByKeywords,
|
splitByKeywords,
|
||||||
@@ -66,6 +75,14 @@ interface SnippetSegment {
|
|||||||
styleUrl: './news-results.component.scss',
|
styleUrl: './news-results.component.scss',
|
||||||
})
|
})
|
||||||
export class KeywordsToNewsResultsComponent {
|
export class KeywordsToNewsResultsComponent {
|
||||||
|
readonly CHECK_CIRCLE_ICON = CHECK_CIRCLE_ICON;
|
||||||
|
readonly SORT_ICON = SORT_ICON;
|
||||||
|
readonly FILTER_OFF_ICON = FILTER_OFF_ICON;
|
||||||
|
readonly EXPAND_MORE_ICON = EXPAND_MORE_ICON;
|
||||||
|
readonly CANCEL_ICON = CANCEL_ICON;
|
||||||
|
readonly HELP_ICON = HELP_ICON;
|
||||||
|
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
|
||||||
|
|
||||||
protected readonly keywordsNewsQueryParamKeys = keywordsNewsQueryParamKeys;
|
protected readonly keywordsNewsQueryParamKeys = keywordsNewsQueryParamKeys;
|
||||||
|
|
||||||
private readonly state = inject(SearchResultsStateService);
|
private readonly state = inject(SearchResultsStateService);
|
||||||
|
|||||||
+9
-9
@@ -5,7 +5,7 @@
|
|||||||
<p class="results-hint">Lädt…</p>
|
<p class="results-hint">Lädt…</p>
|
||||||
} @else if (authors().length === 0) {
|
} @else if (authors().length === 0) {
|
||||||
<div class="results-placeholder">
|
<div class="results-placeholder">
|
||||||
<mat-icon>groups</mat-icon>
|
<mat-icon>{{ GROUPS_ICON }}</mat-icon>
|
||||||
<h2>Keine Autoren gefunden</h2>
|
<h2>Keine Autoren gefunden</h2>
|
||||||
<p>Passe die Keywords oder die Gewichtung an.</p>
|
<p>Passe die Keywords oder die Gewichtung an.</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
color="primary"
|
color="primary"
|
||||||
[disabled]="!canCompare()"
|
[disabled]="!canCompare()"
|
||||||
(click)="compare()">
|
(click)="compare()">
|
||||||
<mat-icon>insights</mat-icon>
|
<mat-icon>{{ INSIGHTS_ICON }}</mat-icon>
|
||||||
Vergleichen
|
Vergleichen
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
<div class="filter-section-header">
|
<div class="filter-section-header">
|
||||||
<h3>Filter</h3>
|
<h3>Filter</h3>
|
||||||
<button mat-stroked-button color="primary" (click)="resetFilters()">
|
<button mat-stroked-button color="primary" (click)="resetFilters()">
|
||||||
<mat-icon>restart_alt</mat-icon>
|
<mat-icon>{{ RESTART_ICON }}</mat-icon>
|
||||||
Zurücksetzen
|
Zurücksetzen
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -77,14 +77,14 @@
|
|||||||
appearance="outline"
|
appearance="outline"
|
||||||
class="filter-field"
|
class="filter-field"
|
||||||
subscriptSizing="dynamic">
|
subscriptSizing="dynamic">
|
||||||
<mat-icon matPrefix>article</mat-icon>
|
<mat-icon matPrefix>{{ ARTICLE_ICON }}</mat-icon>
|
||||||
<mat-label>Art der Work</mat-label>
|
<mat-label>Art der Work</mat-label>
|
||||||
<mat-select
|
<mat-select
|
||||||
multiple
|
multiple
|
||||||
[ngModel]="selectedPubTypes()"
|
[ngModel]="selectedPubTypes()"
|
||||||
(ngModelChange)="onPubTypesChange($event)">
|
(ngModelChange)="onPubTypesChange($event)">
|
||||||
<div class="pub-type-search">
|
<div class="pub-type-search">
|
||||||
<mat-icon class="search-icon">search</mat-icon>
|
<mat-icon class="search-icon">{{ SEARCH_ICON }}</mat-icon>
|
||||||
<input
|
<input
|
||||||
matInput
|
matInput
|
||||||
placeholder="Suchen..."
|
placeholder="Suchen..."
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
pubTypeSearchTerm.set(''); $event.stopPropagation()
|
pubTypeSearchTerm.set(''); $event.stopPropagation()
|
||||||
"
|
"
|
||||||
style="margin-right: 8px; transform: scale(0.8)">
|
style="margin-right: 8px; transform: scale(0.8)">
|
||||||
<mat-icon>close</mat-icon>
|
<mat-icon>{{ CLOSE_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
appearance="outline"
|
appearance="outline"
|
||||||
class="filter-field"
|
class="filter-field"
|
||||||
subscriptSizing="dynamic">
|
subscriptSizing="dynamic">
|
||||||
<mat-icon matPrefix>link</mat-icon>
|
<mat-icon matPrefix>{{ LINK_ICON }}</mat-icon>
|
||||||
<mat-label>Keyword-Verknüpfung</mat-label>
|
<mat-label>Keyword-Verknüpfung</mat-label>
|
||||||
<mat-select
|
<mat-select
|
||||||
[ngModel]="keywordOperator()"
|
[ngModel]="keywordOperator()"
|
||||||
@@ -133,7 +133,7 @@
|
|||||||
appearance="outline"
|
appearance="outline"
|
||||||
class="filter-field"
|
class="filter-field"
|
||||||
subscriptSizing="dynamic">
|
subscriptSizing="dynamic">
|
||||||
<mat-icon matPrefix>trending_up</mat-icon>
|
<mat-icon matPrefix>{{ TRENDING_UP_ICON }}</mat-icon>
|
||||||
<mat-label>Karrierestufe</mat-label>
|
<mat-label>Karrierestufe</mat-label>
|
||||||
<mat-select
|
<mat-select
|
||||||
multiple
|
multiple
|
||||||
@@ -151,7 +151,7 @@
|
|||||||
appearance="outline"
|
appearance="outline"
|
||||||
class="filter-field"
|
class="filter-field"
|
||||||
subscriptSizing="dynamic">
|
subscriptSizing="dynamic">
|
||||||
<mat-icon matPrefix>business</mat-icon>
|
<mat-icon matPrefix>{{ BUSINESS_ICON }}</mat-icon>
|
||||||
<mat-label>Unternehmen</mat-label>
|
<mat-label>Unternehmen</mat-label>
|
||||||
<mat-select
|
<mat-select
|
||||||
[ngModel]="companyStatus()"
|
[ngModel]="companyStatus()"
|
||||||
|
|||||||
+29
-5
@@ -32,6 +32,20 @@ import {
|
|||||||
} from '../../../../api';
|
} from '../../../../api';
|
||||||
|
|
||||||
import { SearchResultsStateService } from '../search-results-state.service';
|
import { SearchResultsStateService } from '../search-results-state.service';
|
||||||
|
import {
|
||||||
|
ARTICLE_ICON,
|
||||||
|
BUSINESS_ICON,
|
||||||
|
CITATION_ICON,
|
||||||
|
CLOSE_ICON,
|
||||||
|
GROUPS_ICON,
|
||||||
|
INSIGHTS_ICON,
|
||||||
|
LINK_ICON,
|
||||||
|
PATENT_ICON,
|
||||||
|
RESTART_ICON,
|
||||||
|
SEARCH_ICON,
|
||||||
|
TRENDING_UP_ICON,
|
||||||
|
VISIBILITY_ICON,
|
||||||
|
} from '../../../../shared/ui/icons';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-persons-results',
|
selector: 'app-persons-results',
|
||||||
@@ -55,6 +69,16 @@ import { SearchResultsStateService } from '../search-results-state.service';
|
|||||||
styleUrl: './persons-results.component.scss',
|
styleUrl: './persons-results.component.scss',
|
||||||
})
|
})
|
||||||
export class KeywordsToPersonsResultsComponent implements OnInit {
|
export class KeywordsToPersonsResultsComponent implements OnInit {
|
||||||
|
readonly GROUPS_ICON = GROUPS_ICON;
|
||||||
|
readonly INSIGHTS_ICON = INSIGHTS_ICON;
|
||||||
|
readonly RESTART_ICON = RESTART_ICON;
|
||||||
|
readonly ARTICLE_ICON = ARTICLE_ICON;
|
||||||
|
readonly SEARCH_ICON = SEARCH_ICON;
|
||||||
|
readonly CLOSE_ICON = CLOSE_ICON;
|
||||||
|
readonly LINK_ICON = LINK_ICON;
|
||||||
|
readonly TRENDING_UP_ICON = TRENDING_UP_ICON;
|
||||||
|
readonly BUSINESS_ICON = BUSINESS_ICON;
|
||||||
|
|
||||||
// injects the state set by the parent route — no duplicate parsing here
|
// injects the state set by the parent route — no duplicate parsing here
|
||||||
private readonly state = inject(SearchResultsStateService);
|
private readonly state = inject(SearchResultsStateService);
|
||||||
private readonly rankingService = inject(RankingService);
|
private readonly rankingService = inject(RankingService);
|
||||||
@@ -98,7 +122,7 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
|
|||||||
{
|
{
|
||||||
key: 'works',
|
key: 'works',
|
||||||
label: 'Works',
|
label: 'Works',
|
||||||
icon: 'article',
|
icon: ARTICLE_ICON,
|
||||||
description:
|
description:
|
||||||
'Gewichtet die Anzahl und Relevanz wissenschaftlicher Arbeiten.',
|
'Gewichtet die Anzahl und Relevanz wissenschaftlicher Arbeiten.',
|
||||||
defaultValue: 0.5,
|
defaultValue: 0.5,
|
||||||
@@ -107,7 +131,7 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
|
|||||||
{
|
{
|
||||||
key: 'citations',
|
key: 'citations',
|
||||||
label: 'Zitationen',
|
label: 'Zitationen',
|
||||||
icon: 'format_quote',
|
icon: CITATION_ICON,
|
||||||
description: 'Gewichtet wissenschaftlichen Einfluss über Zitationen.',
|
description: 'Gewichtet wissenschaftlichen Einfluss über Zitationen.',
|
||||||
defaultValue: 0.5,
|
defaultValue: 0.5,
|
||||||
queryParamName: 'wCitations',
|
queryParamName: 'wCitations',
|
||||||
@@ -115,7 +139,7 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
|
|||||||
{
|
{
|
||||||
key: 'companies',
|
key: 'companies',
|
||||||
label: 'Unternehmensgründungen',
|
label: 'Unternehmensgründungen',
|
||||||
icon: 'business',
|
icon: BUSINESS_ICON,
|
||||||
description:
|
description:
|
||||||
'Gewichtet die Anzahl der Unternehmensgründungen (Handelsregister-Verbindungen).',
|
'Gewichtet die Anzahl der Unternehmensgründungen (Handelsregister-Verbindungen).',
|
||||||
nameMatched: true,
|
nameMatched: true,
|
||||||
@@ -125,7 +149,7 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
|
|||||||
{
|
{
|
||||||
key: 'news',
|
key: 'news',
|
||||||
label: 'Medien-Sichtbarkeit',
|
label: 'Medien-Sichtbarkeit',
|
||||||
icon: 'visibility',
|
icon: VISIBILITY_ICON,
|
||||||
description:
|
description:
|
||||||
'Gewichtet die öffentliche Sichtbarkeit über Nennungen in Nachrichtenartikeln.',
|
'Gewichtet die öffentliche Sichtbarkeit über Nennungen in Nachrichtenartikeln.',
|
||||||
nameMatched: true,
|
nameMatched: true,
|
||||||
@@ -135,7 +159,7 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
|
|||||||
{
|
{
|
||||||
key: 'patents',
|
key: 'patents',
|
||||||
label: 'Patente',
|
label: 'Patente',
|
||||||
icon: 'workspace_premium',
|
icon: PATENT_ICON,
|
||||||
description: 'Gewichtet Innovations- und Transferleistung über Patente.',
|
description: 'Gewichtet Innovations- und Transferleistung über Patente.',
|
||||||
nameMatched: true,
|
nameMatched: true,
|
||||||
defaultValue: 0.5,
|
defaultValue: 0.5,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<div class="search-results-page">
|
<div class="search-results-page">
|
||||||
<div class="search-results-header">
|
<div class="search-results-header">
|
||||||
<button mat-stroked-button color="primary" (click)="goBackToSearch()">
|
<button mat-stroked-button color="primary" (click)="goBackToSearch()">
|
||||||
<mat-icon>arrow_back</mat-icon>
|
<mat-icon>{{ ARROW_BACK_ICON }}</mat-icon>
|
||||||
Keywords anpassen
|
Keywords anpassen
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
} @else {
|
} @else {
|
||||||
<mat-card class="empty-card">
|
<mat-card class="empty-card">
|
||||||
<mat-card-content class="empty-state">
|
<mat-card-content class="empty-state">
|
||||||
<mat-icon>manage_search</mat-icon>
|
<mat-icon>{{ MANAGE_SEARCH_ICON }}</mat-icon>
|
||||||
<h2>Keine Suchdaten</h2>
|
<h2>Keine Suchdaten</h2>
|
||||||
<p>Starte eine neue Suche, um Ergebnisse zu sehen.</p>
|
<p>Starte eine neue Suche, um Ergebnisse zu sehen.</p>
|
||||||
<button mat-flat-button color="primary" (click)="goBackToSearch()">
|
<button mat-flat-button color="primary" (click)="goBackToSearch()">
|
||||||
|
|||||||
@@ -24,6 +24,16 @@ import {
|
|||||||
SearchResultsPayload,
|
SearchResultsPayload,
|
||||||
SearchResultsStateService,
|
SearchResultsStateService,
|
||||||
} from './search-results-state.service';
|
} from './search-results-state.service';
|
||||||
|
import {
|
||||||
|
ARTICLE_ICON,
|
||||||
|
ARROW_BACK_ICON,
|
||||||
|
BAR_CHART_ICON,
|
||||||
|
MANAGE_SEARCH_ICON,
|
||||||
|
NEWS_ICON,
|
||||||
|
PATENT_ICON,
|
||||||
|
PERSONS_ICON,
|
||||||
|
PROJECT_ICON,
|
||||||
|
} from '../../../shared/ui/icons';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-keywords-search-results',
|
selector: 'app-keywords-search-results',
|
||||||
@@ -45,6 +55,9 @@ import {
|
|||||||
styleUrl: './search-results.component.scss',
|
styleUrl: './search-results.component.scss',
|
||||||
})
|
})
|
||||||
export class KeywordsSearchResultsComponent {
|
export class KeywordsSearchResultsComponent {
|
||||||
|
readonly ARROW_BACK_ICON = ARROW_BACK_ICON;
|
||||||
|
readonly MANAGE_SEARCH_ICON = MANAGE_SEARCH_ICON;
|
||||||
|
|
||||||
private readonly router = inject(Router);
|
private readonly router = inject(Router);
|
||||||
private readonly route = inject(ActivatedRoute);
|
private readonly route = inject(ActivatedRoute);
|
||||||
|
|
||||||
@@ -55,12 +68,12 @@ export class KeywordsSearchResultsComponent {
|
|||||||
private readonly HANDOFF_KEY = 'search-results-handoff';
|
private readonly HANDOFF_KEY = 'search-results-handoff';
|
||||||
|
|
||||||
protected readonly childRoutes = [
|
protected readonly childRoutes = [
|
||||||
{ path: 'persons', label: 'Personen', icon: 'groups' },
|
{ path: 'persons', label: 'Personen', icon: PERSONS_ICON },
|
||||||
{ path: 'projects', label: 'Projekte', icon: 'work' },
|
{ path: 'projects', label: 'Projekte', icon: PROJECT_ICON },
|
||||||
{ path: 'patents', label: 'Patente', icon: 'workspace_premium' },
|
{ path: 'patents', label: 'Patente', icon: PATENT_ICON },
|
||||||
{ path: 'works', label: 'Publikationen', icon: 'article' },
|
{ path: 'works', label: 'Publikationen', icon: ARTICLE_ICON },
|
||||||
{ path: 'news', label: 'Nachrichten', icon: 'newspaper' },
|
{ path: 'news', label: 'Nachrichten', icon: NEWS_ICON },
|
||||||
{ path: 'trends', label: 'Visualisierung', icon: 'bar_chart' },
|
{ path: 'trends', label: 'Visualisierung', icon: BAR_CHART_ICON },
|
||||||
];
|
];
|
||||||
|
|
||||||
private readonly lastUserFuzzy = signal(false);
|
private readonly lastUserFuzzy = signal(false);
|
||||||
|
|||||||
@@ -4,19 +4,19 @@
|
|||||||
class="back-link"
|
class="back-link"
|
||||||
(click)="navigateBack()"
|
(click)="navigateBack()"
|
||||||
aria-label="Zurück zu den Nachrichten">
|
aria-label="Zurück zu den Nachrichten">
|
||||||
<mat-icon>arrow_back</mat-icon>
|
<mat-icon>{{ ARROW_BACK_ICON }}</mat-icon>
|
||||||
Alle Nachrichten
|
Alle Nachrichten
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@if (loading) {
|
@if (loading) {
|
||||||
<app-loading
|
<app-loading
|
||||||
text="Nachricht wird geladen..."
|
text="Nachricht wird geladen..."
|
||||||
icon="newspaper"
|
[icon]="NEWS_ICON"
|
||||||
[size]="60"
|
[size]="60"
|
||||||
[diameter]="60" />
|
[diameter]="60" />
|
||||||
} @else if (notFound || !article) {
|
} @else if (notFound || !article) {
|
||||||
<div class="state error-state">
|
<div class="state error-state">
|
||||||
<mat-icon>search_off</mat-icon>
|
<mat-icon>{{ SEARCH_OFF_ICON }}</mat-icon>
|
||||||
<h2>Nachricht nicht gefunden</h2>
|
<h2>Nachricht nicht gefunden</h2>
|
||||||
<p>Der Artikel konnte nicht geladen werden.</p>
|
<p>Der Artikel konnte nicht geladen werden.</p>
|
||||||
<a mat-stroked-button routerLink="/persons">Zur Personensuche</a>
|
<a mat-stroked-button routerLink="/persons">Zur Personensuche</a>
|
||||||
@@ -37,17 +37,17 @@
|
|||||||
|
|
||||||
@if (article.relevant === true) {
|
@if (article.relevant === true) {
|
||||||
<span class="relevance-badge is-relevant">
|
<span class="relevance-badge is-relevant">
|
||||||
<mat-icon>check_circle</mat-icon>
|
<mat-icon>{{ CHECK_CIRCLE_ICON }}</mat-icon>
|
||||||
Relevant
|
Relevant
|
||||||
</span>
|
</span>
|
||||||
} @else if (article.relevant === false) {
|
} @else if (article.relevant === false) {
|
||||||
<span class="relevance-badge not-relevant">
|
<span class="relevance-badge not-relevant">
|
||||||
<mat-icon>cancel</mat-icon>
|
<mat-icon>{{ CANCEL_ICON }}</mat-icon>
|
||||||
Nicht relevant
|
Nicht relevant
|
||||||
</span>
|
</span>
|
||||||
} @else {
|
} @else {
|
||||||
<span class="relevance-badge undetermined">
|
<span class="relevance-badge undetermined">
|
||||||
<mat-icon>help</mat-icon>
|
<mat-icon>{{ HELP_ICON }}</mat-icon>
|
||||||
Relevanz nicht bestimmt
|
Relevanz nicht bestimmt
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
[href]="article.url"
|
[href]="article.url"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener">
|
rel="noopener">
|
||||||
<mat-icon>open_in_new</mat-icon>
|
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
|
||||||
Originalartikel öffnen
|
Originalartikel öffnen
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -87,14 +87,14 @@
|
|||||||
class="accordion-header"
|
class="accordion-header"
|
||||||
(click)="openPanel = openPanel === 'persons' ? null : 'persons'"
|
(click)="openPanel = openPanel === 'persons' ? null : 'persons'"
|
||||||
[attr.aria-expanded]="openPanel === 'persons'">
|
[attr.aria-expanded]="openPanel === 'persons'">
|
||||||
<mat-icon>group</mat-icon>
|
<mat-icon>{{ GROUP_ICON }}</mat-icon>
|
||||||
<span class="accordion-title">Erwähnte Personen</span>
|
<span class="accordion-title">Erwähnte Personen</span>
|
||||||
<mat-icon
|
<mat-icon
|
||||||
class="info-icon"
|
class="info-icon"
|
||||||
matTooltip="Personen, die im Text erwähnt wurden. Klicke auf eine der UDE angehörige Person, um zu ihrem Profil zu gelangen."
|
matTooltip="Personen, die im Text erwähnt wurden. Klicke auf eine der UDE angehörige Person, um zu ihrem Profil zu gelangen."
|
||||||
matTooltipPosition="above"
|
matTooltipPosition="above"
|
||||||
(click)="$event.stopPropagation()"
|
(click)="$event.stopPropagation()"
|
||||||
>info_outline</mat-icon
|
>{{ INFO_OUTLINE_ICON }}</mat-icon
|
||||||
>
|
>
|
||||||
@if (article.authors?.length) {
|
@if (article.authors?.length) {
|
||||||
<span class="count-badge">{{ article.authors!.length }}</span>
|
<span class="count-badge">{{ article.authors!.length }}</span>
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
<mat-icon
|
<mat-icon
|
||||||
class="chevron"
|
class="chevron"
|
||||||
[class.rotated]="openPanel !== 'persons'"
|
[class.rotated]="openPanel !== 'persons'"
|
||||||
>expand_more</mat-icon
|
>{{ EXPAND_MORE_ICON }}</mat-icon
|
||||||
>
|
>
|
||||||
</button>
|
</button>
|
||||||
@if (openPanel === 'persons') {
|
@if (openPanel === 'persons') {
|
||||||
@@ -141,7 +141,7 @@
|
|||||||
class="page-btn"
|
class="page-btn"
|
||||||
[disabled]="personsPage === 0"
|
[disabled]="personsPage === 0"
|
||||||
(click)="personsPage = personsPage - 1">
|
(click)="personsPage = personsPage - 1">
|
||||||
<mat-icon>chevron_left</mat-icon>
|
<mat-icon>{{ CHEVRON_LEFT_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<span class="page-indicator"
|
<span class="page-indicator"
|
||||||
>{{ personsPage + 1 }} / {{ personsPageCount }}</span
|
>{{ personsPage + 1 }} / {{ personsPageCount }}</span
|
||||||
@@ -151,7 +151,7 @@
|
|||||||
class="page-btn"
|
class="page-btn"
|
||||||
[disabled]="personsPage === personsPageCount - 1"
|
[disabled]="personsPage === personsPageCount - 1"
|
||||||
(click)="personsPage = personsPage + 1">
|
(click)="personsPage = personsPage + 1">
|
||||||
<mat-icon>chevron_right</mat-icon>
|
<mat-icon>{{ CHEVRON_RIGHT_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@@ -170,20 +170,22 @@
|
|||||||
class="accordion-header"
|
class="accordion-header"
|
||||||
(click)="openPanel = openPanel === 'topics' ? null : 'topics'"
|
(click)="openPanel = openPanel === 'topics' ? null : 'topics'"
|
||||||
[attr.aria-expanded]="openPanel === 'topics'">
|
[attr.aria-expanded]="openPanel === 'topics'">
|
||||||
<mat-icon>label</mat-icon>
|
<mat-icon>{{ LABEL_ICON }}</mat-icon>
|
||||||
<span class="accordion-title">Themen & Schlüsselwörter</span>
|
<span class="accordion-title">Themen & Schlüsselwörter</span>
|
||||||
<mat-icon
|
<mat-icon
|
||||||
class="info-icon"
|
class="info-icon"
|
||||||
matTooltip="Themen, die mit den extrahierten Schlüsselwörtern des Artikels assoziiert werden. Klicke auf ein Schlüsselwort, um zum hervorgehobenen Begriff im Text zu springen."
|
matTooltip="Themen, die mit den extrahierten Schlüsselwörtern des Artikels assoziiert werden. Klicke auf ein Schlüsselwort, um zum hervorgehobenen Begriff im Text zu springen."
|
||||||
matTooltipPosition="above"
|
matTooltipPosition="above"
|
||||||
(click)="$event.stopPropagation()"
|
(click)="$event.stopPropagation()"
|
||||||
>info_outline</mat-icon
|
>{{ INFO_OUTLINE_ICON }}</mat-icon
|
||||||
>
|
>
|
||||||
@if (article.topics?.length) {
|
@if (article.topics?.length) {
|
||||||
<span class="count-badge">{{ article.topics!.length }}</span>
|
<span class="count-badge">{{ article.topics!.length }}</span>
|
||||||
}
|
}
|
||||||
<mat-icon class="chevron" [class.rotated]="openPanel !== 'topics'"
|
<mat-icon
|
||||||
>expand_more</mat-icon
|
class="chevron"
|
||||||
|
[class.rotated]="openPanel !== 'topics'"
|
||||||
|
>{{ EXPAND_MORE_ICON }}</mat-icon
|
||||||
>
|
>
|
||||||
</button>
|
</button>
|
||||||
@if (openPanel === 'topics') {
|
@if (openPanel === 'topics') {
|
||||||
@@ -207,8 +209,8 @@
|
|||||||
}}</span>
|
}}</span>
|
||||||
<mat-icon>{{
|
<mat-icon>{{
|
||||||
expandedTopicId === topic.id
|
expandedTopicId === topic.id
|
||||||
? 'expand_less'
|
? EXPAND_LESS_ICON
|
||||||
: 'expand_more'
|
: EXPAND_MORE_ICON
|
||||||
}}</mat-icon>
|
}}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
@if (expandedTopicId === topic.id) {
|
@if (expandedTopicId === topic.id) {
|
||||||
@@ -222,7 +224,7 @@
|
|||||||
class="analyse-btn"
|
class="analyse-btn"
|
||||||
matTooltip="Suche nach dem Schlüsselwort"
|
matTooltip="Suche nach dem Schlüsselwort"
|
||||||
(click)="analyseKeyword(topic.source_keyword)">
|
(click)="analyseKeyword(topic.source_keyword)">
|
||||||
<mat-icon>search</mat-icon>
|
<mat-icon>{{ SEARCH_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@@ -23,6 +23,23 @@ import {
|
|||||||
topicKeywordColors,
|
topicKeywordColors,
|
||||||
} from '../../resolvers/utils/keyword-highlight';
|
} from '../../resolvers/utils/keyword-highlight';
|
||||||
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
|
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
|
||||||
|
import {
|
||||||
|
ARROW_BACK_ICON,
|
||||||
|
CANCEL_ICON,
|
||||||
|
CHECK_CIRCLE_ICON,
|
||||||
|
CHEVRON_LEFT_ICON,
|
||||||
|
CHEVRON_RIGHT_ICON,
|
||||||
|
EXPAND_LESS_ICON,
|
||||||
|
EXPAND_MORE_ICON,
|
||||||
|
GROUP_ICON,
|
||||||
|
HELP_ICON,
|
||||||
|
INFO_OUTLINE_ICON,
|
||||||
|
LABEL_ICON,
|
||||||
|
NEWS_ICON,
|
||||||
|
OPEN_IN_NEW_ICON,
|
||||||
|
SEARCH_ICON,
|
||||||
|
SEARCH_OFF_ICON,
|
||||||
|
} from '../../shared/ui/icons';
|
||||||
|
|
||||||
interface MentionedPerson {
|
interface MentionedPerson {
|
||||||
name: string;
|
name: string;
|
||||||
@@ -66,6 +83,22 @@ interface NewsArticleDetail {
|
|||||||
styleUrl: './news-detail.component.scss',
|
styleUrl: './news-detail.component.scss',
|
||||||
})
|
})
|
||||||
export class NewsDetailComponent implements OnInit {
|
export class NewsDetailComponent implements OnInit {
|
||||||
|
readonly ARROW_BACK_ICON = ARROW_BACK_ICON;
|
||||||
|
readonly NEWS_ICON = NEWS_ICON;
|
||||||
|
readonly SEARCH_OFF_ICON = SEARCH_OFF_ICON;
|
||||||
|
readonly CHECK_CIRCLE_ICON = CHECK_CIRCLE_ICON;
|
||||||
|
readonly CANCEL_ICON = CANCEL_ICON;
|
||||||
|
readonly HELP_ICON = HELP_ICON;
|
||||||
|
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
|
||||||
|
readonly GROUP_ICON = GROUP_ICON;
|
||||||
|
readonly INFO_OUTLINE_ICON = INFO_OUTLINE_ICON;
|
||||||
|
readonly EXPAND_MORE_ICON = EXPAND_MORE_ICON;
|
||||||
|
readonly EXPAND_LESS_ICON = EXPAND_LESS_ICON;
|
||||||
|
readonly CHEVRON_LEFT_ICON = CHEVRON_LEFT_ICON;
|
||||||
|
readonly CHEVRON_RIGHT_ICON = CHEVRON_RIGHT_ICON;
|
||||||
|
readonly LABEL_ICON = LABEL_ICON;
|
||||||
|
readonly SEARCH_ICON = SEARCH_ICON;
|
||||||
|
|
||||||
@ViewChild('articleBody', { read: ElementRef })
|
@ViewChild('articleBody', { read: ElementRef })
|
||||||
articleBodyRef?: ElementRef<HTMLElement>;
|
articleBodyRef?: ElementRef<HTMLElement>;
|
||||||
private readonly router = inject(Router);
|
private readonly router = inject(Router);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
[options]="relevanceOptions"
|
[options]="relevanceOptions"
|
||||||
queryParamKey="relevance"
|
queryParamKey="relevance"
|
||||||
label="Relevanz"
|
label="Relevanz"
|
||||||
icon="check_circle"
|
[icon]="CHECK_CIRCLE_ICON"
|
||||||
[multiple]="true" />
|
[multiple]="true" />
|
||||||
|
|
||||||
@if (!isSearching()) {
|
@if (!isSearching()) {
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
[options]="sortingDirectionOptionsAll"
|
[options]="sortingDirectionOptionsAll"
|
||||||
queryParamKey="sorting_order"
|
queryParamKey="sorting_order"
|
||||||
label="Sortierung"
|
label="Sortierung"
|
||||||
icon="sort" />
|
[icon]="SORT_ICON" />
|
||||||
}
|
}
|
||||||
</app-filter-card>
|
</app-filter-card>
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import {
|
|||||||
} from '../../shared/ui/query-param-selector/query-param-selector.component';
|
} from '../../shared/ui/query-param-selector/query-param-selector.component';
|
||||||
import { FilterCardComponent } from '../../shared/ui/filter-card/filter-card.component';
|
import { FilterCardComponent } from '../../shared/ui/filter-card/filter-card.component';
|
||||||
import { YearRangeSliderComponent } from '../../shared/ui/year-range-slider/year-range-slider.component';
|
import { YearRangeSliderComponent } from '../../shared/ui/year-range-slider/year-range-slider.component';
|
||||||
|
import { CHECK_CIRCLE_ICON, SORT_ICON } from '../../shared/ui/icons';
|
||||||
|
|
||||||
interface NewsArticle extends NewsArticleBase {
|
interface NewsArticle extends NewsArticleBase {
|
||||||
author?: string | null;
|
author?: string | null;
|
||||||
@@ -56,6 +57,9 @@ type SortOrder = 'desc' | 'asc';
|
|||||||
styleUrl: './news.component.scss',
|
styleUrl: './news.component.scss',
|
||||||
})
|
})
|
||||||
export class NewsComponent implements OnInit {
|
export class NewsComponent implements OnInit {
|
||||||
|
readonly CHECK_CIRCLE_ICON = CHECK_CIRCLE_ICON;
|
||||||
|
readonly SORT_ICON = SORT_ICON;
|
||||||
|
|
||||||
private readonly destroyRef = inject(DestroyRef);
|
private readonly destroyRef = inject(DestroyRef);
|
||||||
private readonly route = inject(ActivatedRoute);
|
private readonly route = inject(ActivatedRoute);
|
||||||
private readonly router = inject(Router);
|
private readonly router = inject(Router);
|
||||||
|
|||||||
+4
-4
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
<mat-form-field appearance="outline" subscriptSizing="dynamic">
|
<mat-form-field appearance="outline" subscriptSizing="dynamic">
|
||||||
<mat-label>Institution hinzufügen</mat-label>
|
<mat-label>Institution hinzufügen</mat-label>
|
||||||
<mat-icon matPrefix>search</mat-icon>
|
<mat-icon matPrefix>{{ SEARCH_ICON }}</mat-icon>
|
||||||
<input
|
<input
|
||||||
matInput
|
matInput
|
||||||
type="text"
|
type="text"
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
<div class="institution-list" aria-live="polite">
|
<div class="institution-list" aria-live="polite">
|
||||||
@for (entry of institutions(); track entry.id) {
|
@for (entry of institutions(); track entry.id) {
|
||||||
<article class="institution-item">
|
<article class="institution-item">
|
||||||
<mat-icon class="institution-icon">apartment</mat-icon>
|
<mat-icon class="institution-icon">{{ APARTMENT_ICON }}</mat-icon>
|
||||||
<div class="institution-details">
|
<div class="institution-details">
|
||||||
<strong>{{ entry.institution.display_name }}</strong>
|
<strong>{{ entry.institution.display_name }}</strong>
|
||||||
<span class="institution-id">{{ entry.id }}</span>
|
<span class="institution-id">{{ entry.id }}</span>
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
type="button"
|
type="button"
|
||||||
aria-label="Manuelle Auswahl entfernen"
|
aria-label="Manuelle Auswahl entfernen"
|
||||||
(click)="removeInstitution(entry)">
|
(click)="removeInstitution(entry)">
|
||||||
<mat-icon>close</mat-icon>
|
<mat-icon>{{ CLOSE_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
</article>
|
</article>
|
||||||
@@ -112,7 +112,7 @@
|
|||||||
type="button"
|
type="button"
|
||||||
[disabled]="isLoadingAssociations()"
|
[disabled]="isLoadingAssociations()"
|
||||||
(click)="submit()">
|
(click)="submit()">
|
||||||
<mat-icon>save</mat-icon>
|
<mat-icon>{{ SAVE_ICON }}</mat-icon>
|
||||||
Speichern
|
Speichern
|
||||||
</button>
|
</button>
|
||||||
</mat-dialog-actions>
|
</mat-dialog-actions>
|
||||||
|
|||||||
+13
-1
@@ -44,6 +44,12 @@ import {
|
|||||||
UpdateOrganizationRequest,
|
UpdateOrganizationRequest,
|
||||||
} from '../../../api';
|
} from '../../../api';
|
||||||
import { InstitutionRemovalDialogComponent } from './institution-removal-dialog.component';
|
import { InstitutionRemovalDialogComponent } from './institution-removal-dialog.component';
|
||||||
|
import {
|
||||||
|
APARTMENT_ICON,
|
||||||
|
CLOSE_ICON,
|
||||||
|
SAVE_ICON,
|
||||||
|
SEARCH_ICON,
|
||||||
|
} from '../../../shared/ui/icons';
|
||||||
|
|
||||||
type Relationship = InstitutionAssociation.RelationshipEnum;
|
type Relationship = InstitutionAssociation.RelationshipEnum;
|
||||||
|
|
||||||
@@ -58,10 +64,11 @@ interface EditableInstitution {
|
|||||||
institution: Institution;
|
institution: Institution;
|
||||||
manuallySelected: boolean;
|
manuallySelected: boolean;
|
||||||
origins: InstitutionOrigin[];
|
origins: InstitutionOrigin[];
|
||||||
|
relationship?: Relationship;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OriginLabel {
|
interface OriginLabel {
|
||||||
relationship: 'selected' | Relationship;
|
relationship: Relationship | 'selected';
|
||||||
label: string;
|
label: string;
|
||||||
tooltip?: string;
|
tooltip?: string;
|
||||||
}
|
}
|
||||||
@@ -109,6 +116,11 @@ const cleanInstitutionId = (id: string): string =>
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class OrganizationDialogComponent {
|
export class OrganizationDialogComponent {
|
||||||
|
readonly SEARCH_ICON = SEARCH_ICON;
|
||||||
|
readonly APARTMENT_ICON = APARTMENT_ICON;
|
||||||
|
readonly CLOSE_ICON = CLOSE_ICON;
|
||||||
|
readonly SAVE_ICON = SAVE_ICON;
|
||||||
|
|
||||||
private readonly dialogRef =
|
private readonly dialogRef =
|
||||||
inject<
|
inject<
|
||||||
MatDialogRef<
|
MatDialogRef<
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
color="primary"
|
color="primary"
|
||||||
type="button"
|
type="button"
|
||||||
(click)="startCreate()">
|
(click)="startCreate()">
|
||||||
<mat-icon>add_business</mat-icon>
|
<mat-icon>{{ ADD_BUSINESS_ICON }}</mat-icon>
|
||||||
Neue Organisation
|
Neue Organisation
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
type="button"
|
type="button"
|
||||||
aria-label="Bearbeiten"
|
aria-label="Bearbeiten"
|
||||||
(click)="startEdit(row)">
|
(click)="startEdit(row)">
|
||||||
<mat-icon>edit</mat-icon>
|
<mat-icon>{{ EDIT_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
aria-label="Deaktivieren"
|
aria-label="Deaktivieren"
|
||||||
[disabled]="row.deleted || isCurrentOrganization(row)"
|
[disabled]="row.deleted || isCurrentOrganization(row)"
|
||||||
(click)="deleteOrganization(row)">
|
(click)="deleteOrganization(row)">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>{{ DELETE_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|||||||
@@ -30,6 +30,11 @@ import {
|
|||||||
OrganizationWithInstitutions,
|
OrganizationWithInstitutions,
|
||||||
} from '../../resolvers/organizations-organizations.resolver';
|
} from '../../resolvers/organizations-organizations.resolver';
|
||||||
import { CredentialService } from '../../shared/services/credential.service';
|
import { CredentialService } from '../../shared/services/credential.service';
|
||||||
|
import {
|
||||||
|
ADD_BUSINESS_ICON,
|
||||||
|
DELETE_ICON,
|
||||||
|
EDIT_ICON,
|
||||||
|
} from '../../shared/ui/icons';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-organizations',
|
selector: 'app-organizations',
|
||||||
@@ -49,6 +54,10 @@ import { CredentialService } from '../../shared/services/credential.service';
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class OrganizationsComponent implements OnInit {
|
export class OrganizationsComponent implements OnInit {
|
||||||
|
readonly ADD_BUSINESS_ICON = ADD_BUSINESS_ICON;
|
||||||
|
readonly EDIT_ICON = EDIT_ICON;
|
||||||
|
readonly DELETE_ICON = DELETE_ICON;
|
||||||
|
|
||||||
private readonly router = inject(Router);
|
private readonly router = inject(Router);
|
||||||
private readonly dialog = inject(MatDialog);
|
private readonly dialog = inject(MatDialog);
|
||||||
private readonly snackBar = inject(MatSnackBar);
|
private readonly snackBar = inject(MatSnackBar);
|
||||||
|
|||||||
@@ -4,19 +4,19 @@
|
|||||||
class="back-link"
|
class="back-link"
|
||||||
(click)="navigateBack()"
|
(click)="navigateBack()"
|
||||||
aria-label="Zurück zu den Patenten">
|
aria-label="Zurück zu den Patenten">
|
||||||
<mat-icon>arrow_back</mat-icon>
|
<mat-icon>{{ ARROW_BACK_ICON }}</mat-icon>
|
||||||
Alle Patente
|
Alle Patente
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@if (loading) {
|
@if (loading) {
|
||||||
<app-loading
|
<app-loading
|
||||||
text="Patent wird geladen..."
|
text="Patent wird geladen..."
|
||||||
icon="workspace_premium"
|
[icon]="PATENT_ICON"
|
||||||
[size]="60"
|
[size]="60"
|
||||||
[diameter]="60" />
|
[diameter]="60" />
|
||||||
} @else if (notFound || !patent) {
|
} @else if (notFound || !patent) {
|
||||||
<div class="state error-state">
|
<div class="state error-state">
|
||||||
<mat-icon>search_off</mat-icon>
|
<mat-icon>{{ SEARCH_OFF_ICON }}</mat-icon>
|
||||||
<h2>Patent nicht gefunden</h2>
|
<h2>Patent nicht gefunden</h2>
|
||||||
<p>Das Patent konnte nicht geladen werden.</p>
|
<p>Das Patent konnte nicht geladen werden.</p>
|
||||||
<a mat-stroked-button routerLink="/patents"> Zur Patentübersicht </a>
|
<a mat-stroked-button routerLink="/patents"> Zur Patentübersicht </a>
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener">
|
rel="noopener">
|
||||||
{{ link.label }}
|
{{ link.label }}
|
||||||
<mat-icon>open_in_new</mat-icon>
|
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@@ -63,17 +63,17 @@
|
|||||||
|
|
||||||
<div class="metrics" aria-label="Patentkennzahlen">
|
<div class="metrics" aria-label="Patentkennzahlen">
|
||||||
<div>
|
<div>
|
||||||
<mat-icon>groups</mat-icon>
|
<mat-icon>{{ GROUPS_ICON }}</mat-icon>
|
||||||
<strong>{{ patent.inventors?.length ?? 0 }}</strong>
|
<strong>{{ patent.inventors?.length ?? 0 }}</strong>
|
||||||
<span>Erfinder</span>
|
<span>Erfinder</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<mat-icon>business</mat-icon>
|
<mat-icon>{{ BUSINESS_ICON }}</mat-icon>
|
||||||
<strong>{{ patent.assignees?.length ?? 0 }}</strong>
|
<strong>{{ patent.assignees?.length ?? 0 }}</strong>
|
||||||
<span>Anmelder</span>
|
<span>Anmelder</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<mat-icon>category</mat-icon>
|
<mat-icon>{{ CATEGORY_ICON }}</mat-icon>
|
||||||
<strong>{{
|
<strong>{{
|
||||||
(patent.ipc?.length ?? 0) + (patent.cpc?.length ?? 0)
|
(patent.ipc?.length ?? 0) + (patent.cpc?.length ?? 0)
|
||||||
}}</strong>
|
}}</strong>
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
@if (patent.abstract) {
|
@if (patent.abstract) {
|
||||||
<section class="card abstract-card">
|
<section class="card abstract-card">
|
||||||
<div class="section-title">
|
<div class="section-title">
|
||||||
<mat-icon>subject</mat-icon>
|
<mat-icon>{{ SUBJECT_ICON }}</mat-icon>
|
||||||
<h2>Abstract</h2>
|
<h2>Abstract</h2>
|
||||||
</div>
|
</div>
|
||||||
<p>{{ patent.abstract }}</p>
|
<p>{{ patent.abstract }}</p>
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
|
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<div class="section-title">
|
<div class="section-title">
|
||||||
<mat-icon>engineering</mat-icon>
|
<mat-icon>{{ ENGINEERING_ICON }}</mat-icon>
|
||||||
<h2>Erfinder</h2>
|
<h2>Erfinder</h2>
|
||||||
<span>{{ patent.inventors?.length ?? 0 }}</span>
|
<span>{{ patent.inventors?.length ?? 0 }}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -112,7 +112,7 @@
|
|||||||
@if (patent.assignees?.length) {
|
@if (patent.assignees?.length) {
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<div class="section-title">
|
<div class="section-title">
|
||||||
<mat-icon>account_balance</mat-icon>
|
<mat-icon>{{ ACCOUNT_BALANCE_ICON }}</mat-icon>
|
||||||
<h2>Anmelder</h2>
|
<h2>Anmelder</h2>
|
||||||
<span>{{ patent.assignees?.length ?? 0 }}</span>
|
<span>{{ patent.assignees?.length ?? 0 }}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -129,7 +129,7 @@
|
|||||||
@if (patent.openalex_topics?.length) {
|
@if (patent.openalex_topics?.length) {
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<div class="section-title">
|
<div class="section-title">
|
||||||
<mat-icon>topic</mat-icon>
|
<mat-icon>{{ TOPIC_ICON }}</mat-icon>
|
||||||
<h2>OpenAlex Themen</h2>
|
<h2>OpenAlex Themen</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="tags">
|
<div class="tags">
|
||||||
@@ -154,7 +154,7 @@
|
|||||||
<section
|
<section
|
||||||
class="card classification-card-section classification-card-section--ipc">
|
class="card classification-card-section classification-card-section--ipc">
|
||||||
<div class="section-title">
|
<div class="section-title">
|
||||||
<mat-icon>label</mat-icon>
|
<mat-icon>{{ LABEL_ICON }}</mat-icon>
|
||||||
<h2>Klassifikation (IPC)</h2>
|
<h2>Klassifikation (IPC)</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="classification-cards">
|
<div class="classification-cards">
|
||||||
@@ -228,7 +228,7 @@
|
|||||||
} @else if (patent.ipc?.length) {
|
} @else if (patent.ipc?.length) {
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<div class="section-title">
|
<div class="section-title">
|
||||||
<mat-icon>label</mat-icon>
|
<mat-icon>{{ LABEL_ICON }}</mat-icon>
|
||||||
<h2>Klassifikation (IPC)</h2>
|
<h2>Klassifikation (IPC)</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="tags">
|
<div class="tags">
|
||||||
@@ -243,7 +243,7 @@
|
|||||||
<section
|
<section
|
||||||
class="card classification-card-section classification-card-section--cpc">
|
class="card classification-card-section classification-card-section--cpc">
|
||||||
<div class="section-title">
|
<div class="section-title">
|
||||||
<mat-icon>label</mat-icon>
|
<mat-icon>{{ LABEL_ICON }}</mat-icon>
|
||||||
<h2>Klassifikation (CPC)</h2>
|
<h2>Klassifikation (CPC)</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="classification-cards">
|
<div class="classification-cards">
|
||||||
@@ -317,7 +317,7 @@
|
|||||||
} @else if (patent.cpc?.length) {
|
} @else if (patent.cpc?.length) {
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<div class="section-title">
|
<div class="section-title">
|
||||||
<mat-icon>label</mat-icon>
|
<mat-icon>{{ LABEL_ICON }}</mat-icon>
|
||||||
<h2>Klassifikation (CPC)</h2>
|
<h2>Klassifikation (CPC)</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="tags">
|
<div class="tags">
|
||||||
@@ -332,7 +332,7 @@
|
|||||||
<aside>
|
<aside>
|
||||||
<section class="card facts-card">
|
<section class="card facts-card">
|
||||||
<div class="section-title">
|
<div class="section-title">
|
||||||
<mat-icon>info</mat-icon>
|
<mat-icon>{{ INFO_ICON }}</mat-icon>
|
||||||
<h2>Patentdaten</h2>
|
<h2>Patentdaten</h2>
|
||||||
</div>
|
</div>
|
||||||
<dl>
|
<dl>
|
||||||
@@ -359,14 +359,14 @@
|
|||||||
@if (externalLinks().length) {
|
@if (externalLinks().length) {
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<div class="section-title">
|
<div class="section-title">
|
||||||
<mat-icon>link</mat-icon>
|
<mat-icon>{{ LINK_ICON }}</mat-icon>
|
||||||
<h2>Externe Links</h2>
|
<h2>Externe Links</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="link-list">
|
<div class="link-list">
|
||||||
@for (link of externalLinks(); track link.url) {
|
@for (link of externalLinks(); track link.url) {
|
||||||
<a [href]="link.url" target="_blank" rel="noopener">
|
<a [href]="link.url" target="_blank" rel="noopener">
|
||||||
<span>{{ link.label }}</span>
|
<span>{{ link.label }}</span>
|
||||||
<mat-icon>north_east</mat-icon>
|
<mat-icon>{{ NORTH_EAST_ICON }}</mat-icon>
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -15,6 +15,23 @@ import {
|
|||||||
topicHierarchyColor,
|
topicHierarchyColor,
|
||||||
} from '../../resolvers/utils/topic-colors';
|
} from '../../resolvers/utils/topic-colors';
|
||||||
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
|
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
|
||||||
|
import {
|
||||||
|
ACCOUNT_BALANCE_ICON,
|
||||||
|
ARROW_BACK_ICON,
|
||||||
|
BUSINESS_ICON,
|
||||||
|
CATEGORY_ICON,
|
||||||
|
ENGINEERING_ICON,
|
||||||
|
GROUPS_ICON,
|
||||||
|
INFO_ICON,
|
||||||
|
LABEL_ICON,
|
||||||
|
LINK_ICON,
|
||||||
|
NORTH_EAST_ICON,
|
||||||
|
OPEN_IN_NEW_ICON,
|
||||||
|
PATENT_ICON,
|
||||||
|
SEARCH_OFF_ICON,
|
||||||
|
SUBJECT_ICON,
|
||||||
|
TOPIC_ICON,
|
||||||
|
} from '../../shared/ui/icons';
|
||||||
import {
|
import {
|
||||||
ClassificationCard,
|
ClassificationCard,
|
||||||
ClassificationSystem,
|
ClassificationSystem,
|
||||||
@@ -40,6 +57,22 @@ import {
|
|||||||
styleUrl: './patent-detail.component.scss',
|
styleUrl: './patent-detail.component.scss',
|
||||||
})
|
})
|
||||||
export class PatentDetailComponent implements OnInit {
|
export class PatentDetailComponent implements OnInit {
|
||||||
|
readonly ARROW_BACK_ICON = ARROW_BACK_ICON;
|
||||||
|
readonly PATENT_ICON = PATENT_ICON;
|
||||||
|
readonly SEARCH_OFF_ICON = SEARCH_OFF_ICON;
|
||||||
|
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
|
||||||
|
readonly GROUPS_ICON = GROUPS_ICON;
|
||||||
|
readonly BUSINESS_ICON = BUSINESS_ICON;
|
||||||
|
readonly CATEGORY_ICON = CATEGORY_ICON;
|
||||||
|
readonly SUBJECT_ICON = SUBJECT_ICON;
|
||||||
|
readonly ENGINEERING_ICON = ENGINEERING_ICON;
|
||||||
|
readonly ACCOUNT_BALANCE_ICON = ACCOUNT_BALANCE_ICON;
|
||||||
|
readonly TOPIC_ICON = TOPIC_ICON;
|
||||||
|
readonly LABEL_ICON = LABEL_ICON;
|
||||||
|
readonly INFO_ICON = INFO_ICON;
|
||||||
|
readonly LINK_ICON = LINK_ICON;
|
||||||
|
readonly NORTH_EAST_ICON = NORTH_EAST_ICON;
|
||||||
|
|
||||||
private readonly destroyRef = inject(DestroyRef);
|
private readonly destroyRef = inject(DestroyRef);
|
||||||
private readonly route = inject(ActivatedRoute);
|
private readonly route = inject(ActivatedRoute);
|
||||||
private readonly patentsService = inject(PatentsService);
|
private readonly patentsService = inject(PatentsService);
|
||||||
|
|||||||
@@ -3,13 +3,7 @@
|
|||||||
|
|
||||||
<mat-divider />
|
<mat-divider />
|
||||||
|
|
||||||
@if (loading) {
|
@if (error) {
|
||||||
<app-loading
|
|
||||||
text="Patentdaten werden geladen..."
|
|
||||||
icon="workspace_premium"
|
|
||||||
[size]="150"
|
|
||||||
[diameter]="150" />
|
|
||||||
} @else if (error) {
|
|
||||||
<p class="state-message error">Fehler beim Laden der Patente.</p>
|
<p class="state-message error">Fehler beim Laden der Patente.</p>
|
||||||
} @else if (showDetail && selectedPatent) {
|
} @else if (showDetail && selectedPatent) {
|
||||||
<div class="detail-view">
|
<div class="detail-view">
|
||||||
@@ -261,6 +255,7 @@
|
|||||||
</div>
|
</div>
|
||||||
} @else {
|
} @else {
|
||||||
<app-card-search
|
<app-card-search
|
||||||
|
[loading]="loading"
|
||||||
[page]="cardSearchPage()"
|
[page]="cardSearchPage()"
|
||||||
[cardTmp]="cardTmp"
|
[cardTmp]="cardTmp"
|
||||||
[additionalFiltersTmp]="filtersTmp"
|
[additionalFiltersTmp]="filtersTmp"
|
||||||
@@ -329,7 +324,7 @@
|
|||||||
mat-button
|
mat-button
|
||||||
type="button"
|
type="button"
|
||||||
(click)="selectPatent(patent); $event.stopPropagation()">
|
(click)="selectPatent(patent); $event.stopPropagation()">
|
||||||
<mat-icon>info</mat-icon>
|
<mat-icon>{{ INFO_ICON }}</mat-icon>
|
||||||
Übersicht
|
Übersicht
|
||||||
</button>
|
</button>
|
||||||
</mat-card-actions>
|
</mat-card-actions>
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import { PatentEntry } from '../../api/model/patentEntry';
|
|||||||
import { IpcClassification } from '../../api';
|
import { IpcClassification } from '../../api';
|
||||||
import { OpenAlexTopicTag } from '../../api/model/openAlexTopicTag';
|
import { OpenAlexTopicTag } from '../../api/model/openAlexTopicTag';
|
||||||
import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component';
|
import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component';
|
||||||
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
|
|
||||||
import { YearRangeSliderComponent } from '../../shared/ui/year-range-slider/year-range-slider.component';
|
import { YearRangeSliderComponent } from '../../shared/ui/year-range-slider/year-range-slider.component';
|
||||||
import {
|
import {
|
||||||
classificationSectionColor,
|
classificationSectionColor,
|
||||||
@@ -23,6 +22,7 @@ import {
|
|||||||
Page,
|
Page,
|
||||||
} from '../../shared/ui/card-search/card-search.component';
|
} from '../../shared/ui/card-search/card-search.component';
|
||||||
import { FilterCardComponent } from '../../shared/ui/filter-card/filter-card.component';
|
import { FilterCardComponent } from '../../shared/ui/filter-card/filter-card.component';
|
||||||
|
import { INFO_ICON, PATENT_ICON } from '../../shared/ui/icons';
|
||||||
|
|
||||||
type PatentSource = 'EPO' | 'USPTO';
|
type PatentSource = 'EPO' | 'USPTO';
|
||||||
|
|
||||||
@@ -52,7 +52,6 @@ const MIN_YEAR = 1978;
|
|||||||
MatChipsModule,
|
MatChipsModule,
|
||||||
MatDividerModule,
|
MatDividerModule,
|
||||||
TopicChipComponent,
|
TopicChipComponent,
|
||||||
LoadingComponent,
|
|
||||||
YearRangeSliderComponent,
|
YearRangeSliderComponent,
|
||||||
CardSearchComponent,
|
CardSearchComponent,
|
||||||
FilterCardComponent,
|
FilterCardComponent,
|
||||||
@@ -61,6 +60,9 @@ const MIN_YEAR = 1978;
|
|||||||
styleUrl: './patents.component.scss',
|
styleUrl: './patents.component.scss',
|
||||||
})
|
})
|
||||||
export class PatentsComponent {
|
export class PatentsComponent {
|
||||||
|
readonly PATENT_ICON = PATENT_ICON;
|
||||||
|
readonly INFO_ICON = INFO_ICON;
|
||||||
|
|
||||||
private router = inject(Router);
|
private router = inject(Router);
|
||||||
private route = inject(ActivatedRoute);
|
private route = inject(ActivatedRoute);
|
||||||
private patentsApi = inject(PatentsService);
|
private patentsApi = inject(PatentsService);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
isBookmarked() ? 'Bookmark entfernen' : 'Person speichern'
|
isBookmarked() ? 'Bookmark entfernen' : 'Person speichern'
|
||||||
">
|
">
|
||||||
<mat-icon>{{
|
<mat-icon>{{
|
||||||
isBookmarked() ? 'bookmark' : 'bookmark_border'
|
isBookmarked() ? BOOKMARK_ICON : BOOKMARK_BORDER_ICON
|
||||||
}}</mat-icon>
|
}}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
"
|
"
|
||||||
>apartment</mat-icon
|
>{{ APARTMENT_ICON }}</mat-icon
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
[skText]="loading()"
|
[skText]="loading()"
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
class="institution-open-icon"
|
class="institution-open-icon"
|
||||||
(click)="openInstitutionPage($event)"
|
(click)="openInstitutionPage($event)"
|
||||||
aria-label="Institutionsseite öffnen"
|
aria-label="Institutionsseite öffnen"
|
||||||
>open_in_new</mat-icon
|
>{{ OPEN_IN_NEW_ICON }}</mat-icon
|
||||||
>
|
>
|
||||||
}
|
}
|
||||||
</button>
|
</button>
|
||||||
@@ -124,17 +124,17 @@
|
|||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
<div class="action-buttons">
|
<div class="action-buttons">
|
||||||
<a [routerLink]="['/person', person().id, 'overview']" class="action-btn">
|
<a [routerLink]="['/person', person().id, 'overview']" class="action-btn">
|
||||||
<mat-icon>visibility</mat-icon>
|
<mat-icon>{{ OVERVIEW_ICON }}</mat-icon>
|
||||||
<span>Übersicht</span>
|
<span>Übersicht</span>
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
[routerLink]="['/person', person().id, 'publications']"
|
[routerLink]="['/person', person().id, 'publications']"
|
||||||
class="action-btn">
|
class="action-btn">
|
||||||
<mat-icon>menu_book</mat-icon>
|
<mat-icon>{{ PUBLICATION_ICON }}</mat-icon>
|
||||||
<span>Publikationen</span>
|
<span>Publikationen</span>
|
||||||
</a>
|
</a>
|
||||||
<a [routerLink]="['/person', person().id, 'network']" class="action-btn">
|
<a [routerLink]="['/person', person().id, 'network']" class="action-btn">
|
||||||
<mat-icon>share</mat-icon>
|
<mat-icon>{{ NETWORK_ICON }}</mat-icon>
|
||||||
<span>Netzwerk</span>
|
<span>Netzwerk</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,6 +9,15 @@ import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.compon
|
|||||||
import { CountryFlagComponent } from '../../shared/ui/country-flag/country-flag.component';
|
import { CountryFlagComponent } from '../../shared/ui/country-flag/country-flag.component';
|
||||||
import { CareerStageChipComponent } from '../../shared/ui/career-stage-chip/career-stage-chip.component';
|
import { CareerStageChipComponent } from '../../shared/ui/career-stage-chip/career-stage-chip.component';
|
||||||
import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
|
import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
|
||||||
|
import {
|
||||||
|
APARTMENT_ICON,
|
||||||
|
BOOKMARK_BORDER_ICON,
|
||||||
|
BOOKMARK_ICON,
|
||||||
|
NETWORK_ICON,
|
||||||
|
OPEN_IN_NEW_ICON,
|
||||||
|
OVERVIEW_ICON,
|
||||||
|
PUBLICATION_ICON,
|
||||||
|
} from '../../shared/ui/icons';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-person-card',
|
selector: 'app-person-card',
|
||||||
@@ -27,6 +36,14 @@ import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
|
|||||||
styleUrl: './person-card.component.scss',
|
styleUrl: './person-card.component.scss',
|
||||||
})
|
})
|
||||||
export class PersonCardComponent {
|
export class PersonCardComponent {
|
||||||
|
readonly BOOKMARK_ICON = BOOKMARK_ICON;
|
||||||
|
readonly BOOKMARK_BORDER_ICON = BOOKMARK_BORDER_ICON;
|
||||||
|
readonly APARTMENT_ICON = APARTMENT_ICON;
|
||||||
|
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
|
||||||
|
readonly OVERVIEW_ICON = OVERVIEW_ICON;
|
||||||
|
readonly PUBLICATION_ICON = PUBLICATION_ICON;
|
||||||
|
readonly NETWORK_ICON = NETWORK_ICON;
|
||||||
|
|
||||||
private readonly router = inject(Router);
|
private readonly router = inject(Router);
|
||||||
|
|
||||||
person = input.required<CustomAuthor>();
|
person = input.required<CustomAuthor>();
|
||||||
|
|||||||
+10
-12
@@ -1,7 +1,7 @@
|
|||||||
@if (loading) {
|
@if (loading) {
|
||||||
<app-loading
|
<app-loading
|
||||||
text="Verbindungen zu Unternehmen werden geladen ..."
|
text="Verbindungen zu Unternehmen werden geladen ..."
|
||||||
icon="business"
|
[icon]="BUSINESS_ICON"
|
||||||
[size]="60"
|
[size]="60"
|
||||||
[diameter]="60" />
|
[diameter]="60" />
|
||||||
} @else if (error) {
|
} @else if (error) {
|
||||||
@@ -55,9 +55,9 @@
|
|||||||
? 'Weitere Registerpersonen ausblenden'
|
? 'Weitere Registerpersonen ausblenden'
|
||||||
: 'Weitere Registerpersonen anzeigen'
|
: 'Weitere Registerpersonen anzeigen'
|
||||||
">
|
">
|
||||||
<mat-icon class="graph-related-persons-icon">
|
<mat-icon class="graph-related-persons-icon">{{
|
||||||
{{ showRelatedPersons ? 'no_accounts' : 'account_circle' }}
|
showRelatedPersons ? NO_ACCOUNTS_ICON : ACCOUNT_CIRCLE_ICON
|
||||||
</mat-icon>
|
}}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
@@ -189,13 +189,11 @@
|
|||||||
relatedOfficers.length
|
relatedOfficers.length
|
||||||
}})
|
}})
|
||||||
</span>
|
</span>
|
||||||
<mat-icon>
|
<mat-icon>{{
|
||||||
{{
|
isCompanyOfficersExpanded(connection)
|
||||||
isCompanyOfficersExpanded(connection)
|
? EXPAND_LESS_ICON
|
||||||
? 'expand_less'
|
: EXPAND_MORE_ICON
|
||||||
: 'expand_more'
|
}}</mat-icon>
|
||||||
}}
|
|
||||||
</mat-icon>
|
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@if (isCompanyOfficersExpanded(connection)) {
|
@if (isCompanyOfficersExpanded(connection)) {
|
||||||
@@ -243,7 +241,7 @@
|
|||||||
relatedOfficer.name +
|
relatedOfficer.name +
|
||||||
' öffnen'
|
' öffnen'
|
||||||
">
|
">
|
||||||
<mat-icon>open_in_new</mat-icon>
|
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
|
||||||
</a>
|
</a>
|
||||||
} @else {
|
} @else {
|
||||||
<span class="officer-open-placeholder"></span>
|
<span class="officer-open-placeholder"></span>
|
||||||
|
|||||||
+15
@@ -27,6 +27,14 @@ import {
|
|||||||
import { PersonDataResolved } from '../../resolvers/person.resolver';
|
import { PersonDataResolved } from '../../resolvers/person.resolver';
|
||||||
import { ChartThemeService } from '../../shared/services/chart-theme.service';
|
import { ChartThemeService } from '../../shared/services/chart-theme.service';
|
||||||
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
|
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
|
||||||
|
import {
|
||||||
|
ACCOUNT_CIRCLE_ICON,
|
||||||
|
BUSINESS_ICON,
|
||||||
|
EXPAND_LESS_ICON,
|
||||||
|
EXPAND_MORE_ICON,
|
||||||
|
NO_ACCOUNTS_ICON,
|
||||||
|
OPEN_IN_NEW_ICON,
|
||||||
|
} from '../../shared/ui/icons';
|
||||||
|
|
||||||
interface RoleLegendItem {
|
interface RoleLegendItem {
|
||||||
role: string;
|
role: string;
|
||||||
@@ -57,6 +65,13 @@ interface GraphSymbols {
|
|||||||
styleUrl: './person-company-connections.component.scss',
|
styleUrl: './person-company-connections.component.scss',
|
||||||
})
|
})
|
||||||
export class PersonCompanyConnectionsComponent implements OnInit {
|
export class PersonCompanyConnectionsComponent implements OnInit {
|
||||||
|
readonly BUSINESS_ICON = BUSINESS_ICON;
|
||||||
|
readonly NO_ACCOUNTS_ICON = NO_ACCOUNTS_ICON;
|
||||||
|
readonly ACCOUNT_CIRCLE_ICON = ACCOUNT_CIRCLE_ICON;
|
||||||
|
readonly EXPAND_LESS_ICON = EXPAND_LESS_ICON;
|
||||||
|
readonly EXPAND_MORE_ICON = EXPAND_MORE_ICON;
|
||||||
|
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
|
||||||
|
|
||||||
private readonly route = inject(ActivatedRoute);
|
private readonly route = inject(ActivatedRoute);
|
||||||
private readonly router = inject(Router);
|
private readonly router = inject(Router);
|
||||||
private readonly destroyRef = inject(DestroyRef);
|
private readonly destroyRef = inject(DestroyRef);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
@if (loading) {
|
@if (loading) {
|
||||||
<app-loading
|
<app-loading
|
||||||
text="Förderdaten werden geladen..."
|
text="Förderdaten werden geladen..."
|
||||||
icon="volunteer_activism"
|
[icon]="VOLUNTEER_ACTIVISM_ICON"
|
||||||
[size]="150"
|
[size]="150"
|
||||||
[diameter]="150" />
|
[diameter]="150" />
|
||||||
} @else if (error) {
|
} @else if (error) {
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<mat-form-field
|
<mat-form-field
|
||||||
class="funding-toolbar-field"
|
class="funding-toolbar-field"
|
||||||
subscriptSizing="dynamic">
|
subscriptSizing="dynamic">
|
||||||
<mat-icon matPrefix fontIcon="filter_alt"></mat-icon>
|
<mat-icon matPrefix [fontIcon]="FILTER_ICON"></mat-icon>
|
||||||
<mat-select
|
<mat-select
|
||||||
[value]="activeFilter"
|
[value]="activeFilter"
|
||||||
(selectionChange)="setFilter($event.value)">
|
(selectionChange)="setFilter($event.value)">
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
<mat-form-field
|
<mat-form-field
|
||||||
class="funding-toolbar-field"
|
class="funding-toolbar-field"
|
||||||
subscriptSizing="dynamic">
|
subscriptSizing="dynamic">
|
||||||
<mat-icon matPrefix fontIcon="sort"></mat-icon>
|
<mat-icon matPrefix [fontIcon]="SORT_ICON"></mat-icon>
|
||||||
<mat-select
|
<mat-select
|
||||||
[value]="sortColumn"
|
[value]="sortColumn"
|
||||||
(selectionChange)="setSort($event.value)">
|
(selectionChange)="setSort($event.value)">
|
||||||
@@ -137,7 +137,7 @@
|
|||||||
returnUrl: getCurrentUrl(),
|
returnUrl: getCurrentUrl(),
|
||||||
returnLabel: 'Förderungen',
|
returnLabel: 'Förderungen',
|
||||||
}">
|
}">
|
||||||
<span class="material-icons">open_in_new</span>
|
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
import { Component, OnInit, TemplateRef, inject, viewChild } from '@angular/core';
|
import {
|
||||||
|
Component,
|
||||||
|
OnInit,
|
||||||
|
TemplateRef,
|
||||||
|
inject,
|
||||||
|
viewChild,
|
||||||
|
} from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { ActivatedRoute, RouterLink } from '@angular/router';
|
import { ActivatedRoute, RouterLink } from '@angular/router';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
@@ -14,6 +20,12 @@ import {
|
|||||||
DataTableComponent,
|
DataTableComponent,
|
||||||
GenericColumn,
|
GenericColumn,
|
||||||
} from '../../shared/ui/data-table/data-table.component';
|
} from '../../shared/ui/data-table/data-table.component';
|
||||||
|
import {
|
||||||
|
FILTER_ICON,
|
||||||
|
OPEN_IN_NEW_ICON,
|
||||||
|
SORT_ICON,
|
||||||
|
VOLUNTEER_ACTIVISM_ICON,
|
||||||
|
} from '../../shared/ui/icons';
|
||||||
|
|
||||||
type SortColumn = 'name' | 'publications' | 'first' | 'middle' | 'last';
|
type SortColumn = 'name' | 'publications' | 'first' | 'middle' | 'last';
|
||||||
type SortDirection = 'asc' | 'desc';
|
type SortDirection = 'asc' | 'desc';
|
||||||
@@ -43,6 +55,11 @@ type FundingPublicationDetail = {
|
|||||||
styleUrl: './person-funding.component.scss',
|
styleUrl: './person-funding.component.scss',
|
||||||
})
|
})
|
||||||
export class PersonFundingComponent implements OnInit {
|
export class PersonFundingComponent implements OnInit {
|
||||||
|
readonly VOLUNTEER_ACTIVISM_ICON = VOLUNTEER_ACTIVISM_ICON;
|
||||||
|
readonly FILTER_ICON = FILTER_ICON;
|
||||||
|
readonly SORT_ICON = SORT_ICON;
|
||||||
|
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
|
||||||
|
|
||||||
private route = inject(ActivatedRoute);
|
private route = inject(ActivatedRoute);
|
||||||
private router = inject(Router);
|
private router = inject(Router);
|
||||||
private fundingApi = inject(FundingService);
|
private fundingApi = inject(FundingService);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<h3>Interessant für</h3>
|
<h3>Interessant für</h3>
|
||||||
@if (tags().length > 0) {
|
@if (tags().length > 0) {
|
||||||
<span class="interest-footnote">
|
<span class="interest-footnote">
|
||||||
<mat-icon class="footnote-icon">article</mat-icon>
|
<mat-icon class="footnote-icon">{{ ARTICLE_ICON }}</mat-icon>
|
||||||
Anzahl Publikationen zum Thema
|
Anzahl Publikationen zum Thema
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
<div class="interest-tags-loading" aria-live="polite">
|
<div class="interest-tags-loading" aria-live="polite">
|
||||||
<app-loading
|
<app-loading
|
||||||
text="Themen werden geladen ..."
|
text="Themen werden geladen ..."
|
||||||
icon="interests"
|
[icon]="INTERESTS_ICON"
|
||||||
[size]="48"
|
[size]="48"
|
||||||
[diameter]="48" />
|
[diameter]="48" />
|
||||||
</div>
|
</div>
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
[secondaryActionLabel]="tagAction(tag)?.label ?? null"
|
[secondaryActionLabel]="tagAction(tag)?.label ?? null"
|
||||||
[secondaryActionLink]="tagAction(tag)?.link ?? null"
|
[secondaryActionLink]="tagAction(tag)?.link ?? null"
|
||||||
[secondaryActionQueryParams]="tagAction(tag)?.queryParams ?? null"
|
[secondaryActionQueryParams]="tagAction(tag)?.queryParams ?? null"
|
||||||
countIcon="article"
|
[countIcon]="ARTICLE_ICON"
|
||||||
descriptionTooltipTarget="button"
|
descriptionTooltipTarget="button"
|
||||||
(chipClick)="onTagClick(tag)">
|
(chipClick)="onTagClick(tag)">
|
||||||
</app-topic-chip>
|
</app-topic-chip>
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ import {
|
|||||||
toggleTopicLegendSubfieldSelection,
|
toggleTopicLegendSubfieldSelection,
|
||||||
} from '../../resolvers/utils/topic-legend';
|
} from '../../resolvers/utils/topic-legend';
|
||||||
|
|
||||||
|
import { ARTICLE_ICON, INTERESTS_ICON } from '../../shared/ui/icons';
|
||||||
|
|
||||||
interface InterestTag {
|
interface InterestTag {
|
||||||
id: string;
|
id: string;
|
||||||
label: string;
|
label: string;
|
||||||
@@ -67,6 +69,9 @@ const MAX_TAGS = 5;
|
|||||||
styleUrl: './person-interesting.component.scss',
|
styleUrl: './person-interesting.component.scss',
|
||||||
})
|
})
|
||||||
export class PersonInterestingComponent implements OnInit {
|
export class PersonInterestingComponent implements OnInit {
|
||||||
|
readonly ARTICLE_ICON = ARTICLE_ICON;
|
||||||
|
readonly INTERESTS_ICON = INTERESTS_ICON;
|
||||||
|
|
||||||
private static readonly legendExpandedQueryParam =
|
private static readonly legendExpandedQueryParam =
|
||||||
'interesting_legend_expanded';
|
'interesting_legend_expanded';
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
(click)="clearSearch()"
|
(click)="clearSearch()"
|
||||||
matTooltip="Suche zurücksetzen"
|
matTooltip="Suche zurücksetzen"
|
||||||
aria-label="Suche zurücksetzen">
|
aria-label="Suche zurücksetzen">
|
||||||
<mat-icon>close</mat-icon>
|
<mat-icon>{{ CLOSE_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@@ -44,7 +44,9 @@
|
|||||||
[appComponentTooltip]="AppTopicTooltipComponent"
|
[appComponentTooltip]="AppTopicTooltipComponent"
|
||||||
[tooltipInputs]="getFilterTopicInputs(filter.value)"
|
[tooltipInputs]="getFilterTopicInputs(filter.value)"
|
||||||
[tooltipMaxWidth]="'500px'">
|
[tooltipMaxWidth]="'500px'">
|
||||||
<mat-icon class="filter-topic-chip__icon">label</mat-icon>
|
<mat-icon class="filter-topic-chip__icon">{{
|
||||||
|
LABEL_ICON
|
||||||
|
}}</mat-icon>
|
||||||
<span class="filter-topic-chip__label">{{
|
<span class="filter-topic-chip__label">{{
|
||||||
filter.value
|
filter.value
|
||||||
}}</span>
|
}}</span>
|
||||||
@@ -56,15 +58,15 @@
|
|||||||
[attr.aria-label]="
|
[attr.aria-label]="
|
||||||
'Themenfilter ' + filter.value + ' entfernen'
|
'Themenfilter ' + filter.value + ' entfernen'
|
||||||
">
|
">
|
||||||
<mat-icon>close</mat-icon>
|
<mat-icon>{{ CLOSE_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
} @else if (filter.category === 'institutionId') {
|
} @else if (filter.category === 'institutionId') {
|
||||||
<span [skText]="loading" class="active-institution-filter">
|
<span [skText]="loading" class="active-institution-filter">
|
||||||
<span class="filter-institution-chip">
|
<span class="filter-institution-chip">
|
||||||
<mat-icon class="filter-institution-chip__icon"
|
<mat-icon class="filter-institution-chip__icon">{{
|
||||||
>apartment</mat-icon
|
APARTMENT_ICON
|
||||||
>
|
}}</mat-icon>
|
||||||
<span class="filter-institution-chip__name">{{
|
<span class="filter-institution-chip__name">{{
|
||||||
institutionFilterLabel(filter)
|
institutionFilterLabel(filter)
|
||||||
}}</span>
|
}}</span>
|
||||||
@@ -83,7 +85,7 @@
|
|||||||
class="institution-open-icon"
|
class="institution-open-icon"
|
||||||
(click)="openInstitutionPage(filter.value, $event)"
|
(click)="openInstitutionPage(filter.value, $event)"
|
||||||
aria-label="Institutionsseite öffnen"
|
aria-label="Institutionsseite öffnen"
|
||||||
>open_in_new</mat-icon
|
>{{ OPEN_IN_NEW_ICON }}</mat-icon
|
||||||
>
|
>
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
@@ -92,7 +94,7 @@
|
|||||||
class="remove-chip-btn"
|
class="remove-chip-btn"
|
||||||
(click)="removeFilter(filter)"
|
(click)="removeFilter(filter)"
|
||||||
aria-label="Institutionsfilter entfernen">
|
aria-label="Institutionsfilter entfernen">
|
||||||
<mat-icon>close</mat-icon>
|
<mat-icon>{{ CLOSE_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
} @else {
|
} @else {
|
||||||
@@ -103,7 +105,7 @@
|
|||||||
class="remove-chip-btn"
|
class="remove-chip-btn"
|
||||||
(click)="removeFilter(filter)"
|
(click)="removeFilter(filter)"
|
||||||
aria-label="Filter entfernen">
|
aria-label="Filter entfernen">
|
||||||
<mat-icon>close</mat-icon>
|
<mat-icon>{{ CLOSE_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
@@ -170,7 +172,7 @@
|
|||||||
</div>
|
</div>
|
||||||
} @else {
|
} @else {
|
||||||
<div class="empty-state">
|
<div class="empty-state">
|
||||||
<mat-icon>person_search</mat-icon>
|
<mat-icon>{{ PERSON_SEARCH_ICON }}</mat-icon>
|
||||||
<h2>Keine Personen gefunden</h2>
|
<h2>Keine Personen gefunden</h2>
|
||||||
<p>
|
<p>
|
||||||
Versuchen Sie einen anderen Suchbegriff oder passen Sie die Filter
|
Versuchen Sie einen anderen Suchbegriff oder passen Sie die Filter
|
||||||
@@ -194,7 +196,7 @@
|
|||||||
<!-- Right Column: Sidebar Filters -->
|
<!-- Right Column: Sidebar Filters -->
|
||||||
<aside class="filters-sidebar">
|
<aside class="filters-sidebar">
|
||||||
<div class="sidebar-header">
|
<div class="sidebar-header">
|
||||||
<mat-icon>filter_alt</mat-icon>
|
<mat-icon>{{ FILTER_ICON }}</mat-icon>
|
||||||
<h2>Filter & Suche</h2>
|
<h2>Filter & Suche</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -203,7 +205,7 @@
|
|||||||
<h3 class="filter-section-title">Themen & Expertise</h3>
|
<h3 class="filter-section-title">Themen & Expertise</h3>
|
||||||
|
|
||||||
<div class="topic-search-wrapper">
|
<div class="topic-search-wrapper">
|
||||||
<mat-icon>search</mat-icon>
|
<mat-icon>{{ SEARCH_ICON }}</mat-icon>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
[formControl]="topicSearchControl"
|
[formControl]="topicSearchControl"
|
||||||
@@ -214,7 +216,7 @@
|
|||||||
class="clear-topic-search"
|
class="clear-topic-search"
|
||||||
(click)="topicSearchControl.setValue('')"
|
(click)="topicSearchControl.setValue('')"
|
||||||
aria-label="Themensuche zurücksetzen">
|
aria-label="Themensuche zurücksetzen">
|
||||||
<mat-icon>close</mat-icon>
|
<mat-icon>{{ CLOSE_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@@ -232,7 +234,7 @@
|
|||||||
<div class="filter-section">
|
<div class="filter-section">
|
||||||
<h3 class="filter-section-title">Institution</h3>
|
<h3 class="filter-section-title">Institution</h3>
|
||||||
<div class="topic-search-wrapper" [class.is-loading]="loading">
|
<div class="topic-search-wrapper" [class.is-loading]="loading">
|
||||||
<mat-icon>apartment</mat-icon>
|
<mat-icon>{{ APARTMENT_ICON }}</mat-icon>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
[formControl]="institutionControl"
|
[formControl]="institutionControl"
|
||||||
@@ -266,7 +268,7 @@
|
|||||||
class="clear-topic-search"
|
class="clear-topic-search"
|
||||||
(click)="clearInstitutionFilter()"
|
(click)="clearInstitutionFilter()"
|
||||||
aria-label="Institution zurücksetzen">
|
aria-label="Institution zurücksetzen">
|
||||||
<mat-icon>close</mat-icon>
|
<mat-icon>{{ CLOSE_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -47,6 +47,15 @@ import { BookmarkService } from '../../shared/services/bookmark.service';
|
|||||||
|
|
||||||
import { ComponentTooltipDirective } from '../../directives/component-tooltip.directive';
|
import { ComponentTooltipDirective } from '../../directives/component-tooltip.directive';
|
||||||
import { AppTopicTooltipComponent } from '../../shared/ui/app-topic-tooltip/app-topic-tooltip.component';
|
import { AppTopicTooltipComponent } from '../../shared/ui/app-topic-tooltip/app-topic-tooltip.component';
|
||||||
|
import {
|
||||||
|
APARTMENT_ICON,
|
||||||
|
CLOSE_ICON,
|
||||||
|
FILTER_ICON,
|
||||||
|
LABEL_ICON,
|
||||||
|
OPEN_IN_NEW_ICON,
|
||||||
|
PERSON_SEARCH_ICON,
|
||||||
|
SEARCH_ICON,
|
||||||
|
} from '../../shared/ui/icons';
|
||||||
|
|
||||||
type InstitutionYearFilterMode = 'in' | 'from' | 'between';
|
type InstitutionYearFilterMode = 'in' | 'from' | 'between';
|
||||||
|
|
||||||
@@ -76,6 +85,14 @@ type InstitutionYearFilterMode = 'in' | 'from' | 'between';
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class PersonListComponent {
|
export class PersonListComponent {
|
||||||
|
readonly CLOSE_ICON = CLOSE_ICON;
|
||||||
|
readonly LABEL_ICON = LABEL_ICON;
|
||||||
|
readonly APARTMENT_ICON = APARTMENT_ICON;
|
||||||
|
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
|
||||||
|
readonly PERSON_SEARCH_ICON = PERSON_SEARCH_ICON;
|
||||||
|
readonly FILTER_ICON = FILTER_ICON;
|
||||||
|
readonly SEARCH_ICON = SEARCH_ICON;
|
||||||
|
|
||||||
readonly AppTopicTooltipComponent = AppTopicTooltipComponent;
|
readonly AppTopicTooltipComponent = AppTopicTooltipComponent;
|
||||||
private readonly router = inject(Router);
|
private readonly router = inject(Router);
|
||||||
private readonly route = inject(ActivatedRoute);
|
private readonly route = inject(ActivatedRoute);
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
@if (this.isPending()) {
|
@if (this.isPending()) {
|
||||||
<app-loading
|
<app-loading
|
||||||
text="Das Netzwerk wird gebaut, kleinen Moment..."
|
text="Das Netzwerk wird gebaut, kleinen Moment..."
|
||||||
icon="graph_3"
|
[icon]="GRAPH_ICON"
|
||||||
[size]="150"
|
[size]="150"
|
||||||
[diameter]="150" />
|
[diameter]="150" />
|
||||||
} @else if (this.isFailed()) {
|
} @else if (this.isFailed()) {
|
||||||
<div class="error">
|
<div class="error">
|
||||||
<mat-icon>error</mat-icon>
|
<mat-icon>{{ ERROR_ICON }}</mat-icon>
|
||||||
<span class="error-message">{{
|
<span class="error-message">{{
|
||||||
this.collaborationGraphError()
|
this.collaborationGraphError()
|
||||||
? this.collaborationGraphError()
|
? this.collaborationGraphError()
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
<app-selected-filters [observers]="observers" />
|
<app-selected-filters [observers]="observers" />
|
||||||
<button matButton="outlined" type="button" (click)="openFilterDialog()">
|
<button matButton="outlined" type="button" (click)="openFilterDialog()">
|
||||||
<mat-icon>filter_alt</mat-icon>
|
<mat-icon>{{ FILTER_ICON }}</mat-icon>
|
||||||
Filter
|
Filter
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
mat-stroked-button
|
mat-stroked-button
|
||||||
type="button"
|
type="button"
|
||||||
(click)="openFilterDialog()">
|
(click)="openFilterDialog()">
|
||||||
<mat-icon>filter_alt</mat-icon>
|
<mat-icon>{{ FILTER_ICON }}</mat-icon>
|
||||||
Filter
|
Filter
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
mat-icon-button
|
mat-icon-button
|
||||||
color="primary"
|
color="primary"
|
||||||
[routerLink]="['/person', this.stripOpenAlexIdPrefix(element.id)]">
|
[routerLink]="['/person', this.stripOpenAlexIdPrefix(element.id)]">
|
||||||
<mat-icon>open_in_new</mat-icon>
|
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
|
||||||
</a>
|
</a>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@
|
|||||||
mat-icon-button
|
mat-icon-button
|
||||||
color="primary"
|
color="primary"
|
||||||
[routerLink]="['/publication', this.stripOpenAlexIdPrefix(element.id)]">
|
[routerLink]="['/publication', this.stripOpenAlexIdPrefix(element.id)]">
|
||||||
<mat-icon>open_in_new</mat-icon>
|
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
|
||||||
</a>
|
</a>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@
|
|||||||
mat-icon-button
|
mat-icon-button
|
||||||
color="primary"
|
color="primary"
|
||||||
[routerLink]="['/institution', this.stripOpenAlexIdPrefix(element.id)]">
|
[routerLink]="['/institution', this.stripOpenAlexIdPrefix(element.id)]">
|
||||||
<mat-icon>open_in_new</mat-icon>
|
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
|
||||||
</a>
|
</a>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,20 @@ import {
|
|||||||
} from '../collaboration-graph/collaboration-graph.component';
|
} from '../collaboration-graph/collaboration-graph.component';
|
||||||
import { form } from '@angular/forms/signals';
|
import { form } from '@angular/forms/signals';
|
||||||
import { collaborationGraphQueryParamKeys } from '../../resolvers/collaboration-graph.resolver';
|
import { collaborationGraphQueryParamKeys } from '../../resolvers/collaboration-graph.resolver';
|
||||||
|
import {
|
||||||
|
APARTMENT_ICON,
|
||||||
|
CALENDAR_ICON,
|
||||||
|
ERROR_ICON,
|
||||||
|
FILTER_ICON,
|
||||||
|
GRAPH_ICON,
|
||||||
|
GROUP_ICON,
|
||||||
|
LABEL_ICON,
|
||||||
|
NETWORK_ICON,
|
||||||
|
OPEN_IN_NEW_ICON,
|
||||||
|
PERSON_ICON,
|
||||||
|
PUBLICATION_ICON,
|
||||||
|
SEARCH_ICON,
|
||||||
|
} from '../../shared/ui/icons';
|
||||||
import {
|
import {
|
||||||
FilterObserver,
|
FilterObserver,
|
||||||
SelectedFiltersComponent,
|
SelectedFiltersComponent,
|
||||||
@@ -122,6 +136,11 @@ interface FilterData {
|
|||||||
providers: [],
|
providers: [],
|
||||||
})
|
})
|
||||||
export class PersonNetworkComponent implements OnInit {
|
export class PersonNetworkComponent implements OnInit {
|
||||||
|
readonly GRAPH_ICON = GRAPH_ICON;
|
||||||
|
readonly ERROR_ICON = ERROR_ICON;
|
||||||
|
readonly FILTER_ICON = FILTER_ICON;
|
||||||
|
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
|
||||||
|
|
||||||
readonly AppAuthorTooltipComponent = AppAuthorTooltipComponent;
|
readonly AppAuthorTooltipComponent = AppAuthorTooltipComponent;
|
||||||
readonly AppInstitutionTooltipComponent = AppInstitutionTooltipComponent;
|
readonly AppInstitutionTooltipComponent = AppInstitutionTooltipComponent;
|
||||||
readonly AppPublicationTooltipComponent = AppPublicationTooltipComponent;
|
readonly AppPublicationTooltipComponent = AppPublicationTooltipComponent;
|
||||||
@@ -168,12 +187,12 @@ export class PersonNetworkComponent implements OnInit {
|
|||||||
{
|
{
|
||||||
id: 'searchTerm',
|
id: 'searchTerm',
|
||||||
queryParamKey: 'search_term',
|
queryParamKey: 'search_term',
|
||||||
icon: 'search',
|
icon: SEARCH_ICON,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'yearFrom',
|
id: 'yearFrom',
|
||||||
queryParamKey: collaborationGraphQueryParamKeys.yearFrom,
|
queryParamKey: collaborationGraphQueryParamKeys.yearFrom,
|
||||||
icon: 'calendar_today',
|
icon: CALENDAR_ICON,
|
||||||
valueFormatter: (value: string) => {
|
valueFormatter: (value: string) => {
|
||||||
return value ? `Ab ${value}` : null;
|
return value ? `Ab ${value}` : null;
|
||||||
},
|
},
|
||||||
@@ -181,7 +200,7 @@ export class PersonNetworkComponent implements OnInit {
|
|||||||
{
|
{
|
||||||
id: 'yearTo',
|
id: 'yearTo',
|
||||||
queryParamKey: collaborationGraphQueryParamKeys.yearTo,
|
queryParamKey: collaborationGraphQueryParamKeys.yearTo,
|
||||||
icon: 'calendar_today',
|
icon: CALENDAR_ICON,
|
||||||
valueFormatter: (value: string) => {
|
valueFormatter: (value: string) => {
|
||||||
return value ? `Bis ${value}` : null;
|
return value ? `Bis ${value}` : null;
|
||||||
},
|
},
|
||||||
@@ -189,7 +208,7 @@ export class PersonNetworkComponent implements OnInit {
|
|||||||
{
|
{
|
||||||
id: 'minContributors',
|
id: 'minContributors',
|
||||||
queryParamKey: collaborationGraphQueryParamKeys.minCollaborators,
|
queryParamKey: collaborationGraphQueryParamKeys.minCollaborators,
|
||||||
icon: 'person',
|
icon: PERSON_ICON,
|
||||||
valueFormatter: (value: string) => {
|
valueFormatter: (value: string) => {
|
||||||
return value ? `Mindestens ${value} Autoren` : null;
|
return value ? `Mindestens ${value} Autoren` : null;
|
||||||
},
|
},
|
||||||
@@ -197,7 +216,7 @@ export class PersonNetworkComponent implements OnInit {
|
|||||||
{
|
{
|
||||||
id: 'maxContributors',
|
id: 'maxContributors',
|
||||||
queryParamKey: collaborationGraphQueryParamKeys.maxCollaborators,
|
queryParamKey: collaborationGraphQueryParamKeys.maxCollaborators,
|
||||||
icon: 'group',
|
icon: GROUP_ICON,
|
||||||
valueFormatter: (value: string) => {
|
valueFormatter: (value: string) => {
|
||||||
return value ? `Höchstens ${value} Autoren` : null;
|
return value ? `Höchstens ${value} Autoren` : null;
|
||||||
},
|
},
|
||||||
@@ -205,7 +224,7 @@ export class PersonNetworkComponent implements OnInit {
|
|||||||
{
|
{
|
||||||
id: 'topics',
|
id: 'topics',
|
||||||
queryParamKey: collaborationGraphQueryParamKeys.topicId,
|
queryParamKey: collaborationGraphQueryParamKeys.topicId,
|
||||||
icon: 'label',
|
icon: LABEL_ICON,
|
||||||
valueFormatter: (value: string) => {
|
valueFormatter: (value: string) => {
|
||||||
const topic = this.selectedTopics().elements?.find(
|
const topic = this.selectedTopics().elements?.find(
|
||||||
(topic) => topic.id === value,
|
(topic) => topic.id === value,
|
||||||
@@ -217,7 +236,7 @@ export class PersonNetworkComponent implements OnInit {
|
|||||||
{
|
{
|
||||||
id: 'institutions',
|
id: 'institutions',
|
||||||
queryParamKey: collaborationGraphQueryParamKeys.institutionId,
|
queryParamKey: collaborationGraphQueryParamKeys.institutionId,
|
||||||
icon: 'apartment',
|
icon: APARTMENT_ICON,
|
||||||
valueFormatter: (value: string) => {
|
valueFormatter: (value: string) => {
|
||||||
const institution = this.selectedInstitutions().elements?.find(
|
const institution = this.selectedInstitutions().elements?.find(
|
||||||
(inst) => inst.id === value,
|
(inst) => inst.id === value,
|
||||||
@@ -420,22 +439,22 @@ export class PersonNetworkComponent implements OnInit {
|
|||||||
|
|
||||||
readonly summaryCards = computed(() => [
|
readonly summaryCards = computed(() => [
|
||||||
{
|
{
|
||||||
icon: 'person',
|
icon: PERSON_ICON,
|
||||||
value: this.persons(),
|
value: this.persons(),
|
||||||
description: 'Personen',
|
description: 'Personen',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'apartment',
|
icon: APARTMENT_ICON,
|
||||||
value: this.institutions(),
|
value: this.institutions(),
|
||||||
description: 'Institutionen',
|
description: 'Institutionen',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'menu_book',
|
icon: PUBLICATION_ICON,
|
||||||
value: this.publications(),
|
value: this.publications(),
|
||||||
description: 'Gemeinsame Publikationen',
|
description: 'Gemeinsame Publikationen',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'share',
|
icon: NETWORK_ICON,
|
||||||
value: this.connections(),
|
value: this.connections(),
|
||||||
description: 'Verbindungen im Netzwerk',
|
description: 'Verbindungen im Netzwerk',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
@if (loading) {
|
@if (loading) {
|
||||||
<app-loading
|
<app-loading
|
||||||
text="Patentdaten werden geladen..."
|
text="Patentdaten werden geladen..."
|
||||||
icon="workspace_premium"
|
[icon]="PATENT_ICON"
|
||||||
[size]="150"
|
[size]="150"
|
||||||
[diameter]="150" />
|
[diameter]="150" />
|
||||||
} @else if (error) {
|
} @else if (error) {
|
||||||
@@ -13,23 +13,13 @@
|
|||||||
<div class="patents-content">
|
<div class="patents-content">
|
||||||
<div class="patents-list">
|
<div class="patents-list">
|
||||||
<div class="patents-list-toolbar">
|
<div class="patents-list-toolbar">
|
||||||
|
<app-source-filter
|
||||||
|
[value]="activeFilter"
|
||||||
|
(valueChange)="setFilter($event)" />
|
||||||
<mat-form-field
|
<mat-form-field
|
||||||
class="patents-toolbar-field"
|
class="patents-toolbar-field"
|
||||||
subscriptSizing="dynamic">
|
subscriptSizing="dynamic">
|
||||||
<mat-icon matPrefix fontIcon="filter_alt"></mat-icon>
|
<mat-icon matPrefix [fontIcon]="SORT_ICON"></mat-icon>
|
||||||
<mat-select
|
|
||||||
[value]="activeFilter"
|
|
||||||
(selectionChange)="setFilter($event.value)">
|
|
||||||
<mat-select-trigger>Filter nach Quelle</mat-select-trigger>
|
|
||||||
<mat-option value="all">Alle</mat-option>
|
|
||||||
<mat-option value="EPO">EPO</mat-option>
|
|
||||||
<mat-option value="USPTO">USPTO</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</mat-form-field>
|
|
||||||
<mat-form-field
|
|
||||||
class="patents-toolbar-field"
|
|
||||||
subscriptSizing="dynamic">
|
|
||||||
<mat-icon matPrefix fontIcon="sort"></mat-icon>
|
|
||||||
<mat-select
|
<mat-select
|
||||||
[value]="sortColumn"
|
[value]="sortColumn"
|
||||||
(selectionChange)="setSort($event.value)">
|
(selectionChange)="setSort($event.value)">
|
||||||
@@ -102,7 +92,7 @@
|
|||||||
<span class="patent-detail-action__label"
|
<span class="patent-detail-action__label"
|
||||||
>Patentdetails anzeigen</span
|
>Patentdetails anzeigen</span
|
||||||
>
|
>
|
||||||
<mat-icon aria-hidden="true">chevron_right</mat-icon>
|
<mat-icon aria-hidden="true">{{ CHEVRON_RIGHT_ICON }}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<p class="patent-detail-hint">
|
<p class="patent-detail-hint">
|
||||||
Abstract, Erfinder, Anmelder und IPC/CPC-Klassifikation
|
Abstract, Erfinder, Anmelder und IPC/CPC-Klassifikation
|
||||||
|
|||||||
@@ -17,6 +17,13 @@ import { LoadingComponent } from '../../shared/ui/loading/loading.component';
|
|||||||
import { PageEvent } from '@angular/material/paginator';
|
import { PageEvent } from '@angular/material/paginator';
|
||||||
import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component';
|
import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component';
|
||||||
import { PatentTableComponent } from '../../shared/ui/patent-table/patent-table.component';
|
import { PatentTableComponent } from '../../shared/ui/patent-table/patent-table.component';
|
||||||
|
import {
|
||||||
|
CHEVRON_RIGHT_ICON,
|
||||||
|
FILTER_ICON,
|
||||||
|
PATENT_ICON,
|
||||||
|
SORT_ICON,
|
||||||
|
} from '../../shared/ui/icons';
|
||||||
|
import { SourceFilterComponent } from '../../shared/ui/source-filter/source-filter.component';
|
||||||
|
|
||||||
type SortColumn = 'title' | 'publication_year' | 'source';
|
type SortColumn = 'title' | 'publication_year' | 'source';
|
||||||
type SortDirection = 'asc' | 'desc';
|
type SortDirection = 'asc' | 'desc';
|
||||||
@@ -32,11 +39,17 @@ type SourceFilter = 'all' | 'EPO' | 'USPTO';
|
|||||||
MatIconModule,
|
MatIconModule,
|
||||||
QueryParamPaginatorComponent,
|
QueryParamPaginatorComponent,
|
||||||
PatentTableComponent,
|
PatentTableComponent,
|
||||||
|
SourceFilterComponent,
|
||||||
],
|
],
|
||||||
templateUrl: './person-patents.component.html',
|
templateUrl: './person-patents.component.html',
|
||||||
styleUrl: './person-patents.component.scss',
|
styleUrl: './person-patents.component.scss',
|
||||||
})
|
})
|
||||||
export class PersonPatentsComponent {
|
export class PersonPatentsComponent {
|
||||||
|
readonly PATENT_ICON = PATENT_ICON;
|
||||||
|
readonly FILTER_ICON = FILTER_ICON;
|
||||||
|
readonly SORT_ICON = SORT_ICON;
|
||||||
|
readonly CHEVRON_RIGHT_ICON = CHEVRON_RIGHT_ICON;
|
||||||
|
|
||||||
private route = inject(ActivatedRoute);
|
private route = inject(ActivatedRoute);
|
||||||
private router = inject(Router);
|
private router = inject(Router);
|
||||||
private destroyRef = inject(DestroyRef);
|
private destroyRef = inject(DestroyRef);
|
||||||
|
|||||||
@@ -23,13 +23,13 @@
|
|||||||
(click)="toggleBookmark()">
|
(click)="toggleBookmark()">
|
||||||
<mat-icon>{{
|
<mat-icon>{{
|
||||||
bookmarkService.isBookmarked(person()?.id)
|
bookmarkService.isBookmarked(person()?.id)
|
||||||
? 'bookmark'
|
? BOOKMARK_ICON
|
||||||
: 'bookmark_border'
|
: BOOKMARK_BORDER_ICON
|
||||||
}}</mat-icon>
|
}}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="institution-line">
|
<div class="institution-line">
|
||||||
<mat-icon class="institution-icon">apartment</mat-icon>
|
<mat-icon class="institution-icon">{{ APARTMENT_ICON }}</mat-icon>
|
||||||
@if (institutionId(); as institutionId) {
|
@if (institutionId(); as institutionId) {
|
||||||
<a
|
<a
|
||||||
class="institution-link"
|
class="institution-link"
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
<span class="stats-line">
|
<span class="stats-line">
|
||||||
@if (worksCount() !== null) {
|
@if (worksCount() !== null) {
|
||||||
<span class="stat-item">
|
<span class="stat-item">
|
||||||
<mat-icon class="stat-icon">menu_book</mat-icon>
|
<mat-icon class="stat-icon">{{ PUBLICATION_ICON }}</mat-icon>
|
||||||
{{ worksCount() | number }} Publikationen
|
{{ worksCount() | number }} Publikationen
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
}
|
}
|
||||||
@if (citedByCount() !== null) {
|
@if (citedByCount() !== null) {
|
||||||
<span class="stat-item">
|
<span class="stat-item">
|
||||||
<mat-icon class="stat-icon">format_quote</mat-icon>
|
<mat-icon class="stat-icon">{{ CITATION_ICON }}</mat-icon>
|
||||||
{{ citedByCount() | number }} Zitationen
|
{{ citedByCount() | number }} Zitationen
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
"
|
"
|
||||||
matTooltipPosition="right"
|
matTooltipPosition="right"
|
||||||
[matTooltipShowDelay]="250">
|
[matTooltipShowDelay]="250">
|
||||||
<mat-icon class="stat-icon">trending_up</mat-icon>
|
<mat-icon class="stat-icon">{{ TRENDING_UP_ICON }}</mat-icon>
|
||||||
h-Index {{ h_index() }}
|
h-Index {{ h_index() }}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
matTooltip="ORCID-Profil öffnen"
|
matTooltip="ORCID-Profil öffnen"
|
||||||
matTooltipPosition="right"
|
matTooltipPosition="right"
|
||||||
[matTooltipShowDelay]="250">
|
[matTooltipShowDelay]="250">
|
||||||
<mat-icon>verified</mat-icon>
|
<mat-icon>{{ VERIFIED_ICON }}</mat-icon>
|
||||||
{{ orcidId }}
|
{{ orcidId }}
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
@@ -118,7 +118,7 @@
|
|||||||
@if (isBioLoading()) {
|
@if (isBioLoading()) {
|
||||||
<app-loading
|
<app-loading
|
||||||
text="Biografie wird geladen..."
|
text="Biografie wird geladen..."
|
||||||
icon="description"
|
[icon]="DESCRIPTION_ICON"
|
||||||
[size]="150"
|
[size]="150"
|
||||||
[diameter]="150"></app-loading>
|
[diameter]="150"></app-loading>
|
||||||
} @else if (personBio() != null) {
|
} @else if (personBio() != null) {
|
||||||
@@ -143,7 +143,7 @@
|
|||||||
} @else {
|
} @else {
|
||||||
<app-loading
|
<app-loading
|
||||||
text="Person wird geladen..."
|
text="Person wird geladen..."
|
||||||
icon="person"
|
[icon]="PERSON_ICON"
|
||||||
[size]="150"
|
[size]="150"
|
||||||
[diameter]="150"></app-loading>
|
[diameter]="150"></app-loading>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,14 +49,22 @@ import {
|
|||||||
LinkTabNavBarItem,
|
LinkTabNavBarItem,
|
||||||
} from '../../shared/ui/link-tab-nav-bar/link-tab-nav-bar.component';
|
} from '../../shared/ui/link-tab-nav-bar/link-tab-nav-bar.component';
|
||||||
import {
|
import {
|
||||||
|
APARTMENT_ICON,
|
||||||
|
BOOKMARK_BORDER_ICON,
|
||||||
|
BOOKMARK_ICON,
|
||||||
|
CITATION_ICON,
|
||||||
COMPANY_CONNECTION_ICON,
|
COMPANY_CONNECTION_ICON,
|
||||||
|
DESCRIPTION_ICON,
|
||||||
FUNDING_ICON,
|
FUNDING_ICON,
|
||||||
NETWORK_ICON,
|
NETWORK_ICON,
|
||||||
NEWS_ICON,
|
NEWS_ICON,
|
||||||
OVERVIEW_ICON,
|
OVERVIEW_ICON,
|
||||||
PATENT_ICON,
|
PATENT_ICON,
|
||||||
|
PERSON_ICON,
|
||||||
PROJECT_ICON,
|
PROJECT_ICON,
|
||||||
PUBLICATION_ICON,
|
PUBLICATION_ICON,
|
||||||
|
TRENDING_UP_ICON,
|
||||||
|
VERIFIED_ICON,
|
||||||
} from '../../shared/ui/icons';
|
} from '../../shared/ui/icons';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -78,6 +86,16 @@ import {
|
|||||||
styleUrl: './person.component.scss',
|
styleUrl: './person.component.scss',
|
||||||
})
|
})
|
||||||
export class PersonComponent {
|
export class PersonComponent {
|
||||||
|
readonly BOOKMARK_ICON = BOOKMARK_ICON;
|
||||||
|
readonly BOOKMARK_BORDER_ICON = BOOKMARK_BORDER_ICON;
|
||||||
|
readonly APARTMENT_ICON = APARTMENT_ICON;
|
||||||
|
readonly PUBLICATION_ICON = PUBLICATION_ICON;
|
||||||
|
readonly CITATION_ICON = CITATION_ICON;
|
||||||
|
readonly TRENDING_UP_ICON = TRENDING_UP_ICON;
|
||||||
|
readonly VERIFIED_ICON = VERIFIED_ICON;
|
||||||
|
readonly DESCRIPTION_ICON = DESCRIPTION_ICON;
|
||||||
|
readonly PERSON_ICON = PERSON_ICON;
|
||||||
|
|
||||||
private readonly router = inject(Router);
|
private readonly router = inject(Router);
|
||||||
private readonly activatedRoute = inject(ActivatedRoute);
|
private readonly activatedRoute = inject(ActivatedRoute);
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<div class="breadcrumb">
|
<div class="breadcrumb">
|
||||||
<span>Bund Projekte</span>
|
<span>Bund Projekte</span>
|
||||||
<mat-icon>chevron_right</mat-icon>
|
<mat-icon>{{ CHEVRON_RIGHT_ICON }}</mat-icon>
|
||||||
<span>Projektdetails</span>
|
<span>Projektdetails</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -31,18 +31,18 @@
|
|||||||
[style.background-color]="
|
[style.background-color]="
|
||||||
getStatusColor(getStatusDisplay(bundProject.funding_end_date))
|
getStatusColor(getStatusDisplay(bundProject.funding_end_date))
|
||||||
">
|
">
|
||||||
<mat-icon>circle</mat-icon>
|
<mat-icon>{{ CIRCLE_ICON }}</mat-icon>
|
||||||
<span>{{ getStatusDisplay(bundProject.funding_end_date) }}</span>
|
<span>{{ getStatusDisplay(bundProject.funding_end_date) }}</span>
|
||||||
</div>
|
</div>
|
||||||
<!-- @if (bundProject.project_agency) {
|
<!-- @if (bundProject.project_agency) {
|
||||||
<div class="agency-info" (click)="searchForAgency(bundProject.project_agency)">
|
<div class="agency-info" (click)="searchForAgency(bundProject.project_agency)">
|
||||||
<mat-icon>account_balance</mat-icon>
|
<mat-icon>{{ ACCOUNT_BALANCE_ICON }}</mat-icon>
|
||||||
<span>{{ bundProject.project_agency_fullname || bundProject.project_agency }}</span>
|
<span>{{ bundProject.project_agency_fullname || bundProject.project_agency }}</span>
|
||||||
</div>
|
</div>
|
||||||
} -->
|
} -->
|
||||||
<!-- @if (bundProject.funding_type) {
|
<!-- @if (bundProject.funding_type) {
|
||||||
<div class="funding-type-info" (click)="searchForFundingType(bundProject.funding_type)">
|
<div class="funding-type-info" (click)="searchForFundingType(bundProject.funding_type)">
|
||||||
<mat-icon>category</mat-icon>
|
<mat-icon>{{ CATEGORY_ICON }}</mat-icon>
|
||||||
<span>{{ bundProject.funding_type }}</span>
|
<span>{{ bundProject.funding_type }}</span>
|
||||||
</div>
|
</div>
|
||||||
} -->
|
} -->
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
|
|
||||||
<div class="metrics-grid">
|
<div class="metrics-grid">
|
||||||
<div class="metric-item">
|
<div class="metric-item">
|
||||||
<mat-icon>calendar_today</mat-icon>
|
<mat-icon>{{ CALENDAR_ICON }}</mat-icon>
|
||||||
<div class="metric-content">
|
<div class="metric-content">
|
||||||
<strong>{{
|
<strong>{{
|
||||||
bundProject.funding_start_date | date: 'dd.MM.yyyy'
|
bundProject.funding_start_date | date: 'dd.MM.yyyy'
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="metric-item">
|
<div class="metric-item">
|
||||||
<mat-icon>event_busy</mat-icon>
|
<mat-icon>{{ EVENT_BUSY_ICON }}</mat-icon>
|
||||||
<div class="metric-content">
|
<div class="metric-content">
|
||||||
<strong>{{
|
<strong>{{
|
||||||
getFundingStatus(bundProject.funding_end_date)
|
getFundingStatus(bundProject.funding_end_date)
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="metric-item">
|
<div class="metric-item">
|
||||||
<mat-icon>access_time</mat-icon>
|
<mat-icon>{{ ACCESS_TIME_ICON }}</mat-icon>
|
||||||
<div class="metric-content">
|
<div class="metric-content">
|
||||||
<strong>{{
|
<strong>{{
|
||||||
getStatusDisplay(bundProject.funding_end_date)
|
getStatusDisplay(bundProject.funding_end_date)
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
</div>
|
</div>
|
||||||
@if (bundProject.funding_amount) {
|
@if (bundProject.funding_amount) {
|
||||||
<div class="metric-item">
|
<div class="metric-item">
|
||||||
<mat-icon>paid</mat-icon>
|
<mat-icon>{{ PAID_ICON }}</mat-icon>
|
||||||
<div class="metric-content">
|
<div class="metric-content">
|
||||||
<strong>{{
|
<strong>{{
|
||||||
bundProject.funding_amount
|
bundProject.funding_amount
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
}
|
}
|
||||||
@if (bundProject.funding_profile) {
|
@if (bundProject.funding_profile) {
|
||||||
<div class="metric-item">
|
<div class="metric-item">
|
||||||
<mat-icon>assignment</mat-icon>
|
<mat-icon>{{ ASSIGNMENT_ICON }}</mat-icon>
|
||||||
<div class="metric-content">
|
<div class="metric-content">
|
||||||
<strong>{{ bundProject.funding_profile }}</strong>
|
<strong>{{ bundProject.funding_profile }}</strong>
|
||||||
<span>Förderprofil</span>
|
<span>Förderprofil</span>
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
@if (bundProject.description) {
|
@if (bundProject.description) {
|
||||||
<mat-card appearance="outlined" class="card description-card">
|
<mat-card appearance="outlined" class="card description-card">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<mat-icon>description</mat-icon>
|
<mat-icon>{{ DESCRIPTION_ICON }}</mat-icon>
|
||||||
<h2>Beschreibung</h2>
|
<h2>Beschreibung</h2>
|
||||||
</div>
|
</div>
|
||||||
<p class="description-text">{{ bundProject.description }}</p>
|
<p class="description-text">{{ bundProject.description }}</p>
|
||||||
@@ -122,7 +122,7 @@
|
|||||||
@if (getAssociatedPersons().length > 0) {
|
@if (getAssociatedPersons().length > 0) {
|
||||||
<mat-card appearance="outlined" class="card">
|
<mat-card appearance="outlined" class="card">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<mat-icon>people</mat-icon>
|
<mat-icon>{{ PEOPLE_ICON }}</mat-icon>
|
||||||
<h2>Beteiligte Personen</h2>
|
<h2>Beteiligte Personen</h2>
|
||||||
<span class="count-badge">{{
|
<span class="count-badge">{{
|
||||||
getAssociatedPersons().length
|
getAssociatedPersons().length
|
||||||
@@ -148,7 +148,7 @@
|
|||||||
) {
|
) {
|
||||||
<mat-card appearance="outlined" class="card">
|
<mat-card appearance="outlined" class="card">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<mat-icon>business</mat-icon>
|
<mat-icon>{{ BUSINESS_ICON }}</mat-icon>
|
||||||
<h2>Beteiligte Institution</h2>
|
<h2>Beteiligte Institution</h2>
|
||||||
</div>
|
</div>
|
||||||
<dl class="details-list">
|
<dl class="details-list">
|
||||||
@@ -234,7 +234,7 @@
|
|||||||
) {
|
) {
|
||||||
<mat-card appearance="outlined" class="card">
|
<mat-card appearance="outlined" class="card">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<mat-icon>location_on</mat-icon>
|
<mat-icon>{{ LOCATION_ICON }}</mat-icon>
|
||||||
<h2>Standort</h2>
|
<h2>Standort</h2>
|
||||||
</div>
|
</div>
|
||||||
<dl class="details-list">
|
<dl class="details-list">
|
||||||
@@ -285,7 +285,7 @@
|
|||||||
) {
|
) {
|
||||||
<mat-card appearance="outlined" class="card">
|
<mat-card appearance="outlined" class="card">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<mat-icon>more_info</mat-icon>
|
<mat-icon>{{ MORE_INFO_ICON }}</mat-icon>
|
||||||
<h2>Weitere Informationen</h2>
|
<h2>Weitere Informationen</h2>
|
||||||
</div>
|
</div>
|
||||||
<dl class="details-list">
|
<dl class="details-list">
|
||||||
@@ -322,7 +322,7 @@
|
|||||||
<!-- Projektdetails -->
|
<!-- Projektdetails -->
|
||||||
<mat-card appearance="outlined" class="card details-card">
|
<mat-card appearance="outlined" class="card details-card">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<mat-icon>info</mat-icon>
|
<mat-icon>{{ INFO_ICON }}</mat-icon>
|
||||||
<h2>Projektdetails</h2>
|
<h2>Projektdetails</h2>
|
||||||
</div>
|
</div>
|
||||||
<dl class="details-list">
|
<dl class="details-list">
|
||||||
@@ -408,7 +408,7 @@
|
|||||||
} @else {
|
} @else {
|
||||||
<div class="error-container">
|
<div class="error-container">
|
||||||
<div class="error-state">
|
<div class="error-state">
|
||||||
<mat-icon>error_outline</mat-icon>
|
<mat-icon>{{ ERROR_OUTLINE_ICON }}</mat-icon>
|
||||||
<p>Bund Projekt nicht gefunden.</p>
|
<p>Bund Projekt nicht gefunden.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,6 +5,24 @@ import { MatCardModule } from '@angular/material/card';
|
|||||||
import { MatIconModule } from '@angular/material/icon';
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
import { BundProjectDetails } from '../../../api/model/bundProjectDetails';
|
import { BundProjectDetails } from '../../../api/model/bundProjectDetails';
|
||||||
import { ProjectOaTopicsComponent } from '../../../shared/ui/project-oa-topics/project-oa-topics.component';
|
import { ProjectOaTopicsComponent } from '../../../shared/ui/project-oa-topics/project-oa-topics.component';
|
||||||
|
import {
|
||||||
|
ACCESS_TIME_ICON,
|
||||||
|
ACCOUNT_BALANCE_ICON,
|
||||||
|
ASSIGNMENT_ICON,
|
||||||
|
BUSINESS_ICON,
|
||||||
|
CALENDAR_ICON,
|
||||||
|
CATEGORY_ICON,
|
||||||
|
CHEVRON_RIGHT_ICON,
|
||||||
|
CIRCLE_ICON,
|
||||||
|
DESCRIPTION_ICON,
|
||||||
|
ERROR_OUTLINE_ICON,
|
||||||
|
EVENT_BUSY_ICON,
|
||||||
|
INFO_ICON,
|
||||||
|
LOCATION_ICON,
|
||||||
|
MORE_INFO_ICON,
|
||||||
|
PAID_ICON,
|
||||||
|
PEOPLE_ICON,
|
||||||
|
} from '../../../shared/ui/icons';
|
||||||
|
|
||||||
export interface InstitutionEntry {
|
export interface InstitutionEntry {
|
||||||
label: string;
|
label: string;
|
||||||
@@ -23,6 +41,23 @@ export interface InstitutionEntry {
|
|||||||
styleUrl: './bund-details.component.scss',
|
styleUrl: './bund-details.component.scss',
|
||||||
})
|
})
|
||||||
export class BundDetailsComponent implements OnInit {
|
export class BundDetailsComponent implements OnInit {
|
||||||
|
readonly CHEVRON_RIGHT_ICON = CHEVRON_RIGHT_ICON;
|
||||||
|
readonly CIRCLE_ICON = CIRCLE_ICON;
|
||||||
|
readonly CALENDAR_ICON = CALENDAR_ICON;
|
||||||
|
readonly EVENT_BUSY_ICON = EVENT_BUSY_ICON;
|
||||||
|
readonly ACCESS_TIME_ICON = ACCESS_TIME_ICON;
|
||||||
|
readonly PAID_ICON = PAID_ICON;
|
||||||
|
readonly ASSIGNMENT_ICON = ASSIGNMENT_ICON;
|
||||||
|
readonly DESCRIPTION_ICON = DESCRIPTION_ICON;
|
||||||
|
readonly PEOPLE_ICON = PEOPLE_ICON;
|
||||||
|
readonly BUSINESS_ICON = BUSINESS_ICON;
|
||||||
|
readonly LOCATION_ICON = LOCATION_ICON;
|
||||||
|
readonly MORE_INFO_ICON = MORE_INFO_ICON;
|
||||||
|
readonly INFO_ICON = INFO_ICON;
|
||||||
|
readonly ERROR_OUTLINE_ICON = ERROR_OUTLINE_ICON;
|
||||||
|
readonly ACCOUNT_BALANCE_ICON = ACCOUNT_BALANCE_ICON;
|
||||||
|
readonly CATEGORY_ICON = CATEGORY_ICON;
|
||||||
|
|
||||||
private readonly route = inject(ActivatedRoute);
|
private readonly route = inject(ActivatedRoute);
|
||||||
bundProject: BundProjectDetails | undefined;
|
bundProject: BundProjectDetails | undefined;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<div class="breadcrumb">
|
<div class="breadcrumb">
|
||||||
<span>DFG Projekte</span>
|
<span>DFG Projekte</span>
|
||||||
<mat-icon>chevron_right</mat-icon>
|
<mat-icon>{{ CHEVRON_RIGHT_ICON }}</mat-icon>
|
||||||
<span>Projektdetails</span>
|
<span>Projektdetails</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
[style.background-color]="
|
[style.background-color]="
|
||||||
getStatusColor(getStatusDisplay(dfgProject.funding_end))
|
getStatusColor(getStatusDisplay(dfgProject.funding_end))
|
||||||
">
|
">
|
||||||
<mat-icon>circle</mat-icon>
|
<mat-icon>{{ CIRCLE_ICON }}</mat-icon>
|
||||||
<span>{{ getStatusDisplay(dfgProject.funding_end) }}</span>
|
<span>{{ getStatusDisplay(dfgProject.funding_end) }}</span>
|
||||||
</div>
|
</div>
|
||||||
@if (dfgProject.page_url) {
|
@if (dfgProject.page_url) {
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
[href]="dfgProject.page_url"
|
[href]="dfgProject.page_url"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="primary-action">
|
class="primary-action">
|
||||||
<mat-icon>open_in_new</mat-icon>
|
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
|
||||||
<span>Zum Projekt</span>
|
<span>Zum Projekt</span>
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
[href]="dfgProject.external_link"
|
[href]="dfgProject.external_link"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="secondary-action">
|
class="secondary-action">
|
||||||
<mat-icon>language</mat-icon>
|
<mat-icon>{{ LANGUAGE_ICON }}</mat-icon>
|
||||||
<span>Webseite</span>
|
<span>Webseite</span>
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
@@ -60,21 +60,21 @@
|
|||||||
|
|
||||||
<div class="metrics-grid">
|
<div class="metrics-grid">
|
||||||
<div class="metric-item">
|
<div class="metric-item">
|
||||||
<mat-icon>calendar_today</mat-icon>
|
<mat-icon>{{ CALENDAR_ICON }}</mat-icon>
|
||||||
<div class="metric-content">
|
<div class="metric-content">
|
||||||
<strong>{{ dfgProject.funding_start || 'N/A' }}</strong>
|
<strong>{{ dfgProject.funding_start || 'N/A' }}</strong>
|
||||||
<span>Förderbeginn</span>
|
<span>Förderbeginn</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="metric-item">
|
<div class="metric-item">
|
||||||
<mat-icon>event_busy</mat-icon>
|
<mat-icon>{{ EVENT_BUSY_ICON }}</mat-icon>
|
||||||
<div class="metric-content">
|
<div class="metric-content">
|
||||||
<strong>{{ getFundingEndDisplay(dfgProject.funding_end) }}</strong>
|
<strong>{{ getFundingEndDisplay(dfgProject.funding_end) }}</strong>
|
||||||
<span>Förderende</span>
|
<span>Förderende</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="metric-item">
|
<div class="metric-item">
|
||||||
<mat-icon>access_time</mat-icon>
|
<mat-icon>{{ ACCESS_TIME_ICON }}</mat-icon>
|
||||||
<div class="metric-content">
|
<div class="metric-content">
|
||||||
<strong>{{ getStatusDisplay(dfgProject.funding_end) }}</strong>
|
<strong>{{ getStatusDisplay(dfgProject.funding_end) }}</strong>
|
||||||
<span>Status</span>
|
<span>Status</span>
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
</div>
|
</div>
|
||||||
@if (dfgProject.dfg_procedure) {
|
@if (dfgProject.dfg_procedure) {
|
||||||
<div class="metric-item">
|
<div class="metric-item">
|
||||||
<mat-icon>gavel</mat-icon>
|
<mat-icon>{{ GAVEL_ICON }}</mat-icon>
|
||||||
<div class="metric-content">
|
<div class="metric-content">
|
||||||
<strong>{{ dfgProject.dfg_procedure }}</strong>
|
<strong>{{ dfgProject.dfg_procedure }}</strong>
|
||||||
<span>DFG Verfahren</span>
|
<span>DFG Verfahren</span>
|
||||||
@@ -91,7 +91,7 @@
|
|||||||
}
|
}
|
||||||
@if (getFundingType()) {
|
@if (getFundingType()) {
|
||||||
<div class="metric-item">
|
<div class="metric-item">
|
||||||
<mat-icon>paid</mat-icon>
|
<mat-icon>{{ PAID_ICON }}</mat-icon>
|
||||||
<div class="metric-content">
|
<div class="metric-content">
|
||||||
<strong>{{ getFundingType() }}</strong>
|
<strong>{{ getFundingType() }}</strong>
|
||||||
<span>Förderung</span>
|
<span>Förderung</span>
|
||||||
@@ -100,7 +100,7 @@
|
|||||||
}
|
}
|
||||||
@if (getInternationalRelation()) {
|
@if (getInternationalRelation()) {
|
||||||
<div class="metric-item">
|
<div class="metric-item">
|
||||||
<mat-icon>public</mat-icon>
|
<mat-icon>{{ PUBLIC_ICON }}</mat-icon>
|
||||||
<div class="metric-content">
|
<div class="metric-content">
|
||||||
<strong>{{ getInternationalRelation() }}</strong>
|
<strong>{{ getInternationalRelation() }}</strong>
|
||||||
<span>Internationaler Bezug</span>
|
<span>Internationaler Bezug</span>
|
||||||
@@ -115,7 +115,7 @@
|
|||||||
@if (getDescription()) {
|
@if (getDescription()) {
|
||||||
<mat-card appearance="outlined" class="card">
|
<mat-card appearance="outlined" class="card">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<mat-icon>description</mat-icon>
|
<mat-icon>{{ DESCRIPTION_ICON }}</mat-icon>
|
||||||
<h2>Beschreibung</h2>
|
<h2>Beschreibung</h2>
|
||||||
</div>
|
</div>
|
||||||
<p class="description-text">{{ getDescription() }}</p>
|
<p class="description-text">{{ getDescription() }}</p>
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
@if (getFinalReportAbstract()) {
|
@if (getFinalReportAbstract()) {
|
||||||
<mat-card appearance="outlined" class="card">
|
<mat-card appearance="outlined" class="card">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<mat-icon>fact_check</mat-icon>
|
<mat-icon>{{ FACT_CHECK_ICON }}</mat-icon>
|
||||||
<h2>Abschlussbericht</h2>
|
<h2>Abschlussbericht</h2>
|
||||||
</div>
|
</div>
|
||||||
<p class="description-text">{{ getFinalReportAbstract() }}</p>
|
<p class="description-text">{{ getFinalReportAbstract() }}</p>
|
||||||
@@ -146,7 +146,7 @@
|
|||||||
<!-- Beteiligte Personen -->
|
<!-- Beteiligte Personen -->
|
||||||
<mat-card appearance="outlined" class="card">
|
<mat-card appearance="outlined" class="card">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<mat-icon>people</mat-icon>
|
<mat-icon>{{ PEOPLE_ICON }}</mat-icon>
|
||||||
<h2>Beteiligte Personen</h2>
|
<h2>Beteiligte Personen</h2>
|
||||||
<span class="count-badge">{{ getPersonCount() }}</span>
|
<span class="count-badge">{{ getPersonCount() }}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -184,7 +184,7 @@
|
|||||||
<!-- Beteiligte Institutionen -->
|
<!-- Beteiligte Institutionen -->
|
||||||
<mat-card appearance="outlined" class="card">
|
<mat-card appearance="outlined" class="card">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<mat-icon>business</mat-icon>
|
<mat-icon>{{ BUSINESS_ICON }}</mat-icon>
|
||||||
<h2>Beteiligte Institutionen</h2>
|
<h2>Beteiligte Institutionen</h2>
|
||||||
<span class="count-badge">{{ getInstitutionCount() }}</span>
|
<span class="count-badge">{{ getInstitutionCount() }}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -196,7 +196,7 @@
|
|||||||
searchForInstitutionName(getInstitutionName(institution))
|
searchForInstitutionName(getInstitutionName(institution))
|
||||||
"
|
"
|
||||||
class="institution-item">
|
class="institution-item">
|
||||||
<mat-icon>apartment</mat-icon>
|
<mat-icon>{{ APARTMENT_ICON }}</mat-icon>
|
||||||
<div class="institution-details">
|
<div class="institution-details">
|
||||||
<span>{{ getInstitutionName(institution) }}</span>
|
<span>{{ getInstitutionName(institution) }}</span>
|
||||||
@if (getInstitutionRoleLabel(institution)) {
|
@if (getInstitutionRoleLabel(institution)) {
|
||||||
@@ -220,7 +220,7 @@
|
|||||||
@if (getSubprojects().length > 0) {
|
@if (getSubprojects().length > 0) {
|
||||||
<mat-card appearance="outlined" class="card">
|
<mat-card appearance="outlined" class="card">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<mat-icon>account_tree</mat-icon>
|
<mat-icon>{{ ACCOUNT_TREE_ICON }}</mat-icon>
|
||||||
<h2>Teilprojekte</h2>
|
<h2>Teilprojekte</h2>
|
||||||
<span class="count-badge">{{ getSubprojects().length }}</span>
|
<span class="count-badge">{{ getSubprojects().length }}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -264,7 +264,7 @@
|
|||||||
@if (getPublications().length > 0) {
|
@if (getPublications().length > 0) {
|
||||||
<mat-card appearance="outlined" class="card">
|
<mat-card appearance="outlined" class="card">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<mat-icon>menu_book</mat-icon>
|
<mat-icon>{{ MENU_BOOK_ICON }}</mat-icon>
|
||||||
<h2>Publikationen</h2>
|
<h2>Publikationen</h2>
|
||||||
<span class="count-badge">{{ getPublications().length }}</span>
|
<span class="count-badge">{{ getPublications().length }}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -301,7 +301,7 @@
|
|||||||
@if (getWebsiteHtml()) {
|
@if (getWebsiteHtml()) {
|
||||||
<mat-card appearance="outlined" class="card">
|
<mat-card appearance="outlined" class="card">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<mat-icon>language</mat-icon>
|
<mat-icon>{{ LANGUAGE_ICON }}</mat-icon>
|
||||||
<h2>Projektwebseite</h2>
|
<h2>Projektwebseite</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="website-html" [innerHTML]="getWebsiteHtml()"></div>
|
<div class="website-html" [innerHTML]="getWebsiteHtml()"></div>
|
||||||
@@ -313,7 +313,7 @@
|
|||||||
<!-- Projektdetails -->
|
<!-- Projektdetails -->
|
||||||
<mat-card appearance="outlined" class="card details-card">
|
<mat-card appearance="outlined" class="card details-card">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<mat-icon>info</mat-icon>
|
<mat-icon>{{ INFO_ICON }}</mat-icon>
|
||||||
<h2>Projektdetails</h2>
|
<h2>Projektdetails</h2>
|
||||||
</div>
|
</div>
|
||||||
<dl class="details-list">
|
<dl class="details-list">
|
||||||
@@ -395,7 +395,7 @@
|
|||||||
} @else {
|
} @else {
|
||||||
<div class="error-container">
|
<div class="error-container">
|
||||||
<div class="error-state">
|
<div class="error-state">
|
||||||
<mat-icon>error_outline</mat-icon>
|
<mat-icon>{{ ERROR_OUTLINE_ICON }}</mat-icon>
|
||||||
<p>DFG Projekt nicht gefunden.</p>
|
<p>DFG Projekt nicht gefunden.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,6 +11,28 @@ import { DfgProjectPersonRole } from '../../../api/model/dfgProjectPersonRole';
|
|||||||
import { DFGProjectFachgebieteInner } from '../../../api/model/dFGProjectFachgebieteInner';
|
import { DFGProjectFachgebieteInner } from '../../../api/model/dFGProjectFachgebieteInner';
|
||||||
import { ProjectOaTopicsComponent } from '../../../shared/ui/project-oa-topics/project-oa-topics.component';
|
import { ProjectOaTopicsComponent } from '../../../shared/ui/project-oa-topics/project-oa-topics.component';
|
||||||
import { DfgClassificationComponent } from '../../../shared/ui/dfg-classification/dfg-classification.component';
|
import { DfgClassificationComponent } from '../../../shared/ui/dfg-classification/dfg-classification.component';
|
||||||
|
import {
|
||||||
|
ACCESS_TIME_ICON,
|
||||||
|
ACCOUNT_TREE_ICON,
|
||||||
|
APARTMENT_ICON,
|
||||||
|
BUSINESS_ICON,
|
||||||
|
CALENDAR_ICON,
|
||||||
|
CHEVRON_RIGHT_ICON,
|
||||||
|
CIRCLE_ICON,
|
||||||
|
DESCRIPTION_ICON,
|
||||||
|
ERROR_OUTLINE_ICON,
|
||||||
|
EVENT_BUSY_ICON,
|
||||||
|
FACT_CHECK_ICON,
|
||||||
|
GAVEL_ICON,
|
||||||
|
INFO_ICON,
|
||||||
|
LANGUAGE_ICON,
|
||||||
|
MENU_BOOK_ICON,
|
||||||
|
OPEN_IN_NEW_ICON,
|
||||||
|
PAID_ICON,
|
||||||
|
PEOPLE_ICON,
|
||||||
|
PUBLIC_ICON,
|
||||||
|
} from '../../../shared/ui/icons';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dfg-details',
|
selector: 'app-dfg-details',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
@@ -25,6 +47,26 @@ import { DfgClassificationComponent } from '../../../shared/ui/dfg-classificatio
|
|||||||
styleUrl: './dfg-details.component.scss',
|
styleUrl: './dfg-details.component.scss',
|
||||||
})
|
})
|
||||||
export class DfgDetailsComponent implements OnInit {
|
export class DfgDetailsComponent implements OnInit {
|
||||||
|
readonly CHEVRON_RIGHT_ICON = CHEVRON_RIGHT_ICON;
|
||||||
|
readonly CIRCLE_ICON = CIRCLE_ICON;
|
||||||
|
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
|
||||||
|
readonly LANGUAGE_ICON = LANGUAGE_ICON;
|
||||||
|
readonly CALENDAR_ICON = CALENDAR_ICON;
|
||||||
|
readonly EVENT_BUSY_ICON = EVENT_BUSY_ICON;
|
||||||
|
readonly ACCESS_TIME_ICON = ACCESS_TIME_ICON;
|
||||||
|
readonly GAVEL_ICON = GAVEL_ICON;
|
||||||
|
readonly PAID_ICON = PAID_ICON;
|
||||||
|
readonly PUBLIC_ICON = PUBLIC_ICON;
|
||||||
|
readonly DESCRIPTION_ICON = DESCRIPTION_ICON;
|
||||||
|
readonly FACT_CHECK_ICON = FACT_CHECK_ICON;
|
||||||
|
readonly PEOPLE_ICON = PEOPLE_ICON;
|
||||||
|
readonly BUSINESS_ICON = BUSINESS_ICON;
|
||||||
|
readonly APARTMENT_ICON = APARTMENT_ICON;
|
||||||
|
readonly ACCOUNT_TREE_ICON = ACCOUNT_TREE_ICON;
|
||||||
|
readonly MENU_BOOK_ICON = MENU_BOOK_ICON;
|
||||||
|
readonly INFO_ICON = INFO_ICON;
|
||||||
|
readonly ERROR_OUTLINE_ICON = ERROR_OUTLINE_ICON;
|
||||||
|
|
||||||
private route = inject(ActivatedRoute);
|
private route = inject(ActivatedRoute);
|
||||||
dfgProject: DfgProjectDetails | undefined;
|
dfgProject: DfgProjectDetails | undefined;
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user