From e2a0c379980ef4e6014796cf7e9d378d7a304deb Mon Sep 17 00:00:00 2001 From: Loup Theron Date: Wed, 15 Jan 2025 11:48:18 +0100 Subject: [PATCH] Rename ignore alert to suspend --- frontend/src/api/alert.ts | 2 +- .../AlertListAndReportingList/PendingAlertRow.tsx | 14 +++++--------- .../AlertListAndReportingList/SilenceAlertMenu.tsx | 2 +- .../SideWindowAlerts/SilencedAlerts/index.tsx | 2 +- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/frontend/src/api/alert.ts b/frontend/src/api/alert.ts index 7c18241d0a..b6a1f60853 100644 --- a/frontend/src/api/alert.ts +++ b/frontend/src/api/alert.ts @@ -15,7 +15,7 @@ import type { export const ALERTS_ERROR_MESSAGE = "Nous n'avons pas pu récupérer les alertes opérationelles" export const VALIDATE_ALERT_ERROR_MESSAGE = "Nous n'avons pas pu valider l'alerte opérationelle" -export const SILENCE_ALERT_ERROR_MESSAGE = "Nous n'avons pas pu ignorer l'alerte opérationelle" +export const SILENCE_ALERT_ERROR_MESSAGE = "Nous n'avons pas pu suspendre l'alerte opérationelle" export const DELETE_SILENCED_ALERT_ERROR_MESSAGE = "Nous n'avons pas pu réactiver l'alerte opérationelle" export const CREATE_SILENCED_ALERT_ERROR_MESSAGE = "Nous n'avons pas pu suspendre l'alerte opérationelle" diff --git a/frontend/src/features/Alert/components/SideWindowAlerts/AlertListAndReportingList/PendingAlertRow.tsx b/frontend/src/features/Alert/components/SideWindowAlerts/AlertListAndReportingList/PendingAlertRow.tsx index 9c65caa88a..20ab6be8b0 100644 --- a/frontend/src/features/Alert/components/SideWindowAlerts/AlertListAndReportingList/PendingAlertRow.tsx +++ b/frontend/src/features/Alert/components/SideWindowAlerts/AlertListAndReportingList/PendingAlertRow.tsx @@ -4,7 +4,6 @@ import { useMainAppDispatch } from '@hooks/useMainAppDispatch' import { useMainAppSelector } from '@hooks/useMainAppSelector' import countries from 'i18n-iso-countries' import { useEffect, useMemo, useRef } from 'react' -import { batch } from 'react-redux' import { FlexboxGrid, List } from 'rsuite' import styled from 'styled-components' import * as timeago from 'timeago.js' @@ -18,7 +17,6 @@ import type { LEGACY_PendingAlert } from '../../../types' import type { MutableRefObject, CSSProperties } from 'react' import type { Promisable } from 'type-fest' -// TODO Type these props. export type PendingAlertRowProps = { alert: LEGACY_PendingAlert index: number @@ -70,7 +68,7 @@ export function PendingAlertRow({ )} {silencedAlertsQueueMatch && ( - L’alerte sera ignorée {getSilencedAlertPeriodText(silencedAlertsQueueMatch.silencedAlertPeriodRequest)} + L’alerte sera suspendue {getSilencedAlertPeriodText(silencedAlertsQueueMatch.silencedAlertPeriodRequest)} )} {!alert.isValidated && ( @@ -120,13 +118,11 @@ export function PendingAlertRow({ { - batch(() => { - setShowSilencedAlertForIndex(index + 1) - setSilencedAlertId(alert.id) - }) + setShowSilencedAlertForIndex(index + 1) + setSilencedAlertId(alert.id) }} onMouseOut={e => { if (showSilencedAlertForIndex !== index + 1) { @@ -142,7 +138,7 @@ export function PendingAlertRow({ : `${baseUrl}/Icone_ignorer_alerte.png` } style={silenceAlertStyle} - title="Ignorer l'alerte" + title="Suspendre l'alerte" /> diff --git a/frontend/src/features/Alert/components/SideWindowAlerts/AlertListAndReportingList/SilenceAlertMenu.tsx b/frontend/src/features/Alert/components/SideWindowAlerts/AlertListAndReportingList/SilenceAlertMenu.tsx index 0b9b002894..0cf7870455 100644 --- a/frontend/src/features/Alert/components/SideWindowAlerts/AlertListAndReportingList/SilenceAlertMenu.tsx +++ b/frontend/src/features/Alert/components/SideWindowAlerts/AlertListAndReportingList/SilenceAlertMenu.tsx @@ -71,7 +71,7 @@ export function SilenceAlertMenu({ style={silenceMenuStyle(showSilencedAlertForIndex, scrollableContainer?.current.scrollTop || 0)} > <> - Ignorer l’alerte pour... + Suspendre l’alerte pour... silenceAlert(silenceAlertRequestFromMenu(SilencedAlertPeriod.THIS_OCCURRENCE), id)} onMouseOut={e => setBackgroundAsNotHovered(e)} diff --git a/frontend/src/features/Alert/components/SideWindowAlerts/SilencedAlerts/index.tsx b/frontend/src/features/Alert/components/SideWindowAlerts/SilencedAlerts/index.tsx index 1c36a6b851..b2257975a2 100644 --- a/frontend/src/features/Alert/components/SideWindowAlerts/SilencedAlerts/index.tsx +++ b/frontend/src/features/Alert/components/SideWindowAlerts/SilencedAlerts/index.tsx @@ -102,7 +102,7 @@ export function SilencedAlerts() { Navire Titre NATINF - Ignorée pour... + Suspendue pour... Reprise le...