* 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>
* 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
* Fixed an issue with the moderation button not appearing on some posts.
* Added some E2E tests to ensure moderation button is on posts for trusted users.
* Added some more tests.
* Added a test to ensure moderation button does not appear when logged out.
* Uses Settings::UserExperience.public to conditionally render btn
* Updates landing page-related specs to account for private forem
* Uses Settings::UserExperience in place of ForemInstance in admin_creates_new_page_spec.rb
* Reverts Settings::UserExperience.public? changes throughout codebase
- Removes any changes to ForemInstance.private?
- Adds a new helper method, self.invitation_only?
- Updates self.private? logic
* Updates landing page specs and reverts unnecessary changes
- Reverts any changes that removed the check for
ForemInstance.private?
- Updates landingPage.spec.js to use findByRole rather
than findByText
* Reverts a change to admin_manages_pages_spec.rb
* Updates landingPage.spec.js per PR review comment
* Updates #private_forem_or_no_enabled_auth_options and spec
* Uses .invite_only? in _providers_registration_form.html.erb
* Adjusts authenticationSection.spec.js to test that FB is enabled
* Updates necessary specs to check .invitation_only?
* Consistently uses invite_only_mode_or_no_enabled_auth_options
- Updates all necessary places within the codebase to use
reverted method name, invite_only_mode_or_no_enabled_auth_providers
- Updates #self.enabled to check ForemInstance.invitation_only?
rather than ForemInstance.private?
- Reverts change to Facebook assertion within authenticationSection
e2e test
* Removes superfluous .to from authenticationSection.spec.js
When running tests locally (with an older version of the .env_sample
file as .env) I was seeing nil, rather than the empty string, when
running this spec. I determined the issue is that env vars
provided (but blank) are represented as empty strings, while env vars
not provided are returned as nil, and to avoid this dependence on the
environment file (at test time) it's better to provide the data you're
expecting (as we did for the other keys in the settings hash).
* Boost priority of queue stats worker
We were missing stats for hours at a time this week because this worker
was blocked behind other jobs. We *especially* need stats when Sidekiq
is saturated, so this commit puts these stats at the highest priority.
The tradeoff should be minimal. These jobs take 6-30ms once every 10
minutes.
* Change queue in worker spec, as well
* schema file undelete description
* feat: v1 of the script
* Flesh out remaining enums under their categories
* complete UsersSettings data update script
* complete DUS for relevant attributes in users and profiles tables
* complete DUS for users_notification_settings
* alphabetize user_settings sql file
* safeguard against null values for "null: false" settings
* Set up actual UsersSettings DUS and specs files
* fix broken DUS script
* complete specs for UsersSetting DUS
* Address QA of specs
* complete specs for users_notification_settings DUS
* fix the typos (thanks Julianna!)
* begin implementation
* still building
* add missing attribute "email_membership_newsletter"
* complete sync code (except race condition for user profile)
* complete implementation, remains tests
* Address PR review and fix Travis fails
* remove superfluous Profile.new
* fix travis fails
* feat: update the users_notification_setting attributes from the user model
* feat: use the config fonts enums to display the fonts
* feat: loop through the keys
* fix profile = nil blowing up; add specs for notification_setting model
* remove unneeded spec
* remove feed validation until after sync code removed; fixes feed_import spec failures
* remove spec associated with feed_url validation in user_setting model
* fix failing spec 😅
* add TODO
* feat: set the user settings in the user controller and use it in the customization form
* feat: move some update logic to the users settings controller thats being used from customization
* feat: show the updated values form the users_settingd and not the user instance
* Generalize redirect back to current tab
* still trying to reflect changed theme upon refresh
* customizations take effect on refresh
* remove 'with_feed' scope from user model
Co-authored-by: Jamie Gaskins <jamie@forem.com>
* start with takeover for fields previously in profiles table
* Takeover code for `publishing_from_rss` section in Settings (#13914)
* implement takeover code part 1
* implement takeover code
* fix feed fetch
* need rhymes help
* complete implementation; specs pending
* fix STUPID omission that caused so many headaches 😫
* implement profile fields pointing to users_settings 🎉
* run migrations
* implement inbox type & guidelines takeover code; specs pending (#13911)
* Point changes in notification settings to `users_notification_settings` table (#13910)
* implement takeover code; remains specs
* address PR feedback; remove related sync code
* address PR review feedback
* need help with routing and specs
* address pr review
* addressing pr review
* Treat implementation edge cases and omissions 😅
* fix uncommented comment
* fixing implementation cases
* address more PR review feedback
* fixing notifications use-cases
* refactor settings controller
* more pr review changes
* solving bugs
* fix broken onboarding
* handle eperience_level calls
* more fixes
* remove unneeded mappings
* add To-dos for quety updates
* remove done TODO
* purge done TODOs
* update notification_settings-related queries
* start fixing specs
* fixing specs
* fix notification and lrg_forem specs
* fixing broken specs
* still fixing
* fix line dif and remove reloads from user.rb
* run specs
* silence bullet and other fixes
* remove setting migration scripts and specs, fix more settings for specs
* handle missing user for article builder and fix notification specs
* fix some final controller specs and re-add incorrectly removed specs
* remove deprecated data update scripts and related workers, put travis back
* refactor admin tags mods controller, write/move specs for users notifications settings controller
* schema cleanup and other small refactors for consistency
* set field we can invalidate in spec via active record instead of at the db level
* remove I think an uneccessary hook call from subscribe_to_mailchimp_newsletter
* use bnefore_create to setup settings, please dont blow up the test suite
* mailchimp bot fix
* remove decorator in favor of single model method
Co-authored-by: Arit Amana <msarit@gmail.com>
Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
Co-authored-by: Arit Amana <32520970+msarit@users.noreply.github.com>
Co-authored-by: Jamie Gaskins <jamie@forem.com>