Cleanup from last develop release (#614)

* Added extra information for Swagger Gen

* Ensure that the last scanned time gets updated after a scan finishes.

Remove title case from Library name UI display.

Show time on last scanned

* Don't force title case for library names. Show them as the user created them.
This commit is contained in:
Joseph Milazzo 2021-10-01 15:00:51 -07:00 committed by GitHub
parent 839e35b15e
commit 6d86008607
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 49 additions and 4 deletions

View file

@ -7,7 +7,7 @@
<li *ngFor="let library of libraries; let idx = index;" class="list-group-item">
<div>
<h4>
<span id="library-name--{{idx}}">{{library.name | titlecase}}</span>&nbsp;
<span id="library-name--{{idx}}">{{library.name}}</span>&nbsp;
<div class="spinner-border text-primary" style="width: 1.5rem; height: 1.5rem;" role="status" *ngIf="scanInProgress.hasOwnProperty(library.id) && scanInProgress[library.id]" title="Scan in progress">
<span class="sr-only">Scan for {{library.name}} in progress</span>
</div>
@ -24,7 +24,7 @@
Last Scanned:
<span *ngIf="library.lastScanned == '0001-01-01T00:00:00'; else activeDate">Never</span>
<ng-template #activeDate>
{{library.lastScanned | date: 'MM/dd/yyyy'}}
{{library.lastScanned | date: 'short'}}
</ng-template>
</div>
</li>

View file

@ -39,6 +39,15 @@ export class ManageLibraryComponent implements OnInit, OnDestroy {
this.hubService.messages$.pipe(takeWhile(event => event.event === EVENTS.ScanLibraryProgress)).subscribe((event) => {
const scanEvent = event.payload as ScanLibraryProgressEvent;
this.scanInProgress[scanEvent.libraryId] = scanEvent.progress !== 100;
if (this.scanInProgress[scanEvent.libraryId] === false && scanEvent.progress === 100) {
this.libraryService.getLibraries().pipe(take(1)).subscribe(libraries => {
const newLibrary = libraries.find(lib => lib.id === scanEvent.libraryId);
const existingLibrary = this.libraries.find(lib => lib.id === scanEvent.libraryId);
if (existingLibrary !== undefined) {
existingLibrary.lastScanned = newLibrary?.lastScanned || existingLibrary.lastScanned;
}
});
}
});
}

View file

@ -38,6 +38,6 @@
<app-card-actionables (actionHandler)="performAction($event)" [actions]="actions" [labelBy]="title"></app-card-actionables>
</span>
</div>
<a class="card-title library" [routerLink]="['/library', libraryId]" routerLinkActive="router-link-active" *ngIf="!supressLibraryLink && libraryName">{{libraryName | titlecase}}</a>
<a class="card-title library" [routerLink]="['/library', libraryId]" routerLinkActive="router-link-active" *ngIf="!supressLibraryLink && libraryName">{{libraryName}}</a>
</div>
</div>