Handle until in the dialog

This commit is contained in:
shamoon committed 2026-11-19 21:43:31 -08:00
1 parent ef039e092a
commit a547636e5e
2 files changed
+17 -9

No files matched your search

@@ -1,8 +1,13 @@
<div class="modal-header">
<div>
<h4 class="modal-title" i18n>What's new in Paperless-ngx</h4>
@if (since()) {
<p class="text-muted small mb-0" i18n>Updated from {{ since() }} to {{ version }}</p>
@if (until()) {
<h4 class="modal-title" i18n>Paperless-ngx {{ until() }} is available</h4>
<p class="text-muted small mb-0" i18n>You are running {{ version }}</p>
} @else {
<h4 class="modal-title" i18n>What's new in Paperless-ngx</h4>
@if (since()) {
<p class="text-muted small mb-0" i18n>Updated from {{ since() }} to {{ version }}</p>
}
}
</div>
<div class="d-flex align-items-center gap-3 ms-auto">
@@ -57,6 +57,7 @@ export class ReleaseNotesDialogComponent {
private readonly permissionsService = inject(PermissionsService)
readonly since = signal<string | null>(null)
readonly until = signal<string | null>(null)
readonly releases = signal<AppRelease[] | null>(null)
readonly stars = signal<number | null>(null)
readonly loading = signal(false)
@@ -80,19 +81,21 @@ export class ReleaseNotesDialogComponent {
readonly discussionsUrl = DISCUSSIONS_URL
get releaseUrl(): string {
return this.version ? `${RELEASES_URL}/tag/v${this.version}` : RELEASES_URL
const version = this.until() ?? this.version
return version ? `${RELEASES_URL}/tag/v${version}` : RELEASES_URL
}
/**
* Load notes for releases after `since`, or the running version's
* notes if `since` is null.
* Load notes for releases after `since` up to `until` (default: the
* running version), or just the `until` version's notes if `since` is null.
*/
load(since: string | null): void {
load(since: string | null, until: string | null = null): void {
this.since.set(since)
this.until.set(until)
if (!this.updateCheckingEnabled()) return
this.loading.set(true)
this.remoteVersionService
.getReleaseNotes(since ?? undefined)
.getReleaseNotes(since ?? undefined, until ?? undefined)
.pipe(first())
.subscribe({
next: (notes) => {
@@ -116,7 +119,7 @@ export class ReleaseNotesDialogComponent {
this.updateCheckingIsSet.set(true)
this.updateCheckingEnabled.set(enable)
this.updateCheckingChosen.emit(enable)
if (enable) this.load(this.since())
if (enable) this.load(this.since(), this.until())
}
close(): void {