Skip to content

Commit

Permalink
Merge pull request #1162 from Microsoft/jwilaby/#936-generic-service
Browse files Browse the repository at this point in the history
Re-applying lost code changes
  • Loading branch information
Justin Wilaby authored Dec 10, 2018
2 parents 2cda763 + 9d0def1 commit 8bacc53
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
font-weight: 600;
margin-bottom: 5px;
padding-left: 8px;
width: 100%;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ export class ConnectedServiceEditor extends Component<ConnectedServiceEditorProp

private get supplementalContent(): ReactNode {
if (this.props.serviceType === ServiceTypes.Generic) {
const { connectedService = { configuration: {} } } = this.props;
const { configuration } = connectedService as IGenericService;
const { connectedServiceCopy = { configuration: {} } } = this.state;
const { configuration } = connectedServiceCopy as IGenericService;
return (<KvPair kvPairs={ configuration } onChange={ this.onKvPairChange }/>);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@ export class KvPair extends Component<KvPairProps, KvPairState> {
const numEmptyRows = 1 + length - kvPairs.length;
const rows = [];

for (let i = 0; i < numEmptyRows; i++) {
rows.push(
<li key={ kvPairs.length + i }>
{ this.getTextFieldPair() }
</li>);
}

kvPairs.forEach((kvPair, index) => {
rows.push(
<li key={ index }>
{ this.getTextFieldPair(kvPair.key, kvPair.value) }
</li>);
});

for (let i = 0; i < numEmptyRows; i++) {
rows.push(
<li key={ kvPairs.length + i }>
{ this.getTextFieldPair() }
</li>);
}

return (
<div>
<header className={ styles.header }>
Expand Down

0 comments on commit 8bacc53

Please sign in to comment.