Remove Tailwind CSS and all remaining references (#2413)
Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
committed by
acx10
co-authored by
acx10
parent
5d9e535a14
commit
a0870cac86
@@ -56,7 +56,7 @@
|
||||
optionLabel="name"
|
||||
placeholder="Select Library"
|
||||
[(ngModel)]="selectedLibrary"
|
||||
class="w-full">
|
||||
class="full-width">
|
||||
</p-select>
|
||||
</div>
|
||||
<div class="field-group">
|
||||
@@ -68,7 +68,7 @@
|
||||
placeholder="Select Subpath"
|
||||
[(ngModel)]="selectedPath"
|
||||
[disabled]="!selectedLibrary"
|
||||
class="w-full">
|
||||
class="full-width">
|
||||
</p-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -357,6 +357,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
:host ::ng-deep .p-fileupload-content p-progressbar {
|
||||
::host ::ng-deep .p-fileupload-content p-progressbar {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.full-width {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@
|
||||
strokeWidth="4"
|
||||
animationDuration="1s"
|
||||
/>
|
||||
<p class="mt-3 text-secondary">Loading directories...</p>
|
||||
<p class="loading-text">Loading directories...</p>
|
||||
</div>
|
||||
} @else if (filteredPaths.length === 0) {
|
||||
<div class="empty-state">
|
||||
|
||||
+10
@@ -187,6 +187,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
margin-top: 0.75rem;
|
||||
color: var(--text-secondary-color);
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -504,6 +509,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
.selection-note {
|
||||
margin-top: 0.75rem;
|
||||
color: var(--text-secondary-color);
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
@include panel.dialog-footer;
|
||||
border-top: 1px solid var(--border-color);
|
||||
|
||||
@@ -18,41 +18,41 @@
|
||||
</div>
|
||||
|
||||
<div class="dialog-content">
|
||||
<div class="px-4 mx-2 mb-4 py-3 rounded-lg border border-[var(--border-color)] transition-all">
|
||||
<p class="text-[var(--primary-color)] font-semibold mb-1">
|
||||
<div class="preview-info-box">
|
||||
<p class="preview-title">
|
||||
File Organization Preview
|
||||
</p>
|
||||
<div class="text-sm text-gray-300 space-y-3">
|
||||
<div class="preview-description">
|
||||
<p>
|
||||
Your files will be automatically renamed, organized, and can be moved between libraries based on your preferences.
|
||||
Check the preview below to see how your files will look, select target libraries if needed, then click <span class="font-semibold text-green-400">Move Files</span> to organize them.
|
||||
Check the preview below to see how your files will look, select target libraries if needed, then click <span class="highlight-green">Move Files</span> to organize them.
|
||||
</p>
|
||||
<p>
|
||||
<i class="pi pi-lightbulb text-blue-400 mr-1"></i>
|
||||
<span class="text-blue-300">Want to change how files are named? Go to <strong>Settings → File Naming Pattern</strong>. Each library can have its own naming pattern!</span>
|
||||
<i class="pi pi-lightbulb icon-blue"></i>
|
||||
<span class="text-blue">Want to change how files are named? Go to <strong>Settings → File Naming Pattern</strong>. Each library can have its own naming pattern!</span>
|
||||
</p>
|
||||
<p class="text-yellow-500 font-medium flex items-center gap-2">
|
||||
<i class="pi pi-exclamation-triangle text-yellow-400"></i>
|
||||
<p class="warning-text">
|
||||
<i class="pi pi-exclamation-triangle icon-yellow"></i>
|
||||
This will actually move and rename files on your computer across different library folders. Make sure you're happy with the preview first!
|
||||
</p>
|
||||
<div class="bg-red-900/30 border border-red-500/50 rounded-md p-3 text-red-200 text-xs">
|
||||
<p class="font-bold flex items-center gap-2 mb-1">
|
||||
<div class="metadata-warning-box">
|
||||
<p class="metadata-warning-title">
|
||||
<i class="pi pi-exclamation-circle"></i>
|
||||
Important: Metadata quality warning
|
||||
</p>
|
||||
<p>
|
||||
This feature relies entirely on your books' metadata. If your metadata is missing, inconsistent, or of poor quality, the resulting file names and folder structures will be incorrect or "buggy".
|
||||
</p>
|
||||
<p class="mt-1 font-semibold">
|
||||
<p class="metadata-warning-emphasis">
|
||||
ONLY recommended for high-quality, curated libraries.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-4 mb-4 px-2 items-center w-full">
|
||||
<div class="flex-1">
|
||||
<div class="flex items-center justify-between cursor-pointer" (click)="togglePatternsCollapsed()">
|
||||
<div class="patterns-section">
|
||||
<div class="patterns-content">
|
||||
<div class="patterns-toggle" (click)="togglePatternsCollapsed()">
|
||||
<p-button
|
||||
outlined
|
||||
[icon]="patternsCollapsed ? 'pi pi-chevron-right' : 'pi pi-chevron-down'"
|
||||
@@ -64,16 +64,16 @@
|
||||
</div>
|
||||
|
||||
@if (!patternsCollapsed) {
|
||||
<div class="space-y-2 mt-2">
|
||||
<div class="patterns-list">
|
||||
@for (pattern of libraryPatterns; track pattern.libraryId) {
|
||||
<div class="p-3 border border-zinc-700 rounded-lg bg-zinc-800">
|
||||
<div class="flex justify-between items-start">
|
||||
<div class="flex-1">
|
||||
<p class="text-xs text-gray-400 mb-1">Library: {{ pattern.libraryName }}</p>
|
||||
<code class="text-[var(--primary-color)] font-mono text-sm">{{ pattern.pattern || 'No pattern available' }}</code>
|
||||
<p class="text-xs text-gray-400 mt-1">Source: {{ pattern.source }}</p>
|
||||
<div class="pattern-card">
|
||||
<div class="pattern-card-content">
|
||||
<div class="pattern-info">
|
||||
<p class="pattern-label">Library: {{ pattern.libraryName }}</p>
|
||||
<code class="pattern-code">{{ pattern.pattern || 'No pattern available' }}</code>
|
||||
<p class="pattern-source">Source: {{ pattern.source }}</p>
|
||||
</div>
|
||||
<span class="text-xs bg-blue-600 text-white px-2 py-1 rounded ml-2">{{ pattern.bookCount }} book{{ pattern.bookCount > 1 ? 's' : '' }}</span>
|
||||
<span class="pattern-badge">{{ pattern.bookCount }} book{{ pattern.bookCount > 1 ? 's' : '' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -82,9 +82,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-4 mb-4 px-2 items-center">
|
||||
<div class="flex items-center gap-3">
|
||||
<label class="text-sm font-medium text-gray-300">Set all files to:</label>
|
||||
<div class="bulk-select-section">
|
||||
<div class="bulk-select-controls">
|
||||
<label class="bulk-select-label">Set all files to:</label>
|
||||
<p-select
|
||||
[options]="availableLibraries"
|
||||
[(ngModel)]="defaultTargetLibraryId"
|
||||
@@ -92,7 +92,7 @@
|
||||
optionValue="id"
|
||||
placeholder="Select default library"
|
||||
(onChange)="onDefaultLibraryChange()"
|
||||
class="min-w-[200px]"
|
||||
styleClass="select-library"
|
||||
size="small"
|
||||
appendTo="body"
|
||||
></p-select>
|
||||
@@ -104,7 +104,7 @@
|
||||
optionValue="id"
|
||||
placeholder="Select default path"
|
||||
(onChange)="onDefaultLibraryPathChange()"
|
||||
class="min-w-[250px]"
|
||||
styleClass="select-path"
|
||||
size="small"
|
||||
appendTo="body"
|
||||
></p-select>
|
||||
@@ -112,7 +112,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-4" style="height: 500px;">
|
||||
<div class="table-container">
|
||||
<p-table
|
||||
[value]="filePreviews"
|
||||
[scrollable]="true"
|
||||
@@ -135,8 +135,8 @@
|
||||
<tr>
|
||||
<td>{{ preview.bookId }}</td>
|
||||
<td>
|
||||
<div class="overflow-hidden text-ellipsis">
|
||||
<span class="text-gray-400">{{ preview.currentLibraryName }}/</span><span class="text-gray-200">{{ preview.relativeOriginalPath }}</span>
|
||||
<div class="path-cell">
|
||||
<span class="path-prefix">{{ preview.currentLibraryName }}/</span><span class="path-value">{{ preview.relativeOriginalPath }}</span>
|
||||
</div>
|
||||
</td>
|
||||
<td style="max-width:150px;">
|
||||
@@ -148,7 +148,7 @@
|
||||
placeholder="Select Library"
|
||||
(onChange)="onLibraryChange(preview)"
|
||||
[disabled]="preview.isMoved"
|
||||
class="w-full"
|
||||
styleClass="select-full-width"
|
||||
appendTo="body"
|
||||
size="small"
|
||||
></p-select>
|
||||
@@ -163,23 +163,23 @@
|
||||
placeholder="Select Path"
|
||||
(onChange)="onLibraryPathChange(preview)"
|
||||
[disabled]="preview.isMoved"
|
||||
class="w-full"
|
||||
styleClass="select-full-width"
|
||||
appendTo="body"
|
||||
size="small"
|
||||
></p-select>
|
||||
} @else {
|
||||
<div class="text-xs text-red-400">No paths configured</div>
|
||||
<div class="no-paths-error">No paths configured</div>
|
||||
}
|
||||
</td>
|
||||
<td class="text-[var(--primary-color)] text-center">→</td>
|
||||
<td class="arrow-cell">→</td>
|
||||
<td>
|
||||
<div class="overflow-hidden text-ellipsis">
|
||||
<span class="text-gray-400">{{ preview.targetLibraryName }}/</span><span class="text-gray-200">{{ preview.relativeNewPath }}</span>
|
||||
<div class="path-cell">
|
||||
<span class="path-prefix">{{ preview.targetLibraryName }}/</span><span class="path-value">{{ preview.relativeNewPath }}</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<td class="status-cell">
|
||||
@if (preview.isMoved) {
|
||||
<i class="pi pi-check-circle text-green-600"></i>
|
||||
<i class="pi pi-check-circle icon-success"></i>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -191,10 +191,10 @@
|
||||
|
||||
<div class="dialog-footer">
|
||||
@if (movedFileCount > 0) {
|
||||
<span class="text-green-500 flex items-center font-semibold drop-shadow-sm select-none">
|
||||
<span class="success-message">
|
||||
{{ movedFileCount }} file{{ movedFileCount > 1 ? 's' : '' }} successfully moved
|
||||
<i
|
||||
class="pi pi-check-circle ml-2 text-green-500 animate-bounce"
|
||||
class="pi pi-check-circle success-icon-bounce"
|
||||
style="animation-duration: 1.5s;"
|
||||
aria-label="Success"
|
||||
role="img"
|
||||
|
||||
@@ -40,3 +40,248 @@
|
||||
:host ::ng-deep .p-datatable-tbody > tr > td {
|
||||
padding: 0.5rem 1rem !important;
|
||||
}
|
||||
|
||||
// Preview info box
|
||||
.preview-info-box {
|
||||
padding: 0.75rem 1rem;
|
||||
margin: 0 0.5rem 1rem;
|
||||
border-radius: 0.5rem;
|
||||
border: 1px solid var(--border-color);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.preview-title {
|
||||
color: var(--primary-color);
|
||||
font-weight: 600;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.preview-description {
|
||||
font-size: 0.875rem;
|
||||
color: #d1d5db;
|
||||
|
||||
> * + * {
|
||||
margin-top: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
.highlight-green {
|
||||
font-weight: 600;
|
||||
color: #4ade80;
|
||||
}
|
||||
|
||||
.icon-blue {
|
||||
color: #60a5fa;
|
||||
margin-right: 0.25rem;
|
||||
}
|
||||
|
||||
.text-blue {
|
||||
color: #93c5fd;
|
||||
}
|
||||
|
||||
.warning-text {
|
||||
color: #eab308;
|
||||
font-weight: 500;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.icon-yellow {
|
||||
color: #facc15;
|
||||
}
|
||||
|
||||
.metadata-warning-box {
|
||||
background: rgba(127, 29, 29, 0.3);
|
||||
border: 1px solid rgba(239, 68, 68, 0.5);
|
||||
border-radius: 0.375rem;
|
||||
padding: 0.75rem;
|
||||
color: #fecaca;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
.metadata-warning-title {
|
||||
font-weight: 700;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.metadata-warning-emphasis {
|
||||
margin-top: 0.25rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
// Patterns section
|
||||
.patterns-section {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
padding: 0 0.5rem;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.patterns-content {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.patterns-toggle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.patterns-list {
|
||||
margin-top: 0.5rem;
|
||||
|
||||
> * + * {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.pattern-card {
|
||||
padding: 0.75rem;
|
||||
border: 1px solid #3f3f46;
|
||||
border-radius: 0.5rem;
|
||||
background: #27272a;
|
||||
}
|
||||
|
||||
.pattern-card-content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.pattern-info {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.pattern-label {
|
||||
font-size: 0.75rem;
|
||||
color: #9ca3af;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.pattern-code {
|
||||
color: var(--primary-color);
|
||||
font-family: monospace;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.pattern-source {
|
||||
font-size: 0.75rem;
|
||||
color: #9ca3af;
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
|
||||
.pattern-badge {
|
||||
font-size: 0.75rem;
|
||||
background: #2563eb;
|
||||
color: white;
|
||||
padding: 0.25rem 0.5rem;
|
||||
border-radius: 0.25rem;
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
|
||||
// Bulk select section
|
||||
.bulk-select-section {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
padding: 0 0.5rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.bulk-select-controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.bulk-select-label {
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: #d1d5db;
|
||||
}
|
||||
|
||||
// Table section
|
||||
.table-container {
|
||||
margin-bottom: 1rem;
|
||||
height: 500px;
|
||||
}
|
||||
|
||||
.path-cell {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.path-prefix {
|
||||
color: #9ca3af;
|
||||
}
|
||||
|
||||
.path-value {
|
||||
color: #e5e7eb;
|
||||
}
|
||||
|
||||
.no-paths-error {
|
||||
font-size: 0.75rem;
|
||||
color: #f87171;
|
||||
}
|
||||
|
||||
.arrow-cell {
|
||||
color: var(--primary-color);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.status-cell {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.icon-success {
|
||||
color: #16a34a;
|
||||
}
|
||||
|
||||
// Footer
|
||||
.success-message {
|
||||
color: #22c55e;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-weight: 600;
|
||||
filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.05));
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.success-icon-bounce {
|
||||
margin-left: 0.5rem;
|
||||
color: #22c55e;
|
||||
animation: bounce 1s infinite;
|
||||
}
|
||||
|
||||
@keyframes bounce {
|
||||
0%, 100% {
|
||||
transform: translateY(-25%);
|
||||
animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
|
||||
}
|
||||
50% {
|
||||
transform: translateY(0);
|
||||
animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Select widths
|
||||
:host ::ng-deep {
|
||||
.select-library {
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
.select-path {
|
||||
min-width: 250px;
|
||||
}
|
||||
|
||||
.select-full-width {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -1,11 +1,11 @@
|
||||
<div class="flex flex-col p-4 space-y-2 live-border">
|
||||
<div class="flex flex-row items-center gap-2">
|
||||
<div class="notification-container live-border">
|
||||
<div class="notification-header">
|
||||
@if (latestNotification.severity) {
|
||||
<app-tag [color]="getSeverityColor(latestNotification.severity)" size="3xs" class="self-center">
|
||||
<app-tag [color]="getSeverityColor(latestNotification.severity)" size="3xs" class="tag-centered">
|
||||
{{ latestNotification.severity }}
|
||||
</app-tag>
|
||||
}
|
||||
<span class="text-xs text-zinc-400 self-center">{{ latestNotification.timestamp }}</span>
|
||||
<span class="notification-timestamp">{{ latestNotification.timestamp }}</span>
|
||||
</div>
|
||||
<p class="font-normal text-zinc-200">{{ latestNotification.message }}</p>
|
||||
<p class="notification-message">{{ latestNotification.message }}</p>
|
||||
</div>
|
||||
|
||||
+30
@@ -3,3 +3,33 @@
|
||||
border: 1px solid var(--primary-color);
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.notification-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 1rem;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.notification-header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.tag-centered {
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.notification-timestamp {
|
||||
font-size: 0.75rem;
|
||||
color: #a1a1aa;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.notification-message {
|
||||
font-weight: 400;
|
||||
color: #e4e4e7;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
+13
-13
@@ -1,39 +1,39 @@
|
||||
<div class="task-border mt-4">
|
||||
<div class="task-border">
|
||||
@if (Object.keys(activeTasks).length > 0) {
|
||||
@for (task of activeTasks | keyvalue; track task; let idx = $index) {
|
||||
<div class="task-card p-4">
|
||||
<div class="task-card">
|
||||
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<p class="text-sm font-semibold text-[var(--primary-color)]">Metadata Fetch Task</p>
|
||||
<div class="task-header-row">
|
||||
<div class="task-title-group">
|
||||
<p class="task-title">Metadata Fetch Task</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-1">
|
||||
<div class="task-tags">
|
||||
@if (task.value.review) {
|
||||
<p-tag
|
||||
value="Review"
|
||||
severity="warn"
|
||||
class="text-xs">
|
||||
styleClass="task-tag">
|
||||
</p-tag>
|
||||
} @else {
|
||||
<p-tag
|
||||
value="Auto"
|
||||
severity="success"
|
||||
class="text-xs">
|
||||
styleClass="task-tag">
|
||||
</p-tag>
|
||||
}
|
||||
<p-tag
|
||||
[value]="getStatusLabel(task.value.status)"
|
||||
[severity]="getTagSeverity(task.value.status)"
|
||||
class="text-xs"
|
||||
styleClass="task-tag"
|
||||
></p-tag>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="task-message text-gray-200">
|
||||
<div class="task-message">
|
||||
{{ task.value.message }}
|
||||
</div>
|
||||
|
||||
<div class="task-progress-info text-sm text-gray-300">
|
||||
<div class="task-progress-info">
|
||||
Book <strong>{{ task.value.status === 'COMPLETED' || task.value.completed >= task.value.total ? task.value.total : task.value.completed + 1 }}</strong>
|
||||
of {{ task.value.total }}
|
||||
</div>
|
||||
@@ -45,7 +45,7 @@
|
||||
</p-progressBar>
|
||||
|
||||
@if (task.value.status === 'COMPLETED' || task.value.status === 'ERROR' || task.value.status === 'CANCELLED') {
|
||||
<div class="action-buttons mt-4 flex justify-end gap-2">
|
||||
<div class="action-buttons">
|
||||
@if (task.value.review) {
|
||||
<p-button
|
||||
label="Review"
|
||||
@@ -69,7 +69,7 @@
|
||||
</p-button>
|
||||
</div>
|
||||
} @else if (task.value.status === 'IN_PROGRESS') {
|
||||
<div class="action-buttons mt-4 flex justify-end gap-2">
|
||||
<div class="action-buttons">
|
||||
<p-button
|
||||
label="Cancel"
|
||||
icon="pi pi-stop"
|
||||
|
||||
+44
-2
@@ -1,9 +1,44 @@
|
||||
.task-border {
|
||||
margin-top: 1rem;
|
||||
background: var(--card-background);
|
||||
border: 1px solid var(--primary-color);
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.task-card {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.task-header-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.task-title-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.task-title {
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
color: var(--primary-color);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.task-tags {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
:host ::ng-deep .task-tag {
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
.task-header {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
@@ -12,16 +47,23 @@
|
||||
|
||||
.task-message {
|
||||
font-size: 1rem;
|
||||
color: var(--text-color);
|
||||
color: #e5e7eb;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.task-progress-info {
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-secondary-color);
|
||||
color: #d1d5db;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.action-buttons {
|
||||
margin-top: 1rem;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.review-button {
|
||||
text-align: right;
|
||||
margin-top: 0.75rem;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<div class="metadata-progress-box flex gap-4 flex-col w-[25rem] max-h-[60vh] overflow-y-auto">
|
||||
<div class="metadata-progress-box">
|
||||
<app-live-notification-box/>
|
||||
@if (hasMetadataTasks$ | async) {
|
||||
<app-metadata-progress-widget/>
|
||||
|
||||
+5
@@ -1,4 +1,9 @@
|
||||
.metadata-progress-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
width: 25rem;
|
||||
max-height: 60vh;
|
||||
overflow-y: auto;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="flex flex-col h-full">
|
||||
<div class="menu-container">
|
||||
<div>
|
||||
<ul class="layout-menu">
|
||||
@if (homeMenu$ | async; as homeMenu) {
|
||||
@@ -42,26 +42,26 @@
|
||||
</div>
|
||||
|
||||
@if (versionInfo) {
|
||||
<div style="margin-top: auto;" class="p-4 text-center w-full text-sm">
|
||||
<div class="text-gray-200">
|
||||
<div class="version-info" style="margin-top: auto;">
|
||||
<div class="version-text">
|
||||
@if (isSemanticVersion(versionInfo.current)) {
|
||||
<a
|
||||
[href]="getVersionUrl(versionInfo.current)"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="hover:underline hover:text-gray-100 text-sm"
|
||||
class="version-link"
|
||||
>
|
||||
{{ versionInfo.current }}
|
||||
</a>
|
||||
} @else {
|
||||
<span class="text-sm">{{ versionInfo.current }}</span>
|
||||
<span class="version-label">{{ versionInfo.current }}</span>
|
||||
}
|
||||
</div>
|
||||
@if (isSemanticVersion(versionInfo.current) && versionInfo.latest && versionInfo.latest !== versionInfo.current) {
|
||||
<div>
|
||||
<a
|
||||
(click)="openChangelogDialog()"
|
||||
class="cursor-pointer text-orange-400 hover:underline hover:text-orange-300 text-xs"
|
||||
class="update-link"
|
||||
>
|
||||
(Update)
|
||||
</a>
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
.menu-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.version-info {
|
||||
padding: 1rem;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.version-text {
|
||||
color: #e5e7eb;
|
||||
}
|
||||
|
||||
.version-link {
|
||||
font-size: 0.875rem;
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
color: #f3f4f6;
|
||||
}
|
||||
}
|
||||
|
||||
.version-label {
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.update-link {
|
||||
cursor: pointer;
|
||||
color: #fb923c;
|
||||
font-size: 0.75rem;
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
color: #fdba74;
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@ import {DialogLauncherService} from '../../../services/dialog-launcher.service';
|
||||
standalone: true,
|
||||
imports: [AppMenuitemComponent, MenuModule, AsyncPipe],
|
||||
templateUrl: './app.menu.component.html',
|
||||
styleUrl: './app.menu.component.scss',
|
||||
})
|
||||
export class AppMenuComponent implements OnInit {
|
||||
libraryMenu$: Observable<MenuItem[]> | undefined;
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@
|
||||
{{ release.name }} ({{ release.publishedAt | date: 'mediumDate' }})
|
||||
</a>
|
||||
</p>
|
||||
<div [innerHTML]="markdownToHtml(release.changelog)" class="prose prose-invert w-full max-w-full"></div>
|
||||
<div [innerHTML]="markdownToHtml(release.changelog)" class="release-content"></div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
+77
-2
@@ -59,6 +59,81 @@
|
||||
}
|
||||
}
|
||||
|
||||
:host ::ng-deep .prose h3 {
|
||||
margin-top: 0;
|
||||
.release-content {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
line-height: 1.75;
|
||||
color: var(--text-color);
|
||||
|
||||
:host ::ng-deep & {
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
margin-top: 1.5rem;
|
||||
margin-bottom: 0.75rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.25;
|
||||
color: var(--text-color);
|
||||
|
||||
&:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin-top: 0;
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-top: 0.75rem;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
ul, ol {
|
||||
margin-top: 0.75rem;
|
||||
margin-bottom: 0.75rem;
|
||||
padding-left: 1.5rem;
|
||||
}
|
||||
|
||||
li {
|
||||
margin-top: 0.25rem;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
code {
|
||||
font-size: 0.875em;
|
||||
background: var(--surface-ground);
|
||||
padding: 0.125rem 0.375rem;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
pre {
|
||||
margin-top: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
padding: 1rem;
|
||||
background: var(--surface-ground);
|
||||
border-radius: 0.5rem;
|
||||
overflow-x: auto;
|
||||
|
||||
code {
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--primary-color);
|
||||
text-decoration: underline;
|
||||
|
||||
&:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin: 1rem 0;
|
||||
padding-left: 1rem;
|
||||
border-left: 3px solid var(--border-color);
|
||||
color: var(--text-secondary-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+51
-51
@@ -1,16 +1,16 @@
|
||||
<div class="layout-topbar">
|
||||
|
||||
<a class="layout-topbar-logo pl-5 pr-24 flex gap-2" routerLink="">
|
||||
<svg class="w-[1.875rem] h-[1.875rem] half-title" viewBox="0 0 126 126" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||
<a class="layout-topbar-logo topbar-logo" routerLink="">
|
||||
<svg class="logo-icon half-title" viewBox="0 0 126 126" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M59 4.79297C71.5051 11.5557 80 24.7854 80 40C80 40.5959 79.987 41.1888 79.9609 41.7783C79.8609 44.0406 81.7355 46 84 46C106.091 46 124 63.9086 124 86C124 108.091 106.091 126 84 126H10C4.47715 126 0 121.523 0 116V39.0068L0.0126953 38.9941C0.357624 25.0252 7.86506 12.8347 19 5.95215V63.832C19 64.8345 20.0676 65.4391 20.9121 64.9902L21.0771 64.8867L38.2227 52.3428C38.6819 52.0068 39.3064 52.0068 39.7656 52.3428L56.9229 64.8945L57.0879 64.998C57.9324 65.447 59 64.8423 59 63.8398V4.79297Z"/>
|
||||
<path
|
||||
d="M40 0C43.8745 0 47.6199 0.552381 51.1631 1.58008V50.9697L44.3926 46.0176L44.0879 45.8037C40.9061 43.6679 36.7098 43.7393 33.5957 46.0176L26.8369 50.9619V2.21875C30.9593 0.782634 35.3881 0 40 0Z"
|
||||
fill="white"/>
|
||||
</svg>
|
||||
<span class="flex items-center pt-2">
|
||||
<span class="logo-text-wrapper">
|
||||
<p>Book</p>
|
||||
<p class="half-title text-3xl">lore</p>
|
||||
<p class="half-title logo-text-lore">lore</p>
|
||||
</span>
|
||||
</a>
|
||||
|
||||
@@ -25,29 +25,29 @@
|
||||
>
|
||||
</p-button>
|
||||
|
||||
<div class="flex items-center w-full gap-4">
|
||||
<app-book-searcher class="md:block flex-grow"></app-book-searcher>
|
||||
<ul class="topbar-items hidden md:flex items-center gap-3 ml-auto pl-4">
|
||||
<div class="flex gap-4">
|
||||
<div class="topbar-content">
|
||||
<app-book-searcher class="topbar-search"></app-book-searcher>
|
||||
<ul class="topbar-items topbar-desktop-items">
|
||||
<div class="topbar-action-group">
|
||||
@if (userService.userState$ | async; as userState) {
|
||||
@if (userState.user?.permissions?.canAccessBookdrop || userState.user?.permissions?.admin) {
|
||||
<li>
|
||||
<a class="topbar-item" (click)="navigateToBookdrop()" pTooltip="Bookdrop" tooltipPosition="bottom">
|
||||
<i class="pi pi-inbox text-surface-100"></i>
|
||||
<i class="pi pi-inbox topbar-icon"></i>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
@if (userState.user?.permissions?.canManageLibrary || userState.user?.permissions?.admin) {
|
||||
<li>
|
||||
<a class="topbar-item" (click)="openLibraryCreatorDialog()" pTooltip="Create New Library" tooltipPosition="bottom">
|
||||
<i class="pi pi-plus-circle text-surface-100"></i>
|
||||
<i class="pi pi-plus-circle topbar-icon"></i>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
@if (userState.user?.permissions?.canUpload || userState.user?.permissions?.admin) {
|
||||
<li>
|
||||
<a class="topbar-item" (click)="openFileUploadDialog()" pTooltip="Upload Book" tooltipPosition="bottom">
|
||||
<i class="pi pi-upload text-surface-100"></i>
|
||||
<i class="pi pi-upload topbar-icon"></i>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
@@ -60,14 +60,14 @@
|
||||
[pTooltip]="statsTooltip"
|
||||
tooltipPosition="bottom">
|
||||
<svg class="multi-color-chart-icon" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="1.25" y="10" width="2.5" height="9" rx="0.5" fill="#ef4444"/>
|
||||
<rect x="6.25" y="7" width="2.5" height="12" rx="0.5" fill="#f59e0b"/>
|
||||
<rect x="11.25" y="3" width="2.5" height="16" rx="0.5" fill="#10b981"/>
|
||||
<rect x="16.25" y="5" width="2.5" height="14" rx="0.5" fill="#3b82f6"/>
|
||||
<rect x="1.25" y="10" width="2.5" height="9" rx="0.5" fill="#ef4444"/>
|
||||
<rect x="6.25" y="7" width="2.5" height="12" rx="0.5" fill="#f59e0b"/>
|
||||
<rect x="11.25" y="3" width="2.5" height="16" rx="0.5" fill="#10b981"/>
|
||||
<rect x="16.25" y="5" width="2.5" height="14" rx="0.5" fill="#3b82f6"/>
|
||||
</svg>
|
||||
</button>
|
||||
@if (shouldShowStatsMenu) {
|
||||
<p-menu #statsMenu [model]="statsMenuItems" [popup]="true" appendTo="body" />
|
||||
<p-menu #statsMenu [model]="statsMenuItems" [popup]="true" appendTo="body"/>
|
||||
}
|
||||
</li>
|
||||
}
|
||||
@@ -75,14 +75,14 @@
|
||||
@if (userState.user?.permissions?.canManageLibrary || userState.user?.permissions?.admin) {
|
||||
<li>
|
||||
<a class="topbar-item" (click)="navigateToMetadataManager()" pTooltip="Metadata Manager" tooltipPosition="bottom">
|
||||
<i class="pi pi-sparkles text-surface-100"></i>
|
||||
<i class="pi pi-sparkles topbar-icon"></i>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
<li>
|
||||
<a class="topbar-item" (click)="navigateToSettings()" pTooltip="Settings" tooltipPosition="bottom">
|
||||
<i class="pi pi-cog text-surface-100"></i>
|
||||
<i class="pi pi-cog topbar-icon"></i>
|
||||
</a>
|
||||
</li>
|
||||
</div>
|
||||
@@ -90,8 +90,8 @@
|
||||
<p-divider layout="vertical"/>
|
||||
|
||||
|
||||
<div class="flex gap-4">
|
||||
<li class="relative">
|
||||
<div class="topbar-action-group">
|
||||
<li class="topbar-item-relative">
|
||||
<button
|
||||
type="button"
|
||||
class="topbar-item"
|
||||
@@ -116,15 +116,15 @@
|
||||
</p-popover>
|
||||
</li>
|
||||
|
||||
<li class="relative group overflow-hidden !border-transparent topbar-item" (click)="openGithubSupportDialog()">
|
||||
<li class="topbar-item-relative heart-button topbar-item" (click)="openGithubSupportDialog()">
|
||||
<span
|
||||
style="animation-duration: 2s; background: conic-gradient(from 90deg, #f97316, #f59e0b, #eab308, #84cc16, #22c55e, #10b981, #14a8a6, #06b6d4, #0ea5e9, #3b82f6, #6366f1, #8b5cf6, #a855f7, #d946ef, #ec4899, #f43f5e)"
|
||||
class="absolute -top-5 -left-5 w-20 h-20 animate-spin">
|
||||
class="heart-spinner">
|
||||
</span>
|
||||
<span style="inset: 1px; border-radius: 4px" class="absolute z-2 bg-surface-900 transition-all"></span>
|
||||
<i class="pi pi-heart z-10"></i>
|
||||
<span class="heart-background"></span>
|
||||
<i class="pi pi-heart heart-icon"></i>
|
||||
</li>
|
||||
<li class="relative">
|
||||
<li class="topbar-item-relative">
|
||||
<button type="button"
|
||||
class="topbar-item config-item"
|
||||
enterActiveClass="animate-scalein"
|
||||
@@ -138,7 +138,7 @@
|
||||
</li>
|
||||
</div>
|
||||
<p-divider layout="vertical"/>
|
||||
<div class="flex gap-4">
|
||||
<div class="topbar-action-group">
|
||||
<li>
|
||||
<a class="topbar-item"
|
||||
href="https://booklore.org/docs/getting-started"
|
||||
@@ -146,7 +146,7 @@
|
||||
rel="noopener noreferrer"
|
||||
pTooltip="Documentation"
|
||||
tooltipPosition="bottom">
|
||||
<i class="pi pi-info-circle text-surface-100"></i>
|
||||
<i class="pi pi-info-circle topbar-icon"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
@if (!userState.user?.permissions?.demoUser) {
|
||||
<li>
|
||||
<button class="topbar-item" (click)="openUserProfileDialog()" pTooltip="Profile" tooltipPosition="bottom">
|
||||
<i class="pi pi-user text-surface-100"></i>
|
||||
<i class="pi pi-user topbar-icon"></i>
|
||||
</button>
|
||||
</li>
|
||||
}
|
||||
@@ -163,28 +163,28 @@
|
||||
|
||||
<li>
|
||||
<button class="topbar-item" (click)="logout()" pTooltip="Logout" tooltipPosition="left">
|
||||
<i class="pi pi-sign-out text-surface-100"></i>
|
||||
<i class="pi pi-sign-out topbar-icon"></i>
|
||||
</button>
|
||||
</li>
|
||||
</div>
|
||||
</ul>
|
||||
<!-- Trigger Button -->
|
||||
<div class="md:hidden relative ml-auto">
|
||||
<div class="mobile-trigger">
|
||||
<p-button
|
||||
icon="pi pi-ellipsis-v"
|
||||
outlined
|
||||
(click)="mobileMenu.toggle($event)"
|
||||
/>
|
||||
<p-popover #mobileMenu>
|
||||
<ul class="flex flex-col gap-1 w-48">
|
||||
<ul class="mobile-menu-list">
|
||||
@if (userService.userState$ | async; as userState) {
|
||||
@if (userState.user?.permissions?.canAccessBookdrop || userState.user?.permissions?.admin) {
|
||||
<li>
|
||||
<button
|
||||
class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded"
|
||||
class="mobile-menu-item"
|
||||
(click)="navigateToBookdrop(); mobileMenu.hide()"
|
||||
>
|
||||
<i class="pi pi-inbox text-surface-100"></i>
|
||||
<i class="pi pi-inbox topbar-icon"></i>
|
||||
Bookdrop
|
||||
</button>
|
||||
</li>
|
||||
@@ -192,10 +192,10 @@
|
||||
@if (userState.user?.permissions?.canManageLibrary || userState.user?.permissions?.admin) {
|
||||
<li>
|
||||
<button
|
||||
class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded"
|
||||
class="mobile-menu-item"
|
||||
(click)="openLibraryCreatorDialog(); mobileMenu.hide()"
|
||||
>
|
||||
<i class="pi pi-plus-circle text-surface-100"></i>
|
||||
<i class="pi pi-plus-circle topbar-icon"></i>
|
||||
Create Library
|
||||
</button>
|
||||
</li>
|
||||
@@ -203,10 +203,10 @@
|
||||
@if (userState.user?.permissions?.canUpload || userState.user?.permissions?.admin) {
|
||||
<li>
|
||||
<button
|
||||
class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded"
|
||||
class="mobile-menu-item"
|
||||
(click)="openFileUploadDialog(); mobileMenu.hide()"
|
||||
>
|
||||
<i class="pi pi-upload text-surface-100"></i>
|
||||
<i class="pi pi-upload topbar-icon"></i>
|
||||
Upload Book
|
||||
</button>
|
||||
</li>
|
||||
@@ -215,7 +215,7 @@
|
||||
@if (hasStatsAccess) {
|
||||
<li>
|
||||
<button
|
||||
class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded"
|
||||
class="mobile-menu-item"
|
||||
(click)="shouldShowStatsMenu ? statsMenuMobile.toggle($event) : handleStatsButtonClick($event)"
|
||||
>
|
||||
<svg class="multi-color-chart-icon" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
@@ -227,7 +227,7 @@
|
||||
Charts
|
||||
</button>
|
||||
@if (shouldShowStatsMenu) {
|
||||
<p-menu #statsMenuMobile [model]="statsMenuItems" [popup]="true" />
|
||||
<p-menu #statsMenuMobile [model]="statsMenuItems" [popup]="true"/>
|
||||
}
|
||||
</li>
|
||||
}
|
||||
@@ -235,10 +235,10 @@
|
||||
@if (userState.user?.permissions?.canManageLibrary || userState.user?.permissions?.admin) {
|
||||
<li>
|
||||
<button
|
||||
class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded"
|
||||
class="mobile-menu-item"
|
||||
(click)="navigateToMetadataManager(); mobileMenu.hide()"
|
||||
>
|
||||
<i class="pi pi-sparkles text-surface-100"></i>
|
||||
<i class="pi pi-sparkles topbar-icon"></i>
|
||||
Metadata Manager
|
||||
</button>
|
||||
</li>
|
||||
@@ -246,29 +246,29 @@
|
||||
}
|
||||
<li>
|
||||
<button
|
||||
class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded"
|
||||
class="mobile-menu-item"
|
||||
(click)="navigateToSettings(); mobileMenu.hide()"
|
||||
>
|
||||
<i class="pi pi-cog text-surface-100"></i>
|
||||
<i class="pi pi-cog topbar-icon"></i>
|
||||
Settings
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded"
|
||||
class="mobile-menu-item"
|
||||
href="https://booklore.org/docs/getting-started"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer">
|
||||
<i class="pi pi-info-circle text-surface-100"></i>
|
||||
<i class="pi pi-info-circle topbar-icon"></i>
|
||||
Documentation
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<button
|
||||
class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded"
|
||||
class="mobile-menu-item"
|
||||
(click)="openGithubSupportDialog(); mobileMenu.hide()"
|
||||
>
|
||||
<i class="pi pi-thumbs-up text-surface-100"></i>
|
||||
<i class="pi pi-thumbs-up topbar-icon"></i>
|
||||
Support BookLore
|
||||
</button>
|
||||
</li>
|
||||
@@ -277,10 +277,10 @@
|
||||
@if (!userState.user?.permissions?.demoUser) {
|
||||
<li>
|
||||
<button
|
||||
class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded"
|
||||
class="mobile-menu-item"
|
||||
(click)="openUserProfileDialog(); mobileMenu.hide()"
|
||||
>
|
||||
<i class="pi pi-user text-surface-100"></i>
|
||||
<i class="pi pi-user topbar-icon"></i>
|
||||
Profile
|
||||
</button>
|
||||
</li>
|
||||
@@ -289,10 +289,10 @@
|
||||
|
||||
<li>
|
||||
<button
|
||||
class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded"
|
||||
class="mobile-menu-item"
|
||||
(click)="logout(); mobileMenu.hide()"
|
||||
>
|
||||
<i class="pi pi-sign-out text-surface-100"></i>
|
||||
<i class="pi pi-sign-out topbar-icon"></i>
|
||||
Logout
|
||||
</button>
|
||||
</li>
|
||||
|
||||
@@ -1,3 +1,138 @@
|
||||
.topbar-logo {
|
||||
padding-left: 1.25rem;
|
||||
padding-right: 6rem;
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.logo-icon {
|
||||
width: 1.875rem;
|
||||
height: 1.875rem;
|
||||
}
|
||||
|
||||
.logo-text-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-top: 0.5rem;
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.logo-text-lore {
|
||||
font-size: 1.875rem;
|
||||
line-height: 2.25rem;
|
||||
}
|
||||
|
||||
.topbar-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.topbar-search {
|
||||
flex-grow: 1;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.topbar-desktop-items {
|
||||
display: none;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
margin-left: auto;
|
||||
padding-left: 1rem;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.topbar-action-group {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.topbar-icon {
|
||||
color: var(--p-surface-100);
|
||||
}
|
||||
|
||||
.topbar-item-relative {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.heart-button {
|
||||
overflow: hidden;
|
||||
border-color: transparent !important;
|
||||
}
|
||||
|
||||
.heart-spinner {
|
||||
position: absolute;
|
||||
top: -1.25rem;
|
||||
left: -1.25rem;
|
||||
width: 5rem;
|
||||
height: 5rem;
|
||||
animation: spin 2s linear infinite;
|
||||
}
|
||||
|
||||
.heart-background {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
inset: 1px;
|
||||
border-radius: 4px;
|
||||
background: var(--p-surface-900);
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.heart-icon {
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.mobile-trigger {
|
||||
display: none;
|
||||
position: relative;
|
||||
margin-left: auto;
|
||||
|
||||
@media (max-width: 767px) {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.mobile-menu-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.25rem;
|
||||
width: 12rem;
|
||||
}
|
||||
|
||||
.mobile-menu-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
padding: 0.5rem;
|
||||
border-radius: 0.25rem;
|
||||
background: none;
|
||||
border: none;
|
||||
color: inherit;
|
||||
font: inherit;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
|
||||
&:hover {
|
||||
background: var(--p-surface-700);
|
||||
}
|
||||
}
|
||||
|
||||
.highlight {
|
||||
color: red !important;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {beforeEach, describe, expect, it, vi} from 'vitest';
|
||||
import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest';
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
import {EnvironmentInjector, runInInjectionContext} from '@angular/core';
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {beforeEach, describe, expect, it, vi} from 'vitest';
|
||||
import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest';
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
import {of} from 'rxjs';
|
||||
@@ -139,16 +139,17 @@ describe('AuthService', () => {
|
||||
|
||||
it('should logout and clear all tokens', () => {
|
||||
service.getRxStompService = vi.fn().mockReturnValue(rxStompServiceMock);
|
||||
const loc = {href: ''};
|
||||
vi.stubGlobal('window', {location: loc});
|
||||
routerMock.navigate.mockReturnValue(Promise.resolve(true));
|
||||
|
||||
service.logout();
|
||||
|
||||
expect(localStorage.removeItem).toHaveBeenCalledWith('accessToken_Internal');
|
||||
expect(localStorage.removeItem).toHaveBeenCalledWith('refreshToken_Internal');
|
||||
expect(oAuthStorageMock.removeItem).toHaveBeenCalledWith('access_token');
|
||||
expect(oAuthStorageMock.removeItem).toHaveBeenCalledWith('refresh_token');
|
||||
expect(oAuthStorageMock.removeItem).toHaveBeenCalledWith('id_token');
|
||||
expect(rxStompServiceMock.deactivate).toHaveBeenCalled();
|
||||
expect(loc.href).toBe('/login');
|
||||
expect(routerMock.navigate).toHaveBeenCalledWith(['/login']);
|
||||
});
|
||||
|
||||
it('should initialize websocket connection if token exists', () => {
|
||||
|
||||
@@ -99,7 +99,9 @@ export class AuthService {
|
||||
this.tokenSubject.next(null);
|
||||
this.postLoginInitialized = false;
|
||||
this.getRxStompService().deactivate();
|
||||
window.location.href = '/login';
|
||||
this.router.navigate(['/login']).then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
getRxStompService(): RxStompService {
|
||||
|
||||
@@ -11,6 +11,8 @@ describe('CustomFontService', () => {
|
||||
let service: CustomFontService;
|
||||
let httpClientMock: any;
|
||||
let authServiceMock: any;
|
||||
let fontsSet: any[];
|
||||
let originalDocumentFonts: any;
|
||||
|
||||
const mockFont: CustomFont = {
|
||||
id: 1,
|
||||
@@ -41,19 +43,25 @@ describe('CustomFontService', () => {
|
||||
this.load = vi.fn().mockResolvedValue(this);
|
||||
};
|
||||
|
||||
const fontsSet: any[] = [];
|
||||
(globalThis as any).document = {
|
||||
fonts: {
|
||||
add: vi.fn(font => fontsSet.push(font)),
|
||||
delete: vi.fn(font => {
|
||||
// Store original and create mock fonts set
|
||||
originalDocumentFonts = document.fonts;
|
||||
fontsSet = [];
|
||||
|
||||
// Mock document.fonts
|
||||
Object.defineProperty(document, 'fonts', {
|
||||
value: {
|
||||
add: vi.fn((font: any) => fontsSet.push(font)),
|
||||
delete: vi.fn((font: any) => {
|
||||
const idx = fontsSet.indexOf(font);
|
||||
if (idx !== -1) fontsSet.splice(idx, 1);
|
||||
}),
|
||||
[Symbol.iterator]: function* () {
|
||||
yield* fontsSet;
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
providers: [
|
||||
@@ -109,17 +117,17 @@ describe('CustomFontService', () => {
|
||||
it('should mark font as loaded after loadFontFace', async () => {
|
||||
await service.loadFontFace(mockFont);
|
||||
expect(service.isFontLoaded(mockFont.fontName)).toBe(true);
|
||||
const fontsArr = Array.from((globalThis as any).document.fonts);
|
||||
const fontsArr = Array.from(document.fonts);
|
||||
expect(fontsArr.some((f: any) => f.family === mockFont.fontName)).toBe(true);
|
||||
});
|
||||
|
||||
it('should call removeFontFace on delete', () => {
|
||||
const fontObj = {family: mockFont.fontName};
|
||||
(globalThis as any).document.fonts.add(fontObj);
|
||||
const fontObj = new (globalThis as any).FontFace(mockFont.fontName, 'url(test.ttf)');
|
||||
document.fonts.add(fontObj);
|
||||
service['fontsSubject'].next([mockFont]);
|
||||
httpClientMock.delete.mockReturnValue(of(void 0));
|
||||
service.deleteFont(mockFont.id).subscribe(() => {
|
||||
const fontsArr = Array.from((globalThis as any).document.fonts);
|
||||
const fontsArr = Array.from(document.fonts);
|
||||
expect(fontsArr.some((f: any) => f.family === mockFont.fontName)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -62,32 +62,14 @@ describe('FileDownloadService', () => {
|
||||
];
|
||||
httpClientMock.get.mockReturnValue(of(...events));
|
||||
// Mock DOM for download
|
||||
const appendChild = vi.fn();
|
||||
const removeChild = vi.fn();
|
||||
const link = {
|
||||
setAttribute: vi.fn(),
|
||||
click: vi.fn(),
|
||||
style: {},
|
||||
href: '',
|
||||
download: '',
|
||||
parentNode: {
|
||||
removeChild: removeChild
|
||||
}
|
||||
};
|
||||
(globalThis as any).document = {
|
||||
createElement: vi.fn().mockReturnValue(link),
|
||||
body: {
|
||||
appendChild: appendChild,
|
||||
removeChild: removeChild,
|
||||
contains: vi.fn().mockReturnValue(true)
|
||||
}
|
||||
};
|
||||
(globalThis as any).window = {
|
||||
URL: {
|
||||
createObjectURL: vi.fn().mockReturnValue('blob:url'),
|
||||
revokeObjectURL: vi.fn()
|
||||
}
|
||||
};
|
||||
const link = document.createElement('a');
|
||||
vi.spyOn(link, 'click').mockImplementation(() => {});
|
||||
vi.spyOn(document, 'createElement').mockReturnValue(link);
|
||||
vi.spyOn(document.body, 'appendChild').mockImplementation(() => link);
|
||||
vi.spyOn(document.body, 'removeChild').mockImplementation(() => link);
|
||||
vi.spyOn(document.body, 'contains').mockReturnValue(true);
|
||||
vi.spyOn(URL, 'createObjectURL').mockReturnValue('blob:url');
|
||||
vi.spyOn(URL, 'revokeObjectURL').mockImplementation(() => {});
|
||||
|
||||
service.downloadFile('/api/file', 'file.txt');
|
||||
expect(httpClientMock.get).toHaveBeenCalledWith('/api/file', expect.objectContaining({observe: 'events'}));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {beforeEach, describe, expect, it, vi} from 'vitest';
|
||||
import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest';
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
import {Title} from '@angular/platform-browser';
|
||||
import {PageTitleService} from './page-title.service';
|
||||
|
||||
@@ -135,7 +135,7 @@ describe('ReadingSessionApiService', () => {
|
||||
|
||||
it('should send beacon successfully', () => {
|
||||
const sendBeaconMock = vi.fn().mockReturnValue(true);
|
||||
(globalThis.navigator as any) = {sendBeacon: sendBeaconMock};
|
||||
vi.stubGlobal('navigator', {sendBeacon: sendBeaconMock});
|
||||
const result = service.sendSessionBeacon(mockSessionDto);
|
||||
expect(sendBeaconMock).toHaveBeenCalledWith(
|
||||
expect.stringContaining(BASE_URL),
|
||||
@@ -145,11 +145,11 @@ describe('ReadingSessionApiService', () => {
|
||||
});
|
||||
|
||||
it('should return false if sendBeacon throws', () => {
|
||||
(globalThis.navigator as any) = {
|
||||
vi.stubGlobal('navigator', {
|
||||
sendBeacon: vi.fn().mockImplementation(() => {
|
||||
throw new Error('fail');
|
||||
})
|
||||
};
|
||||
});
|
||||
const result = service.sendSessionBeacon(mockSessionDto);
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
@@ -204,7 +204,7 @@ describe('ReadingSessionApiService - API Contract Tests', () => {
|
||||
|
||||
it('should send beacon to correct endpoint', () => {
|
||||
const sendBeaconMock = vi.fn().mockReturnValue(true);
|
||||
(globalThis.navigator as any) = {sendBeacon: sendBeaconMock};
|
||||
vi.stubGlobal('navigator', {sendBeacon: sendBeaconMock});
|
||||
const dto: CreateReadingSessionDto = {
|
||||
bookId: 1,
|
||||
bookType: 'PDF',
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {beforeEach, describe, expect, it, vi} from 'vitest';
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
import {EnvironmentInjector, runInInjectionContext} from '@angular/core';
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
import {of, throwError} from 'rxjs';
|
||||
import {AppVersion, ReleaseNote, VersionService} from './version.service';
|
||||
@@ -31,13 +30,11 @@ describe('VersionService', () => {
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
providers: [
|
||||
VersionService,
|
||||
{provide: HttpClient, useValue: httpClientMock}
|
||||
]
|
||||
});
|
||||
|
||||
const injector = TestBed.inject(EnvironmentInjector);
|
||||
service = runInInjectionContext(injector, () => TestBed.inject(VersionService));
|
||||
service = TestBed.inject(VersionService);
|
||||
});
|
||||
|
||||
it('should get version', () => {
|
||||
@@ -88,13 +85,11 @@ describe('VersionService - API Contract Tests', () => {
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
providers: [
|
||||
VersionService,
|
||||
{provide: HttpClient, useValue: httpClientMock}
|
||||
]
|
||||
});
|
||||
|
||||
const injector = TestBed.inject(EnvironmentInjector);
|
||||
service = runInInjectionContext(injector, () => TestBed.inject(VersionService));
|
||||
service = TestBed.inject(VersionService);
|
||||
});
|
||||
|
||||
it('should expect AppVersion from getVersion', () => {
|
||||
|
||||
Reference in New Issue
Block a user