feat: SEARCH-1527 - Display swift-search version details in the More Info (#688)

* SEARCH-1527 - Display swift-search version details in the More Info window

* SEARCH-1527 - Arrange in alphabetically order

* SEARCH-1527 - Change the implementation to use package json
This commit is contained in:
Keerthi Niranjan 2019-06-21 23:53:57 +05:30 committed by Vishwas Shashidhar
parent a28e14cfef
commit 79c38e7834
9 changed files with 62 additions and 3 deletions

View File

@ -4,6 +4,7 @@
"version": "3.8.0",
"clientVersion": "1.55",
"buildNumber": "0",
"searchAPIVersion": "1.55.3",
"description": "Symphony desktop app (Foundation ODP)",
"author": "Symphony",
"main": "lib/src/app/init.js",
@ -129,6 +130,6 @@
},
"optionalDependencies": {
"screen-snippet": "git+https://github.com/symphonyoss/ScreenSnippet.git#v1.0.5",
"swift-search": "1.55.2-beta.5"
"swift-search": "1.55.2-beta.6"
}
}

View File

@ -14,9 +14,11 @@
"User name:": "User name:"
},
"MoreInfo": {
"Swift Search Version": "Swift Search Version",
"More Information": "More Information",
"Others": "Others",
"related": "related",
"API Version": "API Version",
"Version Information": "Version Information"
},
"Bring All to Front": "Bring All to Front",

View File

@ -14,9 +14,11 @@
"User name:": "User name:"
},
"MoreInfo": {
"Swift Search Version": "Swift Search Version",
"More Information": "More Information",
"Others": "Others",
"related": "related",
"API Version": "API Version",
"Version Information": "Version Information"
},
"Bring All to Front": "Bring All to Front",

View File

@ -73,9 +73,11 @@
"Minimize on Close": "Minimiser lors de la fermeture",
"More Information": "Informations détaillées",
"MoreInfo": {
"Swift Search Version": "Version de recherche rapide",
"More Information": "Informations détaillées",
"Others": "Autres",
"related": "en relation",
"API Version": "Version de l'API",
"Version Information": "Information sur cette version de Symphony"
},
"Native": "Originaire",

View File

@ -73,9 +73,11 @@
"Minimize on Close": "Minimiser lors de la fermeture",
"More Information": "Informations détaillées",
"MoreInfo": {
"Swift Search Version": "Version de recherche rapide",
"More Information": "Informations détaillées",
"Others": "Autres",
"related": "en relation",
"API Version": "Version de l'API",
"Version Information": "Information sur cette version de Symphony"
},
"Native": "Originaire",

View File

@ -14,9 +14,11 @@
"User name:": "ユーザー名:"
},
"MoreInfo": {
"Swift Search Version": "迅速な検索バージョン",
"More Information": "詳しくは",
"Others": "その他",
"related": "関連した",
"API Version": "APIのバージョン",
"Version Information": "バージョン情報"
},
"Bring All to Front": "すべて前面に表示",

View File

@ -14,9 +14,11 @@
"User name:": "ユーザー名:"
},
"MoreInfo": {
"Swift Search Version": "迅速な検索バージョン",
"More Information": "詳しくは",
"Others": "その他",
"related": "関連した",
"API Version": "APIのバージョン",
"Version Information": "バージョン情報"
},
"Bring All to Front": "すべて前面に表示",

View File

@ -1,13 +1,58 @@
import * as React from 'react';
import { optionalDependencies, searchAPIVersion } from '../../../package.json';
import { i18n } from '../../common/i18n-preload';
interface ISSDataInterface {
supportedVersion?: string;
swiftSearchVersion?: string;
}
const MORE_INFO_NAMESPACE = 'MoreInfo';
/**
* Returns process variable if the value is set
*/
const getSwiftSearchData = () => {
const swiftSearchInfo: ISSDataInterface = {
swiftSearchVersion: optionalDependencies['swift-search'],
supportedVersion: searchAPIVersion,
};
return swiftSearchInfo;
};
/**
* Window that display app version and copyright info
*/
export default class MoreInfo extends React.PureComponent {
/**
* Render Swift-Search version details
*/
public static renderSwiftSearchInfo(): JSX.Element | null {
const { swiftSearchVersion, supportedVersion }: ISSDataInterface = getSwiftSearchData() || {};
if (!swiftSearchVersion || !supportedVersion) {
return null;
}
return (
<div className='content'>
<h4>Swift Search</h4>
<table>
<tbody>
<tr>
<th>{i18n.t('Swift Search Version', MORE_INFO_NAMESPACE)()}</th>
<th>{i18n.t('API Version', MORE_INFO_NAMESPACE)()}</th>
</tr>
<tr>
<td>{swiftSearchVersion || 'N/A'}</td>
<td>{supportedVersion || 'N/A'}</td>
</tr>
</tbody>
</table>
</div>
);
}
/**
* main render function
*/
@ -57,6 +102,7 @@ export default class MoreInfo extends React.PureComponent {
</tbody>
</table>
</div>
{MoreInfo.renderSwiftSearchInfo()}
</div>
);
}

View File

@ -1,6 +1,6 @@
import { ipcRenderer, remote } from 'electron';
import { buildNumber } from '../../package.json';
import { buildNumber, searchAPIVersion } from '../../package.json';
import { ICustomBrowserWindow } from '../app/window-handler';
import {
apiCmds,
@ -177,7 +177,7 @@ export class SSFApi {
buildNumber,
apiVer: '2.0.0',
// Only need to bump if there are any breaking changes.
searchApiVer: '1.55.3',
searchApiVer: searchAPIVersion,
});
}