diff --git a/backend/src/api/satellite/content-types/satellite/schema.json b/backend/src/api/satellite/content-types/satellite/schema.json index 6a2f0f3..121ac83 100644 --- a/backend/src/api/satellite/content-types/satellite/schema.json +++ b/backend/src/api/satellite/content-types/satellite/schema.json @@ -50,6 +50,11 @@ }, "missionStatus": { "type": "string" + }, + "slug": { + "type": "uid", + "targetField": "name", + "required": true } } } diff --git a/backend/types/generated/contentTypes.d.ts b/backend/types/generated/contentTypes.d.ts index ff27751..cdbf876 100644 --- a/backend/types/generated/contentTypes.d.ts +++ b/backend/types/generated/contentTypes.d.ts @@ -512,6 +512,12 @@ export interface PluginContentReleasesRelease extends Schema.CollectionType { attributes: { name: Attribute.String & Attribute.Required; releasedAt: Attribute.DateTime; + scheduledAt: Attribute.DateTime; + timezone: Attribute.String; + status: Attribute.Enumeration< + ['ready', 'blocked', 'failed', 'done', 'empty'] + > & + Attribute.Required; actions: Attribute.Relation< 'plugin::content-releases.release', 'oneToMany', @@ -566,6 +572,7 @@ export interface PluginContentReleasesReleaseAction 'manyToOne', 'plugin::content-releases.release' >; + isEntryValid: Attribute.Boolean; createdAt: Attribute.DateTime; updatedAt: Attribute.DateTime; createdBy: Attribute.Relation< @@ -985,6 +992,8 @@ export interface ApiSatelliteSatellite extends Schema.CollectionType { 'api::most-recent-image.most-recent-image' >; missionStatus: Attribute.String; + slug: Attribute.UID<'api::satellite.satellite', 'name'> & + Attribute.Required; createdAt: Attribute.DateTime; updatedAt: Attribute.DateTime; publishedAt: Attribute.DateTime; diff --git a/frontend/src/__generated__/gql.ts b/frontend/src/__generated__/gql.ts index b1133d2..7acb1dd 100644 --- a/frontend/src/__generated__/gql.ts +++ b/frontend/src/__generated__/gql.ts @@ -16,7 +16,7 @@ const documents = { "query ArticleWithSlug($articlesFilters: ArticleFiltersInput) {\n articles(filters: $articlesFilters) {\n data {\n id\n attributes {\n author {\n data {\n attributes {\n name\n avatar {\n data {\n attributes {\n url\n }\n }\n }\n }\n }\n }\n body\n coverImage {\n data {\n attributes {\n url\n }\n }\n }\n datePublished\n previewCardTitle\n }\n }\n }\n }\n \n ": types.ArticleWithSlugDocument, "\nquery Projects($projectFilters: ProjectFiltersInput) {\n projects(filters: $projectFilters) {\n data {\n attributes {\n title\n content\n satellites {\n data {\n id\n attributes {\n name\n previewImage {\n data {\n attributes {\n url\n }\n }\n }\n }\n }\n }\n slug\n previewImage {\n data {\n id\n attributes {\n url\n }\n }\n }\n }\n }\n }\n}": types.ProjectsDocument, "\n query GET_PROJECTS {\n projects(sort: [\"publishedAt:desc\"]) {\n data {\n id\n attributes {\n title\n content\n satellites {\n data {\n attributes {\n catalogNumberNORAD\n }\n }\n }\n slug\n previewImage {\n data {\n attributes {\n url\n }\n }\n }\n }\n }\n }\n }": types.Get_ProjectsDocument, - "\nquery GET_SATELLITES {\n satellites {\n data {\n id\n attributes {\n celestrakURL\n catalogNumberNORAD\n name\n previewImage {\n data {\n attributes {\n url\n }\n }\n }\n missionStatus\n }\n }\n }\n }\n": types.Get_SatellitesDocument, + "\nquery GET_SATELLITES {\n satellites {\n data {\n id\n attributes {\n celestrakURL\n catalogNumberNORAD\n name\n previewImage {\n data {\n attributes {\n url\n }\n }\n }\n missionStatus\n slug\n }\n }\n }\n }\n": types.Get_SatellitesDocument, "\nquery Query($publicationState: PublicationState) {\n hero(publicationState: $publicationState) {\n data {\n attributes {\n text\n image {\n data {\n attributes {\n url\n }\n }\n }\n }\n }\n }\n }": types.QueryDocument, "\nquery GET_ARTICLES($pagination: PaginationArg, $filters: ArticleFiltersInput) {\n articles(sort: [\"datePublished:desc\"], pagination: $pagination, filters: $filters) {\n data {\n id\n attributes {\n author {\n data {\n attributes {\n name\n avatar {\n data {\n attributes {\n url\n }\n }\n }\n }\n }\n }\n previewCardTitle\n datePublished\n body\n coverImage {\n data {\n attributes {\n url\n }\n }\n }\n createdAt\n publishedAt\n slug\n Tag\n }\n }\n meta {\n pagination {\n total\n }\n }\n }\n}\n": types.Get_ArticlesDocument, "\nquery MostRecentImages {\n mostRecentImages(sort: [\"publishedAt:desc\"]) {\n data {\n attributes {\n mostRecentImage {\n data {\n attributes {\n url\n }\n }\n }\n satellite {\n data {\n attributes {\n catalogNumberNORAD\n name\n }\n }\n }\n createdAt\n updatedAt\n publishedAt\n }\n }\n }\n}\n\n": types.MostRecentImagesDocument, @@ -52,7 +52,7 @@ export function gql(source: "\n query GET_PROJECTS {\n projects(sort: [\"publ /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function gql(source: "\nquery GET_SATELLITES {\n satellites {\n data {\n id\n attributes {\n celestrakURL\n catalogNumberNORAD\n name\n previewImage {\n data {\n attributes {\n url\n }\n }\n }\n missionStatus\n }\n }\n }\n }\n"): (typeof documents)["\nquery GET_SATELLITES {\n satellites {\n data {\n id\n attributes {\n celestrakURL\n catalogNumberNORAD\n name\n previewImage {\n data {\n attributes {\n url\n }\n }\n }\n missionStatus\n }\n }\n }\n }\n"]; +export function gql(source: "\nquery GET_SATELLITES {\n satellites {\n data {\n id\n attributes {\n celestrakURL\n catalogNumberNORAD\n name\n previewImage {\n data {\n attributes {\n url\n }\n }\n }\n missionStatus\n slug\n }\n }\n }\n }\n"): (typeof documents)["\nquery GET_SATELLITES {\n satellites {\n data {\n id\n attributes {\n celestrakURL\n catalogNumberNORAD\n name\n previewImage {\n data {\n attributes {\n url\n }\n }\n }\n missionStatus\n slug\n }\n }\n }\n }\n"]; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/frontend/src/__generated__/graphql.ts b/frontend/src/__generated__/graphql.ts index 5c51fce..6215b0b 100644 --- a/frontend/src/__generated__/graphql.ts +++ b/frontend/src/__generated__/graphql.ts @@ -166,110 +166,6 @@ export type BooleanFilterInput = { startsWith?: InputMaybe; }; -export type ContentReleasesRelease = { - __typename?: 'ContentReleasesRelease'; - actions?: Maybe; - createdAt?: Maybe; - name: Scalars['String']['output']; - releasedAt?: Maybe; - updatedAt?: Maybe; -}; - - -export type ContentReleasesReleaseActionsArgs = { - filters?: InputMaybe; - pagination?: InputMaybe; - sort?: InputMaybe>>; -}; - -export type ContentReleasesReleaseAction = { - __typename?: 'ContentReleasesReleaseAction'; - contentType: Scalars['String']['output']; - createdAt?: Maybe; - entry?: Maybe; - locale?: Maybe; - release?: Maybe; - type: Enum_Contentreleasesreleaseaction_Type; - updatedAt?: Maybe; -}; - -export type ContentReleasesReleaseActionEntity = { - __typename?: 'ContentReleasesReleaseActionEntity'; - attributes?: Maybe; - id?: Maybe; -}; - -export type ContentReleasesReleaseActionEntityResponse = { - __typename?: 'ContentReleasesReleaseActionEntityResponse'; - data?: Maybe; -}; - -export type ContentReleasesReleaseActionEntityResponseCollection = { - __typename?: 'ContentReleasesReleaseActionEntityResponseCollection'; - data: Array; - meta: ResponseCollectionMeta; -}; - -export type ContentReleasesReleaseActionFiltersInput = { - and?: InputMaybe>>; - contentType?: InputMaybe; - createdAt?: InputMaybe; - id?: InputMaybe; - locale?: InputMaybe; - not?: InputMaybe; - or?: InputMaybe>>; - release?: InputMaybe; - type?: InputMaybe; - updatedAt?: InputMaybe; -}; - -export type ContentReleasesReleaseActionInput = { - contentType?: InputMaybe; - locale?: InputMaybe; - release?: InputMaybe; - type?: InputMaybe; -}; - -export type ContentReleasesReleaseActionRelationResponseCollection = { - __typename?: 'ContentReleasesReleaseActionRelationResponseCollection'; - data: Array; -}; - -export type ContentReleasesReleaseEntity = { - __typename?: 'ContentReleasesReleaseEntity'; - attributes?: Maybe; - id?: Maybe; -}; - -export type ContentReleasesReleaseEntityResponse = { - __typename?: 'ContentReleasesReleaseEntityResponse'; - data?: Maybe; -}; - -export type ContentReleasesReleaseEntityResponseCollection = { - __typename?: 'ContentReleasesReleaseEntityResponseCollection'; - data: Array; - meta: ResponseCollectionMeta; -}; - -export type ContentReleasesReleaseFiltersInput = { - actions?: InputMaybe; - and?: InputMaybe>>; - createdAt?: InputMaybe; - id?: InputMaybe; - name?: InputMaybe; - not?: InputMaybe; - or?: InputMaybe>>; - releasedAt?: InputMaybe; - updatedAt?: InputMaybe; -}; - -export type ContentReleasesReleaseInput = { - actions?: InputMaybe>>; - name?: InputMaybe; - releasedAt?: InputMaybe; -}; - export type DateFilterInput = { and?: InputMaybe>>; between?: InputMaybe>>; @@ -326,11 +222,6 @@ export enum Enum_Article_Tag { Updates = 'Updates' } -export enum Enum_Contentreleasesreleaseaction_Type { - Publish = 'publish', - Unpublish = 'unpublish' -} - export type FileInfoInput = { alternativeText?: InputMaybe; caption?: InputMaybe; @@ -362,12 +253,12 @@ export type FloatFilterInput = { startsWith?: InputMaybe; }; -export type GenericMorph = Article | Author | ContentReleasesRelease | ContentReleasesReleaseAction | Hero | I18NLocale | MostRecentImage | Project | Satellite | UploadFile | UploadFolder | UsersPermissionsPermission | UsersPermissionsRole | UsersPermissionsUser; +export type GenericMorph = Article | Author | Hero | I18NLocale | MostRecentImage | Project | Satellite | UploadFile | UploadFolder | UsersPermissionsPermission | UsersPermissionsRole | UsersPermissionsUser; export type Hero = { __typename?: 'Hero'; createdAt?: Maybe; - image?: Maybe; + image: UploadFileEntityResponse; publishedAt?: Maybe; text?: Maybe; updatedAt?: Maybe; @@ -555,8 +446,6 @@ export type Mutation = { changePassword?: Maybe; createArticle?: Maybe; createAuthor?: Maybe; - createContentReleasesRelease?: Maybe; - createContentReleasesReleaseAction?: Maybe; createMostRecentImage?: Maybe; createProject?: Maybe; createSatellite?: Maybe; @@ -568,8 +457,6 @@ export type Mutation = { createUsersPermissionsUser: UsersPermissionsUserEntityResponse; deleteArticle?: Maybe; deleteAuthor?: Maybe; - deleteContentReleasesRelease?: Maybe; - deleteContentReleasesReleaseAction?: Maybe; deleteHero?: Maybe; deleteMostRecentImage?: Maybe; deleteProject?: Maybe; @@ -593,8 +480,6 @@ export type Mutation = { resetPassword?: Maybe; updateArticle?: Maybe; updateAuthor?: Maybe; - updateContentReleasesRelease?: Maybe; - updateContentReleasesReleaseAction?: Maybe; updateFileInfo: UploadFileEntityResponse; updateHero?: Maybe; updateMostRecentImage?: Maybe; @@ -627,16 +512,6 @@ export type MutationCreateAuthorArgs = { }; -export type MutationCreateContentReleasesReleaseArgs = { - data: ContentReleasesReleaseInput; -}; - - -export type MutationCreateContentReleasesReleaseActionArgs = { - data: ContentReleasesReleaseActionInput; -}; - - export type MutationCreateMostRecentImageArgs = { data: MostRecentImageInput; }; @@ -682,16 +557,6 @@ export type MutationDeleteAuthorArgs = { }; -export type MutationDeleteContentReleasesReleaseArgs = { - id: Scalars['ID']['input']; -}; - - -export type MutationDeleteContentReleasesReleaseActionArgs = { - id: Scalars['ID']['input']; -}; - - export type MutationDeleteMostRecentImageArgs = { id: Scalars['ID']['input']; }; @@ -779,18 +644,6 @@ export type MutationUpdateAuthorArgs = { }; -export type MutationUpdateContentReleasesReleaseArgs = { - data: ContentReleasesReleaseInput; - id: Scalars['ID']['input']; -}; - - -export type MutationUpdateContentReleasesReleaseActionArgs = { - data: ContentReleasesReleaseActionInput; - id: Scalars['ID']['input']; -}; - - export type MutationUpdateFileInfoArgs = { id: Scalars['ID']['input']; info?: InputMaybe; @@ -943,10 +796,6 @@ export type Query = { articles?: Maybe; author?: Maybe; authors?: Maybe; - contentReleasesRelease?: Maybe; - contentReleasesReleaseAction?: Maybe; - contentReleasesReleaseActions?: Maybe; - contentReleasesReleases?: Maybe; hero?: Maybe; i18NLocale?: Maybe; i18NLocales?: Maybe; @@ -994,30 +843,6 @@ export type QueryAuthorsArgs = { }; -export type QueryContentReleasesReleaseArgs = { - id?: InputMaybe; -}; - - -export type QueryContentReleasesReleaseActionArgs = { - id?: InputMaybe; -}; - - -export type QueryContentReleasesReleaseActionsArgs = { - filters?: InputMaybe; - pagination?: InputMaybe; - sort?: InputMaybe>>; -}; - - -export type QueryContentReleasesReleasesArgs = { - filters?: InputMaybe; - pagination?: InputMaybe; - sort?: InputMaybe>>; -}; - - export type QueryHeroArgs = { publicationState?: InputMaybe; }; @@ -1138,6 +963,7 @@ export type Satellite = { previewImage?: Maybe; projects?: Maybe; publishedAt?: Maybe; + slug: Scalars['String']['output']; updatedAt?: Maybe; }; @@ -1188,6 +1014,7 @@ export type SatelliteFiltersInput = { or?: InputMaybe>>; projects?: InputMaybe; publishedAt?: InputMaybe; + slug?: InputMaybe; updatedAt?: InputMaybe; }; @@ -1201,6 +1028,7 @@ export type SatelliteInput = { previewImage?: InputMaybe; projects?: InputMaybe>>; publishedAt?: InputMaybe; + slug?: InputMaybe; }; export type SatelliteRelationResponseCollection = { @@ -1628,14 +1456,14 @@ export type Get_ProjectsQuery = { __typename?: 'Query', projects?: { __typename? export type Get_SatellitesQueryVariables = Exact<{ [key: string]: never; }>; -export type Get_SatellitesQuery = { __typename?: 'Query', satellites?: { __typename?: 'SatelliteEntityResponseCollection', data: Array<{ __typename?: 'SatelliteEntity', id?: string | null, attributes?: { __typename?: 'Satellite', celestrakURL?: string | null, catalogNumberNORAD?: string | null, name: string, missionStatus?: string | null, previewImage?: { __typename?: 'UploadFileEntityResponse', data?: { __typename?: 'UploadFileEntity', attributes?: { __typename?: 'UploadFile', url: string } | null } | null } | null } | null }> } | null }; +export type Get_SatellitesQuery = { __typename?: 'Query', satellites?: { __typename?: 'SatelliteEntityResponseCollection', data: Array<{ __typename?: 'SatelliteEntity', id?: string | null, attributes?: { __typename?: 'Satellite', celestrakURL?: string | null, catalogNumberNORAD?: string | null, name: string, missionStatus?: string | null, slug: string, previewImage?: { __typename?: 'UploadFileEntityResponse', data?: { __typename?: 'UploadFileEntity', attributes?: { __typename?: 'UploadFile', url: string } | null } | null } | null } | null }> } | null }; export type QueryQueryVariables = Exact<{ publicationState?: InputMaybe; }>; -export type QueryQuery = { __typename?: 'Query', hero?: { __typename?: 'HeroEntityResponse', data?: { __typename?: 'HeroEntity', attributes?: { __typename?: 'Hero', text?: string | null, image?: { __typename?: 'UploadFileEntityResponse', data?: { __typename?: 'UploadFileEntity', attributes?: { __typename?: 'UploadFile', url: string } | null } | null } | null } | null } | null } | null }; +export type QueryQuery = { __typename?: 'Query', hero?: { __typename?: 'HeroEntityResponse', data?: { __typename?: 'HeroEntity', attributes?: { __typename?: 'Hero', text?: string | null, image: { __typename?: 'UploadFileEntityResponse', data?: { __typename?: 'UploadFileEntity', attributes?: { __typename?: 'UploadFile', url: string } | null } | null } } | null } | null } | null }; export type Get_ArticlesQueryVariables = Exact<{ pagination?: InputMaybe; @@ -1661,7 +1489,7 @@ export type Get_Satellite_InfoQuery = { __typename?: 'Query', satellites?: { __t export const ArticleWithSlugDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ArticleWithSlug"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"articlesFilters"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ArticleFiltersInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"articles"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"articlesFilters"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"body"}},{"kind":"Field","name":{"kind":"Name","value":"coverImage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"datePublished"}},{"kind":"Field","name":{"kind":"Name","value":"previewCardTitle"}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const ProjectsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Projects"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"projectFilters"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ProjectFiltersInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"projects"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"projectFilters"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"satellites"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"previewImage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"previewImage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const Get_ProjectsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GET_PROJECTS"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"projects"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"sort"},"value":{"kind":"ListValue","values":[{"kind":"StringValue","value":"publishedAt:desc","block":false}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"satellites"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"catalogNumberNORAD"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"previewImage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const Get_SatellitesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GET_SATELLITES"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"satellites"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"celestrakURL"}},{"kind":"Field","name":{"kind":"Name","value":"catalogNumberNORAD"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"previewImage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"missionStatus"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const Get_SatellitesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GET_SATELLITES"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"satellites"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"celestrakURL"}},{"kind":"Field","name":{"kind":"Name","value":"catalogNumberNORAD"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"previewImage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"missionStatus"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const QueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Query"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"publicationState"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PublicationState"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hero"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"publicationState"},"value":{"kind":"Variable","name":{"kind":"Name","value":"publicationState"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"image"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const Get_ArticlesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GET_ARTICLES"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pagination"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PaginationArg"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ArticleFiltersInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"articles"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"sort"},"value":{"kind":"ListValue","values":[{"kind":"StringValue","value":"datePublished:desc","block":false}]}},{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pagination"}}},{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"previewCardTitle"}},{"kind":"Field","name":{"kind":"Name","value":"datePublished"}},{"kind":"Field","name":{"kind":"Name","value":"body"}},{"kind":"Field","name":{"kind":"Name","value":"coverImage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"publishedAt"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"Tag"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"meta"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pagination"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"total"}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const MostRecentImagesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"MostRecentImages"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"mostRecentImages"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"sort"},"value":{"kind":"ListValue","values":[{"kind":"StringValue","value":"publishedAt:desc","block":false}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"mostRecentImage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"satellite"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attributes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"catalogNumberNORAD"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"publishedAt"}}]}}]}}]}}]}}]} as unknown as DocumentNode; diff --git a/frontend/src/app/satellites/[satelliteSlug]/page.tsx b/frontend/src/app/satellites/[satelliteSlug]/page.tsx index f90bfce..1c69542 100644 --- a/frontend/src/app/satellites/[satelliteSlug]/page.tsx +++ b/frontend/src/app/satellites/[satelliteSlug]/page.tsx @@ -4,15 +4,8 @@ import fetchSatelliteInfo from "@/lib/data/fetchSatelliteInfo"; import { BlocksContent } from "@strapi/blocks-react-renderer"; import RelatedProjectsAndSatellites from "@/components/RelatedProjectsAndSatellites"; import Map2d from "@/components/2dmap/Map2d"; -import { useSatelliteStore } from "@/lib/store"; import SatelliteDataHome from "@/components/satelliteData/SatelliteDataHome"; -function setSelectedSatelliteSlug(satelliteSlug: string) { - const setSelectedSatellite = - useSatelliteStore.getState().setSelectedSatellite; - setSelectedSatellite(satelliteSlug); -} - export interface SatelliteInfo { name: string; content: BlocksContent; @@ -32,7 +25,6 @@ export default async function SatelliteInfoPage({ }: { params: { satelliteSlug: string }; }) { - setSelectedSatelliteSlug(params.satelliteSlug); const satelliteInfo: SatelliteInfo = await fetchSatelliteInfo({ params: params, }); diff --git a/frontend/src/app/satellites/page.tsx b/frontend/src/app/satellites/page.tsx index eae274a..9cf1870 100644 --- a/frontend/src/app/satellites/page.tsx +++ b/frontend/src/app/satellites/page.tsx @@ -18,6 +18,7 @@ query GET_SATELLITES { } } missionStatus + slug } } } @@ -54,6 +55,7 @@ export default async function Satellites() { ); }, diff --git a/frontend/src/components/satelliteData/SatelliteStatsTableRow.tsx b/frontend/src/components/satelliteData/SatelliteStatsTableRow.tsx index b2678bf..29c5750 100644 --- a/frontend/src/components/satelliteData/SatelliteStatsTableRow.tsx +++ b/frontend/src/components/satelliteData/SatelliteStatsTableRow.tsx @@ -8,8 +8,10 @@ const updateInterval = 10; export default function SatelliteStatsTableRow({ satName, + slug, }: { satName: string; + slug: string; }) { const { satelliteData, fetchAndSetSatelliteData } = useSatelliteStore(); const [satelliteInfo, setSatelliteInfo] = useState( @@ -51,27 +53,27 @@ export default function SatelliteStatsTableRow({ return ( - + {satName} - + {satelliteInfo.velocity + " km/s"} - + {satelliteInfo.altitude + " km"} - + {satelliteInfo.latitudeDeg + "° N"} - + {satelliteInfo.longitudeDeg + "° E"} diff --git a/frontend/src/lib/data/fetchSatelliteInfo.ts b/frontend/src/lib/data/fetchSatelliteInfo.ts index 788c828..b4d7399 100644 --- a/frontend/src/lib/data/fetchSatelliteInfo.ts +++ b/frontend/src/lib/data/fetchSatelliteInfo.ts @@ -45,7 +45,7 @@ export default async function fetchSatelliteInfo({ let satelliteInfo: SatelliteInfo; const filters = { - name: { + slug: { eq: params.satelliteSlug, }, };