feature/person-bio-generator #90
@@ -19,6 +19,11 @@ class Settings(BaseSettings):
|
||||
auth_disabled: bool = False
|
||||
auth_standalone: bool = True
|
||||
auth_secret: str = 'change-me-to-a-secure-secret-key'
|
||||
llm_api_url: str = 'https://project.nes.uni-due.de/llm2/api/generate'
|
||||
llm_api_token: str = 'c2d5e7ccf7a4760dd3d19bed2caed9d85ff7437400e0ea82a6d6f912ebc2f212'
|
||||
llm_model: str = 'gemma4:e4b'
|
||||
elasticsearch_url: str = 'https://project.nes.uni-due.de/elastic/openalex-authors/_search'
|
||||
elasticsearch_api_key: str = 'am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ=='
|
||||
|
||||
settings = Settings()
|
||||
logger.info(f"Database URL: {settings.database_url}.")
|
||||
@@ -15,8 +15,11 @@ from sqlalchemy import insert
|
||||
from sqlalchemy import update
|
||||
from sqlalchemy import func
|
||||
import logging
|
||||
import httpx
|
||||
import json
|
||||
from . import schema
|
||||
from . import model
|
||||
from . import config
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -55,3 +58,86 @@ def insert_element(db: Session, value: S) -> S:
|
||||
db.flush()
|
||||
db.refresh(value)
|
||||
return value
|
||||
|
||||
def search_persons(author_id: Optional[str] = None, query: Optional[str] = None) -> model.PersonSearchResult:
|
||||
headers = {
|
||||
"Authorization": f"ApiKey {config.settings.elasticsearch_api_key}",
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
|
||||
if author_id:
|
||||
query_field = "_id"
|
||||
query_value = author_id
|
||||
elif query:
|
||||
query_field = "display_name"
|
||||
query_value = query
|
||||
else:
|
||||
return "Either author_id or query must be provided"
|
||||
|
||||
payload = {
|
||||
"query": {
|
||||
"query_string": {
|
||||
"default_field": query_field,
|
||||
"query": query_value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
with httpx.Client() as client:
|
||||
response = client.post(config.settings.elasticsearch_url, json=payload, headers=headers)
|
||||
response.raise_for_status()
|
||||
data = response.json()
|
||||
|
||||
persons = []
|
||||
for hit in data.get("hits", {}).get("hits", []):
|
||||
source = hit.get("_source", {})
|
||||
|
||||
affiliations = []
|
||||
for aff in source.get("affiliations", []):
|
||||
institution = aff.get("institution", {})
|
||||
affiliations.append(model.Affiliation(
|
||||
institution=institution.get("display_name", ""),
|
||||
country_code=institution.get("country_code", "")
|
||||
))
|
||||
|
||||
topics = [t.get("display_name", "") for t in source.get("topics", [])]
|
||||
|
||||
persons.append(model.Person(
|
||||
id=hit.get("_id", ""),
|
||||
name=source.get("display_name", ""),
|
||||
works_count=source.get("works_count", 0),
|
||||
cited_by_count=source.get("cited_by_count", 0),
|
||||
affiliations=affiliations,
|
||||
topics=topics
|
||||
))
|
||||
|
||||
return model.PersonSearchResult(persons=persons)
|
||||
|
||||
def generate_person_bio(author_id: str) -> str:
|
||||
search_result = search_persons(author_id=author_id)
|
||||
if not search_result.persons:
|
||||
return "No person found."
|
||||
if len(search_result.persons) > 1:
|
||||
return "Multiple persons found, cannot generate bio."
|
||||
|
||||
person = search_result.persons[0]
|
||||
person_json = json.dumps(person.model_dump())
|
||||
|
||||
system_prompt = "Erstelle eine Beschreibung der Person in 3-5 Sätzen. Gebe nur die Beschreibung zurück, ohne Einleitung oder Schluss."
|
||||
user_prompt = f"Daten zur Person:\n{person_json}"
|
||||
|
||||
headers = {
|
||||
"Authorization": f"Bearer {config.settings.llm_api_token}",
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
payload = {
|
||||
"model": config.settings.llm_model,
|
||||
"prompt": f"{system_prompt}\n{user_prompt}",
|
||||
"stream": False
|
||||
}
|
||||
|
||||
with httpx.Client(timeout=30.0) as client:
|
||||
response = client.post(config.settings.llm_api_url, json=payload, headers=headers)
|
||||
response.raise_for_status()
|
||||
data = response.json()
|
||||
return data.get("response", "")
|
||||
|
||||
@@ -10,6 +10,7 @@ from pydantic import Field
|
||||
from typing import List
|
||||
from typing import TypeVar
|
||||
from typing import Generic
|
||||
from typing import Optional
|
||||
|
||||
|
||||
T = TypeVar('T', bound=BaseModel)
|
||||
@@ -34,3 +35,21 @@ class Page(BaseModel, Generic[T]):
|
||||
|
||||
class ItemPage(Page[Item]):
|
||||
pass
|
||||
|
||||
class PersonBio(BaseModel):
|
||||
bio: str = Field(description="The generated biography.")
|
||||
|
||||
class Affiliation(BaseModel):
|
||||
institution: str = Field(description="Institution name.")
|
||||
country_code: Optional[str] = Field(default=None, description="Country code.")
|
||||
|
||||
class Person(BaseModel):
|
||||
id: str = Field(description="The person id.")
|
||||
name: str = Field(description="The person name.")
|
||||
works_count: int = Field(description="Number of works.")
|
||||
cited_by_count: int = Field(description="Number of citations.")
|
||||
affiliations: List[Affiliation] = Field(default=[], description="Affiliations.")
|
||||
topics: List[str] = Field(default=[], description="Research topics.")
|
||||
|
||||
class PersonSearchResult(BaseModel):
|
||||
persons: List[Person] = Field(default=[], description="List of found persons.")
|
||||
|
||||
@@ -112,3 +112,21 @@ def delete_item(id: Annotated[int, Path(description='The item id.', ge=0)],
|
||||
return Response(status_code=HTTP_200_OK)
|
||||
finally:
|
||||
db.commit()
|
||||
|
||||
@app.get('/persons/search',
|
||||
operation_id='searchPersons',
|
||||
response_model=model.PersonSearchResult,
|
||||
summary='Searches for persons by ID or name.',
|
||||
tags=[ 'Persons' ])
|
||||
def search_persons(author_id: Annotated[str, Query(description="OpenAlex author ID (e.g., A5093075883)")] = None,
|
||||
query: Annotated[str, Query(description="Search query (e.g., Arman AND Arzani)")] = None):
|
||||
return logic.search_persons(author_id, query)
|
||||
|
||||
@app.get('/persons/bio',
|
||||
operation_id='generatePersonBio',
|
||||
response_model=model.PersonBio,
|
||||
summary='Generates a bio for a person by author ID.',
|
||||
tags=[ 'Persons' ])
|
||||
def generate_person_bio(author_id: Annotated[str, Query(description="OpenAlex author ID (e.g., A5093075883)")]):
|
||||
bio = logic.generate_person_bio(author_id)
|
||||
return model.PersonBio(bio=bio)
|
||||
|
||||
+30
-4
@@ -15,7 +15,7 @@
|
||||
"prefix": "app",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:application",
|
||||
"builder": "@angular/build:application",
|
||||
"options": {
|
||||
"baseHref":"/inse-webapp/",
|
||||
"outputPath": "dist/inse",
|
||||
@@ -61,7 +61,7 @@
|
||||
"defaultConfiguration": "production"
|
||||
},
|
||||
"serve": {
|
||||
"builder": "@angular-devkit/build-angular:dev-server",
|
||||
"builder": "@angular/build:dev-server",
|
||||
"options": {
|
||||
"proxyConfig": "src/proxy.conf.json"
|
||||
},
|
||||
@@ -76,13 +76,13 @@
|
||||
"defaultConfiguration": "development"
|
||||
},
|
||||
"extract-i18n": {
|
||||
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||
"builder": "@angular/build:extract-i18n",
|
||||
"options": {
|
||||
"buildTarget": "inse:build"
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"builder": "@angular/build:karma",
|
||||
"options": {
|
||||
"polyfills": [
|
||||
"zone.js",
|
||||
@@ -106,5 +106,31 @@
|
||||
},
|
||||
"cli": {
|
||||
"analytics": false
|
||||
},
|
||||
"schematics": {
|
||||
"@schematics/angular:component": {
|
||||
"type": "component"
|
||||
},
|
||||
"@schematics/angular:directive": {
|
||||
"type": "directive"
|
||||
},
|
||||
"@schematics/angular:service": {
|
||||
"type": "service"
|
||||
},
|
||||
"@schematics/angular:guard": {
|
||||
"typeSeparator": "."
|
||||
},
|
||||
"@schematics/angular:interceptor": {
|
||||
"typeSeparator": "."
|
||||
},
|
||||
"@schematics/angular:module": {
|
||||
"typeSeparator": "."
|
||||
},
|
||||
"@schematics/angular:pipe": {
|
||||
"typeSeparator": "."
|
||||
},
|
||||
"@schematics/angular:resolver": {
|
||||
"typeSeparator": "."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ plugins {
|
||||
|
||||
node {
|
||||
download = true
|
||||
version = "20.15.1"
|
||||
version = "26.2.0"
|
||||
npmVersion = "10.7.0"
|
||||
}
|
||||
|
||||
|
||||
Generated
+5346
-9498
File diff suppressed because it is too large
Load Diff
+18
-16
@@ -10,24 +10,26 @@
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "^18.0.1",
|
||||
"@angular/cdk": "^18.0.1",
|
||||
"@angular/common": "^18.0.1",
|
||||
"@angular/compiler": "^18.0.1",
|
||||
"@angular/core": "^18.0.1",
|
||||
"@angular/forms": "^18.0.1",
|
||||
"@angular/material": "^18.0.1",
|
||||
"@angular/platform-browser": "^18.0.1",
|
||||
"@angular/platform-browser-dynamic": "^18.0.1",
|
||||
"@angular/router": "^18.0.1",
|
||||
"@angular/animations": "^21.2.14",
|
||||
"@angular/cdk": "^21.2.12",
|
||||
"@angular/common": "^21.2.14",
|
||||
"@angular/compiler": "^21.2.14",
|
||||
"@angular/core": "^21.2.14",
|
||||
"@angular/forms": "^21.2.14",
|
||||
"@angular/material": "^21.2.12",
|
||||
"@angular/platform-browser": "^21.2.14",
|
||||
"@angular/platform-browser-dynamic": "^21.2.14",
|
||||
"@angular/router": "^21.2.14",
|
||||
"echarts": "^6.1.0",
|
||||
"ngx-echarts": "^21.0.0",
|
||||
"rxjs": "~7.8.0",
|
||||
"tslib": "^2.3.0",
|
||||
"zone.js": "~0.14.3"
|
||||
"zone.js": "~0.15.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "^18.0.2",
|
||||
"@angular/cli": "^18.0.2",
|
||||
"@angular/compiler-cli": "^18.0.1",
|
||||
"@angular/build": "^21.2.12",
|
||||
"@angular/cli": "^21.2.12",
|
||||
"@angular/compiler-cli": "^21.2.14",
|
||||
"@types/jasmine": "~5.1.0",
|
||||
"jasmine-core": "~5.1.0",
|
||||
"karma": "~6.4.0",
|
||||
@@ -35,6 +37,6 @@
|
||||
"karma-coverage": "~2.2.0",
|
||||
"karma-jasmine": "~5.1.0",
|
||||
"karma-jasmine-html-reporter": "~2.1.0",
|
||||
"typescript": "~5.4.2"
|
||||
"typescript": "~5.9.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,40 +1,70 @@
|
||||
<div style="display: flex; flex-direction: column; height: 100svh; overflow: hidden;">
|
||||
<mat-toolbar class="main">
|
||||
<div>
|
||||
<ng-content select="[indicator]"></ng-content>
|
||||
</div>
|
||||
<div style="flex: 1;" class="menu">
|
||||
@if(mediaQuery.matches && (credentialService.authenticated | async)) {
|
||||
<button mat-icon-button (click)="toggle()"><mat-icon>menu</mat-icon></button>
|
||||
}
|
||||
@else {
|
||||
<a href="/inse-webapp/" style="color: white; text-decoration: none; font-weight: 600; font-size: 18px; letter-spacing: 0.03em;">My App</a>
|
||||
}
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: row;" class="menu">
|
||||
<ng-content select="[menu]"></ng-content>
|
||||
@if(credentialService.authenticated | async) {
|
||||
<button mat-icon-button (click)="logout()" matTooltip="Abmelden"><mat-icon>logout</mat-icon></button>
|
||||
}
|
||||
@else {
|
||||
<button mat-icon-button routerLink="/login" matTooltip="Anmelden"><mat-icon>login</mat-icon></button>
|
||||
}
|
||||
</div>
|
||||
</mat-toolbar>
|
||||
<div class="container">
|
||||
<mat-drawer-container style="width: 100%; height: 100%;">
|
||||
@if((credentialService.authenticated | async) && ((credentialService.superadmin | async) || (credentialService.universityadmin | async))) {
|
||||
<mat-drawer class="drawer" #drawer [mode]="mediaQuery.matches ? 'over' : 'side'" [(opened)]="sideNavOpen">
|
||||
<app-menu></app-menu>
|
||||
</mat-drawer>
|
||||
}
|
||||
<mat-drawer-content>
|
||||
<ng-content></ng-content>
|
||||
</mat-drawer-content>
|
||||
<div
|
||||
style="
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100svh;
|
||||
overflow: hidden;
|
||||
"
|
||||
>
|
||||
<mat-toolbar class="main">
|
||||
<div>
|
||||
<ng-content select="[indicator]"></ng-content>
|
||||
</div>
|
||||
<div style="flex: 1" class="menu">
|
||||
@if (mediaQuery.matches && (credentialService.authenticated | async)) {
|
||||
<button mat-icon-button (click)="toggle()">
|
||||
<mat-icon>menu</mat-icon>
|
||||
</button>
|
||||
} @else {
|
||||
<a
|
||||
href="/inse-webapp/"
|
||||
style="
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
font-size: 18px;
|
||||
letter-spacing: 0.03em;
|
||||
"
|
||||
>Smartguide</a
|
||||
>
|
||||
}
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: row" class="menu">
|
||||
<ng-content select="[menu]"></ng-content>
|
||||
@if (credentialService.authenticated | async) {
|
||||
<button mat-icon-button (click)="logout()" matTooltip="Abmelden">
|
||||
<mat-icon>logout</mat-icon>
|
||||
</button>
|
||||
} @else {
|
||||
<button mat-icon-button routerLink="/login" matTooltip="Anmelden">
|
||||
<mat-icon>login</mat-icon>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</mat-toolbar>
|
||||
<div class="container">
|
||||
<mat-drawer-container style="width: 100%; height: 100%">
|
||||
@if (
|
||||
(credentialService.authenticated | async) &&
|
||||
((credentialService.superadmin | async) ||
|
||||
(credentialService.universityadmin | async))
|
||||
) {
|
||||
<mat-drawer
|
||||
class="drawer"
|
||||
#drawer
|
||||
[mode]="mediaQuery.matches ? 'over' : 'side'"
|
||||
[(opened)]="sideNavOpen"
|
||||
>
|
||||
<app-menu></app-menu>
|
||||
</mat-drawer>
|
||||
}
|
||||
<mat-drawer-content>
|
||||
<ng-content></ng-content>
|
||||
</mat-drawer-content>
|
||||
</mat-drawer-container>
|
||||
</div>
|
||||
<div class="footer-container" >
|
||||
<div class="footer large">© 2024 My App</div>
|
||||
<div class="footer small">© 2024 My App</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer-container">
|
||||
<div class="footer large">© 2026 Smartguide</div>
|
||||
<div class="footer small">© 2026 Smartguide</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -11,11 +11,11 @@ import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
import { CredentialService } from '../services/credential.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-layout',
|
||||
standalone: true,
|
||||
imports: [CommonModule, MatToolbarModule, MatSidenavModule, MatButtonModule, MatIconModule, RouterLink, AppMenuComponent, MatTooltipModule],
|
||||
templateUrl: './app-layout.component.html',
|
||||
styleUrl: './app-layout.component.scss'
|
||||
selector: 'app-layout',
|
||||
imports: [CommonModule, MatToolbarModule, MatSidenavModule, MatButtonModule, MatIconModule, RouterLink, AppMenuComponent, MatTooltipModule],
|
||||
templateUrl: './app-layout.component.html',
|
||||
styleUrl: './app-layout.component.scss',
|
||||
standalone: true,
|
||||
})
|
||||
export class AppLayoutComponent implements OnInit, OnDestroy {
|
||||
|
||||
|
||||
@@ -11,11 +11,11 @@ import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-app-login',
|
||||
standalone: true,
|
||||
imports: [ CommonModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, MatButtonModule, MatIconModule, MatSnackBarModule ],
|
||||
templateUrl: './app-login.component.html',
|
||||
styleUrl: './app-login.component.scss'
|
||||
selector: 'app-app-login',
|
||||
imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, MatButtonModule, MatIconModule, MatSnackBarModule],
|
||||
templateUrl: './app-login.component.html',
|
||||
styleUrl: './app-login.component.scss',
|
||||
standalone: true,
|
||||
})
|
||||
export class AppLoginComponent implements OnInit, OnDestroy {
|
||||
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
<mat-nav-list style="width: 199px; padding: 10px;">
|
||||
<div matSubheader>Navigation</div>
|
||||
<mat-list-item routerLink="/items" routerLinkActive="active">
|
||||
<mat-icon matListItemIcon>list</mat-icon>
|
||||
<div matListItemTitle>Elemente</div>
|
||||
</mat-list-item>
|
||||
<mat-nav-list style="width: 199px; padding: 10px">
|
||||
<div matSubheader>Navigation</div>
|
||||
<mat-list-item routerLink="/items" routerLinkActive="active">
|
||||
<mat-icon matListItemIcon>list</mat-icon>
|
||||
<div matListItemTitle>Elemente</div>
|
||||
</mat-list-item>
|
||||
<mat-list-item routerLink="/person/0">
|
||||
<mat-icon matListItemIcon>person</mat-icon>
|
||||
<div matListItemTitle>Person 0</div>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { RouterLink, RouterLinkActive } from '@angular/router';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
@@ -6,11 +6,11 @@ import { MatListModule } from '@angular/material/list';
|
||||
import { CredentialService } from '../services/credential.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-menu',
|
||||
standalone: true,
|
||||
imports: [ CommonModule, RouterLink, MatIconModule, MatListModule, RouterLinkActive ],
|
||||
templateUrl: './app-menu.component.html',
|
||||
styleUrl: './app-menu.component.scss'
|
||||
selector: 'app-menu',
|
||||
imports: [RouterLink, MatIconModule, MatListModule, RouterLinkActive],
|
||||
templateUrl: './app-menu.component.html',
|
||||
styleUrl: './app-menu.component.scss',
|
||||
standalone: true,
|
||||
})
|
||||
export class AppMenuComponent {
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@ import { RouterOutlet } from '@angular/router';
|
||||
import { AppLayoutComponent } from './app-layout/app-layout.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
standalone: true,
|
||||
imports: [RouterOutlet, AppLayoutComponent ],
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss']
|
||||
selector: 'app-root',
|
||||
imports: [RouterOutlet, AppLayoutComponent],
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
})
|
||||
export class AppComponent {
|
||||
|
||||
|
||||
@@ -2,17 +2,50 @@ import { Routes } from '@angular/router';
|
||||
import { userGuard } from './guards/user.guard';
|
||||
|
||||
export const routes: Routes = [
|
||||
{
|
||||
path: 'login',
|
||||
loadComponent: () => import('./app-login/app-login.component').then(mod => mod.AppLoginComponent),
|
||||
},
|
||||
{
|
||||
path: 'items',
|
||||
canActivate: [ userGuard ],
|
||||
loadComponent: () => import('./list-item/list-item.component').then(mod => mod.ListItemComponent),
|
||||
},
|
||||
{
|
||||
path: '**',
|
||||
redirectTo: 'login'
|
||||
}
|
||||
{
|
||||
path: 'login',
|
||||
loadComponent: () =>
|
||||
import('./app-login/app-login.component').then(
|
||||
(mod) => mod.AppLoginComponent,
|
||||
),
|
||||
},
|
||||
{
|
||||
path: 'items',
|
||||
canActivate: [userGuard],
|
||||
loadComponent: () =>
|
||||
import('./list-item/list-item.component').then(
|
||||
(mod) => mod.ListItemComponent,
|
||||
),
|
||||
},
|
||||
{
|
||||
path: 'person/:id',
|
||||
canActivate: [userGuard],
|
||||
loadComponent: () =>
|
||||
import('./person/person.component').then((mod) => mod.PersonComponent),
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
pathMatch: 'full',
|
||||
redirectTo: 'overview',
|
||||
},
|
||||
{
|
||||
path: 'overview',
|
||||
loadComponent: () =>
|
||||
import('./person-overview/person-overview.component').then(
|
||||
(mod) => mod.PersonOverviewComponent,
|
||||
),
|
||||
},
|
||||
{
|
||||
path: 'network',
|
||||
loadComponent: () =>
|
||||
import('./person-network/person-network.component').then(
|
||||
(mod) => mod.PersonNetworkComponent,
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '**',
|
||||
redirectTo: 'login',
|
||||
},
|
||||
];
|
||||
|
||||
@@ -9,11 +9,11 @@ import {
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
|
||||
@Component({
|
||||
selector: 'app-confirmation-dialog',
|
||||
standalone: true,
|
||||
imports: [MatDialogActions, MatDialogClose, MatDialogContent, MatDialogTitle, MatButtonModule],
|
||||
templateUrl: './confirmation-dialog.component.html',
|
||||
styleUrl: './confirmation-dialog.component.scss'
|
||||
selector: 'app-confirmation-dialog',
|
||||
imports: [MatDialogActions, MatDialogClose, MatDialogContent, MatDialogTitle, MatButtonModule],
|
||||
templateUrl: './confirmation-dialog.component.html',
|
||||
styleUrl: './confirmation-dialog.component.scss',
|
||||
standalone: true,
|
||||
})
|
||||
export class ConfirmationDialogComponent {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
import { MatPaginator, MatPaginatorModule, PageEvent } from '@angular/material/paginator';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
@@ -15,15 +15,21 @@ import { ConfirmationDialogComponent } from '../confirmation-dialog/confirmation
|
||||
import { createLoadError } from '../utils/errorHandler';
|
||||
|
||||
@Component({
|
||||
selector: 'app-list-item',
|
||||
standalone: true,
|
||||
imports: [
|
||||
CommonModule, MatTableModule, MatPaginatorModule, MatButtonModule,
|
||||
MatIconModule, MatDialogModule, MatSnackBarModule, MatFormFieldModule,
|
||||
MatInputModule, ReactiveFormsModule
|
||||
],
|
||||
templateUrl: './list-item.component.html',
|
||||
styleUrl: './list-item.component.scss'
|
||||
selector: 'app-list-item',
|
||||
imports: [
|
||||
MatTableModule,
|
||||
MatPaginatorModule,
|
||||
MatButtonModule,
|
||||
MatIconModule,
|
||||
MatDialogModule,
|
||||
MatSnackBarModule,
|
||||
MatFormFieldModule,
|
||||
MatInputModule,
|
||||
ReactiveFormsModule
|
||||
],
|
||||
templateUrl: './list-item.component.html',
|
||||
styleUrl: './list-item.component.scss',
|
||||
standalone: true,
|
||||
})
|
||||
export class ListItemComponent implements OnInit {
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<p>person-network works!</p>
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-person-network',
|
||||
imports: [],
|
||||
templateUrl: './person-network.component.html',
|
||||
styleUrl: './person-network.component.scss',
|
||||
})
|
||||
export class PersonNetworkComponent {
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<p>person-overview works!</p>
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-person-overview',
|
||||
imports: [],
|
||||
templateUrl: './person-overview.component.html',
|
||||
styleUrl: './person-overview.component.scss',
|
||||
})
|
||||
export class PersonOverviewComponent {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<p>person works!</p>
|
||||
<nav mat-tab-nav-bar [tabPanel]="tabPanel">
|
||||
@for (link of links; track $index) {
|
||||
<a
|
||||
mat-tab-link
|
||||
[routerLink]="link.path"
|
||||
routerLinkActive
|
||||
#rla="routerLinkActive"
|
||||
[active]="rla.isActive"
|
||||
[disabled]="link.disabled"
|
||||
>
|
||||
{{ link.label }}
|
||||
</a>
|
||||
}
|
||||
</nav>
|
||||
<mat-tab-nav-panel #tabPanel></mat-tab-nav-panel>
|
||||
|
||||
<router-outlet></router-outlet>
|
||||
@@ -0,0 +1,19 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { MatTabsModule } from '@angular/material/tabs';
|
||||
import { RouterModule, RouterOutlet } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-person',
|
||||
imports: [MatTabsModule, RouterOutlet, RouterModule],
|
||||
templateUrl: './person.component.html',
|
||||
styleUrl: './person.component.scss',
|
||||
})
|
||||
export class PersonComponent {
|
||||
links = [
|
||||
{ label: 'Übersicht', path: 'overview', disabled: false },
|
||||
{ label: 'Projekte', path: 'projects', disabled: true },
|
||||
{ label: 'Publikationen', path: 'publications', disabled: true },
|
||||
{ label: 'Netzwerk', path: 'network', disabled: false },
|
||||
{ label: 'Gründungen', path: 'foundings', disabled: true },
|
||||
];
|
||||
}
|
||||
@@ -7,7 +7,7 @@ export function createLoadError(snackBar: MatSnackBar, retry: (()=>void)|undefin
|
||||
if (error instanceof HttpErrorResponse) {
|
||||
code = error.status;
|
||||
}
|
||||
var message = msg;
|
||||
let message = msg;
|
||||
if (code) {
|
||||
message += ' (Fehlercode: ' + code + ')';
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
import { provideZoneChangeDetection } from "@angular/core";
|
||||
import { bootstrapApplication } from '@angular/platform-browser';
|
||||
import { appConfig } from './app/app.config';
|
||||
import { AppComponent } from './app/app.component';
|
||||
|
||||
bootstrapApplication(AppComponent, appConfig)
|
||||
bootstrapApplication(AppComponent, {...appConfig, providers: [provideZoneChangeDetection(), ...appConfig.providers]})
|
||||
.catch((err) => console.error(err));
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
@use '@angular/material' as mat;
|
||||
@use 'm3-theme' as m3;
|
||||
|
||||
@include mat.core();
|
||||
@include mat.elevation-classes();
|
||||
@include mat.app-background();
|
||||
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
@@ -114,8 +115,8 @@ body {
|
||||
}
|
||||
|
||||
.menu button {
|
||||
--mdc-icon-button-disabled-icon-color: rgba(255,255,255,0.35);
|
||||
--mdc-icon-button-icon-color: #ffffff;
|
||||
--mat-icon-button-disabled-icon-color: rgba(255,255,255,0.35);
|
||||
--mat-icon-button-icon-color: #ffffff;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -13,15 +13,11 @@
|
||||
"sourceMap": true,
|
||||
"declaration": false,
|
||||
"experimentalDecorators": true,
|
||||
"moduleResolution": "node",
|
||||
"moduleResolution": "bundler",
|
||||
"importHelpers": true,
|
||||
"target": "ES2022",
|
||||
"module": "ES2022",
|
||||
"useDefineForClassFields": false,
|
||||
"lib": [
|
||||
"ES2022",
|
||||
"dom"
|
||||
]
|
||||
"useDefineForClassFields": false
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"enableI18nLegacyMessageIdFormat": false,
|
||||
|
||||
Reference in New Issue
Block a user