Add Moods and Tags to Bulk Metadata Updater (#1339)
This commit is contained in:
@@ -225,6 +225,10 @@ export interface BulkMetadataUpdateRequest {
|
|||||||
clearPublishedDate?: boolean;
|
clearPublishedDate?: boolean;
|
||||||
genres?: string[];
|
genres?: string[];
|
||||||
clearGenres?: boolean;
|
clearGenres?: boolean;
|
||||||
|
moods?: string[];
|
||||||
|
clearMoods?: boolean;
|
||||||
|
tags?: string[];
|
||||||
|
clearTags?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BookDeletionResponse {
|
export interface BookDeletionResponse {
|
||||||
|
|||||||
+3
-3
@@ -99,7 +99,7 @@
|
|||||||
[ngClass]="{
|
[ngClass]="{
|
||||||
'outlined-input-green': isValueCopied(field.controlName) && !hoveredFields[field.controlName],
|
'outlined-input-green': isValueCopied(field.controlName) && !hoveredFields[field.controlName],
|
||||||
}">
|
}">
|
||||||
<p-autoComplete formControlName="{{field.controlName}}" [multiple]="true" [typeahead]="false" [dropdown]="false" [forceSelection]="false" styleClass="w-full" (onBlur)="onAutoCompleteBlur(field.controlName, $event)"></p-autoComplete>
|
<p-autoComplete formControlName="{{field.controlName}}" [multiple]="true" [typeahead]="false" [dropdown]="false" [forceSelection]="false" class="w-full" (onBlur)="onAutoCompleteBlur(field.controlName, $event)"></p-autoComplete>
|
||||||
</div>
|
</div>
|
||||||
<p-button
|
<p-button
|
||||||
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"
|
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
[ngModel]="fetchedMetadata[field.fetchedKey] ?? []"
|
[ngModel]="fetchedMetadata[field.fetchedKey] ?? []"
|
||||||
[ngModelOptions]="{ standalone: true }"
|
[ngModelOptions]="{ standalone: true }"
|
||||||
[disabled]="true"
|
[disabled]="true"
|
||||||
[multiple]="true" [typeahead]="false" [dropdown]="false" [forceSelection]="false" styleClass="w-full">
|
[multiple]="true" [typeahead]="false" [dropdown]="false" [forceSelection]="false" class="w-full">
|
||||||
</p-autoComplete>
|
</p-autoComplete>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -202,7 +202,7 @@
|
|||||||
<div class="flex items-center py-1">
|
<div class="flex items-center py-1">
|
||||||
<label for="{{field.controlName}}" class="w-[15%]">{{ field.label }}</label>
|
<label for="{{field.controlName}}" class="w-[15%]">{{ field.label }}</label>
|
||||||
<div class="flex w-full">
|
<div class="flex w-full">
|
||||||
<p-autoComplete formControlName="{{field.controlName}}" [multiple]="true" [typeahead]="false" [dropdown]="false" [forceSelection]="false" styleClass="w-full" (onBlur)="onAutoCompleteBlur(field.controlName, $event)"></p-autoComplete>
|
<p-autoComplete formControlName="{{field.controlName}}" [multiple]="true" [typeahead]="false" [dropdown]="false" [forceSelection]="false" class="w-full" (onBlur)="onAutoCompleteBlur(field.controlName, $event)"></p-autoComplete>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
@if ((bookState$ | async)?.loaded === false) {
|
@if ((bookState$ | async)?.loaded === false) {
|
||||||
<div class="flex items-center justify-center h-full">
|
<div class="flex items-center justify-center h-full">
|
||||||
<p-progressSpinner
|
<p-progressSpinner
|
||||||
styleClass="spinner center-spinner"
|
class="spinner center-spinner"
|
||||||
[style]="{'width': '60px', 'height': '60px'}"
|
[style]="{'width': '60px', 'height': '60px'}"
|
||||||
strokeWidth="3"
|
strokeWidth="3"
|
||||||
fill="transparent"
|
fill="transparent"
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
<p-multiSelect [options]="libraryOptions" formControlName="value" display="chip" class="w-full" appendTo="body" placeholder="Select Libraries"></p-multiSelect>
|
<p-multiSelect [options]="libraryOptions" formControlName="value" display="chip" class="w-full" appendTo="body" placeholder="Select Libraries"></p-multiSelect>
|
||||||
} @else {
|
} @else {
|
||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
<p-autoComplete [formControl]="ruleCtrl.get('value')" [multiple]="true" [typeahead]="false" [dropdown]="false" [forceSelection]="false" styleClass="w-full" placeholder="Enter values (press Enter or comma)" (onBlur)="onAutoCompleteBlur(ruleCtrl.get('value'), $event)"></p-autoComplete>
|
<p-autoComplete [formControl]="ruleCtrl.get('value')" [multiple]="true" [typeahead]="false" [dropdown]="false" [forceSelection]="false" class="w-full" placeholder="Enter values (press Enter or comma)" (onBlur)="onAutoCompleteBlur(ruleCtrl.get('value'), $event)"></p-autoComplete>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
} @else if (ruleCtrl.get('field')?.value === 'readStatus') {
|
} @else if (ruleCtrl.get('field')?.value === 'readStatus') {
|
||||||
|
|||||||
+1
-1
@@ -134,7 +134,7 @@
|
|||||||
[ngModel]="fetchedMetadata[field.fetchedKey] ?? []"
|
[ngModel]="fetchedMetadata[field.fetchedKey] ?? []"
|
||||||
[ngModelOptions]="{ standalone: true }"
|
[ngModelOptions]="{ standalone: true }"
|
||||||
[disabled]="true"
|
[disabled]="true"
|
||||||
[multiple]="true" [typeahead]="false" [dropdown]="false" [forceSelection]="false" styleClass="w-full">
|
[multiple]="true" [typeahead]="false" [dropdown]="false" [forceSelection]="false" class="w-full">
|
||||||
</p-autoComplete>
|
</p-autoComplete>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+67
-3
@@ -50,7 +50,7 @@
|
|||||||
<label for="clearAuthors" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
<label for="clearAuthors" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
<p-autoComplete formControlName="authors" [disabled]="clearFields.authors" [multiple]="true" [typeahead]="false" [dropdown]="false" [forceSelection]="false" (onBlur)="onAutoCompleteBlur('authors', $event)" styleClass="w-full"></p-autoComplete>
|
<p-autoComplete formControlName="authors" [disabled]="clearFields.authors" [multiple]="true" [typeahead]="false" [dropdown]="false" [forceSelection]="false" (onBlur)="onAutoCompleteBlur('authors', $event)" class="w-full"></p-autoComplete>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Publisher -->
|
<!-- Publisher -->
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
<label for="clearGenres" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
<label for="clearGenres" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
<p-autoComplete formControlName="genres" [disabled]="clearFields.genres" [multiple]="true" [typeahead]="false" [dropdown]="false" [forceSelection]="false" (onBlur)="onAutoCompleteBlur('genres', $event)" styleClass="w-full"></p-autoComplete>
|
<p-autoComplete formControlName="genres" [disabled]="clearFields.genres" [multiple]="true" [typeahead]="false" [dropdown]="false" [forceSelection]="false" (onBlur)="onAutoCompleteBlur('genres', $event)" class="w-full"></p-autoComplete>
|
||||||
|
|
||||||
<div class="flex items-center gap-2 mt-2">
|
<div class="flex items-center gap-2 mt-2">
|
||||||
<p-checkbox
|
<p-checkbox
|
||||||
@@ -150,7 +150,71 @@
|
|||||||
binary="true"
|
binary="true"
|
||||||
/>
|
/>
|
||||||
<label for="mergeCategories" class="text-sm text-gray-300 cursor-pointer">
|
<label for="mergeCategories" class="text-sm text-gray-300 cursor-pointer">
|
||||||
Keep existing categories and add new ones (uncheck to remove all existing categories)
|
Keep existing genres and add new ones (uncheck to remove all existing genres)
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Moods -->
|
||||||
|
<div class="flex flex-col gap-2">
|
||||||
|
<label for="moods" class="flex items-center justify-between gap-2">
|
||||||
|
<span class="flex items-center gap-2">
|
||||||
|
Mood(s)
|
||||||
|
<i class="pi pi-info-circle text-sky-600"
|
||||||
|
pTooltip="Enter multiple moods. Press Enter after typing each mood."
|
||||||
|
tooltipPosition="right"
|
||||||
|
style="cursor: pointer"></i>
|
||||||
|
</span>
|
||||||
|
<div class="flex items-center gap-1">
|
||||||
|
<p-checkbox [(ngModel)]="clearFields.moods" [ngModelOptions]="{standalone: true}"
|
||||||
|
(onChange)="onFieldClearToggle('moods')" binary="true" inputId="clearMoods"/>
|
||||||
|
<label for="clearMoods" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
<p-autoComplete formControlName="moods" [disabled]="clearFields.moods" [multiple]="true" [typeahead]="false" [dropdown]="false" [forceSelection]="false" (onBlur)="onAutoCompleteBlur('moods', $event)" class="w-full"></p-autoComplete>
|
||||||
|
|
||||||
|
<div class="flex items-center gap-2 mt-2">
|
||||||
|
<p-checkbox
|
||||||
|
inputId="mergeMoods"
|
||||||
|
name="mergeMoods"
|
||||||
|
[(ngModel)]="mergeMoods"
|
||||||
|
[ngModelOptions]="{ standalone: true }"
|
||||||
|
binary="true"
|
||||||
|
/>
|
||||||
|
<label for="mergeMoods" class="text-sm text-gray-300 cursor-pointer">
|
||||||
|
Keep existing moods and add new ones (uncheck to remove all existing moods)
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Tags -->
|
||||||
|
<div class="flex flex-col gap-2">
|
||||||
|
<label for="tags" class="flex items-center justify-between gap-2">
|
||||||
|
<span class="flex items-center gap-2">
|
||||||
|
Tag(s)
|
||||||
|
<i class="pi pi-info-circle text-sky-600"
|
||||||
|
pTooltip="Enter multiple tags. Press Enter after typing each tag."
|
||||||
|
tooltipPosition="right"
|
||||||
|
style="cursor: pointer"></i>
|
||||||
|
</span>
|
||||||
|
<div class="flex items-center gap-1">
|
||||||
|
<p-checkbox [(ngModel)]="clearFields.tags" [ngModelOptions]="{standalone: true}"
|
||||||
|
(onChange)="onFieldClearToggle('tags')" binary="true" inputId="clearTags"/>
|
||||||
|
<label for="clearTags" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
<p-autoComplete formControlName="tags" [disabled]="clearFields.tags" [multiple]="true" [typeahead]="false" [dropdown]="false" [forceSelection]="false" (onBlur)="onAutoCompleteBlur('tags', $event)" class="w-full"></p-autoComplete>
|
||||||
|
|
||||||
|
<div class="flex items-center gap-2 mt-2">
|
||||||
|
<p-checkbox
|
||||||
|
inputId="mergeTags"
|
||||||
|
name="mergeTags"
|
||||||
|
[(ngModel)]="mergeTags"
|
||||||
|
[ngModelOptions]="{ standalone: true }"
|
||||||
|
binary="true"
|
||||||
|
/>
|
||||||
|
<label for="mergeTags" class="text-sm text-gray-300 cursor-pointer">
|
||||||
|
Keep existing tags and add new ones (uncheck to remove all existing tags)
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+14
-2
@@ -38,6 +38,8 @@ export class BulkMetadataUpdateComponent implements OnInit {
|
|||||||
books: Book[] = [];
|
books: Book[] = [];
|
||||||
showBookList = true;
|
showBookList = true;
|
||||||
mergeCategories = true;
|
mergeCategories = true;
|
||||||
|
mergeMoods = true;
|
||||||
|
mergeTags = true;
|
||||||
loading = false;
|
loading = false;
|
||||||
|
|
||||||
clearFields = {
|
clearFields = {
|
||||||
@@ -48,6 +50,8 @@ export class BulkMetadataUpdateComponent implements OnInit {
|
|||||||
seriesTotal: false,
|
seriesTotal: false,
|
||||||
publishedDate: false,
|
publishedDate: false,
|
||||||
genres: false,
|
genres: false,
|
||||||
|
moods: false,
|
||||||
|
tags: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
private readonly config = inject(DynamicDialogConfig);
|
private readonly config = inject(DynamicDialogConfig);
|
||||||
@@ -67,7 +71,9 @@ export class BulkMetadataUpdateComponent implements OnInit {
|
|||||||
seriesName: [''],
|
seriesName: [''],
|
||||||
seriesTotal: [''],
|
seriesTotal: [''],
|
||||||
publishedDate: [null],
|
publishedDate: [null],
|
||||||
genres: []
|
genres: [],
|
||||||
|
moods: [],
|
||||||
|
tags: []
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,7 +146,13 @@ export class BulkMetadataUpdateComponent implements OnInit {
|
|||||||
clearPublishedDate: this.clearFields.publishedDate,
|
clearPublishedDate: this.clearFields.publishedDate,
|
||||||
|
|
||||||
genres: this.clearFields.genres ? [] : (formValue.genres?.length ? formValue.genres : undefined),
|
genres: this.clearFields.genres ? [] : (formValue.genres?.length ? formValue.genres : undefined),
|
||||||
clearGenres: this.clearFields.genres
|
clearGenres: this.clearFields.genres,
|
||||||
|
|
||||||
|
moods: this.clearFields.moods ? [] : (formValue.moods?.length ? formValue.moods : undefined),
|
||||||
|
clearMoods: this.clearFields.moods,
|
||||||
|
|
||||||
|
tags: this.clearFields.tags ? [] : (formValue.tags?.length ? formValue.tags : undefined),
|
||||||
|
clearTags: this.clearFields.tags
|
||||||
};
|
};
|
||||||
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@
|
|||||||
tooltipPosition="top">
|
tooltipPosition="top">
|
||||||
<p-progressBar
|
<p-progressBar
|
||||||
[value]="((currentIndex + 1) / proposals.length) * 100"
|
[value]="((currentIndex + 1) / proposals.length) * 100"
|
||||||
styleClass="w-40 h-3 transition-all duration-300 ease-in-out group-hover:shadow-md"
|
class="w-40 h-3 transition-all duration-300 ease-in-out group-hover:shadow-md"
|
||||||
showValue="false">
|
showValue="false">
|
||||||
</p-progressBar>
|
</p-progressBar>
|
||||||
<span class="text-sm text-gray-300 font-medium tabular-nums whitespace-nowrap">
|
<span class="text-sm text-gray-300 font-medium tabular-nums whitespace-nowrap">
|
||||||
|
|||||||
Reference in New Issue
Block a user