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

3765 disallowed request type bug #2

Open
wants to merge 52 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
8a6cda6
Updated bootstrap dependency.
jamesiarmes Jul 28, 2023
850257b
Replace deprecated CSS property.
jamesiarmes Jul 28, 2023
132be10
remove unused partial
Jul 28, 2023
5170bf7
explicitly adding webpack to the precompile manifest
Jul 28, 2023
15b1531
Bootstrap 5 changes: add .btn-close, replaced .rounded-sm and rounded-lg
Jul 28, 2023
0162d0d
Bootstrap 5 upgrade: `data-toggle` => `data-bs-toggle`
Jul 28, 2023
f9e3647
Bootstrap 5: data-bs-target
Jul 28, 2023
b744a2b
Bootstrap 5: data-bs-dismiss
Jul 28, 2023
0bdfc06
Updated bootstrap dependency.
jamesiarmes Jul 28, 2023
aba8066
Fixed barcode lookup modal.
jamesiarmes Jul 28, 2023
d43a4fa
Fixed linting errors.
jamesiarmes Jul 28, 2023
d26bf32
Updated popper to use the bundled version.
jamesiarmes Jul 28, 2023
be11dfc
Fixed staging environment modal.
jamesiarmes Jul 28, 2023
e4485df
Bootstrap 5: deprecated badge-* classes
Jul 29, 2023
824c30d
Bootstrap 5: sr-only => visually-hidden
Jul 29, 2023
b90cd50
Bootstrap 5: custom-* form classes => form-* classes
Jul 29, 2023
c0a5ffe
Add test section for organization request type bug
torienyart Jul 31, 2023
a77c988
Merge branch 'main' into 3765-disallowed-request-type-bug
torienyart Jul 31, 2023
44a4498
Adjust test file
torienyart Aug 1, 2023
4062aa3
Add test for debugging disallowed partner request types
torienyart Aug 3, 2023
580d638
Merge branch 'main' into bootstrap5
awwaiid Aug 5, 2023
03d5561
Add test for organization update service edge casing in disallowed re…
torienyart Aug 7, 2023
bcb4043
Update webpage presentation test for disallowed request type case
torienyart Aug 7, 2023
b1d63d0
Update existing edge case catcher for disallowed request types to use…
torienyart Aug 7, 2023
2a847f0
Add light refactors for spacing and encapsulation
torienyart Aug 7, 2023
d0b2473
Merge branch 'main' into 3765-disallowed-request-type-bug
torienyart Aug 7, 2023
2b56a90
Merge remote-tracking branch 'origin/main' into bootstrap5
awwaiid Aug 13, 2023
55b2f18
Merge branch 'main' of https://github.com/rubyforgood/human-essential…
torienyart Aug 22, 2023
4b65761
Adjust name querying for invalid partners to appear in calling function
torienyart Aug 22, 2023
d2a6b14
Remove unnecessary test from Organization System Spec
torienyart Aug 22, 2023
ff99d7e
Merge branch 'main' into bootstrap5
awwaiid Aug 27, 2023
6260f68
Move logic for false instead of false to organization controller method
torienyart Sep 4, 2023
2e834e6
Merge branch 'main' into 3765-disallowed-request-type-bug
torienyart Sep 4, 2023
d2a9462
Merge branch 'main' into 3765-disallowed-request-type-bug
torienyart Sep 13, 2023
6d4fea3
Restart bin:
torienyart Sep 13, 2023
279b263
Merge remote-tracking branch 'origin/main' into bootstrap5
awwaiid Sep 17, 2023
a160d17
Fix gemfile after conflict fix
awwaiid Sep 17, 2023
8f6e65d
Merge branch 'main' of https://github.com/rubyforgood/human-essential…
torienyart Sep 19, 2023
ff7922a
Remove extraneous save_and_open_page
torienyart Sep 19, 2023
0711679
Fix formatting according to lint
torienyart Sep 19, 2023
5f459b9
Bump rubocop-performance from 1.19.0 to 1.19.1
dependabot[bot] Sep 18, 2023
387abdf
Bump puma from 6.3.1 to 6.4.0 (#3890)
dependabot[bot] Sep 22, 2023
1f99d2a
Bump knapsack_pro from 5.6.0 to 5.7.0 (#3891)
dependabot[bot] Sep 22, 2023
ee9fc91
Bump strong_migrations from 1.6.2 to 1.6.3 (#3892)
dependabot[bot] Sep 22, 2023
960fad6
Merge branch 'main' into bootstrap5
awwaiid Sep 24, 2023
6f2be9d
Merge pull request #3779 from rubyforgood/bootstrap5
awwaiid Sep 24, 2023
a90f819
Bypass safeties on this migration. It's fine! [HOTFIX]
awwaiid Sep 24, 2023
e1affc0
Merge pull request #3893 from rubyforgood/awwaiid/hotfix-migration
awwaiid Sep 24, 2023
03d209c
Update from upstream
torienyart Sep 27, 2023
a4a3136
Merge branch 'main' into 3765-disallowed-request-type-bug
torienyart Sep 27, 2023
7b89fc5
Add suggested sleep to purchase system spec to solve failing test
torienyart Sep 27, 2023
db5e0eb
Increase sleep time in purchase system specs to allow UI to catch up
torienyart Sep 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ gem "paper_trail"
# Associates users with roles.
gem "rolify", "~> 6.0"
# Enforces "safe" migrations.
gem "strong_migrations", "1.6.2"
gem "strong_migrations", "1.6.3"

##### JAVSCRIPT/CSS/ASSETS #######

# Bootstrap is a library for HTML, CSS and JS.
gem 'bootstrap', '~> 4.6.0'
gem 'bootstrap', '~> 5.2'
# SASS CSS framework (nested selectors, variables, etc.)
gem "sass-rails"
# Used to verify that the user is a human.
Expand Down Expand Up @@ -199,8 +199,8 @@ group :test do
gem 'simplecov'
# More concise test ("should") matchers
gem 'shoulda-matchers', '~> 5.3'
# Nice interface to Chrome, handles updates itself now
gem 'selenium-webdriver'
# Selenium webdriver automatic installation and update.
gem 'selenium-webdriver', '~> 4.10'
# Mock HTTP requests and ensure they are not called during tests.
gem "webmock", "~> 3.19"
end
Expand Down
81 changes: 40 additions & 41 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ GEM
activerecord (>= 3.2, < 8.0)
rake (>= 10.4, < 14.0)
ast (2.4.2)
autoprefixer-rails (10.3.3.0)
autoprefixer-rails (10.4.13.0)
execjs (~> 2)
awesome_print (1.9.2)
azure-storage-blob (2.0.3)
Expand All @@ -84,17 +84,17 @@ GEM
net-http-persistent (~> 4.0)
nokogiri (~> 1, >= 1.10.8)
base64 (0.1.1)
bcrypt (3.1.18)
bcrypt (3.1.19)
better_errors (2.10.1)
erubi (>= 1.0.0)
rack (>= 0.9.0)
rouge (>= 1.0.0)
bindex (0.8.1)
binding_of_caller (1.0.0)
debug_inspector (>= 0.0.1)
bootstrap (4.6.1)
bootstrap (5.2.3)
autoprefixer-rails (>= 9.1.0)
popper_js (>= 1.14.3, < 2)
popper_js (>= 2.11.6, < 3)
sassc-rails (>= 2.0.0)
brakeman (6.0.1)
brow (0.4.1)
Expand Down Expand Up @@ -135,7 +135,7 @@ GEM
database_cleaner-core (2.0.1)
date (3.3.3)
debug_inspector (1.1.0)
delayed_job (4.1.10)
delayed_job (4.1.11)
activesupport (>= 3.0, < 8.0)
delayed_job_active_record (4.1.7)
activerecord (>= 3.0, < 8.0)
Expand Down Expand Up @@ -166,14 +166,14 @@ GEM
et-orbi (1.2.7)
tzinfo
execjs (2.8.1)
factory_bot (6.2.0)
factory_bot (6.2.1)
activesupport (>= 5.0.0)
factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0)
railties (>= 5.0.0)
faker (3.2.1)
i18n (>= 1.8.11, < 2)
faraday (1.10.2)
faraday (1.10.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
Expand Down Expand Up @@ -213,7 +213,7 @@ GEM
rack-protection (>= 1.5.3, <= 4.0.0)
sanitize (< 7)
foreman (0.87.2)
formatador (0.3.0)
formatador (1.1.0)
fugit (1.8.1)
et-orbi (~> 1, >= 1.2.7)
raabro (~> 1.4)
Expand Down Expand Up @@ -269,11 +269,11 @@ GEM
activerecord
kaminari-core (= 1.2.2)
kaminari-core (1.2.2)
knapsack_pro (5.6.0)
knapsack_pro (5.7.0)
rake
language_server-protocol (3.17.0.3)
launchy (2.5.0)
addressable (~> 2.7)
launchy (2.5.2)
addressable (~> 2.8)
letter_opener (1.8.1)
launchy (>= 2.2, < 3)
libv8-node (18.16.0.0-arm64-darwin)
Expand All @@ -291,7 +291,7 @@ GEM
loofah (2.21.3)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
lumberjack (1.2.8)
lumberjack (1.2.9)
magic_test (0.0.9)
capybara (>= 3.0)
pry
Expand All @@ -310,7 +310,8 @@ GEM
mini_racer (0.8.0)
libv8-node (~> 18.16.0.0)
minitest (5.20.0)
monetize (1.11.0)
money (~> 6.12)
monetize (1.12.0)
money (~> 6.12)
money (6.16.0)
i18n (>= 0.6.4, <= 2)
Expand All @@ -320,11 +321,11 @@ GEM
money (~> 6.13)
railties (>= 3.0)
multi_xml (0.6.0)
multipart-post (2.2.3)
mustermann (1.1.1)
multipart-post (2.3.0)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
nenv (0.3.0)
net-http-persistent (4.0.1)
net-http-persistent (4.0.2)
connection_pool (~> 2.2)
net-imap (0.3.7)
date
Expand All @@ -346,11 +347,11 @@ GEM
notiffany (0.1.3)
nenv (~> 0.1)
shellany (~> 0.0)
oauth2 (2.0.8)
oauth2 (2.0.9)
faraday (>= 0.17.3, < 3.0)
jwt (>= 1.0, < 3.0)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
rack (>= 1.2, < 4)
snaky_hash (~> 2.0)
version_gem (~> 1.1)
omniauth (2.1.1)
Expand Down Expand Up @@ -381,7 +382,7 @@ GEM
racc
pdf-core (0.9.0)
pg (1.5.4)
popper_js (1.16.0)
popper_js (2.11.8)
prawn (2.4.0)
pdf-core (~> 0.9.0)
ttfunk (~> 1.7)
Expand All @@ -408,13 +409,13 @@ GEM
binding_of_caller (~> 1.0)
pry (~> 0.13)
public_suffix (5.0.3)
puma (6.3.1)
puma (6.4.0)
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.7.1)
rack (2.2.8)
rack-protection (2.1.0)
rack
rack-protection (3.1.0)
rack (~> 2.2, >= 2.2.4)
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.8)
Expand Down Expand Up @@ -482,7 +483,7 @@ GEM
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.5)
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-rails (6.0.3)
Expand All @@ -495,7 +496,7 @@ GEM
rspec-support (~> 3.12)
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.12.0)
rspec-support (3.12.1)
rubocop (1.56.3)
base64 (~> 0.1.1)
json (~> 2.3)
Expand All @@ -510,7 +511,7 @@ GEM
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
rubocop-performance (1.19.0)
rubocop-performance (1.19.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.20.2)
Expand Down Expand Up @@ -555,15 +556,15 @@ GEM
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
sinatra (2.1.0)
mustermann (~> 1.0)
rack (~> 2.2)
rack-protection (= 2.1.0)
sinatra (3.1.0)
mustermann (~> 3.0)
rack (~> 2.2, >= 2.2.4)
rack-protection (= 3.1.0)
tilt (~> 2.0)
slop (3.6.0)
snaky_hash (2.0.0)
snaky_hash (2.0.1)
hashie
version_gem (~> 1.1)
version_gem (~> 1.1, >= 1.1.1)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
Expand All @@ -585,12 +586,12 @@ GEM
rubocop-performance (~> 1.19.0)
stimulus-rails (1.2.2)
railties (>= 6.0.0)
strong_migrations (1.6.2)
strong_migrations (1.6.3)
activerecord (>= 5.2)
terser (1.1.18)
execjs (>= 0.3.0, < 3)
thor (1.2.2)
tilt (2.0.10)
tilt (2.2.0)
timeout (0.4.0)
ttfunk (1.7.0)
turbo-rails (1.4.0)
Expand All @@ -601,7 +602,7 @@ GEM
concurrent-ruby (~> 1.0)
unicode-display_width (2.4.2)
uniform_notifier (1.16.0)
version_gem (1.1.0)
version_gem (1.1.3)
warden (1.2.9)
rack (>= 2.0.9)
web-console (4.2.1)
Expand All @@ -613,15 +614,13 @@ GEM
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.7.0)
websocket (1.2.9)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
yard (0.9.28)
webrick (~> 1.7.0)
yard (0.9.34)
zeitwerk (2.6.11)

