-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvements to ACR selection prompting (#809)
- Loading branch information
1 parent
0994519
commit a9ea653
Showing
16 changed files
with
216 additions
and
187 deletions.
There are no files selected for viewing
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
66 changes: 0 additions & 66 deletions
66
...t/deploymentConfiguration/workspace/azureResources/TryUseExistingWorkspaceRegistryStep.ts
This file was deleted.
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
37 changes: 37 additions & 0 deletions
37
src/commands/deployWorkspaceProject/internal/startingConfiguration/DwpAcrListStep.ts
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,37 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { type Registry } from "@azure/arm-containerregistry"; | ||
import { AzureWizardPromptStep, type IAzureQuickPickItem } from "@microsoft/vscode-azext-utils"; | ||
import { localize } from "../../../../utils/localize"; | ||
import { acrCreatePick, AcrListStep } from "../../../image/imageSource/containerRegistry/acr/AcrListStep"; | ||
import { type DeployWorkspaceProjectInternalContext } from "../DeployWorkspaceProjectInternalContext"; | ||
|
||
export class DwpAcrListStep<T extends DeployWorkspaceProjectInternalContext> extends AzureWizardPromptStep<T> { | ||
public async prompt(context: T): Promise<void> { | ||
const picks: IAzureQuickPickItem<Registry | undefined>[] = await this.getPicks(context); | ||
if (picks.length < 2) { | ||
// No container registries to choose from | ||
return; | ||
} | ||
|
||
const placeHolder: string = localize('selectContainerRegistry', 'Select an Azure Container Registry to store your image'); | ||
const pick: IAzureQuickPickItem<Registry | undefined> = await context.ui.showQuickPick(picks, { placeHolder, enableGrouping: true, suppressPersistence: true }); | ||
|
||
context.registry = pick.data; | ||
} | ||
|
||
public shouldPrompt(context: T): boolean { | ||
return !context.registry; | ||
} | ||
|
||
public async getPicks(context: T): Promise<IAzureQuickPickItem<Registry | undefined>[]> { | ||
return [ | ||
acrCreatePick, | ||
...await AcrListStep.getSortedAndRecommendedPicks(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
45 changes: 0 additions & 45 deletions
45
...mands/deployWorkspaceProject/internal/startingConfiguration/TryUseExistingRegistryStep.ts
This file was deleted.
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
Oops, something went wrong.