Fixed most UI comments
This commit is contained in:
parent
ec5578f1e1
commit
0d4825ae14
8 changed files with 10 additions and 26 deletions
|
|
@ -14,7 +14,7 @@ export enum LibraryType {
|
||||||
|
|
||||||
export const allLibraryTypes = [LibraryType.Manga, LibraryType.ComicVine, LibraryType.Comic, LibraryType.Book, LibraryType.LightNovel, LibraryType.Images];
|
export const allLibraryTypes = [LibraryType.Manga, LibraryType.ComicVine, LibraryType.Comic, LibraryType.Book, LibraryType.LightNovel, LibraryType.Images];
|
||||||
export const allKavitaPlusMetadataApplicableTypes = [LibraryType.Manga, LibraryType.LightNovel, LibraryType.ComicVine, LibraryType.Comic];
|
export const allKavitaPlusMetadataApplicableTypes = [LibraryType.Manga, LibraryType.LightNovel, LibraryType.ComicVine, LibraryType.Comic];
|
||||||
export const allKavitaPlusEligibleTypes = [LibraryType.Manga, LibraryType.LightNovel];
|
export const allKavitaPlusScrobbleEligibleTypes = [LibraryType.Manga, LibraryType.LightNovel];
|
||||||
|
|
||||||
export interface Library {
|
export interface Library {
|
||||||
id: number;
|
id: number;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<ng-container *transloco="let t">
|
<ng-container *transloco="let t">
|
||||||
<button class="btn btn-sm btn-icon" (click)="updateSortOrder()" style="height: 25px; padding-bottom: 0;" [disabled]="isDisabled()">
|
<button class="btn btn-sm btn-icon" (click)="updateSortOrder()" style="height: 25px; padding-bottom: 0;" [disabled]="disabled()">
|
||||||
@if (currentAscending()) {
|
@if (isAscending()) {
|
||||||
<i class="fa fa-arrow-up" [title]="t('metadata-filter.ascending-alt')"></i>
|
<i class="fa fa-arrow-up" [title]="t('metadata-filter.ascending-alt')"></i>
|
||||||
} @else {
|
} @else {
|
||||||
<i class="fa fa-arrow-down" [title]="t('metadata-filter.descending-alt')"></i>
|
<i class="fa fa-arrow-down" [title]="t('metadata-filter.descending-alt')"></i>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import {ChangeDetectionStrategy, Component, computed, EventEmitter, input, Output, signal} from '@angular/core';
|
import {ChangeDetectionStrategy, Component, input, model} from '@angular/core';
|
||||||
import {TranslocoDirective} from "@jsverse/transloco";
|
import {TranslocoDirective} from "@jsverse/transloco";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|
@ -12,21 +12,10 @@ import {TranslocoDirective} from "@jsverse/transloco";
|
||||||
})
|
})
|
||||||
export class SortButtonComponent {
|
export class SortButtonComponent {
|
||||||
|
|
||||||
// input is replacement for @Input
|
|
||||||
disabled = input<boolean>(false);
|
disabled = input<boolean>(false);
|
||||||
isAscending = input<boolean>(true);
|
isAscending = model<boolean>(true);
|
||||||
|
|
||||||
// signal is for internal state, whenever component needs to update the state internally. Not needed for disabled since component doesn't internally modify
|
|
||||||
private isAscendingSignal = signal(this.isAscending());
|
|
||||||
|
|
||||||
// Computed signals for template
|
|
||||||
protected currentAscending = computed(() => this.isAscendingSignal());
|
|
||||||
protected isDisabled = computed(() => this.disabled());
|
|
||||||
|
|
||||||
@Output() update = new EventEmitter<boolean>();
|
|
||||||
|
|
||||||
updateSortOrder() {
|
updateSortOrder() {
|
||||||
this.isAscendingSignal.set(!this.isAscendingSignal());
|
this.isAscending.set(!this.isAscending());
|
||||||
this.update.emit(this.isAscendingSignal());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -148,13 +148,9 @@ export class AllSeriesComponent implements OnInit {
|
||||||
if (this.shouldRewriteTitle()) {
|
if (this.shouldRewriteTitle()) {
|
||||||
const field = this.filter!.statements[0].field;
|
const field = this.filter!.statements[0].field;
|
||||||
|
|
||||||
console.log('field', field);
|
|
||||||
|
|
||||||
// This api returns value as string and number, it will complain without the casting
|
// This api returns value as string and number, it will complain without the casting
|
||||||
(this.metadataService.getOptionsForFilterField<FilterField>(field, 'series') as Observable<Select2Option[]>).subscribe((opts: Select2Option[]) => {
|
(this.metadataService.getOptionsForFilterField<FilterField>(field, 'series') as Observable<Select2Option[]>).subscribe((opts: Select2Option[]) => {
|
||||||
console.log('opts:', opts);
|
|
||||||
|
|
||||||
// BUG: There is now a timing issue when navigating FROM a click. On refresh it works.
|
|
||||||
const matchingOpts = opts.filter(m => `${m.value}` === `${this.filter!.statements[0].value}`);
|
const matchingOpts = opts.filter(m => `${m.value}` === `${this.filter!.statements[0].value}`);
|
||||||
if (matchingOpts.length === 0) return;
|
if (matchingOpts.length === 0) return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@ export class CardDetailLayoutComponent<TFilter extends number, TSort extends num
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
if (this.trackByIdentity === undefined) {
|
if (this.trackByIdentity === undefined) {
|
||||||
this.trackByIdentity = (_: number, item: any) => `${this.header}_${this.updateApplied}_${item?.libraryId}`;
|
this.trackByIdentity = (_: number, item: any) => `${this.header()}_${this.updateApplied}_${item?.id}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.pagination === undefined) {
|
if (this.pagination === undefined) {
|
||||||
|
|
|
||||||
|
|
@ -312,7 +312,6 @@ export class MetadataFilterRowComponent<TFilter extends number = number, TSort e
|
||||||
|
|
||||||
handleFieldChange(val: string) {
|
handleFieldChange(val: string) {
|
||||||
const inputVal = parseInt(val, 10) as TFilter;
|
const inputVal = parseInt(val, 10) as TFilter;
|
||||||
console.log('input', inputVal);inputVal
|
|
||||||
|
|
||||||
const stringFields = this.filterUtilitiesService.getStringFields<TFilter>(this.entityType());
|
const stringFields = this.filterUtilitiesService.getStringFields<TFilter>(this.entityType());
|
||||||
const dropdownFields = this.filterUtilitiesService.getDropdownFields<TFilter>(this.entityType());
|
const dropdownFields = this.filterUtilitiesService.getDropdownFields<TFilter>(this.entityType());
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3 col-sm-9">
|
<div class="col-md-3 col-sm-9">
|
||||||
<label for="sort-options" class="form-label">{{t('sort-by-label')}}</label>
|
<label for="sort-options" class="form-label">{{t('sort-by-label')}}</label>
|
||||||
<app-sort-button [disabled]="filterSettings().sortDisabled" (update)="updateSortOrder($event)" [isAscending]="isAscendingSort" />
|
<app-sort-button [disabled]="filterSettings().sortDisabled" (isAscendingChange)="updateSortOrder($event)" [isAscending]="isAscendingSort" />
|
||||||
<select id="sort-options" class="form-select" formControlName="sortField" style="height: 38px;">
|
<select id="sort-options" class="form-select" formControlName="sortField" style="height: 38px;">
|
||||||
@for(field of sortFieldOptions(); track field.value) {
|
@for(field of sortFieldOptions(); track field.value) {
|
||||||
<option [value]="field.value">{{field.title}}</option>
|
<option [value]="field.value">{{field.title}}</option>
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ import {
|
||||||
import {ConfirmService} from 'src/app/shared/confirm.service';
|
import {ConfirmService} from 'src/app/shared/confirm.service';
|
||||||
import {Breakpoint, UtilityService} from 'src/app/shared/_services/utility.service';
|
import {Breakpoint, UtilityService} from 'src/app/shared/_services/utility.service';
|
||||||
import {
|
import {
|
||||||
allKavitaPlusEligibleTypes,
|
|
||||||
allKavitaPlusMetadataApplicableTypes,
|
allKavitaPlusMetadataApplicableTypes,
|
||||||
|
allKavitaPlusScrobbleEligibleTypes,
|
||||||
allLibraryTypes,
|
allLibraryTypes,
|
||||||
Library,
|
Library,
|
||||||
LibraryType
|
LibraryType
|
||||||
|
|
@ -131,7 +131,7 @@ export class LibrarySettingsModalComponent implements OnInit {
|
||||||
|
|
||||||
get IsKavitaPlusEligible() {
|
get IsKavitaPlusEligible() {
|
||||||
const libType = parseInt(this.libraryForm.get('type')?.value + '', 10) as LibraryType;
|
const libType = parseInt(this.libraryForm.get('type')?.value + '', 10) as LibraryType;
|
||||||
return allKavitaPlusEligibleTypes.includes(libType);
|
return allKavitaPlusScrobbleEligibleTypes.includes(libType);
|
||||||
}
|
}
|
||||||
|
|
||||||
get IsMetadataDownloadEligible() {
|
get IsMetadataDownloadEligible() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue