From 5e1567edd31d33dec6e6d9332d5ac50dc682122a Mon Sep 17 00:00:00 2001 From: Jacob Kozol Date: Wed, 8 Jul 2020 17:04:04 +0200 Subject: [PATCH] wizard: use proper image type label in review step In the review step the image type displays as the image type's label. It was displaying as the image type's name which is less descriptive than the label. --- components/Wizard/CreateImageUpload.js | 1 + components/Wizard/ReviewStep.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/components/Wizard/CreateImageUpload.js b/components/Wizard/CreateImageUpload.js index f90f1d06a..bb3973d65 100644 --- a/components/Wizard/CreateImageUpload.js +++ b/components/Wizard/CreateImageUpload.js @@ -399,6 +399,7 @@ class CreateImageUploadModal extends React.Component { imageName={this.state.imageName} imageSize={this.state.imageSize} imageType={this.state.imageType} + imageTypes={this.props.imageTypes} minImageSize={this.state.minImageSize} maxImageSize={this.state.maxImageSize} uploadService={this.state.uploadService} diff --git a/components/Wizard/ReviewStep.js b/components/Wizard/ReviewStep.js index 8c2f1a976..5e6aeefe1 100644 --- a/components/Wizard/ReviewStep.js +++ b/components/Wizard/ReviewStep.js @@ -62,6 +62,7 @@ class ReviewStep extends React.PureComponent { imageName, imageSize, imageType, + imageTypes, minImageSize, maxImageSize, missingRequiredFields, @@ -280,7 +281,9 @@ class ReviewStep extends React.PureComponent { - {imageType} + + {imageTypes.find((type) => type.name === imageType).label} + {awsReviewStep} @@ -294,6 +297,7 @@ ReviewStep.propTypes = { intl: intlShape.isRequired, imageName: PropTypes.string, imageType: PropTypes.string, + imageTypes: PropTypes.arrayOf(PropTypes.object), imageSize: PropTypes.number, minImageSize: PropTypes.number, maxImageSize: PropTypes.number, @@ -305,6 +309,7 @@ ReviewStep.propTypes = { ReviewStep.defaultProps = { imageName: "", imageType: "", + imageTypes: [], imageSize: undefined, minImageSize: 0, maxImageSize: 2000,