From d58e8d41d6cb555e2424908d5c0d764e1da7256d Mon Sep 17 00:00:00 2001
From: Salah Benmoussati <51402489+sbenmoussati@users.noreply.github.com>
Date: Wed, 8 Feb 2023 11:34:07 +0100
Subject: [PATCH] SDA-4035 Blue border while focus is on copy button (#1691)
---
spec/__snapshots__/aboutApp.spec.ts.snap | 46 ---------------
src/renderer/components/about-app.tsx | 74 ++++++++++++++----------
src/renderer/styles/about-app.less | 6 ++
src/renderer/styles/theme.less | 1 +
4 files changed, 52 insertions(+), 75 deletions(-)
diff --git a/spec/__snapshots__/aboutApp.spec.ts.snap b/spec/__snapshots__/aboutApp.spec.ts.snap
index f4cf711f..ecc709ee 100644
--- a/spec/__snapshots__/aboutApp.spec.ts.snap
+++ b/spec/__snapshots__/aboutApp.spec.ts.snap
@@ -24,52 +24,6 @@ exports[`about app should render correctly 1`] = `
Desktop Application
-
-
- -
-
- POD:
-
-
- N/A
-
-
- -
-
- SBE:
-
-
- N/A (N/A)
-
-
- -
-
- SDA:
-
-
- N/A (N/A)
-
-
- -
-
- SFE-Lite:
-
-
- N/A undefined
-
-
-
-
diff --git a/src/renderer/components/about-app.tsx b/src/renderer/components/about-app.tsx
index 9b8f8100..f3d3d8f8 100644
--- a/src/renderer/components/about-app.tsx
+++ b/src/renderer/components/about-app.tsx
@@ -45,9 +45,11 @@ export default class AboutApp extends React.Component<{}, IState> {
onCopy: () => this.copy(),
onClose: () => this.close(),
};
+ private closeButtonRef: React.RefObject;
constructor(props) {
super(props);
+ this.closeButtonRef = React.createRef();
this.state = {
userConfig: {},
globalConfig: {},
@@ -55,24 +57,24 @@ export default class AboutApp extends React.Component<{}, IState> {
finalConfig: {},
appName: 'Symphony',
versionLocalised: 'Version',
- clientVersion: 'N/A',
- buildNumber: 'N/A',
- hostname: 'N/A',
- sfeVersion: 'N/A',
- sfeClientType: 'N/A',
- sdaVersion: 'N/A',
- sdaBuildNumber: 'N/A',
- electronVersion: 'N/A',
- chromeVersion: 'N/A',
- v8Version: 'N/A',
- nodeVersion: 'N/A',
- openSslVersion: 'N/A',
- zlibVersion: 'N/A',
- uvVersion: 'N/A',
- aresVersion: 'N/A',
- httpParserVersion: 'N/A',
- swiftSearchVersion: 'N/A',
- swiftSearchSupportedVersion: 'N/A',
+ clientVersion: '',
+ buildNumber: '',
+ hostname: '',
+ sfeVersion: '',
+ sfeClientType: '',
+ sdaVersion: '',
+ sdaBuildNumber: '',
+ electronVersion: '',
+ chromeVersion: '',
+ v8Version: '',
+ nodeVersion: '',
+ openSslVersion: '',
+ zlibVersion: '',
+ uvVersion: '',
+ aresVersion: '',
+ httpParserVersion: '',
+ swiftSearchVersion: '',
+ swiftSearchSupportedVersion: '',
};
this.updateState = this.updateState.bind(this);
}
@@ -101,7 +103,7 @@ export default class AboutApp extends React.Component<{}, IState> {
const symphonySectionItems = [
{
key: 'POD:',
- value: `${hostname || 'N/A'}`,
+ value: `${hostname || ''}`,
},
{
key: 'SBE:',
@@ -132,16 +134,7 @@ export default class AboutApp extends React.Component<{}, IState> {
{i18n.t('Desktop Application', ABOUT_SYMPHONY_NAMESPACE)()}
-
-
- {symphonySectionItems.map((item, key) => (
- -
- {item.key}
- {item.value}
-
- ))}
-
-
+ {sdaVersion ? this.renderVersions(symphonySectionItems) : null}
@@ -183,6 +177,9 @@ export default class AboutApp extends React.Component<{}, IState> {
* Callback to handle event when a component is mounted
*/
public componentDidMount(): void {
+ setTimeout(() => {
+ this.closeButtonRef.current?.focus();
+ }, 0);
ipcRenderer.on('about-app-data', this.updateState);
}
@@ -224,4 +221,23 @@ export default class AboutApp extends React.Component<{}, IState> {
private updateState(_event, data): void {
this.setState(data as IState);
}
+
+ /**
+ * Renders component versions
+ * @param symphonySectionItems
+ */
+ private renderVersions(symphonySectionItems): JSX.Element {
+ return (
+
+
+ {symphonySectionItems.map((item, key) => (
+ -
+ {item.key}
+ {item.value}
+
+ ))}
+
+
+ );
+ }
}
diff --git a/src/renderer/styles/about-app.less b/src/renderer/styles/about-app.less
index 967dd1a3..e7deb08c 100644
--- a/src/renderer/styles/about-app.less
+++ b/src/renderer/styles/about-app.less
@@ -149,6 +149,12 @@ body {
padding-right: 8px;
color: @electricity-ui-30;
}
+
+ &:focus {
+ outline: none;
+ box-shadow: 0 0 0 2px @blue inset;
+ border-radius: 4px;
+ }
}
&-close-container {
diff --git a/src/renderer/styles/theme.less b/src/renderer/styles/theme.less
index 95a385e9..e95d7b28 100644
--- a/src/renderer/styles/theme.less
+++ b/src/renderer/styles/theme.less
@@ -22,3 +22,4 @@
@graphite-60: #52565e;
@vanilla-white: #fff;
+@blue: #008eff;