@@ -371,7 +371,7 @@ class RSConnectClientDeployResult(TypedDict):
371371 app_id : str
372372 app_guid : str | None
373373 app_url : str
374- preview_url : str | None
374+ draft_url : str | None
375375 title : str | None
376376
377377
@@ -606,17 +606,17 @@ def deploy(
606606
607607 task = self .content_deploy (app_guid , app_bundle ["id" ], activate = activate )
608608
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' ]} "
613613
614614 return {
615615 "task_id" : task ["task_id" ],
616616 "app_id" : app_id ,
617617 "app_guid" : app ["guid" ],
618618 "app_url" : app ["url" ],
619- "preview_url " : preview_url if not activate else None ,
619+ "draft_url " : draft_url if not activate else None ,
620620 "title" : app ["title" ],
621621 }
622622
@@ -1126,7 +1126,7 @@ def deploy_bundle(self, activate: bool = True):
11261126 app_id = str (prepare_deploy_result .app_id ),
11271127 app_guid = None ,
11281128 task_id = None ,
1129- preview_url = None ,
1129+ draft_url = None ,
11301130 title = self .title ,
11311131 )
11321132 return self
@@ -1168,8 +1168,8 @@ def emit_task_log(
11681168 log_lines = self .remote_server .handle_bad_response (log_lines )
11691169
11701170 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 " ])
11731173 else :
11741174 app_config = self .client .app_config (self .deployed_info ["app_id" ])
11751175 app_config = self .remote_server .handle_bad_response (app_config )
0 commit comments