diff --git a/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.html b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.html index fe4deb59..5ec55e27 100644 --- a/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.html +++ b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.html @@ -63,6 +63,50 @@ [showNormalizedPreview]="true" (weightsChange)="onWeightsChange($event)" (applyWeights)="onApplyWeights($event)"> +
+ + Art der Work + + + + @for (pt of filteredPubTypes(); track pt) { + {{ pt }} + } + + +
+
date_range diff --git a/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.scss b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.scss index ad9c8b1d..bb2547eb 100644 --- a/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.scss +++ b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.scss @@ -108,3 +108,13 @@ width: 100%; margin: 0; } + +::ng-deep .pub-type-search { + display: flex; + align-items: center; + position: sticky; + top: 0; + z-index: 10; + background: white; + border-bottom: 1px solid var(--sg-divider, rgba(0, 0, 0, 0.12)); +} diff --git a/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.ts b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.ts index abfec843..37725b8d 100644 --- a/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.ts +++ b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.ts @@ -9,6 +9,10 @@ import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatIconModule } from '@angular/material/icon'; import { MatSliderModule } from '@angular/material/slider'; import { MatSnackBar } from '@angular/material/snack-bar'; +import { FormsModule } from '@angular/forms'; +import { MatSelectModule } from '@angular/material/select'; +import { MatInputModule } from '@angular/material/input'; +import { MatFormFieldModule } from '@angular/material/form-field'; import { WeightMap, @@ -37,6 +41,10 @@ import { SearchResultsStateService } from '../search-results-state.service'; MatCheckboxModule, MatIconModule, MatSliderModule, + FormsModule, + MatSelectModule, + MatInputModule, + MatFormFieldModule, QueryParamPaginatorComponent, WeightsSlidersComponent, ], @@ -138,6 +146,66 @@ export class KeywordsToPersonsResultsComponent implements OnInit { readonly timespanFrom = signal(this.minYear); readonly timespanTo = signal(this.maxYear); + // publication types + readonly ALL_PUBLICATION_TYPES = [ + 'article', + 'other', + 'dataset', + 'book-chapter', + 'book', + 'dissertation', + 'preprint', + 'paratext', + 'libguides', + 'review', + 'letter', + 'reference-entry', + 'editorial', + 'peer-review', + 'report', + 'standard', + 'erratum', + 'retraction', + 'supplementary-materials', + 'book-section', + 'database', + 'software', + 'report-component', + 'grant', + ]; + + readonly pubTypeSearchTerm = signal(''); + + readonly selectedPubTypes = computed(() => { + const p = this.queryParams(); + const val = p?.['pubType']; + if (!val) return []; + return Array.isArray(val) ? val : val.split(','); + }); + + readonly filteredPubTypes = computed(() => { + const term = this.pubTypeSearchTerm().toLowerCase(); + if (!term) return this.ALL_PUBLICATION_TYPES; + return this.ALL_PUBLICATION_TYPES.filter((pt) => + pt.toLowerCase().includes(term), + ); + }); + + onPubTypesChange(selected: string[]) { + const val = selected.length > 0 ? selected.join(',') : null; + this.router.navigate([], { + relativeTo: this.route, + queryParams: { pubType: val, page: null }, + queryParamsHandling: 'merge', + }); + } + + onPubTypeKeydown(event: KeyboardEvent) { + if (event.key === ' ') { + event.stopPropagation(); + } + } + readonly authors = signal([]); readonly loading = signal(false); @@ -246,6 +314,10 @@ export class KeywordsToPersonsResultsComponent implements OnInit { const rawWeights = this.currentWeights().raw; const request: KeywordToAuthorRequest = { keywords: this.state.keywords(), + publication_types: + this.selectedPubTypes().length > 0 + ? this.selectedPubTypes() + : undefined, weights: { works: rawWeights['works'], citation: rawWeights['citations'],