diff --git a/package.json b/package.json index 8c69f2a4..dda29cb0 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "clientVersion": "2.0.1", "buildNumber": "0", "searchAPIVersion": "1.55.3", + "sfeVersion": "0", "description": "Symphony desktop app (Foundation ODP)", "author": "Symphony OSS ", "main": "lib/src/app/init.js", diff --git a/spec/__snapshots__/aboutApp.spec.ts.snap b/spec/__snapshots__/aboutApp.spec.ts.snap index 6859987d..6cbfb457 100644 --- a/spec/__snapshots__/aboutApp.spec.ts.snap +++ b/spec/__snapshots__/aboutApp.spec.ts.snap @@ -50,6 +50,13 @@ exports[`about app should render correctly 1`] = ` N/A (N/A) +
  • + + SFE: + + + N/A +
  • SDA: diff --git a/src/app/version-handler.ts b/src/app/version-handler.ts index b30e198f..98366c70 100644 --- a/src/app/version-handler.ts +++ b/src/app/version-handler.ts @@ -1,12 +1,13 @@ import { net } from 'electron'; import * as nodeURL from 'url'; -import { buildNumber, clientVersion, optionalDependencies, searchAPIVersion, version } from '../../package.json'; +import { buildNumber, clientVersion, optionalDependencies, searchAPIVersion, sfeVersion, version } from '../../package.json'; import { logger } from '../common/logger'; import { config, IConfig } from './config-handler'; interface IVersionInfo { clientVersion: string; buildNumber: string; + sfeVersion: string; sdaVersion: string; sdaBuildNumber: string; electronVersion: string; @@ -27,11 +28,13 @@ class VersionHandler { public versionInfo: IVersionInfo; private serverVersionInfo: any; private mainUrl; + private sfeVersionInfo: any; constructor() { this.versionInfo = { clientVersion, buildNumber, + sfeVersion, sdaVersion: version, sdaBuildNumber: buildNumber, electronVersion: process.versions.electron, @@ -130,6 +133,58 @@ class VersionHandler { }); request.end(); + + /* Get SFE version */ + const urlSfeVersion = `${protocol}//${hostname}/client/version.json`; + logger.info(`version-handler: Trying to get SFE version info for the URL: ${urlSfeVersion}`); + + const requestSfeVersion = net.request(urlSfeVersion); + requestSfeVersion.on('response', (res) => { + + let body: string = ''; + res.on('data', (d: Buffer) => { + body += d; + }); + + res.on('end', () => { + try { + this.sfeVersionInfo = JSON.parse(body); + const key = 'version'; + + this.versionInfo.sfeVersion = this.sfeVersionInfo[key]; + + logger.info(`version-handler: Updated SFE version info from server! ${JSON.stringify(this.versionInfo)}`); + resolve(this.versionInfo); + } catch (error) { + logger.error(`version-handler: Error getting SFE version data from the server! ${error}`); + resolve(this.versionInfo); + return; + } + }); + + res.on('error', (error: Error) => { + logger.error(`version-handler: Error getting SFE version data from the server! ${error}`); + resolve(this.versionInfo); + return; + }); + + }); + + requestSfeVersion.on('error', (error: Error) => { + logger.error(`version-handler: Error getting SFE version data from the server! ${error}`); + resolve(this.versionInfo); + return; + }); + + requestSfeVersion.on('close', () => { + logger.info(`version-handler: Request closed!!`); + }); + + requestSfeVersion.on('finish', () => { + logger.info(`version-handler: Request finished!!`); + }); + + requestSfeVersion.end(); }); } diff --git a/src/app/window-handler.ts b/src/app/window-handler.ts index f50333ea..a3156bc7 100644 --- a/src/app/window-handler.ts +++ b/src/app/window-handler.ts @@ -437,7 +437,7 @@ export class WindowHandler { const opts: BrowserWindowConstructorOptions = this.getWindowOpts({ width: 420, - height: isWindowsOS ? 725 : 685, + height: isWindowsOS ? 745 : 705, modal: false, alwaysOnTop: isMac, resizable: true, @@ -461,6 +461,7 @@ export class WindowHandler { const aboutInfo = { buildNumber: versionHandler.versionInfo.buildNumber, clientVersion: versionHandler.versionInfo.clientVersion, + sfeVersion: versionHandler.versionInfo.sfeVersion, versionLocalised, ...versionHandler.versionInfo, }; diff --git a/src/renderer/components/about-app.tsx b/src/renderer/components/about-app.tsx index c70f0d72..096d9e90 100644 --- a/src/renderer/components/about-app.tsx +++ b/src/renderer/components/about-app.tsx @@ -7,6 +7,7 @@ interface IState { copyWrite?: string; clientVersion: string; buildNumber: string; + sfeVersion: string; versionLocalised?: string; sdaVersion?: string; sdaBuildNumber?: string; @@ -41,6 +42,7 @@ export default class AboutApp extends React.Component<{}, IState> { versionLocalised: 'Version', clientVersion: 'N/A', buildNumber: 'N/A', + sfeVersion: 'N/A', sdaVersion: 'N/A', sdaBuildNumber: 'N/A', electronVersion: 'N/A', @@ -62,7 +64,7 @@ export default class AboutApp extends React.Component<{}, IState> { * main render function */ public render(): JSX.Element { - const { clientVersion, buildNumber, + const { clientVersion, buildNumber, sfeVersion, sdaVersion, sdaBuildNumber, electronVersion, chromeVersion, v8Version, nodeVersion, openSslVersion, zlibVersion, @@ -95,6 +97,7 @@ export default class AboutApp extends React.Component<{}, IState> {

    Symphony

    • SBE: {podVersion}
    • +
    • SFE: {sfeVersion}
    • SDA: {sdaVersionBuild}