From 24009797ab16b84ba77e0e9fe71ce05b3ab0c57c Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Thu, 19 Aug 2021 11:16:22 +0200 Subject: [PATCH] UI: Rename HideInput to SensitiveTextInput. Resolve spacing --- .../components/configuration-components/UiSchema.js | 8 ++++---- .../{HideInput.js => SensitiveTextInput.js} | 10 ++++------ .../cc/ui/src/styles/components/HideInput.scss | 3 --- 3 files changed, 8 insertions(+), 13 deletions(-) rename monkey/monkey_island/cc/ui/src/components/ui-components/{HideInput.js => SensitiveTextInput.js} (79%) delete mode 100644 monkey/monkey_island/cc/ui/src/styles/components/HideInput.scss diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js index e6dbed239..6879bee2e 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js @@ -3,7 +3,7 @@ import PbaInput from './PbaInput'; import {API_PBA_LINUX, API_PBA_WINDOWS} from '../pages/ConfigurePage'; import InfoBox from './InfoBox'; import TextBox from './TextBox'; -import HideInput from '../ui-components/HideInput'; +import SensitiveTextInput from '../ui-components/SensitiveTextInput'; export default function UiSchema(props) { const UiSchema = { @@ -18,7 +18,7 @@ export default function UiSchema(props) { credentials : { exploit_password_list: { items: { - 'ui:widget': HideInput + 'ui:widget': SensitiveTextInput } } } @@ -116,12 +116,12 @@ export default function UiSchema(props) { exploits: { exploit_lm_hash_list:{ items: { - 'ui:widget': HideInput + 'ui:widget': SensitiveTextInput } }, exploit_ntlm_hash_list: { items: { - 'ui:widget': HideInput + 'ui:widget': SensitiveTextInput } } } diff --git a/monkey/monkey_island/cc/ui/src/components/ui-components/HideInput.js b/monkey/monkey_island/cc/ui/src/components/ui-components/SensitiveTextInput.js similarity index 79% rename from monkey/monkey_island/cc/ui/src/components/ui-components/HideInput.js rename to monkey/monkey_island/cc/ui/src/components/ui-components/SensitiveTextInput.js index 4a2e53915..6dca37157 100644 --- a/monkey/monkey_island/cc/ui/src/components/ui-components/HideInput.js +++ b/monkey/monkey_island/cc/ui/src/components/ui-components/SensitiveTextInput.js @@ -1,18 +1,16 @@ import React from 'react'; import {InputGroup, FormControl} from 'react-bootstrap'; -import '../../styles/components/HideInput.scss' -class HideInput extends React.PureComponent { +class SensitiveTextInput extends React.PureComponent { constructor(props) { super(props); this.state = { hidden: false }; - this.toggleShow = this.toggleShow.bind(this); } - toggleShow() { + toggleShow = () => { this.setState({hidden: ! this.state.hidden}); } @@ -24,7 +22,7 @@ class HideInput extends React.PureComponent { render() { return (
- +