From 65ee294b905942c39d78e0277b9c5e4e300db2ac Mon Sep 17 00:00:00 2001 From: Arbyhisenaj <41119392+Arbyhisenaj@users.noreply.github.com> Date: Thu, 16 Jan 2025 17:31:41 +0000 Subject: [PATCH] Experiment(Area + Record Explorer) --- nextjs/src/__generated__/gql.ts | 9 +- nextjs/src/__generated__/graphql.ts | 14 +- nextjs/src/app/globals.css | 12 +- .../(components)/dashboard/TableDisplay.tsx | 7 - .../(components)/explorer/AreaExplorer.tsx | 147 ++++++++--- .../(components)/explorer/RecordExplorer.tsx | 240 ++++++++++-------- 6 files changed, 262 insertions(+), 167 deletions(-) diff --git a/nextjs/src/__generated__/gql.ts b/nextjs/src/__generated__/gql.ts index 4fd8bdbbf..0e8ade26e 100644 --- a/nextjs/src/__generated__/gql.ts +++ b/nextjs/src/__generated__/gql.ts @@ -56,9 +56,8 @@ const documents = { "\n query GetEventData($eventId: String!, $hostname: String!) {\n importedDataGeojsonPoint(genericDataId: $eventId) {\n properties {\n ...EventFragment\n constituency: area(areaType: \"WMC23\") {\n ...ConstituencyViewFragment\n # List of events\n genericDataForHub(hostname: $hostname) {\n ...EventFragment\n }\n }\n }\n }\n }\n \n \n": types.GetEventDataDocument, "\n query GetPage($hostname: String!, $path: String) {\n hubPageByPath(hostname: $hostname, path: $path) {\n id\n title\n path\n puckJsonContent\n seoTitle\n searchDescription\n hub {\n faviconUrl\n seoTitle\n seoImageUrl\n searchDescription\n primaryColour\n secondaryColour\n customCss\n navLinks {\n link\n label\n }\n }\n }\n }\n": types.GetPageDocument, "\n query GetMemberList($currentOrganisationId: ID!) {\n myOrganisations(filters: { id: $currentOrganisationId }) {\n externalDataSources {\n id\n name\n importedDataCount\n crmType\n dataType\n }\n sharingPermissionsFromOtherOrgs {\n externalDataSource {\n id\n name\n importedDataCount\n crmType\n dataType\n organisation {\n name\n }\n }\n }\n }\n }\n": types.GetMemberListDocument, - "\n query ConstituencyStatsOverview(\n $reportID: ID!\n $analyticalAreaType: AnalyticalAreaType!\n $layerIds: [String!]!\n ) {\n mapReport(pk: $reportID) {\n id\n importedDataCountByConstituency: importedDataCountByArea(\n analyticalAreaType: $analyticalAreaType\n layerIds: $layerIds\n ) {\n label\n gss\n count\n gssArea {\n id\n name\n fitBounds\n mp: person(filters: { personType: \"MP\" }) {\n id\n name\n photo {\n url\n }\n party: personDatum(filters: { dataType_Name: \"party\" }) {\n name: data\n }\n }\n lastElection {\n stats {\n date\n majority\n electorate\n firstPartyResult {\n party\n shade\n votes\n }\n secondPartyResult {\n party\n shade\n votes\n }\n }\n }\n }\n }\n }\n }\n": types.ConstituencyStatsOverviewDocument, "\n query AreaExplorerSummary($gss: String!) {\n area(gss: $gss) {\n id\n fitBounds\n name\n areaType {\n name\n description\n }\n samplePostcode {\n parliamentaryConstituency2024\n adminWard\n adminDistrict\n europeanElectoralRegion\n codes {\n adminWard\n adminDistrict\n parliamentaryConstituency2024\n }\n }\n }\n }\n": types.AreaExplorerSummaryDocument, - "\n query AreaLayerData($gss: String!, $externalDataSource: String!) {\n # collect point data\n points: genericDataFromSourceAboutArea(\n gss: $gss\n sourceId: $externalDataSource\n ) {\n json\n }\n # rolled up area data up to this GSS code\n summary: genericDataSummaryFromSourceAboutArea(\n gss: $gss\n sourceId: $externalDataSource\n points: false\n ) {\n aggregated\n metadata {\n first\n second\n third\n last\n total\n count\n mean\n median\n }\n }\n # for specific pieces of data for this GSS code\n row: genericDataSummaryFromSourceAboutArea(\n gss: $gss\n sourceId: $externalDataSource\n rollup: false\n points: false\n ) {\n aggregated\n metadata {\n first\n second\n third\n last\n total\n count\n mean\n median\n }\n }\n }\n": types.AreaLayerDataDocument, + "\n query AreaLayerData($gss: String!, $externalDataSource: String!) {\n # collect point data\n points: genericDataFromSourceAboutArea(\n gss: $gss\n sourceId: $externalDataSource\n ) {\n json\n id\n startTime\n postcode\n date\n description\n fullName\n lastName\n firstName\n title\n publicUrl\n }\n # rolled up area data up to this GSS code\n summary: genericDataSummaryFromSourceAboutArea(\n gss: $gss\n sourceId: $externalDataSource\n points: false\n ) {\n aggregated\n metadata {\n first\n second\n third\n last\n total\n count\n mean\n median\n }\n }\n # for specific pieces of data for this GSS code\n row: genericDataSummaryFromSourceAboutArea(\n gss: $gss\n sourceId: $externalDataSource\n rollup: false\n points: false\n ) {\n aggregated\n metadata {\n first\n second\n third\n last\n total\n count\n mean\n median\n }\n }\n }\n": types.AreaLayerDataDocument, "\n query RecordExplorerSummary($id: String!) {\n import: importedDataGeojsonPoint(genericDataId: $id) {\n id\n geometry {\n type\n coordinates\n }\n record: properties {\n id\n dataType {\n id\n name\n dataSet {\n id\n externalDataSource {\n id\n name\n organisation {\n id\n name\n }\n crmType\n dataType\n }\n }\n }\n postcode\n postcodeData {\n adminWard\n adminDistrict\n europeanElectoralRegion\n codes {\n adminWard\n adminDistrict\n }\n }\n title\n firstName\n lastName\n fullName\n email\n phone\n startTime\n endTime\n publicUrl\n address\n description\n json\n remoteUrl\n }\n }\n }\n": types.RecordExplorerSummaryDocument, "\n query MapReportLayerGeoJSONPoint($genericDataId: String!) {\n importedDataGeojsonPoint(genericDataId: $genericDataId) {\n id\n type\n geometry {\n type\n coordinates\n }\n properties {\n id\n lastUpdate\n name\n phone\n email\n postcodeData {\n postcode\n }\n address\n json\n remoteUrl\n dataType {\n id\n dataSet {\n id\n externalDataSource {\n id\n name\n dataType\n }\n }\n }\n }\n }\n }\n": types.MapReportLayerGeoJsonPointDocument, "\n query MapReportLayerAnalytics($reportID: ID!) {\n mapReport(pk: $reportID) {\n id\n layers {\n id\n name\n mapboxPaint\n mapboxLayout\n source\n sourceData {\n id\n dataType\n organisation {\n name\n }\n }\n }\n }\n }\n": types.MapReportLayerAnalyticsDocument, @@ -276,10 +275,6 @@ export function gql(source: "\n query GetPage($hostname: String!, $path: String * 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 GetMemberList($currentOrganisationId: ID!) {\n myOrganisations(filters: { id: $currentOrganisationId }) {\n externalDataSources {\n id\n name\n importedDataCount\n crmType\n dataType\n }\n sharingPermissionsFromOtherOrgs {\n externalDataSource {\n id\n name\n importedDataCount\n crmType\n dataType\n organisation {\n name\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query GetMemberList($currentOrganisationId: ID!) {\n myOrganisations(filters: { id: $currentOrganisationId }) {\n externalDataSources {\n id\n name\n importedDataCount\n crmType\n dataType\n }\n sharingPermissionsFromOtherOrgs {\n externalDataSource {\n id\n name\n importedDataCount\n crmType\n dataType\n organisation {\n name\n }\n }\n }\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 ConstituencyStatsOverview(\n $reportID: ID!\n $analyticalAreaType: AnalyticalAreaType!\n $layerIds: [String!]!\n ) {\n mapReport(pk: $reportID) {\n id\n importedDataCountByConstituency: importedDataCountByArea(\n analyticalAreaType: $analyticalAreaType\n layerIds: $layerIds\n ) {\n label\n gss\n count\n gssArea {\n id\n name\n fitBounds\n mp: person(filters: { personType: \"MP\" }) {\n id\n name\n photo {\n url\n }\n party: personDatum(filters: { dataType_Name: \"party\" }) {\n name: data\n }\n }\n lastElection {\n stats {\n date\n majority\n electorate\n firstPartyResult {\n party\n shade\n votes\n }\n secondPartyResult {\n party\n shade\n votes\n }\n }\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query ConstituencyStatsOverview(\n $reportID: ID!\n $analyticalAreaType: AnalyticalAreaType!\n $layerIds: [String!]!\n ) {\n mapReport(pk: $reportID) {\n id\n importedDataCountByConstituency: importedDataCountByArea(\n analyticalAreaType: $analyticalAreaType\n layerIds: $layerIds\n ) {\n label\n gss\n count\n gssArea {\n id\n name\n fitBounds\n mp: person(filters: { personType: \"MP\" }) {\n id\n name\n photo {\n url\n }\n party: personDatum(filters: { dataType_Name: \"party\" }) {\n name: data\n }\n }\n lastElection {\n stats {\n date\n majority\n electorate\n firstPartyResult {\n party\n shade\n votes\n }\n secondPartyResult {\n party\n shade\n votes\n }\n }\n }\n }\n }\n }\n }\n"]; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ @@ -287,7 +282,7 @@ export function gql(source: "\n query AreaExplorerSummary($gss: String!) {\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 AreaLayerData($gss: String!, $externalDataSource: String!) {\n # collect point data\n points: genericDataFromSourceAboutArea(\n gss: $gss\n sourceId: $externalDataSource\n ) {\n json\n }\n # rolled up area data up to this GSS code\n summary: genericDataSummaryFromSourceAboutArea(\n gss: $gss\n sourceId: $externalDataSource\n points: false\n ) {\n aggregated\n metadata {\n first\n second\n third\n last\n total\n count\n mean\n median\n }\n }\n # for specific pieces of data for this GSS code\n row: genericDataSummaryFromSourceAboutArea(\n gss: $gss\n sourceId: $externalDataSource\n rollup: false\n points: false\n ) {\n aggregated\n metadata {\n first\n second\n third\n last\n total\n count\n mean\n median\n }\n }\n }\n"): (typeof documents)["\n query AreaLayerData($gss: String!, $externalDataSource: String!) {\n # collect point data\n points: genericDataFromSourceAboutArea(\n gss: $gss\n sourceId: $externalDataSource\n ) {\n json\n }\n # rolled up area data up to this GSS code\n summary: genericDataSummaryFromSourceAboutArea(\n gss: $gss\n sourceId: $externalDataSource\n points: false\n ) {\n aggregated\n metadata {\n first\n second\n third\n last\n total\n count\n mean\n median\n }\n }\n # for specific pieces of data for this GSS code\n row: genericDataSummaryFromSourceAboutArea(\n gss: $gss\n sourceId: $externalDataSource\n rollup: false\n points: false\n ) {\n aggregated\n metadata {\n first\n second\n third\n last\n total\n count\n mean\n median\n }\n }\n }\n"]; +export function gql(source: "\n query AreaLayerData($gss: String!, $externalDataSource: String!) {\n # collect point data\n points: genericDataFromSourceAboutArea(\n gss: $gss\n sourceId: $externalDataSource\n ) {\n json\n id\n startTime\n postcode\n date\n description\n fullName\n lastName\n firstName\n title\n publicUrl\n }\n # rolled up area data up to this GSS code\n summary: genericDataSummaryFromSourceAboutArea(\n gss: $gss\n sourceId: $externalDataSource\n points: false\n ) {\n aggregated\n metadata {\n first\n second\n third\n last\n total\n count\n mean\n median\n }\n }\n # for specific pieces of data for this GSS code\n row: genericDataSummaryFromSourceAboutArea(\n gss: $gss\n sourceId: $externalDataSource\n rollup: false\n points: false\n ) {\n aggregated\n metadata {\n first\n second\n third\n last\n total\n count\n mean\n median\n }\n }\n }\n"): (typeof documents)["\n query AreaLayerData($gss: String!, $externalDataSource: String!) {\n # collect point data\n points: genericDataFromSourceAboutArea(\n gss: $gss\n sourceId: $externalDataSource\n ) {\n json\n id\n startTime\n postcode\n date\n description\n fullName\n lastName\n firstName\n title\n publicUrl\n }\n # rolled up area data up to this GSS code\n summary: genericDataSummaryFromSourceAboutArea(\n gss: $gss\n sourceId: $externalDataSource\n points: false\n ) {\n aggregated\n metadata {\n first\n second\n third\n last\n total\n count\n mean\n median\n }\n }\n # for specific pieces of data for this GSS code\n row: genericDataSummaryFromSourceAboutArea(\n gss: $gss\n sourceId: $externalDataSource\n rollup: false\n points: false\n ) {\n aggregated\n metadata {\n first\n second\n third\n last\n total\n count\n mean\n median\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/nextjs/src/__generated__/graphql.ts b/nextjs/src/__generated__/graphql.ts index 9b55a2092..f358c657f 100644 --- a/nextjs/src/__generated__/graphql.ts +++ b/nextjs/src/__generated__/graphql.ts @@ -3417,15 +3417,6 @@ export type GetMemberListQueryVariables = Exact<{ export type GetMemberListQuery = { __typename?: 'Query', myOrganisations: Array<{ __typename?: 'Organisation', externalDataSources: Array<{ __typename?: 'ExternalDataSource', id: any, name: string, importedDataCount: number, crmType: CrmType, dataType: DataSourceType }>, sharingPermissionsFromOtherOrgs: Array<{ __typename?: 'SharingPermission', externalDataSource: { __typename?: 'SharedDataSource', id: any, name: string, importedDataCount: number, crmType: CrmType, dataType: DataSourceType, organisation: { __typename?: 'PublicOrganisation', name: string } } }> }> }; -export type ConstituencyStatsOverviewQueryVariables = Exact<{ - reportID: Scalars['ID']['input']; - analyticalAreaType: AnalyticalAreaType; - layerIds: Array | Scalars['String']['input']; -}>; - - -export type ConstituencyStatsOverviewQuery = { __typename?: 'Query', mapReport: { __typename?: 'MapReport', id: any, importedDataCountByConstituency: Array<{ __typename?: 'GroupedDataCount', label?: string | null, gss?: string | null, count: number, gssArea?: { __typename?: 'Area', id: string, name: string, fitBounds?: any | null, mp?: { __typename?: 'Person', id: string, name: string, photo?: { __typename?: 'DjangoImageType', url: string } | null, party?: { __typename?: 'PersonData', name: string } | null } | null, lastElection?: { __typename?: 'ConstituencyElectionResult', stats: { __typename?: 'ConstituencyElectionStats', date: string, majority: number, electorate: number, firstPartyResult: { __typename?: 'PartyResult', party: string, shade: string, votes: number }, secondPartyResult: { __typename?: 'PartyResult', party: string, shade: string, votes: number } } } | null } | null }> } }; - export type AreaExplorerSummaryQueryVariables = Exact<{ gss: Scalars['String']['input']; }>; @@ -3439,7 +3430,7 @@ export type AreaLayerDataQueryVariables = Exact<{ }>; -export type AreaLayerDataQuery = { __typename?: 'Query', points: Array<{ __typename?: 'GenericData', json?: any | null }>, summary?: { __typename?: 'DataSummary', aggregated: any, metadata: { __typename?: 'DataSummaryMetadata', first?: number | null, second?: number | null, third?: number | null, last?: number | null, total?: number | null, count?: number | null, mean?: number | null, median?: number | null } } | null, row?: { __typename?: 'DataSummary', aggregated: any, metadata: { __typename?: 'DataSummaryMetadata', first?: number | null, second?: number | null, third?: number | null, last?: number | null, total?: number | null, count?: number | null, mean?: number | null, median?: number | null } } | null }; +export type AreaLayerDataQuery = { __typename?: 'Query', points: Array<{ __typename?: 'GenericData', json?: any | null, id: string, startTime?: any | null, postcode?: string | null, date?: any | null, description?: string | null, fullName?: string | null, lastName?: string | null, firstName?: string | null, title?: string | null, publicUrl?: string | null }>, summary?: { __typename?: 'DataSummary', aggregated: any, metadata: { __typename?: 'DataSummaryMetadata', first?: number | null, second?: number | null, third?: number | null, last?: number | null, total?: number | null, count?: number | null, mean?: number | null, median?: number | null } } | null, row?: { __typename?: 'DataSummary', aggregated: any, metadata: { __typename?: 'DataSummaryMetadata', first?: number | null, second?: number | null, third?: number | null, last?: number | null, total?: number | null, count?: number | null, mean?: number | null, median?: number | null } } | null }; export type RecordExplorerSummaryQueryVariables = Exact<{ id: Scalars['String']['input']; @@ -3711,9 +3702,8 @@ export const GetLocalDataDocument = {"kind":"Document","definitions":[{"kind":"O export const GetEventDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetEventData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"eventId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"hostname"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"importedDataGeojsonPoint"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"genericDataId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"eventId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EventFragment"}},{"kind":"Field","alias":{"kind":"Name","value":"constituency"},"name":{"kind":"Name","value":"area"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"areaType"},"value":{"kind":"StringValue","value":"WMC23","block":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ConstituencyViewFragment"}},{"kind":"Field","name":{"kind":"Name","value":"genericDataForHub"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"hostname"},"value":{"kind":"Variable","name":{"kind":"Name","value":"hostname"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EventFragment"}}]}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EventFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GenericData"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"postcode"}},{"kind":"Field","name":{"kind":"Name","value":"startTime"}},{"kind":"Field","name":{"kind":"Name","value":"publicUrl"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dataSet"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"externalDataSource"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"dataType"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ConstituencyViewFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Area"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"gss"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"fitBounds"}},{"kind":"Field","name":{"kind":"Name","value":"samplePostcode"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"postcode"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"mp"},"name":{"kind":"Name","value":"person"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"personType"},"value":{"kind":"StringValue","value":"MP","block":false}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"party"},"name":{"kind":"Name","value":"personDatum"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"dataType_Name"},"value":{"kind":"StringValue","value":"party","block":false}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"name"},"name":{"kind":"Name","value":"data"}},{"kind":"Field","name":{"kind":"Name","value":"shade"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"email"},"name":{"kind":"Name","value":"personDatum"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"dataType_Name"},"value":{"kind":"StringValue","value":"email","block":false}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"}}]}}]}},{"kind":"Field","alias":{"kind":"Name","value":"ppcs"},"name":{"kind":"Name","value":"people"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"personType"},"value":{"kind":"StringValue","value":"PPC","block":false}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"party"},"name":{"kind":"Name","value":"personDatum"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"dataType_Name"},"value":{"kind":"StringValue","value":"party","block":false}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"name"},"name":{"kind":"Name","value":"data"}},{"kind":"Field","name":{"kind":"Name","value":"shade"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"email"},"name":{"kind":"Name","value":"personDatum"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"dataType_Name"},"value":{"kind":"StringValue","value":"email","block":false}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"}}]}}]}}]}}]} as unknown as DocumentNode; export const GetPageDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetPage"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"hostname"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"path"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hubPageByPath"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"hostname"},"value":{"kind":"Variable","name":{"kind":"Name","value":"hostname"}}},{"kind":"Argument","name":{"kind":"Name","value":"path"},"value":{"kind":"Variable","name":{"kind":"Name","value":"path"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"path"}},{"kind":"Field","name":{"kind":"Name","value":"puckJsonContent"}},{"kind":"Field","name":{"kind":"Name","value":"seoTitle"}},{"kind":"Field","name":{"kind":"Name","value":"searchDescription"}},{"kind":"Field","name":{"kind":"Name","value":"hub"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"faviconUrl"}},{"kind":"Field","name":{"kind":"Name","value":"seoTitle"}},{"kind":"Field","name":{"kind":"Name","value":"seoImageUrl"}},{"kind":"Field","name":{"kind":"Name","value":"searchDescription"}},{"kind":"Field","name":{"kind":"Name","value":"primaryColour"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryColour"}},{"kind":"Field","name":{"kind":"Name","value":"customCss"}},{"kind":"Field","name":{"kind":"Name","value":"navLinks"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"link"}},{"kind":"Field","name":{"kind":"Name","value":"label"}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const GetMemberListDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetMemberList"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentOrganisationId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"myOrganisations"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentOrganisationId"}}}]}}],"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":"importedDataCount"}},{"kind":"Field","name":{"kind":"Name","value":"crmType"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}}]}},{"kind":"Field","name":{"kind":"Name","value":"sharingPermissionsFromOtherOrgs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","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":"importedDataCount"}},{"kind":"Field","name":{"kind":"Name","value":"crmType"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"organisation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const ConstituencyStatsOverviewDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ConstituencyStatsOverview"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"reportID"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"analyticalAreaType"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"AnalyticalAreaType"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"layerIds"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"mapReport"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pk"},"value":{"kind":"Variable","name":{"kind":"Name","value":"reportID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"importedDataCountByConstituency"},"name":{"kind":"Name","value":"importedDataCountByArea"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"analyticalAreaType"},"value":{"kind":"Variable","name":{"kind":"Name","value":"analyticalAreaType"}}},{"kind":"Argument","name":{"kind":"Name","value":"layerIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"layerIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"gss"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"gssArea"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"fitBounds"}},{"kind":"Field","alias":{"kind":"Name","value":"mp"},"name":{"kind":"Name","value":"person"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"personType"},"value":{"kind":"StringValue","value":"MP","block":false}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"party"},"name":{"kind":"Name","value":"personDatum"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"dataType_Name"},"value":{"kind":"StringValue","value":"party","block":false}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"name"},"name":{"kind":"Name","value":"data"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"lastElection"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stats"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"majority"}},{"kind":"Field","name":{"kind":"Name","value":"electorate"}},{"kind":"Field","name":{"kind":"Name","value":"firstPartyResult"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"party"}},{"kind":"Field","name":{"kind":"Name","value":"shade"}},{"kind":"Field","name":{"kind":"Name","value":"votes"}}]}},{"kind":"Field","name":{"kind":"Name","value":"secondPartyResult"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"party"}},{"kind":"Field","name":{"kind":"Name","value":"shade"}},{"kind":"Field","name":{"kind":"Name","value":"votes"}}]}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const AreaExplorerSummaryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"AreaExplorerSummary"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"gss"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"area"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"gss"},"value":{"kind":"Variable","name":{"kind":"Name","value":"gss"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fitBounds"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"areaType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}}]}},{"kind":"Field","name":{"kind":"Name","value":"samplePostcode"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"parliamentaryConstituency2024"}},{"kind":"Field","name":{"kind":"Name","value":"adminWard"}},{"kind":"Field","name":{"kind":"Name","value":"adminDistrict"}},{"kind":"Field","name":{"kind":"Name","value":"europeanElectoralRegion"}},{"kind":"Field","name":{"kind":"Name","value":"codes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"adminWard"}},{"kind":"Field","name":{"kind":"Name","value":"adminDistrict"}},{"kind":"Field","name":{"kind":"Name","value":"parliamentaryConstituency2024"}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const AreaLayerDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"AreaLayerData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"gss"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"externalDataSource"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"points"},"name":{"kind":"Name","value":"genericDataFromSourceAboutArea"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"gss"},"value":{"kind":"Variable","name":{"kind":"Name","value":"gss"}}},{"kind":"Argument","name":{"kind":"Name","value":"sourceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"externalDataSource"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"json"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"summary"},"name":{"kind":"Name","value":"genericDataSummaryFromSourceAboutArea"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"gss"},"value":{"kind":"Variable","name":{"kind":"Name","value":"gss"}}},{"kind":"Argument","name":{"kind":"Name","value":"sourceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"externalDataSource"}}},{"kind":"Argument","name":{"kind":"Name","value":"points"},"value":{"kind":"BooleanValue","value":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"aggregated"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"first"}},{"kind":"Field","name":{"kind":"Name","value":"second"}},{"kind":"Field","name":{"kind":"Name","value":"third"}},{"kind":"Field","name":{"kind":"Name","value":"last"}},{"kind":"Field","name":{"kind":"Name","value":"total"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"mean"}},{"kind":"Field","name":{"kind":"Name","value":"median"}}]}}]}},{"kind":"Field","alias":{"kind":"Name","value":"row"},"name":{"kind":"Name","value":"genericDataSummaryFromSourceAboutArea"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"gss"},"value":{"kind":"Variable","name":{"kind":"Name","value":"gss"}}},{"kind":"Argument","name":{"kind":"Name","value":"sourceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"externalDataSource"}}},{"kind":"Argument","name":{"kind":"Name","value":"rollup"},"value":{"kind":"BooleanValue","value":false}},{"kind":"Argument","name":{"kind":"Name","value":"points"},"value":{"kind":"BooleanValue","value":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"aggregated"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"first"}},{"kind":"Field","name":{"kind":"Name","value":"second"}},{"kind":"Field","name":{"kind":"Name","value":"third"}},{"kind":"Field","name":{"kind":"Name","value":"last"}},{"kind":"Field","name":{"kind":"Name","value":"total"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"mean"}},{"kind":"Field","name":{"kind":"Name","value":"median"}}]}}]}}]}}]} as unknown as DocumentNode; +export const AreaLayerDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"AreaLayerData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"gss"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"externalDataSource"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"points"},"name":{"kind":"Name","value":"genericDataFromSourceAboutArea"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"gss"},"value":{"kind":"Variable","name":{"kind":"Name","value":"gss"}}},{"kind":"Argument","name":{"kind":"Name","value":"sourceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"externalDataSource"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"json"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"startTime"}},{"kind":"Field","name":{"kind":"Name","value":"postcode"}},{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"fullName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"publicUrl"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"summary"},"name":{"kind":"Name","value":"genericDataSummaryFromSourceAboutArea"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"gss"},"value":{"kind":"Variable","name":{"kind":"Name","value":"gss"}}},{"kind":"Argument","name":{"kind":"Name","value":"sourceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"externalDataSource"}}},{"kind":"Argument","name":{"kind":"Name","value":"points"},"value":{"kind":"BooleanValue","value":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"aggregated"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"first"}},{"kind":"Field","name":{"kind":"Name","value":"second"}},{"kind":"Field","name":{"kind":"Name","value":"third"}},{"kind":"Field","name":{"kind":"Name","value":"last"}},{"kind":"Field","name":{"kind":"Name","value":"total"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"mean"}},{"kind":"Field","name":{"kind":"Name","value":"median"}}]}}]}},{"kind":"Field","alias":{"kind":"Name","value":"row"},"name":{"kind":"Name","value":"genericDataSummaryFromSourceAboutArea"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"gss"},"value":{"kind":"Variable","name":{"kind":"Name","value":"gss"}}},{"kind":"Argument","name":{"kind":"Name","value":"sourceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"externalDataSource"}}},{"kind":"Argument","name":{"kind":"Name","value":"rollup"},"value":{"kind":"BooleanValue","value":false}},{"kind":"Argument","name":{"kind":"Name","value":"points"},"value":{"kind":"BooleanValue","value":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"aggregated"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"first"}},{"kind":"Field","name":{"kind":"Name","value":"second"}},{"kind":"Field","name":{"kind":"Name","value":"third"}},{"kind":"Field","name":{"kind":"Name","value":"last"}},{"kind":"Field","name":{"kind":"Name","value":"total"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"mean"}},{"kind":"Field","name":{"kind":"Name","value":"median"}}]}}]}}]}}]} as unknown as DocumentNode; export const RecordExplorerSummaryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"RecordExplorerSummary"},"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","alias":{"kind":"Name","value":"import"},"name":{"kind":"Name","value":"importedDataGeojsonPoint"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"genericDataId"},"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":"geometry"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"coordinates"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"record"},"name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"dataSet"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","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":"organisation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"crmType"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"postcode"}},{"kind":"Field","name":{"kind":"Name","value":"postcodeData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"adminWard"}},{"kind":"Field","name":{"kind":"Name","value":"adminDistrict"}},{"kind":"Field","name":{"kind":"Name","value":"europeanElectoralRegion"}},{"kind":"Field","name":{"kind":"Name","value":"codes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"adminWard"}},{"kind":"Field","name":{"kind":"Name","value":"adminDistrict"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"fullName"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"phone"}},{"kind":"Field","name":{"kind":"Name","value":"startTime"}},{"kind":"Field","name":{"kind":"Name","value":"endTime"}},{"kind":"Field","name":{"kind":"Name","value":"publicUrl"}},{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"json"}},{"kind":"Field","name":{"kind":"Name","value":"remoteUrl"}}]}}]}}]}}]} as unknown as DocumentNode; export const MapReportLayerGeoJsonPointDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"MapReportLayerGeoJSONPoint"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"genericDataId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"importedDataGeojsonPoint"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"genericDataId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"genericDataId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"geometry"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"coordinates"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"lastUpdate"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"phone"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"postcodeData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"postcode"}}]}},{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"json"}},{"kind":"Field","name":{"kind":"Name","value":"remoteUrl"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dataSet"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","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":"dataType"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const MapReportLayerAnalyticsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"MapReportLayerAnalytics"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"reportID"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"mapReport"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pk"},"value":{"kind":"Variable","name":{"kind":"Name","value":"reportID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"layers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"mapboxPaint"}},{"kind":"Field","name":{"kind":"Name","value":"mapboxLayout"}},{"kind":"Field","name":{"kind":"Name","value":"source"}},{"kind":"Field","name":{"kind":"Name","value":"sourceData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"organisation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; diff --git a/nextjs/src/app/globals.css b/nextjs/src/app/globals.css index 6c2dba607..c4208ab10 100644 --- a/nextjs/src/app/globals.css +++ b/nextjs/src/app/globals.css @@ -104,7 +104,7 @@ --input: var(--meep-gray-600); --ring: 222.2 84% 4.9%; --radius: 0.5rem; - --sidebar-background: 0 0% 98%; + --sidebar-background: var(--meep-gray-600); --sidebar-foreground: 240 5.3% 26.1%; --sidebar-primary: 240 5.9% 10%; --sidebar-primary-foreground: 0 0% 98%; @@ -358,3 +358,13 @@ height: 0; } } + +@layer utilities { + .no-scrollbar::-webkit-scrollbar { + display: none; + } + .no-scrollbar { + -ms-overflow-style: none; + scrollbar-width: none; + } +} diff --git a/nextjs/src/app/reports/[id]/(components)/dashboard/TableDisplay.tsx b/nextjs/src/app/reports/[id]/(components)/dashboard/TableDisplay.tsx index 4356d085d..dea051f18 100644 --- a/nextjs/src/app/reports/[id]/(components)/dashboard/TableDisplay.tsx +++ b/nextjs/src/app/reports/[id]/(components)/dashboard/TableDisplay.tsx @@ -44,14 +44,11 @@ export function TableDisplay({ const [_, setExplorerState] = useExplorerState() const cols: string[] = useMemo(() => { - console.log('Raw data:', data) const columns = config?.columns || allKeysFromAllData(data) - console.log('Generated columns:', columns) return columns }, [config, data]) const dataTableColumns = useMemo(() => { - console.log('Creating table columns from:', cols) if (cols.length === 0) { const firstItem = data[0] if (firstItem) { @@ -91,10 +88,6 @@ export function TableDisplay({
{table.getRowModel().rows.map((row) => { - console.log( - 'Row cells:', - row.getVisibleCells().map((cell) => cell.column.id) - ) const nameCell = row .getVisibleCells() .find( diff --git a/nextjs/src/app/reports/[id]/(components)/explorer/AreaExplorer.tsx b/nextjs/src/app/reports/[id]/(components)/explorer/AreaExplorer.tsx index d8d4caa38..125719692 100644 --- a/nextjs/src/app/reports/[id]/(components)/explorer/AreaExplorer.tsx +++ b/nextjs/src/app/reports/[id]/(components)/explorer/AreaExplorer.tsx @@ -82,7 +82,7 @@ export function AreaExplorer({ gss }: { gss: string }) { } return ( - + <> @@ -271,8 +271,9 @@ function AreaLayerData({ /> ) : ( p.json)} + data={data.data?.points} config={layer.inspectorConfig} + dataType={layer.sourceData.dataType} /> )}
@@ -298,7 +299,15 @@ const AREA_LAYER_DATA = gql` ) { json id + startTime postcode + date + description + fullName + lastName + firstName + title + publicUrl } # rolled up area data up to this GSS code summary: genericDataSummaryFromSourceAboutArea( @@ -478,15 +487,96 @@ function BigNumberDisplay({ function ListDisplay({ data, config, + dataType, }: { data: AreaLayerDataQuery['points'] config: { columns: string[] } + dataType: DataSourceType }) { + function getListValuesBasedOnDataType(item: any) { + type ListValues = { + primary: string[] + secondary: string[] + } + + switch (dataType) { + case DataSourceType.Member: + return { + primary: [item.firstName || item.lastName || item.fullName], + secondary: [item.postcode], + } satisfies ListValues + case DataSourceType.Event: { + return { + primary: [item.title], + secondary: [item.startTime || item.date || item.postcode], + } satisfies ListValues + } + case DataSourceType.Group: { + return { + primary: [item.name], + secondary: [item.date], + } satisfies ListValues + } + case DataSourceType.AreaStats: { + return { + primary: [item.name], + secondary: [item.date], + } satisfies ListValues + } + case DataSourceType.Location: { + return { + primary: [item.name], + secondary: [item.date], + } satisfies ListValues + } + case DataSourceType.Other: { + return { + primary: [item.name], + secondary: [item.date], + } satisfies ListValues + } + case DataSourceType.Story: { + return { + primary: [item.name], + secondary: [item.date], + } satisfies ListValues + } + } + } + + const [explorerState, setExplorerState] = useExplorerState() + return ( - // Display a simple table of the data using ShadCDN - null +
+ {data?.map((item: any) => { + const { primary, secondary } = getListValuesBasedOnDataType(item) + const isActive = + explorerState.entity === 'record' && explorerState.id === item.id + + return ( +
{ + setExplorerState({ + entity: 'record', + id: item.id, + showExplorer: true, + }) + }} + > +
{primary}
+
+ {secondary} +
+
+ ) + })} +
) } @@ -567,31 +657,30 @@ function AreaExplorerBreadcrumbs({ return ( - - {activeBreadcrumbs.map( - (crumb, index) => - crumb.value && ( - - - - handleBreadcrumbClick({ - value: crumb.value, - code: crumb.code || '', - type: crumb.type, - }) - } - > - {crumb.value} - - - - - ) - )} -
- {selectedAreaType ? pluralize(selectedAreaType, 1) : 'Area'} + +
+ {activeBreadcrumbs.map((crumb, index) => ( + + + + handleBreadcrumbClick({ + value: crumb.value, + code: crumb.code || '', + type: crumb.type, + }) + } + > + {crumb.value} + + + + + ))} +
+ {selectedAreaType ? pluralize(selectedAreaType, 1) : 'Area'} +
diff --git a/nextjs/src/app/reports/[id]/(components)/explorer/RecordExplorer.tsx b/nextjs/src/app/reports/[id]/(components)/explorer/RecordExplorer.tsx index 887b7a540..55b5c6e65 100644 --- a/nextjs/src/app/reports/[id]/(components)/explorer/RecordExplorer.tsx +++ b/nextjs/src/app/reports/[id]/(components)/explorer/RecordExplorer.tsx @@ -6,6 +6,7 @@ import { DataSourceIcon } from '@/components/DataSourceIcon' import { Button } from '@/components/ui/button' import { SidebarContent, SidebarHeader } from '@/components/ui/sidebar' import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' +import { dataTypeIcons } from '@/lib/data' import { ExplorerState, StarredState, @@ -20,6 +21,7 @@ import { useEffect, useState } from 'react' import { toast } from 'sonner' import { useReport } from '../ReportProvider' import { PropertiesDisplay } from '../dashboard/PropertiesDisplay' +import { AreaExplorer } from './AreaExplorer' import { exploreArea } from './utils' export function RecordExplorer({ id }: { id: string }) { @@ -110,125 +112,141 @@ export function RecordExplorer({ id }: { id: string }) { } } + const dataType = record?.dataType.dataSet.externalDataSource.dataType + const IconComponent = dataType ? dataTypeIcons[dataType]?.icon : null + return ( - - - <> -
- {record?.dataType.dataSet.externalDataSource.dataType - ? pluralize( - record?.dataType.dataSet.externalDataSource.dataType, - 1 - ) - : 'Record'} -
-
- {data.loading ? ( - Loading... - ) : data.error || !record ? ( - ??? - ) : ( -
-
- - {record.title || - record.fullName || - `${record.firstName} ${record.lastName}`} - -
- - -
-
- {record.postcodeData && ( -
- in{' '} - - - exploreArea(record.postcodeData?.codes.adminWard!) - } - > - {record.postcodeData.adminWard} - - ,{' '} - - exploreArea(record.postcodeData?.codes.adminDistrict!) - } - > - {record.postcodeData.adminDistrict} - - ,{' '} - {record.postcodeData.europeanElectoralRegion} +
+ + + <> +
+ {IconComponent && ( + + )} + {record?.dataType.dataSet.externalDataSource.dataType + ? pluralize( + record?.dataType.dataSet.externalDataSource.dataType, + 1 + ) + : 'Record'} +
+
+ {data.loading ? ( + Loading... + ) : data.error || !record ? ( + ??? + ) : ( +
+
+ + {record.title || + record.fullName || + `${record.firstName} ${record.lastName}`} +
+ + +
- )} -
- )} -
- -
- - - - Summary - - - + in{' '} + + + exploreArea(record.postcodeData?.codes.adminWard!) + } + > + {record.postcodeData.adminWard} + + ,{' '} + + exploreArea( + record.postcodeData?.codes.adminDistrict! + ) + } + > + {record.postcodeData.adminDistrict} + + ,{' '} + + {record.postcodeData.europeanElectoralRegion} + + +
+ )} +
+ )} +
+ + + - {/* Contact deets */} - {!!contactOptions.length && ( + + + Summary + + + + {/* Contact deets */} + {!!contactOptions.length && ( +
+
Contact
+
+ {contactOptions.map((contact, i) => ( + + ))} +
+
+ )} + + {/* Raw data */}
-
Contact
+
Info
- {contactOptions.map((contact, i) => ( - - ))} +
- )} - - {/* Raw data */} -
-
Info
-
- -
-
-
-
- + + + + +
) function copyUrl() {