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

refactor: aadManifest, env, openLinkHandlers #11897

Merged
merged 6 commits into from
Jun 25, 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
5 changes: 5 additions & 0 deletions packages/vscode-extension/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ export enum PrereleaseState {
Version = "teamsToolkit:prerelease:version",
}

export enum ResourceInfo {
Subscription = "Subscription",
ResourceGroup = "Resource Group",
}

export enum GlobalKey {
OpenWalkThrough = "fx-extension.openWalkThrough",
OpenReadMe = "fx-extension.openReadMe",
Expand Down
41 changes: 24 additions & 17 deletions packages/vscode-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ import * as copilotChatHandlers from "./handlers/copilotChatHandlers";
import { debugInTestToolHandler } from "./handlers/debugInTestTool";
import { downloadSampleApp } from "./handlers/downloadSample";
import {
addWebpartHandler,
createNewProjectHandler,
deployHandler,
provisionHandler,
Expand All @@ -102,6 +103,8 @@ import {
openLifecycleLinkHandler,
openM365AccountHandler,
openReportIssues,
openResourceGroupInPortal,
openSubscriptionInPortal,
openWelcomeHandler,
} from "./handlers/openLinkHandlers";
import { showOutputChannelHandler } from "./handlers/showOutputChannel";
Expand Down Expand Up @@ -144,7 +147,16 @@ import {
validateManifestHandler,
} from "./handlers/manifestHandlers";
import { openTutorialHandler, selectTutorialsHandler } from "./handlers/tutorialHandlers";
import { createNewEnvironment, refreshEnvironment } from "./handlers/envHandlers";
import {
editAadManifestTemplateHandler,
openPreviewAadFileHandler,
updateAadAppManifestHandler,
} from "./handlers/aadManifestHandlers";
import {
createNewEnvironment,
openConfigStateFile,
refreshEnvironment,
} from "./handlers/envHandlers";

export async function activate(context: vscode.ExtensionContext) {
process.env[FeatureFlags.ChatParticipant] = (
Expand Down Expand Up @@ -539,12 +551,7 @@ function registerTreeViewCommandsInDevelopment(context: vscode.ExtensionContext)
handlers.installAdaptiveCardExt
);

registerInCommandController(
context,
"fx-extension.addWebpart",
handlers.addWebpart,
"addWebpart"
);
registerInCommandController(context, "fx-extension.addWebpart", addWebpartHandler, "addWebpart");
}

function registerTreeViewCommandsInLifecycle(context: vscode.ExtensionContext) {
Expand Down Expand Up @@ -590,7 +597,7 @@ function registerTeamsFxCommands(context: vscode.ExtensionContext) {

const updateAadAppManifest = vscode.commands.registerCommand(
"fx-extension.updateAadAppManifest",
(...args) => Correlator.run(handlers.updateAadAppManifest, args)
(...args) => Correlator.run(updateAadAppManifestHandler, args)
);
context.subscriptions.push(updateAadAppManifest);

Expand Down Expand Up @@ -620,13 +627,13 @@ function registerTeamsFxCommands(context: vscode.ExtensionContext) {

const openConfigStateCmd = vscode.commands.registerCommand(
"fx-extension.openConfigState",
(...args) => Correlator.run(handlers.openConfigStateFile, args)
(...args) => Correlator.run(openConfigStateFile, args)
);
context.subscriptions.push(openConfigStateCmd);

const editAadManifestTemplateCmd = vscode.commands.registerCommand(
"fx-extension.editAadManifestTemplate",
(...args) => Correlator.run(handlers.editAadManifestTemplate, args)
(...args) => Correlator.run(editAadManifestTemplateHandler, args)
);
context.subscriptions.push(editAadManifestTemplateCmd);

Expand Down Expand Up @@ -750,18 +757,18 @@ function registerMenuCommands(context: vscode.ExtensionContext) {

const aadManifestTemplateCodeLensCmd = vscode.commands.registerCommand(
"fx-extension.openPreviewAadFile",
(...args) => Correlator.run(handlers.openPreviewAadFile, args)
(...args) => Correlator.run(openPreviewAadFileHandler, args)
);
context.subscriptions.push(aadManifestTemplateCodeLensCmd);

const openResourceGroupInPortal = vscode.commands.registerCommand(
const openResourceGroupInPortalCmd = vscode.commands.registerCommand(
"fx-extension.openResourceGroupInPortal",
async (node: Record<string, string>) => {
const envName = node.identifier;
await Correlator.run(handlers.openResourceGroupInPortal, envName);
await Correlator.run(openResourceGroupInPortal, envName);
}
);
context.subscriptions.push(openResourceGroupInPortal);
context.subscriptions.push(openResourceGroupInPortalCmd);

const openManifestSchemaCmd = vscode.commands.registerCommand(
"fx-extension.openSchema",
Expand All @@ -779,14 +786,14 @@ function registerMenuCommands(context: vscode.ExtensionContext) {
);
context.subscriptions.push(addAPICmd);

const openSubscriptionInPortal = vscode.commands.registerCommand(
const openSubscriptionInPortalCmd = vscode.commands.registerCommand(
"fx-extension.openSubscriptionInPortal",
async (node: Record<string, string>) => {
const envName = node.identifier;
await Correlator.run(handlers.openSubscriptionInPortal, envName);
await Correlator.run(openSubscriptionInPortal, envName);
}
);
context.subscriptions.push(openSubscriptionInPortal);
context.subscriptions.push(openSubscriptionInPortalCmd);

registerInCommandController(
context,
Expand Down
Loading
Loading