Commit graph

8730 commits

Author SHA1 Message Date
Jacob Herrington
514b06afd4
Remove unused code (#13305) 2021-04-08 08:50:59 -05:00
rhymes
e00c1d7836
Small post Rails 6.1 fixes (#13290) 2021-04-08 07:58:24 -05:00
Nick Taylor
86deddbb75
Fixed Reading List on Mobile + Small Improvements (#12755)
* Some div soup to semantic markup.

* Small refactor to inline mapping of available tags.

* Renamed <ItemListTags /> component to <TagList />.

* Now a select is used for picking a tag to filter on.

* Added custom Cypress command to create an article.

* Added documentation for the create article custom command.

* Removed unnecesary properties from payload to create an article.

* reading list mobile view wip.

* Reworked styles in <TagList />.

* Reworked reading list to use <MediaQuery /> component.

* Removed bottom padding from reading list header.

* styling tweaks if there are no available tags.

* Added some E2E tests.

* Removed reading list component test in favour of e2e test.

* Made breakpoint values numbers.

* Added some padding and more grid gap to filter on small screens.

* Adjusted jest coverage thresholds as we're moving some tests to e2e tests.

* Reverting a VS Code setting change caused by one of my extensions.

* First pass for E2E tests for the reading list.

* Added some more grid gap.

* Fixed load next page to send tags properly.

* Added some more tests.

* Improved label and placeholder for text filter in reading list.

* Added more tests

* Fixed media queries so it works in Chrome as well.

* Removed aside as tag filters are not complimentary information.

* Update app/javascript/readingList/components/TagList.jsx

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update docs/tests/e2e-tests.md

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Turned off deprecated rule in jsx-a11y eslint plugin.

* Reverted to links instead of radio buttons.

* Added an all tags link and select option.

* Fixed relayout issue.

* Fixed View Archive button size.

* Fixed styling of the load more button.

* Fixed empty list issue toggling between archive and reading list.

* Fixed request changes from PR review.

* Removed CSS change that is no longer required.

* Trigger Build

* Fixed centering of items in top fieldset.

* Fixed issue with search text field resetting reading list.

* Fixed component tests for the reading list.

* Fixed empty state popping up between search queries.

* Fixed casing of fixture filenames.

* Update app/javascript/readingList/readingList.jsx

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Reverted change in reading list component test.

* Added missing JSDoc comment.

* Now links are in an unordered list.

* Promoted some CSS classes from the <nav /> to the <ul /> for spacing.

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-04-08 12:53:43 +01:00
dependabot[bot]
1522b6d41e
Bump chart.js from 2.9.4 to 3.0.2 (#13244)
* Bump chart.js from 2.9.4 to 3.0.2

Bumps [chart.js](https://github.com/chartjs/Chart.js) from 2.9.4 to 3.0.2.
- [Release notes](https://github.com/chartjs/Chart.js/releases)
- [Commits](https://github.com/chartjs/Chart.js/compare/v2.9.4...v3.0.2)

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

* fix issues in migration to 3x of chart.js

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-04-08 10:46:32 +02:00
dependabot[bot]
aa0423cf1b
Bump sidekiq from 6.2.0 to 6.2.1 (#13309)
Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.2.0 to 6.2.1.
- [Release notes](https://github.com/mperham/sidekiq/releases)
- [Changelog](https://github.com/mperham/sidekiq/blob/master/Changes.md)
- [Commits](https://github.com/mperham/sidekiq/compare/v6.2.0...v6.2.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-08 10:37:44 +02:00
dependabot[bot]
b5a7d8f812
Bump nokogiri from 1.11.2 to 1.11.3 (#13310)
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.2 to 1.11.3.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.2...v1.11.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-08 10:37:09 +02:00
dependabot[bot]
05a6bf855f
Bump omniauth from 2.0.3 to 2.0.4 (#13312)
Bumps [omniauth](https://github.com/omniauth/omniauth) from 2.0.3 to 2.0.4.
- [Release notes](https://github.com/omniauth/omniauth/releases)
- [Commits](https://github.com/omniauth/omniauth/compare/v2.0.3...v2.0.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-08 10:36:35 +02:00
dependabot[bot]
5d11a772ba
Bump @storybook/addon-a11y from 6.2.1 to 6.2.5 (#13291)
Bumps [@storybook/addon-a11y](https://github.com/storybookjs/storybook/tree/HEAD/addons/a11y) from 6.2.1 to 6.2.5.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.2.5/addons/a11y)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-08 10:34:36 +02:00
dependabot[bot]
4ebed8ac7a
Bump @storybook/addon-links from 6.2.1 to 6.2.5 (#13295)
Bumps [@storybook/addon-links](https://github.com/storybookjs/storybook/tree/HEAD/addons/links) from 6.2.1 to 6.2.5.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.2.5/addons/links)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-08 10:32:43 +02:00
Jacob Herrington
637b901e1d
Fix misleading title on svg tag (#13272) 2021-04-07 17:22:17 -05:00
Daniel Uber
68867e7c68
Ensure we have current user information before deciding how to handle the "flag user" button (#13279)
* Make test fail again

Minimal reproduction via `rspec
spec/system/user/trusted_user_flags_user_spec.rb --order=random
--seed=9374` which runs in this order:

- when signed in as a trusted user
- when not logged in
- when signed in as the non-trusted user
- when signed in as the user

Because "not logged in" immediately precedes "non-trusted user" in this
order, the browser store cache is cleared and there is no user. Since
there's no user, the flag is not removed.

* Wait for current user promise before processing current user

* Extract button callback registration to function

This addresses a code climate concern (function exceeded 50 lines) by
extracting the button behavior to a function of (button, id, name),
and calls that within the exported initFlag function.

* Prefer request to fetch

Addresses feedback to use @utilities/http's request method in  place
of fetch (which automatically adds the needed csrf headers)

* Reorder imports

Satisfies code climate report that imports are out of order

* Add honeybadger notify to error handling

Do more than just notify that something went wrong. Notify honeybadger
on failure to flag/unflag a user.

* Remove temp variable

This makes the notify code look more like the suggestion

* Reduce function arglist

Since the user id and name are properties of the flagButton's dataset,
we can efficiently extract them from the flagButton.

Only pull user id from dataset to check if current user = profile
user, and extract id and name from dataset after passing the
flagButton.

* reorder imports

Not sure how I managed to reverse this in 18aeb675b but here we go again

* Test button behavior

The original tests only asserted that the link to reactions was
present and labeled correctly. Add additional check that we can use
the button and that the label toggling occurs (this adds a request to
the test case, but adds a test for user facing behavior).

* Tame eslint check

I was getting conflicting feedback on import ordering from code
climate and eslint. Since telling eslint to ignore its rules was
immediately clear to me (there's an example on the line before this)
that's the direction I headed, but I can revisit if it matters

https://github.com/forem/forem/pull/13279#issuecomment-814411401
captures the conflict (code climate wants @utilities/http first,
eslint wants ../chat/util first, one or the other fails regardless of
the ordering.

* Use multiple rules in one ignore comment

https://eslint.org/docs/user-guide/configuring/rules#disabling-rules
supports multiple warnings separated by commas

* Remove stray comment

* Move documentation comment to the code it describes

* Replace invalid name

I had copied from the suggested code snippet the
userData.profileUserID name, but userData in this context is a global
function, and `profileUserId` (capitalization) is the bound variable
in this context.

Fix it before we throw an error trying to report an error (ironically,
before the window alert telling the user an error occurred, I think
this would have been visible only in console).

* Actually call the remove button function
2021-04-07 16:28:21 -05:00
Jamie Gaskins
afa3178b79
Fix rescue in EdgeCache::Bust (#13303)
We were trying to report an exception to Honeybadger but we never
actually captured the exception.
2021-04-07 15:31:30 -04:00
Mac Siri
a842247900
Fix link_formatter.rb's lints (#13301) 2021-04-07 14:28:58 -04:00
Jamie Gaskins
c2b7f0b096
Use 2-digit month and day for JS Date class (#13257)
Single-digit months and days are not compliant with the ECMAScript
standard for date strings.

See: https://262.ecma-international.org/11.0/#sec-date-time-string-format
2021-04-07 14:25:39 -04:00
Julianna Tetreault
d5637105c0
Remove superfluous app_url from nav links index (#13302) 2021-04-07 11:50:10 -06:00
Andy Zhao
7d9ce63e05
Add email type as utm_campaign column (#13297) 2021-04-07 12:54:51 -04:00
Jacob Herrington
f76a8e1e99
[15-minute fix] Don't allow markdown to use CSS classes (#13282)
* Don't allow markdown to use CSS classes

* Fix code highlighting

* Add spec for ignoring CSS classes

* Add comment
2021-04-07 11:40:39 -04:00
Andy Zhao
8204888bf0
[15-min-fix] Use safe navigation in case of nil email messages (#13294)
* Use safe navigation in case of nils

* Only safe navigate for utm_campaign
2021-04-07 10:13:02 -04:00
dependabot[bot]
5ab3b02de4
Bump doorkeeper from 5.5.0 to 5.5.1 (#13285)
Bumps [doorkeeper](https://github.com/doorkeeper-gem/doorkeeper) from 5.5.0 to 5.5.1.
- [Release notes](https://github.com/doorkeeper-gem/doorkeeper/releases)
- [Changelog](https://github.com/doorkeeper-gem/doorkeeper/blob/main/CHANGELOG.md)
- [Commits](https://github.com/doorkeeper-gem/doorkeeper/compare/v5.5.0...v5.5.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-07 08:55:31 -05:00
Vaidehi Joshi
97678456d6
[15 Min Fix]: Extract a post's followers out of service and onto Article model (#13229)
* Move authors followers out of Notifications::NotifiableAction::Send and into Article model

* Rename authors_followers to followers

* Update followers method in service, oops

* Update app/services/notifications/notifiable_action/send.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

Co-authored-by: Michael Kohl <citizen428@dev.to>
2021-04-07 06:46:32 -07:00
dependabot[bot]
48c5828404
Bump @storybook/addons from 6.2.4 to 6.2.5 (#13292)
Bumps [@storybook/addons](https://github.com/storybookjs/storybook/tree/HEAD/lib/addons) from 6.2.4 to 6.2.5.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.2.5/lib/addons)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-07 15:46:25 +02:00
Andrew Bone
6aae404c54
Update Analytics Dashboard time navigation to tabs (#13270)
* Move to crayons-tabs

* Update js logic to use crayon-tabs

* Remove toggle and add tab

The added code moved the tabs to the right hand side of the container (until mobile styles kick in then it will fill the container).
2021-04-07 14:11:15 +01:00
dependabot[bot]
6c749d1c9b
Bump @storybook/addon-actions from 6.2.1 to 6.2.4 (#13284)
Bumps [@storybook/addon-actions](https://github.com/storybookjs/storybook/tree/HEAD/addons/actions) from 6.2.1 to 6.2.4.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.2.4/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.2.4/addons/actions)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-07 12:20:06 +01:00
Julien Maury
36adcd740d
Remove some HTML errors (#13288)
* make clean_fork executable

* fix attribute className not in a JSX context

* delete useless role main on main tag

* delete useless role banner on header
2021-04-07 11:46:12 +01:00
Vaidehi Joshi
f8d5bbacf6
Prevent NoMethodError when Html variant is not present, take 2 (#13283)
Fixes https://app.honeybadger.io/projects/72638/faults/78746996.
2021-04-07 11:58:35 +02:00
Nick Taylor
b34db2360e
Fixed bug with iOS devices that crashed the post editor (#13281) 2021-04-07 05:52:17 -04:00
Jeferson S. Brito
14416f79cc
Fix Wikipedia liquid tag styles (#13154) 2021-04-07 10:33:20 +02:00
Mac Siri
aed41c3238
Fix Ruby 2.7 kwargs' warnings & misc spec warnings (#13256) 2021-04-06 16:57:59 -04:00
Josh Puetz
9c54b7c7b7
Re-add Darwin-20 to gemfile.lock (#13280) 2021-04-06 15:12:29 -05:00
Vaidehi Joshi
b2ded5b889
Prevent NoMethodError when Html variant is not present (#13276)
Fixes https://app.honeybadger.io/projects/72638/faults/78731893.
2021-04-06 11:06:46 -07:00
Daniel Uber
f3d168f2e9
Update Bundler version (#13278)
change second bundler environment variable to match the first
2021-04-06 12:44:53 -05:00
Alex
3891c7d468
✂️ Remove search from Connect (#13235)
* Remove search from connect

* Remove alternate approach

* Alphabetize CHAT_CHANNEL_PARAMS

* Remove default value for user_ids

* Add spec for result ordering
2021-04-06 13:03:31 -04:00
Daniel Uber
8929ebf74e
Run bundle, remove unneeded cached ahoy version (#13274) 2021-04-06 11:09:53 -05:00
Josh Puetz
f6dc638190
Upgrade to Ahoy 2.0.x (#13085)
* First set of changes for Ahoy 2.0

* Fix line length

* Change test

* Remove unused test

* Remove ahoy_messages.opened_at

* Simply digest email sending calculation to not rely on last_opened

* Remove outdated comment

* Fix typo in test

* Rework site config email digest to a single value

* Fix merge duplication

* Remove UTM references from ahoy emails

* Fix credits tests

* Remove UTM from expected email params
2021-04-06 10:12:32 -05:00
Jacob Herrington
a5b2d109d5
Rename banned and comment_banned roles (#12270)
* Rename banned and comment_banned roles

* Add data update script to rename roles containing 'ban'

* Add named error for Suspended users

* Update unidiomatic method names

* Rename misc banned to suspended

* Apply suggestions from code review

Co-authored-by: Michael Kohl <me@citizen428.net>

* Add unit tests for suspended methods

This commit also adds TODO comments for removing banned and
comment_banned from the codebase after data update scripts have
successfully run on all of our Forems.

Co-authored-by: Michael Kohl <me@citizen428.net>
2021-04-06 10:12:14 -05:00
rhymes
fa20539238
Adjust default Forem's RSS feed algorithm to allow non featured articles (#13247)
Since we've removed Buffer related algorithm, posts aren't automatically featured
anymore, leaving the RSS feed pretty empty. The default view should also include
those posts, above a minimum score, that are not featured.
2021-04-06 17:05:35 +02:00
rhymes
8b9a2b7c73
Enable Style/StringChars from Rubocop 1.12.0 (#13246) 2021-04-06 09:51:37 -05:00
dependabot[bot]
38e44f5178
Bump stripe from 5.30.0 to 5.32.1 (#13266)
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 5.30.0 to 5.32.1.
- [Release notes](https://github.com/stripe/stripe-ruby/releases)
- [Changelog](https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stripe/stripe-ruby/compare/v5.30.0...v5.32.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-06 16:12:23 +02:00
dependabot[bot]
79c1601979
Bump email_validator from 2.2.2 to 2.2.3 (#13267)
Bumps [email_validator](https://github.com/K-and-R/email_validator) from 2.2.2 to 2.2.3.
- [Release notes](https://github.com/K-and-R/email_validator/releases)
- [Changelog](https://github.com/K-and-R/email_validator/blob/master/CHANGELOG.md)
- [Commits](https://github.com/K-and-R/email_validator/compare/v2.2.2...v2.2.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-06 07:56:28 -06:00
Jacob Herrington
61ab4d36d4
Use ActiveModel::Errors#add to fix deprecation warning (#13262) 2021-04-06 08:16:57 -05:00
Jacob Herrington
2186210792
Fix deprecation warning (#13253)
Rendering actions with '.' in the name is deprecated
2021-04-06 08:16:42 -05:00
Suzanne Aitchison
aa22266e9d
[15 min fix] Allow resize hook to contrain max-height as well as min (#13269)
* allow resize hook to contrain max-height as well as min

* trigger checks
2021-04-06 12:11:03 +01:00
Michael Kohl
57545cc607
Change frame limit to match imgproxy (#13265) 2021-04-06 12:28:50 +02:00
Vaidehi Joshi
484c97fc8d
Limit mentions in posts (#13259)
* Limit mentions in articles

* Bump MAX_USER_MENTION_LIVE_AT to April 7th, 2021 UTC time

* Use stubbed constants in article and comment specs

* Add TODOs around extracting MAX_USER_MENTIONS into constant
2021-04-05 18:19:46 -07:00
Daniel Uber
ced62bcbc2
Update bundler from 2.1 to 2.2 (#13261)
We started seeing buildkite failures building after the rails 6.1
upgrade

While the bundler version probably isn't important by itself,
changing the containerfile invalidates any cached layers used to speed
up the build.
2021-04-05 19:54:12 -05:00
Mac Siri
77a3901998
Declare DD_VERSION in prerun.sh 2nd try (#13258) 2021-04-05 17:10:46 -04:00
Mac Siri
236a2ba64f
Downgrade dogstatsd-ruby to 4.8.3 (#13255) 2021-04-05 16:17:55 -04:00
Mac Siri
a0591379e5
Declare DD_VERSION in prerun.sh (#13251) 2021-04-05 15:51:08 -04:00
Jacob Herrington
0ecfec1a80
[15 minute fix] Fix word wrapping on mobile dashboard (#13218)
* Fix word wrapping on mobile dashboard

* Update app/assets/stylesheets/components/buttons.scss

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-04-05 14:46:06 -05:00
dependabot[bot]
e3ff582c99
Bump rubocop from 1.12.0 to 1.12.1 (#13245)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.12.0 to 1.12.1.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.12.0...v1.12.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-05 18:31:31 +02:00