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

FYST-792: ID Grocery Credit #4897

Open
wants to merge 56 commits into
base: main
Choose a base branch
from
Open

FYST-792: ID Grocery Credit #4897

wants to merge 56 commits into from

Conversation

mrotondo
Copy link
Contributor

@mrotondo mrotondo commented Oct 22, 2024

Link to pivotal/JIRA issue

Is PM acceptance required? (delete one)

  • Yes - don't merge until JIRA issue is accepted!
    Reminder: merge main into this branch and get green tests before merging to main

What was done?

  • Added the Idaho grocery credit - two new pages, calculator code, and XML + PDF output
  • We used the form & controller code from NameDob and AzSeniorDependents as examples

How to test?

  • We both tested manually and added automated unit tests for most scenarios
  • Risk Assessment
  • We added parameters to our "question-with-follow-up" javascript, so please also test some other places in the app where subsequent questions are revealed based on answers to make sure we didn't break them

Screenshots (for visual changes)

image image image

@mrotondo mrotondo added the wip denotes a work in progress that isn't ready for formal review label Oct 22, 2024
Copy link

Heroku app: https://gyr-review-app-4897-3d3a6ab9ef27.herokuapp.com/
View logs: heroku logs --app gyr-review-app-4897 (optionally add --tail)

app/javascript/lib/honeycrisp.js Fixed Show fixed Hide fixed
app/javascript/lib/honeycrisp.js Fixed Show fixed Hide fixed
Copy link
Contributor

@arinchoi03 arinchoi03 left a comment

Choose a reason for hiding this comment

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

Had a few questions! My head's spinning a bit tbh, might need to pair review tomorrow

config/locales/en.yml Show resolved Hide resolved
app/lib/efile/id/id40_calculator.rb Show resolved Hide resolved
app/views/hub/clients/_client_header.html.erb Outdated Show resolved Hide resolved
app/javascript/lib/honeycrisp.js Outdated Show resolved Hide resolved
@mrotondo mrotondo removed the wip denotes a work in progress that isn't ready for formal review label Oct 29, 2024
Copy link
Contributor

@arinchoi03 arinchoi03 left a comment

Choose a reason for hiding this comment

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

just a few more q's to clarify my understanding...this story got complex 😵

updated_dependent_data = dependents_attributes

# set household member "has months" answers to no if household "has months" answer is no
if base_attrs[:household_has_grocery_credit_ineligible_months] == 'no'
Copy link
Contributor

Choose a reason for hiding this comment

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

this is just a non-related question that I also discussed just now with Drew, but why do we use enum instead of boolean for these types of fields?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Enums let us track yes/no/unfilled instead of just true/false, which I think is primarily useful when generating output for optional pages, though we don't check the unfilled value of this answer anywhere IIRC. Someone who's been on the team longer than me can give a better answer here :) I don't feel very strongly about it either way, mostly just following convention.

Copy link
Contributor

Choose a reason for hiding this comment

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

@DrewProebstel for more context

