Switch Auth Panel to use Universal profiles (#205)

This commit is contained in:
Crash Collison 2022-06-10 13:15:11 -07:00 коммит произвёл GitHub
Родитель ddfcde768c
Коммит 17986da91f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 21 добавлений и 38 удалений

Просмотреть файл

@ -218,13 +218,13 @@ async function snapshot() {
process.chdir(orgDir);
}
}
const cliVersion = '1.15.3';
const cliVersion = '1.15.7-daily-22060700';
const recompile = gulp.series(
clean,
async () => nugetInstall('CAP_ISVExp_Tools_Stable', 'Microsoft.PowerApps.CLI',cliVersion, path.resolve(distdir, 'pac')),
async () => nugetInstall('CAP_ISVExp_Tools_Stable', 'Microsoft.PowerApps.CLI.Core.osx-x64', cliVersion, path.resolve(distdir, 'pac')),
async () => nugetInstall('CAP_ISVExp_Tools_Stable', 'Microsoft.PowerApps.CLI.Core.linux-x64', cliVersion, path.resolve(distdir, 'pac')),
async () => nugetInstall('CAP_ISVExp_Tools_Daily', 'Microsoft.PowerApps.CLI',cliVersion, path.resolve(distdir, 'pac')),
async () => nugetInstall('CAP_ISVExp_Tools_Daily', 'Microsoft.PowerApps.CLI.Core.osx-x64', cliVersion, path.resolve(distdir, 'pac')),
async () => nugetInstall('CAP_ISVExp_Tools_Daily', 'Microsoft.PowerApps.CLI.Core.linux-x64', cliVersion, path.resolve(distdir, 'pac')),
translationsExport,
translationsImport,
translationsGenerate,

Просмотреть файл

@ -36,9 +36,9 @@
</trans-unit>
<trans-unit id="pacCLI.authPanel.welcome.whenInteractiveSupported">
<source xml:lang="en">No auth profiles found on this computer.
[Add Dataverse Auth Profile](command:pacCLI.authPanel.newDataverseAuthProfile)</source>
[Add Auth Profile](command:pacCLI.authPanel.newAuthProfile)</source>
<note>This is a Markdown formatted string, and the formatting must persist across translations.
The second line should be '[TRANSLATION HERE](command:pacCLI.authPanel.newDataverseAuthProfile)', keeping brackets and the text in the parentheses unmodified</note>
The second line should be '[TRANSLATION HERE](command:pacCLI.authPanel.newAuthProfile)', keeping brackets and the text in the parentheses unmodified</note>
</trans-unit>
<trans-unit id="pacCLI.authPanel.welcome.whenInteractiveNotSupported">
<source xml:lang="en">No auth profiles found on this computer.
@ -55,7 +55,7 @@ The third line should be '[TRANSLATION HERE](command:pacCLI.pacAuthHelp)', keepi
<source xml:lang="en">Refresh</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.newDataverseAuthProfile.title">
<source xml:lang="en">New Dataverse Auth Profile</source>
<source xml:lang="en">New Auth Profile</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.selectAuthProfile.title">
<source xml:lang="en">Select Auth Profile</source>
@ -126,12 +126,6 @@ The third line should be '[TRANSLATION HERE](command:pacCLI.pacAuthHelp)', keepi
<trans-unit id="pacCLI.authPanel.clearAuthProfile.cancel">
<source xml:lang="en">Cancel</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.newDataverseAuthProfile.title">
<source xml:lang="en">Create new Dataverse Auth Profile</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.newDataverseAuthProfile.prompt">
<source xml:lang="en">Enter Environment URL</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.deleteAuthProfile.confirm">
<source xml:lang="en">Confirm</source>
</trans-unit>

Просмотреть файл

@ -133,7 +133,7 @@
"icon": "$(refresh)"
},
{
"command": "pacCLI.authPanel.newDataverseAuthProfile",
"command": "pacCLI.authPanel.newAuthProfile",
"category": "Power Platform CLI",
"title": "%pacCLI.authPanel.newDataverseAuthProfile.title%",
"icon": "$(add)"
@ -244,7 +244,7 @@
"when": "never"
},
{
"command": "pacCLI.authPanel.newDataverseAuthProfile",
"command": "pacCLI.authPanel.newAuthProfile",
"when": "pacCLI.authPanel.interactiveLoginSupported"
},
{
@ -302,7 +302,7 @@
],
"view/title": [
{
"command": "pacCLI.authPanel.newDataverseAuthProfile",
"command": "pacCLI.authPanel.newAuthProfile",
"when": "view == pacCLI.authPanel && pacCLI.authPanel.interactiveLoginSupported",
"group": "navigation@0"
},

Просмотреть файл

@ -13,10 +13,10 @@
"pacCLI.authPanel.title": "Auth Profiles",
"pacCLI.authPanel.welcome.whenInteractiveSupported": {
"message": "No auth profiles found on this computer.\n[Add Dataverse Auth Profile](command:pacCLI.authPanel.newDataverseAuthProfile)",
"message": "No auth profiles found on this computer.\n[Add Auth Profile](command:pacCLI.authPanel.newAuthProfile)",
"comment": [
"This is a Markdown formatted string, and the formatting must persist across translations.",
"The second line should be '[TRANSLATION HERE](command:pacCLI.authPanel.newDataverseAuthProfile)', keeping brackets and the text in the parentheses unmodified"
"The second line should be '[TRANSLATION HERE](command:pacCLI.authPanel.newAuthProfile)', keeping brackets and the text in the parentheses unmodified"
]
},
"pacCLI.authPanel.welcome.whenInteractiveNotSupported": {
@ -25,12 +25,12 @@
"This is a Markdown formatted string, and the formatting must persist across translations.",
"The second line should not translate the argument `--deviceCode`",
"The third line should be '[TRANSLATION HERE](command:pacCLI.pacAuthHelp)', keeping brackets and the text in the parentheses unmodified"
]
},
"pacCLI.authPanel.clearAuthProfile.title": "Clear Auth Profiles",
"pacCLI.authPanel.refresh.title": "Refresh",
"pacCLI.authPanel.newDataverseAuthProfile.title": "New Dataverse Auth Profile",
"pacCLI.authPanel.newDataverseAuthProfile.title": "New Auth Profile",
"pacCLI.authPanel.selectAuthProfile.title": "Select Auth Profile",
"pacCLI.authPanel.deleteAuthProfile.title": "Delete Auth Profile",
"pacCLI.authPanel.nameAuthProfile.title": "Name/Rename Auth Profile",

Просмотреть файл

@ -32,17 +32,10 @@ export function RegisterPanels(pacWrapper: PacWrapper): vscode.Disposable[] {
envAndSolutionPanel.refresh();
}
}),
vscode.commands.registerCommand("pacCLI.authPanel.newDataverseAuthProfile", async () => {
const environmentUrl = await vscode.window.showInputBox({
title: localize("pacCLI.authPanel.newDataverseAuthProfile.title", "Create new Dataverse Auth Profile"),
prompt: localize("pacCLI.authPanel.newDataverseAuthProfile.prompt", "Enter Environment URL"),
placeHolder: "https://example.crm.dynamics.com/"
});
if (environmentUrl) {
await pacWrapper.authCreateNewDataverseProfile(environmentUrl);
authPanel.refresh();
envAndSolutionPanel.refresh();
}
vscode.commands.registerCommand("pacCLI.authPanel.newAuthProfile", async () => {
await pacWrapper.authCreateNewAuthProfile();
authPanel.refresh();
envAndSolutionPanel.refresh();
}),
vscode.commands.registerCommand("pacCLI.authPanel.selectAuthProfile", async (item: AuthProfileTreeItem) => {
await pacWrapper.authSelectByIndex(item.model.Index);

Просмотреть файл

@ -56,7 +56,7 @@ export class AuthProfileTreeItem extends vscode.TreeItem {
private static createLabel(profile: AuthProfileListing): string {
if (profile.Name) {
return `${profile.Kind}: ${profile.Name}`;
} else if (profile.Kind === "ADMIN") {
} else if (profile.Kind === "ADMIN" || profile.Kind === "UNIVERSAL") {
return `${profile.Kind}: ${profile.User}`;
} else {
return `${profile.Kind}: ${profile.Resource}`;

Просмотреть файл

@ -112,13 +112,9 @@ export class PacWrapper {
return this.executeCommandAndParseResults<PacAuthListOutput>(new PacArguments("auth", "list"));
}
public async authCreateNewDataverseProfile(environmentUrl: string): Promise<PacAuthListOutput> {
public async authCreateNewAuthProfile(): Promise<PacAuthListOutput> {
return this.executeCommandAndParseResults<PacAuthListOutput>(
new PacArguments("auth", "create", "--kind", "DATAVERSE", "--url", environmentUrl));
}
public async authCreateNewAdminProfile(): Promise<PacAuthListOutput> {
return this.executeCommandAndParseResults<PacAuthListOutput>(new PacArguments("auth", "create", "--kind", "ADMIN"));
new PacArguments("auth", "create"));
}
public async authSelectByIndex(index: number): Promise<PacOutput>{