New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support to select chart version in the helm install form #5718
add support to select chart version in the helm install form #5718
Conversation
}) => { | ||
const { chartName, chartVersion } = values; | ||
const handleYAMLChange = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is getting called on every keystroke of user in the yaml editor which is not required. Better to have a check using initialValues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also an issue with this approach where user changes something in YAML but reverts it back, it will still consider the YAML dirty while technically it's not dirty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed the logic
<YAMLEditorField | ||
name="chartValuesYAML" | ||
onSave={handleSubmit} | ||
onChange={() => handleYAMLChange()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onChange={() => handleYAMLChange()} | |
onChange={handleYAMLChange} |
@@ -179,6 +176,7 @@ const HelmInstallUpgradePage: React.FunctionComponent<HelmInstallUpgradePageProp | |||
{(props) => ( | |||
<HelmInstallUpgradeForm | |||
{...props} | |||
appVersion={appVersion} | |||
chartHasValues={chartHasValues} | |||
submitLabel={helmAction} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to just send helmAction
instead. Using submitLabel
in the other components like helmAction
seems weird.
onAccept(); | ||
return Promise.resolve(); | ||
}, | ||
cancel: () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need to set any value on cancel?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because, when I select an option from the dropdown the chartVersion is immediately set to the selected option and then the modal opens up. Now, if I cancel the modal the chart version is not reset to the initial version, which is why I had to manually reset it by setting the chartversion value to the initial version.
update tests pls, there is a failing suite |
351f6a6
to
c214674
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EDIT - Sorry, wrong PR. Need to test this one locally first.
/lgtm cancel Added lgtm to wrong PR. Need to verify this locally. |
submitLabel={submitLabel} | ||
disableSubmit={(chartVersion && !dirty) || status?.isSubmitting || !_.isEmpty(errors)} | ||
submitLabel={helmAction} | ||
disableSubmit={isSubmitDisabled} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The submit button is not getting disabled now while submitting the form.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
c214674
to
1229949
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Verified locally. Works fine.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: debsmita1, rohitkrai03 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/kind feature |
JIRA story:
https://issues.redhat.com/browse/ODC-4086
Solution Description:
isYAMLDirty
inHelmInstallUpgradeFormData
to check if changes have been to the YAML editorChart Version
dropdown title now shows the chart version concatenated with the App versionChart Version
dropdown is disabled if there are no chart versions or only one chart version is presentGIF: