Commit graph

14 commits

Author SHA1 Message Date
ktmouk
8963e185f8
Fix username combobox tries to load all users (#20227)
* Fix username combobox tries to load all users

* Add the limit param to the users_query

* Add a comment
2023-10-25 15:53:53 -04:00
Anna Buianova
2d6b740940
Renamed DisplayAd model to Billboard (#19993)
* Renamed Resource Admin: DisplayAd to Billboard

* Renamed DisplayAd to Billboard

* Added a data update script for roles
2023-08-28 08:09:36 -04:00
Mac Siri
842e6880b8
Routine rubocop fix on /spec (#19217)
* Softrun rubocop

* Hardrun rubocop (-A)

* Change a rubocop rule

* Add missing cops

* Undo & redo rubocop -A
2023-03-21 09:55:26 -04:00
Suzanne Aitchison
8bfad257f9
ensure all test users are explicitly named (#18181) 2022-07-20 09:34:05 -06:00
Joshua Wehner
9bd93602ba
Admin can attach user via username (#18056)
* 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>
2022-07-18 14:17:45 +02:00
Suzanne Aitchison
5e8fae9ddc
Member index: Filter by status (#17980)
* 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.

Closes forem/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>
2022-07-14 17:32:31 +01:00
Suzanne Aitchison
76c7932b09
Member index: Filter by joining date (#17975)
* 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
2022-07-14 14:52:42 +01:00
Suzanne Aitchison
d57e4cabb7
Member index: filter by organizations (#17943)
* 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>
2022-06-21 13:32:50 +01:00
Jeremy Friesen
b4f17ed7dc
Allowing UserQuery to filter on multiple roles (#17919)
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
2022-06-15 08:50:03 -04:00
Julianna Tetreault
b155749db0
Searchable GDPR Delete Requests Table (#17633)
* Adds search functionality to GDPR delete requests table

* Adds e2e tests for searching GDPR delete requests

* WIP: Address PR review feedback and add a RSpec test

* Updates spec name to include _query

* Updates Adnub::GDPRDeleteRequests#index

* Adjusts expectations within gdpr_delete_requests_query_spec.rb

* Adjusts GDPR Delete Requests Query search default

* Updates gdpr_delete_requests_query_spec.rb
2022-05-31 16:22:25 -06:00
Jacob Herrington
a5b2d109d5
Rename banned and comment_banned roles (#12270)
* 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>
2021-04-06 10:12:14 -05:00
Ben Halpern
0e712f77b0
Add all new functionality for trusted (#10816) 2020-10-15 17:00:49 -04:00
Diogo Osório
3bc51a13cc
Fixes 500 error when viewing the "Tag Mods" page without having the role on the database (#10515)
* 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
2020-10-01 12:55:25 -06:00
Josh Puetz
1c566e0ec4
[deploy] Move /internal to `/admin (#9639)
* 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
2020-08-07 10:36:26 -04:00