-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial commit * Add Service Connector * Remove utils changes * Add service connector UI * More changes for UI * Flip * Requested changes and update package * Add name to activity log * Update package and change names * Hope this is it
- Loading branch information
Showing
9 changed files
with
1,931 additions
and
11,415 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* 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 { SiteTreeItem } from "../../tree/SiteTreeItem"; | ||
import { createActivityContext } from "../../utils/activityUtils"; | ||
import { pickWebApp } from "../../utils/pickWebApp"; | ||
|
||
export async function createServiceConnector(context: IActionContext, item?: SiteTreeItem | ServiceConnectorGroupTreeItem): Promise<void> { | ||
item ??= await pickWebApp(context); | ||
if (item instanceof ServiceConnectorGroupTreeItem) { | ||
item = <SiteTreeItem>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 { SiteTreeItem } from "../../tree/SiteTreeItem"; | ||
import { createActivityContext } from "../../utils/activityUtils"; | ||
import { pickWebApp } from "../../utils/pickWebApp"; | ||
|
||
export async function deleteServiceConnector(context: IActionContext, item?: SiteTreeItem | ServiceConnectorTreeItem): Promise<void> { | ||
let serviceConnectorName = undefined | ||
item ??= await pickWebApp(context); | ||
|
||
if (item instanceof ServiceConnectorTreeItem) { | ||
serviceConnectorName = item.label; | ||
item = <SiteTreeItem>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 { SiteTreeItem } from "../../tree/SiteTreeItem"; | ||
import { createActivityContext } from "../../utils/activityUtils"; | ||
import { pickWebApp } from "../../utils/pickWebApp"; | ||
|
||
export async function validateServiceConnector(context: IActionContext, item?: SiteTreeItem | ServiceConnectorTreeItem): Promise<void> { | ||
let serviceConnectorName = undefined | ||
item ??= await pickWebApp(context); | ||
|
||
if (item instanceof ServiceConnectorTreeItem) { | ||
serviceConnectorName = item.label; | ||
item = <SiteTreeItem>item.parent?.parent; | ||
} | ||
|
||
const activityContext = { | ||
...context, | ||
...await createActivityContext(), | ||
activityTitle: localize('validate', `Validate connection "{0}"`, serviceConnectorName), | ||
} | ||
|
||
await validateLinker(activityContext, item.id, item.subscription, serviceConnectorName); | ||
} |
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