Skip to content
Draft
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
10 changes: 5 additions & 5 deletions packages/fx-core/resource/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -926,17 +926,17 @@
"driver.botFramework.summary.update": "The bot registration has been updated successfully (%s).",
"driver.botFramework.progressBar.createOrUpdateBot": "Creating or updating bot registration.",
"driver.botFramework.error.InvalidBotId": "Bot ID %s is invalid. It must be a GUID.",
"driver.devChannel.description": "Create a sandboxed Team and channel for development and testing",
"driver.devChannel.progress.message": "Creating Team and channel...",
"driver.devChannel.description": "Create a Developer Sandbox for development and testing",
"driver.devChannel.progress.message": "Creating Developer Sandbox team and channel...",
"driver.devChannel.success": "Team %s with default channel %s created. Channel ID: %s, Team ID: %s",
"driver.devChannel.summary": "Team %s with default channel %s created.",
"driver.devChannel.status": "Team and channel creation status: %s",
"driver.devChannel.summary.exists": "Environment variable %s and %s already exist, skipping new sandboxed Team creation step.",
"driver.devChannel.summary.exists": "Environment variable %s and %s already exist, skipping new Developer Sandbox creation step.",
"driver.devChannel.install.success": "App installed into team %s with channel %s successfully.",
"driver.devChannel.install.description": "Install app into sandboxed channel.",
"driver.devChannel.install.description": "Install app into Developer Sandbox channel.",
"driver.devChannel.install.progress.message": "Installing app...",
"driver.devChannel.install.summary.exists": "App '%s' already installed in team '%s'. It will now be updated to the latest version.",
"error.installApp.outsideSandbox": "Unable to install app outside sandboxed Team. Please update TEAM_ID and CHANNEL_ID.",
"error.installApp.outsideSandbox": "Unable to install app outside Developer Sandbox. Please update TEAM_ID and CHANNEL_ID.",
"error.yaml.InvalidYamlSchemaError": "Unable to parse yaml file: %s. Please open the yaml file for detailed errors.",
"error.yaml.InvalidYamlSchemaErrorWithReason": "Unable to parse yaml file: %s. Reason: %s Please review the yaml file or upgrade to the latest Microsoft 365 Agents Toolkit.",
"error.yaml.VersionNotSupported": "version %s is not supported. Supported versions: %s.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { TelemetryProperty } from "../../../common/telemetry";
import { CreateDevChannelOutput } from "./interfaces/CreateDevChannelOutput";

const actionName = "devChannel/create";
const helpLink = "https://aka.ms/teamsfx-actions/devchannel-create";

