Window origin bugfix and build number injected in app version (#1702)

* Origin updation bugfix + build number in app version

* Windows - Build number in app version

* Screensharing indicator bugfix
This commit is contained in:
Salah Benmoussati 2023-02-09 14:09:26 +01:00 committed by GitHub
parent 1825eb1dee
commit 08145c86e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 66 additions and 36 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "symphony", "name": "symphony",
"productName": "Symphony", "productName": "Symphony",
"version": "23.4.0-1", "version": "23.4.0",
"clientVersion": "2.0.1", "clientVersion": "2.0.1",
"buildNumber": "0", "buildNumber": "0",
"searchAPIVersion": "1.55.3", "searchAPIVersion": "1.55.3",

View File

@ -100,6 +100,7 @@ sed -i -e 's/\"url\"[[:space:]]*\:[[:space:]]*\".*\"/\"url\":\"https:\/\/my.symp
# Setup the build version # Setup the build version
echo "Setting build version to ${PARENT_BUILD_VERSION}" echo "Setting build version to ${PARENT_BUILD_VERSION}"
sed -i -e "s/\"buildNumber\"[[:space:]]*\:[[:space:]]*\".*\"/\"buildNumber\": \"${PARENT_BUILD_VERSION}\"/g" package.json sed -i -e "s/\"buildNumber\"[[:space:]]*\:[[:space:]]*\".*\"/\"buildNumber\": \"${PARENT_BUILD_VERSION}\"/g" package.json
sed -i -e "s/\"version\"[[:space:]]*\:[[:space:]]\"\(.*\)\"/\"version\": \"\1-${PARENT_BUILD_VERSION}\"/g" package.json
# Replace version number in pre-install script # Replace version number in pre-install script
echo "Setting package version in pre install script to ${PKG_VERSION}" echo "Setting package version in pre install script to ${PKG_VERSION}"
@ -130,7 +131,7 @@ echo "Package created: ${PACKAGE}"
# Sign the app # Sign the app
PKG_VERSION=$(node -e "console.log(require('./package.json').version);") PKG_VERSION=$(node -e "console.log(require('./package.json').version);")
echo "Signing Package: ${PACKAGE}" echo "Signing Package: ${PACKAGE}"
SIGNED_PACKAGE=installer/mac/build/Symphony_Signed_${PKG_VERSION}_${PARENT_BUILD_VERSION}.pkg SIGNED_PACKAGE=installer/mac/build/Symphony_Signed_${PKG_VERSION}.pkg
productsign --sign "Developer ID Installer: Symphony Communication Services LLC" $PACKAGE $SIGNED_PACKAGE productsign --sign "Developer ID Installer: Symphony Communication Services LLC" $PACKAGE $SIGNED_PACKAGE
echo "Signing Package complete: ${PACKAGE}" echo "Signing Package complete: ${PACKAGE}"
@ -164,13 +165,13 @@ mkdir -p targets
# Attach artifacts to build # Attach artifacts to build
if [ "${EXPIRY_PERIOD}" != "0" ]; then if [ "${EXPIRY_PERIOD}" != "0" ]; then
cp $SIGNED_PACKAGE "targets/Symphony-macOS-${PKG_VERSION}-${PARENT_BUILD_VERSION}-TTL-${EXPIRY_PERIOD}.pkg" cp $SIGNED_PACKAGE "targets/Symphony-macOS-${PKG_VERSION}-TTL-${EXPIRY_PERIOD}.pkg"
cp installer/mac/install_instructions_mac.pdf "targets/Install-Instructions-macOS-${PKG_VERSION}-${PARENT_BUILD_VERSION}-TTL-${EXPIRY_PERIOD}.pdf" cp installer/mac/install_instructions_mac.pdf "targets/Install-Instructions-macOS-${PKG_VERSION}-TTL-${EXPIRY_PERIOD}.pdf"
cp RELEASE_NOTES.pdf "targets/Release-Notes-macOS-${PKG_VERSION}-${PARENT_BUILD_VERSION}-TTL-${EXPIRY_PERIOD}.pdf" cp RELEASE_NOTES.pdf "targets/Release-Notes-macOS-${PKG_VERSION}-TTL-${EXPIRY_PERIOD}.pdf"
else else
cp $SIGNED_PACKAGE "targets/Symphony-macOS-${PKG_VERSION}-${PARENT_BUILD_VERSION}.pkg" cp $SIGNED_PACKAGE "targets/Symphony-macOS-${PKG_VERSION}.pkg"
cp installer/mac/install_instructions_mac.pdf "targets/Install-Instructions-macOS-${PKG_VERSION}-${PARENT_BUILD_VERSION}.pdf" cp installer/mac/install_instructions_mac.pdf "targets/Install-Instructions-macOS-${PKG_VERSION}.pdf"
cp RELEASE_NOTES.pdf "targets/Release-Notes-macOS-${PKG_VERSION}-${PARENT_BUILD_VERSION}.pdf" cp RELEASE_NOTES.pdf "targets/Release-Notes-macOS-${PKG_VERSION}-.pdf"
fi fi
echo "All done, job successfull :)" echo "All done, job successfull :)"

View File

@ -39,6 +39,7 @@ call snyk config set api=%SNYK_API_TOKEN%
:: Below command replaces buildVersion with the appropriate build number from jenkins :: Below command replaces buildVersion with the appropriate build number from jenkins
sed -i -e "s/\"buildNumber\"[[:space:]]*\:[[:space:]]*\".*\"/\"buildNumber\": \"%PARENT_BUILD_VERSION%\"/g" package.json sed -i -e "s/\"buildNumber\"[[:space:]]*\:[[:space:]]*\".*\"/\"buildNumber\": \"%PARENT_BUILD_VERSION%\"/g" package.json
sed -i -e "s/\"version\"[[:space:]]*\:[[:space:]]\"\(.*\)\"/\"version\": \"\1-%PARENT_BUILD_VERSION%\"/g" package.json
:: Copy search libraries onto the project root :: Copy search libraries onto the project root
echo "Copying search libraries" echo "Copying search libraries"
@ -106,9 +107,9 @@ mkdir targets
set targetsDir="%CD%\targets\" set targetsDir="%CD%\targets\"
IF "%EXPIRY_PERIOD%"=="0" ( IF "%EXPIRY_PERIOD%"=="0" (
set archiveName=Symphony-Win64-%SYMVER%-%PARENT_BUILD_VERSION% set archiveName=Symphony-Win64-%SYMVER%
) else ( ) else (
set archiveName=Symphony-Win64-%SYMVER%-%PARENT_BUILD_VERSION%-TTL-%EXPIRY_PERIOD% set archiveName=Symphony-Win64-%SYMVER%-TTL-%EXPIRY_PERIOD%
) )
set installerDir="%CD%\installer\win" set installerDir="%CD%\installer\win"

View File

@ -518,6 +518,7 @@ export class AppMenu {
!bringToFrontCC || bringToFrontCC === CloudConfigDataTypes.NOT_SET, !bringToFrontCC || bringToFrontCC === CloudConfigDataTypes.NOT_SET,
}, },
{ {
type: 'checkbox',
label: i18n.t('Third-party browser login')(), label: i18n.t('Third-party browser login')(),
checked: enableSeamlessLogin, checked: enableSeamlessLogin,
click: () => { click: () => {

View File

@ -135,6 +135,7 @@ class ProtocolHandler {
const mainWebContents = windowHandler.getMainWebContents(); const mainWebContents = windowHandler.getMainWebContents();
if (mainWebContents && !mainWebContents?.isDestroyed() && url) { if (mainWebContents && !mainWebContents?.isDestroyed() && url) {
logger.info('protocol-handler: redirecting main webContents', url); logger.info('protocol-handler: redirecting main webContents', url);
windowHandler.setMainWindowOrigin(url);
mainWebContents?.loadURL(url); mainWebContents?.loadURL(url);
} }
} }

View File

@ -2243,6 +2243,15 @@ export class WindowHandler {
} }
} }
/**
* Setting origin for main window
*/
public setMainWindowOrigin(url: string) {
if (this.mainWindow && windowExists(this.mainWindow)) {
this.mainWindow.origin = url;
}
}
/** /**
* Listens for app load timeouts and reloads if required * Listens for app load timeouts and reloads if required
*/ */

