Add support for uploading and assigning custom SVG icons to libraries… (#1788)

* Add support for uploading and assigning custom SVG icons to libraries and shelves

* Add few default icons
This commit is contained in:
Aditya Chandel
2025-12-07 15:16:22 -07:00
committed by GitHub
parent 04b9f88510
commit ad0a99bcbc
74 changed files with 1613 additions and 171 deletions
@@ -3,11 +3,16 @@ import {DialogService, DynamicDialogRef} from 'primeng/dynamicdialog';
import {IconPickerComponent} from '../components/icon-picker/icon-picker-component';
import {Observable} from 'rxjs';
export interface IconSelection {
type: 'PRIME_NG' | 'CUSTOM_SVG';
value: string;
}
@Injectable({providedIn: 'root'})
export class IconPickerService {
private dialog = inject(DialogService);
open(): Observable<string> {
open(): Observable<IconSelection> {
const isMobile = window.innerWidth <= 768;
const ref: DynamicDialogRef | null = this.dialog.open(IconPickerComponent, {
header: 'Choose an Icon',
@@ -22,6 +27,6 @@ export class IconPickerService {
minWidth: isMobile ? '90vw' : '800px',
}
});
return ref!.onClose as Observable<string>;
return ref!.onClose as Observable<IconSelection>;
}
}
@@ -100,4 +100,9 @@ export class UrlHelperService {
}
});
}
getIconUrl(iconName: string): string {
const url = `${this.mediaBaseUrl}/icon/${iconName}`;
return this.appendToken(url);
}
}