Last PR before Release (#2692)

This commit is contained in:
Joe Milazzo 2024-02-05 18:58:03 -06:00 committed by GitHub
parent 07e96389fb
commit 5cf6077dfd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 3801 additions and 2044 deletions

View file

@ -6,4 +6,7 @@ export interface UpdateVersionEvent {
updateUrl: string;
isDocker: boolean;
publishDate: string;
}
isOnNightlyInRelease: boolean;
isReleaseNewer: boolean;
isReleaseEqual: boolean;
}

View file

@ -18,4 +18,10 @@ export interface ScrobbleEvent {
createdUtc: string;
volumeNumber: number | null;
chapterNumber: number | null;
isErrored: boolean;
/**
* Null when not errored
*/
errorDetails: string | null;
}

View file

@ -73,8 +73,13 @@
</ng-container>
</td>
<td>
<i class="fa-regular fa-circle icon" aria-hidden="true" *ngIf="!item.isProcessed"></i>
<i class="fa-solid fa-check-circle icon" aria-hidden="true" *ngIf="item.isProcessed"></i>
@if(item.isProcessed) {
<i class="fa-solid fa-check-circle icon" aria-hidden="true"></i>
} @else if (item.isErrored) {
<i class="fa-solid fa-circle-exclamation icon error" aria-hidden="true" [ngbTooltip]="item.errorDetails"></i>
} @else {
<i class="fa-regular fa-circle icon" aria-hidden="true"></i>
}
<span class="visually-hidden" attr.aria-labelledby="scrobble-history--{{idx}}">
{{item.isProcessed ? t('processed') : t('not-processed')}}
</span>

View file

@ -1,3 +1,7 @@
.icon {
color: var(--primary-color);
}
.error {
color: var(--error-color);
}

View file

@ -5,7 +5,7 @@ import {ScrobbleProvider, ScrobblingService} from "../../_services/scrobbling.se
import {takeUntilDestroyed} from "@angular/core/rxjs-interop";
import {ScrobbleEvent, ScrobbleEventType} from "../../_models/scrobbling/scrobble-event";
import {ScrobbleEventTypePipe} from "../scrobble-event-type.pipe";
import {NgbPagination} from "@ng-bootstrap/ng-bootstrap";
import {NgbPagination, NgbTooltip} from "@ng-bootstrap/ng-bootstrap";
import {ScrobbleEventSortField} from "../../_models/scrobbling/scrobble-event-filter";
import {debounceTime, take} from "rxjs/operators";
import {PaginatedResult, Pagination} from "../../_models/pagination";
@ -20,7 +20,7 @@ import {ToastrService} from "ngx-toastr";
@Component({
selector: 'app-user-scrobble-history',
standalone: true,
imports: [CommonModule, ScrobbleEventTypePipe, NgbPagination, ReactiveFormsModule, SortableHeader, TranslocoModule, DefaultValuePipe, TranslocoLocaleModule, UtcToLocalTimePipe],
imports: [CommonModule, ScrobbleEventTypePipe, NgbPagination, ReactiveFormsModule, SortableHeader, TranslocoModule, DefaultValuePipe, TranslocoLocaleModule, UtcToLocalTimePipe, NgbTooltip],
templateUrl: './user-scrobble-history.component.html',
styleUrls: ['./user-scrobble-history.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush

View file

@ -9,9 +9,13 @@
<div class="card w-100 mb-2" style="width: 18rem;">
<div class="card-body">
<h4 class="card-title">{{update.updateTitle}}&nbsp;
<span class="badge bg-secondary" *ngIf="isNightly(update)">{{t('nightly', {version: update.currentVersion})}}</span>
<span class="badge bg-secondary" *ngIf="update.updateVersion === update.currentVersion">{{t('installed')}}</span>
<span class="badge bg-secondary" *ngIf="update.updateVersion > update.currentVersion">{{t('available')}}</span>
@if (update.isOnNightlyInRelease) {
<span class="badge bg-secondary">{{t('nightly', {version: update.currentVersion})}}</span>
} @else if (update.isReleaseEqual) {
<span class="badge bg-secondary">{{t('installed')}}</span>
} @else if (update.isReleaseNewer && indx === 0) {
<span class="badge bg-secondary">{{t('available')}}</span>
}
</h4>
<h6 class="card-subtitle mb-1 mt-1 text-muted">{{t('published-label')}}{{update.publishDate | date: 'short'}}</h6>

View file

@ -28,28 +28,4 @@ export class ChangelogComponent implements OnInit {
this.cdRef.markForCheck();
});
}
isNightly(update: UpdateVersionEvent) {
// Split the version numbers into arrays
const updateVersionArr = update.updateVersion.split('.');
const currentVersionArr = update.currentVersion.split('.');
// Compare the first three parts of the version numbers
for (let i = 0; i < 3; i++) {
const updatePart = parseInt(updateVersionArr[i]);
const currentPart = parseInt(currentVersionArr[i]);
// If any part of the update version is less than the corresponding part of the current version, return true
if (updatePart < currentPart) {
return true;
}
// If any part of the update version is greater than the corresponding part of the current version, return false
else if (updatePart > currentPart) {
return false;
}
}
// If all parts are equal, compare the length of the version numbers
return updateVersionArr.length < currentVersionArr.length;
}
}

View file

@ -30,7 +30,7 @@
<div infinite-scroll [infiniteScrollDistance]="1" [infiniteScrollThrottle]="50">
<ng-container *ngFor="let item of webtoonImages | async; let index = index;">
<img src="{{item.src}}" style="display: block"
class="mx-auto {{pageNum === item.page && showDebugOutline() ? 'active': ''}} {{areImagesWiderThanWindow ? 'full-width' : ''}} {{initFinished ? '' : 'full-opacity'}}"
class="mx-auto {{pageNum === item.page && showDebugOutline() ? 'active': ''}} {{areImagesWiderThanWindow ? 'full-width' : ''}}"
rel="nofollow" alt="image" (load)="onImageLoad($event)" id="page-{{item.page}}" [attr.page]="item.page" ondragstart="return false;" onselectstart="return false;">
</ng-container>
</div>

View file

@ -10,9 +10,12 @@
<button class="btn btn-outline-secondary" type="button" (click)="copy()" [title]="t('copy')">
<span class="visually-hidden">Copy</span><i class="fa fa-copy" aria-hidden="true"></i>
</button>
<button class="btn btn-danger" type="button" [ngbTooltip]="tipContent" (click)="refresh()" *ngIf="showRefresh">
<span class="visually-hidden">Regenerate</span><i class="fa fa-sync-alt" aria-hidden="true"></i>
@if (showRefresh) {
<button class="btn btn-danger" type="button" [ngbTooltip]="tipContent" (click)="refresh()">
<span class="visually-hidden">Regenerate</span><i class="fa fa-sync-alt" aria-hidden="true"></i>
</button>
}
<ng-template #tipContent>
{{t('regen-warning')}}
</ng-template>

View file

@ -57,7 +57,9 @@ export class ApiKeyComponent implements OnInit {
key = translate('api-key.no-key');
}
this.showRefresh = !this.accountService.hasReadOnlyRole(user!);
if (this.showRefresh) {
this.showRefresh = !this.accountService.hasReadOnlyRole(user!);
}
if (this.transform != undefined) {
this.key = this.transform(key);