Add Platform.Fabric to run in context of Fabric

This commit is contained in:
Sevo Kukol 2023-09-12 13:21:01 +02:00
parent 12ed591634
commit 14a8072551
3 changed files with 9 additions and 0 deletions

View File

@ -16,6 +16,7 @@ export enum Platform {
Portal = "Portal",
Hosted = "Hosted",
Emulator = "Emulator",
Fabric = "Fabric",
}
export interface ConfigContext {
@ -187,6 +188,7 @@ export async function initializeConfiguration(): Promise<ConfigContext> {
console.error(`Invalid platform query parameter: ${platform}`);
break;
case Platform.Portal:
case Platform.Fabric:
case Platform.Hosted:
case Platform.Emulator:
updateConfigContext({ platform });

View File

@ -5,6 +5,9 @@ export const getDataExplorerWindow = (currentWindow: Window): Window | undefined
if (currentWindow.parent === currentWindow) {
return undefined;
}
if (currentWindow.parent.parent === currentWindow.top) { // Fabric
return currentWindow;
}
if (currentWindow.parent === currentWindow.top) {
return currentWindow;
}

View File

@ -60,6 +60,10 @@ export function useKnockoutExplorer(platform: Platform): Explorer {
} else if (platform === Platform.Portal) {
const explorer = await configurePortal();
setExplorer(explorer);
} else if (platform === Platform.Fabric) {
//TODO: need Fabric specific implementation similar to portal
const explorer = await configureHosted();
setExplorer(explorer);
}
}
};