@Service(actionName)
export class CreateDevChannelDriver implements StepDriver {
Expand Down Expand Up @@ -96,7 +97,7 @@ export class CreateDevChannelDriver implements StepDriver {
if (axios.isAxiosError(error)) {
const message = JSON.stringify(error.response!.data);
context.logProvider.error(message);
return err(new HttpClientError(error, actionName, message));
return err(new HttpClientError(error, actionName, message, helpLink));
} else {
return err(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import { UserError } from "@microsoft/teamsfx-api";
import { getDefaultString, getLocalizedString } from "../../../common/localizeUtils";

export class InstallAppOutsideSandboxError extends UserError {
constructor(actionName: string) {
constructor(actionName: string, helplink?: string) {
super({
source: actionName,
// eslint-disable-next-line no-secrets/no-secrets
name: "InstallAppOutsideSandbox",
message: getDefaultString("error.installApp.outsideSandbox"),
displayMessage: getLocalizedString("error.installApp.outsideSandbox"),
helpLink: helplink,
});
}
}
11 changes: 6 additions & 5 deletions packages/fx-core/src/component/driver/devChannel/installApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { TelemetryProperty } from "../../../common/telemetry";
import { InstallAppOutsideSandboxError } from "./errors";

const actionName = "devChannel/installApp";
const helpLink = "https://aka.ms/teamsfx-actions/devchannel-installapp";

@Service(actionName)
export class InstallAppToChannelDriver implements StepDriver {
Expand Down Expand Up @@ -57,15 +58,15 @@ export class InstallAppToChannelDriver implements StepDriver {
appPackagePath = path.join(context.projectPath, appPackagePath);
}
if (!(await fs.pathExists(appPackagePath))) {
return err(new FileNotFoundError(actionName, appPackagePath));
return err(new FileNotFoundError(actionName, appPackagePath, helpLink));
}
const archivedFile = await fs.readFile(appPackagePath);

// Read Teams app id from app package.
const zipEntries = new AdmZip(archivedFile).getEntries();
const manifestFile = zipEntries.find((x) => x.entryName === Constants.MANIFEST_FILE);
if (!manifestFile) {
return err(new FileNotFoundError(actionName, Constants.MANIFEST_FILE));
return err(new FileNotFoundError(actionName, Constants.MANIFEST_FILE, helpLink));
}
const manifestString = manifestFile.getData().toString();
const manifest = JSON.parse(manifestString) as TeamsAppManifest;
Expand Down Expand Up @@ -110,11 +111,11 @@ export class InstallAppToChannelDriver implements StepDriver {
)
) {
context.logProvider.error(getLocalizedString("error.installApp.outsideSandbox"));
return err(new InstallAppOutsideSandboxError(actionName));
return err(new InstallAppOutsideSandboxError(actionName, helpLink));
}

context.logProvider.error(message);
return err(new HttpClientError(error, actionName, message));
return err(new HttpClientError(error, actionName, message, helpLink));
} else {
return err(error);
}
Expand All @@ -135,7 +136,7 @@ export class InstallAppToChannelDriver implements StepDriver {
invalidParams.push("appPackagePath");
}
if (invalidParams.length > 0) {
return err(new InvalidActionInputError(actionName, invalidParams));
return err(new InvalidActionInputError(actionName, invalidParams, helpLink));
} else {
return ok(undefined);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ describe("InstallAppToChannelDriver", () => {

expect(result.isErr()).to.be.true;
if (result.isErr()) {
expect(result.error.message).to.include("Unable to install app outside sandboxed Team");
expect(result.error.message).to.include("Unable to install app outside");
}
});

Expand Down
14 changes: 7 additions & 7 deletions packages/vscode-extension/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
"teamstoolkit.accountTree.signingInAzure": "Azure: Signing in...",
"teamstoolkit.accountTree.signingInM365": "Microsoft 365: Signing in...",
"teamstoolkit.accountTree.switchingM365": "Microsoft 365: Switching...",
"teamstoolkit.accountTree.sandboxedTeamEnabled": "Sandboxed Team Enabled",
"teamstoolkit.accountTree.sandboxedTeamEnabled.tooltip": "You can create sandboxed Team for local testing.",
"teamstoolkit.accountTree.sandboxedTeamDisabled": "Sandboxed Team Disabled",
"teamstoolkit.accountTree.sandboxedTeamDisabled.tooltip": "Microsoft 365 account administrator hasn't enabled Sandboxed Team.",
"teamstoolkit.accountTree.suggestSandboxedTeam": "[Custom app upload](https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/deploy-and-publish/apps-upload) is disabled in your Microsoft 365 account. But you can create a sandboxed Team for local testing.",
"teamstoolkit.accountTree.sandboxedTeam.button": "Debug in Teams Sandbox (Edge)",
"teamstoolkit.accountTree.sandboxedTeamEnabled": "Developer Sandbox Enabled",
"teamstoolkit.accountTree.sandboxedTeamEnabled.tooltip": "You can create Developer Sandbox for local testing.",
"teamstoolkit.accountTree.sandboxedTeamDisabled": "Developer Sandbox Disabled",
"teamstoolkit.accountTree.sandboxedTeamDisabled.tooltip": "Microsoft 365 account administrator hasn't enabled Developer Sandbox.",
"teamstoolkit.accountTree.suggestSandboxedTeam": "[Custom app upload](https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/deploy-and-publish/apps-upload) is disabled in your Microsoft 365 account. But you can create a Developer Sandbox for local testing.",
"teamstoolkit.accountTree.sandboxedTeam.button": "Debug in Developer Sandbox (Edge)",
"teamstoolkit.appStudioLogin.createM365TestingTenant": "Create a Microsoft 365 developer sandbox",
"teamstoolkit.appStudioLogin.loginCancel": "Sign-in canceled. Microsoft 365 Agents Toolkit needs a Microsoft 365 account with custom app upload permission. If you're a Visual Studio subscriber, create a developer sandbox with the Microsoft 365 Developer Program (https://developer.microsoft.com/en-us/microsoft-365/dev-program).",
"teamstoolkit.appStudioLogin.message": "Microsoft 365 Agents Toolkit needs a Microsoft 365 account with custom app upload permission. If you're a Visual Studio subscriber, create a developer sandbox with the Microsoft 365 Developer Program.",
Expand Down Expand Up @@ -495,7 +495,7 @@
"teamstoolkit.taskDefinitions.args.prerequisites.nodejsTitle": "Check if Node.js is installed.",
"teamstoolkit.taskDefinitions.args.prerequisites.m365AccountTitle": "Prompt to sign in with your Microsoft 365 account and check if side-loading permission is enabled for the account.",
"teamstoolkit.taskDefinitions.args.prerequisites.portsTitle": "Check if the ports are available for debugging.",
"teamstoolkit.taskDefinitions.args.prerequisites.sandboxTitle": "Check if sandbox container is enabled for this account.",
"teamstoolkit.taskDefinitions.args.prerequisites.sandboxTitle": "Check if Developer Sandbox is enabled for this account.",
"teamstoolkit.taskDefinitions.args.portOccupancy.title": "Check the port numbers.",
"teamstoolkit.taskDefinitions.args.env.title": "The environment name.",
"teamstoolkit.taskDefinitions.args.url.title": "The app URL.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
},
{{#SandBoxedTeam}}
{
"name": "Debug in Teams Sandbox (Edge)",
"name": "Debug in Developer Sandbox (Edge)",
"configurations": [
"Launch App to channel (Edge)",
"Attach to Local Service"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version: v1.8

provision:
{{#SandBoxedTeam}}
# Creates a Teams channel in the specified team.
# Creates a Developer Sandbox team for local testing.
- uses: devChannel/create
with:
teamName: "App Development" # The name of the team in which to create the channel.
Expand Down