Skip to content

Commit

Permalink
minor cleanup of the render function
Browse files Browse the repository at this point in the history
  • Loading branch information
Sameer Naik committed Mar 21, 2018
1 parent 6580058 commit bd7ed24
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions dashboard/src/components/AppNew/AppNew.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,12 @@ class AppNew extends React.Component<IAppNewProps, IAppNewState> {
}

public render() {
if (
!this.props.selected.version ||
!this.state.appValues ||
!this.props.selected.versions.length
) {
const { selected, bindings } = this.props;
const { version, versions } = selected;
const { appValues, selectedBinding } = this.state;
if (!version || !appValues || !versions.length) {
return <div>Loading</div>;
}
const { bindings } = this.props;
const { selectedBinding } = this.state;
let bindingDetail = <div />;
if (selectedBinding) {
const {
Expand Down Expand Up @@ -149,7 +146,7 @@ class AppNew extends React.Component<IAppNewProps, IAppNewState> {
<div>
<label htmlFor="chartVersion">Version</label>
<select id="chartVersion" onChange={this.handleChartVersionChange} required={true}>
{this.props.selected.versions.map(v => (
{versions.map(v => (
<option
key={v.id}
value={v.attributes.version}
Expand Down Expand Up @@ -177,7 +174,7 @@ class AppNew extends React.Component<IAppNewProps, IAppNewState> {
width="100%"
onChange={this.handleValuesChange}
setOptions={{ showPrintMargin: false }}
value={this.state.appValues}
value={appValues}
/>
</div>
<div>
Expand Down

0 comments on commit bd7ed24

Please sign in to comment.