From c5ea5a3b828ac0ed7e2c2b5d50af66961db4e275 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Sat, 18 Feb 2023 20:18:37 -0500 Subject: [PATCH] frontend: cleanup most of the duplication for the version pages --- src/lib/utils/github.ts | 3 + src/routes/settings/Versions.svelte | 324 +----------------- .../settings/versions/DevelVersions.svelte | 50 +++ .../settings/versions/OfficialVersions.svelte | 269 +++++++++++++++ .../versions/UnofficialVersions.svelte | 50 +++ 5 files changed, 381 insertions(+), 315 deletions(-) create mode 100644 src/routes/settings/versions/DevelVersions.svelte create mode 100644 src/routes/settings/versions/OfficialVersions.svelte create mode 100644 src/routes/settings/versions/UnofficialVersions.svelte diff --git a/src/lib/utils/github.ts b/src/lib/utils/github.ts index b7c02d5..8dd03b3 100644 --- a/src/lib/utils/github.ts +++ b/src/lib/utils/github.ts @@ -4,6 +4,7 @@ export interface OfficialRelease { githubLink: string | undefined; downloadUrl: string | undefined; // TODO - windows/mac/linux isDownloaded: boolean; + isBeingDownloaded: boolean; } export async function listOfficialReleases(): Promise { @@ -26,6 +27,7 @@ export async function listOfficialReleases(): Promise { downloadUrl: "https://github.com/open-goal/jak-project/releases/download/v0.1.32/opengoal-windows-v0.1.32.zip", isDownloaded: false, + isBeingDownloaded: false, }); } @@ -47,5 +49,6 @@ export async function getLatestOfficialRelease(): Promise { // TODO - HACK downloadUrl: undefined, isDownloaded: false, + isBeingDownloaded: false, }; } diff --git a/src/routes/settings/Versions.svelte b/src/routes/settings/Versions.svelte index ff62ba8..230f50e 100644 --- a/src/routes/settings/Versions.svelte +++ b/src/routes/settings/Versions.svelte @@ -1,323 +1,17 @@ - -
-

- Configure your active tooling version +

+ Configure your active tooling version

- - Official -
-
-

- Official versions are from the `jak-project` GitHub repository -

-
-
- {#if currentOfficialVersion != selectedOfficialVersion} - - {/if} - - -
-
- - - - Select - - - Controls - - Version - Date - Changes Link - - - {#each officialReleases as release (release.version)} - - - {#if release.isDownloaded} - - {/if} - - - - - {release.version} - {new Date(release.date).toLocaleDateString()} - - - - {/each} - -
-
- - Unofficial -

- Unofficial versions are typically modified `jak-project` releases to - enable changes or new content -

-
-
-

- These are not supported by the OpenGOAL team and will have to be - manually added to the folder at this time -

-
-
- - -
-
-
- - Development -

- This list serves as a convenient area to stage, manage and test new - releases (either official or unofficial) -

-
-
-

- This list will always require manual management via it's respective - folder -

-
-
- - -
-
-
+ + +
diff --git a/src/routes/settings/versions/DevelVersions.svelte b/src/routes/settings/versions/DevelVersions.svelte new file mode 100644 index 0000000..e44a570 --- /dev/null +++ b/src/routes/settings/versions/DevelVersions.svelte @@ -0,0 +1,50 @@ + + + + Development +

+ This list serves as a convenient area to stage, manage and test new releases + (either official or unofficial) +

+
+
+

+ This list will always require manual management via it's respective + folder +

+
+
+ + +
+
+
diff --git a/src/routes/settings/versions/OfficialVersions.svelte b/src/routes/settings/versions/OfficialVersions.svelte new file mode 100644 index 0000000..3d35b6d --- /dev/null +++ b/src/routes/settings/versions/OfficialVersions.svelte @@ -0,0 +1,269 @@ + + + + + + Official + {#if !componentLoaded} +
+ +
+ {:else} +
+
+

+ Official versions are from the `jak-project` GitHub repository +

+
+
+ {#if currentOfficialVersion != selectedOfficialVersion} + + {/if} + + +
+
+ + + + Select + + + Controls + + Version + Date + Changes + + + {#each officialReleases as release (release.version)} + + + {#if release.isDownloaded} + + {/if} + + + + + {release.version} + {new Date(release.date).toLocaleDateString()} + + + + {/each} + +
+ {/if} +
diff --git a/src/routes/settings/versions/UnofficialVersions.svelte b/src/routes/settings/versions/UnofficialVersions.svelte new file mode 100644 index 0000000..15c8a66 --- /dev/null +++ b/src/routes/settings/versions/UnofficialVersions.svelte @@ -0,0 +1,50 @@ + + + + Unofficial +

+ Unofficial versions are typically modified `jak-project` releases to enable + changes or new content +

+
+
+

+ These are not supported by the OpenGOAL team and will have to be + manually added to the folder at this time +

+
+
+ + +
+
+