Skip to content

Commit

Permalink
Add a What's New blurb to the start page (#2767)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwateratmsft authored Mar 11, 2021
1 parent 54c75cb commit e1692f4
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 4 deletions.
25 changes: 22 additions & 3 deletions resources/startPage.html.template
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,28 @@
</div>
</div>
<hr />
{{#if showWhatsNew}}
<div class="row">
<div class="icon">
<i class="codicon codicon-new-file" aria-label="Add Docker files"></i>
<i class="codicon codicon-star-empty" alt=""></i>
</div>
<div>
<div>
<h2>What's New</h2>
</div>
<div>
<ul>
<li>The <a href="command:workbench.view.extension.dockerView">Docker Explorer</a> now has advanced tooltips! Hover your mouse over an item to see useful info.</li>
<li>You can now open and download the files in a running container! Expand a container node to get started.</li>
<li>Right-click on a Docker Compose file to try our new <a href="command:vscode-docker.compose.up.subset?%7B%22commandReason%22%3A%22startPage%22%7D">Docker: Compose Up - Select Services</a> command!</li>
</ul>
</div>
</div>
</div>
{{/if}}
<div class="row">
<div class="icon">
<i class="codicon codicon-new-file" alt=""></i>
</div>
<div>
<div>
Expand All @@ -101,7 +120,7 @@
</div>
<div class="row">
<div class="icon">
<i class="codicon codicon-play" aria-label="Run an image"></i>
<i class="codicon codicon-play" alt=""></i>
</div>
<div>
<div>
Expand Down Expand Up @@ -147,7 +166,7 @@
</div>
<div class="row">
<div class="icon">
<i class="codicon codicon-cloud-upload" aria-label="Publish to the Cloud"></i>
<i class="codicon codicon-cloud-upload" alt=""></i>
</div>
<div>
<div>
Expand Down
2 changes: 2 additions & 0 deletions src/commands/startPage/StartPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ interface StartPageContext {
dockerIconUri: string;
showStartPageChecked: 'checked' | '';
isMac: boolean;
showWhatsNew: boolean;
}

class StartPage {
Expand Down Expand Up @@ -70,6 +71,7 @@ class StartPage {
dockerIconUri: webview.asWebviewUri(vscode.Uri.joinPath(resourcesRoot, 'docker_blue.png')).toString(),
showStartPageChecked: vscode.workspace.getConfiguration('docker').get('showStartPage', false) ? 'checked' : '',
isMac: isMac(),
showWhatsNew: !!(await ext.experimentationService.isLiveFlightEnabled('vscode-docker.whatsNew')),
};

const template = Handlebars.compile(await fse.readFile(templatePath.fsPath, 'utf-8'));
Expand Down
1 change: 0 additions & 1 deletion src/tree/AzExtParentTreeItemIntermediate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export abstract class AzExtParentTreeItemIntermediate extends AzExtParentTreeIte
// TODO: when possible we should remove this
// @ts-expect-error
return await callWithTelemetryAndErrorHandling('resolveTooltip', async (actionContext: IActionContext) => {
actionContext.telemetry.suppressIfSuccessful = true;
actionContext.errorHandling.suppressDisplay = true;
actionContext.errorHandling.rethrow = true;

Expand Down
1 change: 1 addition & 0 deletions src/tree/containers/ContainerTreeItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export class ContainerTreeItem extends AzExtParentTreeItemIntermediate implement
}

public async resolveTooltipInternal(actionContext: IActionContext): Promise<vscode.MarkdownString> {
actionContext.telemetry.properties.tooltipType = 'container';
return resolveTooltipMarkdown(containerTooltipTemplate, { NormalizedName: this.containerName, ...await ext.dockerClient.inspectContainer(actionContext, this.containerId) });
}

Expand Down
1 change: 1 addition & 0 deletions src/tree/contexts/ContextTreeItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export class ContextTreeItem extends AzExtTreeItemIntermediate {
}

public async resolveTooltipInternal(actionContext: IActionContext): Promise<MarkdownString> {
actionContext.telemetry.properties.tooltipType = 'context';
return resolveTooltipMarkdown(contextTooltipTemplate, await this.inspect(actionContext));
}
}
Expand Down
1 change: 1 addition & 0 deletions src/tree/images/ImageTreeItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export class ImageTreeItem extends AzExtTreeItemIntermediate {
}

public async resolveTooltipInternal(actionContext: IActionContext): Promise<MarkdownString> {
actionContext.telemetry.properties.tooltipType = 'image';
return resolveTooltipMarkdown(imageTooltipTemplate, { NormalizedName: this.fullTag, NormalizedSize: getCommonPropertyValue(this._item, 'Size'), ...await ext.dockerClient.inspectImage(actionContext, this.imageId) });
}
}
Expand Down
1 change: 1 addition & 0 deletions src/tree/networks/NetworkTreeItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export class NetworkTreeItem extends AzExtTreeItemIntermediate {
}

public async resolveTooltipInternal(actionContext: IActionContext): Promise<MarkdownString> {
actionContext.telemetry.properties.tooltipType = 'network';
return resolveTooltipMarkdown(networkTooltipTemplate, await ext.dockerClient.inspectNetwork(actionContext, this.networkName));
}
}
Expand Down
1 change: 1 addition & 0 deletions src/tree/volumes/VolumeTreeItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export class VolumeTreeItem extends AzExtTreeItemIntermediate {
}

public async resolveTooltipInternal(actionContext: IActionContext): Promise<MarkdownString> {
actionContext.telemetry.properties.tooltipType = 'volume';
return resolveTooltipMarkdown(volumeTooltipTemplate, await ext.dockerClient.inspectVolume(actionContext, this.volumeName));
}
}
Expand Down

0 comments on commit e1692f4

Please sign in to comment.