also @jenny-heath @embarnard @mpidcock @tahsinaislam if there was more reasoning for this choice (unfilled is similar to nil, no?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FWIW I think that the decision to move away from using "unfilled" rather than nil as a default value in the app is well outside the scope of this PR, so discussion on that should probably happen elsewhere for posterity & visibility

end

updated_dependent_data = updated_dependent_data.to_h do |k, v|
credit_count_key = v.key?(:id_months_ineligible_for_grocery_credit)
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 call this has_credit_count_key to be more clear

Copy link
Contributor

Choose a reason for hiding this comment

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

@mrotondo bump

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

app/models/df_json_wrapper.rb Show resolved Hide resolved
app/models/df_json_wrapper.rb Show resolved Hide resolved
</div>

<div class="reveal">
<p><a href="#" class="reveal__link"><%= t('.donate_impact_heading') %></a></p>
Copy link
Contributor

Choose a reason for hiding this comment

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

change to <button class="reveal__button"> after merging in main

Copy link
Contributor

Choose a reason for hiding this comment

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

@mrotondo bump

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

</div>

<div class="reveal">
<p><a href="#" class="reveal__link"><%= t('.why_are_you_asking_heading') %></a></p>
Copy link
Contributor

Choose a reason for hiding this comment

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

change to <button class="reveal__button"> after merging main

Copy link
Contributor

Choose a reason for hiding this comment

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

@mrotondo bump

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -36,6 +36,10 @@ def initialize(json)
@data = JSON.parse(json || "{}")
end

def to_s
@data.to_s
end
Copy link
Contributor

Choose a reason for hiding this comment

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

why was this added?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. I originally added it because I incorrectly used it on state_file_id_intakes.rb:122 instead of to_json, but now that I look more closely, I introduced a bug when I switched over to calling to_json, as it's now returning a json string of the entire DirectFileJsonData object (i.e. it has {data: {...}}) instead of just its stored json object. So this needs to be changed to a to_json that exposes @data, e.g.

def to_json
  @data.to_json
end

or

delegate :to_json, to: :data

Copy link
Contributor

Choose a reason for hiding this comment

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

@mrotondo does this still need to be addressed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done & added a test to verify

@anisharamnani
Copy link
Contributor

since @mrotondo is out today & we spent time working on this, i am going to give it a go addressing merge conflicts & handle some of the questions. 🤞

@mrotondo
Copy link
Contributor Author

mrotondo commented Nov 4, 2024

Thanks for hopping in @anisharamnani! Just popping my head up to answer a few questions.

# Conflicts:
#	app/javascript/lib/honeycrisp.js
#	app/lib/efile/id/id40_calculator.rb
#	app/lib/efile/line_data.yml
#	app/lib/navigation/state_file_id_question_navigation.rb
#	app/lib/pdf_filler/id40_pdf.rb
#	app/lib/submission_builder/ty2024/states/id/documents/id40.rb
#	app/models/state_file_base_intake.rb
#	app/models/state_file_id_intake.rb
#	config/locales/en.yml
#	config/locales/es.yml
#	db/schema.rb
#	spec/factories/state_file_id_intakes.rb
#	spec/features/state_file/complete_intake_spec.rb
#	spec/lib/efile/id/id40_calculator_spec.rb
#	spec/lib/submission_builder/ty2024/states/id/documents/id40_spec.rb
#	spec/models/efile_error_spec.rb
#	spec/models/state_file_id_intake_spec.rb
app/javascript/lib/honeycrisp.js Fixed Show fixed Hide fixed
app/javascript/lib/honeycrisp.js Fixed Show fixed Hide fixed
@anisharamnani
Copy link
Contributor

hello @mrotondo! this is just a note for when you return, @mpidcock and i were able to make a merge in main and resolve the merge conflicts. 🎉

we've found that this issue you mentioned in slack is still occurring where if you select yes, then select no, the calculations still appear on the following page.

something may have changed with the merge conflicts to create this error? i am not sure, but we felt like we got as far as we could go with it.

$(this).find('input').each(function (index, input) {
if ($(this).attr('data-follow-up') != null) {
if ($(this).is(':checked')) {
$($(this).attr('data-follow-up')).find('input, select').attr('disabled', false);

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML Medium

DOM text
is reinterpreted as HTML without escaping meta-characters.
if ($(this).attr('data-follow-up') != null) {
if ($(this).is(':checked')) {
$($(this).attr('data-follow-up')).find('input, select').attr('disabled', false);
$($(this).attr('data-follow-up')).show();

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML Medium

DOM text
is reinterpreted as HTML without escaping meta-characters.
app/javascript/lib/honeycrisp.js Dismissed Show dismissed Hide dismissed
app/javascript/lib/honeycrisp.js Dismissed Show dismissed Hide dismissed
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.

5 participants