From 46b667fccbdaae793f20ccc18b4d76315464270e Mon Sep 17 00:00:00 2001 From: Johanah LEKEU Date: Thu, 14 Nov 2024 09:46:44 +0100 Subject: [PATCH] Resolve PR comments --- .../src/admin/components/scenarios/ScenarioCreation.tsx | 9 ++------- openbas-front/src/utils/Localization.js | 4 ++++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/openbas-front/src/admin/components/scenarios/ScenarioCreation.tsx b/openbas-front/src/admin/components/scenarios/ScenarioCreation.tsx index fb3c08afe9..04695b2909 100644 --- a/openbas-front/src/admin/components/scenarios/ScenarioCreation.tsx +++ b/openbas-front/src/admin/components/scenarios/ScenarioCreation.tsx @@ -1,7 +1,6 @@ import { FunctionComponent, useState } from 'react'; import { useNavigate } from 'react-router-dom'; -import { fetchPlatformParameters } from '../../../actions/Application'; import { LoggedHelper } from '../../../actions/helper'; import type { ScenarioStore } from '../../../actions/scenarios/Scenario'; import { addScenario } from '../../../actions/scenarios/scenario-actions'; @@ -11,7 +10,6 @@ import { useFormatter } from '../../../components/i18n'; import { useHelper } from '../../../store'; import type { PlatformSettings, ScenarioInput } from '../../../utils/api-types'; import { useAppDispatch } from '../../../utils/hooks'; -import useDataLoader from '../../../utils/hooks/useDataLoader'; import ScenarioForm from './ScenarioForm'; interface Props { @@ -46,9 +44,6 @@ const ScenarioCreation: FunctionComponent = ({ const { settings }: { settings: PlatformSettings } = useHelper((helper: LoggedHelper) => ({ settings: helper.getPlatformSettings(), })); - useDataLoader(() => { - dispatch(fetchPlatformParameters()); - }); const initialValues: ScenarioInput = { scenario_name: '', @@ -60,8 +55,8 @@ const ScenarioCreation: FunctionComponent = ({ scenario_external_reference: '', scenario_external_url: '', scenario_tags: [], - scenario_message_header: 'SIMULATION HEADER', - scenario_message_footer: 'SIMULATION FOOTER', + scenario_message_header: t('SIMULATION HEADER'), + scenario_message_footer: t('SIMULATION FOOTER'), scenario_mail_from: settings.default_mailer ? settings.default_mailer : '', scenario_mails_reply_to: [settings.default_reply_to ? settings.default_reply_to : ''], }; diff --git a/openbas-front/src/utils/Localization.js b/openbas-front/src/utils/Localization.js index 26bf8219a3..1002947a74 100644 --- a/openbas-front/src/utils/Localization.js +++ b/openbas-front/src/utils/Localization.js @@ -360,6 +360,8 @@ const i18n = { 'Form request data': 'Données de formulaire de la requête', 'Key': 'Clé', 'Headers': 'En-têtes', + 'SIMULATION HEADER': 'EN-TÊTE DE SIMULATION', + 'SIMULATION FOOTER': 'PIED DE PAGE DE SIMULATION', 'team': 'Equipe', 'attachment': 'Document', 'Executed in': 'Exécuté en', @@ -1766,6 +1768,8 @@ const i18n = { 'Form request data': '申请表数据', 'Key': '密钥', 'Headers': '头部', + 'SIMULATION HEADER': '模拟标头', + 'SIMULATION FOOTER': '模拟页脚', 'team': '团队', 'attachment': '附件', 'Executed in': '已执行',