@@ -12,6 +12,7 @@ import {QuietZoneQRCode} from 'sentry/components/quietZoneQRCode';
1212import { IconClose } from 'sentry/icons/iconClose' ;
1313import { t , tn } from 'sentry/locale' ;
1414import { space } from 'sentry/styles/space' ;
15+ import { MarkedText } from 'sentry/utils/marked/markedText' ;
1516import { useApiQuery } from 'sentry/utils/queryClient' ;
1617import useOrganization from 'sentry/utils/useOrganization' ;
1718import type { InstallDetailsApiResponse } from 'sentry/views/preprod/types/installDetailsTypes' ;
@@ -40,33 +41,71 @@ function InstallModal({projectId, artifactId, closeModal}: InstallModalProps) {
4041 }
4142 ) ;
4243
44+ const header = (
45+ < Flex justify = "center" align = "center" width = "100%" position = "relative" >
46+ < Heading as = "h2" > { t ( 'Install App' ) } </ Heading >
47+ < Container
48+ position = "absolute"
49+ style = { { top : '50%' , right : 0 , transform : 'translateY(-50%)' } }
50+ >
51+ < Button
52+ onClick = { closeModal }
53+ priority = "transparent"
54+ icon = { < IconClose /> }
55+ size = "sm"
56+ aria-label = { t ( 'Close' ) }
57+ />
58+ </ Container >
59+ </ Flex >
60+ ) ;
61+
4362 if ( isPending ) {
4463 return (
45- < Flex direction = "column" align = "center" gap = "md" padding = "3xl" >
64+ < Flex direction = "column" align = "center" gap = "xl" >
65+ { header }
4666 < LoadingIndicator />
4767 < Text > { t ( 'Loading install details...' ) } </ Text >
4868 </ Flex >
4969 ) ;
5070 }
5171
52- if ( isError ) {
72+ if ( isError || ! installDetails ) {
5373 return (
54- < Flex direction = "column" align = "center" gap = "md" padding = "3xl" >
74+ < Flex direction = "column" align = "center" gap = "xl" >
75+ { header }
5576 < Text > { t ( 'Error: %s' , error ?. message || 'Failed to fetch install details' ) } </ Text >
5677 < Button onClick = { ( ) => refetch ( ) } > { t ( 'Retry' ) } </ Button >
57- < Button onClick = { closeModal } > { t ( 'Close' ) } </ Button >
5878 </ Flex >
5979 ) ;
6080 }
6181
62- if ( ! installDetails ?. install_url ) {
63- const message = installDetails
64- ? t ( 'No install download link available' )
65- : t ( 'No install details available' ) ;
82+ if ( ! installDetails . install_url ) {
83+ if ( ! installDetails . is_code_signature_valid ) {
84+ let errors = null ;
85+ if (
86+ installDetails . code_signature_errors &&
87+ installDetails . code_signature_errors . length > 0
88+ ) {
89+ errors = (
90+ < CodeSignatureInfo >
91+ { installDetails . code_signature_errors . map ( e => (
92+ < Text key = { e } > { e } </ Text >
93+ ) ) }
94+ </ CodeSignatureInfo >
95+ ) ;
96+ }
97+ return (
98+ < Flex direction = "column" align = "center" gap = "xl" >
99+ { header }
100+ < Text > { 'Code signature is invalid' } </ Text >
101+ { errors }
102+ </ Flex >
103+ ) ;
104+ }
66105 return (
67- < Flex direction = "column" align = "center" gap = "md" padding = "3xl ">
68- < Text > { message } </ Text >
69- < Button onClick = { closeModal } > { t ( 'Close ' ) } </ Button >
106+ < Flex direction = "column" align = "center" gap = "xl " >
107+ { header }
108+ < Text > { t ( 'No install download link available ' ) } </ Text >
70109 </ Flex >
71110 ) ;
72111 }
@@ -90,21 +129,7 @@ function InstallModal({projectId, artifactId, closeModal}: InstallModalProps) {
90129 return (
91130 < Fragment >
92131 < Flex direction = "column" align = "center" gap = "xl" >
93- < Flex justify = "center" align = "center" width = "100%" position = "relative" >
94- < Heading as = "h2" > { t ( 'Install App' ) } </ Heading >
95- < Container
96- position = "absolute"
97- style = { { top : '50%' , right : 0 , transform : 'translateY(-50%)' } }
98- >
99- < Button
100- onClick = { closeModal }
101- priority = "transparent"
102- icon = { < IconClose /> }
103- size = "sm"
104- aria-label = { t ( 'Close' ) }
105- />
106- </ Container >
107- </ Flex >
132+ { header }
108133
109134 < Fragment >
110135 < Stack align = "center" gap = "md" >
@@ -151,6 +176,14 @@ function InstallModal({projectId, artifactId, closeModal}: InstallModalProps) {
151176 { t ( 'The install link will expire in 12 hours' ) }
152177 </ Text >
153178 </ Stack >
179+ { installDetails . release_notes && (
180+ < ReleaseNotesSection direction = "column" gap = "md" >
181+ < Heading as = "h3" > { t ( 'Release Notes' ) } </ Heading >
182+ < ReleaseNotesContent >
183+ < MarkedText text = { installDetails . release_notes } />
184+ </ ReleaseNotesContent >
185+ </ ReleaseNotesSection >
186+ ) }
154187 </ Fragment >
155188 </ Flex >
156189 </ Fragment >
@@ -163,6 +196,9 @@ export const CodeSignatureInfo = styled('div')`
163196 background: ${ p => p . theme . backgroundSecondary } ;
164197 border-radius: ${ space ( 1 ) } ;
165198 border: 1px solid ${ p => p . theme . border } ;
199+ max-width: 100%;
200+ word-break: break-word;
201+ overflow-wrap: break-word;
166202` ;
167203
168204const Divider = styled ( Flex ) `
@@ -190,6 +226,19 @@ const Divider = styled(Flex)`
190226 }
191227` ;
192228
229+ const ReleaseNotesSection = styled ( Flex ) `
230+ width: 100%;
231+ margin-top: ${ p => p . theme . space . xl } ;
232+ ` ;
233+
234+ const ReleaseNotesContent = styled ( 'div' ) `
235+ width: 100%;
236+ padding: ${ p => p . theme . space . xl } ;
237+ background: ${ p => p . theme . backgroundSecondary } ;
238+ border-radius: ${ p => p . theme . space . md } ;
239+ border: 1px solid ${ p => p . theme . border } ;
240+ ` ;
241+
193242export function openInstallModal ( projectId : string , artifactId : string ) {
194243 openModal (
195244 ( { closeModal} ) => (
0 commit comments