From 7454dce29db4d19f1a4161efad72c828ab2da950 Mon Sep 17 00:00:00 2001 From: Claudio Wunder Date: Sat, 28 Dec 2024 17:48:00 +0000 Subject: [PATCH 1/6] fix: compatibility engine should run even on initial state --- apps/site/util/downloadUtils.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/site/util/downloadUtils.tsx b/apps/site/util/downloadUtils.tsx index 61ff7ccba9937..59937e02d2dfb 100644 --- a/apps/site/util/downloadUtils.tsx +++ b/apps/site/util/downloadUtils.tsx @@ -98,13 +98,14 @@ export const parseCompat = < const satisfiesSemver = (semver: string) => satisfies(version, semver); const supportsOS = (i: T['compatibility']) => - os === 'LOADING' || (i.os?.includes(os) ?? true); + i.os?.includes(os as UserOS) ?? true; const supportsInstallMethod = (i: T['compatibility']) => - (installMethod === '' || i.installMethod?.includes(installMethod)) ?? true; + i.installMethod?.includes(installMethod as Types.InstallationMethod) ?? + true; const supportsPlatform = (i: T['compatibility']) => - platform === '' || (i.platform?.includes(platform) ?? true); + i.platform?.includes(platform as UserPlatform) ?? true; const supportsVersion = (i: T['compatibility']) => i.semver?.some(satisfiesSemver) ?? true; From 8d8eddd5074b99ccc2fff8dbcec6853c9fe837db Mon Sep 17 00:00:00 2001 From: Claudio Wunder Date: Sat, 28 Dec 2024 17:49:56 +0000 Subject: [PATCH 2/6] chore: aix to be allowed on empty install method --- apps/site/util/downloadUtils.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/site/util/downloadUtils.tsx b/apps/site/util/downloadUtils.tsx index 59937e02d2dfb..8b6a97d85ed02 100644 --- a/apps/site/util/downloadUtils.tsx +++ b/apps/site/util/downloadUtils.tsx @@ -146,7 +146,7 @@ export const OPERATING_SYSTEMS: Array> = [ { label: OperatingSystemLabel.AIX, value: 'AIX', - compatibility: { installMethod: [] }, + compatibility: { installMethod: ['' as Types.InstallationMethod] }, iconImage: , }, ]; From 16408a4bc17d1b5cb00fef105ea76fee5e6e6209 Mon Sep 17 00:00:00 2001 From: Claudio Wunder Date: Sat, 28 Dec 2024 17:51:15 +0000 Subject: [PATCH 3/6] chore: update dependency chain --- .../components/Downloads/Release/OperatingSystemDropdown.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/site/components/Downloads/Release/OperatingSystemDropdown.tsx b/apps/site/components/Downloads/Release/OperatingSystemDropdown.tsx index 385717528faf9..0a7d7c032e82f 100644 --- a/apps/site/components/Downloads/Release/OperatingSystemDropdown.tsx +++ b/apps/site/components/Downloads/Release/OperatingSystemDropdown.tsx @@ -30,9 +30,9 @@ const OperatingSystemDropdown: FC = () => { // We parse the compatibility of the dropdown items const parsedOperatingSystems = useMemo( () => parseCompat(OPERATING_SYSTEMS, release), - // We only want to react on the change of the OS, Bitness, and Version + // We only want to react on the change of the Install Method // eslint-disable-next-line react-hooks/exhaustive-deps - [release.os, release.platform, release.version] + [release.installMethod] ); return ( From 93ab8afcc782b22429391c6763c4f30962234c7d Mon Sep 17 00:00:00 2001 From: Claudio Wunder Date: Sat, 28 Dec 2024 17:56:16 +0000 Subject: [PATCH 4/6] chore: minor effect updates --- .../components/Downloads/Release/OperatingSystemDropdown.tsx | 2 +- .../components/Downloads/Release/PackageManagerDropdown.tsx | 2 +- apps/site/components/Downloads/Release/PlatformDropdown.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/site/components/Downloads/Release/OperatingSystemDropdown.tsx b/apps/site/components/Downloads/Release/OperatingSystemDropdown.tsx index 0a7d7c032e82f..d4a4fb31c825c 100644 --- a/apps/site/components/Downloads/Release/OperatingSystemDropdown.tsx +++ b/apps/site/components/Downloads/Release/OperatingSystemDropdown.tsx @@ -32,7 +32,7 @@ const OperatingSystemDropdown: FC = () => { () => parseCompat(OPERATING_SYSTEMS, release), // We only want to react on the change of the Install Method // eslint-disable-next-line react-hooks/exhaustive-deps - [release.installMethod] + [release.installMethod, release.os] ); return ( diff --git a/apps/site/components/Downloads/Release/PackageManagerDropdown.tsx b/apps/site/components/Downloads/Release/PackageManagerDropdown.tsx index 0a0fdafe5173c..3faf61f0a1e9e 100644 --- a/apps/site/components/Downloads/Release/PackageManagerDropdown.tsx +++ b/apps/site/components/Downloads/Release/PackageManagerDropdown.tsx @@ -30,7 +30,7 @@ const PackageManagerDropdown: FC = () => { ), // We only want to react on the change of the Version // eslint-disable-next-line react-hooks/exhaustive-deps - [release.version] + [release.version, release.packageManager] ); return ( diff --git a/apps/site/components/Downloads/Release/PlatformDropdown.tsx b/apps/site/components/Downloads/Release/PlatformDropdown.tsx index 6acb57beb0872..46e3b8ec33c21 100644 --- a/apps/site/components/Downloads/Release/PlatformDropdown.tsx +++ b/apps/site/components/Downloads/Release/PlatformDropdown.tsx @@ -40,7 +40,7 @@ const PlatformDropdown: FC = () => { : [], // We only want to react on the change of the OS, Platform, and Version // eslint-disable-next-line react-hooks/exhaustive-deps - [release.os, release.platform, release.version] + [release.os, release.version] ); // We set the Platform to the next available Architecture when the current From 118982fac18ed660ddfb87b69b23c113a3c8174e Mon Sep 17 00:00:00 2001 From: Claudio Wunder Date: Sat, 28 Dec 2024 18:00:03 +0000 Subject: [PATCH 5/6] fix: layout mobile flex wrap --- .../components/Downloads/Release/PrebuiltDownloadButtons.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/site/components/Downloads/Release/PrebuiltDownloadButtons.tsx b/apps/site/components/Downloads/Release/PrebuiltDownloadButtons.tsx index 8be309c5f46da..f3c8a2d57c7b0 100644 --- a/apps/site/components/Downloads/Release/PrebuiltDownloadButtons.tsx +++ b/apps/site/components/Downloads/Release/PrebuiltDownloadButtons.tsx @@ -30,7 +30,7 @@ const PrebuiltDownloadButtons: FC = () => { : ''; return ( -
+
Date: Sat, 28 Dec 2024 18:06:47 +0000 Subject: [PATCH 6/6] chore: update types to be happy --- apps/site/util/downloadUtils.tsx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/apps/site/util/downloadUtils.tsx b/apps/site/util/downloadUtils.tsx index 8b6a97d85ed02..a7368a97e761a 100644 --- a/apps/site/util/downloadUtils.tsx +++ b/apps/site/util/downloadUtils.tsx @@ -42,9 +42,9 @@ export enum PackageManagerLabel { } type DownloadCompatibility = { - os: Array; - installMethod: Array; - platform: Array; + os: Array; + installMethod: Array; + platform: Array; semver: Array; releases: Array; }; @@ -97,15 +97,13 @@ export const parseCompat = < ): Array => { const satisfiesSemver = (semver: string) => satisfies(version, semver); - const supportsOS = (i: T['compatibility']) => - i.os?.includes(os as UserOS) ?? true; + const supportsOS = (i: T['compatibility']) => i.os?.includes(os) ?? true; const supportsInstallMethod = (i: T['compatibility']) => - i.installMethod?.includes(installMethod as Types.InstallationMethod) ?? - true; + i.installMethod?.includes(installMethod) ?? true; const supportsPlatform = (i: T['compatibility']) => - i.platform?.includes(platform as UserPlatform) ?? true; + i.platform?.includes(platform) ?? true; const supportsVersion = (i: T['compatibility']) => i.semver?.some(satisfiesSemver) ?? true; @@ -146,7 +144,7 @@ export const OPERATING_SYSTEMS: Array> = [ { label: OperatingSystemLabel.AIX, value: 'AIX', - compatibility: { installMethod: ['' as Types.InstallationMethod] }, + compatibility: { installMethod: [''] }, iconImage: , }, ];