From 25a0e1cbbc808754685cdb66fe60b646fa21c7b9 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Mon, 22 Feb 2021 15:07:44 -0500 Subject: [PATCH 1/8] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20use=20electron's?= =?UTF-8?q?=20net=20request=20instead=20of=20axios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/desktop/electron-app/src/origin.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/ui/desktop/electron-app/src/origin.js b/ui/desktop/electron-app/src/origin.js index 7d85e4466..967b9aebc 100644 --- a/ui/desktop/electron-app/src/origin.js +++ b/ui/desktop/electron-app/src/origin.js @@ -1,4 +1,28 @@ const axios = require('axios'); +const { net } = require('electron') + +const requestTimeoutSeconds = 10; +// Simple promise wrapper around Electron's net.request feature. +// https://www.electronjs.org/docs/api/client-request +const netRequestPromise = url => new Promise((resolve, reject) => { + try { + const request = net.request(url); + // We don't worry about canceling the request timeout timer once a + // request ends because: request.abort() has no effect after a request + // ends and the promise will already have been completed, so a rejection + // has no effect either. + const requestTimeout = + setTimeout(() => { + request.abort(); + reject(new Error('Request timeout')); + }, requestTimeoutSeconds * 1000); + request.on('error', reject); + request.on('response', resolve); + request.end(); + } catch (e) { + reject(e); + } +}); // Provides a singleton class instance to enable a consistent view of // runtime settings across the application. @@ -34,7 +58,8 @@ class RuntimeSettings { // test to see if the origin is API-compatible with the desktop client. const scopesEndpoint = `${origin}/v1/scopes`; try { - await axios.get(scopesEndpoint) + await netRequestPromise(scopesEndpoint); + //await axios.get(scopesEndpoint); } catch (e) { throw new Error(`Origin ${origin} could not be validated.`); } From 6f9fa06d113e2c29224992433d18f4402a17b3cb Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Mon, 22 Feb 2021 15:18:01 -0500 Subject: [PATCH 2/8] =?UTF-8?q?chore:=20=F0=9F=A4=96=20remove=20axios=20de?= =?UTF-8?q?pendency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/desktop/electron-app/package.json | 1 - ui/desktop/electron-app/src/origin.js | 2 -- ui/desktop/electron-app/yarn.lock | 12 ------------ 3 files changed, 15 deletions(-) diff --git a/ui/desktop/electron-app/package.json b/ui/desktop/electron-app/package.json index 69caf84b0..931719eb8 100644 --- a/ui/desktop/electron-app/package.json +++ b/ui/desktop/electron-app/package.json @@ -21,7 +21,6 @@ "forge": "config/forge.config.js" }, "dependencies": { - "axios": "^0.21.1", "electron-devtools-installer": "^3.1.1", "electron-is-dev": "^1.2.0", "electron-squirrel-startup": "^1.0.0", diff --git a/ui/desktop/electron-app/src/origin.js b/ui/desktop/electron-app/src/origin.js index 967b9aebc..cdb640cd2 100644 --- a/ui/desktop/electron-app/src/origin.js +++ b/ui/desktop/electron-app/src/origin.js @@ -1,4 +1,3 @@ -const axios = require('axios'); const { net } = require('electron') const requestTimeoutSeconds = 10; @@ -59,7 +58,6 @@ class RuntimeSettings { const scopesEndpoint = `${origin}/v1/scopes`; try { await netRequestPromise(scopesEndpoint); - //await axios.get(scopesEndpoint); } catch (e) { throw new Error(`Origin ${origin} could not be validated.`); } diff --git a/ui/desktop/electron-app/yarn.lock b/ui/desktop/electron-app/yarn.lock index f885d02d3..b33789d73 100644 --- a/ui/desktop/electron-app/yarn.lock +++ b/ui/desktop/electron-app/yarn.lock @@ -494,13 +494,6 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== -axios@^0.21.1: - version "0.21.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" - integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA== - dependencies: - follow-redirects "^1.10.0" - balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" @@ -1335,11 +1328,6 @@ fmix@^0.1.0: dependencies: imul "^1.0.0" -follow-redirects@^1.10.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.1.tgz#5f69b813376cee4fd0474a3aba835df04ab763b7" - integrity sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg== - forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" From 388a146cda6d98a492a604f9498717d9f9a058d0 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Mon, 22 Feb 2021 15:24:16 -0500 Subject: [PATCH 3/8] chore: update changelog --- ui/desktop/CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ui/desktop/CHANGELOG.md b/ui/desktop/CHANGELOG.md index 1627a2137..cee2b0afe 100644 --- a/ui/desktop/CHANGELOG.md +++ b/ui/desktop/CHANGELOG.md @@ -3,6 +3,12 @@ Canonical reference for changes, improvements, and bugfixes for Boundary Desktop. +## Next + +### Changes/Deprecations + +- Boundary origin validation now occurs via Electron's built-in net request module, ensuring the validation request is made via chromium's networking library rather than Node's. ([PR](https://github.com/hashicorp/boundary-ui/pull/480)) + ## v1.0.0-alpha (2021.02.16) v1.0.0-alpha is the first release of Boundary Desktop. As a result there are no changes, improvements, or bugfixes from past versions. From 80d6eda2283ec3b305464bdbeaf269aa46dbff89 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 24 Feb 2021 10:49:19 -0500 Subject: [PATCH 4/8] =?UTF-8?q?style:=20=F0=9F=92=84=20scroll=20only=20wit?= =?UTF-8?q?hin=20columns=20so=20header=20remains=20visible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/desktop/app/styles/app.scss | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/ui/desktop/app/styles/app.scss b/ui/desktop/app/styles/app.scss index d361d91f6..be3610b51 100644 --- a/ui/desktop/app/styles/app.scss +++ b/ui/desktop/app/styles/app.scss @@ -19,6 +19,25 @@ } } +/** + * This section enables scrolling within the sidebar columns separately, + * rather than the whole viewport. This ensures the sidebar and application + * header remain visible when scrolling. + */ +.rose-layout-global { + max-height: 100vh; + + .rose-layout-global-body { + max-height: 100vh; + overflow: hidden; + } + + .rose-layout-sidebar-sidebar, + .rose-layout-sidebar-body { + overflow-y: scroll; + } +} + .rose-nav-sidebar { margin-top: sizing.rems(xxl); @@ -167,7 +186,7 @@ 0% { background-color: var(--action-subtler-1); } - + 100% { background-color: transparent; } From d61faa93383f2312831544e40225613f97b09585 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 24 Feb 2021 10:50:32 -0500 Subject: [PATCH 5/8] docs: add scrolling changelog entry --- ui/desktop/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/desktop/CHANGELOG.md b/ui/desktop/CHANGELOG.md index cee2b0afe..c4a85ba0a 100644 --- a/ui/desktop/CHANGELOG.md +++ b/ui/desktop/CHANGELOG.md @@ -7,6 +7,7 @@ Canonical reference for changes, improvements, and bugfixes for Boundary Desktop ### Changes/Deprecations +- Scrolling now occurs within columns individually so that sidebar and header remain visible when scrolling the application body. - Boundary origin validation now occurs via Electron's built-in net request module, ensuring the validation request is made via chromium's networking library rather than Node's. ([PR](https://github.com/hashicorp/boundary-ui/pull/480)) ## v1.0.0-alpha (2021.02.16) From 32b64106185b85404f3bc1fdb26ad6ab5290f226 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 24 Feb 2021 10:52:08 -0500 Subject: [PATCH 6/8] docs: add changelog PR link --- ui/desktop/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/desktop/CHANGELOG.md b/ui/desktop/CHANGELOG.md index c4a85ba0a..a781b57db 100644 --- a/ui/desktop/CHANGELOG.md +++ b/ui/desktop/CHANGELOG.md @@ -7,7 +7,7 @@ Canonical reference for changes, improvements, and bugfixes for Boundary Desktop ### Changes/Deprecations -- Scrolling now occurs within columns individually so that sidebar and header remain visible when scrolling the application body. +- Scrolling now occurs within columns individually so that sidebar and header remain visible when scrolling the application body. ([PR](https://github.com/hashicorp/boundary-ui/pull/482)) - Boundary origin validation now occurs via Electron's built-in net request module, ensuring the validation request is made via chromium's networking library rather than Node's. ([PR](https://github.com/hashicorp/boundary-ui/pull/480)) ## v1.0.0-alpha (2021.02.16) From 9dfb07e1cd5b73d094456dee2bfb350311d6e74b Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 24 Feb 2021 10:53:17 -0500 Subject: [PATCH 7/8] docs: move scrolling changelog entry to new and improved section --- ui/desktop/CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/desktop/CHANGELOG.md b/ui/desktop/CHANGELOG.md index a781b57db..6491ca19a 100644 --- a/ui/desktop/CHANGELOG.md +++ b/ui/desktop/CHANGELOG.md @@ -5,9 +5,12 @@ Canonical reference for changes, improvements, and bugfixes for Boundary Desktop ## Next -### Changes/Deprecations +### New & Improved - Scrolling now occurs within columns individually so that sidebar and header remain visible when scrolling the application body. ([PR](https://github.com/hashicorp/boundary-ui/pull/482)) + +### Changes/Deprecations + - Boundary origin validation now occurs via Electron's built-in net request module, ensuring the validation request is made via chromium's networking library rather than Node's. ([PR](https://github.com/hashicorp/boundary-ui/pull/480)) ## v1.0.0-alpha (2021.02.16) From 740964f66f74268e727793991360bc942761c695 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Thu, 25 Feb 2021 12:58:17 -0500 Subject: [PATCH 8/8] =?UTF-8?q?chore:=20=F0=9F=A4=96=20tweak=20desktop=20s?= =?UTF-8?q?vg=20bg=20accent=20color=20to=20match=20brand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/desktop/public/brand-background.svg | 42 +++++++++++++------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/ui/desktop/public/brand-background.svg b/ui/desktop/public/brand-background.svg index 050bb59e7..1896291af 100644 --- a/ui/desktop/public/brand-background.svg +++ b/ui/desktop/public/brand-background.svg @@ -9,64 +9,64 @@ - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - + - + - + - +