Add series data in metadata edit tab

This commit is contained in:
aditya.chandel
2025-01-25 23:23:48 -07:00
parent 5b214bee2d
commit 41aef60b11
2 changed files with 51 additions and 1 deletions
@@ -68,6 +68,34 @@
</div>
</div>
<!-- Series -->
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
<div class="flex flex-col gap-1 w-1/3">
<label for="language">Series</label>
<div class="flex justify-between items-center gap-2">
<input pInputText id="seriesName" formControlName="seriesName" class="w-full"/>
<p-button *ngIf="!metadata['seriesNameLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('seriesName')" severity="success"></p-button>
<p-button *ngIf="metadata['seriesNameLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('seriesName')" severity="warn"></p-button>
</div>
</div>
<div class="flex flex-col gap-1 w-1/3">
<label for="isbn10">Book Number</label>
<div class="flex justify-between items-center gap-2">
<input pInputText id="seriesNumber" formControlName="seriesNumber" class="w-full"/>
<p-button *ngIf="!metadata['seriesNumberLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('seriesNumber')" severity="success"></p-button>
<p-button *ngIf="metadata['seriesNumberLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('seriesNumber')" severity="warn"></p-button>
</div>
</div>
<div class="flex flex-col gap-1 w-1/3">
<label for="isbn13">Books in Series</label>
<div class="flex justify-between items-center gap-2">
<input pInputText id="seriesTotal" formControlName="seriesTotal" class="w-full"/>
<p-button *ngIf="!metadata['seriesTotalLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('seriesTotal')" severity="success"></p-button>
<p-button *ngIf="metadata['seriesTotalLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('seriesTotal')" severity="warn"></p-button>
</div>
</div>
</div>
<!-- ISBN, Language, Review Count -->
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
<div class="flex flex-col gap-1 w-1/3">
@@ -128,7 +156,7 @@
<div class="flex flex-col gap-1 w-full">
<label for="description">Description</label>
<div class="flex justify-between items-center gap-2">
<textarea rows="12" pTextarea id="description" formControlName="description" class="w-full"></textarea>
<textarea rows="9" pTextarea id="description" formControlName="description" class="w-full"></textarea>
<p-button *ngIf="!metadata['descriptionLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('description')" severity="success"></p-button>
<p-button *ngIf="metadata['descriptionLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('description')" severity="warn"></p-button>
</div>
@@ -54,6 +54,9 @@ export class MetadataEditorComponent implements OnInit {
language: new FormControl(''),
rating: new FormControl(''),
reviewCount: new FormControl(''),
seriesName: new FormControl(''),
seriesNumber: new FormControl(''),
seriesTotal: new FormControl(''),
titleLocked: new FormControl(false),
subtitleLocked: new FormControl(false),
@@ -68,6 +71,9 @@ export class MetadataEditorComponent implements OnInit {
languageLocked: new FormControl(false),
ratingLocked: new FormControl(false),
reviewCountLocked: new FormControl(false),
seriesNameLocked: new FormControl(false),
seriesNumberLocked: new FormControl(false),
seriesTotalLocked: new FormControl(false),
});
}
@@ -90,6 +96,9 @@ export class MetadataEditorComponent implements OnInit {
language: metadata.language,
rating: metadata.rating,
reviewCount: metadata.reviewCount,
seriesName: metadata.seriesName,
seriesNumber: metadata.seriesNumber,
seriesTotal: metadata.seriesTotal,
titleLocked: metadata.titleLocked || false,
subtitleLocked: metadata.subtitleLocked || false,
@@ -104,6 +113,9 @@ export class MetadataEditorComponent implements OnInit {
languageLocked: metadata.languageLocked || false,
ratingLocked: metadata.ratingLocked || false,
reviewCountLocked: metadata.reviewCountLocked || false,
seriesNameLocked: metadata.seriesNameLocked || false,
seriesNumberLocked: metadata.seriesNumberLocked || false,
seriesTotalLocked: metadata.seriesTotalLocked || false,
});
if (metadata.titleLocked) this.bookMetadataForm.get('title')?.disable();
@@ -119,6 +131,9 @@ export class MetadataEditorComponent implements OnInit {
if (metadata.ratingLocked) this.bookMetadataForm.get('rating')?.disable();
if (metadata.pageCountLocked) this.bookMetadataForm.get('pageCount')?.disable();
if (metadata.descriptionLocked) this.bookMetadataForm.get('description')?.disable();
if (metadata.seriesNameLocked) this.bookMetadataForm.get('seriesName')?.disable();
if (metadata.seriesNumberLocked) this.bookMetadataForm.get('seriesNumber')?.disable();
if (metadata.seriesTotalLocked) this.bookMetadataForm.get('seriesTotal')?.disable();
}
});
}
@@ -170,6 +185,9 @@ export class MetadataEditorComponent implements OnInit {
rating: this.bookMetadataForm.get('rating')?.value,
reviewCount: this.bookMetadataForm.get('reviewCount')?.value,
language: this.bookMetadataForm.get('language')?.value,
seriesName: this.bookMetadataForm.get('seriesName')?.value,
seriesNumber: this.bookMetadataForm.get('seriesNumber')?.value,
seriesTotal: this.bookMetadataForm.get('seriesTotal')?.value,
titleLocked: this.bookMetadataForm.get('titleLocked')?.value,
subtitleLocked: this.bookMetadataForm.get('subtitleLocked')?.value,
@@ -184,6 +202,10 @@ export class MetadataEditorComponent implements OnInit {
languageLocked: this.bookMetadataForm.get('languageLocked')?.value,
ratingLocked: this.bookMetadataForm.get('ratingLocked')?.value,
reviewCountLocked: this.bookMetadataForm.get('reviewCountLocked')?.value,
seriesNameLocked: this.bookMetadataForm.get('seriesNameLocked')?.value,
seriesNumberLocked: this.bookMetadataForm.get('seriesNumberLocked')?.value,
seriesTotalLocked: this.bookMetadataForm.get('seriesTotalLocked')?.value,
};
return updatedBookMetadata;
}