Skip to content

Commit

Permalink
Utilize built-in rules for cron errors
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Rak <[email protected]>
  • Loading branch information
rak-phillip committed Jun 27, 2024
1 parent 6cf779e commit 026097a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions shell/assets/translations/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5822,6 +5822,7 @@ user:
cron:
label: User retention process schedule
subLabel: The user retention process runs as a cron job (required)
errorMessage: User retention process schedule must be a valid cron expression
dryRun:
label: Run the user retention process in DRY mode (no changes will be applied)
subLabel: You can check the logs to see which accounts would be affected
Expand Down
5 changes: 3 additions & 2 deletions shell/pages/c/_cluster/auth/user.retention/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ const validateUserRetentionCron = () => {
if (typeof cronSetting === 'string' && !isValidCron(cronSetting)) {
isFormValid.value = false;
return;
return t('user.retention.edit.form.cron.errorMessage');
}
isFormValid.value = true;
Expand Down Expand Up @@ -296,8 +296,9 @@ onBeforeRouteUpdate((_to: unknown, _from: unknown) => {
class="input-field"
required
type="cron"
:tooltip="t('user.retention.edit.form.cron.subLabel')"
:rules="[validateUserRetentionCron]"
:label="t('user.retention.edit.form.cron.label')"
:sub-label="t('user.retention.edit.form.cron.subLabel')"
@input="validateUserRetentionCron"
/>
</div>
Expand Down

0 comments on commit 026097a

Please sign in to comment.