Commit graph

66 commits

Author SHA1 Message Date
Anna Buianova
784afdf41e
Routine rubocop fixes (#19254)
* Rubocop fixes

* Rubocop fixes

* Fixed rubocop violation

* Fixed policies rubocop violations

* More rubocop fixes
2023-03-24 14:37:44 +03:00
Anna Buianova
9bb5b81fc5
Display information about "unpublish all" actions in the member manager (#18576)
* Query audit_log + target records for display in the member manager

* Display information about logged unpublished articles and comments

* Display information if the post was republished

* Added specs for unpublish_log tab on user's page in the member manager

* Fixed specs

* Change the wording for displaying info about unpublish all actions
2022-10-14 15:46:53 +03:00
Fernando Valverde
0a0e2b0a7f
Ensure super moderator actions Note & AuditLog (#18569)
* Specs - before including changes requires

* Include AuditLog Subscribe listen/forget directives

* Ensure Notes (w/ default content) + AuditLog

* Remove old spec - no longer needed
2022-10-12 09:36:41 -06:00
Anna Buianova
9d755a9d2f
Save list of previously-published articles when user is subject to an "un-publish all" action (#18535)
* Moved logging and deleting comments to Moderator::UnpublishAllArticlesWorker

* Added logging for admin action (unpublish_all_articles)

* Extracted code from UnpublishAllArticlesWorker to the service

* Make it possible to add a note while unpublishing all via admin action

* Added ability to add notes for unpublishing all from moderator action panel

* Fixed setting slug for the AuditLog on unpublishing + spec
2022-10-06 14:17:20 +03: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
Dwight Scott
50e2131079
mod panel update unpublish all posts action 17709 (#17923) 2022-06-27 16:50:31 -04:00
Arit Amana
750d379807
Allow ModRole & Admin to Suspend & Unsuspend User (#17946)
* gotta commit at some point

* out of gas

* IT'S WORKING NOW! 💥

* Cypress tests

* fix Travis failures

* incorporate PR review suggestions

* fix one failing Cypress test

* update API call

* add Unsuspend flow; fix Travis failures

* add tests for unsuspend flow

* remove unnecessary atrribute

* add article_policy spec

* fix failing Travis

* nudge Travis

* fix apparent typo  o o 🤷

* refactor a bunch of duplication

* nudge Travis

* fix Cypress failure related to authorizing moderator for user_status action

* rename modal partial

* remove unnecessary button-exists check

* address PR review suggestions

* hide suspend user btn after action

* toggle btn based on author suspension status

* add data-testids

* use data-testids

* controller refactor
2022-06-27 12:45:35 -04:00
Julianna Tetreault
ec55329a3a
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
2022-06-23 14:30:10 -06: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
8e4b6581e2
Member Index View Actions: "Assign Role" (#17866)
* Adds the Assign Role modal to the Member Index View

* Adds e2e tests for the Assign role modal

* WIP: Conditionally redirects to the correct view upon assigning a role

* Conditionally renders the redirect in the correct method :|

* Adjusts the conditional redirect to account for ID

* Adds an even more explicit check for the correct refferer
2022-06-10 07:22:03 -06:00
Ridhwana
3fc6108651
Remove GDPR from the "users" namespace (#17536)
* feat: update all the paths as a first order of business

* feat: update all the folders to no longer appear under users

* feat: update specs

* feat: update specs

* feat: remove User namespace

* feat: remove route namespace

* feat: path change

* feat: update url
2022-05-03 19:42:20 +02:00
Daniel Uber
42aad1d7e0
fix typo (#17497) 2022-04-27 16:52:28 -05:00
yheuhtozr
ef290a5120
controllers/admin i18n (#17085)
* admin controllers i18n

* remove ja.yml

* fix for spec

* fix for spec 2

* Apply suggestions from code review

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

* Update config/locales/controllers/admin/fr.yml

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2022-04-26 09:40:09 -06:00
Ridhwana
c520cd9b5f
Limit an organizations displayed and add an overflow count (#17339)
* feat: add an overflow count

* fix: alignment

* refactor: pass in variables more cleanly into partials for re-use in tooltips

* refactor: improve the user helpers

* chore: indentation

* Update app/helpers/admin/users_helper.rb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/helpers/admin/users_helper.rb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/helpers/admin/users_helper.rb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update spec/helpers/admin/users_helper_spec.rb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-04-20 13:10:17 +02:00
Ridhwana
2746e77fd5
Adding a modal for the CSV export (#17259) 2022-04-14 18:19:28 +02:00
Julianna Tetreault
760a51f5f7
Refactor Member Index View Users Query (#17251)
* Moves eager loading from _member_index view to Admin::UsersController

* Adds .registered to Admin::UsersQuery
2022-04-12 11:20:28 -06:00
Julianna Tetreault
471472d0b0
Add Internationalization to Admin::UsersController Success Messages (#17252)
* Adds internationalization to Admin::UsersController success messages

* Adds a new line at the end of en.yml and fr.yml

* Removes perriod from update_success message
2022-04-12 09:00:55 -06:00
Ridhwana
aff29406ac
First version of exporting the Users to a CSV (#17217)
* feat: add the export route

* feat: base export csv

* refactor: move the svg into its own file

* feat: add the export partial

* feat: export teh correct fields etc. for the csv

* user status helper

* feat: ensure that we format the time

* feat: add a spec for the CSV

* remove space

* remove puts

* chore: remove blank space

* feat: update traits

* Update app/views/admin/users/export.csv.erb

Co-authored-by: Jamie Gaskins <jgaskins@hey.com>

* Update spec/requests/admin/users/users_export_spec.rb

Co-authored-by: Jamie Gaskins <jgaskins@hey.com>

* Update spec/requests/admin/users/users_export_spec.rb

Co-authored-by: Jamie Gaskins <jgaskins@hey.com>

* fix: export should not error for unregistered users

Co-authored-by: Jamie Gaskins <jgaskins@hey.com>
2022-04-12 15:24:32 +02:00
Julianna Tetreault
bf2973bdc4
Refactor the "Banish" Modal in the Member Detail View (#16757)
* Refactors _banish.html.erb by removing duplicate code

* Refactors _banish.html.erb to account for new and old users

* Moves conditional into Admin::UsersController#set_user_to_be_banished

* Reverts last commit, as it didnt work as expected

* Fixes last commit, which reverted to the incorrect code

* Pulls banishable user into instance var and fixes button txt
2022-03-17 10:36:10 -06:00
Julianna Tetreault
aa44786ebd
Remove admin_member_view Feature Flag-Related Conditionals (#16764)
* Removes admin_member_view feature flags and refactors  conditionals

* Removes unused admin/users/_email_tools partial and user_email_tools_spec

* Actually remove the admin/user_email_tools_spec this time

* Removes the edit route from admin.rb users

* Adds a DUS (and spec) to disable and remove admin_member_view flag

* Fixes admin/users_spec.rb failures by updating spec with Member Detail changes

* Fixes spec failures within admin_bans_or_warns_user_spec.rb

* Refactors Admin::UsersController#credit_params due to failing specs

* Removes last traces of edit_admin_user_path and fixes buttons, specs, etc.
2022-03-10 08:29:05 -07:00
Julianna Tetreault
b8a87b842b
Implement Tabs for the Admin Member Detail View (#16640)
* WIP: Adds tabs to the Admin Member Detail View

* WIP: Adds tabs in the least elegant way to Admin Member Detail View

* WIP: Comments out unused code

* WIP: Initial code set up for tabs

* feat: add a tab param to the route

* feat: set the current tab and direct to the overview tab in all other cases

* chore: remove all other unused code

* Renames @tab to @current_tab and MemberDetails to UserDetails

* Removes unused route and reverts renaming of params

* Removes unused route from admin.rb

* Adds an E2E test that tests tabbing through Admin Member Detail tabs

* Updates navigateTabs E2E and _tabs.html.erb per feedback

* Updates tnavigateTabs.spec.js

* Updates navigateTabs.spec.js per Suzannes suggestion :)

* Removes useless comment from Admin::UsersController

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2022-02-18 10:47:53 -07:00
Ridhwana
5e93d3a25e
Add a contact email address to the /admin/customization/config (#16497)
* feat: remove the default email and cobine the periodic digest and the contact email under the Email section

* refactor: rename  the email_link to contact link and use the contact_email as a default and fallback to the ForemInstance.email

* chore: alignment

* feat: use the contact_email helper

* feat: move the contact_email to the ForemInstance model

* feat: use ForemInstance.contact_email instead of the application helper method

* removed the application Helper

* feat: set the dafault on the contact_email

* fix: cypress tests

* Update app/lib/constants/settings/general.rb

Co-authored-by: Michael Kohl <me@citizen428.net>

Co-authored-by: Michael Kohl <me@citizen428.net>
2022-02-15 17:37:08 +02:00
Julianna Tetreault
8d1eb6f225
Adds flash messages when adding and removing credits from a User (#16531) 2022-02-11 06:14:09 -07:00
Julianna Tetreault
961f0a695a
Removes leftover comments from Admin::UsersController (#16530) 2022-02-10 10:50:43 -07:00
Julianna Tetreault
89706527b0
Remove "New Admin Member"-Related Code (#16475)
* Removes code behind new_admin_members feature flag

* Removes components/admin/users/tools/* and the tools components

* Removes unused /admin/users/tools/* controllers, comments, and routes

* Removes New Member View-related E2E and RSpec specs

* Remove admin_users_tools.rb frin spec/support/shared_examples/

* Removes remaining component-related specs

* Removes the view_component gem and test helper

* Resolve merge conflicts in Admin::UsersController

* Removes the view_component gem, as it is no longer used

* Removes view_component from Gemfile.lock
2022-02-10 06:42:56 -07:00
ludwiczakpawel
50a4f0422b
Admin's Member view (#16174)
* init

* .

* partials

* few extras

* revert indicators in favor of separate PR

* stuff

* .

* stuff

* whoops

* .

* .

* .

* .

* opacity

* partial

* cosmetics

* move actions to a partial

* whoopsy

* Added an @admin alias for the frontend and removed the @admin-controllers alias.

* Added modal support for admin user actions.

* Added modal support for more parts of the user admin.

* pills

* pills

* pills

* Added optional chaining for when the overview panel isn't loaded.

* styling updates

* fix

* modals

* pass size

* tags

* .

* balance modal

* comment

* fixes

* Improved modal trigger implementation.

* Removed default value for dataset.

* Moved prevent default to after modal trigger check so forms still submit.

* Update app/views/admin/users/widgets/_credits.html.erb

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

* Update app/views/admin/users/reports/_index.html.erb

* Apply suggestions from code review

* Apply suggestions from code review

* Update app/views/admin/users/actions/_export.html.erb

* Update app/views/admin/users/widgets/_tag_moderation.html.erb

* Update app/views/admin/users/actions/_merge.html.erb

* Removed <AdminUserActionsModal /> component as it wasn't necessary.

* Fixed duplicate ID errors detected by Axe.

* Redirects to the Show page rather than the Edit page

* Adjusts quotations within _social_accounts.html.erb

* Ensures that Learn More links open in new tab

* updates with latests and greatest

* .

* fixes

* wip. Fixed some issues in the credits form.

* Changed Subtract to Remove for credits dropdown.

* Cleaned up the edits form.

* Wraps functionality in feature flag and calls #set_user_details

* Wraps /admin/users/show.html.erb in feature flag

* wip: Got credit params form working.

* empty select

* responsiveness

* empty commiit

* Updates redirects in spec and controller to show rather than edit

* Updates tag moderation copy in Admin Member Detail View

* Now the note is saved when changing credits.

* Fixed label for attributes as it was affecting writing tests and a11y.

* Removes unused index.js component

* Refactored credit params.

* chore: move method under private and update comment

* verified email responsiveness

* better opacity variables

* better org logo

* indicators

* refactor the credits method

Co-authored-by: Nick Taylor <nick@dev.to>
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
Co-authored-by: Nick Taylor <nick@forem.com>
Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2022-02-09 14:33:01 +01:00
Daniel Uber
47663fd077
Show reactions to the user, rather than user created reactions to other users (#15243)
* Change display from "created by user" to "reacted to user"

The reaction user_id is the creator (who reacted) and not the
target (reacting to what). On the user edit page, show reactions to
the user, rather than reaction from the user.
2021-11-01 12:55:39 -05:00
Ben Halpern
333775b831
Admin productivity: Allow admins to unpublish all posts from a user (#15054)
* Allow admins to unpublish all posts from a user

* Update app/services/moderator/unpublish_all_articles.rb

Co-authored-by: Jamie Gaskins <jamie@forem.com>

* Update app/services/moderator/unpublish_all_articles.rb

Co-authored-by: Jamie Gaskins <jamie@forem.com>

* Update app/services/moderator/unpublish_all_articles.rb

Co-authored-by: Jamie Gaskins <jamie@forem.com>

* Unset `published` irrespective of front matter

* Change to worker and make other adjustments

* Fix controller test

* Fix object name

* Update app/views/admin/users/edit.html.erb

Co-authored-by: Andy Zhao <17884966+Zhao-Andy@users.noreply.github.com>

* Update spec/requests/admin/users_spec.rb

Co-authored-by: Jamie Gaskins <jamie@forem.com>

Co-authored-by: Jamie Gaskins <jamie@forem.com>
Co-authored-by: Jamie Gaskins <jgaskins@hey.com>
Co-authored-by: Andy Zhao <17884966+Zhao-Andy@users.noreply.github.com>
2021-10-15 08:56:59 +02:00
praveen raghav ns
80c8e49a85
Use constants for controller allowed params (#14815)
* Constants for controller allowed params

* Apply suggestions from code review

Co-authored-by: Michael Kohl <me@citizen428.net>

Co-authored-by: Michael Kohl <me@citizen428.net>
2021-09-28 16:30:56 +02:00
rhymes
7ff882b8ce
Refactor Admin Member Detail view - Tools section (#14283)
* Test with Grid layout

* Use Flexbox

* Replace with utility classes

* Wire up Tools -> Emails

* Stash: will rebase with a better commit message

* Fix transition between Email and Tools component

* Refactor Verify Email Ownership button a bit

* Use respond_to for verify_email_ownership

* Wrap the Preact Snackbar controller in Stimulus and use it from users/tools/email_controller

* Add HTML5 validation to EmailComponent

* Validation and cleanup

* Add Email history list and fix styling

* Additional styling cleanups

* Add error handling

* Close panel after email operations

* Actually use <local-time> GitHub time element correctly

* Add specs for Tools component and controller

* Email to Emails

* Add tests for Admin::Users::Tools::EmailsComponent

* Fix bug with ToolsComponent instantiation in ToolsController

* Add notes to show page

* Add ToolsComponent css

* Use Rails UJS instead of manual Stimulus to connect remote helpers

* Make Notes section come alive by adding its code

* Make Credits section come alive by adding its code

* Go back to vertical flex

* Finalize small restructuring of credits code

* Simplify ToolsComponent instantiation

* Add basic Add user to org functionality

* Make update user permissions form work

* Make remove user from org work

* Use generic Stimulus AjaxController to cleanup code

* Use Stimulus AjaxController for NotesComponent

* Use Stimulus AjaxController for CreditsComponent

* Use Stimulus AjaxController for OrganizationsController

* Add Admin::Users::Tools::ReportsComponent

* Do not display snackbar message if there is no message

* Add Admin::Users::Tools::ReactionsComponent

* Fix EmailsComponent spec

* Add CreditsComponent tests

* Fix quotes

* Add OrganizationsComponent specs

* Add ReportsComponent spec

* Add ReactionsComponent spec

* Fix rubocop violation

* Fix ToolsComponent specs

* Remove unused variable

* More tests

* Use keyword argument for ToolsComponent

* Fill in Tools requests specs

* Use Rspec shared_examples for ToolsController and EmailsController

* Add tests for Admin::Users::Tools::CreditsController

* Add tests for Admin::Users::Tools::NotesController

* Add tests for Admin::Users::Tools::OrganizationsController

* Add tests for Admin::Users::Tools::ReactionsController and ReportsController

* Fix bugs and add tests to Admin::OrganizationMembershipsController

* Add comments to deprecated sections of the UsersController

* Fix bugs and add tests to Admin::UsersController #send_email and #verify_email_ownership

* Add User model tests

* Feature flag fixes

* Add Cypress Tools - Emails tests

* Add Cypress Tools - Notes tests

* Add Cypress Tools - Credits tests

* Add Cypress Tools - Organizations tests

* Add Cypress Tools - Reports and Reactions tests

* Mark the replace target as a polite region

* Update view_component gem

* Tiny fixes

* Fix spec

* Wrap component rendering in render_component

* Move user.related_negative_reactions to a Reaction scope

* Move user.reports to a FeedbackMessage scope

* Move user.last_verification_date as EmailAuthorization class method

* Revert encapsulation to private

* Fix boxes backlinks names

* Add keyboard focus styling to boxes

* Remove duplicate styling

* Remove duplicated header element

* Improve heading hiearchy

* Fix <legend> and labels

* Backlink should be Tools not Users

* Announce section change to screen reader and fix focus

* Fix specs

* Add focus style for backlinks

* Enable email sending in e2e mode

* Use Settings instead of env variable
2021-08-17 18:55:53 +02:00
dependabot[bot]
816855ce3b
Bump rubocop from 1.17.0 to 1.18.0 (#14107)
* Bump rubocop from 1.17.0 to 1.18.0

Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.17.0 to 1.18.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.17.0...v1.18.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* yarn install

* Fix violations

* Restore the default aligned setting

* Trigger Travis CI

* Escape HTML

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: rhymes <github@rhymes.dev>
2021-07-01 13:51:49 +02:00
Anna Buianova
26592a3a9c
Removing Settings::General.email_addresses (#13958)
* Replaced Settings::General.email_addresses with Forem.email

* Removed Settings::General.email_addresses remainders

* Fixed schema.rb

* Remove Settings::General.email_addresses record

* Fixed label for default email
2021-06-11 12:34:34 +03:00
Anna Buianova
1862eb5cde
Replacing granular admin email settings with one default email (#13853)
* Replaced granular emails with the default one

* Set reply to header in emails

* Extract shared_examples from NotifyMailer

* Removed unused code

* Replaced SiteConfig with Settings::General

* Fixes related to replacing SiteConfig with Settings

* Removed duplicate line from specs
2021-05-28 12:17:08 +03:00
Michael Kohl
6dfabd578f
Rename SiteConfig to Settings::General (#13573)
* Rename SiteConfig

* More renaming

* Update spec

* Update mandatory settings mapping

* More renaming

* e2e test fixes

* You have a rename, and you have a rename

* Spec fix

* More changes

* Temporarily disable specs

* After-merge update

* Undo rename for migration

* undo rename of DUS

* Fix DUS

* Fix merge problem

* Remove redundant DUS

* Fix specs

* Remove unused code

* Change wrong class name

* More cleanup

* Re-add missing values to constant

* Fix constant

* Fix spec

* Remove obsolete fields

* Add accidentally removed field

* Update spec

* Move methods from Settings::General to ForemInstance

* Remove unneeded model

* Change mentions of 'site config'
2021-05-21 14:45:37 +02:00
Ridhwana
c5bcb4c021
RFC 50: fix some more hardcoded paths (#13473)
* fix: remove hardcoded paths

* fix: use path helpers

* swap href for link_to

* feat: use path helpers

* feat: use a data path to send through the path that we will be calling

* feat: pass route through to js

* dus index path

* chore: change to use path_helpers

* feat: update DUS controller

* chore: oops remove these paths
2021-04-26 17:49:54 +02:00
Vaidehi Joshi
95055b2a89
Remove pro role + expose analytics to all users via dashboard (#13156)
* Remove pro role on user, expose pro dashboard to all users as analytics

* Remove pro from Elasticsearch mappings

* Update user role docs to use :trusted over :pro

* Remove pro from Role model spec

* Remove more references to pro, as noted by @rhymes
2021-03-30 15:02:18 -07:00
Julianna Tetreault
a2458d5f59
Refactor: Extract Role Removal Into a Service (#12812) [deploy]
* WIP: Adds a Users::RemoveRole service to encapsulate Admin::UsersController#destroy

* Adds #role_display_name helper to application_helper.rb for extensibility

* Adjusts Member is Suspended banner to Member is Banned for consistency

* WIP: Extract Admin::UsersController#destroy into remove_role.rb service

* Cleans up Admin::UsersController#destroy and remove_role.rb service
 - Removes unneccessary code from Admin::UsersController#destroy
 - Replaces args with keyword args in Admin::UsersController#destroy
 - Replaces args with keyword args in remove_role.rb service
 - Refactors code to be more extensible and cleaner overall

* Adds a remove_role_spec.rb to test Users::RemoveRole service

* Fix typo in Admin::UsersController#destroy

* Refactors role_display_name helper method and reverts change to banner

* Use #role_display_name in _current_roles.html.erb

* Refactors conditional, names, and adjusts spec to account for refactors

* Raises StandardError if there is an issue with role removal
2021-03-01 09:07:30 -07:00
Julianna Tetreault
71b35f28a0
Remove Roles via Admin (#12582) [deploy]
* Add the ability to remove a role from a non-super_admin in Admin::UsersController
 - Adds a #destroy action to the Admin::UsersController
 - Adds a destroy route for the action

* Add a removal button to non-super_admin roles on admin user pages
  - Pulls Current Roles out of _activity and into own partial
  - Adds a _current_roles partial to /admin/users/show
  - Adds REMOVE buttons to non-super_admin roles
  - Conditionally renders REMOVE buttons for certain roles only

* Add tests around the removal of roles to users_manage_spec

* Adjust formatting of link_to in _current_roles.html.erb

* Use :aggregate_failures in role-related tests in users_manage_spec.rb

* Refactors Admin::UsersController#destroy and role params

* Update admin/users_spec.rb to take into account _current_roles partial

* Replace REMOVE text with X on role removal buttons

* Add additional elsif to handle single_resource_admin removal
  - Adds resource_type params to Admin::UsersController
  - Adds elsif to handle removal of single_resource_admin roles
  - Adds resource_type to the removal button in _current_roles
  - Adds a spec around removing single_resource_admin roles

* Add .constantize to resource_type in Admin::UsersController

* Move .constantize to resource_type arg rather than params in #destroy

* Use .safe_constantize rather than .constantize for params[:resource_type]

* Remove .safe_constantize from params and onto inline var instead

* Add nil check to removal of :single_resource_admin role in #destroy

* Update users_manage_spec.rb to remove proper role in test

* Add resource_name to current user and super admin _current_roles list

* Add additional test around removing :single_resource_admin role
2021-02-16 10:50:10 -07:00
rhymes
1c8b44f326
Remove GitHub repositories when GitHub identity is removed (#11951)
* Remove GitHub repositories when user deletes their own GitHub identity

* Remove GitHub repos also from the admin remove identity

* Add a notice in Settings/Extension

* Add data update script to cleanup orphan GitHub repos
2020-12-20 15:15:40 +01:00
Anna Buianova
1ae0b4f47a
Use helpers.tag and safe_join instead of html_safe (#11916) 2020-12-16 10:02:19 +03:00
Anna Buianova
5430448305
Confirmations that users GDPR data was deleted (#11039)
* Display gdpr delete requests for deleted users in admin

* Added a test for destroy a gdpr request

* Reorganized gdpr requests menu

* Update schema version

* Added a link to the flash notice after user delete by admin

* Fix namespace for tests

* Aligh schema.rb with master

* Added a missing newline

* Removed unused partial

* Fix typo

Co-authored-by: Michael Kohl <me@citizen428.net>

* Replaced string with symbols for AR

Co-authored-by: Michael Kohl <me@citizen428.net>

* Added an AuditLog record on gdpr delete confirmation

* Make email and user_id required in Users::GdprDeleteRequest

* Checked out package.json from master

* Fix Gdpr => GDPR

* Added missing space

* Remove unneeded freeze

Co-authored-by: Michael Kohl <me@citizen428.net>
2020-12-14 12:49:45 +03:00
rhymes
68b320a1de
Add contact email to SiteConfig and replace default where appropriate (#11630)
* Add a new contact email to use in place of default

* Replace :default with :contact email in all non transactional emails

* Add missing expectation
2020-11-27 16:39:38 +01:00
Andy Zhao
b80dae1436
Update data exporter to handle admin send (#10274)
* Update data exporter to handle admin send

* Match button with everything else

* Use proper redirect path

* Stub SiteConfig definition instead of setting it

Co-authored-by: Mac Siri <krairit.siri@gmail.com>

* Removed if statement by accident oops

* Remove non-functional boolean param and pass email directly

* Use refinement to conv to boolean instead of JSON.parse

* Rename to StringToBoolean

* Use 'using' in proper scope (not in method)

* Rename to_bool to to_boolean

* Refactor if statement, thanks rhymes!

* Fix small bugs in tests

* Remove tracking for export_email b/c no @user

Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2020-10-26 18:00:56 -04:00
Julianna Tetreault
0a5babc10e
Add Recent Reactions to the Admin Users' Page (#10680)
* Adds Recent Reations back to the Admin Users page...UGH rebasing :(
  - Render negative_reactions partial in admin/edit.html.erb
  - Add #set_related_reactions back to Admin::UsersController
  - Refacotors JS to target #reports-row in _reports.html.erb

* Alphabetizes reports and reactions partials in edit.html.erb

* Adds tests around Recent Reports and Recent Reactions sections to users_spec.rb
2020-10-07 14:21:10 +07:00
Brunno Souza
e5973ebf9c
Refactoring user_controller separating some classes to service (#10384)
* Refactoring user_controller separating some classes to service

* Replace service Credit::Manager and improve yours specs

* improve method with memoize
2020-10-05 10:41:59 +02:00
Molly Struve
b0e086346d
[deploy] Refactor:Remove BackupData Model and Code (#10409) 2020-09-22 16:45:18 -05:00
Julianna Tetreault
31990b3d3b
Add Recent Reports to Users' Admin User Page (#10058) [deploy]
* Adds _reports partial and renders _reports.html.erb in /admin/users/edit.html.erb

* Adds a Recent Reports sections and a toggle function to /admin/users/_reports

* WIP: display feedback_messages in _reports.html.erb

* Adds #set_feedback_messages to Admin::Users::Controller and adjusts _reports.html.erb

* Adjusts #set_feedback_messages to look for message ids and adds to _reports.html.erb data

* Remove accidental dead code from Admin::Users::Controller

* Adjusts the else statement wording to be more fun

* Adjusts style of recent reports to mirror style of recent reactions

* Implement Admin UI changes to Recent Reports section of admin/users/:id/edit

* Adds a link to the admin_feedback_messages_path for each report in _reports.html.erb

* Adjusts the path used when a report is clicked on in _reports.html.erb

* Adds #user_types check to feedback_message.rb to determine Affected, Offender, or Reporter in _reports
2020-09-03 12:06:15 -06:00
Andy Zhao
0b849341e0
Remove ghostify from app (#10139)
* Remove ghostify from app

* Remove unused ghostify specs
2020-09-01 13:39:39 -04:00