Commit graph

4935 commits

Author SHA1 Message Date
Suzanne Aitchison
516bab133f
Storybook dropdown should be accessible 11724 (#12295)
* allow keyboard access to dropdown stories

* add accessibility notes to dropdown stories

* manage focus in html example

* Update reference to aria attributes in notes

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>

* add focus style to link for keyboard users

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2021-01-19 08:51:37 +00:00
Ben Halpern
d7732499b9
Improve cumulative layout shift on comment reactions + optimizations (#12309)
* Improve content layout shift on comment reactions + optimizations

* Clean ups, tests, and docs

* Fix test typo

* Update app/views/comments/_comment_footer.html.erb

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

* Update docs/technical-overview/architecture.md

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>

* Update docs/technical-overview/architecture.md

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>

* Update docs/technical-overview/architecture.md

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>

* Refactor and add jsdoc

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2021-01-18 19:29:44 -05:00
le-hu
619dd813c7
secure Identity#email in case of missing auth_data_dump hash (#11936) (#12322)
* secure Identity#email in case of missing auth_data_dump hash (#11936)

* Refactor Identity#email

* Delete wrongly commited debugging line

* extract no email found message into Const

* refactor Identity#email to use || as flow control
2021-01-18 19:27:07 -05:00
Nick Taylor
425c3072f7
Fix broken test pre-Preact upgrade (#12328)
* Removed import of xss as it already happens in testSetup.js

* Fixed invalid setting for a the children prop.
2021-01-18 14:39:17 -05:00
Ben Halpern
472c3d2922
Fix and refactor hide user content (#12307) 2021-01-18 11:08:23 -05:00
Shilpi Agrawal
92f191445b
Refactored all site config default hardcoded value in rspec test (#12315)
* Refactored all site config default hardcoded value in rspec test

* Remove Liquid::BlockBody patch (#12313)

* Refactored all site config default hardcoded value in rspec test

* Added seperate function to fetch default site confif value and using it in specs

Co-authored-by: rhymes <rhymes@hey.com>
2021-01-18 15:23:40 +01:00
Anna Buianova
020912264e
Optimize loading partials as collections (#12276)
* Load events' partials  as collections

* Load /admin/articles partials as collections

* Render sponsorships partial as collection

* Render organization articles partials as collection

* Load users articles partials as collections
2021-01-18 14:18:33 +03:00
dependabot[bot]
a63ba17b6a
Bump liquid from 4.0.3 to 5.0.0 (#12150)
* Bump liquid from 4.0.3 to 5.0.0

Bumps [liquid](https://github.com/Shopify/liquid) from 4.0.3 to 5.0.0.
- [Release notes](https://github.com/Shopify/liquid/releases)
- [Changelog](https://github.com/Shopify/liquid/blob/master/History.md)
- [Commits](https://github.com/Shopify/liquid/compare/v4.0.3...v5.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

* Convert ActiveSupport::SafeBuffer to string

* Disable echo and render tags

* Disable liquid tag

* Add issue link

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: rhymes <rhymes@hey.com>
2021-01-15 15:37:42 -06:00
Bogdan Covrig
ad4df246dd
Replace misc :user_settings_path with :customization (#12300) 2021-01-15 15:17:23 -06:00
Julianna Tetreault
d06ee645f8
Improve Error Messaging for Self-Deletion Confirmation Flow (#12266) [deploy]
* Adds guard clauses and better error messages to UsersController #confirm_destroy

* Adds tests around guard clauses in UsersController #confirm_destroy

* Adds a custom error for invalid tokens in UsersController#confirm_destroy

* Refactor user_destroy_token.rb initialize method to be more succinct

* Removes unnecessary code from user_self_destroy_spec.rb and fixes failing InvalidToken spec

* Reworks code in #confirm_destroy to be consistent with other #destroy methods

* Adjust token mismatch test to use mismatched tokens

* Refactors #confirm_destroy and adds a before_action to Users::Controller
 - Reworks the logic within #confirm_destroy and removes excess code
 - Adds set_or_sign_in_user before_action for #confirm_destroy
 - Removes custom InvalidToken error message

* Cleans up spec and adds an additional test around logged out user edge case

* Fixes failing tests due to changes in #confirm_delete flow

* Adjusts test logic in user_self_destroy_spec.rb

* Refactors code by removing custom before_action and rewriting conditionals
2021-01-15 11:51:06 -07:00
Fernando Valverde
e60159184f
Fixes apple auth creator flow in /admin/config (#12287) 2021-01-15 08:07:34 -06:00
Molly Struve
636f4b0ae1
Bug Fix:Increase Default Rate Limit for User Updates to 15 (#12281)
* Bug Fix:Increase Default Rate Limit for User Updates to 15

* spec fix
2021-01-14 12:51:08 -06:00
Ben Halpern
4c6a7ef234
Fix outstanding /pod main image problem (#12280) 2021-01-14 13:18:47 -05:00
Fernando Valverde
7f3859a8b4
Workaround for Apple auth problems (still in beta) (#12263)
* Workaround for Apple auth problems (still in beta)

* Fix spec
2021-01-14 09:44:56 -06:00
Ben Halpern
444841bb90
Fix domain list bug (#12268) 2021-01-14 10:43:42 -05:00
Alex
31689fd76a
Break MarkdownFixer into MarkdownProcessor::Fixer services (#12241)
* Create new MarkdownProcessor::Fixer services

* Remove old MarkdownFixer

* Code cleanup

* Capitalize Base in code comments

* Remove comments related to inheritance

* Add fix_methods method to hold METHDOS constant
2021-01-14 10:26:46 -05:00
Michael Kohl
cc6edc66b6
Remove contact_consent column from ignore list (#12254) 2021-01-14 12:38:42 +07:00
Molly Struve
5a3ea304ca
Log User Save Error Messages When it Fails (#12267) 2021-01-13 16:14:48 -06:00
Andy Zhao
eed4df0fa4
Add sorting feature to /admin/tags (#12249)
* Use Ransack for admin/tags

* Update admin tags index to use search with Ransack

* Add feature to sort tags in /admin/tags

* Add test for viewing /admin/tags pages

* Add aria labels for sort links

* Make links a bit more accessible
2021-01-13 17:03:17 -05:00
Andy Zhao
b45c578ea1
Encode emails properly before sending to /confirm-email (#12211)
* Refactor test a bit

* Account for URL encoding when redirecting to /confirm-email

* Fix failing spec

* Use correct method to encode + and @

* Fix test

* Don't encode things I don't need to (thanks Nick)
2021-01-13 15:17:14 -05:00
Alex
27df7ddee5
Remove old MailchimpBot (#12244)
* Remove old MailchimpBot

* Wake up, Travis

* Wake up, Travis
2021-01-13 14:33:21 -05:00
Arit Amana
3a984c8ee7
[2020 EOY Issue] Modal alert when enabling Auth Provider without keys (#12135)
* Start hooking things up

* further generalize adminModal, hook up relevant code

* Complete implementation

* remove comments

* Address QA suggestions

* Address QA suggestions

* Use object parameter for adminModal

* starting the admin cypress tests

* Code review suggestions

* remove incomplete test

* rename data attributes to make more sense

* complete the work

* use destructuring

* edit warning modal text
2021-01-13 13:54:39 -05:00
Molly Struve
0f2c0c70b1
Log onboarding_checkbox_update Params (#12252) 2021-01-13 12:39:25 -06:00
Alex
01a4b41fed
Fix shell version logic in async info controller (#12262)
* Add .to_s to ForemInstance.deployed_at

* test: could it possibly be holding onto the cached value across the tests

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2021-01-13 13:20:34 -05:00
Alex
a5e6f7942c
Rename MarkdownParser to MarkdownProcessor::Parser (#12248)
* Rename MarkdownParser to MarkdownProcessor::Parse

* Wake up, Travis

* Fix typo
2021-01-13 10:39:13 -05:00
Ridhwana
4549144fbb
Refactor deployed_at and latest_commit_id code (#12224)
* WIP: release footprint in the admin UI

* feat: show the commit ID and the date

* chore: change env optional to empty string

* fix: change the FOREM_BUILD_DATE to RELEASE_FOOTPRINT

* feat: add Not Available as a last option

* test: last deployed time and latest commit id

* feat: update the way we change the env variable!

* fix: we need to set the RELEASE FOOTPRINT so that this clause is not hit - `return path if release_footprint.blank?`

* feat: add a Forem Instance Model

* chore: rename variable

* feat: use the new model that we created

* feat: Update the Forem Instance model to remove Not available from the model method and add it to the view layer

* test: Forem Instance model to return the correct values when present

* feat: use Forem.deployed_at instead of the Application config directly

* chore: remove the initializer

* feat: rename the data keys to reflect what it does

* fix: oops evaluate the var

* refactor: static values that can never change during the lifetime of the app should be constants

* chore: setup the test to have a release footprint before the test gets executed

* chore: remove the methods

* revert to method + cache

* revert to using method

* reset the instance variable
2021-01-13 16:53:59 +02:00
ludwiczakpawel
0c6c5c55a1
Code snippet fullscreen icon - setting constraints for size. (#12010)
* tooltips 1.0.1

* tooltips 1.0.1

* initial fix

* .

* .

* test

* Add data update script to re-save published articles

* Approve verified diffs

* Fix Rubocop violation

Co-authored-by: rhymes <rhymes@hey.com>
2021-01-13 15:17:10 +01:00
Spencer
27648a938b
API: Endpoint to get an organization's articles (#12237)
* update route

* add controller action

* add article jbuilder/update shared files

* add tests

* update api docs

* add published to query

* render articles index/delete articles jbuilder

* call articles index attributes const

* put back article/flare partials

* bug fix for readinglist index

* bug fix for render partial in jbuilder
2021-01-13 13:09:58 +01:00
Michael Kohl
576d60d6bf
Standardize bot meta tags (#12197) 2021-01-13 11:16:33 +07:00
Michael Kohl
b5a9eeb95e
Remove contact_consent from users (#12196) 2021-01-12 16:18:47 -05:00
leewynne
09fa4551b1
Only show user count for large userbases (#12238) 2021-01-12 11:58:03 -06:00
Alex
b168e1529f
Move HexComparer to Hex::Comparer service (#12202)
* Move HexComparere to Hex::Comparer service

* Create USER_COLORS constant and constant specs

* Move formats to constants

* Rename Hex::Comparer to Color::CompareHex
2021-01-12 11:34:30 -05:00
Alex
dfeccf6c11
Move MailchimpBot to Mailchimp::Bot service (#12205)
* Move MailchimpBot to Mailchimp::Bot service

* Update specs

* Put back old Mailchimp Bot
2021-01-12 10:28:48 -05:00
yogeshwaran
cf0a85b3a4
Bug fix #11402 - Very wide code blocks overflow in comment preview (#12166)
* Fix #11402 - Comments with code not scroll issue

* Fix #11402 - Comments with code not scroll issue

* Fix #11402 - Comments with code not scroll issue

* #12166 - PR Review changes

* Fix #11402 - Comments with code not scroll issue

* #12166 - PR Review changes
2021-01-12 10:45:25 +01:00
Molly Struve
49bf1fdea9
Bug Fix:Update Admin Route in View to go to Edit page (#12213) 2021-01-11 18:53:00 -06:00
Michael Kohl
7089da6520
Remove looking for work columns from User ignore list (#12195) 2021-01-11 16:59:57 -05:00
Ben Halpern
9b5e694e9c
Ben/new branch noindex spam comments (#12210)
* noindex google any comment permalinks with negative score

* Add commentable noindex

* Give dummy score to podcast episodes
2021-01-11 16:17:52 -05:00
Ben Halpern
710a2c1a2e
Use SiteConfig twitter keys before env (#12200)
* Use SiteConfig twitter keys before env

* Add basic regression test
2021-01-11 12:01:37 -05:00
Andy Zhao
99a4d7c141
Use an updated version of adding trusted (#12186) 2021-01-11 11:34:45 -05:00
rhymes
202053cf96
Admin: Change label of toggle buttons in Configuration panel (#12183) 2021-01-11 16:38:16 +01:00
Michael Kohl
2e202b0399
Remove looking for work columns (#12173)
* Remove looking for work columns

* Fix schema.rb

* Undo accidental change

* Update spec
2021-01-11 11:22:39 +07:00
Josh Puetz
8c5b7bacb4
Show comment posting errors (#12184) 2021-01-08 14:29:01 -06:00
rhymes
e7f9735354
Remove RssReader (#12169)
* 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
2021-01-08 11:45:15 -05:00
Alex
a7376ad10d
Move Bufferizer to services (#12171)
* Create Bufferizer::MainTweet service

* Create Bufferizer::SatelliteTweet service

* Rename text to tweet

* Create Bufferizer::FacebookPost service

* Create Bufferizer::ListingsTweet service

* Remove old Bufferizer

* Update spec wording

* Update admin_id argument

* Use constants for size limits
2021-01-08 11:17:20 -05:00
Ridhwana
ebfe0ead2d
Add application deployment information to the admin page (#12149)
* WIP: release footprint in the admin UI

* feat: show the commit ID and the date

* chore: change env optional to empty string

* fix: change the FOREM_BUILD_DATE to RELEASE_FOOTPRINT

* feat: add Not Available as a last option

* test: last deployed time and latest commit id

* feat: update the way we change the env variable!

* fix: we need to set the RELEASE FOOTPRINT so that this clause is not hit - `return path if release_footprint.blank?`
2021-01-08 16:36:12 +02:00
Molly Struve
ccc5aa6d11
Feature:Add ability to add a Tag Resource Admin through Admin (#12172) 2021-01-08 06:51:14 -06:00
Michael Kohl
45cecc8592
Break StickyArticleCollection into services (#12147)
* Break StickyArticleCollection into services

* Add tests
2021-01-08 09:14:47 +07:00
Ridhwana
100990f7c6
Basic MVP version of data update script page (#12167)
* feat: add a basic table template with the basic info for the data scripts

* feat: add nav element to sidebar

* feat: add twemoji

* feat: success and failed icon

* feat: don't wrap the status title

* feat: make data update scripts accessible only be tech_admin

* chore: add the file name to the table

* test: write tests for the data_update_script_controller

* chore: remove icons and add status
2021-01-07 23:12:51 +02:00
Alex
ce4fe1aaf7
Move CodeBlockParse and MarkdownParser to service (#12112)
* Move remove_nested_linebreak_in_list to service

* Move prefex_all_images to service

* Major refactor :)

- Move MarkdownParser to /services
- Move CodeBlockParser to HtmlParser in /services
- Update specs

* Fix MarkdownParser

* Fix parser again

* Rename HtmlParser to Html::Parser

- Fix Rubocop violations :/
- Fix conflict

* Make html writer private

* Fix codeclimate

* Fix parser
2021-01-07 10:13:01 -05:00
Julianna Tetreault
c48e9a781d
Updates Recent Reactions + Reports buttons to match other buttons (#12153) [deploy] 2021-01-06 15:05:21 -07:00