From 540c1b4b667127075399f881f0eef20b87d7bd33 Mon Sep 17 00:00:00 2001 From: ChaotiCryptidz Date: Sun, 23 Jan 2022 12:25:19 +0000 Subject: [PATCH] fix creating secrets with path redirecting to the right page --- src/ui/elements/forms/InputProps.tsx | 1 + src/ui/pages/Secrets/KeyValue/KeyValueEdit.tsx | 11 ++++++----- src/ui/pages/Secrets/KeyValue/KeyValueList.tsx | 2 +- src/ui/pages/Secrets/KeyValue/KeyValueNew.tsx | 8 +++++++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/ui/elements/forms/InputProps.tsx b/src/ui/elements/forms/InputProps.tsx index 3951d08..bf16441 100644 --- a/src/ui/elements/forms/InputProps.tsx +++ b/src/ui/elements/forms/InputProps.tsx @@ -2,6 +2,7 @@ export type InputProps = { name?: string; value?: string; placeholder?: string; + onInput?: () => void; onChange?: () => void; required?: boolean; checked?: boolean; diff --git a/src/ui/pages/Secrets/KeyValue/KeyValueEdit.tsx b/src/ui/pages/Secrets/KeyValue/KeyValueEdit.tsx index ddd6c12..55f97b1 100644 --- a/src/ui/pages/Secrets/KeyValue/KeyValueEdit.tsx +++ b/src/ui/pages/Secrets/KeyValue/KeyValueEdit.tsx @@ -66,7 +66,7 @@ export class KVEditor extends Component { this.setState({ dataLoaded: true, kvData: kvData, - code: this.getStringKVData(kvData), + code: this.getStringKVData(kvData, this.state.syntax), }); } @@ -95,11 +95,11 @@ export class KVEditor extends Component { } } - getStringKVData(data: Record): string { + getStringKVData(data: Record, syntax: string): string { return dumpData( Object.fromEntries(sortedObjectMap(data)), this.props.settings.kvEditorIndent, - this.state.syntax, + syntax, ); } @@ -115,7 +115,8 @@ export class KVEditor extends Component {