fix: sentry plugin corrected allowed period values

according https://docs.sentry.io/api/events/list-a-projects-issues/

Signed-off-by: rodion <rodiongork@github.com>
This commit is contained in:
rodion
2021-10-25 22:48:14 +03:00
parent d066399739
commit 61fe752dad
8 changed files with 14 additions and 9 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-sentry': patch
---
fix: sentry-plugin correction for allowed period values
+2 -2
View File
@@ -75,7 +75,7 @@ export type SentryIssue = {
userCount: number;
stats: {
'24h'?: EventPoint[];
'12h'?: EventPoint[];
'14d'?: EventPoint[];
};
culprit: string;
title: string;
@@ -111,7 +111,7 @@ export const SentryIssuesWidget: ({
query,
}: {
entity: Entity;
statsFor?: '12h' | '24h' | undefined;
statsFor?: '' | '14d' | '24h' | undefined;
variant?: InfoCardVariants | undefined;
query?: string | undefined;
}) => JSX.Element;
+1 -1
View File
@@ -20,7 +20,7 @@ import mockData from './sentry-issue-mock.json';
function getMockIssue(): SentryIssue {
const randomizedStats = {
'12h': new Array(12)
'24h': new Array(24)
.fill(0)
.map(() => [0, Math.floor(Math.random() * 100)]),
};
@@ -4,7 +4,7 @@
"numComments": 0,
"userCount": 0,
"stats": {
"12h": [
"24h": [
[1589450400, 7],
[1589454000, 2],
[1589457600, 6],
+1 -1
View File
@@ -39,7 +39,7 @@ export type SentryIssue = {
userCount: number;
stats: {
'24h'?: EventPoint[];
'12h'?: EventPoint[];
'14d'?: EventPoint[];
};
culprit: string;
title: string;
@@ -20,8 +20,8 @@ import { Sparklines, SparklinesBars } from 'react-sparklines';
export const ErrorGraph = ({ sentryIssue }: { sentryIssue: SentryIssue }) => {
const data =
'12h' in sentryIssue.stats
? sentryIssue.stats['12h']
'14d' in sentryIssue.stats
? sentryIssue.stats['14d']
: sentryIssue.stats['24h'];
return (
@@ -59,7 +59,7 @@ const columns: TableColumn[] = [
type SentryIssuesTableProps = {
sentryIssues: SentryIssue[];
statsFor?: '24h' | '12h';
statsFor?: '24h' | '14d' | '';
};
const SentryIssuesTable = ({
@@ -41,7 +41,7 @@ export const SentryIssuesWidget = ({
query = '',
}: {
entity: Entity;
statsFor?: '24h' | '12h';
statsFor?: '24h' | '14d' | '';
variant?: InfoCardVariants;
query?: string;
}) => {