diff --git a/.babelrc b/.babelrc index 5922d86..6c876e6 100644 --- a/.babelrc +++ b/.babelrc @@ -2,6 +2,7 @@ "presets": [ "es2015", "react", - "stage-2" + "stage-2", + "stage-0" ] } diff --git a/app/components/Secrets/Generic/Generic.jsx b/app/components/Secrets/Generic/Generic.jsx index 92d0586..40f1f52 100644 --- a/app/components/Secrets/Generic/Generic.jsx +++ b/app/components/Secrets/Generic/Generic.jsx @@ -318,6 +318,7 @@ class GenericSecretBackend extends React.Component { modal={false} actions={actions} open={this.state.openEditObjectModal} + autoDetectWindowHeight={true} autoScrollBodyContent={true} onRequestClose={() => { this.setState({ openEditObjectModal: false, secretContent: '' }) diff --git a/app/components/shared/JsonEditor.jsx b/app/components/shared/JsonEditor.jsx index f4725f0..eeac0ff 100644 --- a/app/components/shared/JsonEditor.jsx +++ b/app/components/shared/JsonEditor.jsx @@ -1,5 +1,8 @@ import React, { PropTypes } from 'react'; import JSONEditor from 'jsoneditor'; +import JsonDiffReact from 'jsondiffpatch-for-react'; +import Checkbox from 'material-ui/Checkbox'; +import Divider from 'material-ui/Divider'; import 'jsoneditor/src/css/reset.css'; import 'jsoneditor/src/css/jsoneditor.css'; import 'jsoneditor/src/css/menu.css'; @@ -32,6 +35,8 @@ class JsonEditor extends React.Component { state = { hasValue: false, + initialValue: this.props.value, + showDiff: true }; constructor(props) { @@ -81,9 +86,32 @@ class JsonEditor extends React.Component { this._jsoneditor.destroy(); } + renderDiff = () => { + if (_.isEqual(this.state.initialValue, this.props.value)) { + return