SEARCH-1428 (Complete workflow of context-isolation) (#632)

* SEARCH-1313 - Completed full work flow

* SEARCH-1313 - Change get-version-info to return promise

* SEARCH-1313 - Bump Swift-search to 4.0.0-beta.1 to support context isolation

* SEARCH-1313 - Bump Swift-search to 5.0.0-beta.2 to support context isolation

* SEARCH-1313 - Rename export
This commit is contained in:
Keerthi Niranjan 2019-04-25 14:02:58 +05:30 committed by Vishwas Shashidhar
parent 6aca522a1e
commit 5cb931e31c
4 changed files with 41 additions and 1 deletions

View File

@ -157,6 +157,6 @@
},
"optionalDependencies": {
"screen-snippet": "git+https://github.com/symphonyoss/ScreenSnippet.git#v1.0.5",
"swift-search": "5.0.0-beta.1"
"swift-search": "5.0.0-beta.2"
}
}

View File

@ -29,6 +29,7 @@ export enum apiCmds {
initMainWindow = 'init-main-window',
isMisspelled = 'is-misspelled',
memoryInfo = 'memory-info',
swiftSearch = 'swift-search',
}
export enum apiName {

View File

@ -13,6 +13,15 @@ import { SSFApi } from './ssf-api';
const ssf = new SSFApi();
const notification = remote.require('../renderer/notification').notification;
let ssInstance: any;
try {
const SSAPIBridge = remote.require('swift-search').SSAPIBridge;
ssInstance = new SSAPIBridge();
} catch (e) {
ssInstance = null;
console.warn("Failed to initialize swift search. You'll need to include the search dependency. Contact the developers for more details");
}
export default class AppBridge {
@ -51,6 +60,9 @@ export default class AppBridge {
// starts with corporate pod and
// will be updated with the global config url
this.origin = 'https://corporate.symphony.com';
if (ssInstance && typeof ssInstance.setBroadcastMessage === 'function') {
ssInstance.setBroadcastMessage(this.broadcastMessage);
}
window.addEventListener('message', this.callbackHandlers.onMessage);
}
@ -129,6 +141,11 @@ export default class AppBridge {
ssf.setIsInMeeting(data as boolean);
}
break;
case apiCmds.swiftSearch:
if (ssInstance) {
ssInstance.handleMessageEvents(data);
}
break;
}
}

View File

@ -95,6 +95,24 @@ try {
console.warn('Failed to initialize Crypto Lib. You\'ll need to include the Crypto library. Contact the developers for more details');
}
let swiftSearch: any;
try {
swiftSearch = remote.require('swift-search').Search;
} catch (e) {
swiftSearch = null;
// tslint:disable-next-line
console.warn("Failed to initialize swift search. You'll need to include the search dependency. Contact the developers for more details");
}
let swiftSearchUtils: any;
try {
swiftSearchUtils = remote.require('swift-search').SearchUtils;
} catch (e) {
swiftSearchUtils = null;
// tslint:disable-next-line
console.warn("Failed to initialize swift search utils. You'll need to include the search dependency. Contact the developers for more details");
}
let nextIndicatorId = 0;
export class SSFApi {
@ -104,6 +122,10 @@ export class SSFApi {
*/
public CryptoLib: ICryptoLib | null = cryptoLib; // tslint:disable-line
public Search: any = swiftSearch; // tslint:disable-line
public SearchUtils: any = swiftSearchUtils; // tslint:disable-line
/**
* Implements equivalent of desktopCapturer.getSources - that works in
* a sandboxed renderer process.