From 722f95fad1f72746bdff4dfb7f2d1f73e5d23a0d Mon Sep 17 00:00:00 2001 From: genja Date: Wed, 18 Nov 2026 18:21:07 +0100 Subject: [PATCH] added founder table filters to the founder dashboard --- .../founder-dashboard.component.html | 49 +++++++++++++- .../founder-dashboard.component.scss | 40 ++++++++++-- .../founder-dashboard.component.ts | 64 +++++++++++++++++++ 3 files changed, 147 insertions(+), 6 deletions(-) diff --git a/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.html b/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.html index 490c615f..87aaa471 100644 --- a/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.html +++ b/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.html @@ -57,8 +57,53 @@ -
- {{ fmtInt(total()) }} {{ total() === 1 ? 'Person' : 'Personen' }} +
+ + Mindestwert + + {{ INFO_OUTLINE_ICON }} + + + + Aktiv + + + + + {{ thresholdDraft() }} + + Auffällige Profile ausblenden + + + {{ fmtInt(total()) }} {{ total() === 1 ? 'Person' : 'Personen' }} +
diff --git a/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.scss b/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.scss index 6fd17256..8ccb2ac9 100644 --- a/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.scss +++ b/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.scss @@ -77,10 +77,42 @@ } } -.list-count { - margin: 1rem 0; - font-size: 0.875rem; - color: var(--sg-text-soft); +.controls { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 10px 22px; + margin-bottom: 16px; + padding: 12px 14px; + border: 1px solid var(--sg-border); + border-radius: 10px; + background: var(--sg-surface-muted); + font-size: 13px; + + &__range { + display: inline-flex; + align-items: center; + gap: 6px; + color: var(--sg-text-muted); + } + + &__value { + display: inline-block; + min-width: 24px; + color: var(--sg-text); + font-weight: 700; + font-variant-numeric: tabular-nums; + } + + &__count { + margin-left: auto; + color: var(--sg-text-soft); + } + + &__slider { + width: 220px; + min-width: 160px; + } } .list-card { diff --git a/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.ts b/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.ts index 4fd747b3..5a79549f 100644 --- a/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.ts +++ b/webapp/src/app/modules/founder-potential/founder-dashboard/founder-dashboard.component.ts @@ -1,8 +1,10 @@ import { Component, computed, + effect, inject, input, + signal, TemplateRef, viewChild, } from '@angular/core'; @@ -13,6 +15,8 @@ import { MatCardModule } from '@angular/material/card'; import { MatButtonModule } from '@angular/material/button'; import { MatDialog } from '@angular/material/dialog'; import { MatIconModule } from '@angular/material/icon'; +import { MatSliderModule } from '@angular/material/slider'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; import { MatTooltipModule } from '@angular/material/tooltip'; import { RouterLink } from '@angular/router'; import { ComponentTooltipDirective } from '../../../directives/component-tooltip.directive'; @@ -75,6 +79,8 @@ interface FounderRow { MatCardModule, MatButtonModule, MatIconModule, + MatSliderModule, + MatSlideToggleModule, MatTooltipModule, QueryParamPaginatorComponent, ChipComponent, @@ -170,6 +176,15 @@ export class FounderDashboardComponent { readonly careerBucketTooltip = careerBucketDescription; + readonly thresholdTooltip = + 'Legt fest, ab welchem Rang Personen in der Liste erscheinen. 90 ist streng und zeigt nur die obersten 10 % der Vergleichsgruppe; 50 zeigt die obere Hälfte. Ohne Mindestwert werden alle Profile angezeigt.'; + + readonly thresholdToggleTooltip = + 'Standardmäßig werden alle Profile angezeigt. Aktiviere den Mindestwert, um nur Personen ab einem bestimmten Rang zu sehen.'; + + readonly screeningTooltip = + 'Blendet Profile aus, die vermutlich unvollständig, falsch datiert oder mit anderen Personen vermischt sind. Die Werte dieser Personen sind weniger verlässlich. Ist die Option aus, werden alle Profile angezeigt.'; + // -- KPIs --------------------------------------------------------------- readonly kpis = computed(() => { @@ -265,6 +280,55 @@ export class FounderDashboardComponent { // -- Controls ----------------------------------------------------------- + /** Live slider value while dragging; committed to the URL on release. */ + readonly thresholdDraft = signal(DEFAULT_THRESHOLD); + + constructor() { + effect(() => this.thresholdDraft.set(this.threshold())); + } + + readonly formatThreshold = (value: number): string => String(value); + + /** Enables or disables the threshold filter (writes/removes the URL param). */ + onThresholdEnabledChange(enabled: boolean): void { + void this.router.navigate([], { + relativeTo: this.route, + queryParams: { + threshold: enabled ? this.thresholdDraft() : null, + page: 0, + }, + queryParamsHandling: 'merge', + }); + } + + onSliderInput(value: number): void { + if (Number.isFinite(value)) this.thresholdDraft.set(value); + } + + /** Commits the threshold value to the URL. */ + onSliderCommit(value = this.thresholdDraft()): void { + if (!this.thresholdEnabled() || !Number.isFinite(value)) return; + this.thresholdDraft.set(value); + if (value === this.threshold()) return; + void this.router.navigate([], { + relativeTo: this.route, + queryParams: { threshold: value, page: 0 }, + queryParamsHandling: 'merge', + }); + } + + /** + * `screened=false` means "only rejected profiles" on the backend, so turning + * the toggle off must REMOVE the param (everyone), not set false. + */ + onScreenedChange(checked: boolean): void { + void this.router.navigate([], { + relativeTo: this.route, + queryParams: { screened: checked ? 'true' : null, page: 0 }, + queryParamsHandling: 'merge', + }); + } + onLowerThreshold(): void { const next = Math.max(50, this.threshold() - 10); void this.router.navigate([], {