New button, TODO release notes modal

This commit is contained in:
shamoon committed 2026-11-17 23:35:04 -08:00
1 parent 068fc4b8bc
commit a127ecd35d
3 files changed
+60

No files matched your search

@@ -372,6 +372,17 @@
<pngx-input-switch class="position-absolute top-50 end-0 translate-middle-y me-1" [class.d-none]="slimSidebarEnabled || slimSidebarAnimating()" [compact]="true" title="Documentation" i18n-title [ngModel]="!settingsService.sidebarItemIsHidden(HideableSidebarItemID.Documentation)" (ngModelChange)="toggleSidebarItem(HideableSidebarItemID.Documentation, $event)"></pngx-input-switch>
}
</li>
@if (slimSidebarEnabled && settingsService.unseenReleasesSince()) {
<li class="nav-item d-none d-md-block">
<button type="button" class="nav-link btn btn-link position-relative" (click)="showReleaseNotes()"
aria-label="See what's new in this version" i18n-aria-label
ngbPopover="What's new" i18n-ngbPopover placement="end" container="body"
triggers="mouseenter:mouseleave" popoverClass="popover-slim">
<pngx-bs-icon name="info-circle"></pngx-bs-icon>
<span class="position-absolute top-0 end-0 mt-2 me-2 p-1 bg-success rounded-circle"><span class="visually-hidden" i18n>New</span></span>
</button>
</li>
}
<li class="nav-item" [class.visually-hidden]="slimSidebarEnabled">
<div class="text-muted small d-flex align-items-center flex-wrap nav-label">
<div class="me-2">
@@ -381,6 +392,10 @@
triggers="mouseenter:mouseleave" popoverClass="popover-slim">
{{ versionString }}
</a>
@if (settingsService.unseenReleasesSince()) {
<button type="button" class="badge rounded-pill bg-transparent border border-success text-success fw-normal ms-1 align-middle" (click)="showReleaseNotes()"
title="See what's new in this version" i18n-title i18n>New</button>
}
</div>
@if (!settingsService.updateCheckingIsSet || appRemoteVersion()) {
<div class="version-check d-flex align-items-center">
@@ -695,6 +695,46 @@ describe('AppFrameComponent', () => {
expect(maybeRefreshSpy).toHaveBeenCalled()
})
it('should show new release pill and mark releases seen on click', () => {
settingsService.set(SETTINGS_KEYS.VERSION, '3.5.1')
settingsService.set(SETTINGS_KEYS.WHATS_NEW_LAST_SEEN_VERSION, '3.4.2')
fixture.detectChanges()
const pill = fixture.debugElement
.queryAll(By.css('button'))
.find((b) => b.nativeElement.textContent.trim() === 'New')
expect(pill).toBeTruthy()
pill.nativeElement.click()
const req = httpTestingController.expectOne(
`${environment.apiBaseUrl}ui_settings/`
)
expect(req.request.body.settings.whats_new.last_seen_version).toEqual(
'3.5.1'
)
req.flush({ success: true })
fixture.detectChanges()
expect(
fixture.debugElement
.queryAll(By.css('button'))
.find((b) => b.nativeElement.textContent.trim() === 'New')
).toBeUndefined()
})
it('should show new release dot in slim sidebar', () => {
settingsService.set(SETTINGS_KEYS.SLIM_SIDEBAR, true)
settingsService.set(SETTINGS_KEYS.VERSION, '3.5.1')
settingsService.set(SETTINGS_KEYS.WHATS_NEW_LAST_SEEN_VERSION, '3.4.2')
fixture.detectChanges()
expect(
fixture.debugElement.query(
By.css('button[aria-label="See what\'s new in this version"]')
)
).toBeTruthy()
})
it('should show tasks badge for needs-attention tasks', () => {
jest
.spyOn(tasksService, 'needsAttentionTasksCount', 'get')
@@ -551,6 +551,11 @@ export class AppFrameComponent
})
}
showReleaseNotes() {
// TODO: open release notes modal
this.settingsService.markReleasesSeen().pipe(first()).subscribe()
}
setUpdateChecking(enable: boolean) {
this.settingsService.set(SETTINGS_KEYS.UPDATE_CHECKING_ENABLED, enable)
this.settingsService