Skip to content

fix(ui): Fix date for create incident activity #13441

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

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
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const ActivityBubble = styled('div')`
border: 1px solid ${p => p.borderColor || p.theme.borderLight};
border-radius: ${p => p.theme.borderRadius};
position: relative;
width: 100%; /* this is used in Incidents Details - a chart can cause overflow and won't resize properly */

&:before {
display: block;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Activity extends React.Component {
static propTypes = {
api: PropTypes.object.isRequired,
incidentId: PropTypes.string.isRequired,
incident: SentryTypes.Incident,
loading: PropTypes.bool,
error: PropTypes.bool,
me: SentryTypes.User,
Expand Down Expand Up @@ -59,6 +60,7 @@ class Activity extends React.Component {
error,
me,
incidentId,
incident,
activities,
noteInputId,
createBusy,
Expand Down Expand Up @@ -148,6 +150,7 @@ class Activity extends React.Component {
<ErrorBoundary mini key={`note-${activity.id}`}>
<StatusItem
showTime
incident={incident}
authorName={authorName}
activity={activity}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,20 @@ import SentryTypes from 'app/sentryTypes';
/**
* StatusItem renders status changes for Incidents
*
* For example, incident created, detected, or closed
* For example: incident created, detected, or closed
*
* Note `activity.dateCreated` refers to when the activity was created vs.
* `incident.dateStarted` which is when an incident was first detected or created
*/
class StatusItem extends React.Component {
static propTypes = {
activity: SentryTypes.IncidentActivity.isRequired,
incident: SentryTypes.Incident,
authorName: PropTypes.string,
};

render() {
const {activity, authorName} = this.props;
const {activity, authorName, incident} = this.props;

const isCreated = activity.type === INCIDENT_ACTIVITY_TYPE.CREATED;
const isDetected = activity.type === INCIDENT_ACTIVITY_TYPE.DETECTED;
Expand Down Expand Up @@ -60,7 +64,7 @@ class StatusItem extends React.Component {
{activity.eventStats && (
<Chart
data={activity.eventStats.data}
detected={(isCreated || isDetected) && activity.dateCreated}
detected={(isCreated || isDetected) && incident && incident.dateStarted}
/>
)}
</ActivityItem>
Expand Down