-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PowerPages][Desktop]Fetch and Add Current Environment to Action Hub Tree #1098
base: main
Are you sure you want to change the base?
Conversation
…environment info retrieval in Actions Hub
|
||
import { AuthInfo } from "./power-pages/actions-hub/Constants"; | ||
|
||
class AuthManager { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we rename this to PacAuthManager
since it only manager pac auth?
import { expect } from "chai"; | ||
import * as sinon from "sinon"; | ||
import * as vscode from "vscode"; | ||
import { ActionsHubTreeDataProvider } from "../../../../power-pages/actions-hub/ActionsHubTreeDataProvider"; | ||
import { oneDSLoggerWrapper } from "../../../../../common/OneDSLoggerTelemetry/oneDSLoggerWrapper"; | ||
import { Constants } from "../../../../power-pages/actions-hub/Constants"; | ||
import { EnvironmentGroupTreeItem } from "../../../../power-pages/actions-hub/tree-items/EnvironmentGroupTreeItem"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: formatting
export interface AuthInfo { | ||
userType: string; | ||
cloud: string; | ||
tenantId: string; | ||
tenantCountry: string; | ||
user: string; | ||
entraIdObjectId: string; | ||
puid: string; | ||
userCountryRegion: string; | ||
tokenExpires: string; | ||
authority: string; | ||
environmentGeo: string; | ||
environmentId: string; | ||
environmentType: string; | ||
organizationId: string; | ||
organizationUniqueName: string; | ||
organizationFriendlyName: string; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to move this next to AuthManager.ts
since it's applicable at Power Platform level. What do you think?
oneDSLoggerWrapper.getLogger().traceInfo(Constants.EventNames.ACTIONS_HUB_INITIALIZED); | ||
|
||
return actionsHubTreeDataProvider; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for changing the return type here?
@@ -9,6 +9,7 @@ import { IEnvironmentInfo } from "../models/IEnvironmentInfo"; | |||
import { Constants } from "../Constants"; | |||
|
|||
export class EnvironmentGroupTreeItem extends ActionsHubTreeItem { | |||
environmentInfo: any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for this change?
This pull request introduces several changes to the
ActionsHubTreeDataProvider
class, localization files, and related tests. The most significant updates include adding support for thePacTerminal
in theActionsHubTreeDataProvider
, updating localization strings, and enhancing error handling and logging.Key Changes:
Enhancements to
ActionsHubTreeDataProvider
:initializeActionsHub
andActionsHubTreeDataProvider
to includePacTerminal
as a parameter, enabling the retrieval of environment information. (src/client/extension.ts
,src/client/power-pages/actions-hub/ActionsHubTreeDataProvider.ts
) [1] [2] [3]getChildren
method to fetch and display environment information, with improved error handling and logging. (src/client/power-pages/actions-hub/ActionsHubTreeDataProvider.ts
)Localization Updates:
bundle.l10n.json
andvscode-powerplatform.xlf
. (l10n/bundle.l10n.json
,loc/translations-export/vscode-powerplatform.xlf
) [1] [2]Constants.ts
to includeNO_ENVIRONMENTS_FOUND
andACTIONS_HUB_CURRENT_ENV_FETCH_FAILED
for better localization and logging. (src/client/power-pages/actions-hub/Constants.ts
)Testing Improvements:
ActionsHubTreeDataProvider
to verify initialization, tree item retrieval, error handling, and disposal of disposables. (src/client/test/Integration/power-pages/actions-hub/ActionsHubTreeDataProvider.test.ts
)Telemetry Constants:
OrganizationFriendlyNameKey
to the telemetry constants for better identification of organization-friendly names. (src/common/OneDSLoggerTelemetry/telemetryConstants.ts
)