From 13f85e68190722d2289ae7517768788b1ce4e67f Mon Sep 17 00:00:00 2001 From: mircearoata Date: Wed, 19 Jun 2024 22:38:18 +0200 Subject: [PATCH 1/9] feat: remove SML-related pages --- .../sml-versions/delete_sml_version.graphql | 3 - .../sml-versions/new_sml_version.graphql | 5 - .../sml-versions/sml_version_admin.graphql | 18 -- .../sml-versions/sml_versions_admin.graphql | 21 -- .../sml-versions/update_sml_version.graphql | 5 - src/gql/auth/get_me.graphql | 3 +- src/gql/sml/sml_versions.graphql | 18 -- src/lib/components/general/Sidebar.svelte | 9 +- src/lib/components/general/TopBar.svelte | 4 +- .../sml-versions/SMLVersionForm.svelte | 196 ------------------ .../versions/VersionDependenciesGrid.svelte | 2 +- src/lib/core/graphql.ts | 6 - src/lib/models/sml-versions.ts | 49 ----- src/lib/models/versions.ts | 13 +- src/routes/admin/+page.svelte | 4 - src/routes/admin/sml-versions/+page.svelte | 117 ----------- .../[smlVersionId]/edit/+page.svelte | 76 ------- .../sml-versions/[smlVersionId]/edit/+page.ts | 5 - .../admin/sml-versions/new/+page.svelte | 51 ----- src/routes/sml-versions/+page.svelte | 121 ----------- 20 files changed, 11 insertions(+), 715 deletions(-) delete mode 100644 src/gql/admin/sml-versions/delete_sml_version.graphql delete mode 100644 src/gql/admin/sml-versions/new_sml_version.graphql delete mode 100644 src/gql/admin/sml-versions/sml_version_admin.graphql delete mode 100644 src/gql/admin/sml-versions/sml_versions_admin.graphql delete mode 100644 src/gql/admin/sml-versions/update_sml_version.graphql delete mode 100644 src/gql/sml/sml_versions.graphql delete mode 100644 src/lib/components/sml-versions/SMLVersionForm.svelte delete mode 100644 src/lib/models/sml-versions.ts delete mode 100644 src/routes/admin/sml-versions/+page.svelte delete mode 100644 src/routes/admin/sml-versions/[smlVersionId]/edit/+page.svelte delete mode 100644 src/routes/admin/sml-versions/[smlVersionId]/edit/+page.ts delete mode 100644 src/routes/admin/sml-versions/new/+page.svelte delete mode 100644 src/routes/sml-versions/+page.svelte diff --git a/src/gql/admin/sml-versions/delete_sml_version.graphql b/src/gql/admin/sml-versions/delete_sml_version.graphql deleted file mode 100644 index 6e8a8877f..000000000 --- a/src/gql/admin/sml-versions/delete_sml_version.graphql +++ /dev/null @@ -1,3 +0,0 @@ -mutation DeleteSMLVersion($smlVersionID: SMLVersionID!) { - deleteSMLVersion(smlVersionId: $smlVersionID) -} diff --git a/src/gql/admin/sml-versions/new_sml_version.graphql b/src/gql/admin/sml-versions/new_sml_version.graphql deleted file mode 100644 index 502680c07..000000000 --- a/src/gql/admin/sml-versions/new_sml_version.graphql +++ /dev/null @@ -1,5 +0,0 @@ -mutation NewSMLVersion($smlVersion: NewSMLVersion!) { - createSMLVersion(smlVersion: $smlVersion) { - id - } -} diff --git a/src/gql/admin/sml-versions/sml_version_admin.graphql b/src/gql/admin/sml-versions/sml_version_admin.graphql deleted file mode 100644 index 07b56cadb..000000000 --- a/src/gql/admin/sml-versions/sml_version_admin.graphql +++ /dev/null @@ -1,18 +0,0 @@ -query GetSMLVersionAdmin($smlVersionID: SMLVersionID!) { - getSMLVersion(smlVersionID: $smlVersionID) { - id - version - stability - link - targets { - targetName - link - } - changelog - created_at - date - satisfactory_version - bootstrap_version - engine_version - } -} diff --git a/src/gql/admin/sml-versions/sml_versions_admin.graphql b/src/gql/admin/sml-versions/sml_versions_admin.graphql deleted file mode 100644 index bce883420..000000000 --- a/src/gql/admin/sml-versions/sml_versions_admin.graphql +++ /dev/null @@ -1,21 +0,0 @@ -query GetSMLVersionsAdmin($filter: SMLVersionFilter) { - getSMLVersions(filter: $filter) { - sml_versions { - id - version - stability - link - targets { - targetName - link - } - changelog - created_at - date - satisfactory_version - bootstrap_version - engine_version - } - count - } -} diff --git a/src/gql/admin/sml-versions/update_sml_version.graphql b/src/gql/admin/sml-versions/update_sml_version.graphql deleted file mode 100644 index f996d777f..000000000 --- a/src/gql/admin/sml-versions/update_sml_version.graphql +++ /dev/null @@ -1,5 +0,0 @@ -mutation UpdateSMLVersion($smlVersionID: SMLVersionID!, $smlVersion: UpdateSMLVersion!) { - updateSMLVersion(smlVersionId: $smlVersionID, smlVersion: $smlVersion) { - id - } -} diff --git a/src/gql/auth/get_me.graphql b/src/gql/auth/get_me.graphql index 3f2fc08da..004372bdd 100644 --- a/src/gql/auth/get_me.graphql +++ b/src/gql/auth/get_me.graphql @@ -14,8 +14,7 @@ query GetMe { deleteContent editContent editUsers - editSMLVersions - editBootstrapVersions + editSatisfactoryVersions editAnyModCompatibility } } diff --git a/src/gql/sml/sml_versions.graphql b/src/gql/sml/sml_versions.graphql deleted file mode 100644 index 649e696c8..000000000 --- a/src/gql/sml/sml_versions.graphql +++ /dev/null @@ -1,18 +0,0 @@ -query GetSMLVersions($limit: Int!, $offset: Int!) { - getSMLVersions(filter: { limit: $limit, offset: $offset }) { - count - sml_versions { - id - version - stability - changelog - link - targets { - targetName - link - } - date - satisfactory_version - } - } -} diff --git a/src/lib/components/general/Sidebar.svelte b/src/lib/components/general/Sidebar.svelte index 0917400b0..757c9d934 100644 --- a/src/lib/components/general/Sidebar.svelte +++ b/src/lib/components/general/Sidebar.svelte @@ -12,7 +12,9 @@ export const { t } = getTranslate(); - $: isAdmin = !$user ? false : $user.roles.approveMods || $user.roles.approveVersions || $user.roles.editSMLVersions; + $: isAdmin = !$user + ? false + : $user.roles.approveMods || $user.roles.approveVersions || $user.roles.editSatisfactoryVersions; let top: SidebarItemData[]; $: top = [ @@ -31,11 +33,6 @@ icon: 'description', label: $t('sidebar.guides') }, - { - url: base + '/sml-versions', - icon: 'lightbulb', - label: $t('sidebar.sml-versions') - }, { url: base + '/tools', icon: 'apps', diff --git a/src/lib/components/general/TopBar.svelte b/src/lib/components/general/TopBar.svelte index 66e221529..78acfbe09 100644 --- a/src/lib/components/general/TopBar.svelte +++ b/src/lib/components/general/TopBar.svelte @@ -8,7 +8,9 @@ import { AppBar, type PopupSettings, popup, getDrawerStore, getModalStore } from '@skeletonlabs/skeleton'; import LoginModal from '$lib/modals/LoginModal.svelte'; - $: isAdmin = !$user ? false : $user.roles.approveMods || $user.roles.approveVersions || $user.roles.editSMLVersions; + $: isAdmin = !$user + ? false + : $user.roles.approveMods || $user.roles.approveVersions || $user.roles.editSatisfactoryVersions; export const { t } = getTranslate(); diff --git a/src/lib/components/sml-versions/SMLVersionForm.svelte b/src/lib/components/sml-versions/SMLVersionForm.svelte deleted file mode 100644 index 4b98a2e26..000000000 --- a/src/lib/components/sml-versions/SMLVersionForm.svelte +++ /dev/null @@ -1,196 +0,0 @@ - - -
-
-
- - - {message || ''} - -
- -
- - - {message || ''} - -
- - {#if $data.bootstrap_version !== undefined && $data.bootstrap_version !== null} -
- - - {message || ''} - -
- {/if} - -
- - - {message || ''} - -
- -
-
-