Commit graph

146 commits

Author SHA1 Message Date
Mac Siri
afa73e06e3
Replace Webpacker with Esbuild (#20470)
* Migrate to esbuild WIP

* Add exclude

* Remove redundant file

* Move file

* Move to javascript_include_tag

* Lint fix

* WIP

* WIP

* Add watch mode to esbuild WIP

* Get jest working

* Remove babel

* Revert "Remove babel"

This reverts commit 6da35260aa19d6f97f586deb66c0ecaf48433b73.

* More WIP

* Got image to load

* WIP

* Resolve audit

* Lint fix

* WIP

* Fix jest spec

* [CI] Remove asset-restore for test build stage

* Production compliant

* Temp disable sourcemap

* Update glob

* Add esbuild helper to stimulus

* Import fragment

* Temp disable coverage to see failing tests

* Fix broken spec

* Address lint

* Set proper es6 target

* Use esbuild for everything

* wait what

* Revert "Set proper es6 target"

This reverts commit 98f5278093421baa8ffe2ca580845b01c1a1eadf.

* Revert "Use esbuild for everything"

This reverts commit 0ac46738f07ffcb6af095ccb1ffa5e439b7fefa3.

* Replace uglifier with terser

* New compiled assets version

* Remvoe honeybadger-io/webpack

* Remove cypress coverage checks for now

* Update jsconfig.json

* Update docker-compose

* Remove public/packs-test from ci cache
2024-01-25 20:29:21 +00:00
Philip How
b593ecd323
Change 🧐 to 🚩 (#20537)
* inital pass

* icon title

* fix locale issues failing tests
2024-01-22 15:53:25 +00:00
Anna Buianova
473594f192
Match spam role with existing suspended actions (#20477)
* Started matching spam and suspended roles

* Match spam and suspended roles in most cases

* Fixed check_suspended for unauthenticated users
2023-12-27 20:12:50 +00:00
Anna Buianova
d327fbe73d
Remove unused user status span (#20468) 2023-12-22 10:53:32 +00:00
Anna Buianova
adfd76feb6
Consider spam role in the user_status method (#20449)
* Add spam role to user_status method

* Take spam role into account in user status indicator

* Return passed statuses
2023-12-13 16:56:27 +00:00
Rajat Talesra
5ef0f43636
Added limited role (#19969)
* Added limited role

* Nit fix

* Updated tetss

* Added spec tests

* Attempt at 100% code coverage

* Rollback DB migration

* Revert timestamp
2023-08-25 14:41:17 +05:30
Anthony Nguyen
2208d2329c
Handle nil author_id on note on admin member manager view (#19830) 2023-07-26 11:22:42 -04:00
Dhurba baral
84b2f0145a
Displays better name for Admin roles (#19819)
* Displays better name for Admin roles

* Updates translations in fr

* Capitalize role label
2023-07-25 10:46:55 -04:00
Rajat Talesra
fdab1e3418
Score and flag count fix in users profile in admin section (#19664)
* Score and flag count fix in users profile in admin section

* Used score instead of claculating it
2023-07-03 22:47:14 +05:30
Dhurba baral
3bc04bdcc2
Allows super-admin the ability to remove the role from themselves (#19621)
* Allows removing own role

* Removes dead test case
2023-06-26 09:11:33 -04:00
Dhurba baral
4e1edc9225
allows super_admin user to remove super_admin role (#19590)
* Skips scheduled posts in featured post count

* Allows removing super_admin role

* adds namespace resolution op

* Adds pundit policy

* Adds rspec for role policy

* Fixes test cases and minor refactoring

* Removes dead code

---------

Co-authored-by: Lawrence <lawrence@forem.com>
2023-06-21 11:22:25 -04:00
Rajat Talesra
150199e0d2
Add more visibility and control around reactions/flags into the Admin USERS page (#19558)
* Basic implementation without dropdown

* Dropdown functionality

* Partial i18n

* Nit fixes

* Nit fixes

* Flag count fix

* I18n fr.yml

* Nit design fix

* added external div to article_item

* added external div to article_item

* Code merge of article_item and individual_article

* Minor bug fix

* Extacted more common code

* Nit fix

* Optimised code

* Optimised code

* Ni fix

* Test fix

* Minor suggested changes applied

* Nit fix

* Nit fix
2023-06-15 22:08:45 +05:30
Rajat Talesra
54eb412593
Add user status from profiles to the report section (#19240) 2023-03-23 15:47:41 -04:00
Lawrence
ca96be13dd
name route and add link (#19109) 2023-02-14 10:15:21 -06:00
Rajat Talesra
93f73636c7
Post bootstrap changes - remove headings from admin.scss (#19019)
* h1 and h2 design fixes

* h2 redesign fixes

* Removed incorrect code

* Revert incorrect test code

* h3 heading redesign

* h4,h4,h5 headings redesign

* Minor design fixes

* Fixed all heading styles

* Test case fix

* Revert incorrect if condition

* Revert incorrect if condition

* Removed non required div
2023-02-02 15:52:35 +05:30
Rajat Talesra
4ae1721848
Remove bootstrap library fully with some minor fixes (#18945)
* Minor fixes

* Replaced justify-content-between with justify-content

* Override all heading tags, paragraph tag

* Fixed a tag underline css

* Removed bootstrap library

* Removed duplicate crayons-select class
2023-01-16 20:07:12 +05:30
Rajat Talesra
497f494ef3
Removed nav related classes from feedback tabs (#18924)
* Removed bootstrap from listing_categories, listings, navigation_links

* Removed not-used bootstrap classes from admin/tags

* Removed bootstrap from admin/settings

* Fix collapse glitch in profile-fields

* Feedback partial progress

* Feedback partial progress

* Removed form-control

* Replaced card with crayons-card

* Fixed profile field UI

* Removed collapse hide and show classes

* Removed collapse hide and show classes

* Removed collapse hide and show classes

* Nit height fix

* Nit width fix

* Updated tests

* Removed nav related classes from feedback tabs

* Remove btn-classes from commets too.

* Removed row and col-12 classes

* Removed bootstrap classes from Authentication

* Removed bootstrap classes from Mascot

* Removed bootstrap classes from Onboarding

* Removed bootstrap classes from lock/unlock discussions

* Notes design changes

* Removed bootstrap classes from Organization

* Removed bootstrap classes from Organization

* Remove alert bootstrap class from admin.html.erb

* Fixed tab_pane related code

* Enable click listener on notice

* Enable click listener on notice

* Applied suggested changes

* close bootstrap class removed

* Removed element completely
2023-01-09 20:18:28 +05:30
Ridhwana
8af18a558e
fix: change the case of comment suspended (#18826) 2022-12-12 12:04:46 +02:00
yheuhtozr
5519fe563c
views/admin/users i18n (#18582) 2022-11-11 15:29:48 +02: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
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
Ridhwana
4101e8fdd6
Remove Member Index View Feature Flags (#18191)
* feat: remove feature flags

* separate forms for the duplicating layouts

* tweak controls and filters

* remove partial no longer used

* retain layout when pagination appears or disappears

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-07-27 08:57:07 +01:00
Suzanne Aitchison
dab96a77f5
add clear all functionality to filters modal (#18210) 2022-07-25 16:47:41 +01:00
Ridhwana
74dc9abd8e
Remove "actions" from Member Index View that have not been implemented as yet (#18098)
* feat: remove actions

* feat: remove the associated icons
2022-07-15 15:29:03 +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
189e933202
add a description to the modal (#18097) 2022-07-13 11:58:44 -04:00
Suzanne Aitchison
5166581a34
remove filter by last activity, fix close modal bug (#18081) 2022-07-13 13:58:14 +01: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
213fcb956d
Member index: Show applied org filters (#17977)
* show applied org filters

* correct casing
2022-06-23 18:14:41 +01:00
Suzanne Aitchison
8bd7e4eba9
Member index: Show applied roles filters (#17954)
* show the pills

* clicking pills removes filter

* add some more spacing

* another alignment tweak

* add cypress spec

* put it behind the feature flag

* make the clear all link a button for consistency

* tweak to comment for clarity
2022-06-21 16:27:26 +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
Suzanne Aitchison
48818a96b7
Member index: controls layout refactor (#17927)
* tweak for smallest viewport

* layout essentially there

* conditionally toggle what the filter button triggers

* contain width of filter section on large screens

* reinstate old view depending on feature flag status

* add type: button (woops)
2022-06-17 10:33:43 +01:00
Suzanne Aitchison
b94c5deea6
Admin member index: filter by member roles (#17884)
* prevent ID conflicts in filters modal by caching content

* show roles with expandable section

* minor tweak

* don't use the hidden field

* send array of role

* role -> roles. small refactor

* set initial checked status

* show an indicator when a filter is applied

* add JS to toggle filter clear buttons and indicators

* update some comments, make sure users only appear once in list

* add some cypress specs, fix some bugs
2022-06-16 15:06:35 +01:00
Julianna Tetreault
379a5fd3dd
Member Index View Actions: "Add Organization" (#17879)
* Adds an Add Organization modal and e2e tests for the modal

* Conditionally redirects to the correct view upon adding org

* Combines modal tests within userIndexView.spec.js

* Removes redundant code and switches assign role and add org button positions

* Updates RSpec tests to account for conditional redirection

* Lowercases the o in organization within _user_actions_dropdown.html.erb

* Fixes failing e2e tests
2022-06-14 08:31:51 -06: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
Suzanne Aitchison
c119b64b74
Reusable user admin modals (#17763)
* target modal content by a classname to avoid duplicate IDs

* woops - fix missed selector

* use showWindowModal in editUser

* move add org to a partial

* move add role into a partial

* move adjust credits to a partial

* move profile modals to be re-used

* generalise approach to add organisation modal

* generalise add role modal form

* generalise adjust credits modal

* rework unpublish modal

* refactor banish user modal

* refactors

* prevent issues with duplicate ids

* fix banish form action

* make sure role management specs covered in cypress

* let hidden modal content use IDs

* rename file for clarity

* add some JSDoc notes

* cleanup some redundant changes

* one more

* woops - fixed id that contained a classname
2022-06-02 09:52:26 -06:00
Julianna Tetreault
b155398f17
"Empty State" for Result-less Search and Filter (#17777)
* Adds an empty state when user search & filter returns nothing

* Addresses e2e failures for small screens
2022-06-01 06:54:39 -06:00
Dwight Scott
c6f852624f
create helper for roles and add FF for moderator role (#17737)
* create helper for roles and add FF for moderator role

* address PR feedback
2022-05-24 10:46:30 -04:00
Suzanne Aitchison
e62684342f
Member index view - collapse other filter sections when one is clicked (#17740)
* collapse any filter sections when a new one is clicked

* add a cypress test
2022-05-24 14:51:18 +01:00
Suzanne Aitchison
3eafafd2e7
switch icon (#17757) 2022-05-24 14:38:12 +01:00
Suzanne Aitchison
5f12358040
add UI for member index v2 actions (#17739) 2022-05-23 14:55:28 +01:00
Suzanne Aitchison
c37bbd77e5
Member index phase 2 - mock filters modal (#17578)
* mock filters popover

* fix for safari

* add missing label
2022-05-17 15:25:21 +01:00
Ridhwana
6f880ee5b6
Update the Sidebar to include the Member Manager (#17538)
* 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: move the menu items to the sidebar

* feat: add a badge

* feat: remove tabs partial

* xs font

* feat: update describe blocks

* feat: update cypress tests

* chore: oops member_manager instead of member_management

* feat: c-indicator

* feat: update the tests

* feat: update the gdpr test

* feat: add the invitations

* chore: align

* feat: update the GDPR constant

* feat: rename to GDPR actions

* feat: add member manager route
2022-05-05 12:46:47 +02:00
Ridhwana
e72957a913
feat: add an inflection and change instances of gdpr to GDPR (#17567) 2022-05-04 16:20:46 +02: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
Ridhwana
b598ece277
feat: remove unused partial (#17537) 2022-05-03 09:42:55 -04:00
Suzanne Aitchison
25bf8a0711
Remove name from invitation flow (#17438)
* remove name from invite user flow

* remove name from invitation instructions

* update invitations spec

* update specs and invitation actions overflow menu name

* allow users to set name when accepting invite
2022-05-03 09:33:12 +01:00
Ridhwana
994a121c62
feat: add search by email back (#17511) 2022-04-29 09:59:10 -04:00
Ridhwana
d9ca26b521
DO NOT MERGE: Remove the Member Index View Feature Flags + old code (#17388)
* feat: remove feature flag on the member index view and re-arrange some partials

* feat: remove Feature Flag for the invitations view

* feat: remove Feature Flag for the gdpr view

* feat: remove Feature Flag for the controls

* feat: remove the feature flag in the tests

* remove extra queries that we no longer use

* Update app/views/admin/invitations/index.html.erb

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

* Update app/views/admin/invitations/index.html.erb

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

* Update app/views/admin/users/index/_controls.html.erb

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

* Update app/views/admin/users/gdpr_delete_requests/index.html.erb

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

* Update cypress/integration/seededFlows/adminFlows/users/userIndexView.spec.js

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

* Update cypress/integration/seededFlows/adminFlows/users/userIndexView.spec.js

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

* Update app/views/admin/users/gdpr_delete_requests/index.html.erb

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

* feat: attempt to fix Cypress test

* fix: soem other cypress tests

* fix: search bar

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-04-25 14:49:34 +02:00