Skip to content

Commit 430631d

Browse files
authored
Merge pull request metabrainz#1993 from reosarevok/MBS-11455
MBS-11455: Hide view links on stats when logged out
2 parents 197b9da + 66fa189 commit 430631d

File tree

1 file changed

+21
-23
lines changed

1 file changed

+21
-23
lines changed

root/user/UserProfile.js

+21-23
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,7 @@ const UserEditsProperty = ({
431431
{$c.user ? (exp.l('{count} ({view_url|view})', {
432432
count: formatCount($c, addedEntities),
433433
view_url: searchEditsURL(createEditTypes),
434-
})) : (exp.l('{count}', {
435-
count: formatCount($c, addedEntities),
436-
}))}
434+
})) : formatCount($c, addedEntities)}
437435
</UserProfileProperty>
438436
);
439437
};
@@ -505,87 +503,87 @@ const UserProfileStatistics = ({
505503
<thead>
506504
<tr>
507505
<th colSpan="2">
508-
{exp.l(
506+
{$c.user ? exp.l(
509507
'Edits ({view_url|view})',
510508
{view_url: `/user/${encodedName}/edits`},
511-
)}
509+
) : l('Edits')}
512510
</th>
513511
</tr>
514512
</thead>
515513

516514
<tbody>
517515
<UserProfileProperty name={lp('Accepted', 'edit descriptor')}>
518-
{exp.l(
516+
{$c.user ? exp.l(
519517
'{count} ({view_url|view})',
520518
{
521519
count: formatCount($c, editStats.accepted_count),
522520
view_url: `/user/${encodedName}/edits/accepted`,
523521
},
524-
)}
522+
) : formatCount($c, editStats.accepted_count)}
525523
</UserProfileProperty>
526524

527525
<UserProfileProperty name={l('Auto-edits')}>
528-
{exp.l(
526+
{$c.user ? exp.l(
529527
'{count} ({view_url|view})',
530528
{
531529
count: formatCount($c, editStats.accepted_auto_count),
532530
view_url: `/user/${encodedName}/edits/autoedits`,
533531
},
534-
)}
532+
) : formatCount($c, editStats.accepted_auto_count)}
535533
</UserProfileProperty>
536534

537535
<UserProfileProperty className="positive" name={l('Total applied')}>
538-
{exp.l(
536+
{$c.user ? exp.l(
539537
'{count} ({view_url|view})',
540538
{
541539
count: formatCount($c, allAppliedCount),
542540
view_url: `/user/${encodedName}/edits/applied`,
543541
},
544-
)}
542+
) : formatCount($c, allAppliedCount)}
545543
</UserProfileProperty>
546544

547545
<UserProfileProperty className="negative" name={l('Voted down')}>
548-
{exp.l(
546+
{$c.user ? exp.l(
549547
'{count} ({view_url|view})',
550548
{
551549
count: formatCount($c, editStats.rejected_count),
552550
view_url: `/user/${encodedName}/edits/rejected`,
553551
},
554-
)}
552+
) : formatCount($c, editStats.rejected_count)}
555553
</UserProfileProperty>
556554

557555
<UserProfileProperty name={l('Failed')}>
558-
{exp.l(
556+
{$c.user ? exp.l(
559557
'{count} ({view_url|view})',
560558
{
561559
count: formatCount($c, editStats.failed_count),
562560
view_url: `/user/${encodedName}/edits/failed`,
563561
},
564-
)}
562+
) : formatCount($c, editStats.failed_count)}
565563
</UserProfileProperty>
566564

567565
<UserProfileProperty name={l('Cancelled')}>
568-
{exp.l(
566+
{$c.user ? exp.l(
569567
'{count} ({view_url|view})',
570568
{
571569
count: formatCount($c, editStats.cancelled_count),
572570
view_url: `/user/${encodedName}/edits/cancelled`,
573571
},
574-
)}
572+
) : formatCount($c, editStats.cancelled_count)}
575573
</UserProfileProperty>
576574

577575
<UserProfileProperty name={l('Open')}>
578-
{exp.l(
576+
{$c.user ? exp.l(
579577
'{count} ({view_url|view})',
580578
{
581579
count: formatCount($c, editStats.open_count),
582580
view_url: `/user/${encodedName}/edits/open`,
583581
},
584-
)}
582+
) : formatCount($c, editStats.open_count)}
585583
</UserProfileProperty>
586584

587585
<UserProfileProperty name={l('Last 24 hours')}>
588-
{exp.l('{count} ({view_url|view})', {
586+
{$c.user ? exp.l('{count} ({view_url|view})', {
589587
count: formatCount($c, editStats.last_day_count),
590588
view_url: (
591589
'/search/edits' +
@@ -601,7 +599,7 @@ const UserProfileStatistics = ({
601599
'&negation=0' +
602600
'&auto_edit_filter='
603601
),
604-
})}
602+
}) : formatCount($c, editStats.last_day_count)}
605603
</UserProfileProperty>
606604
</tbody>
607605
</table>
@@ -613,9 +611,9 @@ const UserProfileStatistics = ({
613611
<thead>
614612
<tr>
615613
<th colSpan="3">
616-
{exp.l('Votes ({view_url|view})', {
614+
{$c.user ? exp.l('Votes ({view_url|view})', {
617615
view_url: `/user/${encodedName}/votes`,
618-
})}
616+
}) : l('Votes')}
619617
</th>
620618
</tr>
621619
<tr>

0 commit comments

Comments
 (0)