sda-2700 show 1.5/SFE 2.0/SFE-lite

This commit is contained in:
Johan Kwarnmark 2020-11-30 12:14:09 +01:00
parent eb80e42463
commit fabb8fb860
6 changed files with 36 additions and 7 deletions

View File

@ -6,6 +6,7 @@
"buildNumber": "0", "buildNumber": "0",
"searchAPIVersion": "1.55.3", "searchAPIVersion": "1.55.3",
"sfeVersion": "0", "sfeVersion": "0",
"sfeClientType": "1.5",
"description": "Symphony desktop app (Foundation ODP)", "description": "Symphony desktop app (Foundation ODP)",
"author": "Symphony OSS <help@finos.org>", "author": "Symphony OSS <help@finos.org>",
"main": "lib/src/app/init.js", "main": "lib/src/app/init.js",
@ -182,4 +183,4 @@
"!lib/src/**/*.js" "!lib/src/**/*.js"
] ]
} }
} }

View File

@ -62,7 +62,8 @@ exports[`about app should render correctly 1`] = `
</li> </li>
<li> <li>
<b> <b>
SFE: SFE-Lite
:
</b> </b>
N/A N/A

View File

@ -16,6 +16,7 @@ describe('about app', () => {
buildNumber: '4.x.x', buildNumber: '4.x.x',
hostname: 'N/A', hostname: 'N/A',
sfeVersion: 'N/A', sfeVersion: 'N/A',
sfeClientType: '1.5',
sdaVersion: '3.8.0', sdaVersion: '3.8.0',
sdaBuildNumber: '0', sdaBuildNumber: '0',
electronVersion: '3.1.11', electronVersion: '3.1.11',

View File

@ -41,6 +41,7 @@ test('about-app: verify copy button with few data validation', async (t) => {
t.true(clipboard.hasOwnProperty('appName')); t.true(clipboard.hasOwnProperty('appName'));
t.true(clipboard.hasOwnProperty('clientVersion')); t.true(clipboard.hasOwnProperty('clientVersion'));
t.true(clipboard.hasOwnProperty('sfeVersion')); t.true(clipboard.hasOwnProperty('sfeVersion'));
t.true(clipboard.hasOwnProperty('sfeClientType'));
t.true(clipboard.hasOwnProperty('sdaVersion')); t.true(clipboard.hasOwnProperty('sdaVersion'));
t.true(clipboard.hasOwnProperty('sdaBuildNumber')); t.true(clipboard.hasOwnProperty('sdaBuildNumber'));
robotActions.closeWindow(); robotActions.closeWindow();

View File

@ -1,6 +1,6 @@
import { net } from 'electron'; import { net } from 'electron';
import * as nodeURL from 'url'; import * as nodeURL from 'url';
import { buildNumber, clientVersion, optionalDependencies, searchAPIVersion, sfeVersion, version } from '../../package.json'; import { buildNumber, clientVersion, optionalDependencies, searchAPIVersion, sfeClientType, sfeVersion, version } from '../../package.json';
import { logger } from '../common/logger'; import { logger } from '../common/logger';
import { config, IGlobalConfig } from './config-handler'; import { config, IGlobalConfig } from './config-handler';
@ -8,6 +8,7 @@ interface IVersionInfo {
clientVersion: string; clientVersion: string;
buildNumber: string; buildNumber: string;
sfeVersion: string; sfeVersion: string;
sfeClientType: string;
sdaVersion: string; sdaVersion: string;
sdaBuildNumber: string; sdaBuildNumber: string;
electronVersion: string; electronVersion: string;
@ -35,6 +36,7 @@ class VersionHandler {
clientVersion, clientVersion,
buildNumber, buildNumber,
sfeVersion, sfeVersion,
sfeClientType,
sdaVersion: version, sdaVersion: version,
sdaBuildNumber: buildNumber, sdaBuildNumber: buildNumber,
electronVersion: process.versions.electron, electronVersion: process.versions.electron,
@ -140,8 +142,22 @@ class VersionHandler {
request.end(); request.end();
logger.info('version-handler: mainUrl: ' + mainUrl);
logger.info('version-handler: hostname: ' + hostname);
/* Get SFE version */ /* Get SFE version */
const urlSfeVersion = `${protocol}//${hostname}/client/version.json`; let urlSfeVersion;
if (mainUrl?.includes('/client-bff/')) {
if (mainUrl?.includes('/client-bff/daily/')) {
urlSfeVersion = `${protocol}//${hostname}/client-bff/daily/version.json`;
} else {
urlSfeVersion = `${protocol}//${hostname}/client-bff/version.json`;
}
this.versionInfo.sfeClientType = '2.0';
} else {
urlSfeVersion = `${protocol}//${hostname}/client/version.json`;
this.versionInfo.sfeClientType = '1.5';
}
logger.info(`version-handler: Trying to get SFE version info for the URL: ${urlSfeVersion}`); logger.info(`version-handler: Trying to get SFE version info for the URL: ${urlSfeVersion}`);
const requestSfeVersion = net.request(urlSfeVersion); const requestSfeVersion = net.request(urlSfeVersion);
@ -159,7 +175,9 @@ class VersionHandler {
this.versionInfo.sfeVersion = this.sfeVersionInfo[key]; this.versionInfo.sfeVersion = this.sfeVersionInfo[key];
logger.info(`version-handler: Updated SFE version info from server! ${JSON.stringify(this.versionInfo)}`); logger.info('version-handler: SFE-version: ' + this.sfeVersionInfo[key]);
logger.info(`version-handler: Updated SFE version info from server! ${JSON.stringify(this.versionInfo, null, 3)}`);
resolve(this.versionInfo); resolve(this.versionInfo);
} catch (error) { } catch (error) {
logger.error(`version-handler: Error getting SFE version data from the server! ${error}`); logger.error(`version-handler: Error getting SFE version data from the server! ${error}`);

View File

@ -12,6 +12,7 @@ interface IState {
buildNumber: string; buildNumber: string;
hostname: string; hostname: string;
sfeVersion: string; sfeVersion: string;
sfeClientType: string;
versionLocalised?: string; versionLocalised?: string;
sdaVersion?: string; sdaVersion?: string;
sdaBuildNumber?: string; sdaBuildNumber?: string;
@ -53,6 +54,7 @@ export default class AboutApp extends React.Component<{}, IState> {
buildNumber: 'N/A', buildNumber: 'N/A',
hostname: 'N/A', hostname: 'N/A',
sfeVersion: 'N/A', sfeVersion: 'N/A',
sfeClientType: 'N/A',
sdaVersion: 'N/A', sdaVersion: 'N/A',
sdaBuildNumber: 'N/A', sdaBuildNumber: 'N/A',
electronVersion: 'N/A', electronVersion: 'N/A',
@ -75,13 +77,18 @@ export default class AboutApp extends React.Component<{}, IState> {
*/ */
public render(): JSX.Element { public render(): JSX.Element {
const { clientVersion, buildNumber, hostname, sfeVersion, const { clientVersion, buildNumber, hostname, sfeVersion,
sdaVersion, sdaBuildNumber, client, sfeClientType, sdaVersion, sdaBuildNumber, client,
} = this.state; } = this.state;
const appName = remote.app.getName() || 'Symphony'; const appName = remote.app.getName() || 'Symphony';
const copyright = `\xA9 ${new Date().getFullYear()} ${appName}`; const copyright = `\xA9 ${new Date().getFullYear()} ${appName}`;
const podVersion = `${clientVersion} (${buildNumber})`; const podVersion = `${clientVersion} (${buildNumber})`;
const sdaVersionBuild = `${sdaVersion} (${sdaBuildNumber})`; const sdaVersionBuild = `${sdaVersion} (${sdaBuildNumber})`;
let sfeClientTypeName = 'SFE';
if (sfeClientType !== '1.5') {
sfeClientTypeName = 'SFE-Lite';
}
return ( return (
<div className='AboutApp' lang={i18n.getLocale()}> <div className='AboutApp' lang={i18n.getLocale()}>
<div className='AboutApp-header-container'> <div className='AboutApp-header-container'>
@ -103,7 +110,7 @@ export default class AboutApp extends React.Component<{}, IState> {
<li><b>POD:</b> {hostname || 'N/A'}</li> <li><b>POD:</b> {hostname || 'N/A'}</li>
<li><b>SBE:</b> {podVersion}</li> <li><b>SBE:</b> {podVersion}</li>
<li><b>SDA:</b> {sdaVersionBuild}</li> <li><b>SDA:</b> {sdaVersionBuild}</li>
<li><b>SFE:</b> {sfeVersion} {client}</li> <li><b>{sfeClientTypeName}:</b> {sfeVersion} {client}</li>
</ul> </ul>
</section> </section>
</div> </div>