Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified assets/HERO-STARTER-HERE-CORE-UI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion how-to/register-with-home/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ npm run client
npm run build
```

![Register With Home](openfin-register-with-home.gif)
![Register With Home](new-home.png)

### Note About The App

Expand Down Expand Up @@ -107,6 +107,7 @@ const homeProvider: HomeProvider = {
title: settings.homeProvider.title,
id: settings.homeProvider.id,
icon: settings.homeProvider.icon,
subHeader: homeSettings.subHeader,
onUserInput: onUserInput,
onResultDispatch: onSelection
};
Expand All @@ -125,6 +126,12 @@ The [provider.ts](client/src/provider.ts) `getManifestCustomSettings` method rea
"homeProvider": {
"id":"register-with-home",
"title":"Home Starter",
"subHeader": {
"title1": "Welcome to the",
"title2": "HERE Home Starter",
"subtitle": "Your gateway to HERE applications",
"icon": "http://localhost:8080/favicon.ico"
},
"icon":"http://localhost:8080/favicon.ico",
"queryMinLength": 3,
"queryAgainst": ["title"]
Expand All @@ -140,6 +147,7 @@ The [provider.ts](client/src/provider.ts) `getManifestCustomSettings` method rea
| **homeProvider** | Config related to the home provider setup to list things in Home and the Browser Add New View |
| id | What your provider should be called |
| title | The title that should be shown in the Home UI to represent your provider |
| subHeader | A custom and optional object to add branding and a welcome message to the Home component. Please see the image above for referencing where the text and optional icon is placed. |
| icon | The icon to show in the Home UI (top right section as well as an icon to switch between providers when there is more than one registered) |
| queryMinLength | How many characters should be typed before filtering the list? |
| queryAgainst | What do you wish to run the query against when inspecting your search results. An array of entries. If not specified it will default to ["title"]. Since this example stores the app definition inside of a cli search result's data field you can add data.tags to the array so that it will see if the query matches the start of a tag e.g. ["title","data.tags"] |
Expand All @@ -165,6 +173,7 @@ const homeProvider: HomeProvider = {
title: settings.homeProvider.title,
id: settings.homeProvider.id,
icon: settings.homeProvider.icon,
subHeader: homeSettings.subHeader,
onUserInput: onUserInput,
onResultDispatch: onSelection
};
Expand Down
2 changes: 2 additions & 0 deletions how-to/register-with-home/client/src/home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,12 @@ export async function register(
title: homeSettings.title,
id: homeSettings.id,
icon: homeSettings.icon,
subHeader: homeSettings.subHeader,
onUserInput,
onResultDispatch: onSelection
};

console.log(`In home.ts with these settings: ${JSON.stringify(homeSettings.subHeader)}`);
homeRegistration = await Home.register(homeProvider);
console.log("Home configured.");
console.log(homeRegistration);
Expand Down
4 changes: 2 additions & 2 deletions how-to/register-with-home/client/src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { CustomSettings } from "./shapes";
window.addEventListener("DOMContentLoaded", async () => {
// Load the settings from the manifest
const customSettings = await getManifestCustomSettings();

console.log("Custom settings loaded from manifest:", customSettings);
// When the platform api is ready we bootstrap the platform.
const platform = fin.Platform.getCurrentSync();
await platform.once("platform-api-ready", async () => initializeWorkspaceComponents(customSettings));
Expand Down Expand Up @@ -73,7 +73,7 @@ async function initializeWorkspaceComponents(customSettings: CustomSettings): Pr
async function getManifestCustomSettings(): Promise<CustomSettings> {
// Get the manifest for the current application
const app = await fin.Application.getCurrent();

console.log("Retrieving manifest for application:", app.identity.uuid);
// Extract the custom settings for this application
const manifest: OpenFin.Manifest & { customSettings?: CustomSettings } = await app.getManifest();
return manifest.customSettings ?? {};
Expand Down
22 changes: 22 additions & 0 deletions how-to/register-with-home/client/src/shapes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,28 @@ export interface HomeProviderSettings {
*/
title: string;

/**
* The optional title changes to display on home.
*/
subHeader?: {
/**
* First title text to display in the subheader.
*/
title1?: string;
/**
* Second title text to display in the subheader (renders on a new line).
*/
title2?: string;
/**
* Subtitle text to display in the subheader.
*/
subtitle?: string;
/**
* URL of the icon to display in the subheader.
*/
icon?: string;
};

/**
* The icon to display in home.
*/
Expand Down
Binary file added how-to/register-with-home/new-home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
7 changes: 7 additions & 0 deletions how-to/register-with-home/public/manifest.fin.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
},
"platform": {
"uuid": "register-with-home",
"name": "Register With Home - v23.0.0",
"icon": "http://localhost:8080/favicon.ico",
"autoShow": false,
"providerUrl": "http://localhost:8080/platform/provider.html",
Expand Down Expand Up @@ -59,6 +60,12 @@
"homeProvider": {
"id": "register-with-home",
"title": "Home Starter",
"subHeader": {
"title1": "Welcome to the",
"title2": "HERE Home Starter",
"subtitle": "Your gateway to HERE applications",
"icon": "http://localhost:8080/favicon.ico"
},
"icon": "http://localhost:8080/favicon.ico",
"queryMinLength": 3,
"queryAgainst": ["title"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@
"updatable": {
"description": "What can be specified when launching a native app. This is an array of named types to reflect the properties you are happy to be specified.\nBy default nothing can be set outside of the app definition when launching the app.",
"items": {
"$ref": "#/definitions/NativePreference<never>"
"$ref": "#/definitions/NativePreference%3Cnever%3E"
},
"type": "array"
}
Expand Down Expand Up @@ -447,7 +447,7 @@
"$ref": "#/definitions/ViewPreferenceUrl"
},
{
"$ref": "#/definitions/ViewPreference<never>"
"$ref": "#/definitions/ViewPreference%3Cnever%3E"
}
]
},
Expand Down Expand Up @@ -563,7 +563,7 @@
"$ref": "#/definitions/WindowPreferenceUrl"
},
{
"$ref": "#/definitions/WindowPreference<never>"
"$ref": "#/definitions/WindowPreference%3Cnever%3E"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@
"updatable": {
"description": "What can be specified when launching a native app. This is an array of named types to reflect the properties you are happy to be specified.\nBy default nothing can be set outside of the app definition when launching the app.",
"items": {
"$ref": "#/definitions/NativePreference<never>"
"$ref": "#/definitions/NativePreference%3Cnever%3E"
},
"type": "array"
}
Expand Down Expand Up @@ -664,7 +664,7 @@
"$ref": "#/definitions/ViewPreferenceUrl"
},
{
"$ref": "#/definitions/ViewPreference<never>"
"$ref": "#/definitions/ViewPreference%3Cnever%3E"
}
]
},
Expand Down Expand Up @@ -792,7 +792,7 @@
"$ref": "#/definitions/WindowPreferenceUrl"
},
{
"$ref": "#/definitions/WindowPreference<never>"
"$ref": "#/definitions/WindowPreference%3Cnever%3E"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@
"rules": {
"description": "List of rules for creation of new content.",
"items": {
"$ref": "#/definitions/ContentCreationRule<ContentCreationBehavior>"
"$ref": "#/definitions/ContentCreationRule%3CContentCreationBehavior%3E"
},
"type": "array"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@
"rules": {
"description": "List of rules for creation of new content.",
"items": {
"$ref": "#/definitions/ContentCreationRule<ContentCreationBehavior>"
"$ref": "#/definitions/ContentCreationRule%3CContentCreationBehavior%3E"
},
"type": "array"
}
Expand Down
Loading
Loading