final fixup

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2021-09-16 19:32:41 +02:00
parent 5e2ca4d472
commit 530d43a5f5
4 changed files with 10 additions and 8 deletions
+1 -1
View File
@@ -152,4 +152,4 @@ yarn remove @backstage/plugin-pagerduty
![PagerDuty plugin popup modal for creating an incident](doc/pd3.png)
![PagerDuty plugin showing an active incident](doc/pd4.png)
![PagerDuty plugin showing an active incident](doc/pd4.png)
+4
View File
@@ -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);