Fix linter errors and warnings in sentry plugin
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2020 Spotify AB
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createDevApp } from '@backstage/dev-utils';
|
||||
import { plugin } from '../src/plugin';
|
||||
|
||||
createDevApp().registerPlugin(plugin).render();
|
||||
@@ -17,7 +17,7 @@ import { ErrorCell } from './ErrorCell';
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
import mockIssue from '../../data/sentry-issue-mock.json';
|
||||
import { ThemeProvider } from '@material-ui/styles';
|
||||
import { ThemeProvider } from '@material-ui/core';
|
||||
import { lightTheme } from '@backstage/theme';
|
||||
|
||||
describe('Sentry error cell component', () => {
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2020 Spotify AB
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import React, { FC } from 'react';
|
||||
import { SentryIssue } from '../../data/sentry-issue';
|
||||
import { Link, Typography } from '@material-ui/core';
|
||||
@@ -7,7 +22,7 @@ import { BackstageTheme } from '@backstage/theme';
|
||||
function stripText(text: string, maxLength: number) {
|
||||
return text.length > maxLength ? `${text.substr(0, maxLength)}...` : text;
|
||||
}
|
||||
const useStyles = makeStyles<BackstageTheme>(theme => ({
|
||||
const useStyles = makeStyles<BackstageTheme>((theme) => ({
|
||||
root: {
|
||||
minWidth: 260,
|
||||
position: 'relative',
|
||||
|
||||
@@ -18,7 +18,7 @@ import { render } from '@testing-library/react';
|
||||
import SentryIssuesTable from './SentryIssuesTable';
|
||||
import { SentryIssue } from '../../data/sentry-issue';
|
||||
import mockIssue from '../../data/sentry-issue-mock.json';
|
||||
import { ThemeProvider } from '@material-ui/styles';
|
||||
import { ThemeProvider } from '@material-ui/core';
|
||||
import { lightTheme } from '@backstage/theme';
|
||||
|
||||
describe('SentryIssuesTable', () => {
|
||||
|
||||
@@ -32,8 +32,7 @@ function getMockIssues(number: number): SentryIssue[] {
|
||||
return new Array(number).fill(0).map(getMockIssue);
|
||||
}
|
||||
export class MockSentryApi implements SentryApi {
|
||||
fetchIssues(project: string, statsFor: string): Promise<SentryIssue[]> {
|
||||
console.info('Fetching mock responses for', project, statsFor);
|
||||
fetchIssues(): Promise<SentryIssue[]> {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => resolve(getMockIssues(14)), 800);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user