diff --git a/webapp/src/app/modules/keywords-search/keywords-search.component.ts b/webapp/src/app/modules/keywords-search/keywords-search.component.ts index 4a279076..c5d1820c 100644 --- a/webapp/src/app/modules/keywords-search/keywords-search.component.ts +++ b/webapp/src/app/modules/keywords-search/keywords-search.component.ts @@ -623,7 +623,11 @@ export class KeywordsSearchComponent { } isSearchDisabled(): boolean { - return this.selectedKeywords().length === 0 || this.isExtracting(); + return ( + this.selectedKeywords().length === 0 || + this.isExtracting() || + this.loadingNewKeyword() + ); } onExtractKeywordsClick(): void { diff --git a/webapp/src/app/modules/keywords-search/search-results/search-results.component.html b/webapp/src/app/modules/keywords-search/search-results/search-results.component.html index b66690d0..65794279 100644 --- a/webapp/src/app/modules/keywords-search/search-results/search-results.component.html +++ b/webapp/src/app/modules/keywords-search/search-results/search-results.component.html @@ -59,29 +59,9 @@ - + @if (resultTabPanel) { + + } diff --git a/webapp/src/app/modules/keywords-search/search-results/search-results.component.scss b/webapp/src/app/modules/keywords-search/search-results/search-results.component.scss index b12c502a..61735b93 100644 --- a/webapp/src/app/modules/keywords-search/search-results/search-results.component.scss +++ b/webapp/src/app/modules/keywords-search/search-results/search-results.component.scss @@ -101,13 +101,6 @@ $touch-target: 44px; } } -/* ============================================================ - CHILD ROUTE NAV - ============================================================ */ -.result-nav { - margin-top: 0.5rem; -} - /* ============================================================ EMPTY STATE ============================================================ */ @@ -170,8 +163,4 @@ $touch-target: 44px; width: 100%; justify-content: center; } - - .result-nav { - overflow-x: auto; - } } diff --git a/webapp/src/app/modules/keywords-search/search-results/search-results.component.ts b/webapp/src/app/modules/keywords-search/search-results/search-results.component.ts index 2d73ed7b..1588a49a 100644 --- a/webapp/src/app/modules/keywords-search/search-results/search-results.component.ts +++ b/webapp/src/app/modules/keywords-search/search-results/search-results.component.ts @@ -1,12 +1,6 @@ -import { Component, computed, inject } from '@angular/core'; +import { Component, computed, inject, signal } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; -import { - ActivatedRoute, - Router, - RouterLink, - RouterLinkActive, - RouterOutlet, -} from '@angular/router'; +import { ActivatedRoute, Router, RouterOutlet } from '@angular/router'; import { MatTooltipModule } from '@angular/material/tooltip'; import { MatButtonModule } from '@angular/material/button'; import { MatCardModule } from '@angular/material/card'; @@ -34,19 +28,21 @@ import { PERSONS_ICON, PROJECT_ICON, } from '../../../shared/ui/icons'; - +import { + LinkTabNavBarComponent, + LinkTabNavBarItem, +} from '../../../shared/ui/link-tab-nav-bar/link-tab-nav-bar.component'; @Component({ selector: 'app-keywords-search-results', standalone: true, imports: [ - RouterLink, - RouterLinkActive, RouterOutlet, MatButtonModule, MatCardModule, MatIconModule, TopicChipComponent, MatTabsModule, + LinkTabNavBarComponent, MatSlideToggleModule, MatTooltipModule, ], @@ -76,6 +72,92 @@ export class KeywordsSearchResultsComponent { { path: 'trends', label: 'Visualisierung', icon: BAR_CHART_ICON }, ]; + _links = computed(() => { + const links: LinkTabNavBarItem[] = [ + { + label: 'Personen', + icon: PERSONS_ICON, + path: 'persons', + queryParams: { + keywords: this.state.payload()?.keywords?.join(','), + fuzzy: this.tabFuzzyValue('persons'), + topics: this.tabFuzzyValue('persons') ? this.state.topicIds() : null, + topicId: null, + }, + queryParamsHandling: 'replace', + disabled: false, + }, + { + label: 'Projekte', + icon: PROJECT_ICON, + path: 'projects', + queryParams: { + keywords: this.state.payload()?.keywords?.join(','), + fuzzy: this.tabFuzzyValue('projects'), + topics: this.tabFuzzyValue('projects') ? this.state.topicIds() : null, + topicId: null, + }, + queryParamsHandling: 'replace', + disabled: false, + }, + { + label: 'Patente', + icon: PATENT_ICON, + path: 'patents', + queryParams: { + keywords: this.state.payload()?.keywords?.join(','), + fuzzy: this.tabFuzzyValue('patents'), + topics: this.tabFuzzyValue('patents') ? this.state.topicIds() : null, + topicId: null, + }, + queryParamsHandling: 'replace', + disabled: false, + }, + { + label: 'Publikationen', + icon: ARTICLE_ICON, + path: 'works', + queryParams: { + keywords: this.state.payload()?.keywords?.join(','), + fuzzy: this.tabFuzzyValue('works'), + topics: this.tabFuzzyValue('works') ? this.state.topicIds() : null, + topicId: null, + }, + queryParamsHandling: 'replace', + disabled: false, + }, + { + label: 'Nachrichten', + icon: NEWS_ICON, + path: 'news', + queryParams: { + keywords: this.state.payload()?.keywords?.join(','), + fuzzy: this.tabFuzzyValue('news'), + topics: this.tabFuzzyValue('news') ? this.state.topicIds() : null, + topicId: null, + }, + queryParamsHandling: 'replace', + disabled: false, + }, + { + label: 'Visualisierung', + icon: BAR_CHART_ICON, + path: 'trends', + queryParams: { + keywords: this.state.payload()?.keywords?.join(','), + fuzzy: this.tabFuzzyValue('trends'), + topics: this.tabFuzzyValue('trends') ? this.state.topicIds() : null, + topicId: null, + }, + queryParamsHandling: 'replace', + disabled: false, + }, + ]; + return links; + }); + + private readonly lastUserFuzzy = signal(false); + readonly selectedKeywordCount = computed(() => this.state.keywords().length); readonly allKeywordEntries = computed(() => { const seen = new Set(); @@ -116,6 +198,15 @@ export class KeywordsSearchResultsComponent { }); } + // the Fuzzy Search toggle is locked on while the Personen tab is active + isPersonsTab(): boolean { + return this.route.snapshot.firstChild?.routeConfig?.path === 'persons'; + } + + tabFuzzyValue(path: string): boolean { + if (path === 'persons') return true; + return this.lastUserFuzzy(); + } goBackToSearch(): void { void this.router.navigate(['/keywords'], { queryParamsHandling: 'merge', diff --git a/webapp/src/app/shared/ui/app-author-chip/app-author-chip.component.ts b/webapp/src/app/shared/ui/app-author-chip/app-author-chip.component.ts index 276bfb24..59b983ff 100644 --- a/webapp/src/app/shared/ui/app-author-chip/app-author-chip.component.ts +++ b/webapp/src/app/shared/ui/app-author-chip/app-author-chip.component.ts @@ -87,6 +87,7 @@ export class AppAuthorChipComponent { } _onChipClick(event: MouseEvent | KeyboardEvent) { + event.stopPropagation(); const author = this._author(); if (this.handleChipClick && author) { this.handleChipClick.emit(author); diff --git a/webapp/src/app/shared/ui/app-topic-chip/app-topic-chip.component.ts b/webapp/src/app/shared/ui/app-topic-chip/app-topic-chip.component.ts index 51d5f3ca..34f1a405 100644 --- a/webapp/src/app/shared/ui/app-topic-chip/app-topic-chip.component.ts +++ b/webapp/src/app/shared/ui/app-topic-chip/app-topic-chip.component.ts @@ -90,6 +90,7 @@ export class AppTopicChipComponent { }); _onChipClick(event: MouseEvent | KeyboardEvent) { + event.stopPropagation(); const topic = this.topic(); if (this.isClickable() && this.handleChipClick && topic) { this.handleChipClick.emit(topic); diff --git a/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.html b/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.html index f55e54fb..37296c22 100644 --- a/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.html +++ b/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.html @@ -55,7 +55,7 @@ [matTooltip]="getInstitutionTooltipText(institutions[0])" matTooltipPosition="above" [attr.aria-label]="getInstitutionTooltipText(institutions[0])" - (click)="filterByInstitution(institutions[0])"> + (click)="filterByInstitution($event, institutions[0])"> {{ APARTMENT_ICON }} {{ institutions[0].name || institutions[0].recepient || '-' @@ -72,7 +72,7 @@ [class.active]="isFundingTypeActive(project.funding_type)" matTooltip="Nach Typ filtern" matTooltipPosition="above" - (click)="toggleFundingTypeFilter(project.funding_type)"> + (click)="toggleFundingTypeFilter($event, project.funding_type)"> {{ project.funding_type }} diff --git a/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.ts b/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.ts index be0ada59..ec199d6f 100644 --- a/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.ts +++ b/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.ts @@ -203,7 +203,8 @@ export class BundProjectTableComponent implements OnInit { if (normalized == 'übrige indirekte projektförderung') return 'help'; return 'info'; } - toggleFundingTypeFilter(type: string): void { + toggleFundingTypeFilter(event: Event, type: string): void { + event.stopPropagation(); const selectedTypes = this.selectedFundingTypesQueryParams(); if (selectedTypes.includes(type)) { this.router.navigate([], { @@ -271,7 +272,8 @@ export class BundProjectTableComponent implements OnInit { ); } - filterByInstitution(institution: any): void { + filterByInstitution(event: Event, institution: any): void { + event.stopPropagation(); const institutionName = institution.name ?? institution.recepient; if (!institutionName || !this.institutionFilterEnabled()) return; diff --git a/webapp/src/app/shared/ui/chip-overflow-toggle/chip-overflow-toggle.component.html b/webapp/src/app/shared/ui/chip-overflow-toggle/chip-overflow-toggle.component.html index d9c834d5..60d7ccc5 100644 --- a/webapp/src/app/shared/ui/chip-overflow-toggle/chip-overflow-toggle.component.html +++ b/webapp/src/app/shared/ui/chip-overflow-toggle/chip-overflow-toggle.component.html @@ -2,6 +2,6 @@ type="button" class="chip-overflow-toggle" [attr.aria-expanded]="expanded()" - (click)="toggle.emit()"> + (click)="handleToggleClick($event)"> {{ expanded() ? 'weniger' : '+' + hiddenCount() }} diff --git a/webapp/src/app/shared/ui/chip-overflow-toggle/chip-overflow-toggle.component.ts b/webapp/src/app/shared/ui/chip-overflow-toggle/chip-overflow-toggle.component.ts index 6beff800..cfc26514 100644 --- a/webapp/src/app/shared/ui/chip-overflow-toggle/chip-overflow-toggle.component.ts +++ b/webapp/src/app/shared/ui/chip-overflow-toggle/chip-overflow-toggle.component.ts @@ -10,5 +10,9 @@ export class ChipOverflowToggleComponent { expanded = input(false); hiddenCount = input(0); - toggle = output(); + toggle = output(); + handleToggleClick(event: MouseEvent): void { + event.stopPropagation(); + this.toggle.emit(event); + } } diff --git a/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.html b/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.html index 0fb0cdf6..22445463 100644 --- a/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.html +++ b/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.html @@ -37,10 +37,7 @@ @let isClassificationsExpanded = isProjectClassificationsExpanded(project); @let visibleClassifications = isClassificationsExpanded ? classifications : classifications.slice(0, 3); -
+
@for (classification of visibleClassifications; track $index) { + (click)="filterByAuthor($event, author.person_id!)"> {{ PERSON_ICON }} {{ author.full_name }} @@ -219,7 +216,7 @@ [matTooltip]="getInstitutionTooltipText(institution)" matTooltipPosition="above" [attr.aria-label]="getInstitutionTooltipText(institution)" - (click)="filterByInstitution(institution)"> + (click)="filterByInstitution($event, institution)"> {{ APARTMENT_ICON }} {{ institution.institute_name_de || institution.institute_name_en diff --git a/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.scss b/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.scss index 29bf2f5e..d4642344 100644 --- a/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.scss +++ b/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.scss @@ -112,7 +112,9 @@ flex-wrap: wrap; gap: 6px; } - +.classification-tags { + padding: 0.5rem 0.5rem; +} .topic-chips { max-width: 320px; } diff --git a/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.ts b/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.ts index c032aefd..f2c3bc16 100644 --- a/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.ts +++ b/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.ts @@ -234,7 +234,8 @@ export class DfgProjectTableComponent implements OnInit { } return `Autor: ${author.full_name}`; } - filterByAuthor(authorId: number): void { + filterByAuthor(event: Event, authorId: number): void { + event.stopPropagation(); if (!authorId || !this.authorFilterEnabled()) return; const selectedAuthorIds = this.selectedAuthorIdsQueryParams(); if (selectedAuthorIds.includes(String(authorId))) { @@ -317,7 +318,8 @@ export class DfgProjectTableComponent implements OnInit { ); } - filterByInstitution(institution: any): void { + filterByInstitution(event: Event, institution: any): void { + event.stopPropagation(); const institutionId = this.getProjectInstitutionId(institution); if (!institutionId || !this.institutionFilterEnabled()) return; diff --git a/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.html b/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.html index 81ec8023..46eaebd7 100644 --- a/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.html +++ b/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.html @@ -19,7 +19,7 @@ [class.active]="isTypeActive(project.project_type)" matTooltip="Nach Typ filtern" matTooltipPosition="above" - (click)="toggleTypeFilter(project.project_type)"> + (click)="toggleTypeFilter($event, project.project_type)"> {{ getProjectTypeLabel(project) }} @@ -92,7 +92,7 @@ [matTooltip]="getOrganizationTooltipText(organization)" matTooltipPosition="above" [attr.aria-label]="getOrganizationTooltipText(organization)" - (click)="filterByOrganization(organization)"> + (click)="filterByOrganization($event, organization)"> {{ APARTMENT_ICON }} {{ getOrganizationName(organization) }} @@ -106,7 +106,7 @@ + (toggle)="toggleProjectOrganizationsExpansion($event, project)" /> }
@@ -133,7 +133,7 @@ + (toggle)="toggleProjectTopicsExpansion($event, project)" /> }
diff --git a/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.ts b/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.ts index 26c5660b..9f9e2945 100644 --- a/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.ts +++ b/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.ts @@ -207,7 +207,8 @@ export class EuProjectTableComponent { isTypeActive(type: string): boolean { return this.selectedTypesQueryParams().includes(type); } - toggleTypeFilter(type: string): void { + toggleTypeFilter(event: Event, type: string): void { + event.stopPropagation(); const selectedTypes = this.selectedTypesQueryParams(); if (selectedTypes.includes(type)) { this.router.navigate([], { @@ -427,7 +428,11 @@ export class EuProjectTableComponent { return `Organisation: ${name}`; } - filterByOrganization(organization: EuCordisOrganizationSummary | any): void { + filterByOrganization( + event: Event, + organization: EuCordisOrganizationSummary | any, + ): void { + event.stopPropagation(); const organizationId = this.getOrganizationId(organization); if (!organizationId || !this.institutionFilterEnabled()) return; @@ -452,7 +457,11 @@ export class EuProjectTableComponent { return this.expandedProjectOrganizationsIds.includes(projectId); } - toggleProjectOrganizationsExpansion(project: EuCordisProjectSummary): void { + toggleProjectOrganizationsExpansion( + event: Event, + project: EuCordisProjectSummary, + ): void { + event.stopPropagation(); const projectId = this.getProjectId(project); if (!projectId) return; @@ -523,7 +532,11 @@ export class EuProjectTableComponent { return this.expandedProjectTopicsIds.includes(projectId); } - toggleProjectTopicsExpansion(project: EuCordisProjectSummary): void { + toggleProjectTopicsExpansion( + event: Event, + project: EuCordisProjectSummary, + ): void { + event.stopPropagation(); const projectId = this.getProjectId(project); if (!projectId) return;