View File

@ -371,7 +371,13 @@ export class AppBridge {
* @param data {any} * @param data {any}
*/ */
private broadcastMessage(method: string, data: any): void { private broadcastMessage(method: string, data: any): void {
window.postMessage({ method, data }, this.origin); ipcRenderer
.invoke(apiName.symphonyApi, {
cmd: apiCmds.getCurrentOriginUrl,
})
.then((origin) => {
window.postMessage({ method, data }, origin);
});
} }
} }

View File

@ -12,6 +12,8 @@ interface IState {
streamId: string; streamId: string;
} }
const SCREEN_SHARING_NAMESPACE = 'ScreenSharingIndicator';
type mouseEventButton = React.MouseEvent<HTMLButtonElement>; type mouseEventButton = React.MouseEvent<HTMLButtonElement>;
/** /**
* Window that display a banner when the users starting sharing screen * Window that display a banner when the users starting sharing screen
@ -40,26 +42,16 @@ export default class ScreenSharingIndicator extends React.Component<
*/ */
public render(): JSX.Element { public render(): JSX.Element {
const { id } = this.state; const { id } = this.state;
const namespace = 'ScreenSharingIndicator';
const appName = productName || 'Symphony';
return ( return (
<div className={classNames('ScreenSharingIndicator', { mac: isMac })}> <div className={classNames('ScreenSharingIndicator', { mac: isMac })}>
<span className='text-label'> <span className='text-label'>{this.getLabelInBold()}</span>
{i18n
.t(
`You are sharing your screen on {appName}`,
namespace,
)({ appName })
.replace(appName, '')}
<span className='text-label2'>&nbsp;{appName}</span>
</span>
<span className='buttons'> <span className='buttons'>
<button <button
className='stop-sharing-button' className='stop-sharing-button'
onClick={this.eventHandlers.onStopScreenSharing(id)} onClick={this.eventHandlers.onStopScreenSharing(id)}
> >
{i18n.t('Stop sharing', namespace)()} {i18n.t('Stop sharing', SCREEN_SHARING_NAMESPACE)()}
</button> </button>
</span> </span>
</div> </div>
@ -113,4 +105,27 @@ export default class ScreenSharingIndicator extends React.Component<
private updateState(_event, data): void { private updateState(_event, data): void {
this.setState(data as IState); this.setState(data as IState);
} }
/**
* Put App name in bold
*/
private getLabelInBold(): JSX.Element {
const appName = productName || 'Symphony';
const translatedLabel = i18n.t(
`You are sharing your screen on {appName}`,
SCREEN_SHARING_NAMESPACE,
)({ appName });
const appNameStartPosition = translatedLabel.indexOf(appName);
if (appNameStartPosition === -1) {
return <>{translatedLabel}</>;
}
const appNameEndPosition = appNameStartPosition + appName.length;
return (
<>
{`${translatedLabel.slice(0, appNameStartPosition)}`}
<b> {appName} </b>
{translatedLabel.slice(appNameEndPosition)}
</>
);
}
} }

View File

@ -1,13 +1,14 @@
@white: rgba(255, 255, 255, 1); @white: rgba(255, 255, 255, 1);
@background: #6b717c; @background: #6b717c;
@button-color: #303237; @button-color: #303237;
@stop-sharing-background:#EE3D3D; @stop-sharing-background: #ee3d3d;
@font: "system"; @font: 'system';
@font-face { @font-face {
font-family: system; font-family: system;
font-style: normal; font-style: normal;
src: local(".SFNSText"), local(".HelveticaNeueDeskInterface"), local("Ubuntu Light"), local("Segoe UI"), local("Roboto"), local("Tahoma"); src: local('.SFNSText'), local('.HelveticaNeueDeskInterface'),
local('Ubuntu Light'), local('Segoe UI'), local('Roboto'), local('Tahoma');
} }
body { body {
@ -22,7 +23,7 @@ body {
} }
.ScreenSharingIndicator { .ScreenSharingIndicator {
background: #FFFFFF; background: #ffffff;
width: 584px; width: 584px;
height: 40px; height: 40px;
border-radius: 24px; border-radius: 24px;
@ -62,10 +63,6 @@ body {
color: #000000; color: #000000;
} }
.text-label2 {
font-weight: bold
}
.mac { .mac {
.hide-button { .hide-button {
color: @button-color; color: @button-color;
@ -75,5 +72,4 @@ body {
padding: 6px 18px; padding: 6px 18px;
} }
} }
} }