From 75b21b5ba240231d348561bd7a17a863543c849a Mon Sep 17 00:00:00 2001 From: Thomas Zemp Date: Thu, 30 May 2024 15:11:18 +0200 Subject: [PATCH] fix: credentialsExpiresReminderInDays [DHIS2-13866] --- i18n/en.pot | 14 +++++++------- src/settingsCategories.js | 1 + src/settingsFields.component.js | 3 +++ src/settingsKeyMapping.js | 15 ++++++++++++++- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/i18n/en.pot b/i18n/en.pot index 45f4653e..68158069 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2024-01-23T20:33:57.618Z\n" -"PO-Revision-Date: 2024-01-23T20:33:57.618Z\n" +"POT-Creation-Date: 2024-05-30T13:11:40.739Z\n" +"PO-Revision-Date: 2024-05-30T13:11:40.739Z\n" msgid "Failed to load: {{error}}" msgstr "Failed to load: {{error}}" @@ -677,9 +677,6 @@ msgstr "TLS" msgid "Email sender" msgstr "Email sender" -msgid "The address that outgoing messages are sent from." -msgstr "The address that outgoing messages are sent from." - msgid "Send me a test email" msgstr "Send me a test email" @@ -722,8 +719,11 @@ msgstr "6 months" msgid "12 months" msgstr "12 months" -msgid "Enable password expiry alerts" -msgstr "Enable password expiry alerts" +msgid "Send reminders to users before their password expires" +msgstr "Send reminders to users before their password expires" + +msgid "Number of days before password expiry to send reminder (1–28)" +msgstr "Number of days before password expiry to send reminder (1–28)" msgid "Minimum characters in password" msgstr "Minimum characters in password" diff --git a/src/settingsCategories.js b/src/settingsCategories.js index 363b9215..774a86da 100644 --- a/src/settingsCategories.js +++ b/src/settingsCategories.js @@ -123,6 +123,7 @@ export const categories = { 'keyAllowObjectAssignment', 'credentialsExpires', 'credentialsExpiryAlert', + 'credentialsExpiresReminderInDays', 'minPasswordLength', 'corsWhitelist', 'recaptchaSite', diff --git a/src/settingsFields.component.js b/src/settingsFields.component.js index af4c8236..e20c631e 100644 --- a/src/settingsFields.component.js +++ b/src/settingsFields.component.js @@ -319,6 +319,9 @@ class SettingsFields extends React.Component { ...addConditionallyHiddenStyles(mapping), }, hintText: mapping.hintText, + type: mapping.inputType, + min: mapping.minValue, + max: mapping.maxValue, }, validators, } diff --git a/src/settingsKeyMapping.js b/src/settingsKeyMapping.js index 8517e90b..35f9938d 100644 --- a/src/settingsKeyMapping.js +++ b/src/settingsKeyMapping.js @@ -553,9 +553,22 @@ const settingsKeyMapping = { }, }, credentialsExpiryAlert: { - label: i18n.t('Enable password expiry alerts'), + label: i18n.t('Send reminders to users before their password expires'), type: 'checkbox', }, + credentialsExpiresReminderInDays: { + label: i18n.t( + 'Number of days before password expiry to send reminder (1–28)' + ), + type: 'textfield', + inputType: 'number', + minValue: 1, + maxValue: 28, + hideWhen: { + settingsKey: 'credentialsExpiryAlert', + settingsValue: 'false', + }, + }, minPasswordLength: { label: i18n.t('Minimum characters in password'), type: 'dropdown',