* Admin can attach user via username
* Formatting
* Match @username as seen elsewhere
* Matching for accessibility
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Formatting cleanup after merge
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* show the statuses in the modal
* filter the results
* add some todo around good standing
* Enable Rails framework 7.0's isolation_level, partial_inserts, & raise_on_open_redirects (#17970)
* Member index: Show applied org filters (#17977)
* show applied org filters
* correct casing
* API V1 transition (#17835)
* API Articles v0-v1 restructure
* Remove unused helper
* Bulk move API controllers into concerns + add V1 controllers
* Extract API routes + some fixes
* Fix v1 api_controller authenticate! + add more article_controller specs
* Completed spec/requests/api/v1/articles_spec.rb
* specs up to listings
* All v1 specs except for 9 skips
* mime_types cleanup + authenticate! relocation
Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
* Fix email confirmation logic when registering via Omniauth (#17878)
* Move .skip_confirmation! call to .find_or_create_user! method
* Add regression tests to avoid email confirmation delivery
* Keep the original place where we had user.skip_confirmation! too
* Update logic to require email confirmation from omniauth
* test confirmation is required with SMTP
* Keep :notice instead of :global_notice
* Forem Account bypass email confirmation reorg
* inline comment reorder + clarification
* Apply suggestions from code review
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
* Member Index View Actions: "Adjust Credit Balance" (#17974)
* Adds the Adjust credit balance modal to index view
* Adds e2e tests for adjusting credit balances via modal
* Adds the ability to update credits to #user_status
* Adjusts the e2e to address failures
* Introducing a quick and dirty fix for abtests/admin (#17982)
This is a "quick and dirty" hack. Do I like it? No. Do I want to delve
into further debugging/refactoring of [a 72 line method][1]? Not at the
moment. There are a few pathways forward, but for now, this is the
pathway to hopefully give us insight into the
**Why will this likely address the issue?**
Prior to this commit, for an experiment we would render each of the
goals (anywhere from 8 to 11); each of which would require 2 expensive
queries; which means about 16 expensive queries.
After this commit, the experiment page has none of those expensive
queries; instead each goal now runs the 2 expensive queries.
The hope is that this will help us show the results (albeit on multiple
pages) while coming in under the response time out handlers we have in
place.
**Why no tests?**
Ugh; I know right?!? I'm beginning to ask that myself. But for now,
because this is only visible to tech_admins, the consequences of
breaking are limited. In otherwords, this is not a customer facing
feature, so it can be a bit less robust in it's testing. At least
that's the rationalization I'm establishing.
Further, local tests would not reveal the production environment
complications of large data sets. The aforementioned expensive queries
are blisteringly fast on my local machine...in part because I don't much
field_test experiment data.
Closesforem/forem#17981
Related to:
- forem/forem#17895
- forem/forem#17869
[1]:ab2d7d29d0/lib/field_test/experiment.rb (L98-L160)
* Adding test for redundant roles
* Adding filter for roles
* forget about good standing status
* remove good standing specs
* Update app/helpers/admin/users_helper.rb
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* appease rubocop
* simplify
* add e2e tests
* add the applied filter pills for status
* make sure clear all button shows
* add a comment to explain good standing
* tweak
* set the registered dates of test users
Co-authored-by: Mac Siri <mac@forem.com>
Co-authored-by: Fernando Valverde <fernando@fdo.cr>
Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
Co-authored-by: Jeremy Friesen <jeremy.n.friesen@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* add the date picker into view
* allow date picker to overflow modal
* allow aria labels to be passed to inputs
* filter records
* add missing comment
* set earliest date
* specs and a small fix
* cypress spec
* fix typo
* tidying up
* fetch date_format
* commit code review suggestion to params
* Revert "commit code review suggestion to params"
This reverts commit 84fb0e0d3acc13257a362eb41c17b2bb8089606a.
* show added filter pill
* add cypress specs for applied filters
* woops! fix unintended change to filter code
* show the organizations checkboxes
* apply clear filter button and indicator
* filter by org in users query
* add some rspec tests
* add cypress specs
* correct cypress spec
* Fixing UsersQuery to ensure singular user by organization
Co-authored-by: Jeremy Friesen <jeremy.n.friesen@gmail.com>
I had looked at using `User.with_any_roles` but that creates one User
query per role passed. Which is not ideal, given that we want to have
an ActiveRecord::Relation object on which we'd paginate.
This adjustment does it's best to mimic Forem's role structure and
adhear to how Rolify builds the underlying query.
An astute reader will notice that in these specs we use `role: "admin"`
and `roles: ["Admin"]`; the primary reason relates the user interface
being worked on in forem/forem#17884. It is my understanding that the
`role` approach and `roles` approach will be separated by a feature
flag (we're rolling out the `roles` approach).
Related to
- forem/forem#17491
- forem/forem#17884
* Rename banned and comment_banned roles
* Add data update script to rename roles containing 'ban'
* Add named error for Suspended users
* Update unidiomatic method names
* Rename misc banned to suspended
* Apply suggestions from code review
Co-authored-by: Michael Kohl <me@citizen428.net>
* Add unit tests for suspended methods
This commit also adds TODO comments for removing banned and
comment_banned from the codebase after data update scripts have
successfully run on all of our Forems.
Co-authored-by: Michael Kohl <me@citizen428.net>
* Makes the ModeratorsQuery not return an exception on invalid role
The current implementation of the query would yield an exception when
recieving an invalid state parameter. As per the [GH issue
discussion](https://github.com/forem/forem/issues/10060#issuecomment-692295217),
Zhao recommended to change its behaviour and not trigger an exception in
this condition.
This commit does just that. If the state argument is invalid, the query
now returns an empty result set.
* Adds a warning when there are no matching mods
* Re-trigger the build
* First draft - all the big changes
* Changing some more references to 'internal'
* Relocate internal request tests to admin
* Relocate internal system tests to admin
* Fix trailing space
* Test fix
* Move queries from internal to admin
* Docs updates
* Rename internal stimuls controllers to admin (plus docs)
* Rename admin layout
* Fix routing after rebase
* Fixes for latest added admin interfaces
* Serviceworker ignore paths