Release Polishing (#2325)

Co-authored-by: Robbie Davis <robbie@therobbiedavis.com>
This commit is contained in:
Joe Milazzo 2023-10-18 17:52:54 -05:00 committed by GitHub
parent 2d3a0c1eda
commit 8e85ba069c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 88 additions and 96 deletions

View file

@ -18,7 +18,7 @@ import { ReadingList } from 'src/app/_models/reading-list';
import { CollectionTagService } from 'src/app/_services/collection-tag.service';
import {CommonModule} from "@angular/common";
import {FilterPipe} from "../../../pipe/filter.pipe";
import {TranslocoDirective, TranslocoService} from "@ngneat/transloco";
import {translate, TranslocoDirective, TranslocoService} from "@ngneat/transloco";
@Component({
selector: 'app-bulk-add-to-collection',
@ -46,7 +46,6 @@ export class BulkAddToCollectionComponent implements OnInit, AfterViewInit {
collectionTitleTrackby = (index: number, item: CollectionTag) => `${item.title}`;
translocoService = inject(TranslocoService);
@ViewChild('title') inputElem!: ElementRef<HTMLInputElement>;
@ -83,7 +82,7 @@ export class BulkAddToCollectionComponent implements OnInit, AfterViewInit {
create() {
const tagName = this.listForm.value.title;
this.collectionService.addByMultiple(0, this.seriesIds, tagName).subscribe(() => {
this.toastr.success(this.translocoService.translate('toasts.series-added-to-collection', {collectionName: tagName}));
this.toastr.success(translate('toasts.series-added-to-collection', {collectionName: tagName}));
this.modal.close();
});
}
@ -92,7 +91,7 @@ export class BulkAddToCollectionComponent implements OnInit, AfterViewInit {
if (this.seriesIds.length === 0) return;
this.collectionService.addByMultiple(tag.id, this.seriesIds, '').subscribe(() => {
this.toastr.success(this.translocoService.translate('toasts.series-added-to-collection', {collectionName: tag.title}));
this.toastr.success(translate('toasts.series-added-to-collection', {collectionName: tag.title}));
this.modal.close();
});

View file

@ -33,7 +33,7 @@ import { UploadService } from 'src/app/_services/upload.service';
import {takeUntilDestroyed} from "@angular/core/rxjs-interop";
import {CommonModule} from "@angular/common";
import {CoverImageChooserComponent} from "../../cover-image-chooser/cover-image-chooser.component";
import {TranslocoDirective, TranslocoService} from "@ngneat/transloco";
import {translate, TranslocoDirective, TranslocoService} from "@ngneat/transloco";
enum TabID {
@ -65,7 +65,6 @@ export class EditCollectionTagsComponent implements OnInit {
imageUrls: Array<string> = [];
selectedCover: string = '';
private readonly destroyRef = inject(DestroyRef);
translocoService = inject(TranslocoService);
get hasSomeSelected() {
return this.selections != null && this.selections.hasSomeSelected();
@ -172,7 +171,7 @@ export class EditCollectionTagsComponent implements OnInit {
tag.id = this.tag.id;
if (unselectedIds.length == this.series.length &&
!await this.confirmService.confirm(this.translocoService.translate('toasts.no-series-collection-warning'))) {
!await this.confirmService.confirm(translate('toasts.no-series-collection-warning'))) {
return;
}
@ -187,7 +186,7 @@ export class EditCollectionTagsComponent implements OnInit {
forkJoin(apis).subscribe(() => {
this.modal.close({success: true, coverImageUpdated: selectedIndex > 0});
this.toastr.success(this.translocoService.translate('toasts.collection-updated'));
this.toastr.success(translate('toasts.collection-updated'));
});
}

View file

@ -48,7 +48,7 @@ import {BytesPipe} from "../../pipe/bytes.pipe";
import {BadgeExpanderComponent} from "../../shared/badge-expander/badge-expander.component";
import {TagBadgeComponent} from "../../shared/tag-badge/tag-badge.component";
import {PersonBadgeComponent} from "../../shared/person-badge/person-badge.component";
import {TranslocoDirective, TranslocoService} from "@ngneat/transloco";
import {translate, TranslocoDirective, TranslocoService} from "@ngneat/transloco";
import {CardActionablesComponent} from "../../_single-module/card-actionables/card-actionables.component";
enum TabID {
@ -73,7 +73,6 @@ export class CardDetailDrawerComponent implements OnInit {
@Input() libraryId: number = 0;
@Input({required: true}) data!: Volume | Chapter;
private readonly destroyRef = inject(DestroyRef);
private readonly translocoService = inject(TranslocoService);
/**
@ -209,7 +208,7 @@ export class CardDetailDrawerComponent implements OnInit {
resetCoverImage() {
this.uploadService.resetChapterCoverLock(this.chapter.id).subscribe(() => {
this.toastr.info(this.translocoService.translate('toasts.regen-cover'));
this.toastr.info(translate('toasts.regen-cover'));
});
}
@ -262,7 +261,7 @@ export class CardDetailDrawerComponent implements OnInit {
readChapter(chapter: Chapter, incognito: boolean = false) {
if (chapter.pages === 0) {
this.toastr.error(this.translocoService.translate('toasts.no-pages'));
this.toastr.error(translate('toasts.no-pages'));
return;
}
@ -273,7 +272,7 @@ export class CardDetailDrawerComponent implements OnInit {
download(chapter: Chapter) {
if (this.downloadInProgress) {
this.toastr.info(this.translocoService.translate('toasts.download-in-progress'));
this.toastr.info(translate('toasts.download-in-progress'));
return;
}

View file

@ -25,7 +25,7 @@ import {ImageComponent} from "../../shared/image/image.component";
import {DownloadIndicatorComponent} from "../download-indicator/download-indicator.component";
import {EntityInfoCardsComponent} from "../entity-info-cards/entity-info-cards.component";
import {NgbProgressbar, NgbTooltip} from "@ng-bootstrap/ng-bootstrap";
import {TranslocoDirective, TranslocoService} from "@ngneat/transloco";
import {translate, TranslocoDirective} from "@ngneat/transloco";
import {CardActionablesComponent} from "../../_single-module/card-actionables/card-actionables.component";
@Component({
@ -90,7 +90,6 @@ export class ListItemComponent implements OnInit {
@Output() read: EventEmitter<void> = new EventEmitter<void>();
private readonly destroyRef = inject(DestroyRef);
private readonly translocoService = inject(TranslocoService);
actionInProgress: boolean = false;
summary: string = '';
@ -136,7 +135,7 @@ export class ListItemComponent implements OnInit {
performAction(action: ActionItem<any>) {
if (action.action == Action.Download) {
if (this.downloadInProgress) {
this.toastr.info(this.translocoService.translate('toasts.download-in-progress'));
this.toastr.info(translate('toasts.download-in-progress'));
return;
}

View file

@ -22,7 +22,7 @@ import {CommonModule} from "@angular/common";
import {CardItemComponent} from "../card-item/card-item.component";
import {RelationshipPipe} from "../../pipe/relationship.pipe";
import {Device} from "../../_models/device/device";
import {TranslocoService} from "@ngneat/transloco";
import {translate, TranslocoService} from "@ngneat/transloco";
import {SeriesPreviewDrawerComponent} from "../../_single-module/series-preview-drawer/series-preview-drawer.component";
function deepClone(obj: any): any {
@ -96,7 +96,6 @@ export class SeriesCardComponent implements OnInit, OnChanges {
actions: ActionItem<Series>[] = [];
imageUrl: string = '';
private readonly translocoService = inject(TranslocoService);
private readonly offcanvasService = inject(NgbOffcanvas);
constructor(private router: Router, private cdRef: ChangeDetectorRef,
@ -206,7 +205,7 @@ export class SeriesCardComponent implements OnInit, OnChanges {
async scanLibrary(series: Series) {
this.seriesService.scan(series.libraryId, series.id).subscribe((res: any) => {
this.toastr.success(this.translocoService.translate('toasts.scan-queued', {name: series.name}));
this.toastr.success(translate('toasts.scan-queued', {name: series.name}));
});
}