show copyjob screen from portal navigation

This commit is contained in:
Bikram Choudhury
2025-10-29 18:36:13 +05:30
parent 58e187aeb2
commit 844b6e6b65
3 changed files with 21 additions and 8 deletions
+1
View File
@@ -444,6 +444,7 @@ export interface DataExplorerInputsFrame {
}; };
feedbackPolicies?: any; feedbackPolicies?: any;
aadToken?: string; aadToken?: string;
containerCopyEnabled?: boolean;
} }
export interface SelfServeFrameInputs { export interface SelfServeFrameInputs {
+13 -2
View File
@@ -1,10 +1,21 @@
import { DatabaseAccount } from "Contracts/DataModels"; import { DatabaseAccount } from "Contracts/DataModels";
import { CopyJobErrorType } from "./Types"; import { CopyJobErrorType } from "./Types";
const azurePortalMpacEndpoint = "https://ms.portal.azure.com/";
export const buildResourceLink = (resource: DatabaseAccount): string => { export const buildResourceLink = (resource: DatabaseAccount): string => {
const resourceId = resource.id; const resourceId = resource.id;
// TODO: update "ms.portal.azure.com" based on environment (e.g. for PROD or Fairfax) let parentOrigin = window.location.ancestorOrigins?.[0] ?? window.location.origin;
return `https://ms.portal.azure.com/#resource${resourceId}`;
if (/\/\/localhost:/.test(parentOrigin)) {
parentOrigin = azurePortalMpacEndpoint;
} else if (/\/\/cosmos\.azure/.test(parentOrigin)) {
parentOrigin = parentOrigin.replace("cosmos.azure", "portal.azure");
}
parentOrigin = parentOrigin.replace(/\/$/, "");
return `${parentOrigin}/#resource${resourceId}`;
}; };
export const COSMOS_SQL_COMPONENT = "CosmosDBSql"; export const COSMOS_SQL_COMPONENT = "CosmosDBSql";
+7 -6
View File
@@ -959,12 +959,13 @@ function updateContextsFromPortalMessage(inputs: DataExplorerInputsFrame) {
if (inputs.features) { if (inputs.features) {
Object.assign(userContext.features, extractFeatures(new URLSearchParams(inputs.features))); Object.assign(userContext.features, extractFeatures(new URLSearchParams(inputs.features)));
} }
// somehow we need to make enableContainerCopy true for platform: portal & apiType: SQL
// Ideally we need to pass this as a feature flag from portal or in a query param if (
// Then we will fetch the value from query param and set this to true configContext.platform === Platform.Portal &&
// For now setting it to true unconditionally inputs.containerCopyEnabled &&
if (userContext.apiType === "SQL") { userContext.apiType === "SQL"
Object.assign(userContext.features, { enableContainerCopy: true }); ) {
Object.assign(userContext.features, { enableContainerCopy: inputs.containerCopyEnabled });
} }
if (inputs.flights) { if (inputs.flights) {