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,140 @@
<ng-container *transloco="let t; prefix: 'book.shelfCreator'">
<div class="shelf-creator">
<div class="panel-header">
<div class="header-icon-wrapper">
<i class="pi pi-bookmark 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"
(click)="cancel()"
severity="secondary"
[text]="true"
[rounded]="true"
class="close-button"
[pTooltip]="t('closeTooltip')"
tooltipPosition="left"/>
</div>
<div class="form-container">
<div class="form-group highlight-group">
<label for="shelfName" class="form-label">
<i class="pi pi-tag label-icon"></i>
{{ t('shelfNameLabel') }}
<span class="required-indicator">*</span>
</label>
<div class="input-wrapper">
<input
id="shelfName"
type="text"
pInputText
[(ngModel)]="shelfName"
class="input-full"
[placeholder]="t('shelfNamePlaceholder')"
[class.filled]="shelfName.trim()"
/>
@if (shelfName.trim()) {
<i class="pi pi-check-circle input-icon success"></i>
}
</div>
</div>
<div class="gradient-divider"></div>
<div class="form-group highlight-group">
<label class="form-label">
<i class="pi pi-palette label-icon"></i>
{{ t('shelfIconLabel') }}
</label>
@if (!selectedIcon) {
<button class="icon-select-btn" (click)="openIconPicker()" type="button">
<i class="pi pi-plus"></i>
<div class="btn-content">
<span class="btn-title">{{ t('chooseIcon') }}</span>
<span class="btn-subtitle">{{ t('chooseIconSubtitle') }}</span>
</div>
</button>
} @else {
<div class="selected-icon-display">
<div class="icon-preview">
<app-icon-display
[icon]="selectedIcon"
size="24px"
/>
</div>
<div class="icon-info">
<span class="icon-label">{{ t('selectedIcon') }}</span>
<span class="icon-name">
@if (selectedIcon.type === 'PRIME_NG') {
{{ selectedIcon.value }}
} @else {
{{ selectedIcon.value }}
}
</span>
</div>
<p-button
icon="pi pi-times"
severity="danger"
[outlined]="true"
[rounded]="true"
size="small"
(onClick)="clearSelectedIcon()"
[pTooltip]="t('removeIconTooltip')"
tooltipPosition="left"
/>
</div>
}
</div>
@if (isAdmin) {
<div class="gradient-divider"></div>
<div class="form-group highlight-group">
<label class="form-label">
<i class="pi pi-globe label-icon"></i>
{{ t('visibilityLabel') }}
</label>
<div class="input-wrapper" 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">{{ t('makePublicLabel') }}</label>
</div>
</div>
}
</div>
<div class="dialog-footer">
<div class="validation-status">
@if (!shelfName.trim()) {
<div class="validation-message error">
<i class="pi pi-exclamation-circle"></i>
<span>{{ t('validationRequired') }}</span>
</div>
} @else {
<div class="validation-message success">
<i class="pi pi-check-circle"></i>
<span>{{ t('validationReady') }}</span>
</div>
}
</div>
<div class="footer-actions">
<p-button
[label]="t('cancelButton')"
severity="secondary"
[outlined]="true"
(onClick)="cancel()"
/>
<p-button
[label]="t('createButton')"
icon="pi pi-plus"
severity="success"
(onClick)="createShelf()"
[disabled]="!shelfName.trim()"
/>
</div>
</div>
</div>
</ng-container>
@@ -0,0 +1,244 @@
@use '../../../../shared/styles/panel-shared' as panel;
.shelf-creator {
display: flex;
flex-direction: column;
min-width: 600px;
@media (max-width: 640px) {
min-width: auto;
width: 100%;
}
}
.panel-header {
@include panel.panel-header;
}
.form-container {
display: flex;
flex-direction: column;
gap: 1.5rem;
padding: 1.5rem;
background: var(--card-background);
border: 1px solid var(--border-color);
border-top: none;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
@media (max-width: 480px) {
padding: 1rem;
gap: 1rem;
}
}
.form-group {
display: flex;
flex-direction: column;
gap: 0.5rem;
&.highlight-group {
padding: 0.875rem;
}
@media (max-width: 480px) {
gap: 0.375rem;
&.highlight-group {
padding: 0.625rem;
}
}
}
.form-label {
display: flex;
align-items: center;
gap: 0.375rem;
font-size: 0.95rem;
font-weight: 600;
color: var(--text-color);
.label-icon {
color: var(--primary-color);
}
.required-indicator {
color: var(--p-red-500);
margin-left: 0.125rem;
}
@media (max-width: 480px) {
font-size: 0.875rem;
}
}
.input-wrapper {
position: relative;
.input-full {
width: 100%;
padding-right: 2.5rem;
box-sizing: border-box;
}
.input-icon {
position: absolute;
right: 0.75rem;
top: 50%;
transform: translateY(-50%);
font-size: 1rem;
pointer-events: none;
&.success {
color: var(--p-green-500);
}
}
}
.icon-select-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 0.75rem;
width: 100%;
padding: 1rem;
background: var(--ground-background);
border: 1px dashed var(--border-color);
border-radius: 8px;
color: var(--text-color);
font-size: 0.875rem;
font-weight: 500;
cursor: pointer;
transition: all 0.3s ease;
&:hover {
background: var(--overlay-background);
border-color: var(--primary-color);
color: var(--primary-color);
transform: translateY(-1px);
box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}
i {
font-size: 1.25rem;
}
.btn-content {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 0.125rem;
.btn-title {
font-size: 0.9375rem;
font-weight: 600;
}
.btn-subtitle {
font-size: 0.8rem;
opacity: 0.85;
}
}
@media (max-width: 480px) {
padding: 0.75rem;
gap: 0.5rem;
i {
font-size: 1.125rem;
}
.btn-content {
.btn-title {
font-size: 0.875rem;
}
.btn-subtitle {
font-size: 0.75rem;
}
}
}
}
.selected-icon-display {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.875rem;
border: 1px solid var(--border-color);
border-radius: 8px;
background: var(--ground-background);
.icon-preview {
display: flex;
align-items: center;
justify-content: center;
width: 42px;
height: 42px;
background: var(--primary-color);
border-radius: 8px;
box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
app-icon-display {
display: flex;
align-items: center;
justify-content: center;
color: var(--primary-contrast-color);
::ng-deep i {
color: var(--primary-contrast-color);
}
::ng-deep img {
filter: brightness(0) invert(1);
}
}
}
.icon-info {
flex: 1;
display: flex;
flex-direction: column;
gap: 0.125rem;
.icon-label {
font-size: 0.8rem;
color: var(--text-secondary-color);
}
.icon-name {
font-size: 0.875rem;
font-weight: 500;
color: var(--text-color);
font-family: monospace;
}
}
@media (max-width: 480px) {
padding: 0.625rem;
gap: 0.5rem;
.icon-preview {
width: 36px;
height: 36px;
}
.icon-info {
.icon-label {
font-size: 0.75rem;
}
.icon-name {
font-size: 0.8rem;
}
}
}
}
.dialog-footer {
@include panel.dialog-footer;
border-top: none;
}
.validation-message {
@include panel.validation-message;
}
@@ -0,0 +1,82 @@
import {Component, inject} from '@angular/core';
import {DynamicDialogRef} from 'primeng/dynamicdialog';
import {MessageService} from 'primeng/api';
import {ShelfService} from '../../service/shelf.service';
import {IconPickerService, IconSelection} from '../../../../shared/service/icon-picker.service';
import {Shelf} from '../../model/shelf.model';
import {FormsModule} from '@angular/forms';
import {Button} from 'primeng/button';
import {InputText} from 'primeng/inputtext';
import {Tooltip} from 'primeng/tooltip';
import {IconDisplayComponent} from '../../../../shared/components/icon-display/icon-display.component';
import {UserService} from '../../../settings/user-management/user.service';
import {CheckboxModule} from 'primeng/checkbox';
import {TranslocoDirective, TranslocoService} from '@jsverse/transloco';
@Component({
selector: 'app-shelf-creator',
standalone: true,
templateUrl: './shelf-creator.component.html',
imports: [
FormsModule,
Button,
InputText,
Tooltip,
IconDisplayComponent,
CheckboxModule,
TranslocoDirective
],
styleUrl: './shelf-creator.component.scss',
})
export class ShelfCreatorComponent {
private shelfService = inject(ShelfService);
private dynamicDialogRef = inject(DynamicDialogRef);
private messageService = inject(MessageService);
private iconPickerService = inject(IconPickerService);
private userService = inject(UserService);
private readonly t = inject(TranslocoService);
shelfName: string = '';
selectedIcon: IconSelection | null = null;
isPublic: boolean = false;
isAdmin: boolean = this.userService.getCurrentUser()?.permissions.admin ?? false;
openIconPicker(): void {
this.iconPickerService.open().subscribe(icon => {
if (icon) {
this.selectedIcon = icon;
}
});
}
clearSelectedIcon(): void {
this.selectedIcon = null;
}
cancel(): void {
this.dynamicDialogRef.close();
}
createShelf(): void {
const iconValue = this.selectedIcon?.value ?? null;
const iconType = this.selectedIcon?.type ?? null;
const newShelf: Partial<Shelf> = {
name: this.shelfName,
icon: iconValue,
iconType: iconType,
publicShelf: this.isPublic
};
this.shelfService.createShelf(newShelf as Shelf).subscribe({
next: () => {
this.messageService.add({severity: 'info', summary: this.t.translate('common.success'), detail: this.t.translate('book.shelfCreator.toast.createSuccessDetail', { name: this.shelfName })});
this.dynamicDialogRef.close(true);
},
error: (e) => {
this.messageService.add({severity: 'error', summary: this.t.translate('common.error'), detail: this.t.translate('book.shelfCreator.toast.createFailedDetail')});
console.error('Error creating shelf:', e);
}
});
}
}