* feat: remove initializeSponsorshipVisibility and related code
* feat: remove sponsorships from sidebar
* feat: remove sponsorships from the admin - route, controller, view, spec
* feat: remove the admin menu item
* feat: remove the i8n for admin sponsors controller
* feat: sponsorship decorator was not being used anywhere
* feat: sponsorship slack messenger was not being used anywhere
* feat: remove the sponsorship_headline that gets configures on the admin
* feat: remove the /sponsors page
* feat: remove renedring of single_sponsor partial and associated partials
* feat: remove the navigation link rake task for sponsors
* feat: remove sponsorship from tags
* feat: remove i8n constants used
* remove sponsor references in text to the privacy page
* feat: remove the sponsorship detail from the organization page
* feat: remove the sponsors css that was used for app/views/pages/sponsors.html.erb
* feat: remove the sponsorship i8n that was used in the slack messengers
* feat: swap out the decorators to use Article as an example
* feat: remove spec to show sponsors on home page
* feat: update the specs to use Article Decorator instead of the Sponsorship Decorator
* fix: use direct and not all
* fix: remove tests for tag sponsorship
* fix: remove organization sponsorship test
* feat: remove more i8n
* add new column with enum value
* refactor to use display_to column
* add some more specs to application_helper
* test for the backfill DUS
* fix line length
* refactor
* move home link to a customisable navlink
* add trailing slash for path
* update specs
* replace positions, set home link to -1
* add update script for adding home navigation link
* update data update script
Prior to this commit, we were treating all NavigationLink attributes as
unique. So, were we to change a position of one of the NavigationLinks
during the add_navigation_links rake task, we would have created a new
NavigationLink (and the only one would have remained).
With this commit, we're introducing the concept of the NavigationLink's
surrogate identity, that is to say if we have two NavigationLink objects
with the same `url` and `name` we should consider them the same
NavigationLink. This allows us to update properties of those
NavigationLinks (via the rake task) without the risk of creating new
entries.
This unblocks PR #16268 which addresses #16076.
* Let override of ToS and CoC show in onboarding
Prior to this commit any changes to the terms or code of conduct were
not reflected in the onboarding links.
With this commit, I'm leveraging a newly created method that first
checks if there's a page for the given slug. If there is, use that
page's copy.
To test:
- Overwrite default /terms page on a Forem
- Navigate to /onboarding or sign up as a new user
- Click on Terms of Use link text
- Review Terms of Use
Closes#15296
* Adding spec around not passing a block
* Allow for skipping navigation link creation
This commit provides a possible solution for preventing the re-creation
of a navigation link deleted by a Forem creator.
What I need is a discussion around the life-cycle of the application
installation and updates.
In particular, does this provide a robust enough mechanism for resolving
the issue at hand?
_Note: it pains me to ask about a user's role, but this is provided as a
point of discussion and possible implementationi to address the
underlying issue. But I'm referencing a constant in the Rake task so
hopefully that will help future refactors. Also, it's one reason I
needed to remove the `private_constant` declaration._
If we accept this code change, a future task is to document the ENV and
behavior.
Closes#15960
**Further considerations**:
- How might we refine this to not be as "role" reliant?
- Could we have a Site::Setting that we enable/disable
regarding the navigation links?
Regarding QA:
- Start from an empty database
- Run setup
- Verify Navigation Link exists
- Delete Navigation Link
- Run setup again
- Verify Navigation Link exists (because we don't have a user)
- Run seeds
- Delete Navigation Link
- Run setup again
- Verify Navigation Link exists (because we don't have a user)
```shell
$ cd ./path/to/forem/repo
$ rails db:drop db:create db:schema:load
$ bin/setup
$ bin/rails runner "puts NavigationLink.where(url: '/readinglist').exists?"
=> true
$ bin/rails runner "NavigationLink.where(url: '/readinglist').delete_all"
$ bin/rails runner "puts NavigationLink.where(url: '/readinglist').exists?"
=> false
$ bin/setup
$ bin/rails runner "puts NavigationLink.where(url: '/readinglist').exists?"
=> true
$ bin/rails db:seed
$ bin/rails runner "NavigationLink.where(url: '/readinglist').delete_all"
$ bin/rails runner "puts NavigationLink.where(url: '/readinglist').exists?"
=> false
$ bin/setup
$ bin/rails runner "puts NavigationLink.where(url: '/readinglist').exists?"c
=> false
```
* Bump for travis
Changing `Terms of use` to `Terms of Use`
This has been bothering for me a while, and it's now consistent with `Code of Conduct` (which is not `Code of conduct` ) capitalization-wise
* 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
* Allow DATA_UPDATE_WORKER_DELAY to be set otherwise run DataUpdateScripts immediately in the background
* update var name and comment
* set a heroku friendly default
* Update ENV variable name
* Clear asset and vendor caches on deploy
We don't need these inside deployment artifacts
* Don't remove cached gem package files
Apparently Bundler uses this to determine whether the gems it needs are
installed. :-\
* Rename SiteConfig
* More renaming
* Update spec
* Update mandatory settings mapping
* More renaming
* e2e test fixes
* You have a rename, and you have a rename
* Spec fix
* More changes
* Temporarily disable specs
* After-merge update
* Undo rename for migration
* undo rename of DUS
* Fix DUS
* Fix merge problem
* Remove redundant DUS
* Fix specs
* Remove unused code
* Change wrong class name
* More cleanup
* Re-add missing values to constant
* Fix constant
* Fix spec
* Remove obsolete fields
* Add accidentally removed field
* Update spec
* Move methods from Settings::General to ForemInstance
* Remove unneeded model
* Change mentions of 'site config'
* Reduce service worker functionality to minimal offline page
* Update docs for service workers
* Add comment to fix test
* Include incrementable static cache
* Add TODO comments about removal
* Fix trailing whitespace
* Added custom seed task
* Added a test for the initial login for the intial admin of a forem instance.
* Renamed admin login seed data file.
* Pulled functions out of main Cypress plugin file and import them now.
* Added some comments.
* Added a comment about Cypress tasks requiring a return value to be considered successful.
* Moved admin_login_setup seed file to spec folder.
* Made change requests in regards to rake task.
* Fixed reference to SiteConfig
* Created the seeder class to be shared for all seed files.
* Added a missing param to function comment.
* Fixed seeder require in e2e test seed file.
* Fixed seeder require in seeds.rb. Why is Rails.root required?
* Added an environment guard for not being production in the e2e seed task.
* Made seeder require relative.
* Trying something for the Elastic Search issue in CI.
* Revert "Trying something for the Elastic Search issue in CI."
This reverts commit 7cb2a963c8ac1f9242c612a1b9fe8ff814605df6.
* Search indices are now removed via bundle exec rake search:destroy
* Now rake search:destroy is used in the Cypress task for resetting data as well.
* Moved Seeder class to app/lib
* Added cypress-rails
* Got two flows working with db rollbacks.
* Trimmed down the e2e dataset for now.
* Added a custom Cypress command to encompass test setup.
* removed unused e2e rake task
* added some user login/password e2e tests.
* Added a note about Cypress not cleaning cookies, so we do for the moment.
* Removed code no longer required.
* Removed comment in test that is no longer pertinent to the test suite.
* Removed data cleaning plugins as cypress rails gem handles it now.
* Added @citizen428's recommendation got raising an error if trying to seed production.
* Temporarily have paralleziation of e2e tests disabled to figure out cypres-rails/knapsack pro integration.
* Doh! Forgot a semi-colon in the Travis config.
* Added a comment about not integrating cypress-rails/knapsack pro right now.
* Removed knapsack pro npm package for now as we aren't using it.
* Reworded comment about cypress-rails/kanpsackpro.
* Removed seeding for tags to follow for onboarding in e2e seed data.
* Made pree2e script e2e:setup so it only runs explicitly when needed.
* Renamed bin/e2e to bin/e2e-ci.
* Created a new script for local e2e testing.
* Removed RAILS_ENV as it's in the e2e-ci script already.
* Fixed an auto corrected command.
* Fixed wording in e2e script prompt.
* Removed bundle exec rake data_updates:run that I had added. Doesn't appear to be necessary.
* Added missing new lines.
* Renamed e2e seed file and only use that one now. THere are no others.
* Some script cleanup.
* Added a check for the E2E environment so as to not pollute system tests.
* Now e2e test server cleanup occurs when the server shuts down.
* Put puts as this is really just for testing.
* Put environment variable in the proper place for runnning bundle exec.
* Added a check to only run for E2E tests.
* Some bash script formatting.
* Removed copy paste irrelevant comments.
* Updated e2e server shutdown message.
* Now a data-testid attribute is used for finding the user account errors panel.
* Made test selectors ignore casing of text.
* Removed prod paranoia check in e2e seed file.
* Refactored spec to use new cy.loginUser(user) command.
* Update app/lib/seeder.rb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Fixed flakiness that @aitchiss was experiencing.
* Rubocop fix.
* Due to a Cypress issue, fixing cookie clearing with another tweak.
* Bumped the wait time to 500ms if cookies don't clear.
* Added a 'bundle check' to the bin/e2e script as suggested by @katiedavis.
* Removed some white space
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Add script to remove feature flag
* Remove :feeds_import feature flag and RssReader and related classes
* Change Feeds::ImportArticlesWorker signature to support Sidekiq Cron serialization
* Replace RssReader::Assembler with Feeds::AssembleArticleMarkdown
* Removing Assembler
* Add earlier_than to Feeds::Import
* Ignore feeds that have been imported in the last 4 hours
* Make earlier_than mandatory in Feeds::ImportArticlesWorker
* Feature:Award Hacktoberfest Badges Rake Task
* Update to use subscriptions to hand out badges
* some script tweaks to detect successful completes and handle failures
* Add explanatory comment to how RssReaderFetchUserWorker works
* Add Feeds::ImportWorker worker
* Enable Feeds::Import for single user feed fetching behind a feature flag
* Add Feeds::ValidateUrl service
* Add feature flag to user's validate feed URL feature
* Remove todo notices
* Add feature flag to fetch_all_rss task
* Add feature flag to RssReaderWorker
* Bring back short-circuit for Articles::RssReaderWorker
* Add the parallel gem
* Add prototype version of Feeds::Import with parallel URL fetching and parsing
* Tune Feeds::Import and add rake task for local tests
* Add rough measurer tool
* Add specs
* Apply suggestions by @citizen428
* Replace silence with silent
* No need for eager loading
* Add temporary Articles::DevFeedsImportWorker
* Remove temporary rake task
* Add basic error handling, copied from RssReader
* Fix error handling
* Remove temporary measuring rake task
* Remove logging added for development purposes
* Add info and error logging on error level
* feat: configure the frontend for sidebar nav links
* chore: add a comment
* changes to the admin interface
* feat: move the temporary task to be in the rake tasks and use it in the dev seeds
* feat: use the task in the rake seeds
* refactor: reuse the form across two modals
* refactor: use the form partial
* feat: change the modal to be large
* fix: naming
* Update db/seeds.rb
Co-authored-by: Michael Kohl <me@citizen428.net>
* chore: make the file readable
* chore: removed the if else as the rake task was run on all forems + i sent out a message to new communities
* oops
* refactor: add a scope
* chore: oops removed this
* feat: add navigation links specs
* spec: fix two failing ones
Co-authored-by: Michael Kohl <me@citizen428.net>
* feat: add the order of the navigational items to the database + admin interface
* refactor: rename :display_when_signed_in to :display_only_when_signed_in
* chore: rename all instances of display_when_signed_in to display_only_when_signed_in
* feat: add a data script that will setup the base urls
* feat: add a temporary rake file that will allow us to seed prod db's
* chore: oops rename file
* chore: remove the index for now
* chore: remove validation
* feat: change the order field to position and add an index o the name and url
* feat: update everything that uses order to position
* refactor: order by name as a secondary attr
* Optimization:Move Initilization CacheBust to Background Worker
* lower cache bust to 5 min and then bust shell version last
* moving back to 10 min after looking at recent deploy data