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

AP-5592: Update scope limits on check provider answers #7541

Merged
merged 5 commits into from
Dec 18, 2024

Conversation

colinbruce
Copy link
Contributor

@colinbruce colinbruce commented Dec 17, 2024

What

Link to story

This PR changes the proceeding_details partial IDs quite heavily to make testing easier.

Update the proceeding_helper to display the new logic required

  • don't repeat the date on two lines
  • do show the additional notes on a new line
  • show the scope limitation meaning in bold if there is more than one for a proceeding

Checklist

Before you ask people to review this PR:

  • Tests and rubocop should be passing: bundle exec rake
  • Github should not be reporting conflicts; you should have recently run git rebase main.
  • The standards in the Git Workflow document on Confluence should be followed
  • There should be no unnecessary whitespace changes. These make diffs harder to read and conflicts more likely.
  • The PR description should say what you changed and why, with a link to the JIRA story.
  • You should have looked at the diff against main and ensured that nothing unexpected is included in your changes.
  • You should have checked that the commit messages say why the change was made.

@colinbruce colinbruce force-pushed the ap-5592/cya-provider-scope-limits branch 9 times, most recently from d843e30 to 8caa09a Compare December 17, 2024 15:41
@colinbruce colinbruce marked this pull request as ready for review December 17, 2024 15:53
@colinbruce colinbruce requested a review from a team as a code owner December 17, 2024 15:53
@colinbruce colinbruce added the ready for review Please review label Dec 17, 2024
Copy link
Contributor

@jsugarman jsugarman left a comment

Choose a reason for hiding this comment

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

👍

Just some suggestions for refactoring that big method scope_limitation_details, which would be good, but non-blocker

features/providers/check_provider_answers.feature Outdated Show resolved Hide resolved
features/step_definitions/check_provider_answers_steps.rb Outdated Show resolved Hide resolved
@@ -21,10 +21,16 @@ def scope_limits(proceeding, scope_type)
private

def scope_limitation_details(scope_limitation)
scope_limitation_details = [scope_limitation.meaning, scope_limitation.description]
sole_scope_limitation = scope_limitation.proceeding.scope_limitations.where(scope_type: scope_limitation.scope_type).count.eql?(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could extract to own method

def sole_scope_limitation?(scope_limitation)
  scope_limitation.proceeding.scope_limitations.where(scope_type: scope_limitation.scope_type).count.eql?(1)
end

Comment on lines +25 to +30
scope_limitation_meaning = if sole_scope_limitation
scope_limitation.meaning
else
"<span class=\"single-scope-limit-heading\">#{scope_limitation.meaning}</span>".html_safe
end
scope_limitation_details = [scope_limitation_meaning, scope_limitation.description]
Copy link
Contributor

Choose a reason for hiding this comment

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

another method extraction perhaps?

def scope_limitation_base_details(scope_limitation)
  scope_limitation_meaning = if sole_scope_limitation?(scope_limitation)
                               scope_limitation.meaning
                             else
                               "<span class=\"single-scope-limit-heading\">#{scope_limitation.meaning}</span>".html_safe
                             end
  [scope_limitation_meaning, scope_limitation.description]
end

Copy link
Contributor

Choose a reason for hiding this comment

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

or extract both to a class nested in the helper?

like...

ScopeLimitationDetailBuilder.new(scope_limitation).call

This changes the proceeding_details partial IDs quite heavily
to make testing easier.
Add the date to the end of the description if has not been added by
the proceeding method.

This is needed to remove the duplication of date values on the check
your answer pages

This may be a temp fix while scope limitation texts are reviewed
Rather than downcase each interpolated value, downcase the entire
selector name
allow both upper and lower case emeregency or substantive types to be passed
this allows a more uniform appearance in the the feature test scenarios
@colinbruce colinbruce force-pushed the ap-5592/cya-provider-scope-limits branch from 002d3e1 to f43e70e Compare December 18, 2024 08:43
@colinbruce colinbruce merged commit aa37617 into main Dec 18, 2024
15 checks passed
@colinbruce colinbruce deleted the ap-5592/cya-provider-scope-limits branch December 18, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review Please review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants