-
Notifications
You must be signed in to change notification settings - Fork 0
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
Country field added for international schools #42
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #42 +/- ##
==========================================
- Coverage 86.29% 86.18% -0.11%
==========================================
Files 20 20
Lines 693 695 +2
==========================================
+ Hits 598 599 +1
- Misses 95 96 +1 ☔ View full report in Codecov by Sentry. |
@razztech Nice job! This is a significant amount of work. I have a few notes for this PR:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! It seems very good overall 🙌 just some tiny things here and there regarding testing and some clean up.
New notes for today's customer meeting with Michael:
|
@razztech LGTM. Just for future reference, I find it helpful to use the <script>
$(document).ready(function() {
const countrySelected = $('#school_country');
const stateSelectContainer = $('#state_select_container');
const stateTextfieldContainer = $('#state_textfield_container');
const stateSelect = $('#state_select');
const stateTextfield = $('#state_textfield');
function handleCountryChange() {
if (countrySelected.val() === 'US') {
stateSelectContainer.show().attr('required', true);
stateTextfieldContainer.hide();
stateTextfield.removeAttr('name');
stateSelect.attr('name', 'school[state]');
} else {
stateTextfieldContainer.show().attr('required', false);
stateSelectContainer.hide();
stateSelect.removeAttr('name');
stateTextfield.attr('name', 'school[state]');
}
}
countrySelected.change(handleCountryChange);
handleCountryChange();
});
</script> |
Just finished review. Looks to me as well, and I helped fix the reviews I came up, plus adding a new test for undesired user behavior |
Thank you @perryzjc! |
65f2484
to
772f2df
Compare
Pivotal Tracker Link
What this PR does:
This PR adds the country field to the school model. Whenever a new school is created, the option to select a country is available. Moreover, the country data is introduced in tables, teacher and school information panels and in the backend. The UI logic either renders a textfield if the country selected when creating a school is not the US or a dropdown of US states if the selected country is the US.
Include screenshots
Who authored this PR?
How should this PR be tested?
What do the specs/features test?
Are there edge cases to watch out for?
No.
Migration
rails db:migrate
to update the modelNew Gems
country_select
gem for the country dropdown that includes thecountries
andunaccent
gemsbundle install
to use these gemsChecklist:
michael/12345-add-new-feature
Any branch name will do as long as the story ID is there. You can usegit checkout -b [new-branch-name]
)