1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

(bug) untranslated string if prepaid pack has no maximum validity

This commit is contained in:
Sylvain 2022-01-18 15:46:15 +01:00
parent 5b69c0f46f
commit 8097e33ef4
2 changed files with 3 additions and 0 deletions

View File

@ -1,6 +1,7 @@
# Changelog Fab-manager
- Add a test for statistics generation
- Fix a bug: do not display an untranslated string if a prepaid pack has no maximum validity
- Fix a bug: statistics not built for instances with plans created before v4.3.3
- Fix a bug: when requesting to send the sso migration code, the email was case-sensitive.
- Fix a bug: the adminsys email was case-sensitive.

View File

@ -82,6 +82,8 @@ export const ProposePacksModal: React.FC<ProposePacksModalProps> = ({ isOpen, to
* Return a user-friendly string for the validity of the provided pack
*/
const formatValidity = (pack: PrepaidPack): string => {
if (!pack.validity_interval) return null;
const period = t(`app.logged.propose_packs_modal.period.${pack.validity_interval}`, { COUNT: pack.validity_count });
return t('app.logged.propose_packs_modal.validity', { COUNT: pack.validity_count, PERIODS: period });
};