2
* Copyright 2020 The Backstage Authors
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
17
import { Entity } from '@backstage/catalog-model';
18
import { createDevApp, EntityGridItem } from '@backstage/dev-utils';
19
import { EntityProvider } from '@backstage/plugin-catalog-react';
20
import { Grid } from '@material-ui/core';
21
import React from 'react';
30
SENTRY_PROJECT_SLUG_ANNOTATION,
32
} from '../src/api/annotations';
33
import { Content, Header, Page } from '@backstage/core-components';
35
const entity = (name?: string) =>
37
apiVersion: 'backstage.io/v1alpha1',
41
[SENTRY_PROJECT_SLUG_ANNOTATION]: name,
53
fetchIssues: async (e: Entity) => {
54
switch (getProjectSlug(e)) {
56
throw new Error('Error!');
59
return new Promise(() => {});
62
return new MockSentryApi().fetchIssues();
71
title: 'Entity Content',
74
<Header title="Sentry" />
76
<EntityProvider entity={entity('with-values')}>
77
<EntitySentryContent />
87
<Header title="Sentry" />
90
<EntityGridItem xs={12} md={6} entity={entity('error')}>
93
<EntityGridItem xs={12} md={6} entity={entity('empty')}>
96
<EntityGridItem xs={12} md={6} entity={entity('never')}>
99
<EntityGridItem xs={12} md={6} entity={entity('with-values')}>
102
<EntityGridItem xs={12} entity={entity(undefined)}>