File tree 5 files changed +38
-10
lines changed
static/app/views/performance/http
5 files changed +38
-10
lines changed Original file line number Diff line number Diff line change 62
62
"@sentry/node" : " ^7.109.0" ,
63
63
"@sentry/react" : " ^7.109.0" ,
64
64
"@sentry/release-parser" : " ^1.3.1" ,
65
+ "@sentry/status-page-list" : " ^0.0.1" ,
65
66
"@sentry/types" : " ^7.109.0" ,
66
67
"@sentry/utils" : " ^7.109.0" ,
67
68
"@spotlightjs/spotlight" : " ^1.2.13" ,
Original file line number Diff line number Diff line change @@ -4,19 +4,27 @@ import ExternalLink from 'sentry/components/links/externalLink';
4
4
import { IconOpen } from 'sentry/icons' ;
5
5
import { t } from 'sentry/locale' ;
6
6
import { space } from 'sentry/styles/space' ;
7
- import { DOMAIN_STATUS_PAGE_URLS } from 'sentry/views/performance/http/domainStatusPageURLs ' ;
7
+ import { useStatusPageList } from 'sentry/views/performance/http/useStatusPageList ' ;
8
8
9
9
interface Props {
10
10
domain ?: string ;
11
11
}
12
12
13
13
export function DomainStatusLink ( { domain} : Props ) {
14
+ const statusPageList = useStatusPageList ( ) ;
15
+
14
16
if ( ! domain ) {
15
17
return null ;
16
18
}
17
19
20
+ const statusPageURL = statusPageList ?. domainToStatusPageUrls ?. [ domain ] ;
21
+
22
+ if ( ! statusPageURL ) {
23
+ return null ;
24
+ }
25
+
18
26
return (
19
- < ExternalDomainLink href = { DOMAIN_STATUS_PAGE_URLS [ domain ] } >
27
+ < ExternalDomainLink href = { statusPageURL } >
20
28
{ t ( 'Status' ) }
21
29
< IconOpen />
22
30
</ ExternalDomainLink >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import { useCallback , useEffect , useState } from 'react' ;
2
+
3
+ import { useIsMountedRef } from 'sentry/utils/useIsMountedRef' ;
4
+
5
+ export function useStatusPageList ( ) {
6
+ const isMountedRef = useIsMountedRef ( ) ;
7
+ const [ mod , setMod ] = useState < any > ( { } ) ;
8
+
9
+ const loader = useCallback ( async ( ) => {
10
+ const loaded = await import ( '@sentry/status-page-list' ) ;
11
+
12
+ if ( isMountedRef . current ) {
13
+ setMod ( loaded ) ;
14
+ }
15
+ } , [ isMountedRef ] ) ;
16
+
17
+ useEffect ( ( ) => {
18
+ loader ( ) ;
19
+ } , [ loader ] ) ;
20
+
21
+ return mod ;
22
+ }
Original file line number Diff line number Diff line change 3079
3079
"@sentry/types" "7.109.0"
3080
3080
"@sentry/utils" "7.109.0"
3081
3081
3082
+ "@sentry/status-page-list@^0.0.1":
3083
+ version "0.0.1"
3084
+ resolved "https://registry.yarnpkg.com/@sentry/status-page-list/-/status-page-list-0.0.1.tgz#fb65dc67496067798dcd9b3285589ded63f0ecd1"
3085
+ integrity sha512-LQSBWck49vqHdnt9gGKshlwtzhHLqTCAc7H1AIOF66BMmEkpsOzXjhloE7tJ8ufbuIHnPGvBseydA2CcSzwQTQ==
3086
+
3082
3087
"@sentry/types@7.109.0", "@sentry/types@^7.109.0":
3083
3088
version "7.109.0"
3084
3089
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.109.0.tgz#d8778358114ed05be734661cc9e1e261f4494947"
You can’t perform that action at this time.
0 commit comments