Skip to content

Commit

Permalink
Merge branch 'finos:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
robmoffat authored Aug 31, 2022
2 parents 907f731 + 207d86c commit 77d0c92
Show file tree
Hide file tree
Showing 13 changed files with 496 additions and 249 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ Other useful commands:
1. `npm run typecheck` - Run a TypeScript check.
1. `npm run test` - Run tests for all parts of the application, including end-to-end tests.

## Mailing List

To join the Electron FDC3 Desktop Agent & App Directory mailing list please email [electron-fdc3+subscribe@lists.finos.org](mailto:electron-fdc3+subscribe@lists.finos.org).


## Contributing

1. Fork it (<https://github.com/finos/electron-fdc3/fork>)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "electron-fdc3",
"name": "@finos/electron-fdc3",
"private": true,
"engines": {
"node": ">=v16.13",
Expand Down
9 changes: 6 additions & 3 deletions packages/main/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const DEFAULT_WINDOW_HEIGHT = 600;
export const DEFAULT_WINDOW_WIDTH = 800;
export const TOOLBAR_HEIGHT = 90;
export const TOOLBAR_HEIGHT = 100;

export enum TARGETS {
SEARCH_RESULTS = 'searchResults',
Expand All @@ -9,6 +9,7 @@ export enum TARGETS {
}

export enum TOPICS {
OPEN_TOOLS_MENU = 'FRAME:openToolsMenu',
FRAME_READY = 'FRAME:ready',
SEARCH = 'WORK:search',
WORKSPACE_INIT = 'WORK:Init',
Expand All @@ -19,12 +20,14 @@ export enum TOPICS {
NEW_TAB = 'WORK:newTab',
NEW_TAB_CLICK = 'UI:newTab',
OPEN_CHANNEL_PICKER_CLICK = 'UI:openChannelPicker',
OPEN_FRAME_TOOLS_CLICK = 'UI:openFrameTools',
OPEN_TAB_TOOLS_CLICK = 'UI:openTabTools',
SELECT_TAB = 'WORK:selectTab', //tab state changes from event in the main process (i.e. change of focus from new view or intent resolution)
TAB_SELECTED = 'WORK:tabSelected', //tab is selected by user action in the UI
CLOSE_TAB = 'WORK:closeTab',
TAB_DRAG_START = 'WORK:tabDragStart',
TAB_DRAG_END = 'WORK:tabDragEnd',
TEAR_OUT_TAB = 'WORK:tearOutTab',
DROP_TAB = 'WORK:dropTab',
REMOVE_TAB = 'WORK:removeTab', //prune tab without closing the view (when moving tab from one window to another)
JOIN_CHANNEL = 'WORK:joinChannel',
LEAVE_CHANNEL = 'WORK:leaveChannel',
JOIN_WORKSPACE_TO_CHANNEL = 'FDC3:joinWorkspaceToChannel',
Expand Down
40 changes: 26 additions & 14 deletions packages/main/src/listeners/fdc3Listeners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {
IntentMetadata,
TargetApp,
IntentResolution,
ResolveError,
OpenError,
} from '@finos/fdc3';
import { FDC3Message } from '../types/FDC3Message';
import {
Expand Down Expand Up @@ -367,14 +369,17 @@ _listeners.push({
if (newView && msg.context) {
newView.setPendingContext(msg.context, msg.source);
}
//resolve with the window identfier

resolve();
//reject?
} else {
reject(OpenError.AppNotFound);
}
} else {
reject(OpenError.AppNotFound);
}
},
(err) => {
reject(err);
() => {
reject(OpenError.AppNotFound);
},
);
});
Expand Down Expand Up @@ -805,6 +810,9 @@ _listeners.push({
apps: [],
};

if (j.length === 0) {
reject(ResolveError.NoAppsFound);
}
// r.apps = j;
//find intent display name from app directory data
const intnt = j[0].intents.filter((i) => {
Expand All @@ -819,6 +827,7 @@ _listeners.push({
apps: [],
};
}

j.forEach((dirApp) => {
r.apps.push({
name: dirApp.name,
Expand All @@ -832,8 +841,7 @@ _listeners.push({
resolve(r as AppIntent);
},
() => {
//no results found for the app-directory, there may still be intents from live apps
resolve({ intent: { name: intent, displayName: '' }, apps: [] });
reject(ResolveError.NoAppsFound);
},
);
} else {
Expand Down Expand Up @@ -890,14 +898,18 @@ _listeners.push({
r.push(entry);
});
}
resolve(r);
if (r.length > 0) {
resolve(r);
} else {
reject(ResolveError.NoAppsFound);
}
},
(err) => {
reject(err);
() => {
reject(ResolveError.NoAppsFound);
},
);
} else {
reject('no context provided');
reject(ResolveError.NoAppsFound);
}
});
},
Expand Down Expand Up @@ -1073,7 +1085,7 @@ _listeners.push({
try {
data = await _r.json();
} catch (err) {
console.log('error parsing json', err);
reject(ResolveError.NoAppsFound);
}

if (data) {
Expand Down Expand Up @@ -1221,11 +1233,11 @@ _listeners.push({
}
} else {
//show message indicating no handler for the intent...
reject('no apps found for intent');
reject(ResolveError.NoAppsFound);
}
});
} else {
reject('No intent provided');
reject(ResolveError.NoAppsFound);
}
});
},
Expand Down Expand Up @@ -1494,7 +1506,7 @@ _listeners.push({
}
} else {
//show message indicating no handler for the intent...
reject('no apps found for intent');
reject(ResolveError.NoAppsFound);
}
};
raiseIntentForContext();
Expand Down
Loading

0 comments on commit 77d0c92

Please sign in to comment.