Skip to content

Commit

Permalink
Release 2.4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
lfeigen committed Oct 15, 2023
1 parent 9465917 commit 3c47c20
Show file tree
Hide file tree
Showing 153 changed files with 3,573 additions and 6,894 deletions.
3 changes: 3 additions & 0 deletions THIRD_PARTY_LICENSES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1769,6 +1769,9 @@ Copyright (c) 2014 The cheeriojs contributors
ee-first
Copyright (c) 2014 Jonathan Ong me@jongleberry.com

electron-log
Copyright (c) 2016 Alexey Prokhorov

electron-preferences
Copyright 2019 Tim Ambler <tkambler@gmail.com>

Expand Down
2 changes: 1 addition & 1 deletion assembly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>console-backend</artifactId>
<groupId>com.oracle.weblogic</groupId>
<version>2.4.6</version>
<version>2.4.7</version>
</parent>

<packaging>pom</packaging>
Expand Down
44 changes: 38 additions & 6 deletions build-electron.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
# Copyright 2021, 2023, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.

do_docker_pull() {
for i in 1 2 3
do
Expand Down Expand Up @@ -43,6 +46,7 @@ export ALREADY_IN_DOCKER=true
mkdir -p /root/.npm
chmod -R 777 /root
./build-electron.sh $*
chmod -R a+rw electron/dist
rm -rf /build.in/electron/dist
cp -rp electron/dist /build.in/electron
!
Expand Down Expand Up @@ -189,22 +193,38 @@ jlink --output "$extra"/customjre --no-header-files --no-man-pages --compress=2

mkdir -p "$extra"/backend
cp -rp ../runnable/* "$extra"/backend

buildtype=$1
# We allow the building of multiple variants on the image via a custom script.
# For example, if one wants to build a special version for the Memphis office,
# you can create electron/custom/memphis and invoke "build-electron.sh memphis".
if [ -f "custom/$1" -a -x "custom/$1" ]
cp -p package.json "$extra"
if [ -f "custom/$buildtype" -a -x "custom/$buildtype" ]
then
command="custom/$1"
rm -f electron-builder-custom.json
command="custom/$buildtype"
shift

"$command" "$extra"
else
cp -p package.json "$extra"
if [ -f electron-builder-custom.json ]
then
trap 'rm -f "$PWD/electron-builder-custom.json"' 0
set -- "$@" -c electron-builder-custom.json
fi
fi

./gen-messages "$extra"/resources/nls ../frontend/src/resources/nls/frontend*.properties

npm run dist "$@"
if [ "$os" = darwin ] && uname -a | grep -q arm64
then
set -- --arm64 "$@"
fi

while [ "$1" = -- ]
do
shift
done

"$(npm bin)/electron-builder" -p never "$@"

case "$os" in
darwin)
Expand Down Expand Up @@ -246,3 +266,15 @@ else
fi
esac
fi

# Restating from above, we allow the building of multiple variants on the image via a custom script.
# For example, if one wants to build a special version for the Memphis office,
# you can create electron/custom/memphis and invoke "build-electron.sh memphis".
#
# You can create electron/custom/memphis-post to post-process the build as well.
cp -p package.json "$extra"
if [ -f "custom/$buildtype-post" -a -x "custom/$buildtype-post" ]
then
command="custom/$buildtype-post"
"$command"
fi
2 changes: 1 addition & 1 deletion build-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.oracle.weblogic.console-backend</groupId>
<artifactId>build-tools</artifactId>
<version>2.4.6</version>
<version>2.4.7</version>
<name>Build Tools</name>

<properties>
Expand Down
111 changes: 89 additions & 22 deletions electron/app/js/auto-update-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,95 @@

'use strict';

const logger = require('./console-logger');
const { autoUpdater } = require('electron-updater');
const I18NUtils = require('./i18n-utils');
autoUpdater.autoDownload = false;
autoUpdater.allowDowngrade = true;
const { dialog } = require('electron');

let failed;
let _updateInfo;
let _window;
let downloadingDialogAbortController;

autoUpdater.on('error', error => {
failed = true;
if (downloadingDialogAbortController) {
downloadingDialogAbortController.abort();
// This is a little odd. We have to delay this slightly to allow the
// abort to close the "downloading" dialog before showing the "quit"
// dialog. electron doesn't allow the abort to work after the second
// dialog is started.
setTimeout(() => showError(error), 100);
}
else
showError(error);
});

(() => {
autoUpdater.autoDownload = false;
autoUpdater.allowDowngrade = true;
autoUpdater.on('update-downloaded', () => {
dialog.showMessageBox(
_window,
{
title: `${I18NUtils.get('wrc-electron.dialog.help.checkForUpdates.restartNow.message', getVersion())}`,
message: `${I18NUtils.get('wrc-electron.dialog.help.checkForUpdates.updateDownloaded.message')}`,
buttons: [ `${I18NUtils.get('wrc-common.buttons.restart.label')}`, `${I18NUtils.get('wrc-common.buttons.cancel.label')}` ],
type: 'info'
if (!failed) {
if (downloadingDialogAbortController) {
downloadingDialogAbortController.abort();
// This is a little odd. We have to delay this slightly to allow the
// abort to close the "downloading" dialog before showing the "quit"
// dialog. electron doesn't allow the abort to work after the second
// dialog is started.
setTimeout(() => showQuitDialog(), 100);
}
else {
showQuitDialog();
}
).then((choice) => {
if (choice.response === 0)
autoUpdater.quitAndInstall();
});
}
});
})();

const log = require('electron-log');

// We don't need the logging in a second file. We already have "console.log"
// going to a file.
log.transports.file.level = false;

// Make it match our logger (mostly)
log.transports.console.format = '{y}.{m}.{d} {h}:{i}:{s}.{ms} [{level}] {text}';

// Perhaps we'll use the same level for the auto updater as the rest, as below,
// but for now, let's leave logging level at the default (which is "silly") for
// now. A little extra logging couldn't hurt in this tricky area of the system.
// log.transports.console.level = logger.getLoggingLevel();

autoUpdater.logger = log;

function showError(error) {
dialog.showMessageBox(
_window,
{
title: `${I18NUtils.get('wrc-electron.menus.updates.downloadFailed.title')}`,
buttons: [ `${I18NUtils.get('wrc-common.buttons.ok.label')}` ],
type: 'info',
message: `${I18NUtils.get('wrc-electron.menus.updates.downloadFailed.message', error)}`
}
);
}

function showQuitDialog() {
dialog.showMessageBox(
_window,
{
title: `${I18NUtils.get('wrc-electron.dialog.help.checkForUpdates.restartNow.message', getVersion())}`,
message: `${I18NUtils.get('wrc-electron.dialog.help.checkForUpdates.updateDownloaded.message')}`,
buttons: [ `${I18NUtils.get('wrc-common.buttons.restart.label')}`, `${I18NUtils.get('wrc-common.buttons.cancel.label')}` ],
type: 'info'
}
).then((choice) => {
if (choice.response === 0) {
// There is an issue on the Mac with quitAndInstall inside the "on"
setTimeout(() => autoUpdater.quitAndInstall(), 100);
}
});
}

autoUpdater.on('update-available', (info) => {
_updateInfo = info;
});
Expand All @@ -48,18 +111,22 @@ function getVersion() {

async function doUpdate(window) {
_window = window;
downloadingDialogAbortController = new AbortController();
dialog.showMessageBox(
_window,
{
title: `${I18NUtils.get('wrc-electron.menus.updates.downloadStarted.title')}`,
buttons: [ `${I18NUtils.get('wrc-common.buttons.ok.label')}` ],
type: 'info',
signal: downloadingDialogAbortController.signal,
message: `${I18NUtils.get('wrc-electron.menus.updates.downloadStarted.message')}`
},
);
setTimeout(() => { downloadingDialogAbortController.abort(); downloadingDialogAbortController = null; }, 3000);
try {
await autoUpdater.downloadUpdate();
} catch (error) {
dialog.showMessageBox(
_window,
{
title: `${I18NUtils.get('wrc-electron.menus.updates.downloadFailed.title')}`,
buttons: [ `${I18NUtils.get('wrc-common.buttons.ok.label')}` ],
type: 'info',
message: `${I18NUtils.get('wrc-electron.menus.updates.downloadFailed.message', error)}`
}
);
showError(error);
}
}

Expand Down
5 changes: 5 additions & 0 deletions electron/app/js/console-logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ function setLoggingLevel(level) {
_loggingLevel = level;
}

function getLoggingLevel() {
return _loggingLevel;
}

function setOptions(options) {
if (options) {
if (options.loggingLevel) _loggingLevel = options.loggingLevel;
Expand Down Expand Up @@ -191,5 +195,6 @@ module.exports = {
log,
getLogLevels,
setLoggingLevel,
getLoggingLevel,
setOptions
};
1 change: 1 addition & 0 deletions electron/app/js/ipcRendererPreload.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ contextBridge.exposeInMainWorld(
},
invoke: async (channel, arg) => {
const validChannels = [
'external-url-opening',
'translated-strings-sending',
'complete-login',
'perform-login',
Expand Down
12 changes: 6 additions & 6 deletions electron/app/js/user-prefs-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,22 +127,22 @@ const UserPrefs = (() => {
key: 'appExit',
type: 'radio',
options: [
{label: `${I18NUtils.get('wrc-electron.menus.preferences.no')}`, value: true},
{label: `${I18NUtils.get('wrc-electron.menus.preferences.yes')}`, value: false}
{label: `${I18NUtils.get('wrc-electron.menus.preferences.yes')}`, value: true },
{label: `${I18NUtils.get('wrc-electron.menus.preferences.no')}`, value: false }
]
},
{
// The preference is currently used, but can occur in
// various situations. For now, we'll have the property
// and use it in the code, but not show it or try to explain it.
label: `${I18NUtils.get('wrc-electron.menus.preferences.section.unsaved-confirmation.unload.label')}`,
help: `${I18NUtils.get('wrc-electron.menus.preferences.section.unsaved-confirmation.unload.help')}`,
label: 'This is disabled for now',
help: 'This is disabled for now',
hideFunction: () => { return true; },
key: 'unload',
type: 'radio',
options: [
{label: `${I18NUtils.get('wrc-electron.menus.preferences.no')}`, value: true},
{label: `${I18NUtils.get('wrc-electron.menus.preferences.yes')}`, value: false}
{label: `${I18NUtils.get('wrc-electron.menus.preferences.yes')}`, value: false},
{label: `${I18NUtils.get('wrc-electron.menus.preferences.no')}`, value: true}
]
}
]
Expand Down
Loading

0 comments on commit 3c47c20

Please # to comment.