Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(events-v2): Update columns to match mockup #13515

Merged
merged 2 commits into from
Jun 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions src/sentry/static/sentry/app/views/organizationEventsV2/data.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import ProjectBadge from 'app/components/idBadge/projectBadge';
import UserBadge from 'app/components/idBadge/userBadge';
import DateTime from 'app/components/dateTime';

import {QueryLink} from './styles';
import {QueryButton} from './styles';

export const ALL_VIEWS = deepFreeze([
{
id: 'all',
name: 'All Events',
data: {
fields: ['event', 'event.type', 'project', 'user', 'time'],
fields: ['event', 'type', 'project', 'user', 'time'],
sort: '-timestamp',
},
tags: [
Expand All @@ -33,7 +33,7 @@ export const ALL_VIEWS = deepFreeze([
id: 'errors',
name: 'Errors',
data: {
fields: ['issue_title', 'event_count', 'user_count', 'project', 'last_seen'],
fields: ['error', 'event_count', 'user_count', 'project', 'last_seen'],
groupby: ['issue.id', 'project.id'],
sort: '-last_seen',
},
Expand All @@ -43,7 +43,7 @@ export const ALL_VIEWS = deepFreeze([
id: 'csp',
name: 'CSP',
data: {
fields: ['issue_title', 'event_count', 'user_count', 'project', 'last_seen'],
fields: ['csp', 'event_count', 'user_count', 'project', 'last_seen'],
groupby: ['issue.id', 'project.id'],
sort: '-last_seen',
},
Expand Down Expand Up @@ -79,6 +79,14 @@ export const SPECIAL_FIELDS = {
);
},
},
type: {
fields: ['event.type'],
renderFunc: (data, {onSearch}) => (
<QueryButton onClick={() => onSearch(`event.type:${data['event.type']}`)}>
{data['event.type']}
</QueryButton>
),
},
project: {
fields: ['project.name'],
renderFunc: (data, {organization}) => {
Expand Down Expand Up @@ -109,7 +117,9 @@ export const SPECIAL_FIELDS = {
return <Container>{badge}</Container>;
}

return <QueryLink onClick={() => onSearch(`user:${data.user}`)}>{badge}</QueryLink>;
return (
<QueryButton onClick={() => onSearch(`user:${data.user}`)}>{badge}</QueryButton>
);
},
},
time: {
Expand All @@ -120,6 +130,14 @@ export const SPECIAL_FIELDS = {
</Container>
),
},
error: {
fields: ['issue_title'],
renderFunc: data => <Container>{data.issue_title}</Container>,
},
csp: {
fields: ['issue_title'],
renderFunc: data => <Container>{data.issue_title}</Container>,
},
event_count: {
title: 'events',
fields: ['event_count'],
Expand All @@ -131,6 +149,7 @@ export const SPECIAL_FIELDS = {
renderFunc: data => <Container>{data.user_count}</Container>,
},
last_seen: {
title: 'last seen',
fields: ['last_seen'],
renderFunc: data => (
<Container>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import React from 'react';
import styled from 'react-emotion';
import space from 'app/styles/space';
import Button from 'app/components/button';
import overflowEllipsis from 'app/styles/overflowEllipsis';

export const QueryLink = styled('a')`
export const QueryButton = styled(props => (
<Button size="zero" borderless={true} {...props} />
))`
${overflowEllipsis};
color: ${p => p.theme.foreground};
padding: ${space(1)};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {t} from 'app/locale';
import space from 'app/styles/space';

import {SPECIAL_FIELDS} from './data';
import {QueryLink} from './styles';
import {QueryButton} from './styles';

export default class Table extends React.Component {
static propTypes = {
Expand Down Expand Up @@ -45,9 +45,9 @@ export default class Table extends React.Component {
{SPECIAL_FIELDS.hasOwnProperty(field) ? (
SPECIAL_FIELDS[field].renderFunc(row, {organization, onSearch, location})
) : (
<QueryLink onClick={() => onSearch(`${field}:${row[field]}`)}>
<QueryButton onClick={() => onSearch(`${field}:${row[field]}`)}>
{row[field]}
</QueryLink>
</QueryButton>
)}
</Cell>
))}
Expand Down