Commit graph

10094 commits

Author SHA1 Message Date
yheuhtozr
824397b93f
views/listings etc i18n (#15040)
* views/listings etc i18n

* helper labels

* remove ja.yml

* Update edit.html.erb

* Apply suggestions from code review

Co-authored-by: Michael Kohl <citizen428@forem.com>

* Update delete_confirm.html.erb

* Update edit.html.erb

* Update fr.yml

* Update edit.html.erb

Co-authored-by: Michael Kohl <citizen428@forem.com>
2021-10-27 16:37:29 +01:00
Mac Siri
3c204c236d
Update TagsController#index query (#15202)
* Update TagsController#index query

to include empty string

* Update spec
2021-10-27 08:17:53 -04:00
yheuhtozr
c5a5c9c382
views/feedback_messages i18n (#15038)
* views/feedback_messages i18n

* PR name change

* remove ja.yml
2021-10-27 12:34:56 +01:00
Jeremy Friesen
ed78f8f479
Extracting a common calculator for feed weights (#15199)
Prior to this commit, there existed duplicate logic between two of the
primary user feeds.  This refactor introduces a new object which is
solely concerned with calculating scores to add to an article base score.

With this commit, we can introduce A/B testing by changing passing
different config values to `ArticleScoreCalculatorForUser.new`.

My suspicion is that for some of this, we might be able to better
leverage the database via select statements and SQL sums.  However, that
is presently outside of what I'm prepared to tackle.
2021-10-27 04:45:53 -04:00
Thomas Bnt
4ec93a4b5f
Edit tweet intent URL (#15206) 2021-10-27 09:14:32 +01:00
Daniel Uber
10832a426f
Cleanup single reaction template (#15207)
* Cleanup single reaction template

extract the title: link_to() target conditional outside the call to
translate

add missing closing paren for t()

remove comment (probably could stay if it's useful - explains why we
have a conditional at all)

* Fix indentation and ensure link has correct class

* Fix indentation and ensure links have a path

* Remove class from translate template

This was left from shuffling arguments to function calls
2021-10-26 16:35:12 -05:00
Ben Halpern
2395693809
Asynchronously detect image aspect ratios and apply proper attributes (#15170)
* Initial work to expand detection functionality

* Finish up functionality and tests

* Fix class name

* Fix tests

* Update spec/services/articles/enrich_image_attributes_spec.rb

Co-authored-by: Michael Kohl <citizen428@forem.com>

* Update spec/services/articles/enrich_image_attributes_spec.rb

Co-authored-by: Michael Kohl <citizen428@forem.com>
2021-10-26 13:39:25 -07:00
dependabot[bot]
a59bde6186
Bump counter_culture from 2.9.0 to 3.0.0 (#15204)
Bumps [counter_culture](https://github.com/magnusvk/counter_culture) from 2.9.0 to 3.0.0.
- [Release notes](https://github.com/magnusvk/counter_culture/releases)
- [Changelog](https://github.com/magnusvk/counter_culture/blob/master/CHANGELOG.md)
- [Commits](https://github.com/magnusvk/counter_culture/compare/v2.9.0...v3.0.0)

---
updated-dependencies:
- dependency-name: counter_culture
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-26 14:44:45 -04:00
Daniel Uber
39a230ffcb
Add reaction to articles when seeding the database (#15193)
* Add one reaction to each article when seeding the database

* Add reaction to article when created

and sync reactions count.

There's still a gap where the redis-cached reaction count could be
present but not cleared during seeder runs (redis is disconnected for
caching and rails cache is set to the null store). Since we are able
to enqueue sidekiq jobs redis is live - but it's a bad idea to use
sidekiq's connection to flush keys in redis.

* Make the reaction count update script a no-op

* Remove unused data update script and limit user id queries

Pull all user ids into an array before you start creating articles,
and sample from the array rather than repeatedly asking for the first
user from a random ordered db result.

* fail if we can't create reaction

thanks @jgaskins

Co-authored-by: Jamie Gaskins <jamie@forem.com>

* Revert "fail if we can't create reaction"

This reverts commit c35f6d47d2e8956a240133b9e6ad0d144f1b4722.

There is a uniqueness constraint on (user, reactable, category) that
could be triggered when seeding due to random selection. It's better
to skip creation when a validation error occurs than to break the seed
completely.

There are expected to be 0-9 reactions per article, we don't require a
set number on each article, and likely won't notice any specific
problem if the random number is one lower than it would have been
because some reactions were skipped due to uniqueness violations.

Co-authored-by: Jamie Gaskins <jamie@forem.com>
2021-10-26 10:56:14 -05:00
dependabot[bot]
0dbf7d0832
Bump eslint-config-preact from 1.1.4 to 1.2.0 (#15185)
Bumps [eslint-config-preact](https://github.com/preactjs/eslint-config-preact) from 1.1.4 to 1.2.0.
- [Release notes](https://github.com/preactjs/eslint-config-preact/releases)
- [Commits](https://github.com/preactjs/eslint-config-preact/compare/v1.1.4...1.2.0)

---
updated-dependencies:
- dependency-name: eslint-config-preact
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-26 09:52:23 -06:00
Jeremy Friesen
7989226d3f
Jeremyf/refactor order of operations (#15192)
* Adding guard clause for nill org feed score

There's no sense running a query if we don't have an organization.  This
is a small refactor that might offer a most nominal speed bump

* Caching calculated value

Prior to this commit, we calculated the user_experience_level once per
article in the feed.

This change adds a cache, creating a minor computational improvement.
2021-10-26 10:18:52 -04:00
Jeremy Friesen
fbce226c08
Low Stakes Refactor of Feed class (#15180)
* Removing state change and unused method

Prior to this commit, the `@comment_weight` value would change.  This is
not ideal as depending on the call sequence, can notably change the
output.  I suspect this state change occurred so as to not alter an
underlying spec.

What this change does is remove the state change, removes a dead method,
renames a method (to the dead method name), and leverages
parameterization to better test a spec that was brittle based on
possible state changes.

I believe, from a logical stand point, that this change does not impact
the functionality nor the actual logic that is part of the production
call path.

* Marking methods as @api private

The goal is to highlight that we really shouldn't be calling these
outside of their contained class.  Ideally, I'd love to make them
private methods, but there are specs and would prefer to not use
`__send__` to change those specs.

This is a noop change.

* Renaming method to refelct returned param order

Prior to this commit the "default_home_feed_and_featured_story" returned
an array of `[featured_story, default_home_feed]`.  The method name and
the order of the returned values were misaligned.  This change helps
align the method name and the order of those returned values.

Note, methods such as `each_with_index` have an `element, index`
parameter order.
2021-10-26 09:57:33 -04:00
Andy Zhao
06b97cf291
Add back reaction translations (#15194) 2021-10-25 18:15:05 -04:00
dependabot[bot]
3f3358519e
Bump lint-staged from 11.2.3 to 11.2.4 (#15188)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 11.2.3 to 11.2.4.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v11.2.3...v11.2.4)

---
updated-dependencies:
- dependency-name: lint-staged
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-25 16:58:58 -04:00
ludwiczakpawel
88a3b573ea
Page headers unified (#15158)
* fix; remove the bottom 100%

* dashboard

* fixes + magic border-radius

* everything

* fix

* fix

* spec

* split PRs

* Update app/assets/stylesheets/views/listings.scss

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2021-10-25 21:41:29 +02:00
Andy Zhao
864fd9e072
Use proper Node version for Storybook (#15182)
* Try using Netlify pre-built yarn

* Add env vars to maybe trigger Yarn

* shrug

* Try using npm to build storybook

* Add  npm install

* Update node version and use original command

* Update yarn version

* idk :(

* Try pulling versions from files instead of hardcoding

* Possibly in root already?

* never mind dynamic var usage is not supported

* yarn version prob unused b/c we technically use npm
2021-10-25 15:29:03 -04:00
dependabot[bot]
6076dc8b9b
Bump omniauth-facebook from 8.0.0 to 9.0.0 (#15186)
Bumps [omniauth-facebook](https://github.com/simi/omniauth-facebook) from 8.0.0 to 9.0.0.
- [Release notes](https://github.com/simi/omniauth-facebook/releases)
- [Changelog](https://github.com/simi/omniauth-facebook/blob/master/CHANGELOG.md)
- [Commits](https://github.com/simi/omniauth-facebook/compare/v8.0.0...v9.0.0)

---
updated-dependencies:
- dependency-name: omniauth-facebook
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-25 13:05:12 -06:00
dependabot[bot]
add1b9e4db
Bump postcss from 8.3.9 to 8.3.11 (#15189)
Bumps [postcss](https://github.com/postcss/postcss) from 8.3.9 to 8.3.11.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.3.9...8.3.11)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-25 14:47:06 -04:00
dependabot[bot]
bfc8cd6eec
Bump core-js from 3.18.3 to 3.19.0 (#15187)
Bumps [core-js](https://github.com/zloirock/core-js) from 3.18.3 to 3.19.0.
- [Release notes](https://github.com/zloirock/core-js/releases)
- [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zloirock/core-js/compare/v3.18.3...v3.19.0)

---
updated-dependencies:
- dependency-name: core-js
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-25 14:46:31 -04:00
dependabot[bot]
b46c0f0f79
Bump rubocop from 1.22.1 to 1.22.2 (#15164)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.22.1 to 1.22.2.
- [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.22.1...v1.22.2)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-25 12:39:40 -06:00
dependabot[bot]
4756a19a8b
Bump view_component from 2.40.0 to 2.41.0 (#15163)
Bumps [view_component](https://github.com/github/view_component) from 2.40.0 to 2.41.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.40.0...v2.41.0)

---
updated-dependencies:
- dependency-name: view_component
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-25 12:38:50 -06:00
dependabot[bot]
cac9a4567e
Bump capybara from 3.35.3 to 3.36.0 (#15191)
Bumps [capybara](https://github.com/teamcapybara/capybara) from 3.35.3 to 3.36.0.
- [Release notes](https://github.com/teamcapybara/capybara/releases)
- [Changelog](https://github.com/teamcapybara/capybara/blob/master/History.md)
- [Commits](https://github.com/teamcapybara/capybara/compare/3.35.3...3.36.0)

---
updated-dependencies:
- dependency-name: capybara
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-25 12:35:34 -06:00
yheuhtozr
ffd8c9ed1b
actions and reactions i18n (#15058)
* actions and reactions i18n

* remove ja.yml

* Update en.yml

* Update fr.yml

* Update _actions.html.erb
2021-10-25 12:35:05 -06:00
dependabot[bot]
68504659d4
Bump honeycomb-beeline from 2.7.0 to 2.7.1 (#15190)
Bumps [honeycomb-beeline](https://github.com/honeycombio/beeline-ruby) from 2.7.0 to 2.7.1.
- [Release notes](https://github.com/honeycombio/beeline-ruby/releases)
- [Changelog](https://github.com/honeycombio/beeline-ruby/blob/main/CHANGELOG.md)
- [Commits](https://github.com/honeycombio/beeline-ruby/compare/v2.7.0...v2.7.1)

---
updated-dependencies:
- dependency-name: honeycomb-beeline
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-25 14:34:28 -04:00
Ikko Ashimine
dbf3cf75fa
Fix typo in create_from_controller_params.rb (#15171)
interation -> interaction
2021-10-25 10:42:40 -07:00
yheuhtozr
6a3a91d9b7
views/podcasts, views/podcast_episodes i18n (#15020)
* views/podcasts, views/podcast_episodes i18n

* reformat for PR

* helper labels

* PR sync with main

* remove ja.yml

* Update en.yml

* Update fr.yml

* Update _meta.html.erb

* Update podcast_episodes_index_spec.rb

* Update podcast_create_spec.rb

* Update user_visits_podcast_episode_spec.rb

* Update en.yml

* Update feed.rb

* Update index.html.erb
2021-10-25 14:32:51 +01:00
ludwiczakpawel
719b87e2ae
Auto border-radius (#15165) 2021-10-25 14:41:13 +02:00
ludwiczakpawel
656cfcd655
Tag edit (#15173)
* tag edit

* more

* chop chop

* spec

* Apply suggestions from code review

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

* french translation

* Fix I18n usage

* Apply suggestions from code review

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

* lang

Co-authored-by: Michael Kohl <me@citizen428.net>
Co-authored-by: Michael Kohl <citizen428@forem.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-10-25 12:50:00 +02:00
yheuhtozr
cdedbc1588
views/notifications i18n (#15056)
* views/notifications etc i18n

* notifications PR fixes

* remove ja.yml

* Update en.yml

* Update fr.yml

* Update en.yml

* Update fr.yml

* Update _comment.html.erb

* Update _comment.html.erb

* Update notifications_helper.rb

* Update notifications_helper.rb

* Update notifications_helper.rb

* Update notifications_helper.rb

Co-authored-by: Michael Kohl <citizen428@forem.com>
2021-10-25 15:46:46 +07:00
Lewis Sparlin
e621659279
Add Article post_commit when user_id changes with specs (#15132)
* Add Article post_commit when user_id changes with specs

* Add example in requests/admin/articles_spec for updating user
2021-10-25 10:53:21 +07:00
ludwiczakpawel
1c03584acf
missing padding (#15168) 2021-10-22 22:35:05 +02:00
Jamie Gaskins
10e3fc2af6
Remove whitespace in element attributes (#15166)
For most of these this isn't a big deal because `class` is delimited
by whitespace, but it changes the meaning of the `id` attribute since it
must be an exact match (including whitespace). There is also a data-*
attribute or two in here that may have had their semantics changed.
2021-10-22 15:08:17 -04:00
rhymes
cde6f04cc7
Remove rhymes from the Core Team (#15167)
😭
2021-10-22 20:51:40 +02:00
Jamie Gaskins
405f6a1f91
Fix "Unpublish Article" button (#15162)
The malformed link ended up messing up HTML further down the page,
hiding the "Unpublish Article" button because the browser didn't parse
it as a separate element.
2021-10-22 12:09:06 -05:00
Nick Taylor
2b135ab8e3
Small change to make the tools section of member details mobile friendly. (#15159) 2021-10-22 18:47:20 +02:00
Mac Siri
68821176d5
Parallelize cypress specs (#15142)
* Use forked cypress-rails

* Add @KnapsackPro/knapsack-pro-cypress

* Update .travis.yml

* Fix syntax error

* Add KNAPSACK_PRO_TEST_FILE_EXCLUDE_PATTERN

* Update to use KNAPSACK_PRO_TEST_FILE_PATTERN

* Update .travis.yml

* Upgrade custom cypress-rails

* Update custom cypress-rails gem again

* Update .travis.yml

* Create bin/knapsack_pro_cypress

* Add another e2e node
2021-10-22 12:41:56 -04:00
Jeremy Friesen
24929ba20d
Naming "magic numbers" to help clarify (#15161)
As part of my reading and seeking to understand the
`Articles::Feed::LargeForemExperimental` class, I figured I would come
in and add parameters.  In adding parameters, one thought I had was that
we can more readily create a data structure that allows us to tweak the
various implicit values.

This is a first step to help me understand and name the numbers.
2021-10-22 12:37:11 -04:00
Mac Siri
e55d5a85fe
Use custom fork of cypress_rails gem (#15157)
* Use custom fork of cypress_rails

* Change fork repo
2021-10-22 11:40:38 -04:00
Ridhwana
cb6babc595
Fix Tooltips (#15156)
* fix; remove the bottom 100%

* refactor: make the tooltip appear at the top + no pointer-events
2021-10-22 07:49:15 -07:00
ludwiczakpawel
d1aac57053
Podcasts fixes (#15130) 2021-10-22 11:06:11 +02:00
Nick Taylor
bf2d673492
Created the Forem creator confirmation email template (#14659)
Co-authored-by: Michael Kohl <citizen428@forem.com>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2021-10-21 14:56:09 -04:00
Daniel Uber
c10d582e2a
Ensure shown vomit reactions have reactable (#15153)
This is the counter-argument to #15152 - filter in the controller
rather than adding lots of conditional logic to the view to handle the
case where there was a vomit reaction left for a deleted user causing
the moderation reports page to fail to load.
2021-10-21 11:34:06 -05:00
Julianna Tetreault
a69a97b023
✂️✂️ Remove Extra Space From en.yml and fr.yml Files ✂️✂️ (#15149)
* Removes extra space from views/manager/fr.yml and en.yml

* Removes further spaces from views/manager/fr.yml and en.yml
2021-10-21 08:28:26 -06:00
dependabot[bot]
cb3c862f45
Bump webdrivers from 4.7.0 to 5.0.0 (#15145)
Bumps [webdrivers](https://github.com/titusfortner/webdrivers) from 4.7.0 to 5.0.0.
- [Release notes](https://github.com/titusfortner/webdrivers/releases)
- [Changelog](https://github.com/titusfortner/webdrivers/blob/main/CHANGELOG.md)
- [Commits](https://github.com/titusfortner/webdrivers/compare/v4.7.0...v5.0.0)

---
updated-dependencies:
- dependency-name: webdrivers
  dependency-type: direct:development
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-21 07:06:13 -06:00
rhymes
0dd11b3da5
Replace spread syntax with Object.assign in untranspiled JS file (#15148) 2021-10-21 14:01:05 +02:00
Ridhwana
085a506205
Navigation Links Validation (#15139)
* feat: add a required attribute for the fields on Navigation Links that are required

* remove the weird margin

* we want the field to be required only when we  don't have a vallue from form.object[:icon] that is in the craete view
2021-10-21 12:43:05 +02:00
yheuhtozr
e826fabf18
views/liquids i18n (#15060)
* views/liquids i18n

* PR key name changes

* remove ja.yml
2021-10-21 12:25:30 +07:00
yheuhtozr
7eea2b6a22
article editor and manager i18n (#15070)
* article editor, manager i18n

* PR key name changes

* remove ja.yml
2021-10-21 08:18:48 +07:00
Arit Amana
55a6bc3644
Allow users to choose their default Home and Tags-View Feed (Part 1) (#15128)
* add new column & define enums

* add new column & define enums

* add tests; improve enum naming

* complete specs update 😅

* discard changes to schema.rb

* rename column name more appropriately

* update specs

* update specs properly 🤦🏾‍♀️

* Please Travis do the thing

* Add DB schema diff

Co-authored-by: Jamie Gaskins <jgaskins@hey.com>
2021-10-20 18:02:59 -04:00
Daniel Uber
f5a65c5f0c
Update i18n read_path to match our current localization file layout (#15140)
* Update read path to match our current file layout

The files specified under "more files" were expecting to be
named *.{locale}.yml, like misc.en.yml or tags.fr.yml. However, our
project layout is using a directory prefix like misc/en.yml or
tags/fr.yml.

Consequently, the locale files for views were not being tested (a
previous update ensured that they were being loaded).

Change the load pattern to match the files we use in the app, and
ensure they're tested.

This introduces test failures which will be addressed in the next commit.

* Add back the original pattern

This matches files like devise.en.yml and other existing files in
config/locales (not already in a subdirectory).

* Update inconsistent interpolation

The english version had `{community}` while the french version had
`{name}` for the videos.heading key, checking the call site at
https://github.com/forem/forem/blob/main/app/views/videos/index.html.erb#L26
we have `community:`, passed for interpolation to the translate call,
so change the french translations to include that, rather than name

* Update missing pluralization for badges

* make travis happy
2021-10-20 12:50:22 -05:00