From c091766a865d9f6996fe681020f4a15c7201368d Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue, 17 Nov 2026 23:03:13 -0800 Subject: [PATCH] Frontend getReleaseNotes --- .../rest/remote-version.service.spec.ts | 17 ++++++++++++ .../services/rest/remote-version.service.ts | 26 ++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src-ui/src/app/services/rest/remote-version.service.spec.ts b/src-ui/src/app/services/rest/remote-version.service.spec.ts index a9734ca42e..848fb40297 100644 --- a/src-ui/src/app/services/rest/remote-version.service.spec.ts +++ b/src-ui/src/app/services/rest/remote-version.service.spec.ts @@ -40,4 +40,21 @@ describe('RemoteVersionService', () => { ) expect(req.request.method).toEqual('GET') }) + + it('should call release notes endpoint without since', () => { + subscription = service.getReleaseNotes().subscribe() + const req = httpTestingController.expectOne( + `${environment.apiBaseUrl}release_notes/` + ) + expect(req.request.method).toEqual('GET') + expect(req.request.params.has('since')).toBe(false) + }) + + it('should pass since to release notes endpoint', () => { + subscription = service.getReleaseNotes('3.4.2').subscribe() + const req = httpTestingController.expectOne( + `${environment.apiBaseUrl}release_notes/?since=3.4.2` + ) + expect(req.request.method).toEqual('GET') + }) }) diff --git a/src-ui/src/app/services/rest/remote-version.service.ts b/src-ui/src/app/services/rest/remote-version.service.ts index 0c100fd6cb..ba0c3445d5 100644 --- a/src-ui/src/app/services/rest/remote-version.service.ts +++ b/src-ui/src/app/services/rest/remote-version.service.ts @@ -1,4 +1,4 @@ -import { HttpClient } from '@angular/common/http' +import { HttpClient, HttpParams } from '@angular/common/http' import { Injectable, inject } from '@angular/core' import { Observable } from 'rxjs' import { environment } from 'src/environments/environment' @@ -8,6 +8,19 @@ export interface AppRemoteVersion { update_available: boolean } +export interface AppRelease { + version: string + name: string + body: string + html_url: string + published_at: string +} + +export interface AppReleaseNotes { + version: string + releases: AppRelease[] +} + @Injectable({ providedIn: 'root', }) @@ -19,4 +32,15 @@ export class RemoteVersionService { `${environment.apiBaseUrl}remote_version/` ) } + + public getReleaseNotes(since?: string): Observable { + let params = new HttpParams() + if (since) { + params = params.set('since', since) + } + return this.http.get( + `${environment.apiBaseUrl}release_notes/`, + { params } + ) + } }