Skip to content

Commit

Permalink
Add timed EOL warning and effectve notices
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Reynolds <[email protected]>
  • Loading branch information
gsreynolds committed Nov 25, 2024
1 parent 0f22072 commit db0bdb6
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.**

Expand Down
35 changes: 32 additions & 3 deletions src/components/DeprecationAlert/DeprecationAlert.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import {
useTranslation, Trans,
} from 'react-i18next';

import i18next from 'src/i18n';

const DeprecationAlertComponent = () => {
const {
isOpen: isVisible, onClose,
Expand All @@ -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 ? (
<Alert status="info">
<Alert status={eolStatus}>
<AlertIcon />
<Box w="100%">
<AlertTitle>{t('PD Live is deprecated')}</AlertTitle>
<AlertTitle>{t(alertTitle)}</AlertTitle>
<AlertDescription>
<Trans i18nKey="Deprecation">
<Trans i18nKey={i18nKey}>
Deprecation Notice
<a
href="https://support.pagerduty.com/main/docs/operations-console"
Expand All @@ -54,4 +73,14 @@ const DeprecationAlertComponent = () => {
);
};

// 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;
4 changes: 4 additions & 0 deletions src/locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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</1>.",
"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</1>.",
"error": "fehler",
"Error": "Fehler",
"Escalate": "Eskalieren",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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</1> 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</1> instead.",
"error": "error",
"Error": "Error",
"Escalate": "Escalate",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions src/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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</1> 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</1> en su lugar.",
"error": "error",
"Error": "Error",
"Escalate": "Escalar",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions src/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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</1> à 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</1> à la place.",
"error": "erreur",
"Error": "Erreur",
"Escalate": "Escalader",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions src/locales/id/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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</1> 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</1> sebagai gantinya.",
"error": "error",
"Error": "Error",
"Escalate": "Eskalasi",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions src/locales/ja/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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</1>に移行してください。",
"EOLWarning": "PD Liveは2025年1月31日にEnd of Life(EOL)に達します。この日以降、PD Liveはサポートされなくなります。代わりに<1>Operations Console</1>に移行してください。",
"error": "error",
"Error": "Error",
"Escalate": "エスカレート",
Expand Down Expand Up @@ -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": "ポーリング中",
Expand Down
4 changes: 4 additions & 0 deletions src/locales/pt-br/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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</1> 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</1> em vez disso.",
"error": "erro",
"Error": "Erro",
"Escalate": "Escalar",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions src/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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</1> 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</1> em vez disso.",
"error": "erro",
"Error": "Erro",
"Escalate": "Escalar",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit db0bdb6

Please sign in to comment.