Commit graph

10619 commits

Author SHA1 Message Date
Daniel Uber
c489971ecf
Allow admin control of auth broadcast messages (was: Don't suggest apple authentication) (#16069)
* Don't send auth broadcasts for providers that are in beta

Currently we have :apple as a restricted provider (you can enable it,
but it's treated as beta here, rather than generally available).

While we were correctly checking if you had all GA providers enabled
in authenticated_with_all_providers?, we were incorrectly pulling
all enabled provider names in find_auth_broadcast (the message to send
the user), and picking apple_connect.

Since it doesn't make sense to omit apple id login from consideration
when checking if all available auth methods are used, then recommend
that it be used consistently, capture this "GA" state as a method, and
use it both in the test "does this user have all available identity
providers enabled?" and the selection "which identity provider can I
suggest they setup?" consistently.

Since we're about to enable google as an auth source (in #15986) I'll
check with Josh if he expects this to be GA on release or in limited
beta.

* Clean up authenticated_with_all_providers?

We have a method identities that returns the enabled identities for
the user (a relation), and a method ga_providers that returns a list
of enabled and not beta provider symbols.

Change the set difference to use Array#all? (which will exit early on
the first failure). Efficiency note: while I think this reads
better,it's possible this issues a number of small (cheap) queries for
identity by user id and provider id, but there's a unique index on
(provider, user_id) that should be effective.

* Only check providers that have active broadcast messages

An admin can stop sending "connect using apple" follow ups by
disabling that broadcast.

I randomized the enabled/active broadcasts for connection options so
they're not always pulling the same (facebook? apple?) option every
time.

* Clean up lost thought in comment
2022-01-12 09:59:14 -06:00
Michael Kohl
f471ba9bd6
Don't load ActiveJob railtie (#16074) 2022-01-12 22:29:54 +07:00
Michael Kohl
92b1958181
Remove IE-specific setting (#16073) 2022-01-12 22:16:57 +07:00
Jeremy Friesen
0a1b222bb7
Moving the "Null" user object closer to User (#16070)
* Moving the "Null" user object closer to User

Prior to this commit, we had the presentation concept of a DELETED_USER
in the ApplicationHelper.  Further, we did type checks against that
object instead of relying attributes of the object.

With this commit, I moved the "Null" user closer to the User definition
to help highlight the concept that there might be deleted users.

I didn't remove all of the type checks, but did attempt to create a more
"duck-type" object.

Further, I moved away from an OpenStruct which in the past (and perhaps
present) had performance issues.

* Moving DeletedUser into Users module space
2022-01-12 08:45:01 -05:00
Ben Halpern
bd8b3b5ddc
Adjust in-feed-comment p margin for readability (#16068) 2022-01-12 07:46:04 -05:00
Michael Kohl
3a4fce3b88
Enable AR cache versioning (#16043) 2022-01-12 13:21:16 +07:00
Michael Kohl
3143febb4b
Enable safe Rails 6.1 defaults (#16045) 2022-01-12 10:12:51 +07:00
Daniel Uber
f20b8bd412
Prefer named comparison #after? to numeric comparison on times (#16057)
ActiveSupport adds DateAndTime::Calculations#after? (and before?) -
which clarifies intent (users newer than the relative time are
skipped) of the early returns.
2022-01-11 15:34:20 -06:00
Daniel Uber
6f2cf0e9fd
Add one day to the new users range (#16065)
The download app broadcast (in the Generator) returns early if the
user was created less than 7 days ago. It seems counterproductive to
filter out _only_ users created in the last 7 days.

Add one day to the query range, so users created less than 8 days ago,
but more than 7 days ago, receive the final message.
2022-01-11 15:33:33 -06:00
Daniel Uber
fadc84f47e
Add apple_connect welcome notification broadcast (#16063)
* Generator output

Add your logic here!

* replicate the logic from the forem connect migration

* Add data update script

This will generate the expected broadcast message to fix #16059

* Add apple connect to seeds file
2022-01-11 14:34:19 -06:00
Daniel Uber
6a9757c8ef
Modify welcome notification generator to handle errors per-message (#16060)
* Modify welcome notification generator to handle errors per-message

The original flow aborted all processing when any
ActiveRecord::RecordNotFound exception was raised. This causes a
situation where a missing broadcast message (by title) causes that
notification message to fail, and each day the same failure to
occur (since it wasn't successfully sent the day before), blocking all
further messages.

We want these to proceed on the schedule implicit in the checks, and
failing early prevents that.

Modify the error handling to catch RecordNotFound on each message, and
continue throught the checks until a notification is enqueued or all
checks have been attempted.

* Run welcome broadcast check 4 hours after the user was created

This started to fail when I modified the generator (why? because the
user was 7 days old and _other_ notifications would be sent).

Ensure the user is 4 hours old before checking that the disabled
welcome broadcast message is checked, and not sent.
2022-01-11 14:27:21 -06:00
Daniel Uber
1db02f355c
Simplify and label date calculation (#16052)
* Name the created after timestamp and remove temporary variables

The logic used to calculate the live at time, the week ago time, then
compare them to find the more recent value.

Move all of this logic to a method (there's a guard to exit if
the setting is nil, so this should be safe).

* Mark method private

This is not part of the public api (for workers, this should be
`#perform` alone). Mark it private
2022-01-11 14:09:11 -06:00
Arit Amana
7dc59eb4bf
Raise Error with Invalid UnifiedEmbed URL (#16051)
* raise error with invalid embed url

* fix spec; update docs
2022-01-11 14:55:06 -05:00
dependabot[bot]
1a10bfd70d
Bump bootsnap from 1.9.3 to 1.9.4 (#16058)
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.9.3 to 1.9.4.
- [Release notes](https://github.com/Shopify/bootsnap/releases)
- [Changelog](https://github.com/Shopify/bootsnap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.9.3...v1.9.4)

---
updated-dependencies:
- dependency-name: bootsnap
  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>
2022-01-11 11:53:06 -07:00
Ben Halpern
294b3471af
Proposing feed experiment 3: More comment count weight (#15993)
* Initial work

* Implement strategy injection into WeightedQueryStrategy

* Modify field_test config and adding variants

* Change orginal to constant and make some other adjustments

* Fix hardcoded test values
2022-01-11 11:05:06 -05:00
Nick Taylor
ed003d3ab4
Refactored client-side onboarding redirect logic. (#16026) 2022-01-11 07:04:06 -05:00
dependabot[bot]
70a5a6b4b9
Bump @storybook/preact from 6.4.9 to 6.4.10 (#16040)
Bumps [@storybook/preact](https://github.com/storybookjs/storybook/tree/HEAD/app/preact) from 6.4.9 to 6.4.10.
- [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.4.10/app/preact)

---
updated-dependencies:
- dependency-name: "@storybook/preact"
  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>
2022-01-11 10:06:01 +00:00
dependabot[bot]
c4b47e8b3d
Bump babel-jest from 27.4.5 to 27.4.6 (#16021)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-11 10:29:21 +07:00
dependabot[bot]
b3d89b608f
Bump lint-staged from 12.1.5 to 12.1.7 (#16038)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-11 10:16:54 +07:00
Michael Kohl
76a6466645
Use crayons_icon_tag for user and org views (#16014) 2022-01-11 10:10:21 +07:00
yheuhtozr
b120f3a241
app/controllers/api i18n (#16002) 2022-01-11 10:05:54 +07:00
yheuhtozr
d794e70cbc
small non-views ruby i18n (#16004) 2022-01-11 10:05:18 +07:00
dependabot[bot]
9412d864bb
Bump @storybook/manager-webpack5 from 6.4.9 to 6.4.10 (#16036)
Bumps [@storybook/manager-webpack5](https://github.com/storybookjs/storybook/tree/HEAD/lib/core) from 6.4.9 to 6.4.10.
- [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.4.10/lib/core)

---
updated-dependencies:
- dependency-name: "@storybook/manager-webpack5"
  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>
2022-01-10 15:15:15 -07:00
dependabot[bot]
4039227d59
Bump @storybook/addon-a11y from 6.4.9 to 6.4.10 (#16031)
Bumps [@storybook/addon-a11y](https://github.com/storybookjs/storybook/tree/HEAD/addons/a11y) from 6.4.9 to 6.4.10.
- [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.4.10/addons/a11y)

---
updated-dependencies:
- dependency-name: "@storybook/addon-a11y"
  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>
2022-01-10 14:43:19 -07:00
Daniel Uber
4180287e70
Migrate faker dependency to supported upstream (#16037)
* Move faker package to supported(?) upstream

* Import from new package
2022-01-10 15:00:48 -06:00
Jeremy Friesen
c5bf4bf880
Extracting duplicate logic (#16035)
Prior to this commit, we had two places that need to know the nuances
ofquerying for tag flares and what we should include in our queries for
serialization.

With this commit, we're factoring towards a common source of knowledge
and providing a much needed test for the expected output of this
serialization.

Loosely related to #15916, #15983, #15994, and #16032.
2022-01-10 15:19:04 -05:00
Julianna Tetreault
03d4c50dfc
Small grammatical updates to the config constants (#16034) 2022-01-10 13:06:56 -07:00
dependabot[bot]
baa87a9829
Bump @storybook/addon-storysource from 6.4.9 to 6.4.10 (#16029)
Bumps [@storybook/addon-storysource](https://github.com/storybookjs/storybook/tree/HEAD/addons/storysource) from 6.4.9 to 6.4.10.
- [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.4.10/addons/storysource)

---
updated-dependencies:
- dependency-name: "@storybook/addon-storysource"
  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>
2022-01-10 13:01:04 -07:00
dependabot[bot]
bbf584690c
Bump @storybook/addon-actions from 6.4.9 to 6.4.10 (#16030)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-10 14:56:17 -05:00
Jeremy Friesen
b8105661d0
Removing unused Search::ArticleSerializer (#16032)
Below are the grep results of searching for ArticleSerializer (note
there are no remaining `Search::ArticleSerializer' references).

Using `ripgrep` (e.g., `rg`), I have the following from the `main`
branch.

```log
> rg ArticleSerializer
app/services/search/reading_list.rb:
  Search::ReadingListArticleSerializer
app/services/search/article.rb:
  Homepage::ArticleSerializer
app/services/homepage/fetch_articles.rb:
  Homepage::ArticleSerializer
spec/serializers/search/reading_list_article_serializer_spec.rb:
  RSpec.describe Search::ReadingListArticleSerializer do
app/serializers/search/reading_list_article_serializer.rb:
  class ReadingListArticleSerializer < ApplicationSerializer
app/serializers/homepage/article_serializer.rb:
  class ArticleSerializer < ApplicationSerializer
```

Definitely want to keep pruning unused code.

This relates to exploration around #15916 and the attempted solutions in
2022-01-10 13:57:50 -05:00
Michael Kohl
6c26a8b40e
Update framework defaults (#15988)
* Update framework defaults to 6.0

* Update application.rb
2022-01-10 13:35:28 -05:00
dependabot[bot]
62864eae09
Bump sass from 1.45.2 to 1.47.0 (#16027)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-10 12:44:59 -05:00
Jeremy Friesen
f45e784e7f
Favor using existing variable over re-parsing (#15995)
While working on #15916 (via #15983 and later #15994) I was exploring if
we needed to stringify JSON values.  I also injected a few `try, catch,
debug` areas.

Consolidating the parsing does not appear to adversely affect things.
2022-01-10 12:33:31 -05:00
dependabot[bot]
623da55b5a
Bump @storybook/addon-links from 6.4.9 to 6.4.10 (#16016)
Bumps [@storybook/addon-links](https://github.com/storybookjs/storybook/tree/HEAD/addons/links) from 6.4.9 to 6.4.10.
- [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.4.10/addons/links)

---
updated-dependencies:
- dependency-name: "@storybook/addon-links"
  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>
2022-01-10 10:30:22 -07:00
Julianna Tetreault
0dfad5b07f
Remove Setup Banner (VerifySetupCompleted) (#15969)
* Remove all references to VerifySetupCompleted to remove setup banner

* Removes setup banner-related specs

* Adjusts the title in activateMissingKeysModal

* Adds the show expand classes to getStartedBodyContainer in show.html.erb
2022-01-10 10:30:05 -07:00
dependabot[bot]
d140e43061
Bump @rails/ujs from 6.1.4 to 7.0.1 (#16024)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-10 12:15:26 -05:00
dependabot[bot]
d9d12c9a90
Bump @storybook/addon-controls from 6.4.9 to 6.4.10 (#16020)
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.4.9 to 6.4.10.
- [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.4.10/addons/controls)

---
updated-dependencies:
- dependency-name: "@storybook/addon-controls"
  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>
2022-01-10 09:49:17 -07:00
dependabot[bot]
b4560a3848
Bump autoprefixer from 10.4.1 to 10.4.2 (#16023)
Bumps [autoprefixer](https://github.com/postcss/autoprefixer) from 10.4.1 to 10.4.2.
- [Release notes](https://github.com/postcss/autoprefixer/releases)
- [Changelog](https://github.com/postcss/autoprefixer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/autoprefixer/compare/10.4.1...10.4.2)

---
updated-dependencies:
- dependency-name: autoprefixer
  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>
2022-01-10 09:48:57 -07:00
Michael Kohl
6dae5323de
Copy .env_sample to .env in bin/setup (#16005) 2022-01-10 21:33:08 +07:00
dependabot[bot]
b831a90b01
Bump jest from 27.4.5 to 27.4.7 (#16022)
Bumps [jest](https://github.com/facebook/jest) from 27.4.5 to 27.4.7.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/compare/v27.4.5...v27.4.7)

---
updated-dependencies:
- dependency-name: jest
  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>
2022-01-10 07:30:26 -07:00
Ridhwana
3f582e88c2
Update the images section in preparation for Creator Setup and Onboarding Launch [Will deploy on 10/01] (#15989)
* feat: add a section id to the images section

* feat: update the images section

* chore: add some space

* chore: update the descriptiion text for logos
2022-01-10 16:10:57 +02:00
Ridhwana
81571bb0b5
Data Update Script to migrate logo_svg contents to png file (Will be merged and deployed on 10/01) (#15710)
* feat/WIP: first version of the svg logo to png logo DUS

* feat: logoSVG Uploader

* refactor: remove the if original_filename

* feat: add a test for the logo_svg_uploader

* feat: update the test and dus

* add soem error handling

* updae the rails spec helper

* feat: provide a content type

* feat: add content type

* Try https://travis-ci.community/t/build-times-out-with-no-apparent-reason/5083/4

* chore: try this suggestion https://stackoverflow.com/questions/41138404/how-to-install-newer-imagemagick-with-webp-support-in-travis-ci-container

* chore: remove libweb adn fix = in the travis.yml

* chore: undo the changes to attempt to update the version for image magick

* feat: install gsfonts for convert

* chore: add a comment for svg

* feat: use the good practices for tempfile, update error handling and update the tests

* chore: update the timestamp on the DUS

* feat: convert to png with a transparent background using Image Magick

* feat: substitute some css variables with real css colors

* chore: revert the path

* fix: set content type

* Update lib/data_update_scripts/20220105112823_migrate_logo_svg_data.rb

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

Co-authored-by: Jamie Gaskins <jamie@forem.com>
2022-01-10 16:09:34 +02:00
dependabot[bot]
bc86e319bb
Bump rubocop-rails from 2.13.0 to 2.13.1 (#16007)
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.13.0 to 2.13.1.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.13.0...v2.13.1)

---
updated-dependencies:
- dependency-name: rubocop-rails
  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>
2022-01-10 07:04:46 -07:00
dependabot[bot]
e4ab11b833
Bump @storybook/builder-webpack5 from 6.4.9 to 6.4.10 (#16011)
Bumps [@storybook/builder-webpack5](https://github.com/storybookjs/storybook/tree/HEAD/lib/core) from 6.4.9 to 6.4.10.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.4.10/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.10/lib/core)

---
updated-dependencies:
- dependency-name: "@storybook/builder-webpack5"
  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>
2022-01-10 06:57:36 -07:00
dependabot[bot]
151fc3a442
Bump webpack-dev-server from 3.11.2 to 3.11.3 (#16009)
Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 3.11.2 to 3.11.3.
- [Release notes](https://github.com/webpack/webpack-dev-server/releases)
- [Changelog](https://github.com/webpack/webpack-dev-server/blob/v3.11.3/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-server/compare/v3.11.2...v3.11.3)

---
updated-dependencies:
- dependency-name: webpack-dev-server
  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>
2022-01-10 06:57:07 -07:00
dependabot[bot]
1fc6124d97
Bump @storybook/addon-docs from 6.4.9 to 6.4.10 (#16008)
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.4.9 to 6.4.10.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.4.10/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.10/addons/docs)

---
updated-dependencies:
- dependency-name: "@storybook/addon-docs"
  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>
2022-01-10 06:56:21 -07:00
dependabot[bot]
34fa9d4557
Bump inline_svg from 1.7.2 to 1.8.0 (#16010)
Bumps [inline_svg](https://github.com/jamesmartin/inline_svg) from 1.7.2 to 1.8.0.
- [Release notes](https://github.com/jamesmartin/inline_svg/releases)
- [Changelog](https://github.com/jamesmartin/inline_svg/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jamesmartin/inline_svg/compare/v1.7.2...v1.8.0)

---
updated-dependencies:
- dependency-name: inline_svg
  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>
2022-01-10 06:55:26 -07:00
dependabot[bot]
fd6e8a8ff2
Bump prop-types from 15.8.0 to 15.8.1 (#16013) 2022-01-10 06:41:51 -05:00
Michael Kohl
1cf0b60690
Update dependabot config (#15987) 2022-01-10 11:35:48 +07:00
dependabot[bot]
dff1314b2d
Bump google-protobuf from 3.19.1 to 3.19.2 (#16000)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-10 10:31:34 +07:00