From 0817f27284631ff716b61d0cfaaf64539526a42f Mon Sep 17 00:00:00 2001 From: ChaotiCryptidz Date: Wed, 19 Jan 2022 17:04:26 +0000 Subject: [PATCH] "Default Indent" -> "Indent" --- README.md | 2 +- src/translations/en.js | 4 +-- src/ui/pages/Settings/KeyValueSettings.tsx | 42 ++++++++++++++++------ 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 83ff4a4..95ecb35 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ VaultUI is a user interface for [Hashicorp Vault](https://www.hashicorp.com/prod ### Key Value - Viewing of Key/Value secrets (v1 & v2) - Managing versions of secrets in v2 mounts. -- Editing Key/Value secrets with ability to edit in JSON, JSON5, Yaml, etc. +- Editing and Viewing Key/Value secrets in JSON, JSON5, Yaml, etc with default settings for both. - Search bar for easily finding a secret on mobile. ### TOTP - Can view and delete TOTP codes. diff --git a/src/translations/en.js b/src/translations/en.js index f922832..78d4c19 100644 --- a/src/translations/en.js +++ b/src/translations/en.js @@ -84,9 +84,9 @@ module.exports = { // Key/Value Settings settings_kv_title: "Key/Value", settings_kv_default_view_language: "Default View Syntax", - settings_kv_default_view_indent: "Default View Indent", + settings_kv_view_indent: "View Indent", settings_kv_default_editor_language: "Default Editor Syntax", - settings_kv_default_editor_indent: "Default Editor Indent", + settings_kv_editor_indent: "Editor Indent", settings_kv_always_view_in_code_mode: "Always view in code mode", // Set Vault URL Page diff --git a/src/ui/pages/Settings/KeyValueSettings.tsx b/src/ui/pages/Settings/KeyValueSettings.tsx index e3dd8af..aece50e 100644 --- a/src/ui/pages/Settings/KeyValueSettings.tsx +++ b/src/ui/pages/Settings/KeyValueSettings.tsx @@ -5,18 +5,12 @@ import { SupportedLanguages } from "../../../utils/dataInterchange"; import { settingsSavedNotification } from "./Settings"; import i18next from "i18next"; -export class KeyValueSettings extends Component { - editorSyntaxSelectRef = createRef(); - editorIndentInputRef = createRef(); +export class KeyValueViewSettings extends Component { viewSyntaxSelectRef = createRef(); viewIndentInputRef = createRef(); - codeModeToggleRef = createRef(); - render() { return (
-

{i18next.t("settings_kv_title")}

- {/* KV View Language */} { const value = this.viewIndentInputRef.current.value; const indent = parseInt(value); @@ -54,7 +48,18 @@ export class KeyValueSettings extends Component { }} /> +
+ ) + } +} + +export class KeyValueEditorSettings extends Component { + editorSyntaxSelectRef = createRef(); + editorIndentInputRef = createRef(); + render() { + return ( +
{/* KV Editor Language */} { }} /> +
+ ) + } +} + + + +export class KeyValueSettings extends Component { + codeModeToggleRef = createRef(); + + render() { + return ( +
+

{i18next.t("settings_kv_title")}

+ + + {/* Always view in code mode */}