* Require profile fields to belong to a group
Remove the empty group dropdown from the group select tag
Remove the optional: true from the belongs_to validation (raise a
validation error on save if the group is not provided)
Update test to remove belongs_to's optional setting
* Update ProfileFields::Add spec to include profile field group
* update factory to ensure a non-empty profile field group
* Add required profile field group to seeded profile fields
Since profile field is required, create was failing (silently).
Add required field so these are available in e2e tests.
* Use factory `association` to create a profile field group
https://github.com/thoughtbot/factory_bot/blob/master/GETTING_STARTED.md#explicit-definition
* provide required profile field group when posting data
* Fix one spec, drop another
Both of these scripts will be removed in the other branch (changing
the attribute name) - dropping the test here seems lower trouble than
modifying an out of data data update script to pass.
* skip test slated for removal
Similar to the last commit - this test exercises a script about to be
archived in the other branch.
* move script to packs, strip ids
* make sure userdata is available before determining ui
* stop working around old html, fix duplicate ID errors
* skip login modal
* remove DEV hard coding
* replace system spec with cypress spec
* update base_data to include apple auth info, add to cypress tests
* add initial version of DUS to resave HTML
* remove data update script
* Removes code behind new_admin_members feature flag
* Removes components/admin/users/tools/* and the tools components
* Removes unused /admin/users/tools/* controllers, comments, and routes
* Removes New Member View-related E2E and RSpec specs
* Remove admin_users_tools.rb frin spec/support/shared_examples/
* Removes remaining component-related specs
* Removes the view_component gem and test helper
* Resolve merge conflicts in Admin::UsersController
* Removes the view_component gem, as it is no longer used
* Removes view_component from Gemfile.lock
* figuring things out
* working both ways for issues PRs except disc and PRreview
* working on repo urls
* complete implementation and check specs
* resolve Travis failures
* resolving travis failures
* Fix VCR cassette
* fix regexs
Co-authored-by: Jamie Gaskins <jgaskins@hey.com>
* Removes FeatureFlag.enabled?(:creator_onboarding) from codebase
* Removes FeatureFlag.enabled?(:creator_onboarding) from specs
* Further cleanup, removal, and spec fixes
* Fixes the user_request_confirmation_spec.rb
* Reverts change to confirmation email button
* Revert revert after looking at designs again :(
* Removes redundant logo_png field from config + fixes test
* Rewords an expectation in user_uses_the_editor_spec.rb
* Revert removal of logo_png from Config images
* Removes CSS class from user_uses_the_editor_spec.rb
* Removes test from user_uses_the_editor_sepc.rb
* Removes unnecessary else from _logo.html.erb
* Adds back removed system spec
* Removes SVG-related code from _logo.html.erb
* Removes AsyncInfoController#use_creator_onboarding
* Fixes spec failues due to removed code
* Removes svg-related code (that I thought I removed already :/ )
* Re-removes FeatureFlag and logo_svg from _images.html.erb
* Remove newest instances of FeatureFlag(:creator_onboarding)
* remove instances where we use the creator_onboarding field from the base_data
* fix: redirect to the correct path in the reguistrations controller based on whether the user is a creator or not
Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
* Base author reaction functionality
* Get logic more in place
* Finalize tests
* Add admin clause for new user points
* Add proper registered_at for seeded user
* Fix regsitered_at in e2e
* Add registered_at across the board in e2e tests
* Update comments
* Update spec/models/reaction_spec.rb
Co-authored-by: Jamie Gaskins <jamie@forem.com>
* Update spec/models/reaction_spec.rb
Co-authored-by: Jamie Gaskins <jamie@forem.com>
* Update spec/models/reaction_spec.rb
Co-authored-by: Jamie Gaskins <jamie@forem.com>
* Put points in constant and refactor points resave logic
Co-authored-by: Jamie Gaskins <jamie@forem.com>
Prior to this commit, we were somewhat naively rendering Hash style data
attributes in our ERB templates. By rendering each hash attribute
separately, we were rendering characters that could break the
javascript (e.g. double hack or backslash `"` or `\`).
By moving to this view_object rendering, we leverage Rails's `to_json`
behavior to ensure properly escaped values. As part of this exercise, I
generalized the method to allow for other places to benefit from this
behavior.
This generalization also helps ensure that we have a more conformant
rendering (e.g. we should always have an :id, :className, and :name
value in our data-info hash).
_Note: I've updated the user's names for Cypress tests as they are more
likely to catch the particular issue than anything else. I assume that
I'm going to break some cypress tests and will need some help fixing
them._
Closes#15916, #14704
Supersedes #15983
How to test locally:
Assuming you have seeded database (e.g. `rails db:seed`), checkout the
"main" branch. Then in `rails console` find a user that's written articles:
```ruby
user = Article.last.user
user.update(name: "\\: #{user.name}")
user.articles.each(&:save)
```
Now, again on the "main" branch, start your application (e.g.,
`bin/startup`).
Then get a logged in and a logged out browser session going. Open your
web inspector and open console. Then go to the local instances homepage
(e.g., http://localhost:3000) and look for JS errors.
On the main branch, you should see an exception around
`JSON.parse(button.data.info)` (assuming that the `user`'s article is
rendered on the homepage).
Then go to the user's page (e.g. https://localhost:3000/:user-slug) and
look for JS parse errors.
On this PR's branch (e.g.,
`jeremyf/take-two-at-resolving-gh-15916`)
you shouldn't see those console errors.
More importantly, the Follow buttons should work.
* Remove Connect
* Remove more Connect specs
* Remove a lot more Connect code
* 🚮
* It all has to go
* Explicitly add httpclient
* Update application layout
* Remove messages association from User
* Start fixing specs
* reintroduce util function and refactor references
* Remove Connect Cypress test
* Fix more specs
* Remove Connect from listings
* Ignore contact_via_connect column on listings
* Remove contact_via_connect usages
* Ignore mod_chat_channel_id on tags
* Drop Connect tables
* Remove email_connect_messages from user notification settings
* Re-add httpclient 2.8.3
This was mistakenly removed as a merge conflict
* Don't need to exclude removed chat channel file
* Remove unneeded style for chat channels
* Remove unneeded channel list prop type
* Remove chat channels index/connect-link from getPageEntries
* Re-add comment from httpclient in Gemfile
* Remove connect references from mailers
Tag Moderators no longer have a chat channel
No longer will users be notified about new messages (there won't be
any)
No longer will users be notified about channel invites (you can't
invite anyone anymore)
* Don't configure Pusher and remove PUSHER_* from .env_sample
since it's removed from gemfile, the Pusher constant will not resolve, if this is
configured in the environment variables we'll fail to boot.
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Dan Uber <dan@forem.com>
* Downcase `followable_type` to fix wrong follows creation bug
* Use `follow_button` helper
* Remove puts statement
* Revert use of follow_button helper
* Remove downcase of followable_type from helper
* Refactor switch case for better consistency
* Add e2e test for follow organization from article page functionality
* Split cypress `it` block into two
* Add additional test to following organizations from dashboard
* Remove downcasing of followable_type for decorated objects
* Fix failing follow back spec
* Force capitalize `followable_type` param
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
* Update app/controllers/follows_controller.rb
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
* Handling hiding/collapsing hidden comments client side
* Updated comment quality text
* Added placeholder for comments against podcast episodes
* Added logic for encompassing co-author-ids in articles
* Removed rspecs validating non-presence of hidden comments in dom
* Fixed hiding flow on comments page for a commentable
* Fixed e2e specs
* Addressed feedback on e2e tests
* Initial work to expand detection functionality
* Finish up functionality and tests
* Fix class name
* Fix tests
* Update spec/services/articles/enrich_image_attributes_spec.rb
Co-authored-by: Michael Kohl <citizen428@forem.com>
* Update spec/services/articles/enrich_image_attributes_spec.rb
Co-authored-by: Michael Kohl <citizen428@forem.com>
* Remove hard coded organization id from seed
Since we create (hopefully) an organization with a known slug, use
find_by here to set the organization_id on the seeded DisplayAd.
* Since the DisplayAd looks by slug, create org if slug not found
Change the seed guard to ensure an organization with slug "bachmanity"
is present - we'll find by slug in DisplayAd (rather than assuming
this is id 1).
* Make e2e seed safe to run twice
We have a number of checks in the seed file that prevent creating
objects if they're found in the database, but nothing is guarding
against this breaking.
Change a few create! to create_with().find_or_create_by() and update
guard clauses where we create if doesn't exist to match the objects
created. These had drifted, preventing subsequent runs of the seed in
a "dirty" database. In CI we're typically creating a new database,
loading schema, and only running this once, so the guards are never
checked and the objects are always created, but locally that might not
always be the case.
* Update multiple guards
We're creating test users against @forem.local domain, let's check
that there's not already a forem.local user with the same email
account.
Additionally, something was causing the "find article by title" to
miss identifying the commented article, but it was not create()'d due
to a slug collision, and the comment could not be created. Update the
call to use `create!` instead (since we rely on it existing in the
comment create) and guard against the slug instead of the title.
* Initial forem omniauth strategy setup work
* Finish basic raw proof of concept
* Some playing around
* use OAuth payloads + PASSPORT_OAUTH_URL for local dev
* Use FeatureFlag for Forem Passport Auth
* Working on tests
* Fix tests 🤞🏼 & some cleanup
* Use correct namespace within lib directory (match class namespace)
* Test to ensure Forem Passport auth is restricted by FeatureFlag
* Add broadcast + work on tests
* Update spec/lib/data_update_scripts/insert_forem_connect_broadcast_message_spec.rb
Co-authored-by: Michael Kohl <citizen428@forem.com>
* Hash format
* Schema cleanup + inline comments
* Use temprorary Heroku domain
* More cleanup
* Missed one
* Back to passport.forem.com
* Require correct path in lib
* Apply suggestions from code review
Co-authored-by: Michael Kohl <citizen428@forem.com>
* Use with_indifferent_access for symbol hash access in Forem strategy
Co-authored-by: benhalpern <bendhalpern@gmail.com>
Co-authored-by: Michael Kohl <citizen428@forem.com>
* hook up frontend parts
* complete backend, save success alert issues
* fix broken existing specs
* complete snackbar confirmation on page redirect
* rollback success alert; but leave foundation for it in place
* preserve a11y features of snackbar; complete cypress tests
* test redirect after braodcast destroy
* Admin-configurable display locale
* Add i18n-js and namespacing
* Basic tests and clean up
* A few test adjustments
* Update vendor cache
* Fix a few tests
* Fix a few tests
* Update app/views/articles/_actions.html.erb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update app/views/articles/_comments_actions.html.erb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update app/views/articles/_single_story.html.erb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update app/views/articles/_single_story.html.erb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update app/views/comments/_comment_header.html.erb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update app/views/layouts/_sidebar_tags.html.erb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update app/views/listings/index.html.erb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update spec/system/homepage/user_visits_homepage_articles_spec.rb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update spec/system/user/view_user_index_spec.rb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Alphabetical locale page
* Add activerecord custom validation error translations
* Add i18n to webpacker
* Fix a few tests
* Adjust error messages
* Add i18n-tasks
* Adjust JS to get working with jest
* Adjust the way translations are pulled in
* Adjust jest tests
* Remove time localization
* Remove superfluous public js
* Add basic tests for i18n application controller
* Remove unnecessary content
Co-authored-by: Michael Kohl <citizen428@dev.to>
This matches the same change made to the db/seeds.rb file at
https://github.com/forem/forem/blob/main/db/seeds.rb#L515
Since there's a validation that Listings are only 12 lines or
shorter, and no technical limit on the length of
`Faker::Markdown.random`'s output, take the first 10 lines only.
* Add feature flag for connect
* Start using Connect feature flag
* Add feature flag check to plaintext mailers
* Minor fixes/formatting issues
* Fix typo
* Enable Connect feature flag for tests
* Fix feature flag in tests
* Update rails_helper
* Fix typo
* (╯°□°)╯︵ ┻━┻
* One more try
* connect announcement
* Use connect feature flag in admin and admin routes
* Add aria-live attribute to announcement
* Undo schema.rb changes
Co-authored-by: Paweł Ludwiczak <ludwiczakpawel@gmail.com>
* Make podcast-playback to be controllable via keyboard
* Add improved state handling for the play/pause controller
* Fix business logic + Improve HTML semantics
* Remove manual tabIndex addition (not required now)
* Refactor redudant event-listener
* Keep aria-pressed label in sync in all cases
* Code refactor
* Add seed data to create a test podcast
* Add a static file and use that as example podcast episode (#1)
Rather than relying at test time on external media, and requiring the
podcast episode import flow to run during e2e testing, just insert a
canned episode that shows.
Confirmed in cypress this does show after visit('/pod') in the
togglePodcastPlayback.spec.js
* Add cypress test
* Move cypress tests
* Update cypress/integration/seededFlows/podcastFlows/togglePodcastPlayback.spec.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* fix button name in test
Co-authored-by: Daniel Uber <djuber@gmail.com>
Co-authored-by: rhymes <github@rhymes.dev>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Test with Grid layout
* Use Flexbox
* Replace with utility classes
* Wire up Tools -> Emails
* Stash: will rebase with a better commit message
* Fix transition between Email and Tools component
* Refactor Verify Email Ownership button a bit
* Use respond_to for verify_email_ownership
* Wrap the Preact Snackbar controller in Stimulus and use it from users/tools/email_controller
* Add HTML5 validation to EmailComponent
* Validation and cleanup
* Add Email history list and fix styling
* Additional styling cleanups
* Add error handling
* Close panel after email operations
* Actually use <local-time> GitHub time element correctly
* Add specs for Tools component and controller
* Email to Emails
* Add tests for Admin::Users::Tools::EmailsComponent
* Fix bug with ToolsComponent instantiation in ToolsController
* Add notes to show page
* Add ToolsComponent css
* Use Rails UJS instead of manual Stimulus to connect remote helpers
* Make Notes section come alive by adding its code
* Make Credits section come alive by adding its code
* Go back to vertical flex
* Finalize small restructuring of credits code
* Simplify ToolsComponent instantiation
* Add basic Add user to org functionality
* Make update user permissions form work
* Make remove user from org work
* Use generic Stimulus AjaxController to cleanup code
* Use Stimulus AjaxController for NotesComponent
* Use Stimulus AjaxController for CreditsComponent
* Use Stimulus AjaxController for OrganizationsController
* Add Admin::Users::Tools::ReportsComponent
* Do not display snackbar message if there is no message
* Add Admin::Users::Tools::ReactionsComponent
* Fix EmailsComponent spec
* Add CreditsComponent tests
* Fix quotes
* Add OrganizationsComponent specs
* Add ReportsComponent spec
* Add ReactionsComponent spec
* Fix rubocop violation
* Fix ToolsComponent specs
* Remove unused variable
* More tests
* Use keyword argument for ToolsComponent
* Fill in Tools requests specs
* Use Rspec shared_examples for ToolsController and EmailsController
* Add tests for Admin::Users::Tools::CreditsController
* Add tests for Admin::Users::Tools::NotesController
* Add tests for Admin::Users::Tools::OrganizationsController
* Add tests for Admin::Users::Tools::ReactionsController and ReportsController
* Fix bugs and add tests to Admin::OrganizationMembershipsController
* Add comments to deprecated sections of the UsersController
* Fix bugs and add tests to Admin::UsersController #send_email and #verify_email_ownership
* Add User model tests
* Feature flag fixes
* Add Cypress Tools - Emails tests
* Add Cypress Tools - Notes tests
* Add Cypress Tools - Credits tests
* Add Cypress Tools - Organizations tests
* Add Cypress Tools - Reports and Reactions tests
* Mark the replace target as a polite region
* Update view_component gem
* Tiny fixes
* Fix spec
* Wrap component rendering in render_component
* Move user.related_negative_reactions to a Reaction scope
* Move user.reports to a FeedbackMessage scope
* Move user.last_verification_date as EmailAuthorization class method
* Revert encapsulation to private
* Fix boxes backlinks names
* Add keyboard focus styling to boxes
* Remove duplicate styling
* Remove duplicated header element
* Improve heading hiearchy
* Fix <legend> and labels
* Backlink should be Tools not Users
* Announce section change to screen reader and fix focus
* Fix specs
* Add focus style for backlinks
* Enable email sending in e2e mode
* Use Settings instead of env variable
* Add the preview card to logged out feed initial content
* initialise the initial dropdowns added on the logged out feed
* minor tweak to selector
* flip the follow button and the summary
* add minimal preview card to build article HTML
* WIP: data fetched an inserted into card on logged out feed
* WIP: cards added to logged in feed
* create separate profile preview card component
* small style tweak, import pack on each page that shows feed cards
* rename
* tweak some styling issues
* make sure follow buttons init in cards
* populate all matching metadata placeholders after fetch
* don't render full preview card upfront on logged out feed
* refactors from PR comments
* fix issue in person search results
* remove check for article author link that will be superseded by cypress test for preview card
* Revert "remove check for article author link that will be superseded by cypress test for preview card"
This reverts commit 9b42804ffd0f051891c87293d0b791ed2bb0367f.
* Revert "fix issue in person search results"
This reverts commit 04941e3520c0895212141193b60f2933faed5ca1.
* only show the preview cards on story cards for Posts (not users etc in search results)
* correct display on collections view
* remove link check that will be replaced by cypress test
* tweaks to small issues, add a test for the logged out feed
* add tests for logged in home feed, logged out tag index
* add search test and tag index logged in test
* fixes to preview profile spec
* tweak to followauthor spec
* add cypress test for preview on series page
* use a unique test user for series test
* correct the jsdoc comments
* tweaks following PR review
* allow feed preview cards to reposition
* move to separate file from pack
* fix: github readme liquid tag broken links in HTML
The relative links contained in the README's HTML are replaced by absolute links.
These absolute links have broken URL's: https://raw.githubusercontent.com/forem/forem/main/#what-is-forem
This commit aims to fix the links with a correct URL: https://github.com/forem/forem#what-is-forem
* Add a test for GitHub Readme with relative URLs
* Fix test for GitHub Readme with relative URLs
* Fix test for GitHub Readme with relative URLs
* Revert "Fix test for GitHub Readme with relative URLs"
This reverts commit 1b38da9132baf72f88303316ab6116eb9175909b.
* Use new cassette for for GitHub Readme with relative URLs test
* Add cassette file for GitHub Readme with relative URLs test
* create new pack, handle user follow buttons, use pack on article page, remove initializeUserFollowButts
* init all follow button types, add pack to tag index and podcast episode pages
* add pack to all relevant pages, listen for newly inserted follow buttons
* change to searchParams to remove follow button initializer calls
* fix bug with tag page, add pack to notifications page
* fix issue with follow back inner text
* update cypress specs
* run the followbuttons code on sponsors page
* remove extra foreach
* add test for follow from article sidebar
* add test for follow and unfollow tag
* add test for the tag index page
* add spec for organisation profile follow
* add tests for follow buttons in search results
* add tests for notification follows
* commit missed file - woops
* show login modal if user is logged out when they click
* add cypress tests for logged out state
* change tag button initialization
* remove data-button-initialized
* init follow buttons from base pack
* handle the case where multiple follow buttons exist on a page for the same user
* account for instantclick and userdata not being defined, lower coverage for jest
* use getInstantClick
* fix issue with set initialisation
* only listen for mutations in areas we know follow buttons may be added dynamically
* small refactors
* schema file undelete description
* update with main
* update with origin
* Add "section" enum to navlink model
* create migration for section column
* create migration and data-update script
* update related rake tasks
* add scopes for default_links and other_links
* update E2E seeds
* ran migration; correct enum reference
* fix requests and model specs
* write DUS spec; fix factory and DUS
* yarn install
* address PR review comments
* fix migration; add null: false
* Remove yarn.lock from commit
* remove yarn.lock changes from commit
* sync yarn.lock with main
* newline