Skip to content

Commit

Permalink
Merge pull request #1067 from dhis2/TECH-1301-add-credentials-expires…
Browse files Browse the repository at this point in the history
…-reminder-in-days-setting

feat: add credentialsExpiresReminderInDays setting
  • Loading branch information
stian-sandvold authored Aug 14, 2023
2 parents aaad5d6 + 45c81b1 commit 990f45f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
7 changes: 5 additions & 2 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,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 (0–28)"
msgstr "Number of days before password expiry to send reminder (0–28)"

msgid "Minimum characters in password"
msgstr "Minimum characters in password"
Expand Down
1 change: 1 addition & 0 deletions src/settingsCategories.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export const categories = {
'keyAllowObjectAssignment',
'credentialsExpires',
'credentialsExpiryAlert',
'credentialsExpiresReminderInDays',
'minPasswordLength',
'corsWhitelist',
'recaptchaSite',
Expand Down
3 changes: 3 additions & 0 deletions src/settingsFields.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@ class SettingsFields extends React.Component {
...addConditionallyHiddenStyles(mapping),
},
hintText: mapping.hintText,
type: mapping.inputType,
min: mapping.minValue,
max: mapping.maxValue,
helpText: mapping.helpText,
},
validators,
Expand Down
15 changes: 14 additions & 1 deletion src/settingsKeyMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,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',
Expand Down

0 comments on commit 990f45f

Please sign in to comment.