@@ -43,12 +43,14 @@ import InformationCard from '#components/InformationCard';
4343import areaSvg from '#resources/icons/area.svg' ;
4444import sceneSvg from '#resources/icons/scene.svg' ;
4545import featureSvg from '#resources/icons/feature.svg' ;
46+ import validateImageSvg from '#resources/icons/validate-image.svg' ;
4647import {
4748 ContributorTimeStatType ,
4849 OrganizationSwipeStatsType ,
4950 ProjectTypeSwipeStatsType ,
5051 ProjectTypeAreaStatsType ,
5152 ContributorSwipeStatType ,
53+ ProjectTypeEnum ,
5254} from '#generated/types' ;
5355import { mergeItems } from '#utils/common' ;
5456import {
@@ -67,17 +69,28 @@ const CHART_BREAKPOINT = 700;
6769export type ActualContributorTimeStatType = ContributorTimeStatType & { totalSwipeTime : number } ;
6870const UNKNOWN = '-1' ;
6971const BUILD_AREA = 'BUILD_AREA' ;
72+ const MEDIA = 'MEDIA' ;
73+ const DIGITIZATION = 'DIGITIZATION' ;
7074const FOOTPRINT = 'FOOTPRINT' ;
7175const CHANGE_DETECTION = 'CHANGE_DETECTION' ;
76+ const VALIDATE_IMAGE = 'VALIDATE_IMAGE' ;
7277const COMPLETENESS = 'COMPLETENESS' ;
7378const STREET = 'STREET' ;
7479
7580// FIXME: the name property is not used properly
76- const projectTypes : Record < string , { color : string , name : string } > = {
81+ const projectTypes : Record < ProjectTypeEnum | '-1' , { color : string , name : string } > = {
7782 [ UNKNOWN ] : {
7883 color : '#cacaca' ,
7984 name : 'Unknown' ,
8085 } ,
86+ [ MEDIA ] : {
87+ color : '#cacaca' ,
88+ name : 'Media' ,
89+ } ,
90+ [ DIGITIZATION ] : {
91+ color : '#cacaca' ,
92+ name : 'Digitization' ,
93+ } ,
8194 [ BUILD_AREA ] : {
8295 color : '#f8a769' ,
8396 name : 'Find' ,
@@ -94,6 +107,10 @@ const projectTypes: Record<string, { color: string, name: string }> = {
94107 color : '#fb8072' ,
95108 name : 'Completeness' ,
96109 } ,
110+ [ VALIDATE_IMAGE ] : {
111+ color : '#a1b963' ,
112+ name : 'Validate Image' ,
113+ } ,
97114 [ STREET ] : {
98115 color : '#808080' ,
99116 name : 'Street' ,
@@ -376,14 +393,16 @@ function StatsBoard(props: Props) {
376393 const sortedProjectSwipeType = useMemo (
377394 ( ) => (
378395 swipeByProjectType
379- ?. map ( ( item ) => ( {
380- ...item ,
381- projectType : (
382- isDefined ( item . projectType )
383- && isDefined ( projectTypes [ item . projectType ] )
384- ) ? item . projectType
385- : UNKNOWN ,
386- } ) )
396+ ?. map ( ( item ) => {
397+ const projectType : ProjectTypeEnum | '-1' = (
398+ isDefined ( item . projectType ) && isDefined ( projectTypes [ item . projectType ] )
399+ ) ? item . projectType : UNKNOWN ;
400+
401+ return ( {
402+ ...item ,
403+ projectType,
404+ } ) ;
405+ } )
387406 . sort ( ( a , b ) => compareNumber ( a . totalSwipes , b . totalSwipes , - 1 ) ) ?? [ ]
388407 ) ,
389408 [ swipeByProjectType ] ,
@@ -449,6 +468,10 @@ function StatsBoard(props: Props) {
449468 ( project ) => project . projectType === FOOTPRINT ,
450469 ) ?. totalSwipes ;
451470
471+ const validateImageTotalSwipes = swipeByProjectType ?. find (
472+ ( project ) => project . projectType === VALIDATE_IMAGE ,
473+ ) ?. totalSwipes ;
474+
452475 const organizationColors = scaleOrdinal < string , string | undefined > ( )
453476 . domain ( totalSwipesByOrganizationStats ?. map (
454477 ( organization ) => ( organization . organizationName ) ,
@@ -699,6 +722,29 @@ function StatsBoard(props: Props) {
699722 subHeading = "Compare"
700723 variant = "stat"
701724 />
725+ < InformationCard
726+ icon = { (
727+ < img
728+ src = { validateImageSvg }
729+ alt = "group icon"
730+ />
731+ ) }
732+ value = { (
733+ < NumberOutput
734+ className = { styles . numberOutput }
735+ value = { validateImageTotalSwipes }
736+ normal
737+ invalidText = { 0 }
738+ />
739+ ) }
740+ label = { (
741+ < div className = { styles . infoLabel } >
742+ Images Validated
743+ </ div >
744+ ) }
745+ subHeading = "Validate Image"
746+ variant = "stat"
747+ />
702748 </ div >
703749 < div className = { styles . overallStatsContainer } >
704750 < InformationCard
0 commit comments