-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Service Connector * Requested changes and update package * Add name to activity log * Hide validate from the command palette * Update package and change create/delete name * one more change * Update dev and serviceconnector package
- Loading branch information
Showing
10 changed files
with
218 additions
and
15 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.md in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { ServiceConnectorGroupTreeItem, createLinker } from "@microsoft/vscode-azext-serviceconnector"; | ||
import { IActionContext } from "@microsoft/vscode-azext-utils"; | ||
import { localize } from "../localize"; | ||
import { SlotTreeItem } from "../tree/SlotTreeItem"; | ||
import { createActivityContext } from "../utils/activityUtils"; | ||
import { pickFunctionApp } from "../utils/pickFunctionApp"; | ||
|
||
export async function createServiceConnector(context: IActionContext, item?: SlotTreeItem | ServiceConnectorGroupTreeItem): Promise<void> { | ||
item ??= await pickFunctionApp(context); | ||
|
||
if (item instanceof ServiceConnectorGroupTreeItem) { | ||
item = <SlotTreeItem>item.parent; | ||
} | ||
|
||
const activityContext = { | ||
...context, | ||
...await createActivityContext(), | ||
activityTitle: localize('createServiceConnector', 'Create connection'), | ||
} | ||
|
||
await createLinker(activityContext, item.id, item.subscription); | ||
await item.refresh(context); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.md in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { ServiceConnectorTreeItem, deleteLinker } from "@microsoft/vscode-azext-serviceconnector"; | ||
import { IActionContext } from "@microsoft/vscode-azext-utils"; | ||
import { localize } from "../localize"; | ||
import { SlotTreeItem } from "../tree/SlotTreeItem"; | ||
import { createActivityContext } from "../utils/activityUtils"; | ||
import { pickFunctionApp } from "../utils/pickFunctionApp"; | ||
|
||
export async function deleteServiceConnector(context: IActionContext, item?: SlotTreeItem | ServiceConnectorTreeItem): Promise<void> { | ||
let serviceConnectorName: string | undefined = undefined; | ||
item ??= await pickFunctionApp(context); | ||
|
||
if (item instanceof ServiceConnectorTreeItem) { | ||
serviceConnectorName = item.label; | ||
item = <SlotTreeItem>item.parent?.parent; | ||
} | ||
|
||
const activityContext = { | ||
...context, | ||
...await createActivityContext(), | ||
activityTitle: localize('deleteServiceConnector', 'Delete connection'), | ||
} | ||
|
||
await deleteLinker(activityContext, item.id, item.subscription, serviceConnectorName); | ||
await item.refresh(context); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.md in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { ServiceConnectorTreeItem, validateLinker } from "@microsoft/vscode-azext-serviceconnector"; | ||
import { IActionContext } from "@microsoft/vscode-azext-utils"; | ||
import { localize } from "../localize"; | ||
import { SlotTreeItem } from "../tree/SlotTreeItem"; | ||
import { createActivityContext } from "../utils/activityUtils"; | ||
import { pickFunctionApp } from "../utils/pickFunctionApp"; | ||
|
||
export async function validateServiceConnector(context: IActionContext, item?: SlotTreeItem | ServiceConnectorTreeItem): Promise<void> { | ||
let serviceConnectorName: string | undefined = undefined | ||
item ??= await pickFunctionApp(context); | ||
|
||
if (item instanceof ServiceConnectorTreeItem) { | ||
serviceConnectorName = item.label; | ||
item = <SlotTreeItem>item.parent?.parent; | ||
} | ||
|
||
const activityContext = { | ||
...context, | ||
...await createActivityContext(), | ||
activityTitle: localize('validate', `Validate connection "{0}"`, serviceConnectorName), | ||
} | ||
|
||
await validateLinker(activityContext, item.id, item.subscription, serviceConnectorName); | ||
} |
Oops, something went wrong.