From 9724c46be1257a4287bb313a1cb85407bf0349e3 Mon Sep 17 00:00:00 2001 From: Jusheng Huang <117657272+viajes7@users.noreply.github.com> Date: Fri, 29 Nov 2024 00:58:57 +0800 Subject: [PATCH] [ILM] fix remove the unnecessary toast notification (#201524) ## Summary Fixes #129647 After fixup: image --- .../sections/edit_policy/edit_policy.tsx | 35 ++++++++----------- .../translations/translations/fr-FR.json | 1 - .../translations/translations/ja-JP.json | 1 - .../translations/translations/zh-CN.json | 1 - 4 files changed, 15 insertions(+), 23 deletions(-) diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.tsx index f254c7d525759..20ca1fbc82a2f 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.tsx @@ -33,7 +33,6 @@ import { useKibana, useFormIsModified, } from '../../../shared_imports'; -import { toasts } from '../../services/notification'; import { getPoliciesListPath, getPolicyViewPath } from '../../services/navigation'; import { UseField } from './form'; import { savePolicy } from './save_policy'; @@ -137,25 +136,21 @@ export const EditPolicy: React.FunctionComponent = () => { const { data: policy, isValid } = await form.submit(); if (!isValid) { - toasts.addDanger( - i18n.translate('xpack.indexLifecycleMgmt.editPolicy.formErrorsMessage', { - defaultMessage: 'Please fix the errors on this page.', - }) - ); - } else { - const name = getPolicyName(); - setHasSubmittedForm(true); - const success = await savePolicy( - { - ...policy, - name, - }, - isNewPolicy || isClonedPolicy - ); - - if (success) { - backToPolicyList(name); - } + return; + } + + const name = getPolicyName(); + setHasSubmittedForm(true); + const success = await savePolicy( + { + ...policy, + name, + }, + isNewPolicy || isClonedPolicy + ); + + if (success) { + backToPolicyList(name); } }; diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 183b8724c2455..b22dd8b9c2f51 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -23702,7 +23702,6 @@ "xpack.indexLifecycleMgmt.editPolicy.forceMerge.enableExplanationText": "Réduisez le nombre de segments dans chaque partition d'index et nettoyez les documents supprimés.", "xpack.indexLifecycleMgmt.editPolicy.forceMerge.enableText": "Forcer la fusion", "xpack.indexLifecycleMgmt.editPolicy.forcemerge.numberOfSegmentsRequiredError": "Valeur obligatoire du nombre de segments.", - "xpack.indexLifecycleMgmt.editPolicy.formErrorsMessage": "Veuillez corriger les erreurs sur cette page.", "xpack.indexLifecycleMgmt.editPolicy.frozenPhase.activateFrozenPhaseSwitchLabel": "Activer la phase \"frozen\"", "xpack.indexLifecycleMgmt.editPolicy.frozenPhase.frozenPhaseDescription": "Transférez les données au niveau \"frozen\" pour les conserver sur le long terme. Le niveau \"frozen\" représente le moyen le plus rentable de conserver vos données tout en permettant d'effectuer des recherches.", "xpack.indexLifecycleMgmt.editPolicy.frozenPhase.frozenPhaseTitle": "Phase \"frozen\"", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 045a68d9abdab..710bcd937efc4 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -23674,7 +23674,6 @@ "xpack.indexLifecycleMgmt.editPolicy.forceMerge.enableExplanationText": "各インデックスシャードのセグメント数を減らし、削除したドキュメントをクリーンアップします。", "xpack.indexLifecycleMgmt.editPolicy.forceMerge.enableText": "強制結合", "xpack.indexLifecycleMgmt.editPolicy.forcemerge.numberOfSegmentsRequiredError": "セグメント数の評価が必要です。", - "xpack.indexLifecycleMgmt.editPolicy.formErrorsMessage": "このページのエラーを修正してください。", "xpack.indexLifecycleMgmt.editPolicy.frozenPhase.activateFrozenPhaseSwitchLabel": "フローズンフェーズをアクティブ化", "xpack.indexLifecycleMgmt.editPolicy.frozenPhase.frozenPhaseDescription": "長期間保持する場合はデータをフローズンティアに移動します。フローズンティアはデータを格納し、検索することもできる最も費用対効果が高い方法です。", "xpack.indexLifecycleMgmt.editPolicy.frozenPhase.frozenPhaseTitle": "フローズンフェーズ", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index d747917e0339d..8d17a753111c6 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -23273,7 +23273,6 @@ "xpack.indexLifecycleMgmt.editPolicy.forceMerge.enableExplanationText": "减少每个索引分片中的分段数目,并清除删除的文档。", "xpack.indexLifecycleMgmt.editPolicy.forceMerge.enableText": "强制合并", "xpack.indexLifecycleMgmt.editPolicy.forcemerge.numberOfSegmentsRequiredError": "必须指定分段数的值。", - "xpack.indexLifecycleMgmt.editPolicy.formErrorsMessage": "请修复此页面上的错误。", "xpack.indexLifecycleMgmt.editPolicy.frozenPhase.activateFrozenPhaseSwitchLabel": "激活冻结阶段", "xpack.indexLifecycleMgmt.editPolicy.frozenPhase.frozenPhaseDescription": "将数据移到冻层以长期保留。冻层提供最有成本效益的方法存储数据,并且仍能够搜索数据。", "xpack.indexLifecycleMgmt.editPolicy.frozenPhase.frozenPhaseTitle": "冻结阶段",