From db0bdb60d74a5bb0a18696c297ec95322ab2328d Mon Sep 17 00:00:00 2001 From: Gavin Reynolds Date: Mon, 25 Nov 2024 11:25:18 +0000 Subject: [PATCH] Add timed EOL warning and effectve notices Signed-off-by: Gavin Reynolds --- README.md | 2 +- .../DeprecationAlert/DeprecationAlert.jsx | 35 +++++++++++++++++-- src/locales/de/translation.json | 4 +++ src/locales/en/translation.json | 4 +++ src/locales/es/translation.json | 4 +++ src/locales/fr/translation.json | 4 +++ src/locales/id/translation.json | 4 +++ src/locales/ja/translation.json | 4 +++ src/locales/pt-br/translation.json | 4 +++ src/locales/pt/translation.json | 4 +++ 10 files changed, 65 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index dec0f2a4..5fd471ba 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This repository hosts the source code for PagerDuty Live, an open-source, single **Live URL: https://pagerduty.github.io/pd-live-react/** -## :heavy_exclamation_mark: Deprecation +## :heavy_exclamation_mark: End of Life **This project has been replaced by [Operations Console](https://support.pagerduty.com/main/docs/operations-console), which is supported product from PagerDuty. Please plan to migrate to Operations Console instead.** diff --git a/src/components/DeprecationAlert/DeprecationAlert.jsx b/src/components/DeprecationAlert/DeprecationAlert.jsx index 308b7178..263dbd12 100644 --- a/src/components/DeprecationAlert/DeprecationAlert.jsx +++ b/src/components/DeprecationAlert/DeprecationAlert.jsx @@ -14,6 +14,8 @@ import { useTranslation, Trans, } from 'react-i18next'; +import i18next from 'src/i18n'; + const DeprecationAlertComponent = () => { const { isOpen: isVisible, onClose, @@ -22,13 +24,30 @@ const DeprecationAlertComponent = () => { t, } = useTranslation(); + const today = new Date(); + const eolWarningDate = new Date('2024-12-01'); + const eolDate = new Date('2025-01-31'); + let alertTitle = 'PD Live is deprecated'; + let i18nKey = 'Deprecation'; + let eolStatus = 'info'; + + if (today > eolDate) { + alertTitle = 'PD Live EOL: Effective'; + i18nKey = 'EOL'; + eolStatus = 'error'; + } else if (today > eolWarningDate) { + alertTitle = 'PD Live EOL: Approaching'; + i18nKey = 'EOLWarning'; + eolStatus = 'warning'; + } + return isVisible ? ( - + - {t('PD Live is deprecated')} + {t(alertTitle)} - + Deprecation Notice { ); }; +// List of eol names for i18next-parser +export const eolTranslations = [ + i18next.t('PD Live is deprecated'), + i18next.t('Deprecation'), + i18next.t('PD Live EOL: Approaching'), + i18next.t('EOLWarning'), + i18next.t('PD Live EOL: Effective'), + i18next.t('EOL'), +]; + export default DeprecationAlertComponent; diff --git a/src/locales/de/translation.json b/src/locales/de/translation.json index f24ffcd0..604f7845 100644 --- a/src/locales/de/translation.json +++ b/src/locales/de/translation.json @@ -66,6 +66,8 @@ "Download CSV (X alerts)_one": "CSV herunterladen (1 Benachrichtigung)", "Download CSV (X alerts)_other": "CSV herunterladen ({{count}} Benachrichtigungen)", "Drag and drop to reorder": "Ziehen und ablegen, um neu zu ordnen", + "EOL": "PD Live hat das Ende seines Lebenszyklus (EOL) erreicht und wird nicht mehr unterstützt. Bitte migrieren Sie stattdessen zu <1>Operations Console.", + "EOLWarning": "PD Live erreicht am 31. Januar 2025 das Ende seines Lebenszyklus (EOL). Nach diesem Datum wird PD Live nicht mehr unterstützt. Bitte migrieren Sie stattdessen zu <1>Operations Console.", "error": "fehler", "Error": "Fehler", "Escalate": "Eskalieren", @@ -152,6 +154,8 @@ "OK": "OK", "on": "ein", "Open Incidents": "Offene Vorfälle", + "PD Live EOL: Approaching": "PD Live EOL: Annähernd", + "PD Live EOL: Effective": "PD Live EOL: Wirksam", "PD Live is deprecated": "PD Live ist veraltet", "Please contact the associated site owner for access": "Bitte wenden Sie sich an den Eigentümer der zugehörigen Website, um Zugriff zu erhalten", "Polling": "Abfragen", diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index fc97b052..19563350 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -66,6 +66,8 @@ "Download CSV (X alerts)_one": "Download CSV (1 alert)", "Download CSV (X alerts)_other": "Download CSV ({{count}} alerts)", "Drag and drop to reorder": "Drag and drop to reorder", + "EOL": "PD Live has reached its End of Life (EOL) and is no longer supported. Please migrate to <1>Operations Console instead.", + "EOLWarning": "PD Live will reach its End of Life (EOL) on 31st January 2025. After this date PD Live will no longer be supported. Please migrate to <1>Operations Console instead.", "error": "error", "Error": "Error", "Escalate": "Escalate", @@ -152,6 +154,8 @@ "OK": "OK", "on": "on", "Open Incidents": "Open Incidents", + "PD Live EOL: Approaching": "PD Live EOL: Approaching", + "PD Live EOL: Effective": "PD Live EOL: Effective", "PD Live is deprecated": "PD Live is deprecated", "Please contact the associated site owner for access": "Please contact the associated site owner for access", "Polling": "Polling", diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json index 3ce46576..0a52c1fa 100644 --- a/src/locales/es/translation.json +++ b/src/locales/es/translation.json @@ -67,6 +67,8 @@ "Download CSV (X alerts)_many": "Descargar CSV ({{count}} alertas)", "Download CSV (X alerts)_other": "Descargar CSV ({{count}} alertas)", "Drag and drop to reorder": "Arrastrar y soltar para reordenar", + "EOL": "PD Live ha alcanzado su fin de vida (EOL) y ya no tiene soporte. Por favor, migre a <1>Operations Console en su lugar.", + "EOLWarning": "PD Live alcanzará su fin de vida (EOL) el 31 de enero de 2025. Después de esta fecha, PD Live ya no recibirá soporte. Por favor, migre a <1>Operations Console en su lugar.", "error": "error", "Error": "Error", "Escalate": "Escalar", @@ -154,6 +156,8 @@ "OK": "OK", "on": "en", "Open Incidents": "Incidentes abiertos", + "PD Live EOL: Approaching": "PD Live EOL: Aproximación", + "PD Live EOL: Effective": "PD Live EOL: Efectivo", "PD Live is deprecated": "PD Live está obsoleto", "Please contact the associated site owner for access": "Póngase en contacto con el propietario del sitio asociado para obtener acceso", "Polling": "Sondeo", diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.json index 78aed28f..cc09877e 100644 --- a/src/locales/fr/translation.json +++ b/src/locales/fr/translation.json @@ -67,6 +67,8 @@ "Download CSV (X alerts)_many": "Télécharger CSV ({{count}} alertes)", "Download CSV (X alerts)_other": "Télécharger CSV ({{count}} alertes)", "Drag and drop to reorder": "Glisser-déposer pour réorganiser", + "EOL": "PD Live a atteint sa fin de vie (EOL) et n'est plus pris en charge. Veuillez migrer vers <1>Operations Console à la place.", + "EOLWarning": "PD Live atteindra sa fin de vie (EOL) le 31 janvier 2025. Après cette date, PD Live ne sera plus pris en charge. Veuillez migrer vers <1>Operations Console à la place.", "error": "erreur", "Error": "Erreur", "Escalate": "Escalader", @@ -154,6 +156,8 @@ "OK": "OK", "on": "sur", "Open Incidents": "Incidents ouverts", + "PD Live EOL: Approaching": "PD Live EOL: en approche", + "PD Live EOL: Effective": "PD Live EOL: efficace", "PD Live is deprecated": "PD Live est obsolète", "Please contact the associated site owner for access": "Please contact the associated site owner for access", "Polling": "Interrogation", diff --git a/src/locales/id/translation.json b/src/locales/id/translation.json index cd634b11..1556deb0 100644 --- a/src/locales/id/translation.json +++ b/src/locales/id/translation.json @@ -65,6 +65,8 @@ "Don't Restart": "Jangan Mulai Ulang", "Download CSV (X alerts)_other": "Unduh CSV ({{count}} peringatan)", "Drag and drop to reorder": "Seret dan lepas untuk mengurutkan ulang", + "EOL": "PD Live telah mencapai End of Life (EOL) dan tidak lagi didukung. Silakan bermigrasi ke <1>Operations Console sebagai gantinya.", + "EOLWarning": "PD Live akan mencapai End of Life (EOL) pada 31 Januari 2025. Setelah tanggal ini, PD Live tidak akan lagi didukung. Silakan bermigrasi ke <1>Operations Console sebagai gantinya.", "error": "error", "Error": "Error", "Escalate": "Eskalasi", @@ -150,6 +152,8 @@ "OK": "OK", "on": "on", "Open Incidents": "Insiden yang Dibuka", + "PD Live EOL: Approaching": "PD Live EOL: Mendekati", + "PD Live EOL: Effective": "PD Live EOL: Efektif", "PD Live is deprecated": "PD Live sudah tidak digunakan lagi", "Please contact the associated site owner for access": "Silakan hubungi pemilik situs terkait untuk akses", "Polling": "Polling", diff --git a/src/locales/ja/translation.json b/src/locales/ja/translation.json index 33c01c9e..42ef1fc7 100644 --- a/src/locales/ja/translation.json +++ b/src/locales/ja/translation.json @@ -65,6 +65,8 @@ "Don't Restart": "再起動しない", "Download CSV (X alerts)_other": "CSVをダウンロード({{count}}件)", "Drag and drop to reorder": "ドラッグ&ドロップで並び替え", + "EOL": "PD LiveはEnd of Life(EOL)に達し、サポートされなくなりました。代わりに<1>Operations Consoleに移行してください。", + "EOLWarning": "PD Liveは2025年1月31日にEnd of Life(EOL)に達します。この日以降、PD Liveはサポートされなくなります。代わりに<1>Operations Consoleに移行してください。", "error": "error", "Error": "Error", "Escalate": "エスカレート", @@ -150,6 +152,8 @@ "OK": "OK", "on": "。対象:", "Open Incidents": "オープンインシデント", + "PD Live EOL: Approaching": "PD Live EOL: 近づいています", + "PD Live EOL: Effective": "PD Live EOL: 有効", "PD Live is deprecated": "PD Liveは非推奨です", "Please contact the associated site owner for access": "アクセスするには、サイトオーナーにお問い合わせください", "Polling": "ポーリング中", diff --git a/src/locales/pt-br/translation.json b/src/locales/pt-br/translation.json index e3a02fd2..ec524701 100644 --- a/src/locales/pt-br/translation.json +++ b/src/locales/pt-br/translation.json @@ -67,6 +67,8 @@ "Download CSV (X alerts)_many": "Baixar CSV ({{count}} alertas)", "Download CSV (X alerts)_other": "Baixar CSV ({{count}} alertas)", "Drag and drop to reorder": "Arraste e solte para reordenar", + "EOL": "PD Live atingiu o seu Fim de Vida (EOL) e não é mais suportado. Por favor, migre para <1>Operations Console em vez disso.", + "EOLWarning": "PD Live atingirá o seu Fim de Vida (EOL) em 31 de janeiro de 2025. Após esta data, o PD Live não será mais suportado. Por favor, migre para <1>Operations Console em vez disso.", "error": "erro", "Error": "Erro", "Escalate": "Escalar", @@ -154,6 +156,8 @@ "OK": "OK", "on": "em", "Open Incidents": "Incidentes Abertos", + "PD Live EOL: Approaching": "PD Live EOL: Aproximação", + "PD Live EOL: Effective": "PD Live EOL: Eficaz", "PD Live is deprecated": "PD Live está obsoleto", "Please contact the associated site owner for access": "Por favor entre em contato com o proprietário do site associado para obter acesso", "Polling": "Consultando", diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json index 2de68794..7720e433 100644 --- a/src/locales/pt/translation.json +++ b/src/locales/pt/translation.json @@ -67,6 +67,8 @@ "Download CSV (X alerts)_many": "Baixar CSV ({{count}} alertas)", "Download CSV (X alerts)_other": "Baixar CSV ({{count}} alertas)", "Drag and drop to reorder": "Arraste e solte para reordenar", + "EOL": "PD Live atingiu o seu Fim de Vida (EOL) e já não é suportado. Por favor, migre para <1>Operations Console em vez disso.", + "EOLWarning": "PD Live atingirá o seu Fim de Vida (EOL) a 31 de janeiro de 2025. Após esta data, o PD Live deixará de ser suportado. Por favor, migre para <1>Operations Console em vez disso.", "error": "erro", "Error": "Erro", "Escalate": "Escalar", @@ -154,6 +156,8 @@ "OK": "OK", "on": "em", "Open Incidents": "Incidentes Abertos", + "PD Live EOL: Approaching": "PD Live EOL: Aproximação", + "PD Live EOL: Effective": "PD Live EOL: Eficaz", "PD Live is deprecated": "PD Live está obsoleto", "Please contact the associated site owner for access": "Por favor entre em contato com o proprietário do site associado para obter acesso", "Polling": "A sondar",