diff --git a/nextjs/src/__generated__/gql.ts b/nextjs/src/__generated__/gql.ts index ad5f55218..08ed80c91 100644 --- a/nextjs/src/__generated__/gql.ts +++ b/nextjs/src/__generated__/gql.ts @@ -13,8 +13,8 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/ * Therefore it is highly recommended to use the babel or swc plugin for production. */ const documents = { - "\n query Example {\n organisations {\n id\n name\n }\n }\n": types.ExampleDocument, "\n mutation Verify($token: String!) {\n verifyAccount(token: $token) {\n errors\n success\n }\n }\n": types.VerifyDocument, + "\n query Example {\n organisations {\n id\n name\n }\n }\n": types.ExampleDocument, "\n query ListExternalDataSources {\n externalDataSources {\n id\n name\n connectionDetails {\n crmType: __typename\n }\n autoUpdateEnabled\n jobs {\n lastEventAt\n status\n }\n updateMapping {\n source\n sourcePath\n destinationColumn\n }\n }\n }\n": types.ListExternalDataSourcesDocument, "\n query GetSourceMapping($ID: ID!) {\n externalDataSource(pk: $ID) {\n id\n autoUpdateEnabled\n updateMapping {\n destinationColumn\n source\n sourcePath\n }\n geographyColumn\n geographyColumnType\n }\n }\n": types.GetSourceMappingDocument, "\n query TestAirtableSource(\n $apiKey: String!\n $baseId: String!\n $tableId: String!\n ) {\n testAirtableSource(apiKey: $apiKey, baseId: $baseId, tableId: $tableId)\n }\n": types.TestAirtableSourceDocument, @@ -23,6 +23,7 @@ const documents = { "\n query AutoUpdateCreationReview($ID: ID!) {\n externalDataSource(pk: $ID) {\n id\n name\n connectionDetails {\n crmType: __typename\n }\n autoUpdateEnabled\n updateMapping {\n source\n sourcePath\n destinationColumn\n }\n jobs {\n lastEventAt\n status\n }\n }\n }\n": types.AutoUpdateCreationReviewDocument, "\n query ExternalDataSourceInspectPage($ID: ID!) {\n externalDataSource(pk: $ID) {\n id\n name\n connectionDetails {\n crmType: __typename\n ... on AirtableSource {\n baseId\n tableId\n apiKey\n }\n }\n autoUpdateEnabled\n webhookHealthcheck\n geographyColumn\n geographyColumnType\n jobs {\n status\n id\n taskName\n args\n lastEventAt\n }\n updateMapping {\n source\n sourcePath\n destinationColumn\n }\n }\n }\n": types.ExternalDataSourceInspectPageDocument, "\n mutation DeleteUpdateConfig($id: String!) {\n deleteExternalDataSource(data: { id: $id }) {\n id\n }\n }\n": types.DeleteUpdateConfigDocument, + "\n query ExternalDataSourceName($externalDataSourceId: ID!) {\n externalDataSource(pk: $externalDataSourceId) {\n name\n }\n }\n": types.ExternalDataSourceNameDocument, "\n mutation Login($username: String!, $password: String!) {\n tokenAuth(username: $username, password: $password) {\n errors\n success\n token {\n token\n payload {\n exp\n }\n }\n }\n }\n": types.LoginDocument, "\n mutation Register($email: String!, $password1: String!, $password2: String!, $username: String!) {\n register(email: $email, password1: $password1, password2: $password2, username: $username) {\n errors\n success\n }\n }\n": types.RegisterDocument, "\n mutation AutoUpdateWebhookRefresh($ID: String!) {\n refreshWebhooks(externalDataSourceId: $ID) {\n id\n webhookHealthcheck\n }\n }\n": types.AutoUpdateWebhookRefreshDocument, @@ -55,11 +56,11 @@ export function gql(source: string): unknown; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function gql(source: "\n query Example {\n organisations {\n id\n name\n }\n }\n"): (typeof documents)["\n query Example {\n organisations {\n id\n name\n }\n }\n"]; +export function gql(source: "\n mutation Verify($token: String!) {\n verifyAccount(token: $token) {\n errors\n success\n }\n }\n"): (typeof documents)["\n mutation Verify($token: String!) {\n verifyAccount(token: $token) {\n errors\n success\n }\n }\n"]; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function gql(source: "\n mutation Verify($token: String!) {\n verifyAccount(token: $token) {\n errors\n success\n }\n }\n"): (typeof documents)["\n mutation Verify($token: String!) {\n verifyAccount(token: $token) {\n errors\n success\n }\n }\n"]; +export function gql(source: "\n query Example {\n organisations {\n id\n name\n }\n }\n"): (typeof documents)["\n query Example {\n organisations {\n id\n name\n }\n }\n"]; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ @@ -92,6 +93,10 @@ export function gql(source: "\n query ExternalDataSourceInspectPage($ID: ID!) { * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql(source: "\n mutation DeleteUpdateConfig($id: String!) {\n deleteExternalDataSource(data: { id: $id }) {\n id\n }\n }\n"): (typeof documents)["\n mutation DeleteUpdateConfig($id: String!) {\n deleteExternalDataSource(data: { id: $id }) {\n id\n }\n }\n"]; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql(source: "\n query ExternalDataSourceName($externalDataSourceId: ID!) {\n externalDataSource(pk: $externalDataSourceId) {\n name\n }\n }\n"): (typeof documents)["\n query ExternalDataSourceName($externalDataSourceId: ID!) {\n externalDataSource(pk: $externalDataSourceId) {\n name\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/nextjs/src/__generated__/graphql.ts b/nextjs/src/__generated__/graphql.ts index 56fe5b23a..7ae50ea51 100644 --- a/nextjs/src/__generated__/graphql.ts +++ b/nextjs/src/__generated__/graphql.ts @@ -653,11 +653,6 @@ export type UserType = { verified: Scalars['Boolean']['output']; }; -export type ExampleQueryVariables = Exact<{ [key: string]: never; }>; - - -export type ExampleQuery = { __typename?: 'Query', organisations: Array<{ __typename?: 'Organisation', id: string, name: string }> }; - export type VerifyMutationVariables = Exact<{ token: Scalars['String']['input']; }>; @@ -665,6 +660,11 @@ export type VerifyMutationVariables = Exact<{ export type VerifyMutation = { __typename?: 'Mutation', verifyAccount: { __typename?: 'MutationNormalOutput', errors?: any | null, success: boolean } }; +export type ExampleQueryVariables = Exact<{ [key: string]: never; }>; + + +export type ExampleQuery = { __typename?: 'Query', organisations: Array<{ __typename?: 'Organisation', id: string, name: string }> }; + export type ListExternalDataSourcesQueryVariables = Exact<{ [key: string]: never; }>; @@ -719,6 +719,13 @@ export type DeleteUpdateConfigMutationVariables = Exact<{ export type DeleteUpdateConfigMutation = { __typename?: 'Mutation', deleteExternalDataSource: { __typename?: 'ExternalDataSource', id: any } }; +export type ExternalDataSourceNameQueryVariables = Exact<{ + externalDataSourceId: Scalars['ID']['input']; +}>; + + +export type ExternalDataSourceNameQuery = { __typename?: 'Query', externalDataSource: { __typename?: 'ExternalDataSource', name: string } }; + export type LoginMutationVariables = Exact<{ username: Scalars['String']['input']; password: Scalars['String']['input']; @@ -808,8 +815,8 @@ export type PublicUserQuery = { __typename?: 'Query', publicUser?: { __typename? export const AutoUpdateCardFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutoUpdateCardFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ExternalDataSource"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"connectionDetails"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmType"},"name":{"kind":"Name","value":"__typename"}}]}},{"kind":"Field","name":{"kind":"Name","value":"autoUpdateEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"updateMapping"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"source"}},{"kind":"Field","name":{"kind":"Name","value":"sourcePath"}},{"kind":"Field","name":{"kind":"Name","value":"destinationColumn"}}]}},{"kind":"Field","name":{"kind":"Name","value":"jobs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lastEventAt"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}}]} as unknown as DocumentNode; export const ExternalDataSourceCardFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ExternalDataSourceCardFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ExternalDataSource"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"connectionDetails"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmType"},"name":{"kind":"Name","value":"__typename"}}]}}]}}]} as unknown as DocumentNode; -export const ExampleDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Example"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"organisations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const VerifyDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"Verify"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"token"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"verifyAccount"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"token"},"value":{"kind":"Variable","name":{"kind":"Name","value":"token"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"errors"}},{"kind":"Field","name":{"kind":"Name","value":"success"}}]}}]}}]} as unknown as DocumentNode; +export const ExampleDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Example"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"organisations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const ListExternalDataSourcesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListExternalDataSources"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"externalDataSources"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"connectionDetails"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmType"},"name":{"kind":"Name","value":"__typename"}}]}},{"kind":"Field","name":{"kind":"Name","value":"autoUpdateEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"jobs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lastEventAt"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}},{"kind":"Field","name":{"kind":"Name","value":"updateMapping"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"source"}},{"kind":"Field","name":{"kind":"Name","value":"sourcePath"}},{"kind":"Field","name":{"kind":"Name","value":"destinationColumn"}}]}}]}}]}}]} as unknown as DocumentNode; export const GetSourceMappingDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSourceMapping"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"ID"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"externalDataSource"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pk"},"value":{"kind":"Variable","name":{"kind":"Name","value":"ID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"autoUpdateEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"updateMapping"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"destinationColumn"}},{"kind":"Field","name":{"kind":"Name","value":"source"}},{"kind":"Field","name":{"kind":"Name","value":"sourcePath"}}]}},{"kind":"Field","name":{"kind":"Name","value":"geographyColumn"}},{"kind":"Field","name":{"kind":"Name","value":"geographyColumnType"}}]}}]}}]} as unknown as DocumentNode; export const TestAirtableSourceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"TestAirtableSource"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"apiKey"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"baseId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"tableId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"testAirtableSource"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"apiKey"},"value":{"kind":"Variable","name":{"kind":"Name","value":"apiKey"}}},{"kind":"Argument","name":{"kind":"Name","value":"baseId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"baseId"}}},{"kind":"Argument","name":{"kind":"Name","value":"tableId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"tableId"}}}]}]}}]} as unknown as DocumentNode; @@ -818,6 +825,7 @@ export const AllExternalDataSourcesDocument = {"kind":"Document","definitions":[ export const AutoUpdateCreationReviewDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"AutoUpdateCreationReview"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"ID"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"externalDataSource"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pk"},"value":{"kind":"Variable","name":{"kind":"Name","value":"ID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"connectionDetails"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmType"},"name":{"kind":"Name","value":"__typename"}}]}},{"kind":"Field","name":{"kind":"Name","value":"autoUpdateEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"updateMapping"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"source"}},{"kind":"Field","name":{"kind":"Name","value":"sourcePath"}},{"kind":"Field","name":{"kind":"Name","value":"destinationColumn"}}]}},{"kind":"Field","name":{"kind":"Name","value":"jobs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lastEventAt"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}}]}}]} as unknown as DocumentNode; export const ExternalDataSourceInspectPageDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ExternalDataSourceInspectPage"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"ID"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"externalDataSource"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pk"},"value":{"kind":"Variable","name":{"kind":"Name","value":"ID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"connectionDetails"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmType"},"name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AirtableSource"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"baseId"}},{"kind":"Field","name":{"kind":"Name","value":"tableId"}},{"kind":"Field","name":{"kind":"Name","value":"apiKey"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"autoUpdateEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"webhookHealthcheck"}},{"kind":"Field","name":{"kind":"Name","value":"geographyColumn"}},{"kind":"Field","name":{"kind":"Name","value":"geographyColumnType"}},{"kind":"Field","name":{"kind":"Name","value":"jobs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"taskName"}},{"kind":"Field","name":{"kind":"Name","value":"args"}},{"kind":"Field","name":{"kind":"Name","value":"lastEventAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"updateMapping"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"source"}},{"kind":"Field","name":{"kind":"Name","value":"sourcePath"}},{"kind":"Field","name":{"kind":"Name","value":"destinationColumn"}}]}}]}}]}}]} as unknown as DocumentNode; export const DeleteUpdateConfigDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteUpdateConfig"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteExternalDataSource"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode; +export const ExternalDataSourceNameDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ExternalDataSourceName"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"externalDataSourceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"externalDataSource"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pk"},"value":{"kind":"Variable","name":{"kind":"Name","value":"externalDataSourceId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const LoginDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"Login"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"username"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"password"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"tokenAuth"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"username"},"value":{"kind":"Variable","name":{"kind":"Name","value":"username"}}},{"kind":"Argument","name":{"kind":"Name","value":"password"},"value":{"kind":"Variable","name":{"kind":"Name","value":"password"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"errors"}},{"kind":"Field","name":{"kind":"Name","value":"success"}},{"kind":"Field","name":{"kind":"Name","value":"token"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"token"}},{"kind":"Field","name":{"kind":"Name","value":"payload"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"exp"}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const RegisterDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"Register"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"email"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"password1"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"password2"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"username"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"register"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"email"},"value":{"kind":"Variable","name":{"kind":"Name","value":"email"}}},{"kind":"Argument","name":{"kind":"Name","value":"password1"},"value":{"kind":"Variable","name":{"kind":"Name","value":"password1"}}},{"kind":"Argument","name":{"kind":"Name","value":"password2"},"value":{"kind":"Variable","name":{"kind":"Name","value":"password2"}}},{"kind":"Argument","name":{"kind":"Name","value":"username"},"value":{"kind":"Variable","name":{"kind":"Name","value":"username"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"errors"}},{"kind":"Field","name":{"kind":"Name","value":"success"}}]}}]}}]} as unknown as DocumentNode; export const AutoUpdateWebhookRefreshDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"AutoUpdateWebhookRefresh"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"ID"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"refreshWebhooks"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"externalDataSourceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"ID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"webhookHealthcheck"}}]}}]}}]} as unknown as DocumentNode; diff --git a/nextjs/src/app/account/data-table.tsx b/nextjs/src/app/account/data-table.tsx deleted file mode 100644 index b588e08c8..000000000 --- a/nextjs/src/app/account/data-table.tsx +++ /dev/null @@ -1,46 +0,0 @@ -"use client"; - -import { gql } from "@apollo/client"; -import { useQuery } from "@apollo/experimental-nextjs-app-support/ssr"; - -const EXAMPLE_QUERY = gql` - query Example { - organisations { - id - name - } - } -` - -export default function DataTable() { - const { data, error, loading } = useQuery(EXAMPLE_QUERY); - - if (error) { - return

Error: {String(error)}

; - } - - if (loading) { - return

Loading...

; - } - - const orgs = data?.organisations || []; - - return ( - - - - - - - - - {orgs.map((a: { id: string, name: string }) => ( - - - - - ))} - -
IDName
{a.id}{a.name}
- ) -} diff --git a/nextjs/src/app/account/page.tsx b/nextjs/src/app/account/page.tsx index 07922997b..e91712397 100644 --- a/nextjs/src/app/account/page.tsx +++ b/nextjs/src/app/account/page.tsx @@ -1,5 +1,6 @@ +import { Metadata } from "next"; import { useRequireAuth } from "../../hooks/auth"; -import DataTable from "./data-table"; +import YourOrganisations from "./your-organisations"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" export default async function Account() { @@ -12,7 +13,7 @@ export default async function Account() { Account Information - Table + Your organisations
@@ -27,12 +28,14 @@ export default async function Account() {
- Change your password here. - - - + +
); } + +export const metadata: Metadata = { + title: "Your Account", +}; \ No newline at end of file diff --git a/nextjs/src/app/account/your-organisations.tsx b/nextjs/src/app/account/your-organisations.tsx new file mode 100644 index 000000000..0b6b6f391 --- /dev/null +++ b/nextjs/src/app/account/your-organisations.tsx @@ -0,0 +1,37 @@ +"use client"; + +import { gql } from "@apollo/client"; +import { useQuery } from "@apollo/experimental-nextjs-app-support/ssr"; + +const YOUR_ORGANISATIONS = gql` + query Example { + organisations { + id + name + } + } +` + +export default function YourOrganisations() { + const { data, error, loading } = useQuery(YOUR_ORGANISATIONS); + + if (error) { + return

Error: {String(error)}

; + } + + if (loading) { + return

Loading...

; + } + + const orgs = data?.organisations || []; + + return ( +
+ {orgs.map((a: { id: string, name: string }) => ( +
+ {a.name} +
+ ))} +
+ ) +} diff --git a/nextjs/src/app/data-sources/create-auto-update/layout.tsx b/nextjs/src/app/data-sources/create-auto-update/layout.tsx index bafabd24d..e7da817ff 100644 --- a/nextjs/src/app/data-sources/create-auto-update/layout.tsx +++ b/nextjs/src/app/data-sources/create-auto-update/layout.tsx @@ -1,6 +1,7 @@ import { useRequireAuth } from "@/hooks/auth"; import NewExternalDataSourceWrapper from "./NewExternalDataSourceWrapper"; +import { Metadata } from "next"; export default async function Layout({ children, @@ -13,3 +14,7 @@ export default async function Layout({ {children} ); } + +export const metadata: Metadata = { + title: "Connect New Data Source", +}; \ No newline at end of file diff --git a/nextjs/src/app/data-sources/inspect/[externalDataSourceId]/page.tsx b/nextjs/src/app/data-sources/inspect/[externalDataSourceId]/page.tsx index 1c89bef34..f07549159 100644 --- a/nextjs/src/app/data-sources/inspect/[externalDataSourceId]/page.tsx +++ b/nextjs/src/app/data-sources/inspect/[externalDataSourceId]/page.tsx @@ -1,10 +1,18 @@ import { useRequireAuth } from "@/hooks/auth"; import InspectExternalDataSource from "./InspectExternalDataSource"; +import { Metadata } from 'next' +import { getClient } from "@/services/apollo-client"; +import { gql } from "@apollo/client"; +import { ExternalDataSourceNameQuery, ExternalDataSourceNameQueryVariables } from "@/__generated__/graphql"; + +type Params = { + externalDataSourceId: string +} export default async function Page({ params: { externalDataSourceId }, }: { - params: { externalDataSourceId: string }; + params: Params; }) { await useRequireAuth(); @@ -14,3 +22,31 @@ export default async function Page({ /> ); } + +const EXTERNAL_DATA_SOURCE_NAME = gql` + query ExternalDataSourceName($externalDataSourceId: ID!) { + externalDataSource(pk: $externalDataSourceId) { + name + } + } +`; + +export async function generateMetadata({ params: { externalDataSourceId } }: { params: Params }): Promise { + try { + const client = getClient(); + const query = await client.query({ + query: EXTERNAL_DATA_SOURCE_NAME, + variables: { + externalDataSourceId, + } + }) + + return { + title: query.data.externalDataSource.name, + } + } catch (e) { + return { + title: "Data Source", + } + } +} \ No newline at end of file diff --git a/nextjs/src/app/data-sources/page.tsx b/nextjs/src/app/data-sources/page.tsx index 64b7bc2e5..22cc7ded9 100644 --- a/nextjs/src/app/data-sources/page.tsx +++ b/nextjs/src/app/data-sources/page.tsx @@ -1,8 +1,13 @@ import { useRequireAuth } from "@/hooks/auth"; import ExternalDataSourceUpdates from "./ExternalDataSourceUpdates"; +import { Metadata } from "next"; export default async function Page() { await useRequireAuth(); return ; } + +export const metadata: Metadata = { + title: "Your Data Sources", +}; \ No newline at end of file diff --git a/nextjs/src/app/layout.tsx b/nextjs/src/app/layout.tsx index c06213f50..5b81e50fe 100644 --- a/nextjs/src/app/layout.tsx +++ b/nextjs/src/app/layout.tsx @@ -13,6 +13,7 @@ import Footer from "@/components/footer"; import Navbar from "@/components/navbar"; import { AreaPattern } from "@/components/areaPattern"; +import { Metadata } from 'next' function MappedIcon() { @@ -57,3 +58,10 @@ export default async function RootLayout({ ); } + +export const metadata: Metadata = { + title: { + template: '%s | Mapped by CK', + default: 'Mapped by Common Knowledge', // a default is required when creating a template + }, +} \ No newline at end of file diff --git a/nextjs/src/app/login/page.tsx b/nextjs/src/app/login/page.tsx index d3f657d20..34f24e8db 100644 --- a/nextjs/src/app/login/page.tsx +++ b/nextjs/src/app/login/page.tsx @@ -2,6 +2,7 @@ import { Button } from "@/components/ui/button"; import { useRequireNoAuth } from "../../hooks/auth"; import LoginForm from "./login-form"; import Link from "next/link"; +import { Metadata } from "next"; // This has been split into a two components to separate the client-side (LoginForm) // and the server side (this component), which allows using useRequireNoAuth() here @@ -22,3 +23,7 @@ export default async function Login() { ); } + +export const metadata: Metadata = { + title: "Login", +}; \ No newline at end of file diff --git a/nextjs/src/app/logout/page.tsx b/nextjs/src/app/logout/page.tsx index 22b5ecb09..6ea295bb1 100644 --- a/nextjs/src/app/logout/page.tsx +++ b/nextjs/src/app/logout/page.tsx @@ -1,3 +1,4 @@ +import { Metadata } from "next"; import { useRequireAuth } from "../../hooks/auth"; import LogoutForm from "./logout-form"; @@ -8,3 +9,7 @@ export default async function Logout() { return ; } + +export const metadata: Metadata = { + title: "Logout", +}; \ No newline at end of file diff --git a/nextjs/src/app/reports/page.tsx b/nextjs/src/app/reports/page.tsx index 638ccb575..de4938b50 100644 --- a/nextjs/src/app/reports/page.tsx +++ b/nextjs/src/app/reports/page.tsx @@ -9,6 +9,7 @@ import { CardTitle, } from "@/components/ui/card" import { Button, buttonVariants } from "@/components/ui/button" +import { Metadata } from 'next'; export default function Report() { @@ -56,3 +57,7 @@ function PageHeader() { ); } + +export const metadata: Metadata = { + title: "Reports", +}; \ No newline at end of file diff --git a/nextjs/src/app/signup/page.tsx b/nextjs/src/app/signup/page.tsx index 06dbb16c9..0429dcd3c 100644 --- a/nextjs/src/app/signup/page.tsx +++ b/nextjs/src/app/signup/page.tsx @@ -2,6 +2,7 @@ import { Button } from "@/components/ui/button"; import { useRequireNoAuth } from "../../hooks/auth"; import RegisterForm from "./register-form"; import Link from "next/link"; +import { Metadata } from "next"; // This has been split into a two components to separate the client-side (RegisterForm) // and the server side (this component), which allows using useRequireNoAuth() here @@ -22,3 +23,7 @@ export default async function Login() { ); } + +export const metadata: Metadata = { + title: "Signup", +}; \ No newline at end of file