From a92d52d54bd451ff65c543f809c528c5070f8aae Mon Sep 17 00:00:00 2001 From: secondl1ght Date: Wed, 18 Dec 2024 21:20:09 -0700 Subject: [PATCH 1/2] refactor: replace deprecated fields --- schema.gql | 3 +-- .../queries/__generated__/getAmbossUser.generated.tsx | 6 ++---- src/client/src/graphql/queries/getAmbossUser.ts | 3 +-- src/client/src/graphql/types.ts | 3 +-- src/server/modules/api/amboss/amboss.gql.ts | 3 +-- src/server/modules/api/amboss/amboss.types.ts | 5 +---- 6 files changed, 7 insertions(+), 16 deletions(-) diff --git a/schema.gql b/schema.gql index c79524e3..78213a3d 100644 --- a/schema.gql +++ b/schema.gql @@ -842,11 +842,10 @@ input UpdateRoutingFeesParams { } type UserBackupInfo { - available_size: String! last_update: String last_update_size: String - remaining_size: String! total_size_saved: String! + slots: Float! } type UserGhostInfo { diff --git a/src/client/src/graphql/queries/__generated__/getAmbossUser.generated.tsx b/src/client/src/graphql/queries/__generated__/getAmbossUser.generated.tsx index 130c19d0..0b09010c 100644 --- a/src/client/src/graphql/queries/__generated__/getAmbossUser.generated.tsx +++ b/src/client/src/graphql/queries/__generated__/getAmbossUser.generated.tsx @@ -20,8 +20,7 @@ export type GetAmbossUserQuery = { last_update?: string | null; last_update_size?: string | null; total_size_saved: string; - available_size: string; - remaining_size: string; + slots: number; }; ghost: { __typename?: 'UserGhostInfo'; username?: string | null }; } | null; @@ -39,8 +38,7 @@ export const GetAmbossUserDocument = gql` last_update last_update_size total_size_saved - available_size - remaining_size + slots } ghost { username diff --git a/src/client/src/graphql/queries/getAmbossUser.ts b/src/client/src/graphql/queries/getAmbossUser.ts index 105fb58b..c2d0499f 100644 --- a/src/client/src/graphql/queries/getAmbossUser.ts +++ b/src/client/src/graphql/queries/getAmbossUser.ts @@ -12,8 +12,7 @@ export const GET_AMBOSS_USER = gql` last_update last_update_size total_size_saved - available_size - remaining_size + slots } ghost { username diff --git a/src/client/src/graphql/types.ts b/src/client/src/graphql/types.ts index 771a9925..6a3df874 100644 --- a/src/client/src/graphql/types.ts +++ b/src/client/src/graphql/types.ts @@ -1204,11 +1204,10 @@ export type UpdateRoutingFeesParams = { export type UserBackupInfo = { __typename?: 'UserBackupInfo'; - available_size: Scalars['String']['output']; last_update?: Maybe; last_update_size?: Maybe; - remaining_size: Scalars['String']['output']; total_size_saved: Scalars['String']['output']; + slots: Scalars['Float']['output']; }; export type UserGhostInfo = { diff --git a/src/server/modules/api/amboss/amboss.gql.ts b/src/server/modules/api/amboss/amboss.gql.ts index 88699fe9..19c24e50 100644 --- a/src/server/modules/api/amboss/amboss.gql.ts +++ b/src/server/modules/api/amboss/amboss.gql.ts @@ -9,11 +9,10 @@ export const getUserQuery = gql` upgradable } backups { - available_size last_update last_update_size - remaining_size total_size_saved + slots } ghost { username diff --git a/src/server/modules/api/amboss/amboss.types.ts b/src/server/modules/api/amboss/amboss.types.ts index 6853b103..7c9762a7 100644 --- a/src/server/modules/api/amboss/amboss.types.ts +++ b/src/server/modules/api/amboss/amboss.types.ts @@ -22,10 +22,7 @@ export class UserBackupInfo { total_size_saved: string; @Field() - available_size: string; - - @Field() - remaining_size: string; + slots: number; } @ObjectType() From 704ed723c2d695934b2e3a8f561ff6294ca3ef6f Mon Sep 17 00:00:00 2001 From: secondl1ght Date: Wed, 18 Dec 2024 21:48:19 -0700 Subject: [PATCH 2/2] refactor: finish wip --- schema.gql | 1 - .../__generated__/getAmbossUser.generated.tsx | 2 -- src/client/src/graphql/queries/getAmbossUser.ts | 1 - src/client/src/graphql/types.ts | 1 - src/client/src/views/amboss/Backups.tsx | 12 +----------- src/server/modules/api/amboss/amboss.gql.ts | 1 - src/server/modules/api/amboss/amboss.types.ts | 3 --- 7 files changed, 1 insertion(+), 20 deletions(-) diff --git a/schema.gql b/schema.gql index 78213a3d..41a4ae18 100644 --- a/schema.gql +++ b/schema.gql @@ -845,7 +845,6 @@ type UserBackupInfo { last_update: String last_update_size: String total_size_saved: String! - slots: Float! } type UserGhostInfo { diff --git a/src/client/src/graphql/queries/__generated__/getAmbossUser.generated.tsx b/src/client/src/graphql/queries/__generated__/getAmbossUser.generated.tsx index 0b09010c..f6be5c33 100644 --- a/src/client/src/graphql/queries/__generated__/getAmbossUser.generated.tsx +++ b/src/client/src/graphql/queries/__generated__/getAmbossUser.generated.tsx @@ -20,7 +20,6 @@ export type GetAmbossUserQuery = { last_update?: string | null; last_update_size?: string | null; total_size_saved: string; - slots: number; }; ghost: { __typename?: 'UserGhostInfo'; username?: string | null }; } | null; @@ -38,7 +37,6 @@ export const GetAmbossUserDocument = gql` last_update last_update_size total_size_saved - slots } ghost { username diff --git a/src/client/src/graphql/queries/getAmbossUser.ts b/src/client/src/graphql/queries/getAmbossUser.ts index c2d0499f..75f2afb6 100644 --- a/src/client/src/graphql/queries/getAmbossUser.ts +++ b/src/client/src/graphql/queries/getAmbossUser.ts @@ -12,7 +12,6 @@ export const GET_AMBOSS_USER = gql` last_update last_update_size total_size_saved - slots } ghost { username diff --git a/src/client/src/graphql/types.ts b/src/client/src/graphql/types.ts index 6a3df874..56e7f0ec 100644 --- a/src/client/src/graphql/types.ts +++ b/src/client/src/graphql/types.ts @@ -1207,7 +1207,6 @@ export type UserBackupInfo = { last_update?: Maybe; last_update_size?: Maybe; total_size_saved: Scalars['String']['output']; - slots: Scalars['Float']['output']; }; export type UserGhostInfo = { diff --git a/src/client/src/views/amboss/Backups.tsx b/src/client/src/views/amboss/Backups.tsx index 06f850ac..41a83b88 100644 --- a/src/client/src/views/amboss/Backups.tsx +++ b/src/client/src/views/amboss/Backups.tsx @@ -47,16 +47,10 @@ export const AmbossBackupsView = () => { if (!user) return null; const { - backups: { - remaining_size, - total_size_saved, - last_update, - last_update_size, - }, + backups: { total_size_saved, last_update, last_update_size }, } = user; const total = Number(total_size_saved) / 1e6; - const remaining = Number(remaining_size) / 1e6; return ( <> @@ -74,10 +68,6 @@ export const AmbossBackupsView = () => { 'Total Size Saved', `${numeral(total).format('0.[0000]')} MB` )} - {renderLine( - 'Remaining Size Available', - `${numeral(remaining).format('0.[0000]')} MB` - )} ); diff --git a/src/server/modules/api/amboss/amboss.gql.ts b/src/server/modules/api/amboss/amboss.gql.ts index 19c24e50..7e91cb79 100644 --- a/src/server/modules/api/amboss/amboss.gql.ts +++ b/src/server/modules/api/amboss/amboss.gql.ts @@ -12,7 +12,6 @@ export const getUserQuery = gql` last_update last_update_size total_size_saved - slots } ghost { username diff --git a/src/server/modules/api/amboss/amboss.types.ts b/src/server/modules/api/amboss/amboss.types.ts index 7c9762a7..98ff8ede 100644 --- a/src/server/modules/api/amboss/amboss.types.ts +++ b/src/server/modules/api/amboss/amboss.types.ts @@ -20,9 +20,6 @@ export class UserBackupInfo { @Field() total_size_saved: string; - - @Field() - slots: number; } @ObjectType()