refactor(frontend): rename booklore-ui to frontend

- Frontend path:
  - rename the tracked Angular app tree from `booklore-ui/` to `frontend/`
  - preserve file contents during the move so this commit stays focused on the path change itself
- Frontend docs:
  - update the moved frontend README and contribution guide where they refer to the renamed folder
  - keep those edits limited to path references introduced by the directory rename
This commit is contained in:
James Cox
2026-04-22 17:26:39 -04:00
committed by Zach Yale
parent c99aa87877
commit 874b013f75
1493 changed files with 3 additions and 3 deletions
@@ -0,0 +1,82 @@
<ng-container *transloco="let t; prefix: 'book.shelfEditDialog'">
<div class="shelf-form">
<div class="panel-header">
<div class="header-icon-wrapper">
<i class="pi pi-pencil header-icon"></i>
</div>
<div class="header-text">
<h2 class="panel-title">{{ t('title') }}</h2>
<p class="panel-description">
{{ t('description') }}
</p>
</div>
<p-button
icon="pi pi-times"
[text]="true"
[rounded]="true"
severity="secondary"
(onClick)="closeDialog()"
class="close-button">
</p-button>
</div>
<div class="shelf-container">
<div class="shelf-fields">
<div class="shelf-row">
<label class="label">{{ t('shelfNameLabel') }}</label>
<input type="text" pInputText [(ngModel)]="shelfName" [placeholder]="t('shelfNamePlaceholder')" class="input"/>
</div>
<div class="shelf-row">
<label class="label">{{ t('shelfIconLabel') }}</label>
<div class="icon-section">
@if (!selectedIcon) {
<p-button [label]="t('selectIcon')" icon="pi pi-search" [outlined]="true" severity="info" (onClick)="openIconPicker()"></p-button>
}
@if (selectedIcon) {
<div class="icon-container">
<div class="icon-wrapper">
<app-icon-display
[icon]="selectedIcon"
size="24px"
iconClass="icon"
/>
</div>
<p-button icon="pi pi-times" (onClick)="clearSelectedIcon()" [rounded]="true" [text]="true" severity="danger"></p-button>
</div>
}
</div>
</div>
@if (isAdmin) {
<div class="shelf-row">
<label class="label">{{ t('visibilityLabel') }}</label>
<div class="visibility-section" style="display: flex; align-items: center; gap: 0.5rem;">
<p-checkbox [(ngModel)]="isPublic" [binary]="true" inputId="publicShelf"></p-checkbox>
<label for="publicShelf" style="cursor: pointer; user-select: none;">{{ t('publicShelfLabel') }}</label>
</div>
</div>
}
</div>
</div>
<div class="dialog-footer">
<div></div>
<div class="footer-actions">
<p-button
[label]="t('cancelButton')"
severity="secondary"
[outlined]="true"
(onClick)="closeDialog()"
/>
<p-button
[label]="t('saveChanges')"
icon="pi pi-check"
severity="success"
(onClick)="save()"
/>
</div>
</div>
</div>
</ng-container>
@@ -0,0 +1,108 @@
@use '../../../../shared/styles/panel-shared' as panel;
.shelf-form {
width: 550px;
max-width: 550px;
display: flex;
flex-direction: column;
@media (max-width: 640px) {
width: 100%;
max-width: 100%;
}
}
.panel-header {
@include panel.panel-header;
border-bottom: none;
}
.shelf-container {
display: flex;
flex-direction: column;
gap: 1rem;
padding: 1.75rem;
background: var(--card-background);
border: 1px solid var(--border-color);
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
min-height: 200px;
@media (max-width: 480px) {
padding: 1rem;
}
}
.shelf-fields {
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.shelf-row {
display: flex;
align-items: center;
gap: 1rem;
@media (max-width: 480px) {
flex-direction: column;
align-items: flex-start;
gap: 0.5rem;
}
}
.label {
width: 7rem;
font-weight: 600;
font-size: 0.9375rem;
color: var(--text-color);
margin: 0;
@media (max-width: 480px) {
width: 100%;
}
}
.input {
flex: 1;
width: 100%;
}
.icon-section {
flex: 1;
display: flex;
align-items: center;
@media (max-width: 480px) {
width: 100%;
}
}
.icon-container {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.5rem 0.75rem;
background: var(--ground-background);
border: 1px solid var(--border-color);
border-radius: 8px;
.icon-wrapper {
display: flex;
align-items: center;
justify-content: center;
width: 38px;
height: 38px;
background: var(--primary-color);
border-radius: 8px;
.icon {
font-size: 1.25rem;
color: var(--primary-contrast-color);
}
}
}
.dialog-footer {
@include panel.dialog-footer;
border-top: none;
}
@@ -0,0 +1,113 @@
import {Component, effect, inject, Injector, OnInit} from '@angular/core';
import {ShelfService} from '../../service/shelf.service';
import {DynamicDialogConfig, DynamicDialogRef} from 'primeng/dynamicdialog';
import {Button} from 'primeng/button';
import {InputText} from 'primeng/inputtext';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {Shelf} from '../../model/shelf.model';
import {MessageService} from 'primeng/api';
import {IconPickerService, IconSelection} from '../../../../shared/service/icon-picker.service';
import {IconDisplayComponent} from '../../../../shared/components/icon-display/icon-display.component';
import {CheckboxModule} from 'primeng/checkbox';
import {UserService} from '../../../settings/user-management/user.service';
import {TranslocoDirective, TranslocoService} from '@jsverse/transloco';
@Component({
selector: 'app-shelf-edit-dialog',
imports: [
Button,
InputText,
ReactiveFormsModule,
FormsModule,
IconDisplayComponent,
CheckboxModule,
TranslocoDirective
],
templateUrl: './shelf-edit-dialog.component.html',
standalone: true,
styleUrl: './shelf-edit-dialog.component.scss'
})
export class ShelfEditDialogComponent implements OnInit {
private shelfService = inject(ShelfService);
private dynamicDialogConfig = inject(DynamicDialogConfig);
private dynamicDialogRef = inject(DynamicDialogRef);
private messageService = inject(MessageService);
private iconPickerService = inject(IconPickerService);
private userService = inject(UserService);
private readonly t = inject(TranslocoService);
private readonly injector = inject(Injector);
private shelfInitialized = false;
shelfName: string = '';
selectedIcon: IconSelection | null = null;
shelf!: Shelf | undefined;
isPublic: boolean = false;
isAdmin: boolean = this.userService.getCurrentUser()?.permissions.admin ?? false;
ngOnInit(): void {
const shelfId = this.dynamicDialogConfig?.data.shelfId;
effect(() => {
if (this.shelfInitialized) {
return;
}
const shelf = this.shelfService.shelves().find(currentShelf => currentShelf.id === shelfId);
if (!shelf) {
return;
}
this.shelfInitialized = true;
this.shelf = shelf;
this.shelfName = shelf.name;
this.isPublic = shelf.publicShelf ?? false;
if (shelf.iconType && shelf.icon) {
if (shelf.iconType === 'PRIME_NG') {
this.selectedIcon = {type: 'PRIME_NG', value: `pi pi-${shelf.icon}`};
} else {
this.selectedIcon = {type: 'CUSTOM_SVG', value: shelf.icon};
}
}
}, {injector: this.injector});
}
openIconPicker() {
this.iconPickerService.open().subscribe(icon => {
if (icon) {
this.selectedIcon = icon;
}
})
}
clearSelectedIcon() {
this.selectedIcon = null;
}
save() {
const iconValue = this.selectedIcon?.value ?? null;
const iconType = this.selectedIcon?.type ?? null;
const shelf: Shelf = {
name: this.shelfName,
icon: iconValue,
iconType: iconType,
publicShelf: this.isPublic
};
this.shelfService.updateShelf(shelf, this.shelf?.id).subscribe({
next: () => {
this.messageService.add({severity: 'success', summary: this.t.translate('book.shelfEditDialog.toast.updateSuccessSummary'), detail: this.t.translate('book.shelfEditDialog.toast.updateSuccessDetail')});
this.dynamicDialogRef.close();
},
error: (e) => {
this.messageService.add({severity: 'error', summary: this.t.translate('book.shelfEditDialog.toast.updateFailedSummary'), detail: this.t.translate('book.shelfEditDialog.toast.updateFailedDetail')});
console.error(e);
}
});
}
closeDialog() {
this.dynamicDialogRef.close();
}
}