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

[Shared dev] [#162254] Open "Report an issue" in modal #4325

Merged
merged 15 commits into from
Jun 13, 2024

Conversation

LeticiaErrandonea
Copy link
Contributor

@LeticiaErrandonea LeticiaErrandonea commented Jun 7, 2024

Release Notes

  • Show "Report an issue" action in modal

Screenshot

image

Accessibility

  • Did you scan for accessibility issues?
  • Did you check our accessibility goal checklist?
  • Did you add accessibility specs?

@@ -28,6 +28,10 @@
top: 6px;
}

#js--reportAnIssueModal {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

More styles are needed as modal still looks off. Also, I think it's missing a Cancel button

image

Copy link
Contributor

Choose a reason for hiding this comment

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

we have existing examples on the code, or you can look at bootstrap 2 docs

Copy link
Contributor

@giladshanan giladshanan left a comment

Choose a reason for hiding this comment

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

left some comments

redirect_to_order_id = params[:redirect_to_order_id]

if modal?
render partial: "instruments/actions/issues", locals: { product: @product, order_detail: @order_detail, instrument_issue: @instrument_issue, redirect_to_order_id: }
Copy link
Contributor

Choose a reason for hiding this comment

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

try moving this back to the new template


if @instrument_issue.send_notification
redirect_to reservations_path, notice: text("create.success")
if redirect_to_order_id.present?
Copy link
Contributor

Choose a reason for hiding this comment

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

let's move this into a method that returns the redirect path
in that method we can check modal? and ensure we have an order to redirect to
we can also add a code comment there if needed to clarify the expected code paths

@@ -28,6 +28,10 @@
top: 6px;
}

#js--reportAnIssueModal {
Copy link
Contributor

Choose a reason for hiding this comment

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

we have existing examples on the code, or you can look at bootstrap 2 docs

@LeticiaErrandonea LeticiaErrandonea marked this pull request as ready for review June 12, 2024 19:39
@LeticiaErrandonea LeticiaErrandonea requested a review from a team as a code owner June 12, 2024 19:39
Copy link
Contributor

@giladshanan giladshanan left a comment

Choose a reason for hiding this comment

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

Nice work on the refactors!

Comment on lines 16 to 18
if modal?
render layout: false
end
Copy link
Contributor

Choose a reason for hiding this comment

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

I think line 11 should handle this

@@ -1,3 +1,5 @@
- modal_view = @redirect_to_order_id.present?
Copy link
Contributor

Choose a reason for hiding this comment

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

can we set this in the controller?

.row
.span12
%h2= text("title")
- url = facility_order_order_detail_issues_path(current_facility, @order_detail.order, @order_detail, redirect_to_order_id: @redirect_to_order_id)
Copy link
Contributor

Choose a reason for hiding this comment

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

can we set this in the controller?

= f.input :message, as: :text, input_html: { class: "input-xxlarge" }
= f.submit text("submit"), class: "btn btn-primary"
.modal-footer
= modal_cancel_button text: "Cancel"
Copy link
Contributor

Choose a reason for hiding this comment

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

i18n please

spec/support/contexts/cross_core_context.rb Outdated Show resolved Hide resolved
describe "Report an Issue" do
it "redirects to original order show" do
find("h3", text: cross_core_reservation_order.facility.to_s, match: :first).click
find("a", text: "Report an Issue").click
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe put this into a within block to make it explicit which order detail we're reporting an issue about

@LeticiaErrandonea LeticiaErrandonea merged commit 9373c6a into master Jun 13, 2024
3 checks passed
@LeticiaErrandonea LeticiaErrandonea deleted the 162254-reservation_actions_modal branch June 13, 2024 18:05
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.

2 participants