Label "Estimated price per hour" is not visible on pipeline configuration tab - fixed
@@ -239,6 +239,7 @@ class LaunchPipelineForm extends localization.LocalizedReactComponent {
activeAutoCompleteParameterKey: null,
currentProjectMetadata: null,
estimatedPrice: {
+ evaluated: false,
pending: false,
pricePerHour: 0,
maximumPrice: 0,
@@ -800,6 +801,7 @@ class LaunchPipelineForm extends localization.LocalizedReactComponent {
bucketPathParameterKey: null,
bucketPathParameterSection: null,
estimatedPrice: {
+ evaluated: false,
pending: false,
pricePerHour: 0,
maximumPrice: 0,
@@ -850,6 +852,7 @@ class LaunchPipelineForm extends localization.LocalizedReactComponent {
bucketPathParameterKey: null,
bucketPathParameterSection: null,
estimatedPrice: {
+ evaluated: false,
pending: false,
pricePerHour: 0,
maximumPrice: 0,
@@ -1072,7 +1075,9 @@ class LaunchPipelineForm extends localization.LocalizedReactComponent {
cloudRegionId: values[EXEC_ENVIRONMENT].cloudRegionId
? +values[EXEC_ENVIRONMENT].cloudRegionId
: undefined,
- prettyUrl: this.prettyUrlEnabled ? prettyUrlGenerator.build(values[ADVANCED].prettyUrl) : undefined
+ prettyUrl: this.prettyUrlEnabled
+ ? prettyUrlGenerator.build(values[ADVANCED].prettyUrl)
+ : undefined
};
if ((values[ADVANCED].is_spot ||
`${this.getDefaultValue('is_spot')}`) !== 'true' &&
@@ -1387,7 +1392,7 @@ class LaunchPipelineForm extends localization.LocalizedReactComponent {
this.getDefaultValue('cloudRegionId') || this.defaultCloudRegionId;
}
isSpot = `${isSpot}` === 'true';
- if (!isNaN(disk) && type) {
+ if (!isNaN(disk) && type && !this.state.estimatedPrice.pending) {
const request = this.props.pipeline
? new PipelineRunEstimatedPrice(
this.props.pipeline.id,
@@ -1413,6 +1418,7 @@ class LaunchPipelineForm extends localization.LocalizedReactComponent {
}
return cents / 100;
};
+ estimatedPriceState.evaluated = true;
estimatedPriceState.averagePrice = adjustPrice(request.value.averageTimePrice);
estimatedPriceState.maximumPrice = adjustPrice(request.value.maximumTimePrice);
estimatedPriceState.minimumPrice = adjustPrice(request.value.minimumTimePrice);
@@ -2694,8 +2700,14 @@ class LaunchPipelineForm extends localization.LocalizedReactComponent {
onClick={() => this.removeParameter(sectionName, key)}
style={{marginLeft: 15, width: 15}}
/>
+ ) : (
+ <div
+ style={{
+ marginLeft: 15,
+ width: 15,
+ display: 'inline-block'
+ }}>{'\u00A0'}</div>
)
- : <div style={{marginLeft: 15, width: 15, display: 'inline-block'}}>{'\u00A0'}</div>
}
{
parameterHintFn &&
@@ -4054,7 +4066,8 @@ class LaunchPipelineForm extends localization.LocalizedReactComponent {
onClick={
() => this.props.onRemoveConfiguration && this.props.onRemoveConfiguration()
}
- style={{verticalAlign: 'middle'}}>
+ style={{verticalAlign: 'middle'}}
+ >
Remove
</Button>
) : undefined
@@ -4509,6 +4522,11 @@ class LaunchPipelineForm extends localization.LocalizedReactComponent {
this.resetToolSettings();
}
}
+ if (prevProps.allowedInstanceTypes.loaded &&
+ !this.state.estimatedPrice.evaluated &&
+ !this.state.estimatedPrice.pending) {
+ this.evaluateEstimatedPrice({});
+ }
}
componentWillReceiveProps (nextProps) {
