Skip to content

Commit d487f32

Browse files
authored
Simplify URL params for launching VS Code Web (#1490)
* Refactor schema and URL handling in tests - 🔧 Updated test cases in `schemaHelperUtil.test.ts` to use `ORG_ID` instead of schema version. - 🔄 Modified `urlBuilderUtil.test.ts` to correct the mapping of fetch query parameters. - 🧹 Cleaned up `webExtensionTelemetry.test.ts` by removing unused query parameters. - 🚀 Removed the `isMultifileEnabled` function from `commonUtil.ts`. - 🔄 Refactored `folderHelperUtility.ts` to use `orgUrl` directly from `WebExtensionContext`. - 🔄 Adjusted `schemaHelperUtil.ts` to simplify fetch query retrieval logic. - 🔄 Updated `urlBuilderUtil.ts` to use `websiteId` directly from `WebExtensionContext`. - 🔄 Changed `NPSWebView.ts` to retrieve `tenantId` directly from `WebExtensionContext`. -Priyanshu * Refactor remoteFetchProvider tests for clarity - 🔧 Updated comments for clarity on function calls - 🐛 Changed fetchDataFromDataverseAndUpdateVFS to include entity parameters - 🔄 Replaced fetch stubs with concurrencyHandler stubs for consistency - ✨ Initialized WebExtensionContext properties in tests -Priyanshu * Add WEBSITE_ID parameter and update related logic - ✨ Introduced WEBSITE_ID to queryParameters enum. - 🔄 Updated errorHandler to check for WEBSITE_ID instead of PORTAL_ID. - 🧪 Added tests to validate behavior when WEBSITE_ID is present or missing. -Priyanshu * Add message for multiple websites selection - ✨ Added a new message for when multiple websites are found, prompting the user to select one. -Priyanshu
1 parent 3f20d10 commit d487f32

27 files changed

Lines changed: 809 additions & 882 deletions

l10n/bundle.l10n.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
"Edit the site": "Edit the site",
66
"Be careful making changes. Anyone can see the changes you make immediately. Choose Edit the site to make edits, or close the editor tab to cancel without editing.": "Be careful making changes. Anyone can see the changes you make immediately. Choose Edit the site to make edits, or close the editor tab to cancel without editing.",
77
"You are editing a live, public site ": "You are editing a live, public site ",
8+
"Fetching environment information ...": "Fetching environment information ...",
9+
"Unable to fetch environment information": "Unable to fetch environment information",
10+
"Fetching website details ...": "Fetching website details ...",
11+
"Unable to fetch website details": "Unable to fetch website details",
12+
"Multiple websites found. Please select one.": "Multiple websites found. Please select one.",
813
"Microsoft wants your feedback": "Microsoft wants your feedback",
914
"Preview site": "Preview site",
1015
"Open in Power Pages studio": "Open in Power Pages studio",
@@ -20,7 +25,6 @@
2025
"Update Extension": "Update Extension",
2126
"Failed to generate VS Code Desktop URL: {0}": "Failed to generate VS Code Desktop URL: {0}",
2227
"Failed to open in VS Code Desktop: {0}": "Failed to open in VS Code Desktop: {0}",
23-
"Check the URL and verify the parameters are correct": "Check the URL and verify the parameters are correct",
2428
"Unable to complete the request": "Unable to complete the request",
2529
"One or more attribute names have been changed or removed. Contact your admin.": "One or more attribute names have been changed or removed. Contact your admin.",
2630
"Authorization Failed. Please run again to authorize it": "Authorization Failed. Please run again to authorize it",
@@ -32,6 +36,7 @@
3236
"Failed to fetch some files.": "Failed to fetch some files.",
3337
"Failed to get file ready for edit: {0}": "Failed to get file ready for edit: {0}",
3438
"Saving your file ...": "Saving your file ...",
39+
"Check the URL and verify the parameters are correct": "Check the URL and verify the parameters are correct",
3540
"Debug Power Pages Server Logic": "Debug Power Pages Server Logic",
3641
"Debug Current Server Logic": "Debug Current Server Logic",
3742
"Run Server Logic": "Run Server Logic",

loc/translations-export/vscode-powerplatform.xlf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,12 @@ The {3} represents Solution's Type (Managed or Unmanaged), but that test is loca
599599
<trans-unit id="++CODE++aac77df347205252b074d45aff7891debdba0ff1466cc0c351416d1662bb71ab">
600600
<source xml:lang="en">Feedback</source>
601601
</trans-unit>
602+
<trans-unit id="++CODE++6625a35e6dacf5200897a3c37d9d601d529b759031fa6c2684a9e7491afaf82c">
603+
<source xml:lang="en">Fetching environment information ...</source>
604+
</trans-unit>
605+
<trans-unit id="++CODE++558c0e8512ccb47e170851ab1dc541283c7e53179581db1e69ece6c9b5fb8719">
606+
<source xml:lang="en">Fetching website details ...</source>
607+
</trans-unit>
602608
<trans-unit id="++CODE++1b600fc82f2c98dc384adb9fa255ff5914978d978928c8aa5e56bf5fc64980b2">
603609
<source xml:lang="en">Fetching websites from '{0}'...</source>
604610
<note>Message shown while fetching websites from an environment. {0} is the environment name.</note>
@@ -796,6 +802,9 @@ Return to this chat and @powerpages can help you write and edit your website cod
796802
<trans-unit id="++CODE++e8ce5dcaf408935ff76747226d2e8bee4319a2f593c1d7a838115e56183d1f37">
797803
<source xml:lang="en">Modified</source>
798804
</trans-unit>
805+
<trans-unit id="++CODE++0516c7a52473008fcb8090b8654caa0f680697bf92bb7b41dc4eb2eb1516fe29">
806+
<source xml:lang="en">Multiple websites found. Please select one.</source>
807+
</trans-unit>
799808
<trans-unit id="++CODE++a253ff09c5a8678e1fd1962b2c329245e139e45f9cc6ced4e5d7ad42c4108fc0">
800809
<source xml:lang="en">NEW</source>
801810
</trans-unit>
@@ -1297,6 +1306,12 @@ The {3} represents Dataverse Environment's Organization ID (GUID)</note>
12971306
<trans-unit id="++CODE++bd7b156375b48ce5797a3421150e6f5c3b71d3a30f823e957241589aea6236ca">
12981307
<source xml:lang="en">Unable to complete the request</source>
12991308
</trans-unit>
1309+
<trans-unit id="++CODE++825428f802dce30a8443dd17ada4d08aff818700cba857285da17a926c96c8b9">
1310+
<source xml:lang="en">Unable to fetch environment information</source>
1311+
</trans-unit>
1312+
<trans-unit id="++CODE++9083a7e873ce09c78f134fb812ce04c4fcb02ace2682c620211eca599cfa78c3">
1313+
<source xml:lang="en">Unable to fetch website details</source>
1314+
</trans-unit>
13001315
<trans-unit id="++CODE++bab36b47fe2dd4f2f7e8eb486f2e3546e27dc047e69f5b24307bc71e5be2a7cf">
13011316
<source xml:lang="en">Unable to find that app</source>
13021317
</trans-unit>

src/common/OneDSLoggerTelemetry/web/client/webExtensionTelemetryEvents.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,13 @@ export enum webExtensionTelemetryEventNames {
7171
WEB_EXTENSION_FETCH_DATAVERSE_AND_CREATE_FILES_SYSTEM_ERROR = 'webExtensionFetchDataverseCreateFilesSystemError',
7272
WEB_EXTENSION_SAVE_DATA_TO_DATAVERSE_API_ERROR = 'webExtensionSaveDataToDataverseAPIError',
7373
WEB_EXTENSION_GET_SAVE_PARAMETERS_ERROR = 'webExtensionGetSaveParametersError',
74-
WEB_EXTENSION_MULTI_FILE_FEATURE_FLAG_ENABLED = "WebExtensionMultiFileFeatureFlagEnabled",
75-
WEB_EXTENSION_MULTI_FILE_FEATURE_FLAG_DISABLED = "WebExtensionMultiFileFeatureFlagDisabled",
76-
WEB_EXTENSION_MULTI_FILE_MANDATORY_PARAMETERS_MISSING = "WebExtensionMultiFileMandatoryParametersMissing",
7774
WEB_EXTENSION_WEBSITE_PREVIEW_URL_VALIDATION_SITE_DETAILS_FETCH_FAILED = "WebExtensionWebsitePreviewUrlValidationSiteDetailsFetchFailed",
7875
WEB_EXTENSION_WEBSITE_PREVIEW_URL_VALIDATION_INSUFFICIENT_PARAMETERS = "WebExtensionWebsitePreviewUrlValidationInsufficientParameters",
7976
WEB_EXTENSION_MULTI_FILE_INVALID_DATAVERSE_URL = "WebExtensionMultiFileInvalidDataverseUrl",
80-
WEB_EXTENSION_MULTI_FILE_INVALID_WEBSITE_PREVIEW_URL = "WebExtensionMultiFileInvalidWebsitePreviewUrl",
8177
WEB_EXTENSION_CO_PRESENCE_FEATURE_FLAG_DISABLED = "WebExtensionCoPresenceFeatureFlagDisabled",
8278
WEB_EXTENSION_CO_PRESENCE_FEATURE_FLAG_ENABLED = "WebExtensionCoPresenceFeatureFlagEnabled",
8379
WEB_EXTENSION_FILES_LOAD_SUCCESS = "WebExtensionFilesLoadSuccess",
8480
WEB_EXTENSION_PREPARE_WORKSPACE_SUCCESS = "webExtensionPrepareWorkspaceSuccess",
85-
WEB_EXTENSION_MULTI_FILE_FEATURE_AVAILABILITY = "WebExtensionMultiFileFeatureAvailability",
8681
WEB_EXTENSION_APP_NAME_NOT_FOUND = "WebExtensionAppNameNotFound",
8782
WEB_EXTENSION_SET_VSCODE_WORKSPACE_STATE_FAILED = "WebExtensionSetVscodeWorkspaceStateFailed",
8883
WEB_EXTENSION_SET_VSCODE_WORKSPACE_STATE_SUCCESS = "WebExtensionGetVscodeWorkspaceStateSuccess",

src/common/ecs-features/ecsFeatureGates.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@
66
import { COPILOT_GOVERNANCE_SETTING_NAME, PowerPagesClientName } from './constants';
77
import { getFeatureConfigs } from './ecsFeatureUtil';
88

9-
export const {
10-
feature: EnableMultifileVscodeWeb
11-
} = getFeatureConfigs({
12-
teamName: PowerPagesClientName,
13-
description: 'Enable multiple file view in Visual Studio Code Web',
14-
fallback: {
15-
enableMultifileVscodeWeb: false,
16-
},
17-
});
18-
199
export const {
2010
feature: CopilotDisableList
2111
} = getFeatureConfigs({

src/common/services/BAPService.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class BAPService {
1515
try {
1616
const accessToken = await bapServiceAuthentication(true);
1717

18-
const response = await fetch(await BAPService.getBAPCopilotCrossGeoFlagEndpoint(serviceEndpointStamp, environmentId), {
18+
const response = await fetch(BAPService.getBAPCopilotCrossGeoFlagEndpoint(serviceEndpointStamp, environmentId), {
1919
method: 'GET',
2020
headers: getCommonHeaders(accessToken)
2121
});
@@ -33,13 +33,12 @@ export class BAPService {
3333
return false;
3434
}
3535

36-
static async getBAPCopilotCrossGeoFlagEndpoint(serviceEndpointStamp: ServiceEndpointCategory, environmentId: string): Promise<string> {
36+
static getBAPCopilotCrossGeoFlagEndpoint(serviceEndpointStamp: ServiceEndpointCategory, environmentId: string): string {
3737

38-
const bapEndpoint = await getBAPEndpoint(serviceEndpointStamp);
38+
const bapEndpoint = getBAPEndpoint(serviceEndpointStamp);
3939

4040
return BAP_SERVICE_ENDPOINT.replace('{rootURL}', bapEndpoint) +
4141
BAP_SERVICE_COPILOT_CROSS_GEO_FLAG_RELATIVE_URL.replace('{environmentID}', environmentId).replace('{apiVersion}', BAP_API_VERSION);
4242
}
4343

4444
}
45-

0 commit comments

Comments
 (0)