fix: add validation error handling to InactiveJailDetail
- Add validationError state to show network/API failures to user - Use handleFetchError to properly handle auth errors (suppress generic error banner, trigger session-expiry flow) - Clear validationError when user clicks Validate again - Ensure error MessageBar renders instead of success banner when validation fails - Fix InactiveJailDetail onValidate to return Promise as expected by prop type - Fix useJailConfigs test to use correct JailConfig interface Fixes TASK-BUG-05: prevents silent validation failures where user cannot distinguish between clean 'no issues' result and server error. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -15,27 +15,19 @@ describe("useJailConfigs", () => {
|
||||
jails: [
|
||||
{
|
||||
name: "sshd",
|
||||
enabled: true,
|
||||
active: true,
|
||||
ban_time: 600,
|
||||
find_time: 600,
|
||||
max_retry: 5,
|
||||
fail_regex: [],
|
||||
ignore_regex: [],
|
||||
log_paths: [],
|
||||
date_pattern: null,
|
||||
log_encoding: "auto",
|
||||
backend: "systemd",
|
||||
filename: "/etc/fail2ban/jail.d/sshd.conf",
|
||||
source_file: "/etc/fail2ban/jail.d/sshd.conf",
|
||||
last_activation: "2024-01-01T00:00:00Z",
|
||||
bantime: 600,
|
||||
findtime: 600,
|
||||
maxretry: 5,
|
||||
action: [],
|
||||
logpath: [],
|
||||
port: [],
|
||||
ignoreself: false,
|
||||
filter: "sshd",
|
||||
destemail: "",
|
||||
sendername: "",
|
||||
action_d_files: [],
|
||||
ignoreip: [],
|
||||
ignorecommand: "",
|
||||
banaction: "",
|
||||
banaction_allports: false,
|
||||
use_dns: "warn",
|
||||
prefregex: "",
|
||||
actions: [],
|
||||
bantime_escalation: null,
|
||||
},
|
||||
],
|
||||
total: 1,
|
||||
|
||||
Reference in New Issue
Block a user