Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the developer menu module #675

Merged
merged 1 commit into from
Jan 24, 2024
Merged
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
1 change: 1 addition & 0 deletions how-to/workspace-platform-starter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- Fixed - when launching multiple instances of an inline app asset it is possible to try and re-download an app asset that has just been downloaded or exists. We now fetch the app asset info to see if the platform already has the app asset and if it is the required version.
- Added util getCommandLineArgs to extract multiple command line arguments from a string into an array. Snap accepts an array of arguments and app assets and external apps take a string as an args parameter. This lets you specify arguments that cover scenarios where snap is disabled and enabled. Added tests to verify getCommandLineArgs behavior.
- Updated identity returned when launching a native app or app asset (either normally or through snap). The UUID is the app id if the app has been marked as instanceMode = "single" otherwise the uuid is appId/guid (guid being an instanceId). The name is the same as the UUID (as name is not specified in app asset/external process options). If your app supports having multiple instances and it registers intent handlers then we recommend passing the created UUID for your app instance using {OF-EXT-UUD} as part of the command line args so that the uuid can be used when you connect to the OpenFin runtime. When you then connect to the workspace platform interop broker (as the platform will be waiting on that connection to fire an intent against it) it will use the expected UUID as it's connection id.
- Update developer composite menu to use the Close menu option instead of Print as the positioning hook. Add Copy Url to the developer view context menu options.

## v16

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,31 @@ export class DeveloperActions implements Actions {
}
};

actionMap["copy-url"] = async (payload: CustomActionPayload): Promise<void> => {
if (payload.callerType === CustomActionCallerType.ViewTabContextMenu) {
const urls: string[] = [];
for (let i = 0; i < payload.selectedViews.length; i++) {
const viewIdentity = payload.selectedViews[i];
try {
const view = fin.View.wrapSync(viewIdentity);
const info = await view.getInfo();
urls.push(info.url);
} catch (error) {
this._logger?.error(
`Error while trying to capture view url for view ${viewIdentity.name}`,
error
);
}
}
if (urls.length > 0) {
const url = urls.join("\n");
await fin.Clipboard.writeText({
data: url
});
}
}
};

return actionMap;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ export class DeveloperMenus implements Menus {
}
},
position: {
operation: "after",
type: "Print"
operation: "before",
type: "CloseTab"
},
separator: "before"
},
Expand All @@ -118,6 +118,22 @@ export class DeveloperMenus implements Menus {
type: "Custom",
customId: "developer-inspect"
}
},
{
include: true,
label: "Copy Url",
data: {
type: "Custom",
action: {
id: "copy-url"
}
},
position: {
operation: "after",
type: "Custom",
customId: "raise-create-app-definition-intent"
},
separator: "after"
}
];
}
Expand Down
Loading