Skip to content

Fix task page bugs #9479

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GilbertCherrie
Copy link
Member

@GilbertCherrie GilbertCherrie commented Jun 9, 2025

Fix the delete on the tasks page.

Before:
Clicking delete on the task page made it seem like nothing was happening because no flash message would appear. The tasks are not deleted immediately, instead the deletion of the task is queued so it should alert the user of this in a flash message or else it seems like the task is not being deleted.

After:
This pr fixes this issue by alerting the user that the task deletion is queued and will occur.
Screenshot 2025-06-09 at 12 29 08 PM

@GilbertCherrie GilbertCherrie requested a review from a team as a code owner June 9, 2025 16:22
@GilbertCherrie GilbertCherrie requested a review from Fryguy June 9, 2025 16:23
Comment on lines 132 to 138
checked_items = find_checked_items
new_checked_items = []
checked_items.each do |item|
if params["select-row-#{item}"] == "on"
new_checked_items.push(item)
end
end
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
checked_items = find_checked_items
new_checked_items = []
checked_items.each do |item|
if params["select-row-#{item}"] == "on"
new_checked_items.push(item)
end
end
new_checked_items = find_checked_items.select { |item| params["select-row-#{item}"] == "on" }

Copy link
Member

@Fryguy Fryguy Jun 12, 2025

Choose a reason for hiding this comment

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

I'll be honest I don't understand what this code is saying. Do only newly checked items have the "select-row-" on? If we're deleting all checked items, why do we then only delete the newly checked items?

Copy link
Member Author

@GilbertCherrie GilbertCherrie Jun 16, 2025

Choose a reason for hiding this comment

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

The delete button doesn't instantly delete the tasks, it instead queues their deletion. So when the table is reloaded and user resubmits it with the previous items checked off you don't want to queue their deletion again

@miq-bot
Copy link
Member

miq-bot commented Jun 16, 2025

Checked commit GilbertCherrie@9ddecb4 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.62.0, and yamllint
2 files checked, 2 offenses detected

app/controllers/miq_task_controller.rb

  • ⚠️ - Line 132, Col 5 - Lint/UselessAssignment - Useless assignment to variable - checked_items.
  • ❗ - Line 338, Col 93 - Rails/TimeZone - Do not use Time.now without zone. Use one of Time.zone.now, Time.current, Time.now.in_time_zone, Time.now.utc, Time.now.getlocal, Time.now.xmlschema, Time.now.iso8601, Time.now.jisx0301, Time.now.rfc3339, Time.now.httpdate, Time.now.to_i, Time.now.to_f instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants