123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- import {Component} from 'react';
- import {browserHistory, Route, Router} from 'react-router';
- import PropTypes from 'prop-types';
- import StreamGroup from 'sentry/components/stream/group';
- import GroupStore from 'sentry/stores/groupStore';
- export default {
- title: 'Features/Issues/Stream Group',
- };
- const selection = {
- projects: [1],
- environments: ['production', 'staging'],
- datetime: {
- start: '2019-10-09T11:18:59',
- end: '2019-09-09T11:18:59',
- period: null,
- utc: true,
- },
- };
- const organization = {
- id: '1',
- slug: 'test-org',
- features: [],
- };
- function loadGroups() {
- const group = {
- assignedTo: null,
- count: '327482',
- culprit: 'fetchData(app/components/group/suggestedOwners/suggestedOwners)',
- firstRelease: null,
- firstSeen: '2020-10-05T19:44:05.963Z',
- hasSeen: false,
- id: '1',
- isBookmarked: false,
- isPublic: false,
- isSubscribed: false,
- lastSeen: '2020-10-11T01:08:59Z',
- level: 'warning',
- logger: null,
- metadata: {function: 'fetchData', type: 'RequestError'},
- numComments: 0,
- permalink: 'https://foo.io/organizations/foo/issues/1234/',
- platform: 'javascript',
- project: {
- platform: 'javascript',
- id: 1,
- slug: 'test-project',
- },
- shareId: null,
- shortId: 'JAVASCRIPT-6QS',
- stats: {
- '24h': [
- [1517281200, 2],
- [1517310000, 1],
- ],
- '30d': [
- [1514764800, 1],
- [1515024000, 122],
- ],
- },
- status: 'unresolved',
- title: 'RequestError: GET /issues/ 404',
- type: 'error',
- userCount: 35097,
- userReportCount: 0,
- inbox: {
- date_added: '2020-11-24T13:17:42.248751Z',
- reason: 0,
- reason_details: {},
- },
- };
- const unhandledGroup = {
- ...group,
- id: '2',
- culprit: 'sentry.tasks.email.send_email',
- isUnhandled: true,
- level: 'error',
- count: '12',
- userCount: 1337,
- metadata: {
- function: 'send_messages',
- type: 'SMTPServerDisconnected',
- value: 'Connection unexpectedly closed',
- filename: 'sentry/utils/email.py',
- },
- annotations: ['<a href="https://sentry.io">PROD-72</a>'],
- title: 'UnhandledError: GET /issues/ 404',
- inbox: {
- date_added: '2020-11-24T13:17:42.248751Z',
- reason: 2,
- reason_details: {},
- },
- };
- const resolvedGroup = {
- ...group,
- id: '3',
- status: 'resolved',
- isUnhandled: true,
- metadata: {function: 'fetchData', type: 'ResolvedError'},
- numComments: 2,
- inbox: null,
- };
- const ignoredGroup = {
- ...group,
- id: '4',
- status: 'ignored',
- culprit: 'culprit',
- metadata: {function: 'fetchData', type: 'IgnoredErrorType'},
- inbox: null,
- };
- const bookmarkedGroup = {
- ...group,
- id: '5',
- metadata: {
- function: 'send_messages',
- type: 'BookmarkedError',
- value: 'Connection unexpectedly closed',
- filename: 'sentry/utils/email.py',
- },
- culprit: '',
- isBookmarked: true,
- logger: 'sentry.incidents.tasks',
- shortId: 'JAVASCRIPT-LONGNAME-6QS',
- inbox: {
- date_added: '2020-11-24T13:17:42.248751Z',
- reason: 3,
- reason_details: {},
- },
- };
- const slimGroup = {
- ...group,
- id: '6',
- title: 'Monitor failure: getsentry-expire-plan-trials (missed_checkin)',
- metadata: {
- type: 'Monitor failure: getsentry-expire-plan-trials (missed_checkin)',
- },
- culprit: '',
- logger: 'sentry.incidents.tasks',
- annotations: ['<a href="https://sentry.io">PROD-72</a>'],
- inbox: {
- date_added: '2020-11-24T13:17:42.248751Z',
- reason: 1,
- reason_details: {},
- },
- };
- GroupStore.loadInitialData([
- group,
- unhandledGroup,
- resolvedGroup,
- ignoredGroup,
- bookmarkedGroup,
- slimGroup,
- ]);
- }
- class LocationContext extends Component {
- static childContextTypes = {
- location: PropTypes.object,
- };
- getChildContext() {
- return {location: {query: {}}};
- }
- render() {
- return (
- <Router history={browserHistory}>
- <Route path="/*" component={() => this.props.children} />
- </Router>
- );
- }
- }
- export const _StreamGroup = () => {
- loadGroups();
- return (
- <LocationContext>
- <StreamGroup
- id="1"
- canSelect
- withChart={null}
- memberList={[]}
- organization={organization}
- selection={selection}
- query=""
- isGlobalSelectionReady
- />
- <StreamGroup
- id="2"
- canSelect
- withChart={null}
- memberList={[]}
- organization={organization}
- selection={selection}
- query=""
- isGlobalSelectionReady
- />
- <StreamGroup
- id="3"
- canSelect
- withChart={null}
- memberList={[]}
- organization={organization}
- selection={selection}
- query=""
- isGlobalSelectionReady
- />
- <StreamGroup
- id="4"
- canSelect
- withChart={null}
- memberList={[]}
- organization={organization}
- selection={selection}
- query=""
- isGlobalSelectionReady
- />
- <StreamGroup
- id="5"
- canSelect
- withChart={null}
- memberList={[]}
- organization={organization}
- selection={selection}
- query=""
- isGlobalSelectionReady
- />
- <StreamGroup
- id="6"
- canSelect
- withChart={null}
- memberList={[]}
- organization={organization}
- selection={selection}
- query=""
- isGlobalSelectionReady
- />
- </LocationContext>
- );
- };
- _StreamGroup.storyName = 'Stream Group';
|