Skip to content

Commit dface38

Browse files
authored
Merge pull request #62 from oracle/release-2.4.7
Release 2.4.7
2 parents 603f46d + 7f02651 commit dface38

File tree

153 files changed

+3573
-6894
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+3573
-6894
lines changed

THIRD_PARTY_LICENSES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,6 +1769,9 @@ Copyright (c) 2014 The cheeriojs contributors
17691769
ee-first
17701770
Copyright (c) 2014 Jonathan Ong [email protected]
17711771

1772+
electron-log
1773+
Copyright (c) 2016 Alexey Prokhorov
1774+
17721775
electron-preferences
17731776
Copyright 2019 Tim Ambler <[email protected]>
17741777

assembly/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<artifactId>console-backend</artifactId>
1111
<groupId>com.oracle.weblogic</groupId>
12-
<version>2.4.6</version>
12+
<version>2.4.7</version>
1313
</parent>
1414

1515
<packaging>pom</packaging>

build-electron.sh

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/bin/bash
2+
# Copyright 2021, 2023, Oracle and/or its affiliates.
3+
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
4+
25
do_docker_pull() {
36
for i in 1 2 3
47
do
@@ -43,6 +46,7 @@ export ALREADY_IN_DOCKER=true
4346
mkdir -p /root/.npm
4447
chmod -R 777 /root
4548
./build-electron.sh $*
49+
chmod -R a+rw electron/dist
4650
rm -rf /build.in/electron/dist
4751
cp -rp electron/dist /build.in/electron
4852
!
@@ -189,22 +193,38 @@ jlink --output "$extra"/customjre --no-header-files --no-man-pages --compress=2
189193

190194
mkdir -p "$extra"/backend
191195
cp -rp ../runnable/* "$extra"/backend
196+
197+
buildtype=$1
192198
# We allow the building of multiple variants on the image via a custom script.
193199
# For example, if one wants to build a special version for the Memphis office,
194200
# you can create electron/custom/memphis and invoke "build-electron.sh memphis".
195-
if [ -f "custom/$1" -a -x "custom/$1" ]
201+
cp -p package.json "$extra"
202+
if [ -f "custom/$buildtype" -a -x "custom/$buildtype" ]
196203
then
197-
command="custom/$1"
204+
rm -f electron-builder-custom.json
205+
command="custom/$buildtype"
198206
shift
199-
200207
"$command" "$extra"
201-
else
202-
cp -p package.json "$extra"
208+
if [ -f electron-builder-custom.json ]
209+
then
210+
trap 'rm -f "$PWD/electron-builder-custom.json"' 0
211+
set -- "$@" -c electron-builder-custom.json
212+
fi
203213
fi
204214

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

207-
npm run dist "$@"
217+
if [ "$os" = darwin ] && uname -a | grep -q arm64
218+
then
219+
set -- --arm64 "$@"
220+
fi
221+
222+
while [ "$1" = -- ]
223+
do
224+
shift
225+
done
226+
227+
"$(npm bin)/electron-builder" -p never "$@"
208228

209229
case "$os" in
210230
darwin)
@@ -246,3 +266,15 @@ else
246266
fi
247267
esac
248268
fi
269+
270+
# Restating from above, we allow the building of multiple variants on the image via a custom script.
271+
# For example, if one wants to build a special version for the Memphis office,
272+
# you can create electron/custom/memphis and invoke "build-electron.sh memphis".
273+
#
274+
# You can create electron/custom/memphis-post to post-process the build as well.
275+
cp -p package.json "$extra"
276+
if [ -f "custom/$buildtype-post" -a -x "custom/$buildtype-post" ]
277+
then
278+
command="custom/$buildtype-post"
279+
"$command"
280+
fi

build-tools/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.oracle.weblogic.console-backend</groupId>
88
<artifactId>build-tools</artifactId>
9-
<version>2.4.6</version>
9+
<version>2.4.7</version>
1010
<name>Build Tools</name>
1111

1212
<properties>

electron/app/js/auto-update-utils.js

Lines changed: 89 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,95 @@
77

88
'use strict';
99

10+
const logger = require('./console-logger');
1011
const { autoUpdater } = require('electron-updater');
1112
const I18NUtils = require('./i18n-utils');
13+
autoUpdater.autoDownload = false;
14+
autoUpdater.allowDowngrade = true;
1215
const { dialog } = require('electron');
1316

17+
let failed;
1418
let _updateInfo;
1519
let _window;
20+
let downloadingDialogAbortController;
21+
22+
autoUpdater.on('error', error => {
23+
failed = true;
24+
if (downloadingDialogAbortController) {
25+
downloadingDialogAbortController.abort();
26+
// This is a little odd. We have to delay this slightly to allow the
27+
// abort to close the "downloading" dialog before showing the "quit"
28+
// dialog. electron doesn't allow the abort to work after the second
29+
// dialog is started.
30+
setTimeout(() => showError(error), 100);
31+
}
32+
else
33+
showError(error);
34+
});
1635

1736
(() => {
18-
autoUpdater.autoDownload = false;
19-
autoUpdater.allowDowngrade = true;
2037
autoUpdater.on('update-downloaded', () => {
21-
dialog.showMessageBox(
22-
_window,
23-
{
24-
title: `${I18NUtils.get('wrc-electron.dialog.help.checkForUpdates.restartNow.message', getVersion())}`,
25-
message: `${I18NUtils.get('wrc-electron.dialog.help.checkForUpdates.updateDownloaded.message')}`,
26-
buttons: [ `${I18NUtils.get('wrc-common.buttons.restart.label')}`, `${I18NUtils.get('wrc-common.buttons.cancel.label')}` ],
27-
type: 'info'
38+
if (!failed) {
39+
if (downloadingDialogAbortController) {
40+
downloadingDialogAbortController.abort();
41+
// This is a little odd. We have to delay this slightly to allow the
42+
// abort to close the "downloading" dialog before showing the "quit"
43+
// dialog. electron doesn't allow the abort to work after the second
44+
// dialog is started.
45+
setTimeout(() => showQuitDialog(), 100);
46+
}
47+
else {
48+
showQuitDialog();
2849
}
29-
).then((choice) => {
30-
if (choice.response === 0)
31-
autoUpdater.quitAndInstall();
32-
});
50+
}
3351
});
3452
})();
3553

54+
const log = require('electron-log');
55+
56+
// We don't need the logging in a second file. We already have "console.log"
57+
// going to a file.
58+
log.transports.file.level = false;
59+
60+
// Make it match our logger (mostly)
61+
log.transports.console.format = '{y}.{m}.{d} {h}:{i}:{s}.{ms} [{level}] {text}';
62+
63+
// Perhaps we'll use the same level for the auto updater as the rest, as below,
64+
// but for now, let's leave logging level at the default (which is "silly") for
65+
// now. A little extra logging couldn't hurt in this tricky area of the system.
66+
// log.transports.console.level = logger.getLoggingLevel();
67+
68+
autoUpdater.logger = log;
69+
70+
function showError(error) {
71+
dialog.showMessageBox(
72+
_window,
73+
{
74+
title: `${I18NUtils.get('wrc-electron.menus.updates.downloadFailed.title')}`,
75+
buttons: [ `${I18NUtils.get('wrc-common.buttons.ok.label')}` ],
76+
type: 'info',
77+
message: `${I18NUtils.get('wrc-electron.menus.updates.downloadFailed.message', error)}`
78+
}
79+
);
80+
}
81+
82+
function showQuitDialog() {
83+
dialog.showMessageBox(
84+
_window,
85+
{
86+
title: `${I18NUtils.get('wrc-electron.dialog.help.checkForUpdates.restartNow.message', getVersion())}`,
87+
message: `${I18NUtils.get('wrc-electron.dialog.help.checkForUpdates.updateDownloaded.message')}`,
88+
buttons: [ `${I18NUtils.get('wrc-common.buttons.restart.label')}`, `${I18NUtils.get('wrc-common.buttons.cancel.label')}` ],
89+
type: 'info'
90+
}
91+
).then((choice) => {
92+
if (choice.response === 0) {
93+
// There is an issue on the Mac with quitAndInstall inside the "on"
94+
setTimeout(() => autoUpdater.quitAndInstall(), 100);
95+
}
96+
});
97+
}
98+
3699
autoUpdater.on('update-available', (info) => {
37100
_updateInfo = info;
38101
});
@@ -48,18 +111,22 @@ function getVersion() {
48111

49112
async function doUpdate(window) {
50113
_window = window;
114+
downloadingDialogAbortController = new AbortController();
115+
dialog.showMessageBox(
116+
_window,
117+
{
118+
title: `${I18NUtils.get('wrc-electron.menus.updates.downloadStarted.title')}`,
119+
buttons: [ `${I18NUtils.get('wrc-common.buttons.ok.label')}` ],
120+
type: 'info',
121+
signal: downloadingDialogAbortController.signal,
122+
message: `${I18NUtils.get('wrc-electron.menus.updates.downloadStarted.message')}`
123+
},
124+
);
125+
setTimeout(() => { downloadingDialogAbortController.abort(); downloadingDialogAbortController = null; }, 3000);
51126
try {
52127
await autoUpdater.downloadUpdate();
53128
} catch (error) {
54-
dialog.showMessageBox(
55-
_window,
56-
{
57-
title: `${I18NUtils.get('wrc-electron.menus.updates.downloadFailed.title')}`,
58-
buttons: [ `${I18NUtils.get('wrc-common.buttons.ok.label')}` ],
59-
type: 'info',
60-
message: `${I18NUtils.get('wrc-electron.menus.updates.downloadFailed.message', error)}`
61-
}
62-
);
129+
showError(error);
63130
}
64131
}
65132

electron/app/js/console-logger.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ function setLoggingLevel(level) {
149149
_loggingLevel = level;
150150
}
151151

152+
function getLoggingLevel() {
153+
return _loggingLevel;
154+
}
155+
152156
function setOptions(options) {
153157
if (options) {
154158
if (options.loggingLevel) _loggingLevel = options.loggingLevel;
@@ -191,5 +195,6 @@ module.exports = {
191195
log,
192196
getLogLevels,
193197
setLoggingLevel,
198+
getLoggingLevel,
194199
setOptions
195200
};

electron/app/js/ipcRendererPreload.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ contextBridge.exposeInMainWorld(
3939
},
4040
invoke: async (channel, arg) => {
4141
const validChannels = [
42+
'external-url-opening',
4243
'translated-strings-sending',
4344
'complete-login',
4445
'perform-login',

electron/app/js/user-prefs-json.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,22 +127,22 @@ const UserPrefs = (() => {
127127
key: 'appExit',
128128
type: 'radio',
129129
options: [
130-
{label: `${I18NUtils.get('wrc-electron.menus.preferences.no')}`, value: true},
131-
{label: `${I18NUtils.get('wrc-electron.menus.preferences.yes')}`, value: false}
130+
{label: `${I18NUtils.get('wrc-electron.menus.preferences.yes')}`, value: true },
131+
{label: `${I18NUtils.get('wrc-electron.menus.preferences.no')}`, value: false }
132132
]
133133
},
134134
{
135135
// The preference is currently used, but can occur in
136136
// various situations. For now, we'll have the property
137137
// and use it in the code, but not show it or try to explain it.
138-
label: `${I18NUtils.get('wrc-electron.menus.preferences.section.unsaved-confirmation.unload.label')}`,
139-
help: `${I18NUtils.get('wrc-electron.menus.preferences.section.unsaved-confirmation.unload.help')}`,
138+
label: 'This is disabled for now',
139+
help: 'This is disabled for now',
140140
hideFunction: () => { return true; },
141141
key: 'unload',
142142
type: 'radio',
143143
options: [
144-
{label: `${I18NUtils.get('wrc-electron.menus.preferences.no')}`, value: true},
145-
{label: `${I18NUtils.get('wrc-electron.menus.preferences.yes')}`, value: false}
144+
{label: `${I18NUtils.get('wrc-electron.menus.preferences.yes')}`, value: false},
145+
{label: `${I18NUtils.get('wrc-electron.menus.preferences.no')}`, value: true}
146146
]
147147
}
148148
]

0 commit comments

Comments
 (0)