Commit graph

330 commits

Author SHA1 Message Date
Anna Buianova
7d5650c3f1
Admin access to spam comments by url (#20775)
* Admin access to spam comments by url

* Fixed spec

* Fixed view spec
2024-03-22 08:40:36 -04:00
Ben Halpern
83878e9c10
Add classes to content wrapper for articles and pages (#20731)
* Add classes to content wrapper for articles and pages

* Add class name check

* Fix org check
2024-03-06 12:44:47 -05:00
Anna Buianova
e5064b418f
Hide super low score comments if they are child comments (#20612) 2024-02-09 16:24:13 +00:00
Ben Halpern
2f9769a89d
Add new sidebar billboard locations and remove legacy campaign area (#20562)
* Add new sidebar billboard locations

* Remove some specs

* Remove campaign tests

* Adjust tag-allowed billboards

* Fix up targeting functionality

* Fix sidebar third render
2024-02-08 16:55:48 +00:00
Anna Buianova
7125a62db0
Changed logic for hiding and displaying low-quality marker for comments based on their score (#20581)
* Specs for revised comments thresholds

* Changed thresholds for low quality comments

* Added specs for comments page

* Fixed /comments and related specs

* Reorganized code for comments trees

* Specs for podcasts episodes comments

* Refactored Comments::Tree

* Refactored Comments::Tree + added specs

* Made build_sort_query private
2024-02-05 09:27:24 -05: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
PJ
47deeefe57
Optionally limit new users based on admin setting (#20149)
* create admin setting for new user status

* limiting on signup working 🎉

* update registration specs

* sort out OAuth registrations
2023-09-26 10:46:36 +01:00
Ridhwana
aa201060e8
Override Tag Moderation Actions (#20088)
* feat: remove the validation for the article_id and tag_name to be unique on a tag_adjustment

* chore: remove unique index

* feat: update the validate_tag method to align with the removal of unique indexes on the table

* feat: do not allow removal and addition of tags that were added/removed by admins

* spec: add tests for the tag_adjustment_spec

* fix: update the validation of tags

* spec: article validation

* spec: test the action_panel helper

* chore: amend language

* add styles

* Empty commit
2023-09-15 15:06:58 +02:00
Ben Halpern
d6d7eeeb59
Add proper follow-user class to liquid when passed UserDecorator (#20101)
* Add proper follow-user class to liquid

* Adjust test
2023-09-13 11:36:21 -04:00
PJ
3f922921e5
Admin setting to control enabled countries for billboard geotargeting (#20083)
* use instance setting for enabled target geolocations

* add validation for enabled geolocations setting

* a start on the UI?

* backend tweaks for UI

* proper crack at autocomplete component

* fix region targeting toggle

* e2e spec
2023-09-12 12:06:00 -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
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
Duke Greene
6d5c451cd7
add comment to color helper (#19852) 2023-08-02 07:01:42 -04:00
Duke Greene
cf7847fadb
remove onboarding background image, use gradient based on brand color (#19815)
* remove background image, rename prop to refer to color, pass primary brand color

* create helper method, send calculated gradient values into frontend props

* test new helper method and refine how color is darkened
2023-07-27 07:27:21 -04:00
Ridhwana
272aea6127
Allow admins to delete an organization (#19699)
* feat: update the layout for organizations

* feat: update the layout for an organization

* feat: organization logos are square

* feat: change the text on the org visit button

* feat: initialize the dropdown menu

* feat: trigger the  modal

* feat: update the text in the model

* feat: tweak wording

* WIP/feat: hook up a route with an action that calls an organization delete worker.

* feat: redirect after showing the notice

* feat: update the authorization required to be super admin

* feat: add the notice to localization

* spec: integration test

* spec: fix

* spec: delete worker

* chore: update the link

* feat: add safe navigation

* feat: make sure that we show an error if the organization has credits

* fix: error message for modal unspent credits

* feat add the spec for the helper

* fix: remove rspec preface

* fix: small fixes to tests and I18n

* fix: updated the number of orgs

* feat: update the message

* feat: update the message

* chore: remove inclusion of helper

* feat: change the name of the parameter

* chore: newline
2023-07-17 12:09:24 +02:00
Joshua Wehner
20c282df80
Still trying to fix notification caching when un/subscribing (#19754)
* Revert "Uncache subscribe to comments (#19739)"

This reverts commit 30500805ae.

* Tweak cache key for faster cache change on un/subscribe
2023-07-17 11:23:55 +02:00
Anna Buianova
be1e57d85c
Rename DisplayAdHelper to BillboardHelper (#19750) 2023-07-14 14:48:45 -04:00
PJ
cee84b49ef
Exclude manual segments from dropdown in billboard admin form (#19677)
* exclude manual segments from audience segments dropdown

* specs 🎉

* fix deleteDisplayAds specs

* add seed for display ad with manually managed segment

* moar specs
2023-07-12 20:23:50 +01:00
Ridhwana
ccacf0bc3a
Refactor the home feed + add user tag filtering on in-feed billboards (#19600)
* feat: fix of there is no article

* feat: set the feed order in a data structure rather than in a view

* feat: update yarn.lock

* feat: push the items to the array

* feat: update feed to only show billboards if we have the correct length of items in the feed

* fix: organizedFeedItems.legth

* feat: rename 'featured' to 'image'

* feat: rename 'featured' to 'image'

* feat: rename 'featured' to 'image'

* feat: add some utilities for the feed that we can use in the FeedTest

* feat/WIP: the setup for the feed tests and a first working test

* test: imageItem

* fix: the podcasts can be passed through as an array of objects in the feedItems so that they can be grouped in one card

* feat: remove podcastEpisode state and the attribute in the object

* fix: check that the items exist before trying to slice them

* feat: setup the userdata and the podcast data in the test

* whoops - commit the podcast episodes

* feat: write soem more tests for the feed and including the podcasts

* feat: add some more tests

* feat: add more billboards tests to chcek the order of stuff

* feat: set the timeframe not empty

* feat: update the logic for organizaed feed by inserting the last on first

* doc: jsdoc for functions

* refactor: break the code up into smaller functions

* refactor: make the code more readable and easier to follow

* refactor: pull function out into a utlity

* feat: add specs to utility

* feat: chcek if pinned post

* test the latest timeframe correctly

* chore: update var name

* move the podcast items out of the object clause

* feat: update text

* feat: add a pack file that duplicates initializeDisplayAdVisibility

* feat: create callbacks that will help us to determine when the feed has been rendered so that we can observe the dsplay ads accordingly

* chore: rename to billboards instead of display ad

* feat: abstract out a function that will work for any tagged resource and also limit the article tags within a scope of the article_id

* feat: update the spec for the previous changes

* feat: write tests for the user_tags

* feat: add user_tags to for_display adn the query

* feat: add user_tags to the endpoint where we query the tags to send it through to for_display

* feat: pass through the suer tags to the async request

* feat: update the user_tags fiter query + tests

* feat: update the admin view to show targeted tags on the new feed option billboards too

* feat: add tests for targeted tags field on admin

* refactor: consolidate all of the options into one

* feat: move comment close to attribute

* feat: use a helper method

* feat: include helper on ads query

* feat: move the query from the frontend to live on the backend

* feat: first pass at some error handling whilst maintaining the order of the items

* test: for feed error

* feat: abstract out some code

* update the feed items for errors

* chore: comment

* feat: update the variable names

* feat: update honeybadger message

* feat: update the name of the variable

* refactor: do not conflate the duty of the untagged_ads

* refactor: rename the variables + add note for clarity

* fix: update var
2023-07-06 16:47:08 +02:00
PJ
795cfc3da0
Manual Audience Segments API write endpoints (#19476)
* add composite index to segmented_users table

* bulk queries for segmented users

* create segment endpoint

* adding and removing users

* deleting segments 😪

* fix time precision in specs

* api docs 🎉

* pluck improvements that couldn't be cherry-picked

* better service objects; also introduce batch upserting

* docs???
2023-05-25 20:37:18 +01:00
Duke Greene
1798a1f845
notify mod on new user articles (#19478)
* update moderation notification view and message for articles

* update models to allow first published articles to notify mod after create

* update mod notifications worker and spec to support articles

* update mod notification send service and spec to support articles

* update helper and request spec to support article mod notifications

* update spec language to match updated notification message

* Update spec/workers/notifications/create_round_robin_moderation_notifications_worker_spec.rb

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

* Update spec/workers/notifications/create_round_robin_moderation_notifications_worker_spec.rb

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

* Update spec/workers/notifications/create_round_robin_moderation_notifications_worker_spec.rb

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

* Update spec/workers/notifications/create_round_robin_moderation_notifications_worker_spec.rb

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

* fix comment and refactor order of send_moderation_notification steps

* add fr.yml article mod notification config

* fix spacing around equal sign per rubocop

* fix spacing around equal sign per rubocop

* Update spec/workers/notifications/create_round_robin_moderation_notifications_worker_spec.rb

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

---------

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-05-23 10:51:46 -04:00
PJ
eadbc94ca5
Round Robin notifications design refresh (#19420)
* update visual design

* add comment user to mod notification

* fix request spec
2023-05-04 18:13:14 +01:00
Joshua Wehner
dc1ab81401
Allow DisplayAd to target users via audience segmentation (#19284)
* Trying some models for audience segmentation

* AudienceSegment basics

* Attach AudienceSegment to DisplayAd

* Possibly use a DUS to populate AudienceSegments

* Add to display ad form UI

* Add to display ad API

* Refresh strategy for audience segments

* Add user_id to async ads query

* Maybe :testing -> :manual, for no-refresh segment

* Test & tweak segment refresh

* Testing audience_segment#refresh logic

* Coverage: testing human_readable

* Scope segment refresh to recently active users

* Tweak logic for when to refresh

* Tweak experience levels to match SettingsHelper

* Test for front-end logic

* Fix test, hope this helps coverage?

* Better test names

* One worker for all, many workers for each, perform_bulk

* Fix audience segment UI, needs to use id, not enum

* cron/schedule should RefreshAll

* Singular id in RefreshWorker
2023-04-25 08:41:10 -04:00
Joshua Wehner
5188ca8138
Cleanup multiple reactions feature flag (#19257)
* Update notifications_helper

* Update notification decorator

* Removed old notifications views

* Remove flag check from _actions partial

* Remove feature flag from views

* Remove flag from model

* Update logic in reaction drawer button

* Missed this somehow

* Update app/assets/javascripts/initializers/initializeArticleReactions.js

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

* Update these tests to multiple reactions

* Adjust logged-out test to account for multiple reactions

* Removed unused

* Try to boost coverage

---------

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-04-07 17:14:10 +02:00
Joshua Wehner
8086ef68ac
Fix bullet issue with includes commentable (#19145)
* Fix bullet issue with includes commentable

* Flatten view logic

* Restore user comment section logic (but bullet-friendly)

* Try fixing podcast_episode -> podcast

* Add test that would have caught the logic bug

* View specs need describe to specific the path

* Remove unnecessary _comments argument

* Ooops, missed saving this
2023-03-20 16:08:03 +01:00
dancristianb
814080dc3b
Fix nested sidebar active item highlight (#18973)
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
Co-authored-by: Fernando Valverde <fernando@fdo.cr>
Co-authored-by: Joshua Wehner <joshua@forem.com>
2023-02-21 16:18:42 -05:00
Joshua Wehner
1374ab98e6
Ensure spam doesn't hit logged-out /latest (#19110)
* Ensure spam doesn't hit logged-out /latest

* Restore load-bearing constant

* Narrow selector avoids the new 'latest' banner

* Test scenario for signed-in low-score content

* Remove false-negative test

* Actual test for the logged-in scenario

* Signed-in users get poor quality content

* Feeds (RSS) use an entirely different query

* Pass @stories

* Update tests with new minimum score
2023-02-17 09:29:59 +01:00
Joshua Wehner
ea2154d506
Fixing design issues with multiple reactions (#19020)
* Try disabling text-select (mobile long-tap)

* Try to force button color on mobile safari

* Try making notification decorator more helpful

* More using notification decorator

* Helper so I can see exceptions

* As we toggle feature flag, temporary show 'heart' for unsupported reactions

* Reaction on Comment is a 'reaction'-type notification

* Temporarily add new emojis to i18n

* Render full-color, unique SVGs for multiple_reactions

* Restore card layout

* Aggregate reaction icons also need unique SVGs

* This seems unnecessary?

* Multiple is -more-than-one-

* Display *unique* reaction categories on /notifications

* Comment notification no longer needs to re-render as reaction

* Decorator needs to handle some data gaps

* Fix NotificationHelper

* Try a better name for this

* Tests for the notification decorator

* These partials wound up without an outer layer

* Add a descriptive comment

* index needs force_unique

* Try multiple reactions external img (#19076)

* Try external img SVGs

* Unique SVG might not be necessary if this works

* Can also remove this spec if successful

* Restore flash icon behavior

* Plus external img for #index as well
2023-02-08 11:39:47 +01:00
Joshua Wehner
30c0485507
Frontend for multiple reactions (v1) (#18808)
* Remove extraneous comment (see 9361d2 and 5c18f8)

* Flexible, multiple reaction types

* Fix reaction counts

* Re-use svg for active state for now

* Update yml, update spec

* Possible temp fix for failing tests

* Colorize reaction icon svgs

* Reaction engagement above post title

* Index reactions engagements (for logged-out)

* Maybe readinglist is special

* Try using crayons' dropdown as a drawer?

* readinglist isn't really public now

* feat: update the styles for the reaction drawer

* Grey background highlight, turn off border/shadow

* Read our feature flag docs, saw this was recommended

* Missed fifth emoji: party/tada

* Fix JS test errors

* Update test with tada

* Suppress flashing engagements when no public reactions

* Liberate jump-to-comments from unicorn replacement

* 'Add reaction' on tooltip

* Don't show reaction emoji on index unless it's been used

* rubocop

* Update heart+ total count when toggling

* Do not include 'readinglist' in drawer/public counts

* Fix semi-public readinglist so that icon is badged for current user

* Tweak heart-plus svg

* Style tweak: border on active reaction

* Show reacted icon on drawer trigger for 1.5 sec

* Tweak styles for engagements bar

* Style tweaks for multiple engagements (#index)

* Trying to get size working through crayons/inline_svg

* Sparkle hearts

* Restore unicorn

* Make heart-plus-active work when user has an active reaction

* Try 'hoverdown' a dropdown that activates with hover

* Long touch?

* Tap *outside* the drawer to close

* Mobile reaction drawer is also supposed to be columns

* More reaction count cleanup

* Final emoticons maybe?

* Fix reaction bug when feature disabled

* Remove readinglist from public reaction counts

* Update specs for new reaction categories

* Shuffle makes specs flaky

* Order does not matter

* rubocop

* Update to preserve readinglist analytics

* Shuffle makes specs flaky

* Fix flickering images, remove icon highlight for now

* Don't update total for readinglist

* reactions_by_user_id

* Try renaming this observer function

* Try unid ids for SVGs

* Remove local test file

* Simplistic test for the unique svg transform

* Fix javascript for current SVG

* Signifcant string literals in this case, rubocop

* Use the right expected output

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2023-01-23 16:00:50 +01:00
yheuhtozr
5519fe563c
views/admin/users i18n (#18582) 2022-11-11 15:29:48 +02:00
Joshua Wehner
201f4d998a
Try hiding low-quality comments (#18513)
* Try hiding low-quality comments

* Message indicating when negative comments are being hidden

* Adjust comment show count for logged-out visitors

* Remove unusued comments_to_show_count from article decorator

* Remove unusued comments_to_show_count from podcast episode decorator

* Add test for hidden negative comment

* Update spec/system/articles/user_visits_an_article_spec.rb

Co-authored-by: Fernando Valverde <fernando@fdo.cr>

* Don't create twice; do test logged-in and -out

* Comment caching needs to account for signed-in status

Co-authored-by: Fernando Valverde <fernando@fdo.cr>
2022-10-11 14:15:40 +02:00
Fernando Valverde
e5e36a2e2d
Comment fragment link when signed out (#18517)
* Comment fragment link when signed out

* Optional chaining for article path

* Fix comment liquid tag rendering

* Extract signed in/out logic into helper

* Debugging specs

* Fix specs

* Use named empty anchor to link comments with id_code
2022-10-03 07:58:34 -06:00
Julianna Tetreault
de4acd4fa5
Remove Community Emoji from Admin Config 🌱 (#16902)
* Removes all community_emoji-related code

* Removes community_emoji-related specs from codebase

* Updates communitySection.spec.js to test for member_label

* chore: merge conflicts

* feat: remove data update script

* chore: add file back

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2022-08-30 17:16:58 +02:00
Julianna Tetreault
806a5a774e
Backfill community_emoji data with a DUS 🌱 (#16896)
* Adds a DUS to backfill community_emoji for Forems that have one

* Adds a DUS spec to test backfilling community names

* update the script adn the tests to allow us to change the community name

* feat: add a stub for the community name

* feat: generate a later timestamp so that it doesnt cause confusion

* chcek if the emoji already appears in the community name

* feat: remove community emoji from displaying on the UI

* refactor:remove the else if completely

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2022-08-26 16:12:46 +02:00
Suzanne Aitchison
fd690982cf
Hide like text if no likes on comment (#18322)
* set label to empty if no likes

* update spec

* fix styling issues when text is removed

* fix missed test text
2022-08-12 15:19:53 +01:00
Joshua Wehner
445fd0f9e5
Try renaming moderator -> super_moderator (#18261)
* Try renaming moderator -> super_moderator

* Still finding 'moderator' words

* Fixes for failing specs

* Update test with new role name

* Update app/services/moderator/manage_activity_and_roles.rb

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

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-08-10 16:43:30 +02:00
Suzanne Aitchison
f1df37f431
Add "only display when logged out" as an option on Navigation Links (#18275)
* add new column with enum value

* refactor to use display_to column

* add some more specs to application_helper

* test for the backfill DUS

* fix line length

* refactor
2022-08-08 10:55:24 +01:00
Joshua Wehner
4e17649e15
Remove generated social images, except for articles#show (#18118)
* Prefer main_social_image (except on articles#show)

See https://github.com/forem/forem-internal-eng/issues/485

* Cleanup social media helpers no longer in use
2022-07-18 12:29:21 +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
26077f3e1f
Rename base_roles ui labels (#17938)
* rename base_roles ui labels

* update some specs

* fix missed strings in cypress spec
2022-06-21 16:17:35 +01: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
Arit Amana
a75ef4e1b2
Fix styling on Follow Button in User Info Panel (post view) (#17642)
* fix

* nudge Travis
2022-05-12 08:03:41 -04:00
Arit Amana
41acd673d0
Make Follow Buttons in User, Org and Tag Embeds "secondary" (#17602)
* complete implementation

* Make PR review changes
2022-05-10 16:37:39 -04:00
Jamie Gaskins
c568557ead
Sanitize URL before parsing (#17559)
URL strings that have leading or trailing spaces raise exceptions when
parsing.
2022-05-03 14:28:20 -04: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
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
Jeremy Friesen
f790c3c0c1
Encapsulating the "why we hide/show" something (#17166)
* Encapsulating the "why we hide/show" something

Prior to this commit, we were relying on our views/templates to
understand why it might want to append the "hidden" dom class.  That is
not ideal, because it required repeating knowledge about the conditions
of the policy outside of the policy's domain.

With this commit, we're removing a duplication of knowledge; or more
appropriately asking the steward responsible for the knowledge to
produce the answer.

* Refining the note to not describe a course of action
2022-04-11 13:40:16 -04:00
Julianna Tetreault
bf67ae2fbb
Refactor Member Index View Tooltips (#17170)
* Adjusts Member Index View tooltips to include resource type

* Adds .compact to the list of resource_types in #format_role_tooltip

* Updates users_helper.rb#format_role_tooltip tests

* right align tooltip

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

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

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-04-11 09:20:26 -06:00
Jeremy Friesen
1d2ecc64f0
Removing Listing rate limiting when feature disabled (#17181)
* Removing Listing rate limiting when feature disabled

Closes forem/forem#17175

* Fixing tests
2022-04-08 11:59:23 -04:00
Jeremy Friesen
a9a5ad214b
Narrowing when we apply "hidden" by policy attributes (#17143)
Prior to this commit, we always assumed a policy based attribute would
have the "hidden" class and then we'd rely on JavaScript to toggle the
visibility.

With this approach, we are "cheating" a bit by specifically referencing
a feature flag that is the driver for the visibility behavior.

This mirrors the one-off behavior of forem/forem#16606.  Namely, when
the flag is off, we render without default hiding.  And when it's on, we
include the "hidden" attribute.

In both cases, we will still leveraged the [applyApplicationPolicyToggles.js][1]
introduced in forem/forem#17076.

An impact could be that if multiple flags are fiddling with the policy,
we could see an area disappear or wrongly remain present.  This would be
a warning to fix (the server would still enforce correct policies so
this would be a bit of a "heads up we have a mismatch in understanding
that happens to impact UI behavior").

[1]:https://github.com/forem/forem/blob/main/app/javascript/packs/applyApplicationPolicyToggles.js
2022-04-06 13:57:01 -04:00