From 6aaf3823bced0ce5ebb6cd9b643ebcea1bc9f50b Mon Sep 17 00:00:00 2001 From: Cesar Varela Date: Thu, 19 Dec 2024 13:31:11 -0300 Subject: [PATCH] Add created_at field to incidents and promoted submissions --- site/gatsby-site/server/fields/submissions.ts | 1 + site/gatsby-site/server/generated/graphql.ts | 5 +++++ site/gatsby-site/server/types/incidents.ts | 2 ++ 3 files changed, 8 insertions(+) diff --git a/site/gatsby-site/server/fields/submissions.ts b/site/gatsby-site/server/fields/submissions.ts index d9a2f253ce..bc441fadad 100644 --- a/site/gatsby-site/server/fields/submissions.ts +++ b/site/gatsby-site/server/fields/submissions.ts @@ -108,6 +108,7 @@ export const mutationFields: GraphQLFieldConfigMap = { implicated_systems: submission.implicated_systems || [], editor_notes: submission.editor_notes ?? '', flagged_dissimilar_incidents: [], + created_at: new Date(), } if (submission.embedding) { newIncident.embedding = { diff --git a/site/gatsby-site/server/generated/graphql.ts b/site/gatsby-site/server/generated/graphql.ts index d2e5da2ed9..a7d4479751 100644 --- a/site/gatsby-site/server/generated/graphql.ts +++ b/site/gatsby-site/server/generated/graphql.ts @@ -1517,6 +1517,7 @@ export type Incident = { AllegedDeveloperOfAISystem?: Maybe>>; AllegedHarmedOrNearlyHarmedParties?: Maybe>>; _id?: Maybe; + created_at?: Maybe; date: Scalars['String']['output']; description?: Maybe; editor_dissimilar_incidents?: Maybe>>; @@ -1624,6 +1625,7 @@ export type IncidentFilterType = { NOR?: InputMaybe>>; OR?: InputMaybe>>; _id?: InputMaybe; + created_at?: InputMaybe; date?: InputMaybe; description?: InputMaybe; editor_dissimilar_incidents?: InputMaybe; @@ -1654,6 +1656,7 @@ export type IncidentInsertType = { AllegedDeveloperOfAISystem?: InputMaybe; AllegedHarmedOrNearlyHarmedParties?: InputMaybe; _id?: InputMaybe; + created_at?: InputMaybe; date: Scalars['String']['input']; description?: InputMaybe; editor_dissimilar_incidents?: InputMaybe>>; @@ -1835,6 +1838,7 @@ export type IncidentSetType = { AllegedDeveloperOfAISystem?: InputMaybe; AllegedHarmedOrNearlyHarmedParties?: InputMaybe; _id?: InputMaybe; + created_at?: InputMaybe; date?: InputMaybe; description?: InputMaybe; editor_dissimilar_incidents?: InputMaybe>>; @@ -1871,6 +1875,7 @@ export enum IncidentSortByInput { export type IncidentSortType = { _id?: InputMaybe; + created_at?: InputMaybe; date?: InputMaybe; description?: InputMaybe; editor_notes?: InputMaybe; diff --git a/site/gatsby-site/server/types/incidents.ts b/site/gatsby-site/server/types/incidents.ts index f91bb0a708..f14ee7fd15 100644 --- a/site/gatsby-site/server/types/incidents.ts +++ b/site/gatsby-site/server/types/incidents.ts @@ -5,6 +5,7 @@ import { getListRelationshipConfig, getListRelationshipExtension, getListRelatio import { UserType } from "./user"; import { IncidentEmbeddingType, NlpSimilarIncidentType, TsneType } from "./types"; import { ReportType } from "./report"; +import { GraphQLDateTime } from "graphql-scalars"; export const IncidentType = new GraphQLObjectType({ name: 'Incident', @@ -49,6 +50,7 @@ export const IncidentType = new GraphQLObjectType({ nlp_similar_incidents: { type: new GraphQLList(NlpSimilarIncidentType) }, reports: getListRelationshipConfig(ReportType, GraphQLInt, 'reports', 'report_number', 'reports', 'aiidprod'), tsne: { type: TsneType }, + created_at: { type: GraphQLDateTime }, }, });