fixed the expanded/collapsed bug for orgminer content, where no orgminer content was shown after a chart node was clicked
This commit is contained in:
@@ -88,27 +88,34 @@ export class HierarchyComponent implements OnInit {
|
||||
}
|
||||
|
||||
onHierarchyExpandedChange(expanded: boolean): void {
|
||||
if (this.hierarchyExpanded() === expanded) return;
|
||||
this.hierarchyExpanded.set(expanded);
|
||||
this.syncPanelState({ [HIERARCHY_PANEL_PARAM]: expanded });
|
||||
}
|
||||
|
||||
onOrganizationExpandedChange(expanded: boolean): void {
|
||||
if (this.organizationExpanded() === expanded) return;
|
||||
this.organizationExpanded.set(expanded);
|
||||
this.syncPanelState({ [ORGANIZATION_PANEL_PARAM]: expanded });
|
||||
}
|
||||
|
||||
onClassifiedPagesExpandedChange(expanded: boolean): void {
|
||||
if (this.classifiedPagesExpanded() === expanded) return;
|
||||
this.classifiedPagesExpanded.set(expanded);
|
||||
this.syncPanelState({ [CLASSIFIED_PAGES_PANEL_PARAM]: expanded });
|
||||
}
|
||||
|
||||
analyzeOrg(org: { name: string; url: string }) {
|
||||
this.hierarchyExpanded.set(false);
|
||||
this.organizationExpanded.set(true);
|
||||
void this.router.navigate([], {
|
||||
async analyzeOrg(org: { name: string; url: string }): Promise<void> {
|
||||
const organizationUrl = org.url.trim();
|
||||
if (!organizationUrl) return;
|
||||
|
||||
// No local signal.set() here: the queryParamMap subscription applies the state.
|
||||
// Setting hierarchyExpanded directly made the expansion panel emit
|
||||
// expandedChange, which started a second navigation without the org params.
|
||||
const navigated = await this.router.navigate([], {
|
||||
relativeTo: this.route,
|
||||
queryParams: {
|
||||
[ORGANIZATION_URL_PARAM]: org.url,
|
||||
[ORGANIZATION_URL_PARAM]: organizationUrl,
|
||||
[ORGANIZATION_NAME_PARAM]: org.name,
|
||||
[ORGMINER_EXPANDED_PARAM]: null,
|
||||
[ORGMINER_SELECTION_CATEGORY_PARAM]: null,
|
||||
@@ -121,6 +128,7 @@ export class HierarchyComponent implements OnInit {
|
||||
queryParamsHandling: 'merge',
|
||||
replaceUrl: true,
|
||||
});
|
||||
if (!navigated) console.warn('[Hierarchy] navigation was cancelled');
|
||||
}
|
||||
|
||||
private syncPanelState(queryParams: Record<string, boolean>): void {
|
||||
@@ -128,6 +136,7 @@ export class HierarchyComponent implements OnInit {
|
||||
relativeTo: this.route,
|
||||
queryParams,
|
||||
queryParamsHandling: 'merge',
|
||||
replaceUrl: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+244
-229
@@ -1,247 +1,262 @@
|
||||
<div class="orgminer">
|
||||
<!-- ============================ SIDEBAR ============================ -->
|
||||
<aside class="orgminer-sidebar">
|
||||
<div class="sidebar-header">
|
||||
<span class="sidebar-title">
|
||||
{{ orgName() || 'Organisation' }}
|
||||
</span>
|
||||
@if (data()) {
|
||||
<a
|
||||
class="sidebar-uri"
|
||||
[href]="data()!.uri"
|
||||
target="_blank"
|
||||
rel="noopener">
|
||||
{{ data()!.uri }}
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
@if (loading()) {
|
||||
<div class="orgminer-state">
|
||||
<mat-spinner diameter="32"></mat-spinner>
|
||||
<span>Lade Orgminer-Inhalte ...</span>
|
||||
</div>
|
||||
} @else if (!data()) {
|
||||
<div class="orgminer-state">
|
||||
<mat-icon>search_off</mat-icon>
|
||||
<span
|
||||
>Für {{ orgName() || 'diese Organisation' }} wurden keine
|
||||
Orgminer-Inhalte gefunden.</span
|
||||
>
|
||||
</div>
|
||||
} @else {
|
||||
<div class="orgminer">
|
||||
<!-- ============================ SIDEBAR ============================ -->
|
||||
<aside class="orgminer-sidebar">
|
||||
<div class="sidebar-header">
|
||||
<span class="sidebar-title">
|
||||
{{ orgName() || 'Organisation' }}
|
||||
</span>
|
||||
@if (data()) {
|
||||
<a
|
||||
class="sidebar-uri"
|
||||
[href]="data()!.uri"
|
||||
target="_blank"
|
||||
rel="noopener">
|
||||
{{ data()!.uri }}
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
|
||||
<nav class="accordion">
|
||||
<!-- STAFF -->
|
||||
<div class="accordion-section">
|
||||
<div class="splitted-accordion">
|
||||
<nav class="accordion">
|
||||
<!-- STAFF -->
|
||||
<div class="accordion-section">
|
||||
<div class="splitted-accordion">
|
||||
<button
|
||||
class="accordion-toggle"
|
||||
[class.active]="expandedCategory() === 'staff'"
|
||||
(click)="toggleCategory('staff')">
|
||||
<mat-icon>{{ PERSONS_ICON }}</mat-icon>
|
||||
<span class="cat-label">Personal</span>
|
||||
<span class="cat-count">{{ categoryCount('staff') }}</span>
|
||||
<span class="chevron" [class.open]="expandedCategory() === 'staff'"
|
||||
>▾</span
|
||||
>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@if (expandedCategory() === 'staff') {
|
||||
<ul class="accordion-list">
|
||||
@for (person of sortedStaff(); track person.name) {
|
||||
<li
|
||||
class="accordion-item"
|
||||
[class.selected]="isSelected('staff', person)"
|
||||
(click)="selectItem('staff', person)">
|
||||
{{ person.name }}
|
||||
@if (isVerified(person.name)) {
|
||||
<mat-icon
|
||||
class="verified-badge"
|
||||
matTooltip="Verified Staff Member"
|
||||
>verified</mat-icon
|
||||
>
|
||||
}
|
||||
</li>
|
||||
|
||||
<span></span>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
</div>
|
||||
|
||||
<!-- PROJECTS -->
|
||||
<div class="accordion-section">
|
||||
<button
|
||||
class="accordion-toggle"
|
||||
[class.active]="expandedCategory() === 'staff'"
|
||||
(click)="toggleCategory('staff')">
|
||||
<mat-icon>{{ PERSONS_ICON }}</mat-icon>
|
||||
<span class="cat-label">Personal</span>
|
||||
<span class="cat-count">{{ categoryCount('staff') }}</span>
|
||||
<span class="chevron" [class.open]="expandedCategory() === 'staff'"
|
||||
[class.active]="expandedCategory() === 'projects'"
|
||||
(click)="toggleCategory('projects')">
|
||||
<mat-icon>{{ PROJECT_ICON }}</mat-icon>
|
||||
<span class="cat-label">Projekte</span>
|
||||
<span class="cat-count">{{ categoryCount('projects') }}</span>
|
||||
<span class="chevron" [class.open]="expandedCategory() === 'projects'"
|
||||
>▾</span
|
||||
>
|
||||
</button>
|
||||
|
||||
@if (expandedCategory() === 'projects') {
|
||||
<ul class="accordion-list">
|
||||
@for (project of data()?.projects ?? []; track project.title) {
|
||||
<li
|
||||
class="accordion-item"
|
||||
[class.selected]="isSelected('projects', project)"
|
||||
(click)="selectItem('projects', project)">
|
||||
{{ project.title }}
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
</div>
|
||||
|
||||
@if (expandedCategory() === 'staff') {
|
||||
<ul class="accordion-list">
|
||||
@for (person of sortedStaff(); track person.name) {
|
||||
<li
|
||||
class="accordion-item"
|
||||
[class.selected]="isSelected('staff', person)"
|
||||
(click)="selectItem('staff', person)">
|
||||
{{ person.name }}
|
||||
@if (isVerified(person.name)) {
|
||||
<mat-icon
|
||||
class="verified-badge"
|
||||
matTooltip="Verified Staff Member"
|
||||
>verified</mat-icon
|
||||
>
|
||||
}
|
||||
</li>
|
||||
<!-- NEWS -->
|
||||
<div class="accordion-section">
|
||||
<button
|
||||
class="accordion-toggle"
|
||||
[class.active]="expandedCategory() === 'news'"
|
||||
(click)="toggleCategory('news')">
|
||||
<mat-icon>{{ NEWS_ICON }}</mat-icon>
|
||||
<span class="cat-label">Nachrichten</span>
|
||||
<span class="cat-count">{{ categoryCount('news') }}</span>
|
||||
<span class="chevron" [class.open]="expandedCategory() === 'news'"
|
||||
>▾</span
|
||||
>
|
||||
</button>
|
||||
|
||||
<span></span>
|
||||
@if (expandedCategory() === 'news') {
|
||||
<ul class="accordion-list">
|
||||
@for (n of data()?.news ?? []; track n.title) {
|
||||
<li
|
||||
class="accordion-item"
|
||||
[class.selected]="isSelected('news', n)"
|
||||
(click)="selectItem('news', n)">
|
||||
{{ n.title }}
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
</div>
|
||||
</nav>
|
||||
</aside>
|
||||
|
||||
<!-- ============================ DETAIL PANEL ============================ -->
|
||||
<main class="orgminer-detail">
|
||||
@if (!selection()) {
|
||||
<div class="empty-state">
|
||||
<p>Wählen Sie links ein Element aus, um Details anzuzeigen.</p>
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- ---------------------------- STAFF DETAIL ---------------------------- -->
|
||||
@if (selectedStaff(); as staff) {
|
||||
<div class="detail-card">
|
||||
<h2 class="detail-title">{{ staff.name }}</h2>
|
||||
|
||||
<div class="detail-fields">
|
||||
@if (staff.email) {
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">E-Mail</span>
|
||||
<a class="detail-value" [href]="'mailto:' + staff.email">{{
|
||||
staff.email
|
||||
}}</a>
|
||||
</div>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
</div>
|
||||
|
||||
<!-- PROJECTS -->
|
||||
<div class="accordion-section">
|
||||
<button
|
||||
class="accordion-toggle"
|
||||
[class.active]="expandedCategory() === 'projects'"
|
||||
(click)="toggleCategory('projects')">
|
||||
<mat-icon>{{ PROJECT_ICON }}</mat-icon>
|
||||
<span class="cat-label">Projekte</span>
|
||||
<span class="cat-count">{{ categoryCount('projects') }}</span>
|
||||
<span class="chevron" [class.open]="expandedCategory() === 'projects'"
|
||||
>▾</span
|
||||
>
|
||||
</button>
|
||||
|
||||
@if (expandedCategory() === 'projects') {
|
||||
<ul class="accordion-list">
|
||||
@for (project of data()?.projects ?? []; track project.title) {
|
||||
<li
|
||||
class="accordion-item"
|
||||
[class.selected]="isSelected('projects', project)"
|
||||
(click)="selectItem('projects', project)">
|
||||
{{ project.title }}
|
||||
</li>
|
||||
@if (staff.telefon) {
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Telefon</span>
|
||||
<a class="detail-value" [href]="'tel:' + staff.telefon">{{
|
||||
staff.telefon
|
||||
}}</a>
|
||||
</div>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
</div>
|
||||
|
||||
<!-- NEWS -->
|
||||
<div class="accordion-section">
|
||||
<button
|
||||
class="accordion-toggle"
|
||||
[class.active]="expandedCategory() === 'news'"
|
||||
(click)="toggleCategory('news')">
|
||||
<mat-icon>{{ NEWS_ICON }}</mat-icon>
|
||||
<span class="cat-label">Nachrichten</span>
|
||||
<span class="cat-count">{{ categoryCount('news') }}</span>
|
||||
<span class="chevron" [class.open]="expandedCategory() === 'news'"
|
||||
>▾</span
|
||||
>
|
||||
</button>
|
||||
|
||||
@if (expandedCategory() === 'news') {
|
||||
<ul class="accordion-list">
|
||||
@for (n of data()?.news ?? []; track n.title) {
|
||||
<li
|
||||
class="accordion-item"
|
||||
[class.selected]="isSelected('news', n)"
|
||||
(click)="selectItem('news', n)">
|
||||
{{ n.title }}
|
||||
</li>
|
||||
@if (staff.links?.length) {
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Links</span>
|
||||
<div class="detail-links">
|
||||
@for (link of staff.links; track link) {
|
||||
<a [href]="link" target="_blank" rel="noopener">{{ link }}</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
</div>
|
||||
</nav>
|
||||
</aside>
|
||||
|
||||
<!-- ============================ DETAIL PANEL ============================ -->
|
||||
<main class="orgminer-detail">
|
||||
@if (!selection()) {
|
||||
<div class="empty-state">
|
||||
<p>Wählen Sie links ein Element aus, um Details anzuzeigen.</p>
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- ---------------------------- STAFF DETAIL ---------------------------- -->
|
||||
@if (selectedStaff(); as staff) {
|
||||
<div class="detail-card">
|
||||
<h2 class="detail-title">{{ staff.name }}</h2>
|
||||
|
||||
<div class="detail-fields">
|
||||
@if (staff.email) {
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">E-Mail</span>
|
||||
<a class="detail-value" [href]="'mailto:' + staff.email">{{
|
||||
staff.email
|
||||
}}</a>
|
||||
</div>
|
||||
}
|
||||
@if (staff.telefon) {
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Telefon</span>
|
||||
<a class="detail-value" [href]="'tel:' + staff.telefon">{{
|
||||
staff.telefon
|
||||
}}</a>
|
||||
</div>
|
||||
}
|
||||
@if (staff.links?.length) {
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Links</span>
|
||||
<div class="detail-links">
|
||||
@for (link of staff.links; track link) {
|
||||
<a [href]="link" target="_blank" rel="noopener">{{ link }}</a>
|
||||
}
|
||||
@if (researchInterests(staff).length) {
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Forschungsinteressen</span>
|
||||
<div class="chip-list">
|
||||
@for (ri of researchInterests(staff); track ri) {
|
||||
<app-chip> {{ ri }}</app-chip>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (researchInterests(staff).length) {
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Forschungsinteressen</span>
|
||||
<div class="chip-list">
|
||||
@for (ri of researchInterests(staff); track ri) {
|
||||
<app-chip> {{ ri }}</app-chip>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
<app-keyword-wordcloud [words]="selection()?.item?.keywords || []" />
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- --------------------------- PROJECT DETAIL --------------------------- -->
|
||||
@if (selectedProject(); as project) {
|
||||
<div class="detail-card">
|
||||
<div class="detail-title-row">
|
||||
<h2 class="detail-title">{{ project.title }}</h2>
|
||||
@if (project.project_type) {
|
||||
<app-chip>
|
||||
{{ project.project_type }}
|
||||
</app-chip>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="detail-fields">
|
||||
@if (project.topic) {
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Thema</span>
|
||||
<span class="detail-value">{{ project.topic }}</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<app-keyword-wordcloud [words]="selection()?.item?.keywords || []" />
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- --------------------------- PROJECT DETAIL --------------------------- -->
|
||||
@if (selectedProject(); as project) {
|
||||
<div class="detail-card">
|
||||
<div class="detail-title-row">
|
||||
<h2 class="detail-title">{{ project.title }}</h2>
|
||||
@if (project.project_type) {
|
||||
<app-chip>
|
||||
{{ project.project_type }}
|
||||
</app-chip>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="detail-fields">
|
||||
@if (project.topic) {
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Thema</span>
|
||||
<span class="detail-value">{{ project.topic }}</span>
|
||||
</div>
|
||||
}
|
||||
@if (project.names) {
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Verantwortlich</span>
|
||||
<span class="detail-value">{{ project.names }}</span>
|
||||
</div>
|
||||
}
|
||||
@if (project.links?.length) {
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Links</span>
|
||||
<div class="detail-links">
|
||||
@for (link of project.links; track $index) {
|
||||
<a [href]="link" target="_blank" rel="noopener">{{ link }}</a>
|
||||
}
|
||||
}
|
||||
@if (project.names) {
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Verantwortlich</span>
|
||||
<span class="detail-value">{{ project.names }}</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<app-keyword-wordcloud [words]="selection()?.item?.keywords || []" />
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- ----------------------------- NEWS DETAIL ----------------------------- -->
|
||||
@if (selectedNews(); as news) {
|
||||
<div class="detail-card">
|
||||
<h2 class="detail-title">{{ news.title }}</h2>
|
||||
|
||||
<div class="detail-fields">
|
||||
@if (news.date) {
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Datum</span>
|
||||
<span class="detail-value">{{ news.date }}</span>
|
||||
</div>
|
||||
}
|
||||
@if (news.topic) {
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Thema</span>
|
||||
<span class="detail-value">{{ news.topic }}</span>
|
||||
</div>
|
||||
}
|
||||
@if (news.links?.length) {
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Links</span>
|
||||
<div class="detail-links">
|
||||
@for (link of news.links; track link) {
|
||||
<a [href]="link" target="_blank" rel="noopener">{{ link }}</a>
|
||||
}
|
||||
}
|
||||
@if (project.links?.length) {
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Links</span>
|
||||
<div class="detail-links">
|
||||
@for (link of project.links; track $index) {
|
||||
<a [href]="link" target="_blank" rel="noopener">{{ link }}</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<app-keyword-wordcloud [words]="selection()?.item?.keywords || []" />
|
||||
</div>
|
||||
}
|
||||
|
||||
<app-keyword-wordcloud [words]="selection()?.item?.keywords || []" />
|
||||
</div>
|
||||
}
|
||||
</main>
|
||||
</div>
|
||||
<!-- ----------------------------- NEWS DETAIL ----------------------------- -->
|
||||
@if (selectedNews(); as news) {
|
||||
<div class="detail-card">
|
||||
<h2 class="detail-title">{{ news.title }}</h2>
|
||||
|
||||
<div class="detail-fields">
|
||||
@if (news.date) {
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Datum</span>
|
||||
<span class="detail-value">{{ news.date }}</span>
|
||||
</div>
|
||||
}
|
||||
@if (news.topic) {
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Thema</span>
|
||||
<span class="detail-value">{{ news.topic }}</span>
|
||||
</div>
|
||||
}
|
||||
@if (news.links?.length) {
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Links</span>
|
||||
<div class="detail-links">
|
||||
@for (link of news.links; track link) {
|
||||
<a [href]="link" target="_blank" rel="noopener">{{ link }}</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<app-keyword-wordcloud [words]="selection()?.item?.keywords || []" />
|
||||
</div>
|
||||
}
|
||||
</main>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
.orgminer-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 12px;
|
||||
min-height: 320px;
|
||||
padding: 24px;
|
||||
border: 1px dashed var(--sg-border);
|
||||
border-radius: 8px;
|
||||
background: var(--sg-card-bg);
|
||||
color: var(--sg-text-muted);
|
||||
font-size: 0.95rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.orgminer {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
|
||||
@@ -28,6 +28,7 @@ import {
|
||||
NEWS_ICON,
|
||||
} from '../../../shared/ui/icons';
|
||||
import { MatTooltip } from '@angular/material/tooltip';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
import { OrgminerService } from '../../../api/api/orgminer.service';
|
||||
/* ------------------------------ Data model ------------------------------ */
|
||||
|
||||
@@ -50,6 +51,7 @@ interface Selection {
|
||||
MatIconModule,
|
||||
ChipComponent,
|
||||
MatTooltip,
|
||||
MatProgressSpinnerModule,
|
||||
],
|
||||
templateUrl: './orgminer-content.component.html',
|
||||
styleUrls: ['./orgminer-content.component.scss'],
|
||||
@@ -63,7 +65,11 @@ export class OrgminerContentComponent implements OnInit {
|
||||
private readonly route = inject(ActivatedRoute);
|
||||
private readonly destroyRef = inject(DestroyRef);
|
||||
private isOwnNavigation = false;
|
||||
readonly data = toSignal(
|
||||
/**
|
||||
* `undefined` means the request is still running, `null` means the backend
|
||||
* knows no orgminer document for this URL.
|
||||
*/
|
||||
readonly data = toSignal<OrgminerContent | null | undefined>(
|
||||
toObservable(this.orgUrl).pipe(
|
||||
switchMap((orgUrl) =>
|
||||
orgUrl
|
||||
@@ -73,8 +79,9 @@ export class OrgminerContentComponent implements OnInit {
|
||||
: of(null),
|
||||
),
|
||||
),
|
||||
{ initialValue: null },
|
||||
{ initialValue: undefined },
|
||||
);
|
||||
readonly loading = computed(() => this.data() === undefined);
|
||||
private readonly restoreStateEffect = effect(() => {
|
||||
if (this.data()) {
|
||||
this.restoreStateFromUrl();
|
||||
|
||||
Reference in New Issue
Block a user