PLATFORMS
Expand All @@ -639,7 +638,7 @@ DEPENDENCIES
azure-storage-blob
better_errors
binding_of_caller
bootstrap (~> 4.6.0)
bootstrap (~> 5.2)
brakeman
bugsnag
bullet
Expand Down Expand Up @@ -707,14 +706,14 @@ DEPENDENCIES
rubocop-rails (~> 2.20.1)
rufus-scheduler
sass-rails
selenium-webdriver
selenium-webdriver (~> 4.10)
shoulda-matchers (~> 5.3)
simple_form
simplecov
sprockets (~> 4.2.1)
standard (~> 1.31)
stimulus-rails
strong_migrations (= 1.6.2)
strong_migrations (= 1.6.3)
terser
turbo-rails
web-console
Expand All @@ -724,4 +723,4 @@ RUBY VERSION
ruby 3.1.2p20

BUNDLED WITH
2.4.19
2.4.20
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ You can sign up [here](https://rubyforgood.slack.com/join/shared_invite/zt-1kfei

```
Organization Admin
Email: org_admin1@example.com
Email: org_admin1@example.com
Password: password!

User
Expand Down
1 change: 1 addition & 0 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//= link filterrific/filterrific-spinner.gif
//= link bootstrap.min.js
//= link_tree ../images
//= link_directory ../stylesheets .css
//= link_tree ../../javascript .js
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/AdminLTE.css

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions app/controllers/organizations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def authorize_user
end

def organization_params
request_type_formatter(params)

params.require(:organization).permit(
:name, :short_name, :street, :city, :state,
:zipcode, :email, :url, :logo, :intake_location,
Expand All @@ -99,6 +101,22 @@ def organization_params
)
end

def request_type_formatter(params)
if params[:organization][:enable_individual_requests] == "false"
params[:organization][:enable_child_based_requests] = false
end

if params[:organization][:enable_child_based_requests] == "false"
params[:organization][:enable_individual_requests] = false
end

if params[:organization][:enable_quantity_based_requests] == "false"
params[:organization][:enable_quantity_based_requests] = false
end

params
end

def user_update_redirect_path
if current_user.has_role?(Role::SUPER_ADMIN)
admin_organization_path(current_organization.id)
Expand Down
6 changes: 3 additions & 3 deletions app/helpers/partners_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ def humanize_boolean_3state(boolean)

def partner_status_badge(partner)
if partner.status == "approved"
tag.span partner.display_status, class: %w(badge badge-pill badge-primary float-right)
tag.span partner.display_status, class: %w(badge badge-pill badge-primary bg-primary float-right)
elsif partner.status == "recertification_required"
tag.span partner.display_status, class: %w(badge badge-pill badge-danger float-right)
tag.span partner.display_status, class: %w(badge badge-pill badge-danger bg-danger float-right)
else
tag.span partner.display_status, class: %w(badge badge-pill badge-info float-right)
tag.span partner.display_status, class: %w(badge badge-pill badge-info bg-info float-right)
end
end
end
4 changes: 2 additions & 2 deletions app/helpers/ui_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def dropdown_button(id, options = {})
options[:id] = id
additional_properties = {
data: {
toggle: "dropdown"
"bs-toggle": "dropdown"
},
"aria-haspopup": true,
"aria-expanded": true
Expand Down Expand Up @@ -97,7 +97,7 @@ def js_button(options = {}, properties = {})
end

def modal_button_to(target_id, options = {})
properties = { data: { toggle: "modal" } }
properties = { data: { "bs-toggle": "modal" } }
_link_to target_id, { icon: "dot-circle-o", type: "outline-primary", text: "Set 'text' option", size: "md" }.merge(options), properties
end

Expand Down
Loading
Loading