From 340b5f22b7487346351ce65a9fd78e490a019db7 Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Tue, 4 Aug 2026 07:44:22 +0200 Subject: [PATCH] use app-loading component in several pages --- .../bookmarks/bookmarks.component.html | 9 ++++---- .../bookmarks/bookmarks.component.scss | 1 - .../modules/bookmarks/bookmarks.component.ts | 9 ++------ .../job-logs-dialog.component.html | 22 +++++++++---------- .../job-logs-dialog.component.scss | 20 ----------------- .../job-logs-dialog.component.ts | 4 ++-- .../news-detail/news-detail.component.html | 9 ++++---- .../news-detail/news-detail.component.ts | 4 ++-- .../patent-detail.component.html | 9 ++++---- .../patent-detail/patent-detail.component.ts | 4 ++-- .../person-company-connections.component.html | 9 ++++---- .../person-company-connections.component.ts | 4 ++-- .../person-interesting.component.html | 9 +++++--- .../person-interesting.component.scss | 22 ------------------- .../person-interesting.component.ts | 4 ++-- .../publication-detail.component.html | 9 ++++---- .../publication-detail.component.ts | 4 ++-- .../topic-hierarchy.component.html | 9 ++++---- .../topic-hierarchy.component.scss | 10 --------- .../topic-hierarchy.component.ts | 4 ++-- 20 files changed, 62 insertions(+), 113 deletions(-) diff --git a/webapp/src/app/modules/bookmarks/bookmarks.component.html b/webapp/src/app/modules/bookmarks/bookmarks.component.html index 76f61397..756e6203 100644 --- a/webapp/src/app/modules/bookmarks/bookmarks.component.html +++ b/webapp/src/app/modules/bookmarks/bookmarks.component.html @@ -13,10 +13,11 @@ @if (loading()) { -
- -

Bookmarks werden geladen …

-
+ } @else if (persons().length) {
@for (person of persons(); track person.id) { diff --git a/webapp/src/app/modules/bookmarks/bookmarks.component.scss b/webapp/src/app/modules/bookmarks/bookmarks.component.scss index 1f6b9dc1..87f7f20e 100644 --- a/webapp/src/app/modules/bookmarks/bookmarks.component.scss +++ b/webapp/src/app/modules/bookmarks/bookmarks.component.scss @@ -65,7 +65,6 @@ gap: 20px; } -.loading-state, .empty-state { display: flex; min-height: 320px; diff --git a/webapp/src/app/modules/bookmarks/bookmarks.component.ts b/webapp/src/app/modules/bookmarks/bookmarks.component.ts index c9c9e46e..2192e77b 100644 --- a/webapp/src/app/modules/bookmarks/bookmarks.component.ts +++ b/webapp/src/app/modules/bookmarks/bookmarks.component.ts @@ -2,12 +2,12 @@ import { CommonModule } from '@angular/common'; import { Component, DestroyRef, inject, signal } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { MatIconModule } from '@angular/material/icon'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { catchError, forkJoin, map, of, switchMap } from 'rxjs'; import { CustomAuthor, PersonsService } from '../../api'; import { BookmarkService } from '../../shared/services/bookmark.service'; import { PersonCardComponent } from '../person-card/person-card.component'; +import { LoadingComponent } from '../../shared/ui/loading/loading.component'; const PERSON_INCLUDE_TAGS = 'display_name,works_count,cited_by_count,summary_stats,ids,' + @@ -17,12 +17,7 @@ const PERSON_INCLUDE_TAGS = @Component({ selector: 'app-bookmarks', standalone: true, - imports: [ - CommonModule, - MatIconModule, - MatProgressSpinnerModule, - PersonCardComponent, - ], + imports: [CommonModule, MatIconModule, PersonCardComponent, LoadingComponent], templateUrl: './bookmarks.component.html', styleUrl: './bookmarks.component.scss', }) diff --git a/webapp/src/app/modules/jobs/job-logs-dialog/job-logs-dialog.component.html b/webapp/src/app/modules/jobs/job-logs-dialog/job-logs-dialog.component.html index 13917cdf..f6510c90 100644 --- a/webapp/src/app/modules/jobs/job-logs-dialog/job-logs-dialog.component.html +++ b/webapp/src/app/modules/jobs/job-logs-dialog/job-logs-dialog.component.html @@ -2,12 +2,11 @@ @if (runsLoading() && runs().length === 0) { -
- - Läufe werden geladen … -
+ } @else if (runsError()) {

{{ runsError() }}

} @else if (runs().length === 0) { @@ -79,12 +78,11 @@
@if (loading() && !logs()) { -
- - Logs werden geladen … -
+ } @else {
{{ logs() }}
} diff --git a/webapp/src/app/modules/jobs/job-logs-dialog/job-logs-dialog.component.scss b/webapp/src/app/modules/jobs/job-logs-dialog/job-logs-dialog.component.scss index 18ae63d9..c358a766 100644 --- a/webapp/src/app/modules/jobs/job-logs-dialog/job-logs-dialog.component.scss +++ b/webapp/src/app/modules/jobs/job-logs-dialog/job-logs-dialog.component.scss @@ -3,14 +3,6 @@ margin: 0; } -.runs-loading { - display: flex; - align-items: center; - gap: 10px; - min-height: 120px; - color: var(--sg-text-muted); -} - .logs-error { margin: 0; padding: 16px; @@ -93,18 +85,6 @@ white-space: pre-wrap; word-break: break-word; } - - .logs-loading { - color: var(--sg-text-muted); - } -} - -.logs-loading { - display: flex; - align-items: center; - gap: 10px; - color: var(--sg-text-muted); - font-size: 13px; } .run-select { diff --git a/webapp/src/app/modules/jobs/job-logs-dialog/job-logs-dialog.component.ts b/webapp/src/app/modules/jobs/job-logs-dialog/job-logs-dialog.component.ts index 3828598b..fd208fbe 100644 --- a/webapp/src/app/modules/jobs/job-logs-dialog/job-logs-dialog.component.ts +++ b/webapp/src/app/modules/jobs/job-logs-dialog/job-logs-dialog.component.ts @@ -18,11 +18,11 @@ import { } from '@angular/material/dialog'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; import { MatTooltipModule } from '@angular/material/tooltip'; import { finalize, timer } from 'rxjs'; import { BackgroundJobsService, BackgroundJobTask, JobRun } from '../../../api'; +import { LoadingComponent } from '../../../shared/ui/loading/loading.component'; import { formatRunDuration, formatRunElapsed, @@ -42,9 +42,9 @@ export interface JobLogsDialogData { MatDialogModule, MatFormFieldModule, MatIconModule, - MatProgressSpinnerModule, MatSelectModule, MatTooltipModule, + LoadingComponent, ], templateUrl: './job-logs-dialog.component.html', styleUrl: './job-logs-dialog.component.scss', diff --git a/webapp/src/app/modules/news-detail/news-detail.component.html b/webapp/src/app/modules/news-detail/news-detail.component.html index 4580694d..4f7a14b7 100644 --- a/webapp/src/app/modules/news-detail/news-detail.component.html +++ b/webapp/src/app/modules/news-detail/news-detail.component.html @@ -9,10 +9,11 @@ @if (loading) { -
- -

Nachricht wird geladen...

-
+ } @else if (notFound || !article) {
search_off diff --git a/webapp/src/app/modules/news-detail/news-detail.component.ts b/webapp/src/app/modules/news-detail/news-detail.component.ts index aa495516..707f191f 100644 --- a/webapp/src/app/modules/news-detail/news-detail.component.ts +++ b/webapp/src/app/modules/news-detail/news-detail.component.ts @@ -11,13 +11,13 @@ import { HttpClient } from '@angular/common/http'; import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatTooltipModule } from '@angular/material/tooltip'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { WorksService } from '../../api'; import { topicHierarchyColor } from '../../resolvers/utils/topic-colors'; +import { LoadingComponent } from '../../shared/ui/loading/loading.component'; interface MentionedPerson { name: string; @@ -52,9 +52,9 @@ interface NewsArticleDetail { imports: [ MatButtonModule, MatIconModule, - MatProgressSpinnerModule, MatTooltipModule, RouterLink, + LoadingComponent, ], templateUrl: './news-detail.component.html', styleUrl: './news-detail.component.scss', diff --git a/webapp/src/app/modules/patent-detail/patent-detail.component.html b/webapp/src/app/modules/patent-detail/patent-detail.component.html index 639e160d..3ab15299 100644 --- a/webapp/src/app/modules/patent-detail/patent-detail.component.html +++ b/webapp/src/app/modules/patent-detail/patent-detail.component.html @@ -9,10 +9,11 @@ @if (loading) { -
- -

Patent wird geladen...

-
+ } @else if (notFound || !patent) {
search_off diff --git a/webapp/src/app/modules/patent-detail/patent-detail.component.ts b/webapp/src/app/modules/patent-detail/patent-detail.component.ts index 18816a39..3355e8fd 100644 --- a/webapp/src/app/modules/patent-detail/patent-detail.component.ts +++ b/webapp/src/app/modules/patent-detail/patent-detail.component.ts @@ -3,7 +3,6 @@ import { Component, DestroyRef, OnInit, inject } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { ActivatedRoute, RouterLink } from '@angular/router'; import { finalize } from 'rxjs'; @@ -15,6 +14,7 @@ import { classificationSectionColor, topicHierarchyColor, } from '../../resolvers/utils/topic-colors'; +import { LoadingComponent } from '../../shared/ui/loading/loading.component'; import { ClassificationCard, ClassificationSystem, @@ -32,9 +32,9 @@ import { imports: [ MatButtonModule, MatIconModule, - MatProgressSpinnerModule, RouterLink, TopicChipComponent, + LoadingComponent, ], templateUrl: './patent-detail.component.html', styleUrl: './patent-detail.component.scss', diff --git a/webapp/src/app/modules/person-company-connections/person-company-connections.component.html b/webapp/src/app/modules/person-company-connections/person-company-connections.component.html index 7526b3db..5bf24c01 100644 --- a/webapp/src/app/modules/person-company-connections/person-company-connections.component.html +++ b/webapp/src/app/modules/person-company-connections/person-company-connections.component.html @@ -1,8 +1,9 @@ @if (loading) { -
- - Verbindungen zu Unternehmen werden geladen ... -
+ } @else if (error) {
Verbindungen zu Unternehmen konnten nicht geladen werden. diff --git a/webapp/src/app/modules/person-company-connections/person-company-connections.component.ts b/webapp/src/app/modules/person-company-connections/person-company-connections.component.ts index c1db293b..e8e15636 100644 --- a/webapp/src/app/modules/person-company-connections/person-company-connections.component.ts +++ b/webapp/src/app/modules/person-company-connections/person-company-connections.component.ts @@ -14,7 +14,6 @@ import { MatButtonModule } from '@angular/material/button'; import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; import { MatTooltip, MatTooltipModule } from '@angular/material/tooltip'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { ActivatedRoute, Router, RouterModule } from '@angular/router'; import { EChartsOption } from 'echarts'; import { NgxEchartsDirective } from 'ngx-echarts'; @@ -27,6 +26,7 @@ import { } from '../../api'; import { PersonDataResolved } from '../../resolvers/person.resolver'; import { ChartThemeService } from '../../shared/services/chart-theme.service'; +import { LoadingComponent } from '../../shared/ui/loading/loading.component'; interface RoleLegendItem { role: string; @@ -44,7 +44,6 @@ interface GraphSymbols { selector: 'app-person-company-connections', imports: [ CommonModule, - MatProgressSpinnerModule, NgxEchartsDirective, MatButtonModule, MatCardModule, @@ -52,6 +51,7 @@ interface GraphSymbols { MatTooltipModule, MatTooltip, RouterModule, + LoadingComponent, ], templateUrl: './person-company-connections.component.html', styleUrl: './person-company-connections.component.scss', diff --git a/webapp/src/app/modules/person-interesting/person-interesting.component.html b/webapp/src/app/modules/person-interesting/person-interesting.component.html index 3a30b7bd..cb8215f7 100644 --- a/webapp/src/app/modules/person-interesting/person-interesting.component.html +++ b/webapp/src/app/modules/person-interesting/person-interesting.component.html @@ -24,9 +24,12 @@
@if (loading()) { -
- - Themen werden geladen ... +
+
} @else if (tags().length > 0) { @for (tag of tags(); track tag.label) { diff --git a/webapp/src/app/modules/person-interesting/person-interesting.component.scss b/webapp/src/app/modules/person-interesting/person-interesting.component.scss index c1c334c5..173d465c 100644 --- a/webapp/src/app/modules/person-interesting/person-interesting.component.scss +++ b/webapp/src/app/modules/person-interesting/person-interesting.component.scss @@ -58,25 +58,3 @@ font-size: 13px; font-weight: 600; } - -.interest-state { - display: flex; - width: 100%; - min-height: 90px; - align-items: center; - justify-content: center; - padding: 20px; - color: var(--sg-text-muted); - font-size: 14px; - text-align: center; -} - -.interest-card-loading .interest-state { - min-height: 48px; - padding: 8px; -} - -.interest-state-loading { - flex-direction: column; - gap: 10px; -} diff --git a/webapp/src/app/modules/person-interesting/person-interesting.component.ts b/webapp/src/app/modules/person-interesting/person-interesting.component.ts index 2d4dc1e3..ad3307bf 100644 --- a/webapp/src/app/modules/person-interesting/person-interesting.component.ts +++ b/webapp/src/app/modules/person-interesting/person-interesting.component.ts @@ -10,13 +10,13 @@ import { } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { MatIconModule } from '@angular/material/icon'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { CommonModule } from '@angular/common'; import { ActivatedRoute, Router } from '@angular/router'; import { TopicCount } from '../../api'; import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component'; import { TopicLegendComponent } from '../../shared/ui/topic-legend/topic-legend.component'; +import { LoadingComponent } from '../../shared/ui/loading/loading.component'; import { topicHierarchyColor } from '../../resolvers/utils/topic-colors'; import { buildTopicLegendGroups, @@ -52,9 +52,9 @@ const MAX_TAGS = 5; imports: [ CommonModule, MatIconModule, - MatProgressSpinnerModule, TopicChipComponent, TopicLegendComponent, + LoadingComponent, ], templateUrl: './person-interesting.component.html', styleUrl: './person-interesting.component.scss', diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.html b/webapp/src/app/modules/publication-detail/publication-detail.component.html index fed2db7d..6ffbe5c3 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.html +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.html @@ -9,10 +9,11 @@ @if (loading) { -
- -

Publikation wird geladen...

-
+ } @else if (notFound || !publication) {
search_off diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.ts b/webapp/src/app/modules/publication-detail/publication-detail.component.ts index 51616f1a..f9c8f3e6 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.ts +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.ts @@ -5,7 +5,6 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { HttpClient } from '@angular/common/http'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatTooltipModule } from '@angular/material/tooltip'; import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { @@ -18,6 +17,7 @@ import { } from '../../api'; import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component'; import { CountryFlagComponent } from '../../shared/ui/country-flag/country-flag.component'; +import { LoadingComponent } from '../../shared/ui/loading/loading.component'; import { topicHierarchyColor } from '../../resolvers/utils/topic-colors'; import { WorkTypePipe } from '../../shared/pipes/work-type.pipe'; import { LanguageCodePipe } from '../../shared/pipes/language-code.pipe'; @@ -43,7 +43,6 @@ interface InstitutionDetail { DecimalPipe, MatButtonModule, MatIconModule, - MatProgressSpinnerModule, MatTooltipModule, RouterLink, TopicChipComponent, @@ -52,6 +51,7 @@ interface InstitutionDetail { WorkPrimaryCategoryPipe, ResearchProfileComponent, CountryFlagComponent, + LoadingComponent, ], templateUrl: './publication-detail.component.html', styleUrl: './publication-detail.component.scss', diff --git a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.html b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.html index 3df414de..c8553b15 100644 --- a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.html +++ b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.html @@ -45,10 +45,11 @@
} @if (loading()) { -
- - Lade Themen... -
+ } @else { @if (searchQuery()) { diff --git a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.scss b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.scss index 24c8f08c..416e6a6b 100644 --- a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.scss +++ b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.scss @@ -11,16 +11,6 @@ box-sizing: border-box; } -.loading-state { - display: flex; - align-items: center; - justify-content: center; - gap: 8px; - padding: 16px; - color: var(--sg-text-muted); - font-size: 12px; -} - /* Flat Search Results Styles */ .search-results { display: flex; diff --git a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.ts b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.ts index f7bfc203..25949b3a 100644 --- a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.ts +++ b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.ts @@ -2,11 +2,11 @@ import { Component, input, model, output, OnInit, signal } from '@angular/core'; import { CommonModule } from '@angular/common'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatIconModule } from '@angular/material/icon'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatRadioModule } from '@angular/material/radio'; import { MatTooltipModule } from '@angular/material/tooltip'; import { TopicsService } from '../../api/api/topics.service'; import { topicHierarchyColor } from '../../resolvers/utils/topic-colors'; +import { LoadingComponent } from '../../shared/ui/loading/loading.component'; import { combineLatest, of } from 'rxjs'; import { toObservable } from '@angular/core/rxjs-interop'; import { @@ -50,9 +50,9 @@ interface FlatTopic { CommonModule, MatCheckboxModule, MatIconModule, - MatProgressSpinnerModule, MatRadioModule, MatTooltipModule, + LoadingComponent, ], templateUrl: './topic-hierarchy.component.html', styleUrl: './topic-hierarchy.component.scss',