Add ability to mark magic shelves as public (#1489)

Adds a checkbox to the create/edit magic shelf dialog to set the shelf
as public.
If public then it shows up for all users.
Only admins can edit public shelves (edit options disabled for
non-admin)
This commit is contained in:
Chris Debenham
2025-11-20 21:17:10 -07:00
committed by GitHub
parent 229c360116
commit 79ab4ec5a1
9 changed files with 100 additions and 33 deletions
@@ -13,6 +13,7 @@ export interface MagicShelf {
name: string;
icon?: string;
filterJson: string;
isPublic?: boolean;
}
export interface MagicShelfState {
@@ -92,12 +93,13 @@ export class MagicShelfService {
);
}
saveShelf(data: { id?: number; name: string | null; icon: string | null; group: any }): Observable<MagicShelf> {
saveShelf(data: { id?: number; name: string | null; icon: string | null; group: any, isPublic?: boolean | null }): Observable<MagicShelf> {
const payload: MagicShelf = {
id: data.id,
name: data.name ?? '',
icon: data.icon ?? 'pi pi-book',
filterJson: JSON.stringify(data.group),
isPublic: data.isPublic ?? false
};
return this.http.post<MagicShelf>(this.url, payload).pipe(