From e4f43941979557315564b3dc8963fe62ad8e10e0 Mon Sep 17 00:00:00 2001 From: Zhihe Li Date: Wed, 14 Aug 2024 13:26:35 -0400 Subject: [PATCH] Icu 14403 add dropdown to select and save log verbosity (#2431) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 🎸 Add logging settings card ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-14403 --- addons/core/translations/en-us.yaml | 20 ++- .../settings-card/application/index.hbs | 80 ++++----- .../components/settings-card/logs/index.hbs | 33 ++++ .../components/settings-card/logs/index.js | 25 +++ .../components/settings-card/user/index.hbs | 32 ++-- .../scopes/scope/projects/settings/index.js | 24 ++- ui/desktop/app/styles/app.scss | 34 ++-- .../scopes/scope/projects/settings/index.hbs | 3 +- ui/desktop/electron-app/package.json | 1 + ui/desktop/electron-app/src/index.js | 3 +- ui/desktop/electron-app/src/ipc/handlers.js | 34 +++- .../src/services/electron-store-manager.js | 20 +++ ui/desktop/electron-app/yarn.lock | 168 ++++++++++++++---- .../components/settings-card-test.js | 43 +---- .../components/settings-card/logs-test.js | 49 +++++ .../components/settings-card/user-test.js | 79 ++++++++ 16 files changed, 481 insertions(+), 167 deletions(-) create mode 100644 ui/desktop/app/components/settings-card/logs/index.hbs create mode 100644 ui/desktop/app/components/settings-card/logs/index.js create mode 100644 ui/desktop/electron-app/src/services/electron-store-manager.js create mode 100644 ui/desktop/tests/integration/components/settings-card/logs-test.js create mode 100644 ui/desktop/tests/integration/components/settings-card/user-test.js diff --git a/addons/core/translations/en-us.yaml b/addons/core/translations/en-us.yaml index dd29f0473..43d9d4d60 100644 --- a/addons/core/translations/en-us.yaml +++ b/addons/core/translations/en-us.yaml @@ -44,11 +44,6 @@ titles: not-set: Not set year: '{numberOfYears, plural, =1 {# year} other {# years}}' days: '{days, plural, =1 {# day} other {# days}}' - application: Application - cli: CLI - cache-daemon: Cache Daemon - client: Client - color-theme: Color Theme descriptions: empty-set: There are no items to display yet. You may be able to add items or try back later. cluster-url-initialization: To get started, please enter your cluster URL @@ -110,3 +105,18 @@ unsupported-controller: releases-page: Go to releases page change-cluster-url: Change cluster URL error: Unable to download supported version of desktop app. You’ll need to download version 1.7.1 from the releases page +settings: + application: Application + cli: CLI + cache-daemon: Cache Daemon + client: Client + color-theme: Color Theme + logs: + title: Logs + logging-level: Logging level + log-location: Log location + levels: + error: Error + warn: Warn + info: Info + debug: Debug diff --git a/ui/desktop/app/components/settings-card/application/index.hbs b/ui/desktop/app/components/settings-card/application/index.hbs index a9aeed743..fa20d0076 100644 --- a/ui/desktop/app/components/settings-card/application/index.hbs +++ b/ui/desktop/app/components/settings-card/application/index.hbs @@ -3,47 +3,45 @@ SPDX-License-Identifier: BUSL-1.1 }} - + <:body> -
-
- - {{t 'titles.client'}} - - - {{@model.formattedDesktopVersion}} - -
-
- - {{t 'titles.cli'}} - - - {{@model.formattedCliVersion}} - -
-
- - {{t 'titles.cache-daemon'}} - - - {{#if @model.formattedCacheVersion}} - {{@model.formattedCacheVersion}} - - {{else}} - - {{/if}} +
+ + {{t 'settings.client'}} + + + {{@model.formattedDesktopVersion}} + +
+
+ + {{t 'settings.cli'}} + + + {{@model.formattedCliVersion}} + +
+
+ + {{t 'settings.cache-daemon'}} + + + {{#if @model.formattedCacheVersion}} + {{@model.formattedCacheVersion}} + + {{else}} + + {{/if}} - -
+
{{#if @model.error}} @@ -56,11 +54,11 @@ - {{t 'titles.color-theme'}} + {{t 'settings.color-theme'}} {{#each this.themes as |theme|}}