Skip to content

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

Merged
mabashian merged 1 commit into
ansible:develfrom
mabashian:AAP-20967-prompt-vars
Mar 20, 2024
Merged

Fix bug where extra variables were reset on schedule edit#15008
mabashian merged 1 commit into
ansible:develfrom
mabashian:AAP-20967-prompt-vars

Conversation

@mabashian

Copy link
Copy Markdown
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
@mabashian mabashian force-pushed the AAP-20967-prompt-vars branch from db302f1 to 6f01488 Compare March 19, 2024 19:26

@akus062381 akus062381 left a comment

Copy link
Copy Markdown
Member

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
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