Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wording and welcome page #12879

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/vscode-extension/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@
"teamstoolkit.viewsWelcome.teamsfx-project-and-check-upgradeV3.content": "[Upgrade Project](command:fx-extension.checkProjectUpgrade?%5B%22SideBar%22%5D)\nUpgrade your Teams Toolkit project to stay compatible with the latest version. A backup directory will be created along with an Upgrade Summary. [More Info](command:fx-extension.openDocument?%5B%22SideBar%22%2C%22learnmore%22%5D)\nIf you don't want to upgrade now, please keep using Teams Toolkit version 4.x.x.",
"teamstoolkit.viewsWelcome.teamsfx-empty-project.content": "Welcome to Teams Toolkit!\nGet started with a guided tutorial\n[Build a Notification Bot](command:fx-extension.openWelcome?%5B%22SideBar%22%5D)\n[Build a Declarative Agent](command:fx-extension.buildIntelligentAppsWalkthrough?%5B%22SideBar%22%5D)\n Or jump right into the app development with app templates or samples\n[Create a New App](command:fx-extension.create?%5B%22SideBar%22%5D)\n[View Samples](command:fx-extension.openSamples?%5B%22SideBar%22%5D)\nVisit our documentation to build apps for [Microsoft Teams](command:fx-extension.openDocument?%5B%22documentName%22%2C%22build-apps%22%5D) or extend [Microsoft 365 Copilot](command:fx-extension.openDocument?%5B%22documentName%22%2C%22build-agents%22%5D).",
"_teamstoolkit.viewsWelcome.teamsfx-empty-project.content.comment": "For command like [Get Started](command:xxx), please translate 'Get Started' and keep the string 'command:xxx'",
"teamstoolkit.viewsWelcome.teamsfx-empty-project-with-chat.content": "Welcome to Teams Toolkit!\nGet started with a guided tutorial\n[Build a Notification Bot](command:fx-extension.openWelcome?%5B%22SideBar%22%5D)\n[Build a Declarative Agent](command:fx-extension.buildIntelligentAppsWalkthrough?%5B%22SideBar%22%5D)\n Or jump right into the app development with app templates or samples\n[Create a New App](command:fx-extension.create?%5B%22SideBar%22%5D)\n[View Samples](command:fx-extension.openSamples?%5B%22SideBar%22%5D)\nYou can also create your new app by chat with GitHub Copilot.\n[Create App with GitHub Copilot](command:fx-extension.invokeChat?%5B%22SideBar%22%5D)\nVisit our documentation to build apps for [Microsoft Teams](command:fx-extension.openDocument?%5B%22documentName%22%2C%22build-apps%22%5D) or extend [Microsoft 365 Copilot](command:fx-extension.openDocument?%5B%22documentName%22%2C%22build-agents%22%5D).",
"teamstoolkit.viewsWelcome.teamsfx-empty-project-with-chat.content": "Welcome to Teams Toolkit!\nGet started with a guided tutorial\n[Build a Notification Bot](command:fx-extension.openWelcome?%5B%22SideBar%22%5D)\n[Build a Declarative Agent](command:fx-extension.buildIntelligentAppsWalkthrough?%5B%22SideBar%22%5D)\n Or jump right into the app development with app templates or samples\n[Create a New App](command:fx-extension.create?%5B%22SideBar%22%5D)\n[View Samples](command:fx-extension.openSamples?%5B%22SideBar%22%5D)\nCreate your new app effortlessly with GitHub Copilot.\n[Create App with GitHub Copilot](command:fx-extension.invokeChat?%5B%22SideBar%22%5D)\nVisit our documentation to build apps for [Microsoft Teams](command:fx-extension.openDocument?%5B%22documentName%22%2C%22build-apps%22%5D) or extend [Microsoft 365 Copilot](command:fx-extension.openDocument?%5B%22documentName%22%2C%22build-agents%22%5D).",
"teamstoolkit.walkthroughs.description": "Jumpstart your Teams app development experience with Teams Toolkit",
"teamstoolkit.walkthroughs.withChat.description": "Jumpstart your Teams app development experience with Teams Toolkit.",
"_teamstoolkit.walkthroughs.withChat.description.comment": "@teams is a command which should not be translated.",
Expand Down
1 change: 0 additions & 1 deletion packages/vscode-extension/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export enum CommandKey {
publishToAppSource = "fx-extension.publishToAppSource",
openDeployLink = "fx-extension.officeDevDeploy",
openOfficeDevDocument = "fx-extension.openOfficeDevDocument",
SelectWalkthrough = "fx-extension.selectWalkthrough",
}

export const environmentVariableRegex = /\${{[a-zA-Z-_]+}}/g;
Expand Down
2 changes: 0 additions & 2 deletions packages/vscode-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ import {
openSamplesHandler,
openWelcomeHandler,
saveTextDocumentHandler,
selectWalkthroughHandler,
} from "./handlers/controlHandlers";
import * as copilotChatHandlers from "./handlers/copilotChatHandlers";
import {
Expand Down Expand Up @@ -410,7 +409,6 @@ function registerActivateCommands(context: vscode.ExtensionContext) {

// Quick start
registerInCommandController(context, CommandKeys.OpenWelcome, openWelcomeHandler);
registerInCommandController(context, CommandKeys.SelectWalkthrough, selectWalkthroughHandler);
registerInCommandController(
context,
CommandKeys.BuildIntelligentAppsWalkthrough,
Expand Down
11 changes: 3 additions & 8 deletions packages/vscode-extension/src/handlers/controlHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,13 @@ export async function openWelcomeHandler(...args: unknown[]): Promise<Result<unk
"workbench.action.openWalkthrough",
"TeamsDevApp.ms-teams-vscode-extension#buildIntelligentApps"
);
return Promise.resolve(ok(data));
} else {
data = await vscode.commands.executeCommand(
"workbench.action.openWalkthrough",
getWalkThroughId()
);
return await selectWalkthrough(args);
}
return Promise.resolve(ok(data));
}

