Skip to content

Commit

Permalink
feat: show shared stats in report table
Browse files Browse the repository at this point in the history
Show stats in the report table. Still need to wire things up for
sorting.

For #347.

Came out of phetsims/qa#869.
  • Loading branch information
liammulh committed Feb 8, 2023
1 parent ea38012 commit 874aee3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/client/components/TranslationReportTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ const TranslationReportTable = ( { locale, localeName, wantsUntranslated } ) =>
: <></>
}
</th>
<th>Shared Strings
{
reportPopulated && reportRows.length > 1
? <SortButton onClick={() => handleSortButtonClick( 'need to put sort key here' )}/>
: <></>
}
</th>
<th>Common Strings
{
reportPopulated && reportRows.length > 1
Expand Down
2 changes: 1 addition & 1 deletion src/client/jsx/getTranslationReportRows.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const getTranslationReportRows = (
// Create the row JSX.
const simSpecificPercent = Math.floor( ( reportObject.numSimSpecificTranslatedStrings / reportObject.numSimSpecificStrings ) * 100 );
let sharedPercent = 0;
const hasSharedStrings = reportObject.numSharedStrings && reportObject.numSharedTranslatedStrings;
const hasSharedStrings = reportObject.numSharedStrings !== undefined && reportObject.numSharedTranslatedStrings !== undefined;
let sharedJsx = <td>N/A</td>;
const commonPercent = Math.floor( ( reportObject.numCommonTranslatedStrings / reportObject.numCommonStrings ) * 100 );
if ( hasSharedStrings ) {
Expand Down

0 comments on commit 874aee3

Please sign in to comment.