diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..af60289d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,169 @@ +# Change Log - Power Platform Extension + +## NEXTRELEASE + - pac CLI 1.30.3, (January 2024 refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + - Moved release notes to *CHANGELOG.md* file, per VS Code's [Marketplace integration](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#marketplace-integration) guidelines. + +## 2.0.25 + - pac CLI 1.29.11, (Update to October refresh to fix data import/export and paportal upload/download commands. See release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + +## 2.0.21 + - pac CLI 1.29.6 (October refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + +## 2.0.13 + - pac CLI 1.28.3 (September refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + - Web Extension updates: + - Now Supporting image edit capability using Vscode extensions for Image editing (supported file extensions are png, jpg, webp, bmp, tga, ico, dib, jif, jpe, tpic, jpe, jpeg) #733 + - File explorer now supports Power Pages actions for "Going back to Power pages Studio" and "Preview" of site's runtime instance. #697 + - On browser refresh, Improved support for pre-emptive loading of image files active in editor. #736 + +## 2.0.11 + - pac CLI 1.27.5 (August refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + - (Preview) Added 'Copilot in Power Pages' to Web Extension + +## 2.0.7 + - QFE for styling files load for new data model schema + +## 2.0.6 + - QFE for styles rendering of power pages sites + +## 2.0.4 + - pac CLI 1.26.6 (QFE for `pac paportal bootstrap-migrate`) + +## 2.0.3 + - pac CLI 1.26.5 (July refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + - Authentication Settings - Can now choose other Azure clouds for the "New Auth Profile" button to target [#619](https://github.com/microsoft/powerplatform-vscode/pull/619) + - Environments & Solutions panel improvements: + - Environments now display an icon for the active environment, and button added to select a different environment [#629](https://github.com/microsoft/powerplatform-vscode/pull/629) + - Solutions now have tooltip and icon to indicated managed vs. unmanaged solutions [#618](https://github.com/microsoft/powerplatform-vscode/pull/618) + - (Preview) Added AI code generation assistance with Power Pages Copilot + - Only supports vscode on the desktop currently, not available in the web extension + - Web Extension updates: + - Conflict resolution optimization for incoming changes accept scenario [#664](https://github.com/microsoft/powerplatform-vscode/pull/664) + - Optimized load of webfiles for old data model - media files are now loaded only on view a specific file action [#662](https://github.com/microsoft/powerplatform-vscode/pull/662) + - Performance optimizations and better support for revisit sessions file load [#646](https://github.com/microsoft/powerplatform-vscode/pull/646) [#668](https://github.com/microsoft/powerplatform-vscode/pull/668) [#669](https://github.com/microsoft/powerplatform-vscode/pull/669) + +## 2.0.0 + - pac CLI 1.25.2 (June refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + - Power Pages site code edit support - in VScode web extension - for components like forms, content snippets, lists, and more + - Enhanced Power Pages (paportal) download to have CSS, JS and HTML files as placeholders always. + - Power Pages (paportal) commands to have better error handling for deployment profiles and unsupported web-files. + +## 1.1.28 + - pac CLI 1.24.3 (May refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + - Linux and Mac - PAC switched to the [CrossPlat Dotnet Tool version](https://www.nuget.org/packages/Microsoft.PowerApps.CLI.Tool) from the x64 architectured [Linux x64](https://www.nuget.org/packages/Microsoft.PowerApps.CLI.Core.linux-x64) and [OSx x64](https://www.nuget.org/packages/Microsoft.PowerApps.CLI.Core.osx-x64) versions + - Apple Silicon arm64 machines (M1/M2) should no longer need the x64 version of the net6.0 SDK, just the ARM version + - Windows still uses the [Windows-only net48 version](https://www.nuget.org/packages/Microsoft.PowerApps.CLI), as there are still some verbs such as `pac data` which have full .NET Framework dependencies + - Optimized conflict detection for co-edits in VS Code for web + +## 1.1.27 + - pac CLI 1.23.3 (Apr refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + - Conflict resolution support for co-edits in VS Code for web + +## 1.1.25 + - pac CLI 1.22.4 (see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + +## 1.1.24 + - hotfix to pac CLI 1.22.3 for `pac solution unpack` placing AppModule files in invalid directory + +## 1.1.23 + - pac CLI 1.22.2 (Mar refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + - Improved Paportal manifest generation by maintaining a consistent order + +## 1.1.19 + - pac CLI 1.21.13 (Feb refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + - Desktop extension now supports create, delete and rename for power pages site entities like webpage, webfile, templates and content-snippets + - Enhanced intellisense support - Auto-complete for Dataverse entity tags, template tags, filters, portal-specific liquid objects & their attributes + +## 1.1.16 + - pac CLI 1.21.8 (Dec refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + +## 1.1.14 + - pac CLI 1.21.4 (Nov refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + - support for new data model for Power Pages in Studio web extension + +## 1.1.9 + - pac CLI 1.20.3 (Oct refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + +## 1.1.4 + - pac CLI 1.19.3 (Sept refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + - fixes to Power Pages editing when hosted in vscode.dev (running as web extension) + +## 1.1.2 + - pac CLI 1.18.3 (Aug refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + - added support for Power Pages editing when hosted in vscode.dev (running as web extension, no pac CLI supported) + +## 1.0.21 + - hotfix in pac CLI `pac paportal *` for #255 + +## 1.0.20 + - PCF control debugging support in VS Code's debugger; + see for early details: https://github.com/microsoft/powerplatform-vscode/pull/231 + - pac CLI 1.17.4 (July refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + - when running on macOS on Apple Silicon (ARM M1/M2 CPU): make sure to also have the x64 version of the [.NET6 SDK](https://dotnet.microsoft.com/en-us/download) installed as well + +## 1.0.16 + - pac CLI 1.16.6 (May refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + - the Power Platform panel now supports the new UNIVERSAL authentication kind that pac CLI 1.16.x introduced + +## 1.0.9 + - pac CLI 1.15.3 (April refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + +## 1.0.5 + - pac CLI 1.14.4 (March refresh QFE: pac admin backup: --notes parameter deprecated) + +## 1.0.4 + - pac CLI 1.14.1 (March refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + +## 1.0.2 + - pac CLI 1.13.6 (February refresh plus 2 fixes, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + +## 1.0.1 + - Extension is now released with General Availability + - New Activity Pane for this extension that lets user managed PowerPlatform credentials and shows visible PP environments + - pac CLI 1.13.4 (February refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + +## 0.2.35 + - pac CLI 1.12.2 (Dec/Jan refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + +## 0.2.32 + - pac CLI 1.11.8 (Fixes a regression in `pac solution check`) + +## 0.2.31 + - pac CLI 1.11.6 (Dec/Jan refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + - fixed installation issue for Windows 11 Insider builds due to deprecation of WMIC + +## 0.2.27 + - pac CLI 1.10.4 (November refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + - .NET 6 on Apple M1: pac CLI is targeting dotnetCore 5 for intel, but the .NET6 amd64 installer removes the net5 and x64 support. Users who have installed .NET 6 will need to uninstall all existing .NET bits and then install **both** the amd64 (Apple M1) and the x64 .NET 6 SDKs side by side. + - Documentation on this .NET issue can be found at [.NET Support for macOS 11 and Windows 11 for Arm64 and x64](https://github.com/dotnet/sdk/issues/22380) + - Users who only have .NET 5.0 installed do not need to take any action. + +## 0.2.23 + - pac CLI 1.9.8 (August refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + - added pac CLI Linux support in terminal: on Windows 10, remote connect to WSL terminal () + +## 0.2.19 + - shortened the extension's friendly name + - pac CLI 1.9.4 (July refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) + - macOS: 'pac auth create' interactive login now works + +## 0.2.14 + - pac CLI 1.8.6 (pcf-scripts npm pkg hot fix for June refresh) + +## 0.2.13 + - pac CLI 1.8.5 (June refresh) + - added more Power Platform CLI command palette entries + - PA Portal editing support: + - Enhanced grammar to support include and editable tags + - Support multiple portal root folders for multi-rooted VSCode workspaces + +## 0.2.9 + - pac CLI 1.7.x, same as installed/updated via MSI/nuget.org + +## 0.2.8 +- initial public preview: + - pac CLI installed and runnable in VSCode terminal (cmd, PS, pwsh, git bash, any macOS shell like zsh, fish) + - PA Portal language services and auto complete +- known issues: + - macOS: no good check if the required separate install of dotnetCore 3.x or 5.x is present diff --git a/README.md b/README.md index 987b6a4d..f2812f4e 100644 --- a/README.md +++ b/README.md @@ -18,174 +18,6 @@ Installing this extension will also make the latest Power Platform CLI (aka pac) [Power Platform CLI Exposed](https://www.youtube.com/playlist?list=PLlrxD0HtieHhEdLHxQOU96ySSZpMCyAxf) -## Release Notes - -2.0.25: - - pac CLI 1.29.11, (Update to October refresh to fix data import/export and paportal upload/download commands. See release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - -2.0.21: - - pac CLI 1.29.6 (October refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - -2.0.13: - - pac CLI 1.28.3 (September refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - - Web Extension updates: - - Now Supporting image edit capability using Vscode extensions for Image editing (supported file extensions are png, jpg, webp, bmp, tga, ico, dib, jif, jpe, tpic, jpe, jpeg) #733 - - File explorer now supports Power Pages actions for "Going back to Power pages Studio" and "Preview" of site's runtime instance. #697 - - On browser refresh, Improved support for pre-emptive loading of image files active in editor. #736 - -2.0.11: - - pac CLI 1.27.5 (August refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - - (Preview) Added 'Copilot in Power Pages' to Web Extension - -2.0.7: - - QFE for styling files load for new data model schema - -2.0.6: - - QFE for styles rendering of power pages sites - -2.0.4: - - pac CLI 1.26.6 (QFE for `pac paportal bootstrap-migrate`) - -2.0.3: - - pac CLI 1.26.5 (July refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - - Authentication Settings - Can now choose other Azure clouds for the "New Auth Profile" button to target [#619](https://github.com/microsoft/powerplatform-vscode/pull/619) - - Environments & Solutions panel improvements: - - Environments now display an icon for the active environment, and button added to select a different environment [#629](https://github.com/microsoft/powerplatform-vscode/pull/629) - - Solutions now have tooltip and icon to indicated managed vs. unmanaged solutions [#618](https://github.com/microsoft/powerplatform-vscode/pull/618) - - (Preview) Added AI code generation assistance with Power Pages Copilot - - Only supports vscode on the desktop currently, not available in the web extension - - Web Extension updates: - - Conflict resolution optimization for incoming changes accept scenario [#664](https://github.com/microsoft/powerplatform-vscode/pull/664) - - Optimized load of webfiles for old data model - media files are now loaded only on view a specific file action [#662](https://github.com/microsoft/powerplatform-vscode/pull/662) - - Performance optimizations and better support for revisit sessions file load [#646](https://github.com/microsoft/powerplatform-vscode/pull/646) [#668](https://github.com/microsoft/powerplatform-vscode/pull/668) [#669](https://github.com/microsoft/powerplatform-vscode/pull/669) - -2.0.0: - - pac CLI 1.25.2 (June refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - - Power Pages site code edit support - in VScode web extension - for components like forms, content snippets, lists, and more - - Enhanced Power Pages (paportal) download to have CSS, JS and HTML files as placeholders always. - - Power Pages (paportal) commands to have better error handling for deployment profiles and unsupported web-files. - -1.1.28: - - pac CLI 1.24.3 (May refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - - Linux and Mac - PAC switched to the [CrossPlat Dotnet Tool version](https://www.nuget.org/packages/Microsoft.PowerApps.CLI.Tool) from the x64 architectured [Linux x64](https://www.nuget.org/packages/Microsoft.PowerApps.CLI.Core.linux-x64) and [OSx x64](https://www.nuget.org/packages/Microsoft.PowerApps.CLI.Core.osx-x64) versions - - Apple Silicon arm64 machines (M1/M2) should no longer need the x64 version of the net6.0 SDK, just the ARM version - - Windows still uses the [Windows-only net48 version](https://www.nuget.org/packages/Microsoft.PowerApps.CLI), as there are still some verbs such as `pac data` which have full .NET Framework dependencies - - Optimized conflict detection for co-edits in VS Code for web - -1.1.27: - - pac CLI 1.23.3 (Apr refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - - Conflict resolution support for co-edits in VS Code for web - -1.1.25: - - pac CLI 1.22.4 (see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - -1.1.24: - - hotfix to pac CLI 1.22.3 for `pac solution unpack` placing AppModule files in invalid directory - -1.1.23: - - pac CLI 1.22.2 (Mar refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - - Improved Paportal manifest generation by maintaining a consistent order - -1.1.19: - - pac CLI 1.21.13 (Feb refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - - Desktop extension now supports create, delete and rename for power pages site entities like webpage, webfile, templates and content-snippets - - Enhanced intellisense support - Auto-complete for Dataverse entity tags, template tags, filters, portal-specific liquid objects & their attributes - -1.1.16: - - pac CLI 1.21.8 (Dec refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - -1.1.14: - - pac CLI 1.21.4 (Nov refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - - support for new data model for Power Pages in Studio web extension - -1.1.9: - - pac CLI 1.20.3 (Oct refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - -1.1.4: - - pac CLI 1.19.3 (Sept refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - - fixes to Power Pages editing when hosted in vscode.dev (running as web extension) - -1.1.2: - - pac CLI 1.18.3 (Aug refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - - added support for Power Pages editing when hosted in vscode.dev (running as web extension, no pac CLI supported) - -1.0.21: - - hotfix in pac CLI `pac paportal *` for #255 - -1.0.20: - - PCF control debugging support in VS Code's debugger; - see for early details: https://github.com/microsoft/powerplatform-vscode/pull/231 - - pac CLI 1.17.4 (July refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - - when running on macOS on Apple Silicon (ARM M1/M2 CPU): make sure to also have the x64 version of the [.NET6 SDK](https://dotnet.microsoft.com/en-us/download) installed as well - -1.0.16: - - pac CLI 1.16.6 (May refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - - the Power Platform panel now supports the new UNIVERSAL authentication kind that pac CLI 1.16.x introduced - -1.0.9: - - pac CLI 1.15.3 (April refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - -1.0.5: - - pac CLI 1.14.4 (March refresh QFE: pac admin backup: --notes parameter deprecated) - -1.0.4: - - pac CLI 1.14.1 (March refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - -1.0.2: - - pac CLI 1.13.6 (February refresh plus 2 fixes, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - -1.0.1: - - Extension is now released with General Availability - - New Activity Pane for this extension that lets user managed PowerPlatform credentials and shows visible PP environments - - pac CLI 1.13.4 (February refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - -0.2.35: - - pac CLI 1.12.2 (Dec/Jan refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - -0.2.32: - - pac CLI 1.11.8 (Fixes a regression in `pac solution check`) - -0.2.31: - - pac CLI 1.11.6 (Dec/Jan refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - - fixed installation issue for Windows 11 Insider builds due to deprecation of WMIC - -0.2.27: - - pac CLI 1.10.4 (November refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - - .NET 6 on Apple M1: pac CLI is targeting dotnetCore 5 for intel, but the .NET6 amd64 installer removes the net5 and x64 support. Users who have installed .NET 6 will need to uninstall all existing .NET bits and then install **both** the amd64 (Apple M1) and the x64 .NET 6 SDKs side by side. - - Documentation on this .NET issue can be found at [.NET Support for macOS 11 and Windows 11 for Arm64 and x64](https://github.com/dotnet/sdk/issues/22380) - - Users who only have .NET 5.0 installed do not need to take any action. - -0.2.23: - - pac CLI 1.9.8 (August refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - - added pac CLI Linux support in terminal: on Windows 10, remote connect to WSL terminal () - -0.2.19: - - shortened the extension's friendly name - - pac CLI 1.9.4 (July refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/)) - - macOS: 'pac auth create' interactive login now works - -0.2.14: - - pac CLI 1.8.6 (pcf-scripts npm pkg hot fix for June refresh) - -0.2.13: - - pac CLI 1.8.5 (June refresh) - - added more Power Platform CLI command palette entries - - PA Portal editing support: - - Enhanced grammar to support include and editable tags - - Support multiple portal root folders for multi-rooted VSCode workspaces - -0.2.9: - - pac CLI 1.7.x, same as installed/updated via MSI/nuget.org - -0.2.8: - -- initial public preview: - - pac CLI installed and runnable in VSCode terminal (cmd, PS, pwsh, git bash, any macOS shell like zsh, fish) - - PA Portal language services and auto complete -- known issues: - - macOS: no good check if the required separate install of dotnetCore 3.x or 5.x is present - - ## Requirements - VSCode >= 1.73.0 diff --git a/gulpfile.mjs b/gulpfile.mjs index 11a791ee..e5a925aa 100644 --- a/gulpfile.mjs +++ b/gulpfile.mjs @@ -336,7 +336,7 @@ async function snapshot() { } const feedName = 'CAP_ISVExp_Tools_Stable'; -const cliVersion = '1.29.11'; +const cliVersion = '1.30.3'; const recompile = gulp.series( clean, diff --git a/l10n/bundle.l10n.json b/l10n/bundle.l10n.json index c99dac31..b9621b8f 100644 --- a/l10n/bundle.l10n.json +++ b/l10n/bundle.l10n.json @@ -176,8 +176,8 @@ "The {0} represents the optional name the user provided for the profile)" ] }, - "Resource: {0}/The {0} represents profile's resource/environment URL": { - "message": "Resource: {0}", + "Default Environment: {0}/The {0} represents profile's resource/environment URL": { + "message": "Default Environment: {0}", "comment": [ "The {0} represents profile's resource/environment URL" ] diff --git a/loc/translations-export/vscode-powerplatform.xlf b/loc/translations-export/vscode-powerplatform.xlf index 8d60676b..60493caa 100644 --- a/loc/translations-export/vscode-powerplatform.xlf +++ b/loc/translations-export/vscode-powerplatform.xlf @@ -69,6 +69,10 @@ Creating {0}... {0} will be replaced by the entity type. + + Default Environment: {0} + The {0} represents profile's resource/environment URL + Display Name: {0} Unique Name: {1} @@ -230,10 +234,6 @@ The {3} represents Dataverse Environment's Organization ID (GUID) Profile Kind: {0} The {0} represents the profile type (Admin vs Dataverse) - - Resource: {0} - The {0} represents profile's resource/environment URL - Response data is empty diff --git a/src/client/lib/AuthPanelView.ts b/src/client/lib/AuthPanelView.ts index ca279d70..c3b0e684 100644 --- a/src/client/lib/AuthPanelView.ts +++ b/src/client/lib/AuthPanelView.ts @@ -104,7 +104,7 @@ export class AuthTreeView implements vscode.TreeDataProvider { - vscode.env.openExternal(vscode.Uri.parse(item.model.Resource)); + if (item.model.ActiveOrganization) { + vscode.env.openExternal(vscode.Uri.parse(item.model.ActiveOrganization.EnvironmentUrl)); + } }), vscode.commands.registerCommand('pacCLI.authPanel.copyUser', (item: AuthProfileTreeItem) => { vscode.env.clipboard.writeText(item.model.User); @@ -149,7 +151,7 @@ class AuthProfileTreeItem extends vscode.TreeItem { } else if (profile.Kind === "ADMIN" || profile.Kind === "UNIVERSAL") { return `${profile.Kind}: ${profile.User}`; } else { - return `${profile.Kind}: ${profile.Resource}`; + return `${profile.Kind}: ${profile.ActiveOrganization?.EnvironmentUrl ?? profile.User}`; } } private static createTooltip(profile: AuthProfileListing): string { @@ -165,10 +167,10 @@ class AuthProfileTreeItem extends vscode.TreeItem { args: [profile.Name], comment: ["The {0} represents the optional name the user provided for the profile)"]})); } - if ((profile.Kind === "DATAVERSE" || profile.Kind === "UNIVERSAL") && profile.Resource) { + if ((profile.Kind === "DATAVERSE" || profile.Kind === "UNIVERSAL") && profile.ActiveOrganization) { tooltip.push(vscode.l10n.t({ - message: "Resource: {0}", - args: [profile.Resource], + message: "Default Environment: {0}", + args: [profile.ActiveOrganization.EnvironmentUrl], comment: ["The {0} represents profile's resource/environment URL"]})); } tooltip.push(vscode.l10n.t({ diff --git a/src/client/pac/PacTypes.ts b/src/client/pac/PacTypes.ts index f0a6a098..bd62c5d2 100644 --- a/src/client/pac/PacTypes.ts +++ b/src/client/pac/PacTypes.ts @@ -9,23 +9,28 @@ export type PacOutput = { Information: string[]; } +export type PacOutputWithResult = PacOutput & { + Results: TResults +} + +export type PacOutputWithResultList = PacOutput & { + Results: TListItem[] +} + export type AuthProfileListing = { Index: number; IsActive: boolean; Kind: string; Name: string; - Resource: string; User: string; CloudInstance: string; + ActiveOrganization?: { + FriendlyName: string; + EnvironmentUrl: string; + }; } -export type PacOutputWithResultList = PacOutput & { - Results: T[] -} - -export type PacAuthListOutput = PacOutput & { - Results: AuthProfileListing[]; -} +export type PacAuthListOutput = PacOutputWithResultList; export type AdminEnvironmentListing = { DisplayName: string; @@ -35,9 +40,7 @@ export type AdminEnvironmentListing = { OrganizationId: string; } -export type PacAdminListOutput = PacOutput & { - Results: AdminEnvironmentListing[]; -} +export type PacAdminListOutput = PacOutputWithResultList; export type SolutionListing = { SolutionUniqueName: string; @@ -46,9 +49,7 @@ export type SolutionListing = { IsManaged: boolean; } -export type PacSolutionListOutput = PacOutput & { - Results: SolutionListing[]; -} +export type PacSolutionListOutput = PacOutputWithResultList; export type OrgListOutput = { FriendlyName: string, @@ -58,13 +59,7 @@ export type OrgListOutput = { IsActive: boolean } -export type PacOrgListOutput = PacOutput & { - Results: OrgListOutput[]; -} - -export type PacActiveOrgListOutput = PacOutput & { - Results: ActiveOrgOutput; -} +export type PacOrgListOutput = PacOutputWithResultList; export type ActiveOrgOutput = { OrgId: string, @@ -75,3 +70,5 @@ export type ActiveOrgOutput = { UserId : string, EnvironmentId: string, } + +export type PacOrgWhoOutput = PacOutputWithResult; diff --git a/src/client/pac/PacWrapper.ts b/src/client/pac/PacWrapper.ts index c318b5d3..51ebe036 100644 --- a/src/client/pac/PacWrapper.ts +++ b/src/client/pac/PacWrapper.ts @@ -10,7 +10,7 @@ import * as fs from "fs-extra"; import { ChildProcessWithoutNullStreams, spawn } from "child_process"; import { BlockingQueue } from "../../common/utilities/BlockingQueue"; import { ITelemetry } from "../telemetry/ITelemetry"; -import { PacOutput, PacAdminListOutput, PacAuthListOutput, PacSolutionListOutput, PacOrgListOutput, PacActiveOrgListOutput } from "./PacTypes"; +import { PacOutput, PacAdminListOutput, PacAuthListOutput, PacSolutionListOutput, PacOrgListOutput, PacOrgWhoOutput } from "./PacTypes"; import { v4 } from "uuid"; export interface IPacWrapperContext { @@ -161,8 +161,8 @@ export class PacWrapper { return this.executeCommandAndParseResults(new PacArguments("org", "list")); } - public async activeOrg(): Promise { - return this.executeCommandAndParseResults(new PacArguments("org", "who")); + public async activeOrg(): Promise { + return this.executeCommandAndParseResults(new PacArguments("org", "who")); } public async pcfInit(outputDirectory : string): Promise { diff --git a/src/client/test/unit/PacWrapper.test.ts b/src/client/test/unit/PacWrapper.test.ts index 72d0a4ca..44dd864e 100644 --- a/src/client/test/unit/PacWrapper.test.ts +++ b/src/client/test/unit/PacWrapper.test.ts @@ -33,7 +33,18 @@ class MockPacInterop implements IPacInterop { describe('PacWrapper', () => { it('AuthList parses correctly', async () => { const interop = new MockPacInterop(); - interop.executeReturnValue = "{\"Status\":\"Success\",\"Errors\":[],\"Information\":[\"Input commands: [\\\"auth\\\",\\\"list\\\"]\",\"Profiles (* indicates active):\"],\"Results\":[{\"Index\":1,\"IsActive\":true,\"Kind\":\"CDS\",\"Name\":\"cctest\",\"Resource\":\"https://contoso.example.com\",\"User\":\"bob@contoso.com\",\"CloudInstance\":\"Public\"}]}"; + interop.executeReturnValue = "{\"Status\":\"Success\",\"Errors\":[],\"Information\":[\"Input commands: [\\\"auth\\\",\\\"list\\\"]\",\"Profiles (* indicates active):\"]," + + "\"Results\":[" + + "{" + + "\"Index\":1," + + "\"IsActive\":true," + + "\"Kind\":\"CDS\"," + + "\"Name\":\"cctest\"," + + "\"ActiveOrganization\":{\"EnvironmentUrl\":\"https://contoso-mock.crmtest.dynamics.com\",\"FriendlyName\":\"\"}," + + "\"User\":\"bob@contoso.com\"," + + "\"CloudInstance\":\"Public\"" + + "}" + + "]}"; const wrapper = new PacWrapper(new MockContext, interop); const result = await wrapper.authList(); @@ -41,5 +52,6 @@ describe('PacWrapper', () => { expect(result.Errors.length === 0); expect(result.Information.length > 0); expect(result.Results && result.Results.length === 1 && result.Results[0].User === "bob@contoso.com").to.be.true; + expect(result.Results[0].ActiveOrganization?.EnvironmentUrl === "https://contoso-mock.crmtest.dynamics.com").to.be.true; }); });