Skip to content
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

Fixes #36627 - Discard irrelevant inputs on template change #830

Merged
merged 1 commit into from
Aug 9, 2023

Conversation

adamruzicka
Copy link
Contributor

Previously we kept the pre-filled values from the previous template and then sent them to the backend together with the inputs for the new template. This prevented the job from being started as the backend didn't know what to do with the extra inputs.

Comment on lines 173 to 175
.map(({ inputName }) => inputName)
.concat(
advanced_template_inputs.map(({ inputName }) => inputName)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

template_inputs and advanced_template_inputs dont have a key named inputName
I assume you meant to do here something like this? (name is already defined so need to use _name)

Suggested change
.map(({ inputName }) => inputName)
.concat(
advanced_template_inputs.map(({ inputName }) => inputName)
.map(({ name: _name }) => _name)
.concat(
advanced_template_inputs.map(({ name: _name }) => _name)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, of course. I originally used something like ({ name } => name, got yelled at by the linter for shadowing an outer variable so I just renamed things without thinking, sorry about that

Previously we kept the pre-filled values from the previous template and
then sent them to the backend together with the inputs for the new
template. This prevented the job from being started as the backend
didn't know what to do with the extra inputs.
@adamruzicka adamruzicka force-pushed the fix-rerun branch 2 times, most recently from 34642d4 to ac66294 Compare August 7, 2023 13:50
@adamruzicka adamruzicka merged commit d75089f into theforeman:master Aug 9, 2023
5 checks passed
@adamruzicka
Copy link
Contributor Author

Thank you @MariaAga !

@adamruzicka adamruzicka deleted the fix-rerun branch August 9, 2023 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants