@@ -34,7 +34,6 @@ export const IdeLauncher = () => {
3434 const theme = useTheme ( ) ;
3535 const themeKind = getThemeKind ( theme ) ;
3636 const params = getURLQueryParams ( window . location . search ) ;
37- const { environmentName, spanDisplayName } = params ;
3837 const action = params [ "plugin.action" ] ;
3938 const [ selectItems , setSelectItems ] = useState < SelectItem [ ] > ( ) ;
4039 const isMobile = [ "Android" , "iPhone" , "iPad" ] . some ( ( x ) =>
@@ -108,11 +107,11 @@ export const IdeLauncher = () => {
108107 await tryToShowIdeProject ( port , project ) ;
109108 } ;
110109
111- const handleRefreshButtonClick = ( ) => {
110+ const handleTryScanningAgainButtonClick = ( ) => {
112111 window . location . reload ( ) ;
113112 } ;
114113
115- const handleTryAgainButtonClick = async ( ) => {
114+ const handleTryShowIdeProjectAgainButtonClick = async ( ) => {
116115 const selectedItemValue = selectItems ?. find ( ( item ) => item . selected ) ?. value ;
117116 if ( ! selectedItemValue ) {
118117 return ;
@@ -122,6 +121,14 @@ export const IdeLauncher = () => {
122121 await tryToShowIdeProject ( port , project ) ;
123122 } ;
124123
124+ const handleGetDigmaButtonClick = ( ) => {
125+ window . open (
126+ "https://plugins.jetbrains.com/plugin/19470-digma-continuous-feedback" ,
127+ "_blank" ,
128+ "noopener noreferrer"
129+ ) ;
130+ } ;
131+
125132 useEffect ( ( ) => {
126133 async function initialScan ( ) {
127134 await tryToScanRunningIdeProjects ( ) ;
@@ -135,57 +142,77 @@ export const IdeLauncher = () => {
135142 const selectedItem = selectItems ?. find ( ( item ) => item . selected ) ;
136143
137144 const renderContent = ( ) => {
145+ if ( ! action ) {
146+ return (
147+ < s . TextContainer >
148+ < s . Title > Invalid link</ s . Title >
149+ < s . Subtitle > Link is partial or invalid</ s . Subtitle >
150+ </ s . TextContainer >
151+ ) ;
152+ }
153+
138154 if ( isMobile ) {
139155 return (
140156 < s . TextContainer >
141- < s . Title > Unsupported platform </ s . Title >
142- < s . Description >
143- The IDE cannot be opened on this device.
144- </ s . Description >
157+ < s . Title > Can't open Digma link </ s . Title >
158+ < s . Subtitle >
159+ Digma links can only be opened on desktop/laptop
160+ </ s . Subtitle >
145161 </ s . TextContainer >
146162 ) ;
147163 }
148164
149165 if ( isIdeProjectScanningInProgress ) {
150166 return (
151167 < s . TextContainer >
152- < s . Title > Looking for running IDEs...</ s . Title >
168+ < s . Title > Searching for a running IDE</ s . Title >
169+ < s . Subtitle >
170+ You'll need an IDE installed with Digma configured to open the
171+ link
172+ </ s . Subtitle >
153173 </ s . TextContainer >
154174 ) ;
155175 }
156176
157177 if ( isShowIdeProjectInProgress ) {
158178 return (
159179 < s . TextContainer >
160- < s . Title >
161- Opening the { selectedItem ?. label ?? "IDE project" } ...
162- </ s . Title >
180+ < s . Title > Opening the Digma link in your IDE</ s . Title >
163181 </ s . TextContainer >
164182 ) ;
165183 }
166184
167- if ( showIdeProjectResult ?. error ) {
185+ if ( showIdeProjectResult ?. result === "failure" ) {
168186 return (
169187 < >
170188 < s . TextContainer >
171- < s . Title >
172- Failed to open the { selectedItem ?. label ?? "IDE project" }
173- </ s . Title >
174- < s . Description >
189+ < s . Title > There was an issue opening the link in the IDE</ s . Title >
190+ < s . Subtitle >
175191 Please check that IDE is running and click the{ " " }
176192 < s . EmphasizedText > Try again</ s . EmphasizedText > button below.
177- </ s . Description >
193+ </ s . Subtitle >
178194 </ s . TextContainer >
179195 < NewButton
180196 label = { "Try again" }
181197 onClick = { ( ) => {
182- void handleTryAgainButtonClick ( ) ;
198+ void handleTryShowIdeProjectAgainButtonClick ( ) ;
183199 } }
184200 />
185201 </ >
186202 ) ;
187203 }
188204
205+ if ( showIdeProjectResult ?. result === "success" ) {
206+ return (
207+ < s . TextContainer >
208+ < s . Title > Opening the Digma link in your IDE</ s . Title >
209+ < s . Subtitle >
210+ Switching over to the IDE. You can close this tab.
211+ </ s . Subtitle >
212+ </ s . TextContainer >
213+ ) ;
214+ }
215+
189216 if ( ! selectItems ) {
190217 return null ;
191218 }
@@ -194,60 +221,37 @@ export const IdeLauncher = () => {
194221 return (
195222 < >
196223 < s . TextContainer >
197- < s . Title > Failed to find IDEs with Digma plugin running</ s . Title >
198- < s . Description >
199- Please open the IDE with Digma plugin installed, check its
200- settings and click the{ " " }
201- < s . EmphasizedText > Refresh</ s . EmphasizedText > button below.
202- </ s . Description >
203- </ s . TextContainer >
204- < NewButton label = { "Refresh" } onClick = { handleRefreshButtonClick } />
205- </ >
206- ) ;
207- }
208-
209- if ( selectItems . length === 1 ) {
210- return (
211- < >
212- < s . TextContainer >
213- < s . Title > Opening the IDE...</ s . Title >
214- < s . Description >
215- Your IDE client is opening automatically; you can close this tab.
216- </ s . Description >
224+ < s . Title > Unable to open the Digma link</ s . Title >
225+ < s . Subtitle >
226+ Opening this link requires a running IDE with Digma installed and
227+ configured. Launch your IDE and install Digma as needed, then
228+ click the < s . EmphasizedText > Try again</ s . EmphasizedText > button.
229+ </ s . Subtitle >
217230 </ s . TextContainer >
218- < s . SelectContainer >
219- < Select
220- placeholder = { selectedItem ?. label ?? "Select IDE Project" }
221- items = { selectItems }
222- onChange = { ( value ) => {
223- void handleSelectChange ( value ) ;
224- } }
231+ < s . ButtonsContainer >
232+ < NewButton
233+ label = { "Try again" }
234+ onClick = { handleTryScanningAgainButtonClick }
235+ buttonType = { "secondary" }
225236 />
226- </ s . SelectContainer >
237+ < NewButton
238+ label = { "Get Digma" }
239+ onClick = { handleGetDigmaButtonClick }
240+ />
241+ </ s . ButtonsContainer >
227242 </ >
228243 ) ;
229244 }
230245
231- if ( selectItems . length > 0 ) {
246+ if ( selectItems . length > 1 ) {
232247 return (
233248 < >
234249 < s . TextContainer >
235- { action === "OpenReport" ? (
236- < s . Title >
237- Select the IDE project to view Metrics report in Digma
238- </ s . Title >
239- ) : (
240- < s . Title >
241- Select the IDE project to view{ " " }
242- { spanDisplayName && < > { spanDisplayName } </ > }
243- issues{ " " }
244- { environmentName && < > for { environmentName } environment </ > }
245- in Digma
246- </ s . Title >
247- ) }
248- < s . Description >
249- Please select the IDE project you'd like to open.
250- </ s . Description >
250+ < s . Title > Select the IDE project to view the Digma link</ s . Title >
251+ < s . Subtitle >
252+ We'll automatically switch to the IDE once you make a
253+ selection
254+ </ s . Subtitle >
251255 </ s . TextContainer >
252256 < s . SelectContainer >
253257 < Select
0 commit comments