* 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
* 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
* 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
* 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
* 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
* 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???
* 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>
* 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
* 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>
* 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
* 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
* 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
* 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>
* 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>
* 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
* 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>
* 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>
* 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
* show the statuses in the modal
* filter the results
* add some todo around good standing
* Enable Rails framework 7.0's isolation_level, partial_inserts, & raise_on_open_redirects (#17970)
* Member index: Show applied org filters (#17977)
* show applied org filters
* correct casing
* API V1 transition (#17835)
* API Articles v0-v1 restructure
* Remove unused helper
* Bulk move API controllers into concerns + add V1 controllers
* Extract API routes + some fixes
* Fix v1 api_controller authenticate! + add more article_controller specs
* Completed spec/requests/api/v1/articles_spec.rb
* specs up to listings
* All v1 specs except for 9 skips
* mime_types cleanup + authenticate! relocation
Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
* Fix email confirmation logic when registering via Omniauth (#17878)
* Move .skip_confirmation! call to .find_or_create_user! method
* Add regression tests to avoid email confirmation delivery
* Keep the original place where we had user.skip_confirmation! too
* Update logic to require email confirmation from omniauth
* test confirmation is required with SMTP
* Keep :notice instead of :global_notice
* Forem Account bypass email confirmation reorg
* inline comment reorder + clarification
* Apply suggestions from code review
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
* Member Index View Actions: "Adjust Credit Balance" (#17974)
* Adds the Adjust credit balance modal to index view
* Adds e2e tests for adjusting credit balances via modal
* Adds the ability to update credits to #user_status
* Adjusts the e2e to address failures
* Introducing a quick and dirty fix for abtests/admin (#17982)
This is a "quick and dirty" hack. Do I like it? No. Do I want to delve
into further debugging/refactoring of [a 72 line method][1]? Not at the
moment. There are a few pathways forward, but for now, this is the
pathway to hopefully give us insight into the
**Why will this likely address the issue?**
Prior to this commit, for an experiment we would render each of the
goals (anywhere from 8 to 11); each of which would require 2 expensive
queries; which means about 16 expensive queries.
After this commit, the experiment page has none of those expensive
queries; instead each goal now runs the 2 expensive queries.
The hope is that this will help us show the results (albeit on multiple
pages) while coming in under the response time out handlers we have in
place.
**Why no tests?**
Ugh; I know right?!? I'm beginning to ask that myself. But for now,
because this is only visible to tech_admins, the consequences of
breaking are limited. In otherwords, this is not a customer facing
feature, so it can be a bit less robust in it's testing. At least
that's the rationalization I'm establishing.
Further, local tests would not reveal the production environment
complications of large data sets. The aforementioned expensive queries
are blisteringly fast on my local machine...in part because I don't much
field_test experiment data.
Closesforem/forem#17981
Related to:
- forem/forem#17895
- forem/forem#17869
[1]:ab2d7d29d0/lib/field_test/experiment.rb (L98-L160)
* Adding test for redundant roles
* Adding filter for roles
* forget about good standing status
* remove good standing specs
* Update app/helpers/admin/users_helper.rb
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* appease rubocop
* simplify
* add e2e tests
* add the applied filter pills for status
* make sure clear all button shows
* add a comment to explain good standing
* tweak
* set the registered dates of test users
Co-authored-by: Mac Siri <mac@forem.com>
Co-authored-by: Fernando Valverde <fernando@fdo.cr>
Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
Co-authored-by: Jeremy Friesen <jeremy.n.friesen@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* 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>
* 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
* 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>
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