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

Fix bug where extra variables were reset on schedule edit #15008

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

mabashian
Copy link
Member

SUMMARY

Steps to reproduce the bug:

  1. Create a template with at least one survey question. It's easier to visualize if the survey question has a default value.
  2. Turn the survey on.
  3. Open the template schedule interface, Note the default values displayed in the schedule prompt.
  4. Modify the survey value from step 1.
  5. Save the schedule.
  6. Review the saved schedule to ensure the new values are correctly updated. The changes to the survey should reflected in the Variables detail.
  7. Reopen the schedule for editing, modify at least one non-prompt field like start time or description. Don't open the prompt modal.
  8. Save the edited schedule with the updated values.
  9. Observe that the prompt values have reverted to the defaults

The issue here is that unless the user opens the prompt modal, the form thinks that all of the prompt values have been removed and drops them back to defaults. This fix adds state to track whether or not that modal has been opened and updates the behavior accordingly.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • UI

@mabashian mabashian force-pushed the AAP-20967-prompt-vars branch 2 times, most recently from 6a9b3c7 to db302f1 Compare March 19, 2024 19:21
Fix survey prompt presentation inconsistencies

Remove unnecessary conditional

This conditional always returned true.  See the following warning: This condition will always return 'true' since JavaScript compares objects by reference, not value.

Fix schedule edit tests
Copy link
Member

@akus062381 akus062381 left a comment

Choose a reason for hiding this comment

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

Manually tested and verified! Nice!

@mabashian mabashian merged commit 9bb97dd into ansible:devel Mar 20, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants