From 61c511caf6faaf2bef6b7e46b1c11243a5204103 Mon Sep 17 00:00:00 2001 From: Cathy Teng <70817427+cathyteng17@users.noreply.github.com> Date: Tue, 3 Jan 2023 11:16:10 -0800 Subject: [PATCH] use monitor urls with org frontend --- static/app/views/monitors/details.tsx | 12 +++++++++--- static/app/views/monitors/monitorCheckIns.tsx | 9 +++++++-- static/app/views/monitors/monitorStats.tsx | 5 +++-- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/static/app/views/monitors/details.tsx b/static/app/views/monitors/details.tsx index bfd0e0f1a1a2c6..197f4f4d7b406d 100644 --- a/static/app/views/monitors/details.tsx +++ b/static/app/views/monitors/details.tsx @@ -35,7 +35,13 @@ class MonitorDetails extends AsyncView { getEndpoints(): ReturnType { const {params, location} = this.props; - return [['monitor', `/monitors/${params.monitorId}/`, {query: location.query}]]; + return [ + [ + 'monitor', + `/monitors/${this.orgSlug}/${params.monitorId}/`, + {query: location.query}, + ], + ]; } getTitle() { @@ -68,14 +74,14 @@ class MonitorDetails extends AsyncView { - + {t('Recent Check-ins')} - + )} diff --git a/static/app/views/monitors/monitorCheckIns.tsx b/static/app/views/monitors/monitorCheckIns.tsx index b2f9a62637b5ba..0d34bc66796ad7 100644 --- a/static/app/views/monitors/monitorCheckIns.tsx +++ b/static/app/views/monitors/monitorCheckIns.tsx @@ -21,16 +21,21 @@ type CheckIn = { type Props = { monitor: Monitor; + orgId: string; }; type State = { checkInList: CheckIn[]; }; -const MonitorCheckIns = ({monitor}: Props) => { +const MonitorCheckIns = ({monitor, orgId}: Props) => { const {data, hasError, renderComponent} = useApiRequests({ endpoints: [ - ['checkInList', `/monitors/${monitor.id}/checkins/`, {query: {per_page: '10'}}], + [ + 'checkInList', + `/monitors/${orgId}/${monitor.id}/checkins/`, + {query: {per_page: '10'}}, + ], ], }); diff --git a/static/app/views/monitors/monitorStats.tsx b/static/app/views/monitors/monitorStats.tsx index 17977ce62afa30..a26d11a5ec6ab8 100644 --- a/static/app/views/monitors/monitorStats.tsx +++ b/static/app/views/monitors/monitorStats.tsx @@ -17,13 +17,14 @@ import {Monitor, MonitorStat} from './types'; type Props = { monitor: Monitor; + orgId: string; }; type State = { stats: MonitorStat[] | null; }; -const MonitorStats = ({monitor}: Props) => { +const MonitorStats = ({monitor, orgId}: Props) => { const {selection} = usePageFilters(); const {start, end, period} = selection.datetime; @@ -41,7 +42,7 @@ const MonitorStats = ({monitor}: Props) => { endpoints: [ [ 'stats', - `/monitors/${monitor.id}/stats/`, + `/monitors/${orgId}/${monitor.id}/stats/`, { query: { since: since.toString(),