added shared multiplier filters to multipliers table

This commit is contained in:
2026-11-10 02:24:10 +01:00
parent 75a353125c
commit e1aafefb07
3 changed files with 163 additions and 0 deletions
@@ -0,0 +1,44 @@
<div class="content">
<app-query-param-input
queryParamKey="name"
label="Name suchen"
[debounceTime]="300" />
<div class="select-area">
<app-query-param-selector
[options]="roleOptions"
queryParamKey="tag"
label="Rollen-Badge"
[multiple]="true"
matTooltip="Zeigt nur Personen, die als Bridger, Mentor oder Amplifier eingestuft sind."
matTooltipClass="sg-tooltip-wide"
matTooltipPosition="above" />
<app-query-param-selector
[options]="careerOptions"
queryParamKey="careerBucket"
label="Karrierestufe"
[multiple]="true"
matTooltip="Zeigt nur Personen in der gewählten Karrierestufe."
matTooltipClass="sg-tooltip-wide"
matTooltipPosition="above" />
<app-query-param-selector
[options]="peerRankFieldOptions"
queryParamKey="peerRankField"
label="Rolle für Mindest-Rang"
matTooltip="Wählt die Rolle, deren Rang für den Mindest-Rang gilt."
matTooltipClass="sg-tooltip-wide"
matTooltipPosition="above" />
<app-query-param-selector
[options]="minRankOptions"
queryParamKey="minPeerRank"
label="Mindest-Rang"
matTooltip="Zeigt nur Personen, die diesen Rang in der gewählten Rolle mindestens erreichen."
matTooltipClass="sg-tooltip-wide"
matTooltipPosition="above" />
</div>
<app-selected-filters [observers]="observers" />
</div>
@@ -0,0 +1,19 @@
.content {
display: flex;
flex-direction: column;
gap: 1rem;
width: 100%;
}
.select-area {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
gap: 1rem;
align-items: start;
width: 100%;
}
.select-area app-query-param-selector {
display: block;
min-width: 0;
}
@@ -0,0 +1,100 @@
import { Component } from '@angular/core';
import { MatTooltipModule } from '@angular/material/tooltip';
import { CareerBucket, MultiplierTag, PeerRankField } from '../../../api';
import { tagLabel } from '../founder-potential.utils';
import { QueryParamInputComponent } from '../../../shared/ui/query-param-input/query-param-input.component';
import {
QueryParamSelectorComponent,
SelectorOption,
} from '../../../shared/ui/query-param-selector/query-param-selector.component';
import {
FilterObserver,
SelectedFiltersComponent,
} from '../../../shared/ui/selected-filters/selected-filters.component';
import {
FILTER_ICON,
NETWORK_ICON,
PERSON_ICON,
SEARCH_ICON,
TUNE_ICON,
} from '../../../shared/ui/icons';
@Component({
selector: 'app-multiplier-filters',
standalone: true,
imports: [
MatTooltipModule,
QueryParamInputComponent,
QueryParamSelectorComponent,
SelectedFiltersComponent,
],
templateUrl: './multiplier-filters.component.html',
styleUrl: './multiplier-filters.component.scss',
})
export class MultiplierFiltersComponent {
readonly roleOptions: SelectorOption[] = Object.values(MultiplierTag).map(
(value) => ({ value, display_name: tagLabel(value) }),
);
readonly careerOptions: SelectorOption[] = Object.values(CareerBucket).map(
(value) => ({ value, display_name: value }),
);
readonly peerRankFieldOptions: SelectorOption[] = [
{ value: PeerRankField.Max, display_name: 'Stärkste Rolle' },
...Object.values(MultiplierTag).map((value) => ({
value,
display_name: tagLabel(value),
})),
];
readonly minRankOptions: SelectorOption[] = [
50, 55, 60, 65, 70, 75, 80, 85, 90, 95,
].map((percent) => ({
value: String(percent / 100),
display_name: `ab ${percent} %`,
}));
readonly observers: FilterObserver[] = [
{
id: 'name',
queryParamKey: 'name',
icon: SEARCH_ICON,
removable: true,
},
{
id: 'tags',
queryParamKey: 'tag',
icon: NETWORK_ICON,
valueFormatter: (value) =>
value
.split(',')
.map((tag) => tagLabel(tag))
.join(', '),
removable: true,
},
{
id: 'career',
queryParamKey: 'careerBucket',
icon: PERSON_ICON,
valueFormatter: (value) => value.split(',').join(', '),
removable: true,
},
{
id: 'peerRankField',
queryParamKey: 'peerRankField',
icon: TUNE_ICON,
valueFormatter: (value) =>
value === PeerRankField.Max ? 'Stärkste Rolle' : tagLabel(value),
removable: true,
},
{
id: 'minPeerRank',
queryParamKey: 'minPeerRank',
icon: FILTER_ICON,
valueFormatter: (value) => `ab ${Math.round(Number(value) * 100)} %`,
removable: true,
},
];
}