Skip to content

Commit

Permalink
[UII] Fix client-side validation for agent policy timeout fields (ela…
Browse files Browse the repository at this point in the history
…stic#191674)

## Summary

Resolves elastic#191583. Adjusts the client-side validation for agent policy
timeout fields so that it correctly returns an error when non-numeric
input is encountered, or when input is 0.
  • Loading branch information
jen-huang authored Aug 28, 2024
1 parent a78c69b commit f29bf1c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@ export const agentPolicyFormValidation = (
errors.namespace = [namespaceValidation.error];
}

if (agentPolicy.unenroll_timeout && agentPolicy.unenroll_timeout < 0) {
if (agentPolicy.unenroll_timeout !== undefined && agentPolicy.unenroll_timeout <= 0) {
errors.unenroll_timeout = [
<FormattedMessage
id="xpack.fleet.agentPolicyForm.unenrollTimeoutMinValueErrorMessage"
defaultMessage="Unenroll timeout must be greater than zero."
defaultMessage="Unenroll timeout must be an integer greater than zero."
/>,
];
}

if (agentPolicy.inactivity_timeout && agentPolicy.inactivity_timeout < 0) {
if (agentPolicy.inactivity_timeout !== undefined && agentPolicy.inactivity_timeout <= 0) {
errors.inactivity_timeout = [
<FormattedMessage
id="xpack.fleet.agentPolicyForm.inactivityTimeoutMinValueErrorMessage"
defaultMessage="Inactivity timeout must be greater than zero."
defaultMessage="Inactivity timeout must be an integer greater than zero."
/>,
];
}
Expand Down
16 changes: 8 additions & 8 deletions x-pack/plugins/translations/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -7010,6 +7010,14 @@
"securitySolutionPackages.features.featureRegistry.subFeatures.trustedApplications": "Applications de confiance",
"securitySolutionPackages.features.featureRegistry.subFeatures.trustedApplications.description": "Aide à atténuer les conflits avec d'autres logiciels, généralement d'autres applications d'antivirus ou de sécurité des points de terminaison.",
"securitySolutionPackages.features.featureRegistry.subFeatures.trustedApplications.privilegesTooltip": "\"Tous les espaces\" est requis pour l'accès aux applications de confiance.",
"securitySolutionPackages.flyout.right.header.collapseDetailButtonAriaLabel": "Réduire les détails",
"securitySolutionPackages.flyout.right.header.collapseDetailButtonLabel": "Réduire les détails",
"securitySolutionPackages.flyout.right.header.expandDetailButtonAriaLabel": "Développer les détails",
"securitySolutionPackages.flyout.right.header.expandDetailButtonLabel": "Développer les détails",
"securitySolutionPackages.flyout.shared.errorDescription": "Une erreur est survenue lors de l'affichage de {message}.",
"securitySolutionPackages.flyout.shared.errorTitle": "Impossible d'afficher {title}.",
"securitySolutionPackages.flyout.shared.ExpandablePanelButtonIconAriaLabel": "Activer/Désactiver le panneau extensible",
"securitySolutionPackages.flyout.shared.expandablePanelLoadingAriaLabel": "panneau extensible",
"securitySolutionPackages.markdown.insight.upsell": "Passez au niveau {requiredLicense} pour pouvoir utiliser les informations des guides d'investigation",
"securitySolutionPackages.markdown.investigationGuideInteractions.upsell": "Passez au niveau {requiredLicense} pour pouvoir utiliser les interactions des guides d'investigation",
"securitySolutionPackages.navigation.landingLinks": "Vues de sécurité",
Expand Down Expand Up @@ -39226,10 +39234,6 @@
"xpack.securitySolution.flyout.right.alertPreview.ariaLabel": "Voir un aperçu de l'alerte avec l'id {id}",
"xpack.securitySolution.flyout.right.eventCategoryText": "Catégorie d'événement",
"xpack.securitySolution.flyout.right.header.assignedTitle": "Utilisateurs affectés",
"securitySolutionPackages.flyout.right.header.collapseDetailButtonAriaLabel": "Réduire les détails",
"securitySolutionPackages.flyout.right.header.collapseDetailButtonLabel": "Réduire les détails",
"securitySolutionPackages.flyout.right.header.expandDetailButtonAriaLabel": "Développer les détails",
"securitySolutionPackages.flyout.right.header.expandDetailButtonLabel": "Développer les détails",
"xpack.securitySolution.flyout.right.header.headerTitle": "Détails des documents",
"xpack.securitySolution.flyout.right.header.jsonTabLabel": "JSON",
"xpack.securitySolution.flyout.right.header.overviewTabLabel": "Aperçu",
Expand Down Expand Up @@ -39316,10 +39320,6 @@
"xpack.securitySolution.flyout.right.visualizations.sessionPreview.timeDescription": "à",
"xpack.securitySolution.flyout.right.visualizations.sessionPreview.upsellDescription": "Cette fonctionnalité requiert un {subscription}",
"xpack.securitySolution.flyout.right.visualizations.sessionPreview.upsellLinkText": "Abonnement Enterprise",
"securitySolutionPackages.flyout.shared.errorDescription": "Une erreur est survenue lors de l'affichage de {message}.",
"securitySolutionPackages.flyout.shared.errorTitle": "Impossible d'afficher {title}.",
"securitySolutionPackages.flyout.shared.ExpandablePanelButtonIconAriaLabel": "Activer/Désactiver le panneau extensible",
"securitySolutionPackages.flyout.shared.expandablePanelLoadingAriaLabel": "panneau extensible",
"xpack.securitySolution.flyout.tour.entities.description": "Consultez la vue {entities} étendue pour en savoir plus sur les hôtes et les utilisateurs liés à l'alerte.",
"xpack.securitySolution.flyout.tour.entities.text": "Entités",
"xpack.securitySolution.flyout.tour.entities.title": "De nouvelles informations sur les hôtes et les utilisateurs sont disponibles",
Expand Down
16 changes: 8 additions & 8 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -7006,6 +7006,14 @@
"securitySolutionPackages.features.featureRegistry.subFeatures.trustedApplications": "信頼できるアプリケーション",
"securitySolutionPackages.features.featureRegistry.subFeatures.trustedApplications.description": "他のソフトウェア(通常は他のウイルス対策またはエンドポイントセキュリティアプリケーション)との競合を軽減することができます。",
"securitySolutionPackages.features.featureRegistry.subFeatures.trustedApplications.privilegesTooltip": "信頼できるアプリケーションのアクセスには、すべてのスペースが必要です。",
"securitySolutionPackages.flyout.right.header.collapseDetailButtonAriaLabel": "詳細を折りたたむ",
"securitySolutionPackages.flyout.right.header.collapseDetailButtonLabel": "詳細を折りたたむ",
"securitySolutionPackages.flyout.right.header.expandDetailButtonAriaLabel": "詳細を展開",
"securitySolutionPackages.flyout.right.header.expandDetailButtonLabel": "詳細を展開",
"securitySolutionPackages.flyout.shared.errorDescription": "{message}の表示中にエラーが発生しました。",
"securitySolutionPackages.flyout.shared.errorTitle": "{title}を表示できません。",
"securitySolutionPackages.flyout.shared.ExpandablePanelButtonIconAriaLabel": "展開可能なパネルトグル",
"securitySolutionPackages.flyout.shared.expandablePanelLoadingAriaLabel": "展開可能なパネル",
"securitySolutionPackages.markdown.investigationGuideInteractions.upsell": "{requiredLicense}にアップグレードして、調査ガイドのインタラクションを利用",
"securitySolutionPackages.navigation.landingLinks": "セキュリティビュー",
"securitySolutionPackages.sideNav.betaBadge.label": "ベータ",
Expand Down Expand Up @@ -39209,10 +39217,6 @@
"xpack.securitySolution.flyout.right.alertPreview.ariaLabel": "ID {id}のアラートをプレビュー",
"xpack.securitySolution.flyout.right.eventCategoryText": "イベントカテゴリ",
"xpack.securitySolution.flyout.right.header.assignedTitle": "担当者",
"securitySolutionPackages.flyout.right.header.collapseDetailButtonAriaLabel": "詳細を折りたたむ",
"securitySolutionPackages.flyout.right.header.collapseDetailButtonLabel": "詳細を折りたたむ",
"securitySolutionPackages.flyout.right.header.expandDetailButtonAriaLabel": "詳細を展開",
"securitySolutionPackages.flyout.right.header.expandDetailButtonLabel": "詳細を展開",
"xpack.securitySolution.flyout.right.header.headerTitle": "ドキュメント詳細",
"xpack.securitySolution.flyout.right.header.jsonTabLabel": "JSON",
"xpack.securitySolution.flyout.right.header.overviewTabLabel": "概要",
Expand Down Expand Up @@ -39299,10 +39303,6 @@
"xpack.securitySolution.flyout.right.visualizations.sessionPreview.timeDescription": "に",
"xpack.securitySolution.flyout.right.visualizations.sessionPreview.upsellDescription": "この機能には{subscription}が必要です",
"xpack.securitySolution.flyout.right.visualizations.sessionPreview.upsellLinkText": "エンタープライズサブスクリプション",
"securitySolutionPackages.flyout.shared.errorDescription": "{message}の表示中にエラーが発生しました。",
"securitySolutionPackages.flyout.shared.errorTitle": "{title}を表示できません。",
"securitySolutionPackages.flyout.shared.ExpandablePanelButtonIconAriaLabel": "展開可能なパネルトグル",
"securitySolutionPackages.flyout.shared.expandablePanelLoadingAriaLabel": "展開可能なパネル",
"xpack.securitySolution.flyout.tour.entities.description": "アラートに関連付けられたホストとユーザーの詳細については、展開された{entities}ビューを確認してください。",
"xpack.securitySolution.flyout.tour.entities.text": "エンティティ",
"xpack.securitySolution.flyout.tour.entities.title": "新しいホストとユーザーのインサイトがあります",
Expand Down
16 changes: 8 additions & 8 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -7017,6 +7017,14 @@
"securitySolutionPackages.features.featureRegistry.subFeatures.trustedApplications": "受信任的应用程序",
"securitySolutionPackages.features.featureRegistry.subFeatures.trustedApplications.description": "帮助减少与其他软件(通常指其他防病毒或终端安全应用程序)的冲突。",
"securitySolutionPackages.features.featureRegistry.subFeatures.trustedApplications.privilegesTooltip": "访问受信任的应用程序需要所有工作区。",
"securitySolutionPackages.flyout.right.header.collapseDetailButtonAriaLabel": "折叠详情",
"securitySolutionPackages.flyout.right.header.collapseDetailButtonLabel": "折叠详情",
"securitySolutionPackages.flyout.right.header.expandDetailButtonAriaLabel": "展开详情",
"securitySolutionPackages.flyout.right.header.expandDetailButtonLabel": "展开详情",
"securitySolutionPackages.flyout.shared.errorDescription": "显示 {message} 时出现错误。",
"securitySolutionPackages.flyout.shared.errorTitle": "无法显示 {title}。",
"securitySolutionPackages.flyout.shared.ExpandablePanelButtonIconAriaLabel": "可展开面板切换按钮",
"securitySolutionPackages.flyout.shared.expandablePanelLoadingAriaLabel": "可展开面板",
"securitySolutionPackages.markdown.insight.upsell": "升级到{requiredLicense}以利用调查指南中的洞见",
"securitySolutionPackages.markdown.investigationGuideInteractions.upsell": "升级到 {requiredLicense} 以利用调查指南交互",
"securitySolutionPackages.navigation.landingLinks": "安全视图",
Expand Down Expand Up @@ -39253,10 +39261,6 @@
"xpack.securitySolution.flyout.right.alertPreview.ariaLabel": "预览 ID 为 {id} 的告警",
"xpack.securitySolution.flyout.right.eventCategoryText": "事件类别",
"xpack.securitySolution.flyout.right.header.assignedTitle": "被分配人",
"securitySolutionPackages.flyout.right.header.collapseDetailButtonAriaLabel": "折叠详情",
"securitySolutionPackages.flyout.right.header.collapseDetailButtonLabel": "折叠详情",
"securitySolutionPackages.flyout.right.header.expandDetailButtonAriaLabel": "展开详情",
"securitySolutionPackages.flyout.right.header.expandDetailButtonLabel": "展开详情",
"xpack.securitySolution.flyout.right.header.headerTitle": "文档详情",
"xpack.securitySolution.flyout.right.header.jsonTabLabel": "JSON",
"xpack.securitySolution.flyout.right.header.overviewTabLabel": "概览",
Expand Down Expand Up @@ -39342,10 +39346,6 @@
"xpack.securitySolution.flyout.right.visualizations.sessionPreview.timeDescription": "处于",
"xpack.securitySolution.flyout.right.visualizations.sessionPreview.upsellDescription": "此功能需要{subscription}",
"xpack.securitySolution.flyout.right.visualizations.sessionPreview.upsellLinkText": "企业级订阅",
"securitySolutionPackages.flyout.shared.errorDescription": "显示 {message} 时出现错误。",
"securitySolutionPackages.flyout.shared.errorTitle": "无法显示 {title}。",
"securitySolutionPackages.flyout.shared.ExpandablePanelButtonIconAriaLabel": "可展开面板切换按钮",
"securitySolutionPackages.flyout.shared.expandablePanelLoadingAriaLabel": "可展开面板",
"xpack.securitySolution.flyout.tour.entities.description": "请查阅展开的 {entities} 视图以了解与该告警有关的主机和用户的更多信息。",
"xpack.securitySolution.flyout.tour.entities.text": "实体",
"xpack.securitySolution.flyout.tour.entities.title": "有新主机和用户洞见可用",
Expand Down

0 comments on commit f29bf1c

Please sign in to comment.