Skip to content

Commit

Permalink
[FIX JENKINS-42598] - spacing issue with numeric inputs (#34)
Browse files Browse the repository at this point in the history
* JENKINS-42598 - spacing issue with numeric inputs
* JENKINS-43009 - Fix styling issue with hack for table action buttons affecting input
  • Loading branch information
kzantow committed Mar 22, 2017
1 parent 43c1913 commit bdefbef
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
8 changes: 5 additions & 3 deletions src/main/js/components/properties/DecimalPropertyInput.jsx
@@ -1,15 +1,17 @@
import React from 'react';
import { FormElement } from '@jenkins-cd/design-language';

export default class DecimalPropertyInput extends React.Component {
render() {
const { type: p, step } = this.props;
return (
<div>
<label className="form-label">{this.props.type.capitalizedName + (this.props.type.isRequired ? '*' : '')}</label>
<FormElement title={p.capitalizedName + (p.isRequired ? '*' : '')}
errorMessage={!step.pristine && p.isRequired && !step.data[p.name] && (p.capitalizedName + ' is required')}>
<div className="TextInput">
<input type="number" className="TextInput-control" defaultValue={this.props.step.data[this.props.propName]}
onChange={e => { this.props.step.data[this.props.propName] = parseFloat(e.target.value); this.props.onChange(this.props.step); }}/>
</div>
</div>
</FormElement>
);
}
}
Expand Down
10 changes: 6 additions & 4 deletions src/main/js/components/properties/IntegerPropertyInput.jsx
@@ -1,15 +1,17 @@
import React from 'react';
import { FormElement } from '@jenkins-cd/design-language';

export default class IntegerPropertyInput extends React.Component {
render() {
const { type: p, step } = this.props;
return (
<div>
<label className="form-label">{this.props.type.capitalizedName + (this.props.type.isRequired ? '*' : '')}</label>
<FormElement title={p.capitalizedName + (p.isRequired ? '*' : '')}
errorMessage={!step.pristine && p.isRequired && !step.data[p.name] && (p.capitalizedName + ' is required')}>
<div className="TextInput">
<input type="number" className="TextInput-control" defaultValue={this.props.step.data[this.props.propName]}
onChange={e => { this.props.step.data[this.props.propName] = parseInt(e.target.value); this.props.onChange(this.props.step); }}/>
onChange={e => { step.data[this.props.propName] = parseInt(e.target.value); this.props.onChange(step); }}/>
</div>
</div>
</FormElement>
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/less/header-buttons.less
Expand Up @@ -58,7 +58,7 @@

.actions { // for table actions
overflow: visible !important;
div {
> div > div {
display: inline-block;
}
}

0 comments on commit bdefbef

Please sign in to comment.