Skip to content

Commit

Permalink
feat: add scheduler settings
Browse files Browse the repository at this point in the history
  • Loading branch information
tomzemp committed Dec 22, 2023
1 parent ec2fb11 commit bbf622c
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 83 deletions.
114 changes: 32 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: 2023-09-29T11:26:08.512Z\n"
"PO-Revision-Date: 2023-09-29T11:26:08.512Z\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,16 @@ msgstr "Remote server username"

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

msgid "Number of minutes after which a job is considered stale"
msgstr "Number of minutes after which a job is considered stale"

msgid "Number of minutes after which a completed one-run job is deleted"
msgstr "Number of minutes after which a completed one-run job is deleted"

msgid ""
"Number of hours a job will trigger after its intended time if job has not "
"yet run"
msgstr ""
"Number of hours a job will trigger after its intended time if job has not "
"yet run"
1 change: 1 addition & 0 deletions src/App.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.contentWrap {
display: flex;
background: var(--colors-grey100);
min-height:100vh;
}

.contentArea {
Expand Down
1 change: 1 addition & 0 deletions src/form-fields/text-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class TextFieldComponent extends React.Component {
{...other}
value={this.state.value}
onChange={this.onChange}
error={true}
/>
{helpText && <p style={helpTextStyle}>{helpText}</p>}
</div>
Expand Down
11 changes: 11 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,14 @@ export const categories = {
'keyMetadataDataVersioning',
],
},
scheduledJobs: {
label: i18n.t('Scheduled jobs'),
icon: 'schedule',
pageLabel: i18n.t('Scheduled jobs'),
settings: [
'jobsRescheduleAfterMinutes',
'jobsCleanupAfterMinutes',
'jobsMaxCronDelayHours',
],
},
}
32 changes: 31 additions & 1 deletion src/settingsKeyMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,37 @@ const settingsKeyMapping = {
label: i18n.t('Metadata Versioning'),
type: 'metadataSettings',
},

/* ============================================================================================================ */
/* Category: Scheduled jobs */
/* ============================================================================================================ */
jobsRescheduleAfterMinutes: {
label: i18n.t(
'Number of minutes after which a job is considered stale'
),
type: 'textfield',
inputType: 'number',
minValue: 1,
maxValue: 60,
validators: ['number'],
},
jobsCleanupAfterMinutes: {
label: i18n.t(
'Number of minutes after which a completed one-run job is deleted'
),
type: 'textfield',
inputType: 'number',
minValue: 1,
maxValue: 2147483647,
},
jobsMaxCronDelayHours: {
label: i18n.t(
'Number of hours a job will trigger after its intended time if job has not yet run'
),
type: 'textfield',
inputType: 'number',
minValue: 1,
maxValue: 24,
},
/* ============================================================================================================ */
// The following keys are present in the demo database but are not managed by dhis-web-maintenance-settings
//
Expand Down

0 comments on commit bbf622c

Please sign in to comment.