From ef85bd39eed3b990de930e1b0ae41ee34f2e8954 Mon Sep 17 00:00:00 2001 From: Chris Wall <47161774+porisius@users.noreply.github.com> Date: Tue, 17 Sep 2024 18:51:45 -0400 Subject: [PATCH] Optional Dependencies Grid (#169) * Filter Optional Dependencies from ModDependency List may determine to create an optional dependency list later * mod.id -> mod.mod_reference Requested by Mircea https://discord.com/channels/555424930502541343/830842478956642354/1248726787857321995 * fix: added graphql tags and draft "Optional" tag * Tagged Optional -> Tabled Optional * feat: split deps into distinct tables with tooltips * feat: dotted underline on deps table headers * feat: only show optional deps table when they exist * chore: update aria-label * Make dependencies reactive Co-authored-by: mircearoata * chore: add gpg signing info to readme * fix: pass modref for smm install and modid for smr download --------- Co-authored-by: Rob B Co-authored-by: mircearoata --- .devcontainer/devcontainer.json | 3 +- CONTRIBUTING.md | 8 ++- cspell.json | 15 +++++- src/gql/mods/mod.graphql | 3 ++ src/gql/versions/mod_version.graphql | 1 + .../components/mods/ModLatestVersions.svelte | 5 +- .../components/versions/DependencyRow.svelte | 15 ++++++ .../versions/VersionDependenciesGrid.svelte | 49 +++++++++++++------ src/routes/mod/[modId]/+page.svelte | 5 +- 9 files changed, 84 insertions(+), 20 deletions(-) create mode 100644 src/lib/components/versions/DependencyRow.svelte diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e25cbaf55..7c0a3bfea 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -36,7 +36,8 @@ "mikestead.dotenv", "me-dutour-mathieu.vscode-github-actions", "eamodio.gitlens", - "GitHub.copilot" + "GitHub.copilot", + "GitHub.vscode-pull-request-github" ] } }, diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 884a45184..da9dac208 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,13 @@ You should [operate the devcontainer out of an isolated Docker volume](https://c to avoid the _significant_ slowdowns caused by working on the host file system. You may need to [install additional software](https://code.visualstudio.com/remote/advancedcontainers/sharing-git-credentials) to share your git credentials with the container. -Alternative, try using GitHub Codespaces. +Alternatively, try using GitHub Codespaces. + +If you normally [gpg sign your commits](https://code.visualstudio.com/remote/advancedcontainers/sharing-git-credentials#_sharing-gpg-keys) +and the container is giving you trouble, +consider turning off signing inside the container by running +`git config --global commit.gpgsign false` +inside the container. ### Dependencies diff --git a/cspell.json b/cspell.json index c9049e8ec..4fee56942 100644 --- a/cspell.json +++ b/cspell.json @@ -5,7 +5,20 @@ // language - current active spelling language "language": "en", // words - list of words to be always considered correct - "words": ["cfworker", "felte", "ficsit", "pnpx", "prismjs", "smui", "tolgee", "uplugin", "urql", "webp", "wonka"], + "words": [ + "cfworker", + "felte", + "ficsit", + "gpgsign", + "pnpx", + "prismjs", + "smui", + "tolgee", + "uplugin", + "urql", + "webp", + "wonka" + ], // flagWords - list of words to be always considered incorrect // This is useful for offensive words and common spelling errors. // cSpell:disable (don't complain about the words we listed here) diff --git a/src/gql/mods/mod.graphql b/src/gql/mods/mod.graphql index 1c857b51a..ceb4b69f4 100644 --- a/src/gql/mods/mod.graphql +++ b/src/gql/mods/mod.graphql @@ -21,6 +21,7 @@ query GetMod($mod: String!) { } dependencies { mod_id + optional condition } version @@ -38,6 +39,7 @@ query GetMod($mod: String!) { } dependencies { mod_id + optional condition } version @@ -55,6 +57,7 @@ query GetMod($mod: String!) { } dependencies { mod_id + optional condition } version diff --git a/src/gql/versions/mod_version.graphql b/src/gql/versions/mod_version.graphql index 5c24ee76d..5b8853bb0 100644 --- a/src/gql/versions/mod_version.graphql +++ b/src/gql/versions/mod_version.graphql @@ -28,6 +28,7 @@ query GetModVersion($version: VersionID!) { } dependencies { mod_id + optional condition } } diff --git a/src/lib/components/mods/ModLatestVersions.svelte b/src/lib/components/mods/ModLatestVersions.svelte index cf059548b..5a00d53a3 100644 --- a/src/lib/components/mods/ModLatestVersions.svelte +++ b/src/lib/components/mods/ModLatestVersions.svelte @@ -9,7 +9,7 @@ type IVersion = Pick & { targets?: Pick[]; - } & { dependencies?: Pick[] }; + } & { dependencies?: Pick[] }; type ILatestVersions = { alpha?: IVersion; @@ -23,6 +23,7 @@ export let latestVersions!: ILatestVersions; export let modId!: string; + export let modReference!: string; export const { t } = getTranslate(); @@ -48,7 +49,7 @@
installMod(modId)} + on:click={() => installMod(modReference)} title="Install via Satisfactory Mod Manager" class="text-yellow-500"> download Install diff --git a/src/lib/components/versions/DependencyRow.svelte b/src/lib/components/versions/DependencyRow.svelte new file mode 100644 index 000000000..23116d247 --- /dev/null +++ b/src/lib/components/versions/DependencyRow.svelte @@ -0,0 +1,15 @@ + + + + + + {dependency.mod_id} + + +
{dependency.condition}
+ diff --git a/src/lib/components/versions/VersionDependenciesGrid.svelte b/src/lib/components/versions/VersionDependenciesGrid.svelte index 66ff8a4f2..51ec6b7a3 100644 --- a/src/lib/components/versions/VersionDependenciesGrid.svelte +++ b/src/lib/components/versions/VersionDependenciesGrid.svelte @@ -1,34 +1,55 @@
- +
- + - {#if dependencies?.length === 0} + {#if requiredDependencies?.length === 0} + {:else} - {#each dependencies as dependency} - - - - + {#each requiredDependencies as dependency} + {/each} {/if}
Mod DependencyRequired Dependencies
Version Range
None
N/A
- - {dependency.mod_id} - -
{dependency.condition}
+ + +{#if optionalDependencies?.length !== 0} +
+ + + + + + + {#each optionalDependencies as dependency} + + {/each} + +
Optional Dependencies
Version Range
+
+{/if} diff --git a/src/routes/mod/[modId]/+page.svelte b/src/routes/mod/[modId]/+page.svelte index dbe21cedc..14b42f9c6 100644 --- a/src/routes/mod/[modId]/+page.svelte +++ b/src/routes/mod/[modId]/+page.svelte @@ -141,7 +141,10 @@ modName={$mod.data.mod.name} compatibility={$mod.data.mod.compatibility} />
- +