File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -212,9 +212,20 @@ export function Component() {
212212 ) ,
213213 ) ;
214214
215- const topFiveRatedComponents = topRatedComponents . filter (
216- ( component ) => isDefined ( component . rating ) ,
217- ) . slice ( 0 , 5 ) ;
215+ const topFiveRatedComponents = topRatedComponents . map (
216+ ( component ) => {
217+ const { rating } = component ;
218+
219+ if ( isNotDefined ( rating ) ) {
220+ return undefined ;
221+ }
222+
223+ return {
224+ ...component ,
225+ rating,
226+ } ;
227+ } ,
228+ ) . filter ( isDefined ) . slice ( 0 , 5 ) ;
218229
219230 // FIXME: let's use avgSafe
220231 function getAverage ( list : number [ ] ) {
@@ -486,9 +497,12 @@ export function Component() {
486497 >
487498 { assessmentStats . topFiveRatedComponents . map (
488499 ( component ) => (
489- < div className = { styles . topRatedComponent } key = { component . ra } >
500+ < div
501+ className = { styles . topRatedComponent }
502+ key = { component . rating . id }
503+ >
490504 < div className = { styles . label } >
491- { component . rating ? .title }
505+ { component . rating . title }
492506 </ div >
493507 < div >
494508 { getFormattedComponentName ( component . details ) }
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ export function Component() {
133133 date : (
134134 < DateOutput
135135 value = { modifiedAt }
136- /> ?? '?'
136+ />
137137 ) ,
138138 user : getUserName ( modifiedBy ) ,
139139 } ,
You can’t perform that action at this time.
0 commit comments