diff --git a/webapp/src/app/app.routes.ts b/webapp/src/app/app.routes.ts index a69daf52..43d09f3f 100644 --- a/webapp/src/app/app.routes.ts +++ b/webapp/src/app/app.routes.ts @@ -788,7 +788,9 @@ export const routes: Routes = [ }, runGuardsAndResolvers: (from, to) => { return Object.values(workQueryParamKeys).some( - (key) => from.queryParamMap.get(key) !== to.queryParamMap.get(key), + (key) => + from.queryParamMap.getAll(key).join(',') !== + to.queryParamMap.getAll(key).join(','), ); }, }, @@ -852,7 +854,9 @@ export const routes: Routes = [ ), runGuardsAndResolvers: (from, to) => { return Object.values(workQueryParamKeys).some( - (key) => from.queryParamMap.get(key) !== to.queryParamMap.get(key), + (key) => + from.queryParamMap.getAll(key).join(',') !== + to.queryParamMap.getAll(key).join(','), ); }, resolve: { diff --git a/webapp/src/app/modules/patents/patents.component.html b/webapp/src/app/modules/patents/patents.component.html index b108eb33..d03b5edb 100644 --- a/webapp/src/app/modules/patents/patents.component.html +++ b/webapp/src/app/modules/patents/patents.component.html @@ -269,14 +269,16 @@ searchLabel="Suche nach Titel oder Patent-Nr." /> -
- - EPO - USPTO - +
+ + + EPO + USPTO + + - - EU - BUND - DFG - +
+ + + EU + BUND + DFG + + +
diff --git a/webapp/src/app/modules/projects/projects.component.scss b/webapp/src/app/modules/projects/projects.component.scss index ef8c12a0..cc146f5e 100644 --- a/webapp/src/app/modules/projects/projects.component.scss +++ b/webapp/src/app/modules/projects/projects.component.scss @@ -4,3 +4,12 @@ gap: 1rem; padding: 1rem; } + +.additional-filters { + display: flex; + padding: 0 1rem; + + app-filter-card { + min-height: 90px; + } +} diff --git a/webapp/src/app/modules/projects/projects.component.ts b/webapp/src/app/modules/projects/projects.component.ts index 07d02bfb..699be446 100644 --- a/webapp/src/app/modules/projects/projects.component.ts +++ b/webapp/src/app/modules/projects/projects.component.ts @@ -14,6 +14,7 @@ import { Page, } from '../../shared/ui/card-search/card-search.component'; import { FilterObserver } from '../../shared/ui/selected-filters/selected-filters.component'; +import { FilterCardComponent } from '../../shared/ui/filter-card/filter-card.component'; @Component({ selector: 'app-projects', @@ -26,6 +27,7 @@ import { FilterObserver } from '../../shared/ui/selected-filters/selected-filter MatChipsModule, CardSearchComponent, AppProjectCardComponent, + FilterCardComponent, ], templateUrl: './projects.component.html', styleUrl: './projects.component.scss', diff --git a/webapp/src/app/modules/publications/publications.component.html b/webapp/src/app/modules/publications/publications.component.html index 11992125..80e32d3a 100644 --- a/webapp/src/app/modules/publications/publications.component.html +++ b/webapp/src/app/modules/publications/publications.component.html @@ -16,7 +16,10 @@
- + diff --git a/webapp/src/app/modules/publications/publications.component.ts b/webapp/src/app/modules/publications/publications.component.ts index 50259642..68fda56b 100644 --- a/webapp/src/app/modules/publications/publications.component.ts +++ b/webapp/src/app/modules/publications/publications.component.ts @@ -1,8 +1,11 @@ -import { Component, computed, input } from '@angular/core'; +import { Component, computed, inject, input } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; import { + Author, AuthorPage, InstitutionPageV2, SortDirection, + Topic, TopicPageV2, WorkPageV2, WorkSortBy, @@ -15,6 +18,7 @@ import { MatDivider } from '@angular/material/divider'; import { AppPublicationCardComponent } from '../../shared/ui/app-publication-card/app-publication-card.component'; import { PublicationFilterComponent } from '../../shared/ui/publication-filters/publication-filters.component'; import { SelectorOption } from '../../shared/ui/query-param-selector/query-param-selector.component'; +import { workQueryParamKeys } from '../../resolvers/work-page.resolver'; @Component({ selector: 'app-publications', @@ -28,6 +32,9 @@ import { SelectorOption } from '../../shared/ui/query-param-selector/query-param styleUrl: './publications.component.scss', }) export class PublicationsComponent { + private readonly route = inject(ActivatedRoute); + private readonly router = inject(Router); + workPage = input.required(); selectedAuthorsPage = input.required(); selectedInstitutionsPage = input.required(); @@ -48,4 +55,42 @@ export class PublicationsComponent { { value: SortDirection.Asc, display_name: 'Aufsteigend' }, { value: SortDirection.Desc, display_name: 'Absteigend' }, ]; + + filterByTopic(topic: Topic): void { + if (!topic.id) return; + + const selectedTopicIds = this.route.snapshot.queryParamMap.getAll( + workQueryParamKeys.topicId, + ); + const nextTopicIds = selectedTopicIds.includes(topic.id) + ? selectedTopicIds.filter((id) => id !== topic.id) + : [...selectedTopicIds, topic.id]; + + this.router.navigate([], { + queryParams: { + [workQueryParamKeys.topicId]: nextTopicIds, + [workQueryParamKeys.page]: 0, + }, + queryParamsHandling: 'merge', + }); + } + + filterByAuthor(author: Author): void { + if (!author.id) return; + + const selectedAuthorIds = this.route.snapshot.queryParamMap.getAll( + workQueryParamKeys.authorId, + ); + const nextAuthorIds = selectedAuthorIds.includes(author.id) + ? selectedAuthorIds.filter((id) => id !== author.id) + : [...selectedAuthorIds, author.id]; + + this.router.navigate([], { + queryParams: { + [workQueryParamKeys.authorId]: nextAuthorIds, + [workQueryParamKeys.page]: 0, + }, + 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 58b4af86..10ff376d 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 @@ -77,8 +77,6 @@ export class AppAuthorChipComponent { if (this.handleChipClick && author) { this.handleChipClick.emit(author); } - - console.log('Chip clicked:', event); } stripOpenAlexId(id: string | null | undefined): string | undefined { diff --git a/webapp/src/app/shared/ui/app-institution-card/app-institution-card.component.scss b/webapp/src/app/shared/ui/app-institution-card/app-institution-card.component.scss index c85ff37c..d1295f50 100644 --- a/webapp/src/app/shared/ui/app-institution-card/app-institution-card.component.scss +++ b/webapp/src/app/shared/ui/app-institution-card/app-institution-card.component.scss @@ -1,14 +1,37 @@ +:host { + ::ng-deep .mat-mdc-card-header-text { + min-width: 0; + width: 100%; + } +} + .card-content { display: flex; flex-direction: column; gap: 1rem; + height: 100%; +} + +mat-card-title { + display: -webkit-box; + width: 100%; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + line-clamp: 2; + overflow: hidden; + line-height: 1.3rem; + height: 2.6rem; } .city-country { - display: flex; - align-items: center; - gap: 0.5rem; + display: block; + width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; color: var(--sg-text-muted); + line-height: 1.25rem; + height: 1.25rem; } .metrics { @@ -16,6 +39,8 @@ flex-direction: column; gap: 0.5rem; font-size: 0.875rem; + flex: 1 1 auto; + min-height: 0; } .metric-item { diff --git a/webapp/src/app/shared/ui/app-project-card/app-project-card.component.scss b/webapp/src/app/shared/ui/app-project-card/app-project-card.component.scss index 822522ff..c1b47cc8 100644 --- a/webapp/src/app/shared/ui/app-project-card/app-project-card.component.scss +++ b/webapp/src/app/shared/ui/app-project-card/app-project-card.component.scss @@ -1,3 +1,10 @@ +:host { + ::ng-deep .mat-mdc-card-header-text { + min-width: 0; + width: 100%; + } +} + .card-content { display: flex; flex-direction: column; @@ -5,11 +12,26 @@ height: 100%; } +mat-card-title { + display: -webkit-box; + width: 100%; + -webkit-box-orient: vertical; + -webkit-line-clamp: 5; + line-clamp: 5; + overflow: hidden; + line-height: 1.3rem; + height: 6.5rem; +} + .subtitle { - display: flex; - align-items: center; - gap: 0.5rem; + display: block; + width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; color: var(--sg-text-muted); + line-height: 1.25rem; + height: 1.25rem; } .metrics { diff --git a/webapp/src/app/shared/ui/app-publication-card/app-publication-card.component.html b/webapp/src/app/shared/ui/app-publication-card/app-publication-card.component.html index 3c84c3f8..ddda118a 100644 --- a/webapp/src/app/shared/ui/app-publication-card/app-publication-card.component.html +++ b/webapp/src/app/shared/ui/app-publication-card/app-publication-card.component.html @@ -1,9 +1,6 @@ @let work = this.work(); - + {{ work.title }} @@ -15,15 +12,41 @@ -
- @for (topic of topics(); track topic.id) { - - } - @for (author of authors(); track author.id) { - - } +
+
+ label + Themen +
+
+ @for (topic of visibleTopics(); track topic.id) { + + } +
+ +
+
+ person + Autoren +
+
+ @for (author of visibleAuthors(); track author.id) { + + } + @if (hiddenAuthorCount() > 0) { + +{{ hiddenAuthorCount() }} + } +
+
diff --git a/webapp/src/app/shared/ui/app-publication-card/app-publication-card.component.scss b/webapp/src/app/shared/ui/app-publication-card/app-publication-card.component.scss index ce2961eb..abe550c6 100644 --- a/webapp/src/app/shared/ui/app-publication-card/app-publication-card.component.scss +++ b/webapp/src/app/shared/ui/app-publication-card/app-publication-card.component.scss @@ -1,3 +1,10 @@ +:host { + ::ng-deep .mat-mdc-card-header-text { + min-width: 0; + width: 100%; + } +} + .card-content { display: flex; flex-direction: column; @@ -5,11 +12,46 @@ height: 100%; } +mat-card-title { + display: -webkit-box; + width: 100%; + -webkit-box-orient: vertical; + -webkit-line-clamp: 4; + line-clamp: 4; + overflow: hidden; + line-height: 1.3rem; + height: calc(1.3rem * 4); +} + .subtitle { + display: block; + width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + color: var(--sg-text-muted); + line-height: 1.25rem; + height: 1.25rem; +} + +.chip-section { + display: flex; + flex-direction: column; + gap: 0.5rem; +} + +.chip-section-header { display: flex; align-items: center; - gap: 0.5rem; + gap: 0.25rem; color: var(--sg-text-muted); + font-size: 0.875rem; + + mat-icon { + width: 18px; + height: 18px; + font-size: 18px; + } } .metrics { @@ -42,6 +84,35 @@ height: 100%; } +.chips-column { + flex-direction: column; + flex-wrap: nowrap; + align-items: flex-start; + // 3 rows reserved (32px chip height + 8px gap each) so the divider below + // sits at the same position regardless of how many topics exist. + min-height: calc(3 * 32px + 2 * 0.5rem); +} + +.chips-authors { + flex-wrap: nowrap; + align-content: flex-start; + // 1 row reserved, capped so overflowing chips never push the divider down. + min-height: 32px; + max-height: 32px; + overflow: hidden; +} + +.chip-overflow { + display: inline-flex; + align-items: center; + padding: 0.25rem 0.5rem; + border-radius: var(--sg-radius-sm); + background: var(--sg-surface-soft); + color: var(--sg-text-muted); + font-size: 0.8rem; + font-weight: 600; +} + .mat-card-content { display: flex; flex-direction: column; diff --git a/webapp/src/app/shared/ui/app-publication-card/app-publication-card.component.ts b/webapp/src/app/shared/ui/app-publication-card/app-publication-card.component.ts index 41c8a29a..a4b47b42 100644 --- a/webapp/src/app/shared/ui/app-publication-card/app-publication-card.component.ts +++ b/webapp/src/app/shared/ui/app-publication-card/app-publication-card.component.ts @@ -1,5 +1,5 @@ -import { Component, computed, input } from '@angular/core'; -import { DehydratedAuthor, Work } from '../../../api'; +import { Component, computed, input, output } from '@angular/core'; +import { Author, DehydratedAuthor, Topic, Work } from '../../../api'; import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; import { MatButtonModule } from '@angular/material/button'; @@ -11,6 +11,9 @@ import { LanguageCodePipe } from '../../pipes/language-code.pipe'; import { AppTopicChipComponent } from '../app-topic-chip/app-topic-chip.component'; import { AppAuthorChipComponent } from '../app-author-chip/app-author-chip.component'; +const MAX_VISIBLE_TOPICS = 3; +const MAX_VISIBLE_AUTHORS = 3; + @Component({ selector: 'app-publication-card', imports: [ @@ -31,6 +34,9 @@ import { AppAuthorChipComponent } from '../app-author-chip/app-author-chip.compo export class AppPublicationCardComponent { work = input.required(); + topicChipClick = output(); + authorChipClick = output(); + stripOpenAlexId(id: string | null | undefined): string | undefined { if (!id) { return undefined; @@ -55,4 +61,12 @@ export class AppPublicationCardComponent { .map((authorship) => authorship.author) .filter((author): author is DehydratedAuthor => !!author); }); + + visibleTopics = computed(() => this.topics().slice(0, MAX_VISIBLE_TOPICS)); + + visibleAuthors = computed(() => this.authors().slice(0, MAX_VISIBLE_AUTHORS)); + + hiddenAuthorCount = computed(() => + Math.max(this.authors().length - MAX_VISIBLE_AUTHORS, 0), + ); } diff --git a/webapp/src/app/shared/ui/app-topic-card/app-topic-card.component.html b/webapp/src/app/shared/ui/app-topic-card/app-topic-card.component.html index a31279c7..f302297d 100644 --- a/webapp/src/app/shared/ui/app-topic-card/app-topic-card.component.html +++ b/webapp/src/app/shared/ui/app-topic-card/app-topic-card.component.html @@ -12,7 +12,7 @@ -

{{ description() }}

+

{{ description() }}

menu_book diff --git a/webapp/src/app/shared/ui/app-topic-card/app-topic-card.component.scss b/webapp/src/app/shared/ui/app-topic-card/app-topic-card.component.scss index 9af1418f..6873883d 100644 --- a/webapp/src/app/shared/ui/app-topic-card/app-topic-card.component.scss +++ b/webapp/src/app/shared/ui/app-topic-card/app-topic-card.component.scss @@ -15,22 +15,69 @@ ::ng-deep .mdc-button--outlined { border-color: var(--topic-border) !important; } + + ::ng-deep .mat-mdc-card-header-text { + min-width: 0; + width: 100%; + } } .card-content { display: flex; flex-direction: column; gap: 1rem; + height: 100%; background-color: var(--topic-background); border: 1px solid var(--topic-border); } +mat-card-title { + display: -webkit-box; + width: 100%; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + line-clamp: 2; + overflow: hidden; + line-height: 1.3rem; + height: 2.6rem; +} + .subtitle { - display: flex; - align-items: center; - gap: 0.5rem; + display: -webkit-box; + width: 100%; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + line-clamp: 2; + overflow: hidden; color: var(--sg-text-muted); + line-height: 1.25rem; + height: 2.5rem; +} + +mat-card-content { + display: flex; + flex-direction: column; + gap: 1rem; + flex: 1 1 auto; + min-height: 0; +} + +.description { + margin: 0; + max-height: 6.5rem; + overflow-y: auto; + scrollbar-width: thin; + scrollbar-color: var(--topic-border) transparent; + + &::-webkit-scrollbar { + width: 6px; + } + + &::-webkit-scrollbar-thumb { + background-color: var(--topic-border); + border-radius: 3px; + } } .metrics { diff --git a/webapp/src/app/shared/ui/card-search/card-search.component.scss b/webapp/src/app/shared/ui/card-search/card-search.component.scss index 4b96e61b..23ddbd45 100644 --- a/webapp/src/app/shared/ui/card-search/card-search.component.scss +++ b/webapp/src/app/shared/ui/card-search/card-search.component.scss @@ -28,7 +28,9 @@ .cards { display: grid; gap: 1.5rem; - grid-template-columns: repeat(auto-fit, minmax(var(--card-min-width), 1fr)); + // auto-fill (not auto-fit) keeps empty tracks reserved, so a single result + // stays card-width instead of stretching to fill the whole row. + grid-template-columns: repeat(auto-fill, minmax(var(--card-min-width), 1fr)); padding: 0 1rem; }