Skip to content

Commit

Permalink
feat: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andresgutgon committed Sep 20, 2024
1 parent 92fbc32 commit d938d13
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function ChartWrapper({
return (
<div
className={cn(
'h-[192px] min-w-[300px] flex-1 rounded-lg flex flex-col gap-2 p-2 overflow-hidden border',
'h-[202px] min-w-[300px] flex-1 rounded-lg flex flex-col gap-2 p-2 overflow-hidden border',
{
'border-border': !error,
'border-destructive': !!error,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ export function EvaluationResultsCharts({
evaluation: Evaluation
documentUuid: string
}) {
if (evaluation.configuration.type === EvaluationResultableType.Number) {
return (
<NumericalCharts evaluation={evaluation} documentUuid={documentUuid} />
)
}
const isNumerical =
evaluation.configuration.type === EvaluationResultableType.Number

return null
if (!isNumerical) return null

return <NumericalCharts evaluation={evaluation} documentUuid={documentUuid} />
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Commit, Evaluation, Workspace } from '@latitude-data/core/browser'

import { BigNumberPanels } from './BigNumberPanels'
import { BigNumberPanelsOld } from './BigNumberPanelsOld'
import { EvaluationResultsCharts } from './Charts'

export function MetricsSummary({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ReactNode, Suspense } from 'react'

import { EvaluationResultableType } from '@latitude-data/core/browser'
import { EvaluationsRepository } from '@latitude-data/core/repositories'
import { computeEvaluationResultsWithMetadata } from '@latitude-data/core/services/evaluationResults/computeEvaluationResultsWithMetadata'
import { TableWithHeader, Text } from '@latitude-data/web-ui'
Expand All @@ -13,6 +14,11 @@ import { Actions } from './_components/Actions'
import { EvaluationResults } from './_components/EvaluationResults'
import { MetricsSummary } from './_components/MetricsSummary'

const TYPE_TEXT: Record<EvaluationResultableType, string> = {
[EvaluationResultableType.Text]: 'Text',
[EvaluationResultableType.Number]: 'Numerical',
[EvaluationResultableType.Boolean]: 'Boolean',
}
export default async function ConnectedEvaluationLayout({
params,
children,
Expand Down Expand Up @@ -66,7 +72,16 @@ export default async function ConnectedEvaluationLayout({
/>
),
},
{ name: <Text.H5M>{evaluation.name}</Text.H5M> },
{
name: (
<div className='flex flex-row items-center gap-x-4'>
<Text.H4M>{evaluation.name}</Text.H4M>
<Text.H4M color='foregroundMuted'>
{TYPE_TEXT[evaluation.configuration.type]}
</Text.H4M>
</div>
),
},
]}
/>
}
Expand All @@ -86,8 +101,6 @@ export default async function ConnectedEvaluationLayout({
commit={commit}
evaluation={evaluation}
documentUuid={params.documentUuid}
// TODO: Remove decouple from evaluationResults
evaluationResults={evaluationResults}
/>
</Suspense>
<EvaluationResults
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/BreadcrumbLink/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function BreadcrumbLink({
return (
<Link href={href} className='flex flex-row items-center gap-2'>
{showBackIcon && <Icon name='chevronLeft' color='foregroundMuted' />}
<Text.H5 color='foregroundMuted'>{name}</Text.H5>
<Text.H4M color='foregroundMuted'>{name}</Text.H4M>
</Link>
)
}

0 comments on commit d938d13

Please sign in to comment.