Skip to content

Commit 8654266

Browse files
committed
Merge branch 'develop' into alpha
Signed-off-by: Pawel Psztyc <[email protected]>
2 parents 0e6dd28 + 62971f6 commit 8654266

File tree

10 files changed

+654
-290
lines changed

10 files changed

+654
-290
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"requestloadstart",
2727
"resetzoom",
2828
"restclient",
29+
"robotomono",
2930
"screenview",
3031
"selectall",
3132
"settingschanged",

appresources/themes/@advanced-rest-client/arc-electron-dark-theme/arc-electron-dark-theme.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,5 +269,5 @@ html {
269269
body {
270270
background-color: var(--secondary-background-color);
271271
color: var(--primary-text-color);
272-
--arc-font-code-family: Noto, monospace;
272+
--arc-font-code-family: Roboto Mono, Noto, monospace;
273273
}

appresources/themes/@advanced-rest-client/arc-electron-dark-theme/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@advanced-rest-client/arc-electron-dark-theme",
33
"description": "Dark theme definition for Advanced REST Client",
4-
"version": "4.0.3",
4+
"version": "4.0.4",
55
"license": "Apache-2.0",
66
"main": "arc-electron-dark-theme.css",
77
"keywords": [

appresources/themes/@advanced-rest-client/arc-electron-default-theme/arc-electron-default-theme.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ body {
99
--code-mirror-background-color: #f5f5f5;
1010
--anypoint-dropdown-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
1111
--anypoint-autocomplete-dropdown-shadow: var(--anypoint-dropdown-shadow);
12+
--arc-font-code-family: Roboto Mono, Noto, monospace;
1213

1314
--request-editor-url-area-background-color: #e4e4e4;
1415
--url-input-editor-border-color: #e5e5ee;

appresources/themes/@advanced-rest-client/arc-electron-default-theme/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@advanced-rest-client/arc-electron-default-theme",
33
"description": "Default theme definition for Advanced REST Client",
4-
"version": "4.0.0",
4+
"version": "4.0.1",
55
"license": "Apache-2.0",
66
"main": "arc-electron-default-theme.css",
77
"keywords": [

package-lock.json

Lines changed: 587 additions & 276 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,18 @@
3939
"@advanced-rest-client/arc-environment": "^0.1.6",
4040
"@advanced-rest-client/arc-headers": "^0.1.7",
4141
"@advanced-rest-client/arc-icons": "^3.3.0",
42-
"@advanced-rest-client/arc-ie": "^1.0.4",
42+
"@advanced-rest-client/arc-ie": "^1.0.5",
4343
"@advanced-rest-client/arc-menu": "^4.1.1",
4444
"@advanced-rest-client/arc-messages": "^0.1.0",
45-
"@advanced-rest-client/arc-models": "^4.2.10",
45+
"@advanced-rest-client/arc-models": "^4.2.12",
4646
"@advanced-rest-client/arc-project": "^0.1.0",
47-
"@advanced-rest-client/arc-request-ui": "^0.1.11",
47+
"@advanced-rest-client/arc-request-ui": "^0.1.12",
4848
"@advanced-rest-client/arc-settings": "^0.1.2",
4949
"@advanced-rest-client/bottom-sheet": "^3.2.2",
5050
"@advanced-rest-client/client-certificates": "^0.1.1",
5151
"@advanced-rest-client/exchange-search-panel": "^4.0.0",
52+
"@advanced-rest-client/google-drive-browser": "^4.0.0",
53+
"@advanced-rest-client/host-rules-editor": "^4.0.0",
5254
"@advanced-rest-client/monaco-support": "^1.0.1",
5355
"@advanced-rest-client/pouchdb-quick-search": "^2.0.3",
5456
"@advanced-rest-client/request-engine": "^0.1.11",
@@ -97,8 +99,6 @@
9799
"@advanced-rest-client/electron-amf-service": "^5.0.0",
98100
"@advanced-rest-client/electron-oauth2": "^5.0.4",
99101
"@advanced-rest-client/electron-request": "^3.1.1",
100-
"@advanced-rest-client/google-drive-browser": "^4.0.0",
101-
"@advanced-rest-client/host-rules-editor": "^4.0.0",
102102
"camelcase": "^6.2.0",
103103
"electron-log": "^4.3.1",
104104
"electron-prompt": "^1.6.1",
@@ -307,6 +307,7 @@
307307
"lit-element/lib/*",
308308
"@polymer/font-roboto-local/roboto.js",
309309
"@polymer/font-roboto-local/fonts/roboto/*",
310+
"@polymer/font-roboto-local/fonts/robotomono/*",
310311
"marked/lib/marked.js",
311312
"@anypoint-web-components/anypoint-dialog/index.js",
312313
"@anypoint-web-components/anypoint-dialog/index.d.ts",

src/app/scripts/arc/AdvancedRestClientApplication.js

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ document.adoptedStyleSheets = document.adoptedStyleSheets.concat(ContextMenuStyl
9090
/** @typedef {import('@advanced-rest-client/arc-types').Authorization.OAuth2Authorization} OAuth2Authorization */
9191
/** @typedef {import('@advanced-rest-client/electron-amf-service/types').ApiParseResult} ApiParseResult */
9292
/** @typedef {import('@advanced-rest-client/exchange-search-panel/src/types').ExchangeAsset} ExchangeAsset */
93+
/** @typedef {import('electron-updater').UpdateInfo} UpdateInfo */
9394

9495
const unhandledRejectionHandler = Symbol('unhandledRejectionHandler');
9596
const headerTemplate = Symbol('headerTemplate');
@@ -154,6 +155,8 @@ const unreadMessagesTemplate = Symbol('unreadMessagesTemplate');
154155
const appMessagesDialogTemplate = Symbol('appMessagesDialogTemplate');
155156
const openMessagesHandler = Symbol('openMessagesHandler');
156157
const arcLegacyProjectTemplate = Symbol('arcLegacyProjectTemplate');
158+
const updateIndicatorTemplate = Symbol('updateIndicatorTemplate');
159+
const updateClickHandler = Symbol('updateClickHandler');
157160

158161
/**
159162
* A routes that does not go through the router and should not be remembered in the history.
@@ -331,7 +334,7 @@ export class AdvancedRestClientApplication extends ApplicationPage {
331334
this.initObservableProperties(
332335
'route', 'routeParams', 'initializing', 'loadingStatus',
333336
'compatibility', 'oauth2RedirectUri',
334-
'navigationDetached', 'updateState', 'hasAppUpdate',
337+
'navigationDetached', 'updateState', 'hasAppUpdate', 'manualUpdateAvailable', 'updateVersion',
335338
'popupMenuEnabled', 'draggableEnabled', 'historyEnabled',
336339
'listType', 'detailedSearch', 'currentEnvironment',
337340
'workspaceSendButton', 'workspaceProgressInfo', 'workspaceBodyEditor', 'workspaceAutoEncode',
@@ -382,6 +385,10 @@ export class AdvancedRestClientApplication extends ApplicationPage {
382385
* Whether application update is available.
383386
*/
384387
this.hasAppUpdate = false;
388+
/**
389+
* Set whe an update is available but it has to be triggered manually.
390+
*/
391+
this.manualUpdateAvailable = false;
385392
/**
386393
* The current state of checking for update.
387394
* @type {string}
@@ -620,9 +627,18 @@ export class AdvancedRestClientApplication extends ApplicationPage {
620627
this.logger.info('Checking for application update');
621628
this.updateState = 'checking-for-update';
622629
});
623-
ipc.on('update-available', () => {
630+
ipc.on('update-available',
631+
/**
632+
* @param {Electron.IpcRendererEvent} e
633+
* @param {UpdateInfo} info
634+
*/
635+
(e, info) => {
636+
this.updateVersion = info.version;
624637
this.logger.info('Application update available.');
625638
this.updateState = 'update-available';
639+
if (process.platform === 'linux' || this.config.updater && this.config.updater.auto === false) {
640+
this.manualUpdateAvailable = true;
641+
}
626642
});
627643
ipc.on('update-not-available', () => {
628644
this.logger.info('Application update not available.');
@@ -1361,6 +1377,23 @@ export class AdvancedRestClientApplication extends ApplicationPage {
13611377
this.unreadAppMessages = 0;
13621378
}
13631379

1380+
/**
1381+
* A handler for the application update notification click.
1382+
* It installs the update when manual installation is not requested.
1383+
* If manual installation is requested then it opens the release page.
1384+
*/
1385+
[updateClickHandler]() {
1386+
const { manualUpdateAvailable, hasAppUpdate } = this;
1387+
if (manualUpdateAvailable) {
1388+
const { updateVersion } = this;
1389+
const base = 'https://github.com/advanced-rest-client/arc-electron/releases/tag';
1390+
const url = `${base}/v${updateVersion}`;
1391+
ipc.send('open-external-url', url);
1392+
} else if (hasAppUpdate) {
1393+
ipc.send('install-update');
1394+
}
1395+
}
1396+
13641397
appTemplate() {
13651398
const { initializing } = this;
13661399
if (initializing) {
@@ -1406,11 +1439,26 @@ export class AdvancedRestClientApplication extends ApplicationPage {
14061439
</anypoint-icon-button>`}
14071440
API Client
14081441
<span class="spacer"></span>
1442+
${this[updateIndicatorTemplate]()}
14091443
${this[unreadMessagesTemplate]()}
14101444
${this[environmentTemplate]()}
14111445
</header>`;
14121446
}
14131447

1448+
/**
1449+
* @returns {TemplateResult|string} The template for the app update indicator
1450+
*/
1451+
[updateIndicatorTemplate]() {
1452+
const { manualUpdateAvailable, hasAppUpdate } = this;
1453+
if (!manualUpdateAvailable && !hasAppUpdate) {
1454+
return '';
1455+
}
1456+
return html`
1457+
<anypoint-icon-button title="Application update available" class="header-action-button" @click="${this[updateClickHandler]}">
1458+
<arc-icon icon="cloudDownload"></arc-icon>
1459+
</anypoint-icon-button>`;
1460+
}
1461+
14141462
/**
14151463
* @returns {TemplateResult|string} The template for the unread notifications icon button
14161464
*/

src/app/styles/about.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ h1 {
3333
flex-direction: row;
3434
align-items: center;
3535
font-size: 18px;
36-
color: var(--about-arc-version-label-color, rgba(0, 0, 0, 0.74));
36+
color: var(--about-arc-version-label-color, --secondary-text-color);
3737
}
3838

3939
.version {
@@ -43,8 +43,8 @@ h1 {
4343
border-right: 1px var(--about-arc-version-section-border-right-color, rgba(0, 0, 0, 0.14)) solid;
4444
}
4545

46-
.version-meta a {
47-
color: inherit;
46+
a {
47+
color: var(--link-color, inherit);
4848
text-decoration: inherit;
4949
}
5050

@@ -61,7 +61,7 @@ h1 {
6161
width: 100%;
6262
max-width: 700px;
6363
margin: 40px auto;
64-
background-color: var(--about-arc-updates-section-background-color, #fff);
64+
background-color: var(--about-arc-updates-section-background-color, --primary-background-color);
6565
padding: 24px;
6666
border: 1px var(--about-arc-updates-section-border-color, #e5e5e5) solid;
6767
}

src/preload/arc-preload.esm.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { GoogleAnalytics } from './GoogleAnalytics.js';
1818

1919
const env = {};
2020
const APP_VERSION = process.env.ARC_VERSION;
21+
const PLATFORM = process.platform;
2122
Object.keys(process.env).forEach((key) => {
2223
if (key.indexOf('npm_') === 0 || key.indexOf('ARC_') === 0) {
2324
return;
@@ -70,6 +71,7 @@ process.once('loaded', () => {
7071
global.process = {
7172
// @ts-ignore
7273
env,
74+
platform: PLATFORM,
7375
};
7476

7577
// @ts-ignore

0 commit comments

Comments
 (0)