Skip to content

Commit 7d6f761

Browse files
authored
Merge pull request #991 from stgraber/main
ui: don't filter out the OS changelog entry on non-IncusOS systems
2 parents 987c1ee + a0ec8e3 commit 7d6f761

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

ui/src/components/ChangelogView.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ import { ApplicationVersionData } from "types/server";
77
type Props = {
88
changelog?: Changelog;
99
installedApplications?: ApplicationVersionData[];
10+
osName?: string;
1011
};
1112

12-
const baseApp = "IncusOS";
13-
14-
const ChangeLogView: FC<Props> = ({ changelog, installedApplications }) => {
13+
const ChangeLogView: FC<Props> = ({
14+
changelog,
15+
installedApplications,
16+
osName,
17+
}) => {
1518
const [openKeys, setOpenKeys] = useState<Record<string, boolean>>({});
1619

1720
const toggleKey = (key: string) => {
@@ -38,7 +41,7 @@ const ChangeLogView: FC<Props> = ({ changelog, installedApplications }) => {
3841
// Get names of installed applications.
3942
const installedAppNames = installedApplications
4043
? new Set([
41-
baseApp.toLowerCase(),
44+
(osName || "IncusOS").toLowerCase(),
4245
...installedApplications.map((x) => x.name.toLowerCase()),
4346
])
4447
: null;

ui/src/components/ServerUpdateBtn.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ const ServerUpdateBtn: FC<Props> = ({ server, recommended }) => {
100100
<ChangelogView
101101
changelog={changelog ?? undefined}
102102
installedApplications={server.version_data.applications}
103+
osName={server.version_data.os?.name}
103104
/>
104105
</p>
105106
</ModalWindow>

ui/src/types/server.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@ export interface ApplicationVersionData {
1111
version: string;
1212
}
1313

14+
export interface OSVersionData {
15+
name: string;
16+
version: string;
17+
version_next: string;
18+
}
19+
1420
export interface ServerVersionData {
21+
os: OSVersionData;
1522
applications: ApplicationVersionData[];
1623
needs_reboot: boolean;
1724
needs_update: boolean;

0 commit comments

Comments
 (0)