@@ -152,4 +152,4 @@ yarn remove @backstage/plugin-pagerduty
|
||||
|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
@@ -46,6 +46,10 @@ export class PagerDutyClient implements PagerDutyApi {
|
||||
configApi: ConfigApi,
|
||||
discoveryApi: DiscoveryApi,
|
||||
): PagerDutyClient;
|
||||
// Warning: (ae-forgotten-export) The symbol "ChangeEvent" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// (undocumented)
|
||||
getChangeEventsByServiceId(serviceId: string): Promise<ChangeEvent[]>;
|
||||
// Warning: (ae-forgotten-export) The symbol "Incident" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// (undocumented)
|
||||
|
||||
@@ -51,7 +51,7 @@ export const ChangeEventListItem = ({ changeEvent }: Props) => {
|
||||
const classes = useStyles();
|
||||
const duration =
|
||||
new Date().getTime() - new Date(changeEvent.timestamp).getTime();
|
||||
const changed_at = DateTime.local()
|
||||
const changedAt = DateTime.local()
|
||||
.minus(Duration.fromMillis(duration))
|
||||
.toRelative({ locale: 'en' });
|
||||
let externalLinkElem = null;
|
||||
@@ -80,13 +80,13 @@ export const ChangeEventListItem = ({ changeEvent }: Props) => {
|
||||
}}
|
||||
secondary={
|
||||
<Typography variant="body2" color="textSecondary">
|
||||
Triggered from {changeEvent.source} {changed_at}.
|
||||
Triggered from {changeEvent.source} {changedAt}.
|
||||
</Typography>
|
||||
}
|
||||
/>
|
||||
<ListItemSecondaryAction>
|
||||
{externalLinkElem}
|
||||
<Tooltip title="View in Pagerduty" placement="top">
|
||||
<Tooltip title="View in PagerDuty" placement="top">
|
||||
<IconButton
|
||||
component={Link}
|
||||
to={changeEvent.html_url}
|
||||
|
||||
@@ -60,7 +60,7 @@ describe('Incidents', () => {
|
||||
},
|
||||
],
|
||||
summary: 'summary of event',
|
||||
timestamp: '5 minutes',
|
||||
timestamp: '2020-07-17T08:42:58.315+0000',
|
||||
},
|
||||
{
|
||||
id: 'id2',
|
||||
@@ -73,7 +73,7 @@ describe('Incidents', () => {
|
||||
},
|
||||
],
|
||||
summary: 'sum of EVENT',
|
||||
timestamp: '20 minutes',
|
||||
timestamp: '2020-07-18T08:42:58.315+0000',
|
||||
},
|
||||
] as ChangeEvent[],
|
||||
);
|
||||
@@ -87,8 +87,6 @@ describe('Incidents', () => {
|
||||
await waitFor(() => !queryByTestId('progress'));
|
||||
expect(getByText('summary of event')).toBeInTheDocument();
|
||||
expect(getByText('sum of EVENT')).toBeInTheDocument();
|
||||
expect(getByText('5 minutes')).toBeInTheDocument();
|
||||
expect(getByText('20 minutes')).toBeInTheDocument();
|
||||
|
||||
// assert links, mailto and hrefs, date calculation
|
||||
expect(getAllByTitle('View in PagerDuty').length).toEqual(2);
|
||||
|
||||
Reference in New Issue
Block a user