Skip to content

Commit 0dd5a47

Browse files
committed
feat(crons): Show Owner in details sidebar
<img alt="clipboard.png" width="356" src="https://i.imgur.com/VbnotXc.png" /> ![clipboard.png](https://i.imgur.com/6SJHw1v.png)
1 parent f5b0e32 commit 0dd5a47

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

static/app/views/monitors/components/detailsSidebar.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {Fragment} from 'react';
22
import styled from '@emotion/styled';
33

4+
import ActorAvatar from 'sentry/components/avatar/actorAvatar';
45
import {SectionHeading} from 'sentry/components/charts/styles';
56
import {KeyValueTable, KeyValueTableRow} from 'sentry/components/keyValueTable';
67
import Text from 'sentry/components/text';
@@ -12,6 +13,7 @@ import {space} from 'sentry/styles/space';
1213
import {defined} from 'sentry/utils';
1314
import {getFormattedDate} from 'sentry/utils/dates';
1415
import useCopyToClipboard from 'sentry/utils/useCopyToClipboard';
16+
import useOrganization from 'sentry/utils/useOrganization';
1517
import {DEFAULT_MAX_RUNTIME} from 'sentry/views/monitors/components/monitorForm';
1618
import {MonitorIndicator} from 'sentry/views/monitors/components/monitorIndicator';
1719
import type {Monitor, MonitorEnvironment} from 'sentry/views/monitors/types';
@@ -24,6 +26,8 @@ interface Props {
2426
}
2527

2628
export default function DetailsSidebar({monitorEnv, monitor}: Props) {
29+
const org = useOrganization();
30+
2731
const {checkin_margin, schedule, schedule_type, max_runtime, timezone} = monitor.config;
2832
const {onClick, label} = useCopyToClipboard({text: monitor.slug});
2933

@@ -98,6 +102,18 @@ export default function DetailsSidebar({monitorEnv, monitor}: Props) {
98102
{schedule_type === ScheduleType.CRONTAB && (
99103
<KeyValueTableRow keyName={t('Timezone')} value={timezone} />
100104
)}
105+
{org.features.includes('crons-ownership') && (
106+
<KeyValueTableRow
107+
keyName={t('Owner')}
108+
value={
109+
monitor.owner ? (
110+
<ActorAvatar size={24} actor={monitor.owner} />
111+
) : (
112+
t('Unassigned')
113+
)
114+
}
115+
/>
116+
)}
101117
<KeyValueTableRow
102118
keyName={t('Date created')}
103119
value={getFormattedDate(monitor.dateCreated, 'MMM D, YYYY')}

0 commit comments

Comments
 (0)