Dialog refactor 2 (#2321)
Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
+42
-20
@@ -1,26 +1,48 @@
|
||||
@if (loading) {
|
||||
<div class="p-4 text-center text-gray-400">
|
||||
Loading changelog...
|
||||
<div class="changelog-container">
|
||||
<div class="panel-header">
|
||||
<div class="header-icon-wrapper">
|
||||
<i class="pi pi-sparkles header-icon"></i>
|
||||
</div>
|
||||
<div class="header-text">
|
||||
<h2 class="panel-title">What's New</h2>
|
||||
<p class="panel-description">Latest updates and improvements</p>
|
||||
</div>
|
||||
<p-button
|
||||
icon="pi pi-times"
|
||||
[rounded]="true"
|
||||
[text]="true"
|
||||
severity="secondary"
|
||||
(click)="dialogRef.close()"
|
||||
styleClass="close-button">
|
||||
</p-button>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!loading && changelog.length === 0) {
|
||||
<div class="p-4 text-center text-gray-400">
|
||||
No updates available.
|
||||
</div>
|
||||
}
|
||||
<div class="dialog-content">
|
||||
@if (loading) {
|
||||
<div class="loading-state">
|
||||
Loading changelog...
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!loading && changelog.length > 0) {
|
||||
<div class="space-y-6 p-4 overflow-auto">
|
||||
@for (release of changelog; track release) {
|
||||
<div class="border-b pb-4">
|
||||
<p class="font-bold text-2xl pb-2">
|
||||
<a [href]="release.url" target="_blank" rel="noopener noreferrer" class="text-blue-400 hover:underline">
|
||||
{{ release.name }} ({{ release.publishedAt | date: 'mediumDate' }})
|
||||
</a>
|
||||
</p>
|
||||
<div [innerHTML]="markdownToHtml(release.changelog)" class="prose prose-invert w-full max-w-full"></div>
|
||||
@if (!loading && changelog.length === 0) {
|
||||
<div class="empty-state">
|
||||
No updates available.
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!loading && changelog.length > 0) {
|
||||
<div class="changelog-list">
|
||||
@for (release of changelog; track release) {
|
||||
<div class="release-item">
|
||||
<p class="release-title">
|
||||
<a [href]="release.url" target="_blank" rel="noopener noreferrer" class="release-link">
|
||||
{{ release.name }} ({{ release.publishedAt | date: 'mediumDate' }})
|
||||
</a>
|
||||
</p>
|
||||
<div [innerHTML]="markdownToHtml(release.changelog)" class="prose prose-invert w-full max-w-full"></div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
+62
-1
@@ -1,3 +1,64 @@
|
||||
@use '../../../../../shared/styles/panel-shared' as panel;
|
||||
|
||||
.changelog-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-height: 90dvh;
|
||||
}
|
||||
|
||||
.panel-header {
|
||||
@include panel.panel-header;
|
||||
}
|
||||
|
||||
.dialog-content {
|
||||
padding: 1.5rem;
|
||||
background: var(--card-background);
|
||||
border: 1px solid var(--border-color);
|
||||
border-top: none;
|
||||
border-radius: 0 0 10px 10px;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
|
||||
overflow-y: auto;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.loading-state,
|
||||
.empty-state {
|
||||
padding: 1rem;
|
||||
text-align: center;
|
||||
color: var(--text-secondary-color);
|
||||
}
|
||||
|
||||
.changelog-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
.release-item {
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
.release-title {
|
||||
font-weight: 700;
|
||||
font-size: 1.25rem;
|
||||
padding-bottom: 0.5rem;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.release-link {
|
||||
color: var(--primary-color);
|
||||
text-decoration: none;
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
:host ::ng-deep .prose h3 {
|
||||
margin-top: 0px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
+5
-1
@@ -4,12 +4,15 @@ import { ReleaseNote, VersionService } from '../../../../service/version.service
|
||||
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
||||
import showdown from 'showdown';
|
||||
import {DatePipe} from '@angular/common';
|
||||
import {DynamicDialogRef} from 'primeng/dynamicdialog';
|
||||
import {Button} from 'primeng/button';
|
||||
|
||||
@Component({
|
||||
selector: 'app-version-changelog-dialog',
|
||||
standalone: true,
|
||||
imports: [
|
||||
DatePipe
|
||||
DatePipe,
|
||||
Button
|
||||
],
|
||||
templateUrl: './version-changelog-dialog.component.html',
|
||||
styleUrl: './version-changelog-dialog.component.scss'
|
||||
@@ -18,6 +21,7 @@ export class VersionChangelogDialogComponent implements OnInit {
|
||||
|
||||
private versionService = inject(VersionService);
|
||||
private sanitizer = inject(DomSanitizer);
|
||||
dialogRef = inject(DynamicDialogRef);
|
||||
|
||||
changelog: ReleaseNote[] = [];
|
||||
loading = true;
|
||||
|
||||
Reference in New Issue
Block a user