Implement interactive metadata review for batch updates, with progress tracking and a unified notification system

This commit is contained in:
aditya.chandel
2025-07-13 23:32:08 -06:00
committed by Aditya Chandel
parent 6576f3351a
commit 116f0c950e
95 changed files with 2557 additions and 781 deletions
+11 -8
View File
@@ -2,13 +2,15 @@ import {Component, inject, OnInit} from '@angular/core';
import {RxStompService} from './shared/websocket/rx-stomp.service';
import {Message} from '@stomp/stompjs';
import {BookService} from './book/service/book.service';
import {EventService} from './shared/websocket/event.service';
import {NotificationEventService} from './shared/websocket/notification-event.service';
import {parseLogNotification} from './shared/websocket/model/log-notification.model';
import {ConfirmDialog} from 'primeng/confirmdialog';
import {Toast} from 'primeng/toast';
import {RouterOutlet} from '@angular/router';
import {AuthInitializationService} from './auth-initialization-service';
import {AppConfigService} from './core/service/app-config.service';
import {MetadataBatchProgressNotification} from './core/model/metadata-batch-progress.model';
import {MetadataProgressService} from './core/service/metadata-progress-service';
@Component({
selector: 'app-root',
@@ -23,7 +25,8 @@ export class AppComponent implements OnInit {
private authInit = inject(AuthInitializationService);
private bookService = inject(BookService);
private rxStompService = inject(RxStompService);
private eventService = inject(EventService);
private notificationEventService = inject(NotificationEventService);
private metadataProgressService = inject(MetadataProgressService);
private appConfigService = inject(AppConfigService);
ngOnInit(): void {
@@ -49,14 +52,14 @@ export class AppComponent implements OnInit {
this.bookService.handleMultipleBookUpdates(updatedBooks);
});
this.rxStompService.watch('/topic/book-metadata-batch-progress').subscribe((message: Message) => {
const progress = JSON.parse(message.body) as MetadataBatchProgressNotification;
this.metadataProgressService.handleIncomingProgress(progress);
});
this.rxStompService.watch('/topic/log').subscribe((message: Message) => {
const logNotification = parseLogNotification(message.body);
this.eventService.handleIncomingLog(logNotification);
this.notificationEventService.handleNewNotification(logNotification);
});
}
sendMessage() {
const message = `Message generated at ${new Date()}`;
this.rxStompService.publish({destination: '/app/send', body: message});
}
}