Fix: Custom/Added icons not visible when assigning shelf (#2010)
Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
+5
-1
@@ -47,7 +47,11 @@
|
||||
<label [for]="'shelf-' + shelf.id" class="shelf-label">
|
||||
<div class="shelf-icon-wrapper">
|
||||
@if (shelf.icon) {
|
||||
<i [class]="'pi pi-' + shelf.icon + ' shelf-icon'"></i>
|
||||
<app-icon-display
|
||||
[icon]="getShelfIcon(shelf)"
|
||||
size="20px"
|
||||
iconClass="shelf-icon"
|
||||
/>
|
||||
} @else {
|
||||
<i class="pi pi-bookmark shelf-icon"></i>
|
||||
}
|
||||
|
||||
+12
-1
@@ -14,6 +14,8 @@ import {Checkbox} from 'primeng/checkbox';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {BookDialogHelperService} from '../book-browser/BookDialogHelperService';
|
||||
import {LoadingService} from '../../../../core/services/loading.service';
|
||||
import {IconDisplayComponent} from '../../../../shared/components/icon-display/icon-display.component';
|
||||
import {IconSelection} from '../../../../shared/service/icon-picker.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-shelf-assigner',
|
||||
@@ -24,7 +26,8 @@ import {LoadingService} from '../../../../core/services/loading.service';
|
||||
Button,
|
||||
Checkbox,
|
||||
AsyncPipe,
|
||||
FormsModule
|
||||
FormsModule,
|
||||
IconDisplayComponent
|
||||
]
|
||||
})
|
||||
export class ShelfAssignerComponent implements OnInit {
|
||||
@@ -107,4 +110,12 @@ export class ShelfAssignerComponent implements OnInit {
|
||||
isShelfSelected(shelf: Shelf): boolean {
|
||||
return this.selectedShelves.some(s => s.id === shelf.id);
|
||||
}
|
||||
|
||||
getShelfIcon(shelf: Shelf): IconSelection {
|
||||
if (shelf.iconType === 'PRIME_NG') {
|
||||
return {type: 'PRIME_NG', value: `pi pi-${shelf.icon}`};
|
||||
} else {
|
||||
return {type: 'CUSTOM_SVG', value: shelf.icon};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user