From f681d13331613337fba25a74d855d689a96a6f1d Mon Sep 17 00:00:00 2001 From: tippl Date: Thu, 12 Jul 2018 22:38:51 +0200 Subject: [PATCH] Add bar color indicator for environments (#1042) * Add bar color indicator for environments * Fix according to code review --- packages/insomnia-app/app/models/settings.js | 6 ++++-- .../dropdowns/environments-dropdown.js | 6 +++++- .../app/ui/components/settings/general.js | 16 ++++++++++++++++ .../app/ui/components/sidebar/sidebar.js | 5 ++++- .../insomnia-app/app/ui/components/wrapper.js | 14 +++++++++++++- 5 files changed, 42 insertions(+), 5 deletions(-) diff --git a/packages/insomnia-app/app/models/settings.js b/packages/insomnia-app/app/models/settings.js index 9eb30af20..46d2cf9c2 100644 --- a/packages/insomnia-app/app/models/settings.js +++ b/packages/insomnia-app/app/models/settings.js @@ -25,7 +25,8 @@ type BaseSettings = { nunjucksPowerUserMode: boolean, deviceId: string | null, updateChannel: string, - updateAutomatically: boolean + updateAutomatically: boolean, + environmentHighlightColorStyle: string }; export type Settings = BaseModel & BaseSettings; @@ -58,7 +59,8 @@ export function init(): BaseSettings { nunjucksPowerUserMode: false, deviceId: null, updateChannel: UPDATE_CHANNEL_STABLE, - updateAutomatically: true + updateAutomatically: true, + environmentHighlightColorStyle: 'dot' }; } diff --git a/packages/insomnia-app/app/ui/components/dropdowns/environments-dropdown.js b/packages/insomnia-app/app/ui/components/dropdowns/environments-dropdown.js index 085fca937..5724c04d2 100644 --- a/packages/insomnia-app/app/ui/components/dropdowns/environments-dropdown.js +++ b/packages/insomnia-app/app/ui/components/dropdowns/environments-dropdown.js @@ -21,6 +21,7 @@ type Props = { handleChangeEnvironment: Function, workspace: Workspace, environments: Array, + environmentHighlightColorStyle: String, // Optional className?: string, @@ -67,6 +68,7 @@ class EnvironmentsDropdown extends React.PureComponent { workspace, environments, activeEnvironment, + environmentHighlightColorStyle, ...other } = this.props; @@ -100,7 +102,9 @@ class EnvironmentsDropdown extends React.PureComponent { )}
- {activeEnvironment && activeEnvironment.color ? ( + {activeEnvironment && + activeEnvironment.color && + environmentHighlightColorStyle === 'dot' ? ( {
+
+ +
+