[DEV ONLY] Weedy - sprint16 #143810729 ui custom reason waiting#1
Conversation
| .container | ||
| #other-text-field | ||
| = label_tag :custom_reason_text, t('membership_applications.need_info.other_reason_label') | ||
| = text_field_tag :custom_reason_text, @membership_application.custom_reason_text |
There was a problem hiding this comment.
I removed the form as it was not needed and also caused bugs. (in your feature branch, enter a custom reason and hit "enter" key - you will see an error alert - this is because after the AJAX stuff happens, the form is also submitted to the controller action (not what we want).
I added the "custom reason" item to the select_tag collection. I hacked it up here but it should probably be returned from a helper method. (also, note the ugly way that I am finding the current selected value for the select collection. This can be removed when we refactor the custom reason into the AdminOnly::MemberAppWaitingReason model).
I also added the currently-selected option to the options collection.
I refactored the "onchange" stuff to the DOM-ready function.
I also simplified the ID for the select list and the text_field. (this make for easier read of the code, IMO)
| :javascript | ||
|
|
||
| let reasons_list = document.getElementById('membership_application_member_app_waiting_reasons_id'); // the select HTML element (list) | ||
| let reasons_list = $('#member_app_waiting_reasons'); // the select HTML element (list) |
There was a problem hiding this comment.
You're using both straight JSAPI as well as Jquery - thought it best to just use Jquery throughput.
|
|
||
| function selected_is_customOtherReason() { | ||
| return reasons_list.value === other_reason_option.value; | ||
| return $('#member_app_waiting_reasons option:selected').text() === other_reason_option.text; |
There was a problem hiding this comment.
Your statement did not work for me - it could be because I converted to query(?).
|
|
||
| let initialize = (function() { | ||
| reasons_list.options.add(other_reason_option); // add the other_reason to the list | ||
| // reasons_list.options.add(other_reason_option); // add the other_reason to the list |
There was a problem hiding this comment.
Not needed since I added the option directly to the options passed to select_tag.
Also, this statement was causing a test failure when I used poltergeist as the web driver. I then tried using Selenium and it worked. I have seen poltergeist have trouble with some JS code before, and Selenium generally does a better job with tricky JS.
| // reasons_list.options.add(other_reason_option); // add the other_reason to the list | ||
| hideOrShowCustomReasonElements(); | ||
| $('#member_app_waiting_reasons').on('change', changed_reason); | ||
| $('#custom_reason_text').on('change', changed_custom_text) |
There was a problem hiding this comment.
Here are the refactored 'onchange' triggers.
| create_table "users", id: :bigserial, force: :cascade do |t| | ||
| t.string "email", default: "", null: false | ||
| t.string "encrypted_password", default: "", null: false | ||
| t.string "reset_password_token" |
There was a problem hiding this comment.
I'm not sure how these differences occurred (did not change any migration file). Hopefully they are innocuous ...
|
|
||
| # it is important that this statement is first so that tables are empty, so that things will be seeded | ||
| Given the system is seeded with initial data | ||
| # Given the system is seeded with initial data |
There was a problem hiding this comment.
Since we now add the "custom reason" selection directly (no longer from the DB) this background step is not needed.
|
|
||
|
|
||
| @admin | ||
| @admin @javascript |
There was a problem hiding this comment.
I can't see how the tag @admin also pulled in poltergeist, so added that explicitly.
| Before('@selenium') do | ||
| # For JS-driven tests that Poltergeist does not handle cleanly. | ||
| Capybara.javascript_driver = :selenium | ||
| end |
There was a problem hiding this comment.
This is a hold-over from when I was testing with Selenium. We don't need this change.
|
@weedySeaDragon - see comments in code tab. I still have 4 failures occurring in Those all come from |
|
I think one or two of the failures could be due to this kind of step: The step method for this is: I think that this step will fail because even though the |
|
|
||
| group :test do | ||
| gem 'poltergeist' | ||
| gem 'selenium-webdriver' |
There was a problem hiding this comment.
I had 4 remaining failing cuke tests that will (so far) only run successfully when using Selenium.
| rubyzip (>= 1.2.1) | ||
| sanitize | ||
| sass-rails (~> 5.0) | ||
| selenium-webdriver |
There was a problem hiding this comment.
Need this gem for Selenium driver.
ecc7b69 to
31a1bdb
Compare
* Bump rack from 2.2.3 to 2.2.3.1 Bumps [rack](https://github.com/rack/rack) from 2.2.3 to 2.2.3.1. - [Release notes](https://github.com/rack/rack/releases) - [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md) - [Commits](rack/rack@2.2.3...2.2.3.1) --- updated-dependencies: - dependency-name: rack dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * semaphore: install missing libpng12-0 library (try #1) * use wget to install libpng-12 manually Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ashley Engelund (weedySeaDragon @ github) <ashley@ashleycaroline.com>


This "PR" compares changes in my feature branch against the baseline feature branch from Ashley.
Related to the story in the title.
Changes proposed in this pull request:
1.
2.
3.
Screenshots (Optional):
Ready for review:
@weedySeaDragon