Implement refresh library

This commit is contained in:
aditya.chandel
2024-12-26 14:36:55 -07:00
parent f3bf5e9c0b
commit bc1aa39b34
18 changed files with 214 additions and 32 deletions
@@ -37,13 +37,13 @@
}
.virtual-scroller-item {
height: 243px;
width: 150px;
height: 210px;
width: 130px;
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
gap: 1.3rem;
padding: 1rem;
width: 100%;
@@ -225,7 +225,7 @@ export class BooksBrowserComponent implements OnInit {
},
command: () => {
this.confirmationService.confirm({
message: 'Sure you want to delete ' + this.entity?.name + "?",
message: 'Sure you want to delete library: ' + this.entity?.name + "?",
header: 'Confirmation',
icon: 'pi pi-exclamation-triangle',
acceptIcon: 'none',
@@ -249,6 +249,38 @@ export class BooksBrowserComponent implements OnInit {
}
});
}
},
{
icon: 'pi pi-refresh',
tooltipOptions: {
tooltipLabel: 'Refresh',
tooltipPosition: 'top'
},
command: () => {
this.confirmationService.confirm({
message: 'Sure you want to refresh library: ' + this.entity?.name + "?",
header: 'Confirmation',
icon: 'pi pi-exclamation-triangle',
acceptIcon: 'none',
rejectIcon: 'none',
rejectButtonStyleClass: 'p-button-text',
accept: () => {
this.libraryService.refreshLibrary(this.entity?.id!).subscribe({
complete: () => {
this.messageService.add({severity: 'info', summary: 'Success', detail: 'Library refresh scheduled'});
},
error: () => {
this.messageService.add({
severity: 'error',
summary: 'Failed',
detail: 'Failed to refresh library',
life: 3000
});
}
});
}
});
}
}
];
}