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

View File

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

View File

@ -16,6 +16,7 @@ describe('about app', () => {
buildNumber: '4.x.x',
hostname: 'N/A',
sfeVersion: 'N/A',
sfeClientType: '1.5',
sdaVersion: '3.8.0',
sdaBuildNumber: '0',
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('clientVersion'));
t.true(clipboard.hasOwnProperty('sfeVersion'));
t.true(clipboard.hasOwnProperty('sfeClientType'));
t.true(clipboard.hasOwnProperty('sdaVersion'));
t.true(clipboard.hasOwnProperty('sdaBuildNumber'));
robotActions.closeWindow();

View File

@ -1,6 +1,6 @@
import { net } from 'electron';
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 { config, IGlobalConfig } from './config-handler';
@ -8,6 +8,7 @@ interface IVersionInfo {
clientVersion: string;
buildNumber: string;
sfeVersion: string;
sfeClientType: string;
sdaVersion: string;
sdaBuildNumber: string;
electronVersion: string;
@ -35,6 +36,7 @@ class VersionHandler {
clientVersion,
buildNumber,
sfeVersion,
sfeClientType,
sdaVersion: version,
sdaBuildNumber: buildNumber,
electronVersion: process.versions.electron,
@ -140,8 +142,22 @@ class VersionHandler {
request.end();
logger.info('version-handler: mainUrl: ' + mainUrl);
logger.info('version-handler: hostname: ' + hostname);
/* 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}`);
const requestSfeVersion = net.request(urlSfeVersion);
@ -159,7 +175,9 @@ class VersionHandler {
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);
} catch (error) {
logger.error(`version-handler: Error getting SFE version data from the server! ${error}`);

View File

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