Skip to content

Commit

Permalink
Added translation for reset states
Browse files Browse the repository at this point in the history
Added some default values to schema validator
Fixed a JSDOC comment
  • Loading branch information
Alex-NRCan committed Dec 8, 2023
1 parent b99126e commit 6b80882
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"parsingError": "There was an error parsing the Chart inputs.",
"viewConsoleDetails": "View console for details.",
"downloadFiltered": "Download visible",
"downloadAll": "Download all"
"downloadAll": "Download all",
"resetStates": "Reset states"
}
}
3 changes: 2 additions & 1 deletion locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"parsingError": "Une erreur est survenue lors de la lecture des paramètres.",
"viewConsoleDetails": "Voir détails dans la console.",
"downloadFiltered": "Télécharger visuel",
"downloadAll": "Télécharger tout"
"downloadAll": "Télécharger tout",
"resetStates": "Réinitialiser états"
}
}
6 changes: 4 additions & 2 deletions schema-inputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@
},
"useSteps": {
"description": "Indicates if the line chart should use steps - supported values are: 'before', 'middle', 'after', false",
"enum": ["before", "after", "middle", false]
"enum": ["before", "after", "middle", false],
"default": false
},
"tension": {
"description": "Indicates if the line chart should use tension when drawing the line between the values",
Expand All @@ -94,7 +95,8 @@
},
"type": {
"description": "Indicates the type of axis - supported values are: 'linear', 'time', 'timeseries', 'logarithmic', 'category'",
"type": "string"
"type": "string",
"default": "linear"
},
"label": {
"description": "Indicates the text in the user interface that should be shown for the axis",
Expand Down
7 changes: 5 additions & 2 deletions src/chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,10 @@ export function GeoChart<

/**
* Handles when the download button is clicked
* @param value number Indicates the button drop down selection index when it was clicked
* @param index number Indicates the button drop down selection index when it was clicked.
* For our button usage:
* - 0: Means 'download view' was selected when button was clicked
* - 1: Means 'download all' was selected when button was clicked
*/
const handleDownloadClick = (index: number): void => {
// Get the data
Expand Down Expand Up @@ -1516,7 +1519,7 @@ export function GeoChart<
if (inputs?.ui?.resetStates) {
return (
<Button sx={sxClasses.uiOptionsResetStates} onClick={handleResetStates}>
{t('reset states')}
{t('geochart.resetStates')}
</Button>
);
}
Expand Down

0 comments on commit 6b80882

Please sign in to comment.