@@ -371,7 +371,7 @@ class RSConnectClientDeployResult(TypedDict):
371
371
app_id : str
372
372
app_guid : str | None
373
373
app_url : str
374
- preview_url : str | None
374
+ draft_url : str | None
375
375
title : str | None
376
376
377
377
@@ -606,17 +606,17 @@ def deploy(
606
606
607
607
task = self .content_deploy (app_guid , app_bundle ["id" ], activate = activate )
608
608
609
- # http://ADDRESS/preview/APP_GUID/BUNDLE_ID
610
- # Using replace makes this a bit more robust to changes in the URL structure
611
- # like connect being served on a subpath.
612
- preview_url = app [ "url" ]. replace ( "/content/" , "/preview/" ). rstrip ( "/" ) + f"/{ app_bundle ['id' ]} "
609
+ # http://ADDRESS/DASHBOARD-PATH/#/apps/GUID/draft/BUNDLE_ID_TO_PREVIEW
610
+ # Pulling v1 content to get the full dashboard URL
611
+ app_v1 = self . content_get ( app [ "guid" ])
612
+ draft_url = app_v1 [ "dashboard_url" ] + f"/draft /{ app_bundle ['id' ]} "
613
613
614
614
return {
615
615
"task_id" : task ["task_id" ],
616
616
"app_id" : app_id ,
617
617
"app_guid" : app ["guid" ],
618
618
"app_url" : app ["url" ],
619
- "preview_url " : preview_url if not activate else None ,
619
+ "draft_url " : draft_url if not activate else None ,
620
620
"title" : app ["title" ],
621
621
}
622
622
@@ -1126,7 +1126,7 @@ def deploy_bundle(self, activate: bool = True):
1126
1126
app_id = str (prepare_deploy_result .app_id ),
1127
1127
app_guid = None ,
1128
1128
task_id = None ,
1129
- preview_url = None ,
1129
+ draft_url = None ,
1130
1130
title = self .title ,
1131
1131
)
1132
1132
return self
@@ -1168,8 +1168,8 @@ def emit_task_log(
1168
1168
log_lines = self .remote_server .handle_bad_response (log_lines )
1169
1169
1170
1170
log_callback .info ("Deployment completed successfully." )
1171
- if self .deployed_info .get ("preview_url " ):
1172
- log_callback .info ("\t Preview content URL: %s" , self .deployed_info ["preview_url " ])
1171
+ if self .deployed_info .get ("draft_url " ):
1172
+ log_callback .info ("\t Draft content URL: %s" , self .deployed_info ["draft_url " ])
1173
1173
else :
1174
1174
app_config = self .client .app_config (self .deployed_info ["app_id" ])
1175
1175
app_config = self .remote_server .handle_bad_response (app_config )
0 commit comments