From ecf87ecd1e07730513fd8559a03d9bb2fecb217a Mon Sep 17 00:00:00 2001 From: Bill Sager Date: Thu, 27 Jun 2024 15:07:47 -0700 Subject: [PATCH 1/4] add view-logs anchor to publishing in progress indicator --- .../types/messages/webviewToHostMessages.ts | 10 +++++++-- extensions/vscode/src/views/homeView.ts | 6 ++++++ .../src/components/EvenEasierDeploy.vue | 21 ++++++++++++++++++- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/extensions/vscode/src/types/messages/webviewToHostMessages.ts b/extensions/vscode/src/types/messages/webviewToHostMessages.ts index 0b76ca610..5cc6c5159 100644 --- a/extensions/vscode/src/types/messages/webviewToHostMessages.ts +++ b/extensions/vscode/src/types/messages/webviewToHostMessages.ts @@ -23,6 +23,7 @@ export enum WebviewToHostMessageType { SELECT_DEPLOYMENT = "selectDeployment", NEW_DEPLOYMENT = "newDeployment", NEW_CREDENTIAL = "newCredential", + VIEW_PUBLISHING_LOG = "viewPublishingLog", } export type AnyWebviewToHostMessage< @@ -54,7 +55,8 @@ export type WebviewToHostMessage = | ScanRPackageRequirementsMsg | SelectDeploymentMsg | NewDeploymentMsg - | NewCredentialMsg; + | NewCredentialMsg + | ViewPublishingLog; export function isWebviewToHostMessage(msg: any): msg is WebviewToHostMessage { return ( @@ -76,7 +78,8 @@ export function isWebviewToHostMessage(msg: any): msg is WebviewToHostMessage { msg.kind === WebviewToHostMessageType.SCAN_R_PACKAGE_REQUIREMENTS || msg.kind === WebviewToHostMessageType.SELECT_DEPLOYMENT || msg.kind === WebviewToHostMessageType.NEW_DEPLOYMENT || - msg.kind === WebviewToHostMessageType.NEW_CREDENTIAL + msg.kind === WebviewToHostMessageType.NEW_CREDENTIAL || + msg.kind === WebviewToHostMessageType.VIEW_PUBLISHING_LOG ); } @@ -170,3 +173,6 @@ export type NewDeploymentMsg = export type NewCredentialMsg = AnyWebviewToHostMessage; + +export type ViewPublishingLog = + AnyWebviewToHostMessage; diff --git a/extensions/vscode/src/views/homeView.ts b/extensions/vscode/src/views/homeView.ts index 28267348b..0dc519539 100644 --- a/extensions/vscode/src/views/homeView.ts +++ b/extensions/vscode/src/views/homeView.ts @@ -209,6 +209,8 @@ export class HomeViewProvider implements WebviewViewProvider, Disposable { return this.showNewDeploymentMultiStep(Views.HomeView); case WebviewToHostMessageType.NEW_CREDENTIAL: return this.showNewCredential(); + case WebviewToHostMessageType.VIEW_PUBLISHING_LOG: + return this.showPublishingLog(); default: throw new Error( `Error: _onConduitMessage unhandled msg: ${JSON.stringify(msg)}`, @@ -797,6 +799,10 @@ export class HomeViewProvider implements WebviewViewProvider, Disposable { ); } + private showPublishingLog() { + return commands.executeCommand(Commands.Logs.Focus); + } + private async showDeploymentQuickPick(): Promise< DeploymentNames | undefined > { diff --git a/extensions/vscode/webviews/homeView/src/components/EvenEasierDeploy.vue b/extensions/vscode/webviews/homeView/src/components/EvenEasierDeploy.vue index 3d9ba266b..15432afe9 100644 --- a/extensions/vscode/webviews/homeView/src/components/EvenEasierDeploy.vue +++ b/extensions/vscode/webviews/homeView/src/components/EvenEasierDeploy.vue @@ -105,7 +105,14 @@
- Deployment in Progress... +
+
Deployment in Progress...
+
+ View Log +
+
{ }); }; +const onViewPublishingLog = () => { + hostConduit.sendMsg({ + kind: WebviewToHostMessageType.VIEW_PUBLISHING_LOG, + }); +}; + const isConfigInErrorList = (configName?: string): boolean => { if (!configName) { return false; @@ -449,6 +462,12 @@ const newCredential = () => { margin-right: 10px; } +.progress-desc { + display: flex; + flex-direction: column; + align-items: flex-start; +} + .deployment-details-container { margin-bottom: 0.5rem; From 5b5da72c1296e5518b6fc8c8ed522d129d68b6a2 Mon Sep 17 00:00:00 2001 From: Bill Sager Date: Mon, 1 Jul 2024 11:45:51 -0700 Subject: [PATCH 2/4] Logs -> Log, when referencing a single target --- extensions/vscode/package.json | 8 ++++---- extensions/vscode/src/views/logs.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 68875c986..d5d215ddf 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -248,7 +248,7 @@ }, { "command": "posit.publisher.homeView.navigateToDeployment.ContentLog", - "title": "Show Content Logs", + "title": "Show Content Log", "icon": "$(output)", "category": "Posit Publisher" } @@ -497,7 +497,7 @@ "panel": [ { "id": "posit-publisher-logs", - "title": "Posit Publisher Logs", + "title": "Posit Publisher Log", "icon": "$(output)" } ] @@ -562,8 +562,8 @@ "posit-publisher-logs": [ { "id": "posit.publisher.logs", - "name": "Logs", - "contextualTitle": "Logs", + "name": "Log", + "contextualTitle": "Log", "icon": "$(output)", "when": "workbenchState == folder && posit.publish.state == 'initialized'" } diff --git a/extensions/vscode/src/views/logs.ts b/extensions/vscode/src/views/logs.ts index 510418e81..17ecebc50 100644 --- a/extensions/vscode/src/views/logs.ts +++ b/extensions/vscode/src/views/logs.ts @@ -177,7 +177,7 @@ export class LogsTreeDataProvider implements TreeDataProvider { } }); - let showLogsOption = "Show Logs"; + let showLogsOption = "Show Log"; const selection = await window.showErrorMessage( `Deployment failed: ${msg.data.message}`, showLogsOption, From d50fee625b33494d786170c1eb0e592f0610c834 Mon Sep 17 00:00:00 2001 From: Bill Sager Date: Mon, 1 Jul 2024 13:00:04 -0700 Subject: [PATCH 3/4] Use Show and View consistently --- extensions/vscode/package.json | 10 +++++----- extensions/vscode/src/views/deployProgress.ts | 2 +- extensions/vscode/src/views/logs.ts | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index d5d215ddf..48b250905 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -218,7 +218,7 @@ }, { "command": "posit.publisher.logs.visit", - "title": "View Deployment in Connect", + "title": "View Deployment Logs in Connect", "icon": "$(link-external)", "category": "Posit Publisher" }, @@ -230,25 +230,25 @@ }, { "command": "posit.publisher.homeView.navigateToDeployment.Content", - "title": "View Content", + "title": "View Deployment in Connect", "icon": "$(server-process)", "category": "Posit Publisher" }, { "command": "posit.publisher.showOutputChannel", - "title": "Go to Debug Log", + "title": "Show Debug Log", "icon": "$(output)", "category": "Posit Publisher" }, { "command": "posit.publisher.showPublishingLog", - "title": "Go to Publishing Log", + "title": "Show Publishing Log", "icon": "$(output)", "category": "Posit Publisher" }, { "command": "posit.publisher.homeView.navigateToDeployment.ContentLog", - "title": "Show Content Log", + "title": "View Content Log on Connect", "icon": "$(output)", "category": "Posit Publisher" } diff --git a/extensions/vscode/src/views/deployProgress.ts b/extensions/vscode/src/views/deployProgress.ts index 169039fc5..6b17220c2 100644 --- a/extensions/vscode/src/views/deployProgress.ts +++ b/extensions/vscode/src/views/deployProgress.ts @@ -449,7 +449,7 @@ export function deployProject(localID: string, stream: EventStream) { }); resolveCB("Success!"); - let visitOption = "Visit"; + let visitOption = "View"; const selection = await window.showInformationMessage( "Deployment was successful", visitOption, diff --git a/extensions/vscode/src/views/logs.ts b/extensions/vscode/src/views/logs.ts index 17ecebc50..09a7b40aa 100644 --- a/extensions/vscode/src/views/logs.ts +++ b/extensions/vscode/src/views/logs.ts @@ -177,7 +177,7 @@ export class LogsTreeDataProvider implements TreeDataProvider { } }); - let showLogsOption = "Show Log"; + let showLogsOption = "View Log"; const selection = await window.showErrorMessage( `Deployment failed: ${msg.data.message}`, showLogsOption, @@ -367,7 +367,7 @@ export class LogsTreeLogItem extends TreeItem { if (msg.data.dashboardUrl !== undefined) { this.command = { - title: "Visit", + title: "View", command: Commands.Logs.Visit, arguments: [msg.data.dashboardUrl], }; From b523064d69431213f8ef6f794aad914000131295 Mon Sep 17 00:00:00 2001 From: Bill Sager Date: Mon, 1 Jul 2024 13:00:16 -0700 Subject: [PATCH 4/4] add margin --- .../webviews/homeView/src/components/EvenEasierDeploy.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extensions/vscode/webviews/homeView/src/components/EvenEasierDeploy.vue b/extensions/vscode/webviews/homeView/src/components/EvenEasierDeploy.vue index 15432afe9..434501567 100644 --- a/extensions/vscode/webviews/homeView/src/components/EvenEasierDeploy.vue +++ b/extensions/vscode/webviews/homeView/src/components/EvenEasierDeploy.vue @@ -107,7 +107,7 @@
Deployment in Progress...
-
+
View Log @@ -468,6 +468,10 @@ const newCredential = () => { align-items: flex-start; } +.progress-log-anchor { + margin-top: 5px; +} + .deployment-details-container { margin-bottom: 0.5rem;