* 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 analytic page have no back-to-dashboard button when user have no organization
* resolve conflict with main
* remove dump
* add test for back to dashboard button
* add: article cache on update tag
* minor styling fix
* add: published scope to fetch articles
* update: tag_spec:125 to not fetch articles
* modify: tag.rb:bust_cache to delete server cache
* add: tests to verify cache delete
This method previously assumed that a reaction's `reactable` had a
`user_id` attribute, but if the reactable was a User, it wouldn't have a
`user_id`. The user id would just be `reactable.id`.
* Removing :apple_auth feature flag and debugging
* Fix tests failing due to nil in Devise initializer
* Remove db/schema.rb changes
* Devise config tweak
* cleaning up
* Fix spec + delete debug logs
* Removes temporary beta_access_providers spec + remove feature flag DUS
* Add test to avoid connecting an existing user with SIWA
* Fix merge conflict mistake + more feature flag cleanups
This matches what happens for the html preview ("Joined" is the user's
created_at timestamp), and what the json builder does:
json.created_at utc_iso_timestamp(@user.created_at)
Update the test cases to assert the profile preview is showing the
user's created_at, not the profile's created at.
Since these are almost always the same thing, we didn't notice
this. However, if a user is created just before the second boundary,
and their profile created immediately after the second boundary (so
that the iso8601 values have distinct seconds) this could fail when
looking at the wrong objects timestamp.
To test this locally I modified the user let block to update the
timestamp to be a day earlier (this would not have happened in
practice but was sufficient to cover the use case).
let(:user) { create(:profile).user.tap {|u| u.update(created_at: 1.day.ago) } }
* 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
I noticed a warning from rspec when this policy spec ran:
Using expect { }.not_to permit_actions could produce
confusing results. Please use `.to forbid_actions` instead. To
clarify, `.not_to permit_actions` will look at all of the actions and
checks if ANY actions fail, not if all actions fail. Therefore, you
could result in something like this:
it { is_expected.to permit_actions([:new, :create, :edit]) }
it { is_expected.not_to permit_actions([:edit, :destroy]) }
In this case, edit would be true and destroy would be false, but both
tests would pass.
I just follow the helpful advice.
* Add a failing test case
Currently fails with the reported error
expected no Exception, got #<ArgumentError: Requires a Node, NodeSet or String argument, and cannot accept a NilClass.
* Only replace inner html if not nil
`sub!` can return nil and you can't set an XML::Element's content to
nil (coercion fails).
* Use sub rather than sub! since we'll be using assignment
The issue we were seeing was that sub! returns nil when no change was
made, while sub always returns a string (with modificationsn made).
Remove temp variable since it's not needed when we use the other method.
* Update admin welcome checklist
* Update invite link text in test
* Remove extraneous invite line and period
* Add overview tracking to all links in checklist
* Fix spec to check for proper link
* Tests are failing to find header:nth-child(1)
Not sure why this did not fail in the branch - but the merge build
failed
Use 'div > header' (shudder), replacing the prior 'main > header'
selection, and avoiding the nth-child pseudoclass selector, to find
the "header" in the dashboard body containing the summary statistics.
This avoids the conflict with the top header (forem logo, search,
dropdowns) from the body/summary header (post views, credits
available, etc).
* Specify which div we want to look at
* change dashboard landmark nesting
* switch to main db/schema.rb
* remove unnecessary div
* revert scema.rb to main
* fix user_visits_dashboard test
* change aside to nav, put nav back into main-content
* remove unnecessary file
* remove duplicate nav
* add id to main
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* 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 sections in Admin
* Add "Section" radio btns to New-Link form
* Ensure links created in correct section
* Ensure links created in correct section pt2
* fix styling in admin
* complete section split on frontend
* start on specs
* complete specs
* remove unnecessary Cypress test file
* address all a11y comments in PR review
* fix broken specs due to a11y changes
* Add additional test cases to the DUS
And then handle them.
* rubocop changes
Keep let blocks together
prefer blank? to ! + present?
* Test copied script as well
Since the file was fixed, then copied - we want to test the copy that
will actually run (these _should_ be idempotent and running both back
to back will cause no harm).
* Validate website_url profile field is a url
related to issue #14300
May need a data update script to (fixup? remove?) invalid profiles
since not being able to save existing profiles will cause problems.
* Check that URI is a valid url
Require the scheme to be one of https or http, not something like
mailto:// or telnet:// (nobody would do that, but don't try and link
to it if they did).
* Rubocop fixup for validation rule
URI::regexp is obsolete and should not be used. Instead, use URI::DEFAULT_PARSER.make_regexp
Prefer %w[] literals for arrays of words
Prefer the new style validations `validates :column, format: value` to validates_format_of
* Permit empty website_url fields
The previous validation was rejecting nil, which was the default. This
caused a lot of user factory calls to fail (since users didn't need
website urls in the profiles during testing unless the test was about
the website url link).
* Use :url validation as suggested
* Update validation error message
The validate_url gem gives a more complete error message to the
user. Update the spec to expect this.
* Use url_field rather than text_field in profile form
https://apidock.com/rails/v6.1.3.1/ActionView/Helpers/FormHelper/url_field
* Add data update to either fixup or clear invalid website urls
Checking blazer there are about 2600 profiles with "invalid" website
urls, typically a hostname, sometimes a hostname + path component,
which should be fixed up.
Naively add https:// to the front of the url, check that a valid
scheme and host are present on the resulting url, and save.
If an invalid url is generated (specifically, if host or scheme are
nil), just set the website url (with the invalid link) to an empty
string.
It's possible we'd want to notify users affected by this, that was not
included in this pass.
* Skip validations for intentionally invalid test cases
* Add tests and Railsify a few things
* Adds JSON representation of ProfilePreviewCardsController
* Load profile and setting eagerly
* Add profile preview card color
* fix: shorten_urls to only shorten URLs
* revert: changes to schema.rb
* modify: test to aggregate failures
Co-authored-by: rhymes <github@rhymes.dev>
* fix: shorten_urls to only strip urls
* improve: regex and variable assignments
* remove: unnecessary var assignment
Co-authored-by: rhymes <github@rhymes.dev>
* fix: artiles from the same feed can be fetched from multiple accounts
* undo unintentional changes to schema.rb
* modify: article_spec and import_spec tests
* fix: failing test
* modify: import_spec:213 for user.setting
* fix: failing test import_spec:213
* add: unique index on articles canonical_url where published
* revert: schema.rb
* modify: unique url error message to include admin email
* modify: custom error message
* modify: .update to .update! (bang)
* Remove unused profile fields
* Clean up CSV
* Account for user settings in Profiles::Update
* Move brand color validation to Users::Setting
* Fix specs
* fix: shorten_urls to only shorten URLs
* revert: changes to schema.rb
* modify: test to aggregate failures
Co-authored-by: rhymes <github@rhymes.dev>
Co-authored-by: rhymes <github@rhymes.dev>