From e3695ccf1d7cfee8cbb4c379645c7739ad6dd089 Mon Sep 17 00:00:00 2001 From: Rob Donigian Date: Fri, 20 Dec 2024 12:47:01 -0500 Subject: [PATCH] created aiAssist types --- .../EngagementDataGrid/EngagementColumns.tsx | 16 +++++++++++++--- .../EditEngagement/EditEngagementDialog.tsx | 6 ++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/components/EngagementDataGrid/EngagementColumns.tsx b/src/components/EngagementDataGrid/EngagementColumns.tsx index 24381aa72..3885a9259 100644 --- a/src/components/EngagementDataGrid/EngagementColumns.tsx +++ b/src/components/EngagementDataGrid/EngagementColumns.tsx @@ -8,8 +8,6 @@ import { } from '@mui/x-data-grid-pro'; import { EngagementFilters } from '~/api/schema.graphql'; import { - AIAssistList, - AIAssistTypeLabels, EngagementStatusLabels, EngagementStatusList, ProgressReportStatusLabels, @@ -37,6 +35,14 @@ import { SensitivityColumn } from '../ProjectDataGrid'; import { Link } from '../Routing'; import { EngagementDataGridRowFragment as Engagement } from './engagementDataGridRow.graphql'; +export const AIAssistList: ReadonlyArray = [true, false, null]; + +export const AIAssistTypeLabels: Readonly> = { + true: `true`, + false: `false`, + null: `null`, +}; + export const EngagementColumns: Array> = [ { headerName: 'Project', @@ -102,7 +108,11 @@ export const EngagementColumns: Array> = [ ), valueGetter: (_, row) => row.__typename === 'LanguageEngagement' - ? row.usingAIAssistedTranslation.value + ? row.usingAIAssistedTranslation.value === null + ? 'Unknown' + : row.usingAIAssistedTranslation.value + ? 'Yes' + : 'No' : null, }, { diff --git a/src/scenes/Engagement/EditEngagement/EditEngagementDialog.tsx b/src/scenes/Engagement/EditEngagement/EditEngagementDialog.tsx index 9d1211838..dd92c83a4 100644 --- a/src/scenes/Engagement/EditEngagement/EditEngagementDialog.tsx +++ b/src/scenes/Engagement/EditEngagement/EditEngagementDialog.tsx @@ -6,8 +6,6 @@ import { ComponentType, useMemo } from 'react'; import { Except, Merge } from 'type-fest'; import { invalidateProps } from '~/api'; import { - AIAssistList, - AIAssistTypeLabels, InternshipDomainLabels, InternshipPositionLabels, InternshipProgramLabels, @@ -20,6 +18,10 @@ import { labelFrom, MethodologyToApproach, } from '~/common'; +import { + AIAssistList, + AIAssistTypeLabels, +} from '~/components/EngagementDataGrid'; import { DialogForm, DialogFormProps,