Skip to content

Commit

Permalink
feat: add in scheduling settings to settings app [DHIS2-15765] (#1295)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomzemp authored Jan 23, 2024
1 parent a47a6bb commit ba6f2a1
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 83 deletions.
121 changes: 39 additions & 82 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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: 2023-08-24T10:48:48.806Z\n"
"PO-Revision-Date: 2023-08-24T10:48:48.806Z\n"
"POT-Creation-Date: 2024-01-19T12:30:16.705Z\n"
"PO-Revision-Date: 2024-01-19T12:30:16.705Z\n"

msgid "Failed to load: {{error}}"
msgstr "Failed to load: {{error}}"
Expand Down Expand Up @@ -89,84 +89,6 @@ msgstr "Don't sync metadata if DHIS versions differ"
msgid "Metadata Versioning"
msgstr "Metadata Versioning"

msgid "This client ID is already taken"
msgstr "This client ID is already taken"

msgid "Name"
msgstr "Name"

msgid "Required"
msgstr "Required"

msgid "Client ID"
msgstr "Client ID"

msgid "Client Secret"
msgstr "Client Secret"

msgid "Grant Types"
msgstr "Grant Types"

msgid "Password"
msgstr "Password"

msgid "Refresh token"
msgstr "Refresh token"

msgid "Authorization code"
msgstr "Authorization code"

msgid "One URL per line"
msgstr "One URL per line"

msgid "Redirect URIs"
msgstr "Redirect URIs"

msgid "This field should contain a list of URLs"
msgstr "This field should contain a list of URLs"

msgid "Create new OAuth2 Client"
msgstr "Create new OAuth2 Client"

msgid "Edit OAuth2 Client"
msgstr "Edit OAuth2 Client"

msgid "Save"
msgstr "Save"

msgid "Cancel"
msgstr "Cancel"

msgid "There are currently no OAuth2 clients registered"
msgstr "There are currently no OAuth2 clients registered"

msgid "Edit"
msgstr "Edit"

msgid "Delete"
msgstr "Delete"

msgid "OAuth2 client saved"
msgstr "OAuth2 client saved"

msgid "Failed to save OAuth2 client"
msgstr "Failed to save OAuth2 client"

msgid "Add OAuth2 client"
msgstr "Add OAuth2 client"

msgid "Yes"
msgstr "Yes"

msgid "No"
msgstr "No"

msgid "OAuth2 client deleted"
msgstr "OAuth2 client deleted"

msgid "Failed to delete OAuth2 client"
msgstr "Failed to delete OAuth2 client"

msgid "Settings updated"
msgstr "Settings updated"

Expand Down Expand Up @@ -224,15 +146,18 @@ msgstr "Synchronization"
msgid "Synchronization settings"
msgstr "Synchronization settings"

msgid "OAuth2 Clients"
msgstr "OAuth2 Clients"
msgid "Scheduled jobs"
msgstr "Scheduled jobs"

msgid "This field is required"
msgstr "This field is required"

msgid "This field should be a URL"
msgstr "This field should be a URL"

msgid "This field should contain a list of URLs"
msgstr "This field should contain a list of URLs"

msgid "This field should be a number"
msgstr "This field should be a number"

Expand Down Expand Up @@ -632,6 +557,9 @@ msgstr "Database language"
msgid "Property to display in analysis modules"
msgstr "Property to display in analysis modules"

msgid "Name"
msgstr "Name"

msgid "Short name"
msgstr "Short name"

Expand Down Expand Up @@ -674,6 +602,9 @@ msgstr "Port"
msgid "Username"
msgstr "Username"

msgid "Password"
msgstr "Password"

msgid "TLS"
msgstr "TLS"

Expand Down Expand Up @@ -737,6 +668,9 @@ msgstr "Minimum characters in password"
msgid "CORS whitelist"
msgstr "CORS whitelist"

msgid "One URL per line"
msgstr "One URL per line"

msgid "reCAPTCHA Site Key"
msgstr "reCAPTCHA Site Key"

Expand Down Expand Up @@ -782,6 +716,9 @@ msgstr ""
"system unusable. If you have entered data, it is strongly recommended that "
"you do not change your calendar setting."

msgid "Cancel"
msgstr "Cancel"

msgid "Yes, change calendar"
msgstr "Yes, change calendar"

Expand Down Expand Up @@ -817,3 +754,23 @@ msgstr "Remote server username"

msgid "Remote server password"
msgstr "Remote server password"

msgid "Number of minutes after which a stale job is reset to scheduled state (1-60)"
msgstr "Number of minutes after which a stale job is reset to scheduled state (1-60)"

msgid "Number of minutes after which a completed ad-hoc job is deleted (1+)"
msgstr "Number of minutes after which a completed ad-hoc job is deleted (1+)"

msgid ""
"Maximum number of hours a job may trigger after its intended time if job "
"has not yet run (1-24)"
msgstr ""
"Maximum number of hours a job may trigger after its intended time if job "
"has not yet run (1-24)"

msgid ""
"Job execution interval (seconds) below which a job will be logged at debug "
"(rather than info) level (20+)"
msgstr ""
"Job execution interval (seconds) below which a job will be logged at debug "
"(rather than info) level (20+)"
12 changes: 12 additions & 0 deletions src/settingsCategories.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const categoryOrder = [
'calendar',
'import',
'sync',
'scheduledJobs',
]

export const categories = {
Expand Down Expand Up @@ -161,4 +162,15 @@ export const categories = {
'keyMetadataDataVersioning',
],
},
scheduledJobs: {
label: i18n.t('Scheduled jobs'),
icon: 'schedule',
pageLabel: i18n.t('Scheduled jobs'),
settings: [
'jobsRescheduleAfterMinutes',
'jobsCleanupAfterMinutes',
'jobsMaxCronDelayHours',
'jobsLogDebugBelowSeconds',
],
},
}
44 changes: 43 additions & 1 deletion src/settingsKeyMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,49 @@ const settingsKeyMapping = {
label: i18n.t('Metadata Versioning'),
type: 'metadataSettings',
},

/* ============================================================================================================ */
/* Category: Scheduled jobs */
/* ============================================================================================================ */
jobsRescheduleAfterMinutes: {
label: i18n.t(
'Number of minutes after which a stale job is reset to scheduled state (1-60)'
),
type: 'textfield',
inputType: 'number',
minValue: 1,
maxValue: 60,
validators: ['positive_number'],
},
jobsCleanupAfterMinutes: {
label: i18n.t(
'Number of minutes after which a completed ad-hoc job is deleted (1+)'
),
type: 'textfield',
inputType: 'number',
minValue: 1,
maxValue: 2147483647,
validators: ['positive_number'],
},
jobsMaxCronDelayHours: {
label: i18n.t(
'Maximum number of hours a job may trigger after its intended time if job has not yet run (1-24)'
),
type: 'textfield',
inputType: 'number',
minValue: 1,
maxValue: 24,
validators: ['positive_number'],
},
jobsLogDebugBelowSeconds: {
label: i18n.t(
'Job execution interval (seconds) below which a job will be logged at debug (rather than info) level (20+)'
),
type: 'textfield',
inputType: 'number',
minValue: 20,
maxValue: 2147483647,
validators: ['positive_number'],
},
/* ============================================================================================================ */
// The following keys are present in the demo database but are not managed by dhis-web-maintenance-settings
//
Expand Down

0 comments on commit ba6f2a1

Please sign in to comment.