Skip to content

Commit

Permalink
Merge pull request #494 from PagerDuty/release/0.14.0-beta.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gsreynolds authored Sep 11, 2024
2 parents d5ac12e + 338cfda commit cd6d4e0
Show file tree
Hide file tree
Showing 23 changed files with 106 additions and 43 deletions.
1 change: 0 additions & 1 deletion .github/workflows/cd-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
VITE_PD_ENV: ${{ secrets.PD_ENV }}
VITE_PD_SUBDOMAIN_ALLOW_LIST: '*'
VITE_PD_OAUTH_CLIENT_ID: ${{ secrets.PD_OAUTH_CLIENT_ID }}
VITE_PD_OAUTH_CLIENT_SECRET: ${{ secrets.PD_OAUTH_CLIENT_SECRET }}
VITE_PD_REQUIRED_ABILITY: 'teams'
VITE_DD_APPLICATION_ID: ${{ secrets.DD_APPLICATION_ID }}
VITE_DD_CLIENT_TOKEN: ${{ secrets.DD_CLIENT_TOKEN }}
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ 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

**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.**

## :warning: Disclaimer

**This project is not officially supported by PagerDuty and therefore no issues can be reported to or resolved by PagerDuty Support.
Expand Down Expand Up @@ -45,7 +49,6 @@ The following _optional_ parameters can be used in a `.env` file to override Pag
| ----------- | ----------- |
| `VITE_PD_ENV` | PagerDuty Live Environment Tag; defaults to `localhost-dev` if not set |
| `VITE_PD_OAUTH_CLIENT_ID` | PagerDuty OAuth App client ID (created upon registering app) |
| `VITE_PD_OAUTH_CLIENT_SECRET` | PagerDuty OAuth App client secret (created upon registering app) |
| `VITE_PD_USER_TOKEN` | PagerDuty [Personal API Token](https://support.pagerduty.com/docs/generating-api-keys#generating-a-personal-rest-api-key); this will override OAuth login workflow if set and should be used for integration tests|
| `VITE_PD_SUBDOMAIN_ALLOW_LIST` | Comma separated list of allowed subdomains (e.g. `acme-prod,acme-dev`) |
| `VITE_PD_REQUIRED_ABILITY` | PagerDuty account-level [ability](https://developer.pagerduty.com/api-reference/b3A6Mjc0ODEwMg-list-abilities) required to use application |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pd-live-react",
"homepage": "https://pagerduty.github.io/pd-live-react",
"version": "0.13.2-beta.0",
"version": "0.14.0-beta.0",
"private": true,
"dependencies": {
"@chakra-ui/icons": "^2.1.1",
Expand Down
6 changes: 4 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {

import moment from 'moment/min/moment-with-locales';

import DeprecationAlertComponent from 'src/components/DeprecationAlert/DeprecationAlert';
import CatastropheModal from 'src/components/CatastropheModal/CatastropheModal';
import AuthComponent from 'src/components/Auth/AuthComponent';
import UnauthorizedModalComponent from 'src/components/UnauthorizedModal/UnauthorizedModalComponent';
Expand Down Expand Up @@ -77,7 +78,7 @@ import {
} from 'src/redux/monitoring/actions';

import {
PD_USER_TOKEN, PD_OAUTH_CLIENT_ID, PD_OAUTH_CLIENT_SECRET,
PD_USER_TOKEN, PD_OAUTH_CLIENT_ID,
} from 'src/config/constants';

import 'src/App.scss';
Expand Down Expand Up @@ -168,7 +169,7 @@ const App = () => {
if (!PD_USER_TOKEN && (typeof token !== 'string' || !token.startsWith('pd'))) {
return (
<div className="App">
<AuthComponent clientId={PD_OAUTH_CLIENT_ID} clientSecret={PD_OAUTH_CLIENT_SECRET} />
<AuthComponent clientId={PD_OAUTH_CLIENT_ID} />
</div>
);
}
Expand Down Expand Up @@ -202,6 +203,7 @@ const App = () => {
>
<Box position="fixed" w="100%" h="100%" overflow="hidden">
<Box as="header" top={0} w="100%" pb={1}>
<DeprecationAlertComponent />
<NavigationBarComponent />
</Box>
<Box as="main" id="main">
Expand Down
4 changes: 4 additions & 0 deletions src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,7 @@ body.dark-mode div.react-select__option--is-focused {
color: $pd-brand-white !important;
}

a.external-link {
text-decoration: underline;
}

6 changes: 3 additions & 3 deletions src/components/Auth/AuthComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const AuthComponent = (props) => {
redirectURL,
} = props;
const {
clientId, clientSecret,
clientId,
} = props;

if (!redirectURL) {
Expand All @@ -52,7 +52,7 @@ const AuthComponent = (props) => {
const savedButtons = savedButtonsStr ? JSON.parse(savedButtonsStr) : [];
const buttonParams = savedButtons ? `?button=${savedButtons.join('&button=')}` : '';

exchangeCodeForToken(clientId, clientSecret, redirectURL, codeVerifier, code).then((data) => {
exchangeCodeForToken(clientId, redirectURL, codeVerifier, code).then((data) => {
const {
access_token: newAccessToken,
refresh_token: newRefreshToken,
Expand All @@ -77,7 +77,7 @@ const AuthComponent = (props) => {
} else {
sessionStorage.removeItem('pd_buttons');
}
getAuthURL(clientId, clientSecret, redirectURL, codeVerifier).then((url) => {
getAuthURL(clientId, redirectURL, codeVerifier).then((url) => {
const subdomainParams = subdomain ? `&subdomain=${subdomain}&service_region=${region}` : '';
setAuthURL(`${url}${subdomainParams}`);
});
Expand Down
57 changes: 57 additions & 0 deletions src/components/DeprecationAlert/DeprecationAlert.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import React from 'react';

import {
useDisclosure,
Alert,
AlertIcon,
AlertTitle,
AlertDescription,
Box,
CloseButton,
} from '@chakra-ui/react';

import {
useTranslation, Trans,
} from 'react-i18next';

const DeprecationAlertComponent = () => {
const {
isOpen: isVisible, onClose,
} = useDisclosure({ defaultIsOpen: true });
const {
t,
} = useTranslation();

return isVisible ? (
<Alert status="info">
<AlertIcon />
<Box w="100%">
<AlertTitle>{t('PD Live is deprecated')}</AlertTitle>
<AlertDescription>
<Trans i18nKey="Deprecation">
Deprecation Notice
<a
href="https://support.pagerduty.com/main/docs/operations-console"
rel="external nofollow noopener noreferrer"
className="external-link"
target="_blank"
>
Operations Console
</a>
</Trans>
</AlertDescription>
</Box>
<CloseButton
alignSelf="flex-start"
position="relative"
right={-1}
top={-1}
onClick={onClose}
/>
</Alert>
) : (
''
);
};

export default DeprecationAlertComponent;
4 changes: 2 additions & 2 deletions src/components/NavigationBar/NavigationBarComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
} from '@chakra-ui/icons';

import {
PD_OAUTH_CLIENT_ID, PD_OAUTH_CLIENT_SECRET,
PD_OAUTH_CLIENT_ID,
} from 'src/config/constants';

import {
Expand Down Expand Up @@ -203,7 +203,7 @@ const NavigationBarComponent = () => {
onClick={() => {
const token = sessionStorage.getItem('pd_access_token');
if (token) {
revokeToken(token, PD_OAUTH_CLIENT_ID, PD_OAUTH_CLIENT_SECRET);
revokeToken(token, PD_OAUTH_CLIENT_ID);
}
userAcceptDisclaimer();
userUnauthorize();
Expand Down
1 change: 0 additions & 1 deletion src/config/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export const PD_ENV = import.meta.env.VITE_PD_ENV || 'localhost-dev';

// Authentication
export const PD_OAUTH_CLIENT_ID = import.meta.env.VITE_PD_OAUTH_CLIENT_ID || null;
export const PD_OAUTH_CLIENT_SECRET = import.meta.env.VITE_PD_OAUTH_CLIENT_SECRET || null;
export const PD_SUBDOMAIN_ALLOW_LIST = import.meta.env.VITE_PD_SUBDOMAIN_ALLOW_LIST || '*';
export const PD_USER_TOKEN = import.meta.env.VITE_PD_USER_TOKEN || null;
export const PD_REQUIRED_ABILITY = import.meta.env.VITE_PD_REQUIRED_ABILITY || null;
Expand Down
2 changes: 1 addition & 1 deletion src/config/version.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Debugging Actions": "Debugging-Aktionen",
"Decline": "Ablehnen",
"Default Since Date Lookback": "Standard seit Datumsrückblick",
"Deprecation": "<1>Operations Console</1> ist die neue und verbesserte Version von PD Live und ein unterstütztes Produkt von PagerDuty. Bitte planen Sie, anstelle von PD Live zu Operations Console zu migrieren.",
"Description": "Beschreibung",
"Detailed Status": "Detaillierter Status",
"Disclaimer & License": "Haftungsausschluss & Lizenz",
Expand Down Expand Up @@ -151,6 +152,7 @@
"OK": "OK",
"on": "ein",
"Open Incidents": "Offene Vorfälle",
"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",
"Presets file is for a different subdomain": "Die Voreinstellungsdatei ist für eine andere Subdomain",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Debugging Actions": "Debugging Actions",
"Decline": "Decline",
"Default Since Date Lookback": "Default Since Date Lookback",
"Deprecation": "<1>Operations Console</1> is the new and improved version of PD Live, and is supported product from PagerDuty. Please plan to migrate to Operations Console instead.",
"Description": "Description",
"Detailed Status": "Detailed Status",
"Disclaimer & License": "Disclaimer & License",
Expand Down Expand Up @@ -151,6 +152,7 @@
"OK": "OK",
"on": "on",
"Open Incidents": "Open Incidents",
"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",
"Presets file is for a different subdomain": "Presets file is for a different subdomain",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Debugging Actions": "Acciones de depuración",
"Decline": "Rechazar",
"Default Since Date Lookback": "Vista previa de fecha de inicio predeterminada",
"Deprecation": "<1>Operations Console</1> es la versión nueva y mejorada de PD Live, y es un producto compatible de PagerDuty. Por favor, planee migrar a Operations Console en su lugar.",
"Description": "Descripción",
"Detailed Status": "Estado detallado",
"Disclaimer & License": "Aviso legal y licencia",
Expand Down Expand Up @@ -153,6 +154,7 @@
"OK": "OK",
"on": "en",
"Open Incidents": "Incidentes abiertos",
"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",
"Presets file is for a different subdomain": "El archivo de preajustes es para un subdominio diferente",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Debugging Actions": "Actions de débogage",
"Decline": "Décliner",
"Default Since Date Lookback": "Défaut depuis la date de recherche",
"Deprecation": "<1>Operations Console</1> est la nouvelle version améliorée de PD Live, et est un produit pris en charge par PagerDuty. Veuillez prévoir de migrer vers Operations Console à la place.",
"Description": "Description",
"Detailed Status": "Statut détaillé",
"Disclaimer & License": "Clause de non-responsabilité et licence (en anglais)",
Expand Down Expand Up @@ -153,6 +154,7 @@
"OK": "OK",
"on": "sur",
"Open Incidents": "Incidents ouverts",
"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",
"Presets file is for a different subdomain": "Le fichier de préréglages est pour un sous-domaine différent",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/id/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Debugging Actions": "Tindakan Debugging",
"Decline": "Tolak",
"Default Since Date Lookback": "Periode tampilan default",
"Deprecation": "<1>Operations Console</1> adalah versi baru dan ditingkatkan dari PD Live, dan merupakan produk yang didukung oleh PagerDuty. Silakan rencanakan untuk bermigrasi ke Operations Console sebagai gantinya.",
"Description": "Deskripsi",
"Detailed Status": "Status Detail",
"Disclaimer & License": "Sanggahan & Lisensi",
Expand Down Expand Up @@ -149,6 +150,7 @@
"OK": "OK",
"on": "on",
"Open Incidents": "Insiden yang Dibuka",
"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",
"Presets file is for a different subdomain": "File preset untuk subdomain yang berbeda",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/ja/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Debugging Actions": "デバッグアクション",
"Decline": "拒否",
"Default Since Date Lookback": "デフォルト表示期間",
"Deprecation": "<1>Operations Console</1> はPD Liveの新しいバージョンであり、PagerDutyからサポートされている製品です。代わりにOperations Consoleに移行する予定です。",
"Description": "説明",
"Detailed Status": "詳細ステータス",
"Disclaimer & License": "免責事項・ライセンス",
Expand Down Expand Up @@ -149,6 +150,7 @@
"OK": "OK",
"on": "。対象:",
"Open Incidents": "オープンインシデント",
"PD Live is deprecated": "PD Liveは非推奨です",
"Please contact the associated site owner for access": "アクセスするには、サイトオーナーにお問い合わせください",
"Polling": "ポーリング中",
"Presets file is for a different subdomain": "プリセットファイルは別のサブドメイン用です",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/pt-br/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Debugging Actions": "Ações de Depuração",
"Decline": "Recusar",
"Default Since Date Lookback": "Retrospectiva a partir de Data Predefinida",
"Deprecation": "<1>Operations Console</1> é a nova e melhorada versão do PD Live, e é um produto suportado pela PagerDuty. Por favor, planeje migrar para o Operations Console em vez disso.",
"Description": "Descrição",
"Detailed Status": "Estado Detalhado",
"Disclaimer & License": "Aviso Legal & Licença",
Expand Down Expand Up @@ -153,6 +154,7 @@
"OK": "OK",
"on": "em",
"Open Incidents": "Incidentes Abertos",
"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",
"Presets file is for a different subdomain": "O arquivo de predefinições é para um subdomínio diferente",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Debugging Actions": "Ações de Depuração",
"Decline": "Recusar",
"Default Since Date Lookback": "Retrospetiva a partir de Data Predefinida",
"Deprecation": "<1>Operations Console</1> é a nova e melhorada versão do PD Live, e é um produto suportado pela PagerDuty. Por favor, planeie migrar para o Operations Console em vez disso.",
"Description": "Descrição",
"Detailed Status": "Estado Detalhado",
"Disclaimer & License": "Aviso Legal & Licença",
Expand Down Expand Up @@ -153,6 +154,7 @@
"OK": "OK",
"on": "em",
"Open Incidents": "Incidentes Abertos",
"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",
"Presets file is for a different subdomain": "O ficheiro de predefinições é para um subdomínio diferente",
Expand Down
2 changes: 0 additions & 2 deletions src/redux/connection/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {

import {
PD_OAUTH_CLIENT_ID,
PD_OAUTH_CLIENT_SECRET,
PD_REQUIRED_ABILITY,
DEBUG_DISABLE_POLLING,
} from 'src/config/constants';
Expand Down Expand Up @@ -238,7 +237,6 @@ export function* refreshOauthImpl() {
const formData = {
grant_type: 'refresh_token',
client_id: PD_OAUTH_CLIENT_ID,
client_secret: PD_OAUTH_CLIENT_SECRET,
refresh_token: refreshToken,
};

Expand Down
8 changes: 6 additions & 2 deletions src/redux/incidents/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,17 @@ export function* getIncidentsImpl() {
}
// The incident list API may return duplicate incidents under some circumstances, so as a precaution we'll dedupe the list by incident.id
// Also log a RUM error if we find any duplicates
const duplicateIncidents = incidents.filter((incident, index, self) => self.findIndex((t) => t.id === incident.id) !== index);
const duplicateIncidents = incidents.filter(
(incident, index, self) => self.findIndex((t) => t.id === incident.id) !== index,
);
const numDuplicateIncidents = duplicateIncidents.length;
if (numDuplicateIncidents > 0) {
// eslint-disable-next-line no-console
console.error('Duplicate incidents found', numDuplicateIncidents);
RealUserMonitoring.trackError(new Error('Duplicate incidents found'), numDuplicateIncidents);
incidents = incidents.filter((incident, index, self) => self.findIndex((t) => t.id === incident.id) === index);
incidents = incidents.filter(
(incident, index, self) => self.findIndex((t) => t.id === incident.id) === index,
);
}

return incidents;
Expand Down
1 change: 0 additions & 1 deletion src/setupTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const {
jest.mock('src/config/constants', () => ({
VITE_PD_ENV: 'localhost-dev',
PD_OAUTH_CLIENT_ID: null,
PD_OAUTH_CLIENT_SECRET: null,
PD_SUBDOMAIN_ALLOW_LIST: null,
PD_USER_TOKEN: null,
PD_REQUIRED_ABILITY: null,
Expand Down
Loading

0 comments on commit cd6d4e0

Please sign in to comment.