* refactor: make verifyAndDismissFlashMessage to be more general
* feat: update the shared admin utility
* refactor: manageCredits
* refactor: manageOrganizations
* refactor: manageRoles
* refactor: manageUserOptions
* feat: remove adminUtilities
* chore: update the path name
* Bulk Assign Roles UI
* Renaming roles to role
* Added role to multiple users without using note.
* Role note added
* Role blank key fix
* Removed roles
* typo fix
* AuditLog Added
* Optimising code
* Good standing role issue
* Good standing role issue fix
* Minor PR changes based on review
* Added cypress tests
* Added spec tests for BulkAssignRole
* Minor fixes
* 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
* Move save over and add button labels
* comment notification design and functionality
* controller error handling
* add ternery operator for background class
* minor cleanup
* add proper styling toggles
* tests and mobile spec
* add for all buttons
* add article as a param
* comment is not required on article preview
* update policy spec
* add test for coverage
* add proper button titles
* use the last user comment as comment id
* add better error handling and remove multiple fetch calls in js
* copy change to threads
* update copy, fix multiple fetch calls, add observer for loading more notifications
* update spec
* add rspecs
* more test specs
* fix test specs
* subscribe button text tests
* add export
* optimistically update ui function tests
* button initialize test
* check for comment ancestry
* add feature flag block
* some cleanup
* update logic and specs
* oops
* rubocop issues
* change config names
* change config names
* fix spec
* add one more conditional
* check for comments
* service-object the toggler
* separate routes
* continual refactoring
* refine spec tests
* clean up policy
* Adjust js and view files to match be params
* some service object refactoring
* separate endpoints on client-side
* broken spec
* service specs
* policy spec fixes
* remove action param
* remove action param from spec
* minor updates
* trigger build
* update to post
* Services don't need permitted params
* Notifications continue to be a mess, decorator specs to follow
* Not toggling now
* This doesn't really belong here
* Fix tests after moving
* Streamline front-end
* There could be errors?
* polymorphic_name is a class thing
* ☠️ json_data in notification views
* Use feature_flag helper to get current_user
* Cannot derive current subscription status from notification, only from subscription
* Default is subscribe to all article comments
* Sync up matching unsubscribe, make subscribe idempotent-ish
* Temporarily comment-out button jest tests to see if I can unstick CI
* Stop trying to detect potential subscribe-to-comment
* Stop trying to detect potential subscribe-to-comment
* Minor spec refactoring
* Add specs for article notification decoration
* NotificationDecorator specs are rather long
* Rubocop likes it?
* Minor spec refactoring
* Doesn't need to stay pending
* Add spec for subscription finder
* Expand Subscribe service specs
* YAGNI, but I don't like hard-coded config
* Refactor Unsubscribe service specs
* nobody expects the infinite scroll
* This *might* work, except for feature flag
* Ancestry can be quite deep actually
* Rubocop
* Update subscribe button for subscribe-to-thread
* Jest tests are just tests
* hasAttribute != getAttribute
* Test knows **nothing** about window size
* Tests have been lying about mobileLabel this whole time
* Make payload/endpoint testable
* Is Jest actually happy???
* Still cleaning up jest/eslint
* Temporarily comment-out cypress tests pending feature flag
* Thanks, Rubocop, what would we do without you
* Preserve round-trip for 'top-level' and 'only-author' subscriptions
* Update specs
* Move save button icon
* Update test with better config param
* Try feature flag specific to cypress env
* Tell cypress to wait for (un)subscribing to work
---------
Co-authored-by: Lawrence S <lawrence@forem.com>
Co-authored-by: Joshua Wehner <joshua@forem.com>
* 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
* Created separate comments page
* Optimised code for single comment and multiple comments
* Indifual comments poage added
* Minor header change
* Created show method
* Full implementation with eager loading error
* Temporarily suppress Bullet from Admin::CommentsController
* Minor fixes
* Minor fixes
* Added table
* Added french translations
* Added reaction stats / summary
* Tests added fore empty comments
* Added seed data and few more tests
* Updated test
* Added model tests for comment and article
* Nit test fix
* Applied changes as per PJ's review
---------
Co-authored-by: Joshua Wehner <joshua@forem.com>
* 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>
* init
* remove from asset pipeline and add tests
* add utc date conversion test
* try removing last tests
* add some more tests
* add tests for more coverage
* add yet more tests
* separate descibe statments
* add dt test back
* more test cleanup
* include pack js files
* add jest back
* Include /packs/ in code coverage metric
* derp
* revert jest
* reformat some of the test accordingly
* try e2e
* fix cypress test
---------
Co-authored-by: Mac Siri <mac@forem.com>
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
* feat: tests for series list on article page
* feat: test for jump to comments button (needs fix)
* feat: tests for reaction drawer on article page
* feat: test for full date on hover??
* feat: add full date on hover tests for all pages with publish dates
* fixed jumping to comments test
* move initialisers to packs
* fix coverage issues
* fix flaky login modal spec
* switch back to using onclick instead of addEventListener
* 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
* feat: tests for tag page sidebar drawers on mobile
* feat: tests for hero area/banner on home feed
* refactor: move ui interaction initialisers to packs
* remove old filter select implementation
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
Co-authored-by: Lawrence S <lboogie@Lawrences-Air.attlocal.net>
Co-authored-by: Rajat Talesra <rajat@forem.com>
* 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>
* feat: Add a pack file that pulls in the MultiSelect Component
* feat: move the tags to its own component
* save tags
* refactor: create a getCSRFToken function in the packs files so that it can be used in the admin
* feat: import the new module in request.js
* feat: remove unnecessary id
* feat: first pass of csrf token test
* chore: update the test
* fix: csrf token
* feat: hide the enw functionality behinda feature flag
* fix: loading form twice
* refactor: import for csrftoken
* chore: update the description of the function
* feat: use acts_on_taggable to craete a relationship between display_ad and tag
* feat: add a tag field to the display_ad form
* feat: add the selected tags from the multiselect autocomplete component to the input text field that references the tag_list
* feat: add the tag_list to the controller so that we can save it to the db with the display ad parameters
* feat: pull out the tag validation from the article and the display_ads into a concern
* feat: write soem tests for validating the tag on the display_ads model
* feat: add the tag_list as a hidden field
* feat: set the selected tags on edit
* feat: add a js class for the placement area
* feat: use the change in the dropdown to determine whether we show the tags field dropdown
* refactor: rename and brak up fucntions
* feat: show the tags field if the value of the placement area is already set
* fix: move if statement out of the change event
* feat: hide tags field and clear the tag list
* refactor: delete the display ads
* tests: ensure that we test the toggle
* fix:ensure that the tags on the hidden field show up as a string in the input field
* feat: update the jsdoc
* fix: no need to replace space with comma since we showing as string in form
* feat: update the name of the label
* fix: add hidden back
* Makes reason for adjustment optional for mod tag adjustments
* Makes reason for adjustment in notification conditional on adjustment reason
* Fix cypress element lookup by placeholder text
* Sort comments in articles page
* Clickable area in sort comments article is now more approriate
* Comments subtitle is now responsive in articles page
* Consider comments sort order for cache in articles page
* On selecting sort option the refreshed page lands to comments section
* feat: add a migration that creates a display_to column on the display_ads table
* feat: add an enum for display_to
* feat/WIP: add rough draft of the field to the UI and permit it in the controller
* feat: take into account on whether an ad needs to be shown on logged in or out or both + update cache keys on sign in
* fix: if a user is not signed in then we want to display all and logged out
* fix: display_for spec in model
* feat: add some tests for display_to
* feat: style the label
* feat: show the display_to on the index page
* feat: add a seed for e2e
* chore: force true