mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-13 04:26:16 -08:00
fix(settings): show current release notes
This commit is contained in:
1 parent
b1119189e2
commit
dcb09580d8
22 files changed
+63
-26
No files matched your search
@@ -81,6 +81,24 @@ describe('SettingsAboutSectionComponent app updates', () => {
|
||||
expect(install).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('shows release notes for the current version when no update is available', () => {
|
||||
const openNotes = jest.fn();
|
||||
fixture.componentInstance.openAppUpdateReleaseNotes.subscribe(openNotes);
|
||||
configureComponent(fixture, {
|
||||
currentVersion: '0.22.0',
|
||||
latestVersion: '0.22.0',
|
||||
manualDownloadUrl:
|
||||
'https://github.com/4gray/iptvnator/releases/latest',
|
||||
status: ELECTRON_BRIDGE_APP_UPDATE_STATUSES.NotAvailable,
|
||||
supportedSelfUpdate: true,
|
||||
});
|
||||
|
||||
getButton(fixture, 'app-update-release-notes')?.click();
|
||||
|
||||
expect(getButton(fixture, 'app-update-release-notes')).toBeTruthy();
|
||||
expect(openNotes).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('emits a manual release request for unsupported Linux packages', () => {
|
||||
const openManual = jest.fn();
|
||||
fixture.componentInstance.openManualAppUpdate.subscribe(openManual);
|
||||
|
||||
@@ -64,13 +64,8 @@ export class SettingsAboutSectionComponent {
|
||||
const status = this.appUpdateStatus();
|
||||
|
||||
return Boolean(
|
||||
status?.latestVersion &&
|
||||
status.status !== ELECTRON_BRIDGE_APP_UPDATE_STATUSES.Idle &&
|
||||
status.status !==
|
||||
ELECTRON_BRIDGE_APP_UPDATE_STATUSES.Checking &&
|
||||
status.status !==
|
||||
ELECTRON_BRIDGE_APP_UPDATE_STATUSES.NotAvailable &&
|
||||
status.status !== ELECTRON_BRIDGE_APP_UPDATE_STATUSES.Error
|
||||
status?.currentVersion &&
|
||||
status.status !== ELECTRON_BRIDGE_APP_UPDATE_STATUSES.Checking
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -500,6 +500,29 @@ describe('SettingsComponent', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('opens release notes dialog for the current version when no update is available', () => {
|
||||
const openSpy = jest
|
||||
.spyOn(privateApi(component).matDialog, 'open')
|
||||
.mockReturnValue(createDialogRef(false));
|
||||
component.appUpdateStatus.set({
|
||||
...DEFAULT_APP_UPDATE_STATUS,
|
||||
latestVersion: undefined,
|
||||
release: undefined,
|
||||
status: ELECTRON_BRIDGE_APP_UPDATE_STATUSES.NotAvailable,
|
||||
});
|
||||
|
||||
component.openAppUpdateReleaseNotes();
|
||||
|
||||
expect(openSpy).toHaveBeenCalledWith(
|
||||
AppUpdateReleaseNotesDialogComponent,
|
||||
expect.objectContaining({
|
||||
data: {
|
||||
initialVersion: DEFAULT_APP_UPDATE_STATUS.currentVersion,
|
||||
},
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('should render a compact page header outside dialog mode', () => {
|
||||
const nativeElement = fixture.nativeElement as HTMLElement;
|
||||
|
||||
|
||||
@@ -403,7 +403,8 @@ export class SettingsComponent implements OnInit, OnDestroy {
|
||||
data: {
|
||||
initialVersion:
|
||||
this.appUpdateStatus()?.latestVersion ??
|
||||
this.appUpdateStatus()?.release?.version,
|
||||
this.appUpdateStatus()?.release?.version ??
|
||||
this.appUpdateStatus()?.currentVersion,
|
||||
},
|
||||
maxWidth: 'calc(100vw - 32px)',
|
||||
restoreFocus: true,
|
||||
|
||||
@@ -410,7 +410,7 @@
|
||||
"APP_UPDATE_DOWNLOAD": "Update",
|
||||
"APP_UPDATE_INSTALL": "Restart application",
|
||||
"APP_UPDATE_OPEN_RELEASE": "Open GitHub release",
|
||||
"APP_UPDATE_RELEASE_NOTES": "Release notes"
|
||||
"APP_UPDATE_RELEASE_NOTES": "What's new"
|
||||
},
|
||||
"THEMES": {
|
||||
"DARK_THEME": "داكن",
|
||||
|
||||
@@ -410,7 +410,7 @@
|
||||
"APP_UPDATE_DOWNLOAD": "Update",
|
||||
"APP_UPDATE_INSTALL": "Restart application",
|
||||
"APP_UPDATE_OPEN_RELEASE": "Open GitHub release",
|
||||
"APP_UPDATE_RELEASE_NOTES": "Release notes"
|
||||
"APP_UPDATE_RELEASE_NOTES": "What's new"
|
||||
},
|
||||
"THEMES": {
|
||||
"DARK_THEME": "داكن",
|
||||
|
||||
@@ -410,7 +410,7 @@
|
||||
"APP_UPDATE_DOWNLOAD": "Update",
|
||||
"APP_UPDATE_INSTALL": "Restart application",
|
||||
"APP_UPDATE_OPEN_RELEASE": "Open GitHub release",
|
||||
"APP_UPDATE_RELEASE_NOTES": "Release notes"
|
||||
"APP_UPDATE_RELEASE_NOTES": "What's new"
|
||||
},
|
||||
"THEMES": {
|
||||
"DARK_THEME": "Цёмная",
|
||||
|
||||
@@ -410,7 +410,7 @@
|
||||
"APP_UPDATE_DOWNLOAD": "Update",
|
||||
"APP_UPDATE_INSTALL": "Restart application",
|
||||
"APP_UPDATE_OPEN_RELEASE": "Open GitHub release",
|
||||
"APP_UPDATE_RELEASE_NOTES": "Release notes"
|
||||
"APP_UPDATE_RELEASE_NOTES": "What's new"
|
||||
},
|
||||
"THEMES": {
|
||||
"DARK_THEME": "Dunkel",
|
||||
|
||||
@@ -410,7 +410,7 @@
|
||||
"APP_UPDATE_DOWNLOAD": "Update",
|
||||
"APP_UPDATE_INSTALL": "Restart application",
|
||||
"APP_UPDATE_OPEN_RELEASE": "Open GitHub release",
|
||||
"APP_UPDATE_RELEASE_NOTES": "Release notes"
|
||||
"APP_UPDATE_RELEASE_NOTES": "What's new"
|
||||
},
|
||||
"THEMES": {
|
||||
"DARK_THEME": "Σκούρο",
|
||||
|
||||
@@ -410,7 +410,7 @@
|
||||
"APP_UPDATE_DOWNLOAD": "Update",
|
||||
"APP_UPDATE_INSTALL": "Restart application",
|
||||
"APP_UPDATE_OPEN_RELEASE": "Open GitHub release",
|
||||
"APP_UPDATE_RELEASE_NOTES": "Release notes"
|
||||
"APP_UPDATE_RELEASE_NOTES": "What's new"
|
||||
},
|
||||
"THEMES": {
|
||||
"DARK_THEME": "Dark",
|
||||
|
||||
@@ -410,7 +410,7 @@
|
||||
"APP_UPDATE_DOWNLOAD": "Update",
|
||||
"APP_UPDATE_INSTALL": "Restart application",
|
||||
"APP_UPDATE_OPEN_RELEASE": "Open GitHub release",
|
||||
"APP_UPDATE_RELEASE_NOTES": "Release notes"
|
||||
"APP_UPDATE_RELEASE_NOTES": "What's new"
|
||||
},
|
||||
"THEMES": {
|
||||
"DARK_THEME": "Oscuro",
|
||||
|
||||
@@ -410,7 +410,7 @@
|
||||
"APP_UPDATE_DOWNLOAD": "Update",
|
||||
"APP_UPDATE_INSTALL": "Restart application",
|
||||
"APP_UPDATE_OPEN_RELEASE": "Open GitHub release",
|
||||
"APP_UPDATE_RELEASE_NOTES": "Release notes"
|
||||
"APP_UPDATE_RELEASE_NOTES": "What's new"
|
||||
},
|
||||
"THEMES": {
|
||||
"DARK_THEME": "Sombre",
|
||||
|
||||
@@ -410,7 +410,7 @@
|
||||
"APP_UPDATE_DOWNLOAD": "Update",
|
||||
"APP_UPDATE_INSTALL": "Restart application",
|
||||
"APP_UPDATE_OPEN_RELEASE": "Open GitHub release",
|
||||
"APP_UPDATE_RELEASE_NOTES": "Release notes"
|
||||
"APP_UPDATE_RELEASE_NOTES": "What's new"
|
||||
},
|
||||
"THEMES": {
|
||||
"DARK_THEME": "Scuro",
|
||||
|
||||
@@ -410,7 +410,7 @@
|
||||
"APP_UPDATE_DOWNLOAD": "Update",
|
||||
"APP_UPDATE_INSTALL": "Restart application",
|
||||
"APP_UPDATE_OPEN_RELEASE": "Open GitHub release",
|
||||
"APP_UPDATE_RELEASE_NOTES": "Release notes"
|
||||
"APP_UPDATE_RELEASE_NOTES": "What's new"
|
||||
},
|
||||
"THEMES": {
|
||||
"DARK_THEME": "ダーク",
|
||||
|
||||
@@ -410,7 +410,7 @@
|
||||
"APP_UPDATE_DOWNLOAD": "Update",
|
||||
"APP_UPDATE_INSTALL": "Restart application",
|
||||
"APP_UPDATE_OPEN_RELEASE": "Open GitHub release",
|
||||
"APP_UPDATE_RELEASE_NOTES": "Release notes"
|
||||
"APP_UPDATE_RELEASE_NOTES": "What's new"
|
||||
},
|
||||
"THEMES": {
|
||||
"DARK_THEME": "어둡게",
|
||||
|
||||
@@ -410,7 +410,7 @@
|
||||
"APP_UPDATE_DOWNLOAD": "Update",
|
||||
"APP_UPDATE_INSTALL": "Restart application",
|
||||
"APP_UPDATE_OPEN_RELEASE": "Open GitHub release",
|
||||
"APP_UPDATE_RELEASE_NOTES": "Release notes"
|
||||
"APP_UPDATE_RELEASE_NOTES": "What's new"
|
||||
},
|
||||
"THEMES": {
|
||||
"DARK_THEME": "Donker",
|
||||
|
||||
@@ -410,7 +410,7 @@
|
||||
"APP_UPDATE_DOWNLOAD": "Update",
|
||||
"APP_UPDATE_INSTALL": "Restart application",
|
||||
"APP_UPDATE_OPEN_RELEASE": "Open GitHub release",
|
||||
"APP_UPDATE_RELEASE_NOTES": "Release notes"
|
||||
"APP_UPDATE_RELEASE_NOTES": "What's new"
|
||||
},
|
||||
"THEMES": {
|
||||
"DARK_THEME": "Ciemny",
|
||||
|
||||
@@ -410,7 +410,7 @@
|
||||
"APP_UPDATE_DOWNLOAD": "Update",
|
||||
"APP_UPDATE_INSTALL": "Restart application",
|
||||
"APP_UPDATE_OPEN_RELEASE": "Open GitHub release",
|
||||
"APP_UPDATE_RELEASE_NOTES": "Release notes"
|
||||
"APP_UPDATE_RELEASE_NOTES": "What's new"
|
||||
},
|
||||
"THEMES": {
|
||||
"DARK_THEME": "Escuro",
|
||||
|
||||
@@ -410,7 +410,7 @@
|
||||
"APP_UPDATE_DOWNLOAD": "Обновить",
|
||||
"APP_UPDATE_INSTALL": "Перезагрузить приложение",
|
||||
"APP_UPDATE_OPEN_RELEASE": "Открыть GitHub release",
|
||||
"APP_UPDATE_RELEASE_NOTES": "Release notes"
|
||||
"APP_UPDATE_RELEASE_NOTES": "Что нового"
|
||||
},
|
||||
"THEMES": {
|
||||
"DARK_THEME": "Тёмная",
|
||||
|
||||
@@ -410,7 +410,7 @@
|
||||
"APP_UPDATE_DOWNLOAD": "Update",
|
||||
"APP_UPDATE_INSTALL": "Restart application",
|
||||
"APP_UPDATE_OPEN_RELEASE": "Open GitHub release",
|
||||
"APP_UPDATE_RELEASE_NOTES": "Release notes"
|
||||
"APP_UPDATE_RELEASE_NOTES": "What's new"
|
||||
},
|
||||
"THEMES": {
|
||||
"DARK_THEME": "Koyu",
|
||||
|
||||
@@ -410,7 +410,7 @@
|
||||
"APP_UPDATE_DOWNLOAD": "Update",
|
||||
"APP_UPDATE_INSTALL": "Restart application",
|
||||
"APP_UPDATE_OPEN_RELEASE": "Open GitHub release",
|
||||
"APP_UPDATE_RELEASE_NOTES": "Release notes"
|
||||
"APP_UPDATE_RELEASE_NOTES": "What's new"
|
||||
},
|
||||
"THEMES": {
|
||||
"DARK_THEME": "深色",
|
||||
|
||||
@@ -410,7 +410,7 @@
|
||||
"APP_UPDATE_DOWNLOAD": "Update",
|
||||
"APP_UPDATE_INSTALL": "Restart application",
|
||||
"APP_UPDATE_OPEN_RELEASE": "Open GitHub release",
|
||||
"APP_UPDATE_RELEASE_NOTES": "Release notes"
|
||||
"APP_UPDATE_RELEASE_NOTES": "What's new"
|
||||
},
|
||||
"THEMES": {
|
||||
"DARK_THEME": "深色",
|
||||
|
||||
Reference in new issue
Block a user