export async function selectWalkthroughHandler(
...args: unknown[]
): Promise<Result<unknown, FxError>> {
export async function selectWalkthrough(...args: unknown[]): Promise<Result<unknown, FxError>> {
const TeamsToolkitOptionLabel = getDefaultString("teamstoolkit.walkthroughs.title");
const BuildingIntelligentAppsLabel = getDefaultString(
"teamstoolkit.walkthroughs.buildIntelligentApps.title"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ class TreeViewManager {
new TreeViewCommand(
localize("teamstoolkit.commandsTreeViewProvider.getStartedTitle"),
localize("teamstoolkit.commandsTreeViewProvider.getStarted"),
"fx-extension.selectWalkthrough",
"fx-extension.openWelcome",
undefined,
{ name: "symbol-event", custom: false },
TreeCategory.GettingStarted
Expand Down
28 changes: 18 additions & 10 deletions packages/vscode-extension/test/handlers/controlHandlers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
openSamplesHandler,
openWelcomeHandler,
saveTextDocumentHandler,
selectWalkthroughHandler,
selectWalkthrough,
} from "../../src/handlers/controlHandlers";
import { ExtTelemetry } from "../../src/telemetry/extTelemetry";
import {
Expand All @@ -40,7 +40,9 @@ describe("Control Handlers", () => {
sandbox.stub(manifestUtils, "getCapabilities").returns(["bot"]);
const executeCommands = sandbox.stub(vscode.commands, "executeCommand");
const sendTelemetryEvent = sandbox.stub(ExtTelemetry, "sendTelemetryEvent");

sandbox
.stub(vscode.window, "showQuickPick")
.resolves({ label: getDefaultString("teamstoolkit.walkthroughs.title") });
await openWelcomeHandler();

sandbox.assert.calledOnceWithExactly(
Expand All @@ -56,7 +58,9 @@ describe("Control Handlers", () => {
sandbox.stub(manifestUtils, "getCapabilities").returns(["bot"]);
const executeCommands = sandbox.stub(vscode.commands, "executeCommand");
const sendTelemetryEvent = sandbox.stub(ExtTelemetry, "sendTelemetryEvent");

sandbox
.stub(vscode.window, "showQuickPick")
.resolves({ label: getDefaultString("teamstoolkit.walkthroughs.title") });
await openWelcomeHandler();

sandbox.assert.calledOnceWithExactly(
Expand Down Expand Up @@ -136,7 +140,9 @@ describe("Control Handlers", () => {
sandbox.stub(fs, "readFile").resolves(Buffer.from(""));
const executeCommands = sandbox.stub(vscode.commands, "executeCommand");
const sendTelemetryEvent = sandbox.stub(ExtTelemetry, "sendTelemetryEvent");

sandbox
.stub(vscode.window, "showQuickPick")
.resolves({ label: getDefaultString("teamstoolkit.walkthroughs.title") });
await openWelcomeHandler();

sandbox.assert.calledOnceWithExactly(
Expand All @@ -157,7 +163,9 @@ describe("Control Handlers", () => {
sandbox.stub(fs, "readFile").resolves(Buffer.from(""));
const executeCommands = sandbox.stub(vscode.commands, "executeCommand");
const sendTelemetryEvent = sandbox.stub(ExtTelemetry, "sendTelemetryEvent");

sandbox
.stub(vscode.window, "showQuickPick")
.resolves({ label: getDefaultString("teamstoolkit.walkthroughs.title") });
await openWelcomeHandler();

sandbox.assert.calledOnceWithExactly(
Expand Down Expand Up @@ -326,7 +334,7 @@ describe("Control Handlers", () => {
});
});

describe("selectWalkthroughHandler", () => {
describe("selectWalkthrough", () => {
let quickPickStub: sinon.SinonStub;
let executeCommandStub: sinon.SinonStub;

Expand All @@ -352,7 +360,7 @@ describe("Control Handlers", () => {
return "Success";
});

const result = await selectWalkthroughHandler();
const result = await selectWalkthrough();

chai.assert.isTrue(quickPickStub.calledOnce);
chai.assert.isTrue(executeCommandStub.calledOnce);
Expand Down Expand Up @@ -380,7 +388,7 @@ describe("Control Handlers", () => {
return "Success";
});

const result = await selectWalkthroughHandler();
const result = await selectWalkthrough();

chai.assert.isTrue(quickPickStub.calledOnce);
chai.assert.isTrue(executeCommandStub.calledOnce);
Expand All @@ -399,7 +407,7 @@ describe("Control Handlers", () => {
return "Success";
});

const result = await selectWalkthroughHandler();
const result = await selectWalkthrough();

chai.assert.isTrue(quickPickStub.calledOnce);
chai.assert.isTrue(executeCommandStub.calledOnce);
Expand All @@ -417,7 +425,7 @@ describe("Control Handlers", () => {
return "Success";
});

const result = await selectWalkthroughHandler();
const result = await selectWalkthrough();

chai.assert.isTrue(quickPickStub.calledOnce);
chai.assert.isTrue(executeCommandStub.calledOnce);
Expand Down
Loading