Commit graph

71 commits

Author SHA1 Message Date
Anna Buianova
51316c747f
Comments count according to display rules in feed (#20753)
* Move calculating comments score from worker to a service

* Display displayed comments count in feed

* Recalculating displayed comments counts on article show (if needed)

* Rubocop fixes

* Fixed lambda
2024-03-28 12:12:05 +00:00
Ben Halpern
a30b86a025
Allow billboards to target specific pages with "fixed bottom" placement (#20748)
* Add page fixed bottom billboard

* Add page fixed bottom billboard

* Fix schema
2024-03-15 14:32:30 -04:00
Anna Buianova
288c9ed31f
Fix articles counts based on display rules (#20669)
* Comment counts for signed in users

* Adjust comments count for articles

* Fixed counts for signed out users, added specs for Comments::Count

* Fixed counts for signed out and added specs for Comments::Count

* Removed debug info from the view

* Removed separate count for signed out users

* Remove irrelevant specs

* Remove unused scope
2024-03-01 07:54:15 -05:00
Mac Siri
feabafcc33
Disable flaky specs (#20704) 2024-02-29 16:17:56 -05:00
Ben Halpern
083732e2f3
Optimize and simplify onboarding recommendations (#20682)
* Improve performance of follow recs

* Finish and simplify

* Update tests

* Update tests

* Update tests

* Change onboardings_controller

* Adjust tests

* Change fallback to use score

* Adjust join
2024-02-29 15:57:52 -05: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
Ben Halpern
e376e2b887
Add cookie requirement option for billboards (#20486)
* Add cookie requirement for billboards

* Clean up tests

* Fix up tests

* Adjust tests

* Adjust tests
2024-01-03 16:33:08 +00:00
ktmouk
8963e185f8
Fix username combobox tries to load all users (#20227)
* Fix username combobox tries to load all users

* Add the limit param to the users_query

* Add a comment
2023-10-25 15:53:53 -04:00
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
Ben Halpern
944991a432
Adjust ActiveThreadsQuery to use home_feed_minimum_score (#20004) 2023-08-29 09:35:09 -04:00
Joshua Wehner
d227e1d285
Suppressing articles negative-follow tags from appearing in the "relevant" feed (#19948)
* Try suppressing all negative-follow tags

* userData isn't always available

* Bolster test coverage for tag filter scenarios

* Antitags for the non-basic 'strategy'

* Rename antitags -> hidden_tags

* Rename 'anti_tags' -> 'hidden_tags' as well

* Use userData.followed_tags to derive hidden_tags
2023-08-28 10:11:20 -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
Anna Buianova
fc034e41cd
Renamed display ads to billboards in tests descriptions (#19973) 2023-08-24 23:42:13 +03:00
Anna Buianova
9c9663a5b5
Renamed display_ads to billboards: variables and descriptions in tests (#19920)
* Renamed display ad variables and descriptions in tests

* Renamed api docs display_ads => billboards

* Updated billboard cypress seeds

* Fixed api billboards specs

* Update db/schema.rb

Co-authored-by: Duke Greene <dukegreene@gmail.com>

---------

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
Co-authored-by: Duke Greene <dukegreene@gmail.com>
2023-08-11 15:00:07 -04:00
Anna Buianova
058fd17b58
Renamed display_ad variables to billboard (#19851)
* Renamed display ad variables and constants

* Renamed display_ads associations

* Fixed variable name in display ads

* Renamed display_ads variables in views

* Fixed admin billboard view spec

* Fixed variable name in FilteredAdsQuery
2023-07-31 17:19:02 +03:00
PJ
6e7a898828
possibly flaky test fix (#19856) 2023-07-28 19:50:19 +05:30
PJ
7be865b295
Feature-flagged support for filtering billboards by location (#19834)
* add migrations

* add countries gem?

* first pass at location model

* specs 

* add location to filtered ads query

* feature flag and nicer errors

* cosmetic fixes

* more tweaks (remove unnecessary index, add initializer)
2023-07-27 18:13:26 +01:00
Anna Buianova
869f29d942
Only query unpublish_all data on a relevant tab in the member manager (#19827)
* Only query unpublish_all data on a relevant tab in the member manager

* Added specs for AuditLog::UnpublishAllsQuery
2023-07-25 17:36:45 +03: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
Mac Siri
8bce9f006d
Skip flaky specs (#19665) 2023-06-30 11:51:32 -04:00
Joshua Wehner
e0d7658138
Follow-ups for suggested organizations follows during onboarding (#19619)
* Documentation for /api/follows end-point

* Rename and refactor User suggester

* Clean up feature flag

* User average count should be unscoped
2023-06-29 11:49:01 +02:00
Joshua Wehner
c2a131e43d
Add organizations to onboarding follow suggestions (#19564)
* Prepare: relocate user suggestions

* Prepare: relocate users suggestion service -> query

* Organization query for orgs with above-average scores

* Rubocop

* Limit to last 3 weeks

* Tweak recent scope, limit to 5 orgs

* Onboarding routes are also always JSON

* Divide by zero makes NaN means

* Add Orgs suggester into suggestions

* Rubocop

* select distinct orgs

* Fix for weird edge-case with bad local data

* Include type_identifier in JSON payload

* Update follows API to allow org_ids as input

* Update onboarding front-end to distinguish users/orgs

* Fix: i18n issues

* Fix: type_identifier in json output

* Fix: distinct is weird

* Fix: JS linter

* Continue tweaking front-end

* Audit import order

* Cleanup @todo note

* Try renaming controller action

* Move Article average calculation to postgres and fix math

* Refactor decorated type_identifier

* Refactor SuggestProminent, return more orgs, fix spec math

* Use FeatureFlag for organization suggestions

* This might fix the jest
2023-06-09 10:32:03 +02:00
Joshua Wehner
6b80d99c1b
Update onboarding suggested tag logic (#19477)
* Onboarding suggested tags should include supported

* Migrate tags to add suggested boolean column

* Use new suggested attribute

* Sync Settings.suggested_tags with new form setting

* Better sort order

* Test logic update

* Add a little comment
2023-05-23 17:22:27 +02:00
Lawrence
1b32e9a8e3
Hero Billboard Placement (#19467)
* init

* add option to swagger docs

* in_house validation

* filtered ad quesry changes

* styling and prioritizing home hero banner over campaign banner

* rubocop

* typo

* broken spec

* more spec fixes

* found the spec break culprit

* derp

* Update app/views/shared/_display_ad.html.erb

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

* Update app/controllers/stories_controller.rb

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

* remove immediate return

* styling feedback and moving banner to articles index

* remove nil

* updated styling

* add signed in bool

* add feature flag

* remove feature flag data scripts

---------

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-05-18 12:37:32 -05:00
Ben Halpern
bbcd1ed3da
Limit ApiSearchQuery results to index minimum score (#19407) 2023-05-01 17:49:09 -04:00
Ridhwana
e67454fa53
Preparation of endpoint and files required for ChatGPT Plugin (#19394)
* feat: add the ./wellknown/ai-plugin.json file

* feat: add a logo

* feat: firts attempt at open_api file with endpoint we thought we'd use

* feat: add a search action to teh articles controller that build up teh appropriate json

* feat: add a query param to the article index

* feat: add some chatgpt endpoints and file paths to CORS

* feat: update the openapi yml file to reflect the article search endpoint

* fix: use the correct concept

* feat: replace the logo

* feat: update the ai-json file

* feat: update the openapi file

* feat: update the api and it's params

* feat: update the search query

* fix: ordering

* feat: cors debug

* fix: logic with markdown

* chore: fix test

* spec: article

* spec: article

* spec: article

* Update public/.well-known/ai-plugin.json

* Update public/openapi.yml

---------

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2023-04-27 16:51:24 -04: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
d3f8e127fa
Add an article exclusion list to Billboards (#19280)
* Add exclude_article_ids int array

* Add specs, normalize inputs better

* Add to form & controller

* Add exclude_article_ids to DisplayAd API

* Use exclude_article_ids in query

* Rubocop

* Comment typo

* Tweak rspec example length config

* Arguments all the way down

* Typo

* Update spec/requests/api/v1/docs/display_ads_spec.rb

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>

* Update spec/requests/api/v1/docs/display_ads_spec.rb

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

* Swagger schema for Display Ad

---------

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-04-05 09:10:22 -04:00
Joshua Wehner
197b7f7128
Update FilteredAdQuery to better support community ads (#19281)
* Update FilteredAdQuery to better support community ads

* Maybe organization_id could be blank?

* Try an explanatory comment for filter ordering

* Update app/queries/display_ads/filtered_ads_query.rb

Co-authored-by: Anna Buianova <lightallloy@gmail.com>

* Rubocop

* Tidy up type matching logic

---------

Co-authored-by: Anna Buianova <lightallloy@gmail.com>
2023-04-03 14:44:35 +02:00
Mac Siri
842e6880b8
Routine rubocop fix on /spec (#19217)
* Softrun rubocop

* Hardrun rubocop (-A)

* Change a rubocop rule

* Add missing cops

* Undo & redo rubocop -A
2023-03-21 09:55:26 -04:00
Joshua Wehner
230e77e5cd
Update FilteredAdsQuery and user settings for opting-out of Billboards (#19208)
* Users can only opt-out of external ads

* Move random sampling out of FilteredAdsQuery

* Refactor filtered_ads_query_spec

* Add test for new permit_adjacent setting

* Rubocop

* Use permit_adjacent_sponsors on article sidebar and post-comments

* Remove, unused

* Update copy

* type_matched -> type_of_ads

* Remove non-applicable test

---------

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2023-03-16 15:23:02 +02:00
Lawrence
cfad413ca1
Display Rules for In house and Community Billboards (#19189)
* init

* Update app/queries/display_ads/filtered_ads_query.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/queries/display_ads/filtered_ads_query.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* add display ad query and update caller

* set as keyword args and add org id to callers

* Update app/queries/display_ads/filtered_ads_query.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/queries/display_ads/filtered_ads_query.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/queries/display_ads/filtered_ads_query.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/views/articles/_sticky_nav.html.erb

Co-authored-by: Joshua Wehner <joshua@forem.com>

* Update app/views/articles/show.html.erb

Co-authored-by: Joshua Wehner <joshua@forem.com>

* Update app/queries/display_ads/filtered_ads_query.rb

Spacing

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/queries/display_ads/filtered_ads_query.rb

More spacing

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/queries/display_ads/filtered_ads_query.rb

Co-authored-by: Joshua Wehner <joshua@forem.com>

* Update app/queries/display_ads/filtered_ads_query.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix some broken specs

* add updated spec for billboard rules

* missing comma

* Update spec/queries/display_ads/filtered_ads_query_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* add placement in spec

* fix external spec

* cleanup

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joshua Wehner <joshua@forem.com>
2023-03-06 14:15:14 -08:00
Ridhwana
686976ced8
Round Robin Notifications Refactor (#19026)
* chore: rubocop

* feat: rename the worker in accordance to our guidelines and to be more verbose

* refactor: move the NotificationsModeration service to be a users query, and move the constants out to new files

* refactor: removed subscribed_to_mod_roundrobin_notifications? which was only being used once in a test

* refactor: remove the aliass from the user method and add them to notification_setting + update references
2023-02-01 15:21:36 +02:00
Ridhwana
2da1b45c32
Move a portion of the Display Ads tests alongside the query (#19017)
* Remove jQuery

* Added jquery back to videos

* Removed jquery code

* Nit fix

* Revert incorrect code

* Updated jquery code to javascript

* Removed jquery from comments

* refactor: move the spec to test the query

---------

Co-authored-by: rt4914 <rajattalesra4914@gmail.com>
Co-authored-by: Rajat Talesra <rajat@forem.com>
2023-01-30 10:57:34 +02:00
Fernando Valverde
9fa52753c1
Remove community wellness badge rollout logic (#17639) 2022-12-19 11:48:31 -06: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
455399bdba
Rubocop fixes (#18461)
* Rubocop fixes

* Fixed most Capybara/SpecificMatcher violations

* Moved flash notice texts to locales
2022-09-16 15:25:48 +03:00
Suzanne Aitchison
8bfad257f9
ensure all test users are explicitly named (#18181) 2022-07-20 09:34:05 -06:00
Joshua Wehner
9bd93602ba
Admin can attach user via username (#18056)
* Admin can attach user via username

* Formatting

* Match @username as seen elsewhere

* Matching for accessibility

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

* Formatting cleanup after merge

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-07-18 14:17:45 +02:00
Suzanne Aitchison
5e8fae9ddc
Member index: Filter by status (#17980)
* show the statuses in the modal

* filter the results

* add some todo around good standing

* Enable Rails framework 7.0's isolation_level, partial_inserts, & raise_on_open_redirects (#17970)

* Member index: Show applied org filters (#17977)

* show applied org filters

* correct casing

* API V1 transition (#17835)

* API Articles v0-v1 restructure

* Remove unused helper

* Bulk move API controllers into concerns + add V1 controllers

* Extract API routes + some fixes

* Fix v1 api_controller authenticate! + add more article_controller specs

* Completed spec/requests/api/v1/articles_spec.rb

* specs up to listings

* All v1 specs except for 9 skips

* mime_types cleanup + authenticate! relocation

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>

* Fix email confirmation logic when registering via Omniauth (#17878)

* Move .skip_confirmation! call to .find_or_create_user! method

* Add regression tests to avoid email confirmation delivery

* Keep the original place where we had user.skip_confirmation! too

* Update logic to require email confirmation from omniauth

* test confirmation is required with SMTP

* Keep :notice instead of :global_notice

* Forem Account bypass email confirmation reorg

* inline comment reorder + clarification

* Apply suggestions from code review

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

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

* Member Index View Actions: "Adjust Credit Balance" (#17974)

* Adds the Adjust credit balance modal to index view

* Adds e2e tests for adjusting credit balances via modal

* Adds the ability to update credits to #user_status

* Adjusts the e2e to address failures

* Introducing a quick and dirty fix for abtests/admin (#17982)

This is a "quick and dirty" hack.  Do I like it?  No.  Do I want to delve
into further debugging/refactoring of [a 72 line method][1]?  Not at the
moment.  There are a few pathways forward, but for now, this is the
pathway to hopefully give us insight into the

**Why will this likely address the issue?**

Prior to this commit, for an experiment we would render each of the
goals (anywhere from 8 to 11); each of which would require 2 expensive
queries; which means about 16 expensive queries.

After this commit, the experiment page has none of those expensive
queries; instead each goal now runs the 2 expensive queries.

The hope is that this will help us show the results (albeit on multiple
pages) while coming in under the response time out handlers we have in
place.

**Why no tests?**

Ugh; I know right?!?  I'm beginning to ask that myself.  But for now,
because this is only visible to tech_admins, the consequences of
breaking are limited.  In otherwords, this is not a customer facing
feature, so it can be a bit less robust in it's testing.  At least
that's the rationalization I'm establishing.

Further, local tests would not reveal the production environment
complications of large data sets.  The aforementioned expensive queries
are blisteringly fast on my local machine...in part because I don't much
field_test experiment data.

Closes forem/forem#17981

Related to:

- forem/forem#17895
- forem/forem#17869

[1]:ab2d7d29d0/lib/field_test/experiment.rb (L98-L160)

* Adding test for redundant roles

* Adding filter for roles

* forget about good standing status

* remove good standing specs

* Update app/helpers/admin/users_helper.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* appease rubocop

* simplify

* add e2e tests

* add the applied filter pills for status

* make sure clear all button shows

* add a comment to explain good standing

* tweak

* set the registered dates of test users

Co-authored-by: Mac Siri <mac@forem.com>
Co-authored-by: Fernando Valverde <fernando@fdo.cr>
Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
Co-authored-by: Jeremy Friesen <jeremy.n.friesen@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-07-14 17:32:31 +01:00
Suzanne Aitchison
76c7932b09
Member index: Filter by joining date (#17975)
* add the date picker into view

* allow date picker to overflow modal

* allow aria labels to be passed to inputs

* filter records

* add missing comment

* set earliest date

* specs and a small fix

* cypress spec

* fix typo

* tidying up

* fetch date_format

* commit code review suggestion to params

* Revert "commit code review suggestion to params"

This reverts commit 84fb0e0d3acc13257a362eb41c17b2bb8089606a.

* show added filter pill

* add cypress specs for applied filters

* woops! fix unintended change to filter code
2022-07-14 14:52:42 +01:00
Anna Buianova
ff76cdd3c5
Scheduling articles (#17939)
* Article query spec for scheduled articles

* Added scheduled article badge on the user dashboard

* Added published_at field to editor options

* Accept and validate published_at from editor

* Refactor published_at validation

* Allow 1-minute difference in published_at

* Notice on an unpublished article page

* Added specs for 'Click to edit' link on scheduled article preview page

* ContextNotification model

* Articles::Publish worker

* Added specs for articles publish worker

* Schedule publish articles worker

* Added tests to check for scheduled posts in feeds

* Don't allow managing scheduled articles

* Don't send notifications for scheduled articles

* Set published_at in Articles::Updater when publishing

* Published_at value in post options

* Pass timezone and set published_at accordingly

* Limit setting published_at to the future

* Readonly published_at for articles that were already published

* Chagning published_at format in editor v1 (start)

* Changed published_at format in frontmatter, specs

* Added specs for updating published_at from frontmatter

* Fixed accepting past published_at for articles published_from_feed

* Enabled published_at validation: don't allow updating published_at for already published articles

* Validate published_at on create

* Added a spec for updating published_at for exported articles

* Fixed specs related to creating articles with past published_at

* Fixed specs related to past published_at for articles

* Added a hack so that admins would be able to update published_at

* Switch button text schedule/publish when changin publishedAt

* Fixed saving published_at with timezone

* Added a feature flag for scheduling articles

* Default text in markdown editor depends on feature flag

* Enable article editor cache again

* Fixed the default value in the markdown editor

* Fix sitemaps spec

* Removed tooltip

* Fixed articles update specs

* Added missing locales

* Fixed article create specs

* Fixed spec

* Removed commented code

* Returned enabling extensions in the schema

* Returned accidentally deleted constraint

* Make articles query spec more stable

Co-authored-by: Jeremy Friesen <jeremy.n.friesen@gmail.com>

* Removed commented code

* Removed unused code

* A clearer policy

Co-authored-by: Jeremy Friesen <jeremy.n.friesen@gmail.com>

* Use StringInquirer for article current state

* Added a note and todo to articles factory past trait

* Remove duplicated PropType

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

* Refactor query in the Articles::PublishWorker

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

* Refactor articleForm.jsx

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

* Removed specs that are no longer relevant

* Removed useless onKeyUp on a hidden input

* Refactored articleForm

* Hide scheduling from post options when published_at is readonly

* Run sends notifications worker every 5 minutes instead of every minute

Co-authored-by: Jeremy Friesen <jeremy.n.friesen@gmail.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2022-07-07 17:32:49 +03:00
Suzanne Aitchison
d57e4cabb7
Member index: filter by organizations (#17943)
* show the organizations checkboxes

* apply clear filter button and indicator

* filter by org in users query

* add some rspec tests

* add cypress specs

* correct cypress spec

* Fixing UsersQuery to ensure singular user by organization

Co-authored-by: Jeremy Friesen <jeremy.n.friesen@gmail.com>
2022-06-21 13:32:50 +01:00
Jeremy Friesen
b4f17ed7dc
Allowing UserQuery to filter on multiple roles (#17919)
I had looked at using `User.with_any_roles` but that creates one User
query per role passed.  Which is not ideal, given that we want to have
an ActiveRecord::Relation object on which we'd paginate.

This adjustment does it's best to mimic Forem's role structure and
adhear to how Rolify builds the underlying query.

An astute reader will notice that in these specs we use `role: "admin"`
and `roles: ["Admin"]`; the primary reason relates the user interface
being worked on in forem/forem#17884.  It is my understanding that the
`role` approach and `roles` approach will be separated by a feature
flag (we're rolling out the `roles` approach).

Related to
- forem/forem#17491
- forem/forem#17884
2022-06-15 08:50:03 -04:00
Julianna Tetreault
b155749db0
Searchable GDPR Delete Requests Table (#17633)
* Adds search functionality to GDPR delete requests table

* Adds e2e tests for searching GDPR delete requests

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

* Updates spec name to include _query

* Updates Adnub::GDPRDeleteRequests#index

* Adjusts expectations within gdpr_delete_requests_query_spec.rb

* Adjusts GDPR Delete Requests Query search default

* Updates gdpr_delete_requests_query_spec.rb
2022-05-31 16:22:25 -06:00
Fernando Valverde
8759439cd9
Fix spec calc that checks date filter expectation (#17690)
* Fix spec calc that checks date filter expectation

* Long line reformat
2022-05-16 12:43:18 -06:00
Fernando Valverde
8160089f3d
Remove Community Wellness badge feature flag (#17623)
* Remove feature flag

* Remove tracking spec

* Add rollout date restriction logic + specs
2022-05-11 12:08:40 -06:00
Fernando Valverde
bf4d34fe9c
Wellness badge query+service refactor (#17592)
* Query +service slight refactor

* 33 week comment
2022-05-09 16:44:50 -06:00
Fernando Valverde
c4df397fef
Community Wellness badge (#17394)
* First greedy algorithm approach to awarding community wellness badge

* Update app/services/badges/award_community_wellness.rb

I'm sorry I ignored you rubocop. It's still on draft for a reason 😅

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/services/badges/award_community_wellness.rb

Okay, whatever you say rubocop. This line will go away before merging anyways

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Use app/queries/comments/community_wellness_query.rb to replace greedy algorithm

* Query indenting + rename positive_reactions to negative_reactions in EXCEPT

* First step towards query spec

* Fix spec and make it more robust

* Slight cleanup/tweaks

* Badge reward & message

* copy edits + spec improvements + 3 days ago min for query

* Cron update to run daily + small tweak for FeatureFlag use

* inline comment tweaks

* Slight reorder of guard checks in service (FeatureFlag related)

* PR review feedback

* Fix specs from static method refactor

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-04-29 12:38:40 -06:00
Fernando Valverde
6e6c32e92a
Fixes a name conflict in Rpush models (#15978)
* Fixes a name conflict in Rpush models

* Removes unnecessary operator

* Review feedback
2022-01-07 09:38:16 -06:00