-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into workspace/v19.2.0
- Loading branch information
Showing
26 changed files
with
603 additions
and
304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ import { AppManifestType, getCurrentSync } from "@openfin/workspace-platform"; | |
* @returns List of app definitions. | ||
*/ | ||
export function getApps(): App[] { | ||
return [OPENFIN_INFORMATION_APP, FDC3_BROADCAST, INTEROP_BROADCAST]; | ||
return [OPENFIN_INFORMATION_APP, FDC3_BROADCAST, INTEROP_BROADCAST, EXCEL_WINDOW]; | ||
} | ||
|
||
/** | ||
|
@@ -92,20 +92,51 @@ const INTEROP_BROADCAST: App = { | |
tags: ["view", "interop", "tools"] | ||
}; | ||
|
||
/** | ||
* App definition for the FDC3 Interop Broadcast View. | ||
*/ | ||
const EXCEL_WINDOW: App = { | ||
appId: "excel-window", | ||
title: "Excel Window", | ||
description: | ||
"A window that launches Excel and listens for changes. This is an alternative to the Excel Home integration.", | ||
manifest: "http://localhost:8080/windows/excel.window.fin.json", | ||
manifestType: "window", | ||
icons: [ | ||
{ | ||
src: "http://localhost:8080/common/images/icon-blue.png" | ||
} | ||
], | ||
contactEmail: "[email protected]", | ||
supportEmail: "[email protected]", | ||
publisher: "OpenFin", | ||
intents: [], | ||
images: [], | ||
tags: ["window", "excel", "tools"] | ||
}; | ||
|
||
/** | ||
* Launch the passed app using its manifest type to determine how to launch it. | ||
* @param app The app to launch. | ||
* @returns The value returned by the launch. | ||
*/ | ||
export async function launchApp( | ||
app: App | ||
): Promise<OpenFin.Platform | OpenFin.Identity | OpenFin.View | OpenFin.Application | undefined> { | ||
): Promise< | ||
OpenFin.Platform | OpenFin.Identity | OpenFin.View | OpenFin.Application | OpenFin.Window | undefined | ||
> { | ||
if (!app.manifest) { | ||
console.error(`No manifest was provided for type ${app.manifestType}`); | ||
return; | ||
} | ||
|
||
let ret: OpenFin.Platform | OpenFin.Identity | OpenFin.View | OpenFin.Application | undefined; | ||
let ret: | ||
| OpenFin.Platform | ||
| OpenFin.Identity | ||
| OpenFin.View | ||
| OpenFin.Application | ||
| OpenFin.Window | ||
| undefined; | ||
|
||
console.log("Application launch requested:", app); | ||
|
||
|
@@ -127,6 +158,14 @@ export async function launchApp( | |
break; | ||
} | ||
|
||
case "window": { | ||
const manifest: OpenFin.WindowCreationOptions = await fetch(app.manifest).then(async (response) => | ||
response.json() | ||
); | ||
ret = await fin.Window.create(manifest); | ||
break; | ||
} | ||
|
||
default: { | ||
ret = await fin.Application.startFromManifest(app.manifest); | ||
break; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { init as initExcel, launchExcel } from "./excel"; | ||
import type { ExcelSettings } from "./shapes"; | ||
|
||
window.addEventListener("DOMContentLoaded", async () => { | ||
const root = "http://localhost:8080"; | ||
const excelSettings: ExcelSettings = { | ||
appAsset: { | ||
alias: "excel-interop-example.xlsx", | ||
version: "0.0.5", | ||
src: `${root}/assets/excel-interop-example.zip`, | ||
target: "excel-interop-example.xlsx" | ||
}, | ||
icon: `${root}/assets/excel.svg`, | ||
asset: { | ||
title: "Excel Interop Example", | ||
description: "Demonstrate interop with Excel workbook", | ||
workbook: "excel-interop-example.xlsx", | ||
worksheets: [ | ||
{ | ||
name: "Sheet1", | ||
cellHandlers: [ | ||
{ | ||
cell: "$B$3", | ||
types: ["instrument", "fdc3.instrument"], | ||
contextGroup: "green" | ||
}, | ||
{ | ||
cell: "$B$4", | ||
types: ["instrument", "fdc3.instrument"], | ||
contextGroup: "purple" | ||
}, | ||
{ | ||
cell: "$B$5", | ||
types: ["instrument", "fdc3.instrument"], | ||
contextGroup: "orange" | ||
}, | ||
{ | ||
cell: "$B$6", | ||
types: ["instrument", "fdc3.instrument"], | ||
contextGroup: "red" | ||
}, | ||
{ | ||
cell: "$B$7", | ||
types: ["instrument", "fdc3.instrument"], | ||
contextGroup: "pink" | ||
}, | ||
{ | ||
cell: "$B$8", | ||
types: ["instrument", "fdc3.instrument"], | ||
contextGroup: "yellow" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}; | ||
await initExcel(excelSettings); | ||
await launchExcel(excelSettings.asset); | ||
}); |
Oops, something went wrong.