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

[#162225] Multi-Facility - Duplicates being created #4189

Merged
merged 5 commits into from
Apr 29, 2024

Conversation

LeticiaErrandonea
Copy link
Contributor

Release Notes

  • Fix bug for duplicate order details.

Additional Context

Add a spec to add to facility order using Feature Flag.
New spec failed with old code as it found two "Make a reservation" buttons.

Accessibility

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

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 catch! Left a couple small comments

app/views/facility_orders/show.html.haml Outdated Show resolved Hide resolved
@@ -31,6 +31,7 @@ def save

if @original_order.facility.id == @facility_id
add_to_order!
return true
end

return true unless SettingsHelper.feature_on?(:cross_core_projects)
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 I'd prefer to wrap the feature flagged changes in a conditional, instead of using a guard clause:

  if SettingsHelper.feature_on?(:cross_core_projects)
    if order_for_selected_facility.nil?
      create_cross_core_project_and_add_order!
    else
      add_to_order!
    end
  end

... then we can still git true on line 45.
This would be easier to read and clearer what needs to happen when we are ready to remove the flag.

create_cross_core_project_and_add_order!
else
add_to_order!
if SettingsHelper.feature_on?(:cross_core_projects)
Copy link
Contributor

Choose a reason for hiding this comment

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

@LeticiaErrandonea maybe this should be elsif?

@LeticiaErrandonea LeticiaErrandonea merged commit 0c8b6f3 into master Apr 29, 2024
3 checks passed
@LeticiaErrandonea LeticiaErrandonea deleted the 162225-avoid_dups branch April 29, 2024 21:15
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.

None yet

2 participants