diff --git a/CHANGELOG.md b/CHANGELOG.md index 5946622d7..e3b3acb5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [1999](https://github.com/microsoft/BotFramework-Emulator/pull/1999) - [2000](https://github.com/microsoft/BotFramework-Emulator/pull/2000) - [2001](https://github.com/microsoft/BotFramework-Emulator/pull/2001) + - [2002](https://github.com/microsoft/BotFramework-Emulator/pull/2002) - [2009](https://github.com/microsoft/BotFramework-Emulator/pull/2009) - [2010](https://github.com/microsoft/BotFramework-Emulator/pull/2010) diff --git a/packages/app/client/src/ui/shell/explorer/servicesExplorer/connectedServiceEditor/connectedServiceEditor.scss b/packages/app/client/src/ui/shell/explorer/servicesExplorer/connectedServiceEditor/connectedServiceEditor.scss index 6c411cbde..cbdbbad0e 100644 --- a/packages/app/client/src/ui/shell/explorer/servicesExplorer/connectedServiceEditor/connectedServiceEditor.scss +++ b/packages/app/client/src/ui/shell/explorer/servicesExplorer/connectedServiceEditor/connectedServiceEditor.scss @@ -38,42 +38,30 @@ .header { display: flex; width: 100%; - - > * { - font-size: 13px; - font-weight: 600; - margin-bottom: 5px; - padding-left: 8px; - width: 100%; - } + font-size: 13px; + font-weight: 600; + margin-bottom: 5px; + padding-left: 8px; } -ul.kv-pair-container { +.kv-pair-container { list-style: none; margin: 0; padding: 0; position: relative; max-height: 180px; overflow: auto; + display: flex; + width: 100%; +} - > li { - width: 100%; - display: flex; - - > * { - width: 100%; - } - - // key - > div { - margin-right: 4px; - } +.kv-input-row { + justify-content: space-between; + width: 100%; + display: flex; - // value - > div + div { - margin-right: 0; - margin-left: 4px; - } + >* { + width: 100%; } input[disabled] { @@ -81,6 +69,19 @@ ul.kv-pair-container { } } +.kv-input-key { + display: flex; + width: 100%; + margin-right: 4px; +} + +.kv-input-value { + display:flex; + width: 100%; + margin-right: 0; + margin-left: 4px; +} + .no-border { border: none; } diff --git a/packages/app/client/src/ui/shell/explorer/servicesExplorer/connectedServiceEditor/connectedServiceEditor.scss.d.ts b/packages/app/client/src/ui/shell/explorer/servicesExplorer/connectedServiceEditor/connectedServiceEditor.scss.d.ts index 806737d36..df41a9765 100644 --- a/packages/app/client/src/ui/shell/explorer/servicesExplorer/connectedServiceEditor/connectedServiceEditor.scss.d.ts +++ b/packages/app/client/src/ui/shell/explorer/servicesExplorer/connectedServiceEditor/connectedServiceEditor.scss.d.ts @@ -2,6 +2,9 @@ export const connectedServiceEditor: string; export const header: string; export const kvPairContainer: string; +export const kvInputRow: string; +export const kvInputKey: string; +export const kvInputValue: string; export const noBorder: string; export const link: string; export const alert: string; diff --git a/packages/app/client/src/ui/shell/explorer/servicesExplorer/connectedServiceEditor/kvPair.spec.tsx b/packages/app/client/src/ui/shell/explorer/servicesExplorer/connectedServiceEditor/kvPair.spec.tsx index b4f115704..3318987e1 100644 --- a/packages/app/client/src/ui/shell/explorer/servicesExplorer/connectedServiceEditor/kvPair.spec.tsx +++ b/packages/app/client/src/ui/shell/explorer/servicesExplorer/connectedServiceEditor/kvPair.spec.tsx @@ -53,7 +53,7 @@ describe('The KvPair component', () => { numRows: 2, }); - expect(node.find('ul').children()).toHaveLength(2); + expect(node.find('tr')).toHaveLength(4); }); it('should call the onChange callback with the updated kv pairs', () => { diff --git a/packages/app/client/src/ui/shell/explorer/servicesExplorer/connectedServiceEditor/kvPair.tsx b/packages/app/client/src/ui/shell/explorer/servicesExplorer/connectedServiceEditor/kvPair.tsx index 5649cd585..b978504ec 100644 --- a/packages/app/client/src/ui/shell/explorer/servicesExplorer/connectedServiceEditor/kvPair.tsx +++ b/packages/app/client/src/ui/shell/explorer/servicesExplorer/connectedServiceEditor/kvPair.tsx @@ -31,7 +31,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -import { LinkButton, TextField } from '@bfemulator/ui-react'; +import { LinkButton, TextField, Row } from '@bfemulator/ui-react'; import * as React from 'react'; import { ChangeEvent, Component, ReactNode } from 'react'; @@ -62,15 +62,24 @@ export class KvPair extends Component { return (
- - - - - + +
+ Key + {kvPairs.map((pair, index) => ( + + {this.getTextFieldKey(pair.key, index)} + + ))} +
+
+ Value + {kvPairs.map((pair, index) => ( + + {this.getTextFieldValue(pair.key, pair.value, index)} + + ))} +
+
{ ); } - private getTextFieldPair(key: string = '', value: string = '', index: number): ReactNode { + private getTextFieldKey(key: string = '', index: number): ReactNode { let ref; if (index === this.state.numRows - 1) { ref = ref => { @@ -102,6 +111,7 @@ export class KvPair extends Component { return ( <> { onChange={this.onChange} inputRef={ref} /> + + ); + } + + private getTextFieldValue(key: string = '', value: string = '', index: number): ReactNode { + return ( + <>