@@ -49,6 +49,7 @@ import {
4949 ProjectTypeSwipeStatsType ,
5050 ProjectTypeAreaStatsType ,
5151 ContributorSwipeStatType ,
52+ ProjectTypeEnum ,
5253} from '#generated/types' ;
5354import { mergeItems } from '#utils/common' ;
5455import {
@@ -67,17 +68,28 @@ const CHART_BREAKPOINT = 700;
6768export type ActualContributorTimeStatType = ContributorTimeStatType & { totalSwipeTime : number } ;
6869const UNKNOWN = '-1' ;
6970const BUILD_AREA = 'BUILD_AREA' ;
71+ const MEDIA = 'MEDIA' ;
72+ const DIGITIZATION = 'DIGITIZATION' ;
7073const FOOTPRINT = 'FOOTPRINT' ;
7174const CHANGE_DETECTION = 'CHANGE_DETECTION' ;
75+ const VALIDATE_IMAGE = 'VALIDATE_IMAGE' ;
7276const COMPLETENESS = 'COMPLETENESS' ;
7377const STREET = 'STREET' ;
7478
7579// FIXME: the name property is not used properly
76- const projectTypes : Record < string , { color : string , name : string } > = {
80+ const projectTypes : Record < ProjectTypeEnum | '-1' , { color : string , name : string } > = {
7781 [ UNKNOWN ] : {
7882 color : '#cacaca' ,
7983 name : 'Unknown' ,
8084 } ,
85+ [ MEDIA ] : {
86+ color : '#cacaca' ,
87+ name : 'Media' ,
88+ } ,
89+ [ DIGITIZATION ] : {
90+ color : '#cacaca' ,
91+ name : 'Digitization' ,
92+ } ,
8193 [ BUILD_AREA ] : {
8294 color : '#f8a769' ,
8395 name : 'Find' ,
@@ -94,6 +106,10 @@ const projectTypes: Record<string, { color: string, name: string }> = {
94106 color : '#fb8072' ,
95107 name : 'Completeness' ,
96108 } ,
109+ [ VALIDATE_IMAGE ] : {
110+ color : '#a1b963' ,
111+ name : 'Validate Image' ,
112+ } ,
97113 [ STREET ] : {
98114 color : '#808080' ,
99115 name : 'Street' ,
@@ -376,14 +392,16 @@ function StatsBoard(props: Props) {
376392 const sortedProjectSwipeType = useMemo (
377393 ( ) => (
378394 swipeByProjectType
379- ?. map ( ( item ) => ( {
380- ...item ,
381- projectType : (
382- isDefined ( item . projectType )
383- && isDefined ( projectTypes [ item . projectType ] )
384- ) ? item . projectType
385- : UNKNOWN ,
386- } ) )
395+ ?. map ( ( item ) => {
396+ const projectType : ProjectTypeEnum | '-1' = (
397+ isDefined ( item . projectType ) && isDefined ( projectTypes [ item . projectType ] )
398+ ) ? item . projectType : UNKNOWN ;
399+
400+ return ( {
401+ ...item ,
402+ projectType,
403+ } ) ;
404+ } )
387405 . sort ( ( a , b ) => compareNumber ( a . totalSwipes , b . totalSwipes , - 1 ) ) ?? [ ]
388406 ) ,
389407 [ swipeByProjectType ] ,
0 commit comments