Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: replace sml version with game version #174

Merged
merged 9 commits into from
Aug 11, 2024
Merged
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dev": "conc -c 'auto' bun:graphql-codegen:watch bun:dev:serve bun:check:dev bun:lint:dev",
"dev:serve": "vite dev --host",
"graphql-codegen": "graphql-codegen -r dotenv-flow/config --default-node-env=development --config codegen.yml",
"graphql-codegen:watch": "graphql-codegen --watch",
"graphql-codegen:watch": "bun graphql-codegen --watch",
"lint": "eslint . && prettier --check .",
"lint:dev": "chokidar -c \"eslint . --cache\" --silent --initial \"src/**/*.svelte\" \"src/**/*.ts\"",
"prepare": "husky",
Expand Down
3 changes: 0 additions & 3 deletions src/gql/admin/sml-versions/delete_sml_version.graphql

This file was deleted.

5 changes: 0 additions & 5 deletions src/gql/admin/sml-versions/new_sml_version.graphql

This file was deleted.

18 changes: 0 additions & 18 deletions src/gql/admin/sml-versions/sml_version_admin.graphql

This file was deleted.

21 changes: 0 additions & 21 deletions src/gql/admin/sml-versions/sml_versions_admin.graphql

This file was deleted.

5 changes: 0 additions & 5 deletions src/gql/admin/sml-versions/update_sml_version.graphql

This file was deleted.

3 changes: 1 addition & 2 deletions src/gql/auth/get_me.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ query GetMe {
deleteContent
editContent
editUsers
editSMLVersions
editBootstrapVersions
editSatisfactoryVersions
editAnyModCompatibility
}
}
Expand Down
3 changes: 0 additions & 3 deletions src/gql/home/mods.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@ query GetMods($offset: Int!, $limit: Int!, $search: String, $order: Order, $orde
alpha {
id
version
sml_version
}
beta {
id
version
sml_version
}
release {
id
version
sml_version
}
}
compatibility {
Expand Down
6 changes: 3 additions & 3 deletions src/gql/mods/mod.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ query GetMod($mod: String!) {
}
version
created_at
sml_version
game_version
}
beta {
id
Expand All @@ -42,7 +42,7 @@ query GetMod($mod: String!) {
}
version
created_at
sml_version
game_version
}
release {
id
Expand All @@ -59,7 +59,7 @@ query GetMod($mod: String!) {
}
version
created_at
sml_version
game_version
}
}
downloads
Expand Down
2 changes: 1 addition & 1 deletion src/gql/mods/versions.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ query GetModVersions($mod: ModID!, $limit: Int!, $offset: Int!) {
id
version
stability
sml_version
game_version
downloads
created_at
changelog
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mutation CreateSatisfactoryVersion($satisfactoryVersion: NewSatisfactoryVersion!) {
createSatisfactoryVersion(input: $satisfactoryVersion) {
id
version
engine_version
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mutation DeleteSatisfactoryVersion($satisfactoryVersionID: SatisfactoryVersionID!) {
deleteSatisfactoryVersion(id: $satisfactoryVersionID)
}
7 changes: 7 additions & 0 deletions src/gql/satisfactoryVersions/satisfactory_versions.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
query GetSatisfactoryVersions {
getSatisfactoryVersions {
id
version
engine_version
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mutation UpdateSatisfactoryVersion($id: SatisfactoryVersionID!, $satisfactoryVersion: UpdateSatisfactoryVersion!) {
updateSatisfactoryVersion(id: $id, input: $satisfactoryVersion) {
id
version
engine_version
}
}
18 changes: 0 additions & 18 deletions src/gql/sml/sml_versions.graphql

This file was deleted.

3 changes: 0 additions & 3 deletions src/gql/users/user.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@ query GetUser($user: UserID!) {
alpha {
id
version
sml_version
}
beta {
id
version
sml_version
}
release {
id
version
sml_version
}
}
compatibility {
Expand Down
2 changes: 1 addition & 1 deletion src/gql/versions/mod_version.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ query GetModVersion($version: VersionID!) {
id
version
stability
sml_version
game_version
downloads
created_at
changelog
Expand Down
9 changes: 3 additions & 6 deletions src/lib/components/general/Sidebar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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',
Expand Down
4 changes: 3 additions & 1 deletion src/lib/components/general/TopBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
6 changes: 3 additions & 3 deletions src/lib/components/mods/ModCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
'id' | 'mod_reference' | 'name' | 'logo' | 'views' | 'downloads' | 'short_description' | 'compatibility' | 'tags'
> & {
latestVersions: {
alpha?: Maybe<Pick<Version, 'id' | 'sml_version'>>;
beta?: Maybe<Pick<Version, 'id' | 'sml_version'>>;
release?: Maybe<Pick<Version, 'id' | 'sml_version'>>;
alpha?: Maybe<Pick<Version, 'id'>>;
beta?: Maybe<Pick<Version, 'id'>>;
release?: Maybe<Pick<Version, 'id'>>;
};
};

Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/mods/ModVersions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<tr>
<th>{$t('version')}</th>
<th>{$t('stability')}</th>
<th>SML {$t('version')}</th>
<th>{$t('game-versions')}</th>
<th>{$t('downloads')}</th>
<th>{$t('upload-date')}</th>
<th><!-- Buttons --></th>
Expand All @@ -61,7 +61,7 @@
<tr on:click={() => toggleRow(version.id)}>
<td>{version.version}</td>
<td>{version.stability}</td>
<td>{version.sml_version}</td>
<td>{version.game_version}</td>
<td>{prettyNumber(version.downloads)}</td>
<td>{prettyDate(version.created_at)}</td>
<td class="!overflow-visible !p-2">
Expand Down
Loading