Commit graph

10359 commits

Author SHA1 Message Date
Josh Soref
0403e78f08
Spelling (#15702)
* spelling: access

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: additional

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: administrative

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: aggregate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: assigns

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: attributes

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: autocomplete

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: because

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: between

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: bootstrap

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: calculating

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: captcha

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: character

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: chosen

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: commenter

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: competitor

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: componentize

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: contrast

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: corresponding

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: description

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: destroyed

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: destroys

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: discussion

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: episode

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: escaped

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: evaluates

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: expired

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: explicitly

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: facebook

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: fragment

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: functionality

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: improper

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: incentive

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: interfere

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: latest

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: message

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: minimum

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: moderator

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: mouseover

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: mutual

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: nonexistent

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: notification

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: occasionally

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: occurrence

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: occurs

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: octokit

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: offset

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: omitted

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: opacity

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: organization

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: organizations

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: overridden

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: override

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: overriding

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: prefill

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: previous

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: profile

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: recycling

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: registered

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: repositories

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: rescuing

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: response

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: returns

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: second

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: separator

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: services

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: subscriber

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: subscription

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: success

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: successful

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: successfully

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: suppress

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: test

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: thought

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: uniqueness

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unknown

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unproductive

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unreachable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unsuccessful

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: utilities

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: utility

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: valid

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: voluntarily

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: vomited

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: website

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: withholding

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2021-12-07 06:59:10 -07:00
Julianna Tetreault
00324c38e6
Pulls Creator Onboarding Redirect Links Into a Creator Onboarding-Specific Function (#15654)
* Pulls Creator Onboarding redirect links out into own function

* Adds all pathnames to redirectableCreatorOnbboardingLocation()

* Uses Array.proptypes.includes() in onboardingRedirectCheck.jsx

* Adds back removed pathname from redirectableLocation

* Refactor redirectableCreatorOnboardingLocation()

* Adds back code changes that were reverted at some point :/
2021-12-07 06:47:42 -07:00
Nick Taylor
8c1b1f1982
Creator Settings: Fixed the resizing of the preview logo (#15688) 2021-12-07 07:04:07 -05:00
Jeremy Friesen
b71865fc42
Extracting cross-model uniqueness validator (#15640)
* Extracting cross-model uniqueness validator

Prior to this commit, we had somewhat duplicated logic across four
models.  In adding this validator we're consolidating the logic and
tidying up each of the other models; letting the validator know which
models are part of the "uniqueness gang."

* Adding conditional test for validator

* Bump for travis

* Apply suggestions from code review

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

Co-authored-by: Michael Kohl <citizen428@forem.com>
2021-12-06 17:07:47 -05:00
Daniel Uber
b516f7cb5a
Specify a single base image for builder and production (#15678)
This prevents missing the second FROM ruby: line for production (I
think I've tripped over this twice now).
2021-12-06 11:27:12 -06:00
Jeremy Friesen
393d678718
Moving engine mount points to admin (#15667)
These are administrative engines, and should be mounted within the
`/admin` path.
2021-12-06 05:50:11 -05:00
Josh Soref
5324eb1477
Spelling fixes to live code (#15670)
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2021-12-06 12:11:25 +02:00
dependabot[bot]
558dd157be
Bump view_component from 2.45.0 to 2.46.0 (#15677)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-06 10:44:41 +07:00
Daniel Uber
e20820794b
Disable failing test cases (#15680)
I think this is related to some requests triggering the weighted query
field test (which changes the rules for the home feed in a way that
may include these campaign tags and handles relevancy differently from
the scoring).

It's reasonable to revisit these. Either the entire context should
include an assertion that all field tests return the original
strategy, never weighted, or we should determine their importance if
we expect the weighted query strategy to be universally deployed (or
widely deployed).
2021-12-03 20:52:49 -05:00
Daniel Uber
19a2b05770
Use the tag_list method, rather than the cached_tag_list attribute (#15638)
* Use the tag_list method, rather than the cached_tag_list attribute

This is a follow on to #15456 and #15637

Saving the article in #15637 was a work-around to force the article to
have a valid cached tag list. However, we can rely on the tag_list
method to find the associated tags.

Update the worker to use tag_list (rather than the decorator's
cached_tag_list.array) and flatten the tag list rather than flat
mapping String#split over the non-nil cached_tag_lists.

* Remove unused join on tags

The query logging showed each article's tags were loaded twice in a
row (select by id, immediately followed by select by id). Removing the
join removed this behavior. I suspect mapping `#tag_list` over
articles is ignoring the loaded tags.

Performance (in my local environment) improved about 30% when this join was removed.
2021-12-03 14:47:42 -06:00
Daniel Uber
0eb4e690ed
Validate payment info present before attempting to process (#15629)
* Add two guards when purchasing credits

This prevents sending an empty card to stripe, and avoids a
foreseeable error when purchasing 0 credits. Error returned from
stripe is "This value must be greater than or equal to 1".

* Move redirect back into action method

Only use validation methods to check input and set appropriate messages.

* Accept organization id if set

The payment service will use the organization id (and charge the
organization) when that's the purchaser. Don't fail when no stripe
token or card selected if an organization admin is purchasing credits.

* Move validation into the payment processing service

This cleans up the number of details the controller needs to worry
about

Now only if the process payment service had any tests...

* Prevent only organization_id from permitting purchase

and move this check to a method, with an intention revealing name

* Add i18n translation for error message

There weren't any service side error messages - this will be displayed
in a view (credits/purchase) but comes from the payment service -
other messages (from stripe) are passed through as-is there.

If this is the wrong _place_ for the translation I can retool.

* Add unit test for payment processing

Only checking errors are raised as expected and the internal error
message is translated.

* Leave translation alone

Revert test translation
2021-12-03 13:09:23 -06:00
Jamie Gaskins
251e870766
Don't write a \n at the end of the release version (#15659)
We also didn't need to shell out to the `echo` command for this. I don't
know why I did that.
2021-12-03 13:08:27 -05:00
Nick Taylor
6d79fc94a9
Creator Settings: Removed SVG files as an option for logo upload (#15662) 2021-12-03 10:47:42 -05:00
Jeremy Friesen
8c126ca2e0
Fixing blank home page for anonymous/visitor (#15665)
Prior to this fix, in the production rails console we ran the following:

```ruby
Articles::Feeds::WeightedQueryStrategy
  .new(user: nil, page: 1, tags: nil)
  .featured_story_and_default_home_feed(user_signed_in: false)
```

The result was: `[nil, []]`.  Which in the
[StoriesController#assign_feed_stories][1] is where we have the
following:

```ruby
@featured_story, @stories = feed
  .featured_story_and_default_home_feed(
    user_signed_in: user_signed_in?)
```

In Blazer, I ran the following query at 2021-12-02 Thu 20:41 EST:

```sql
SELECT * FROM articles
WHERE featured = true
AND published = true
AND published_at > (NOW() - interval '7 days')
AND published_at < NOW()
AND main_image IS NOT NULL
```

So the logic of filtering with `only_featured` resulted in the
`@featured_story` being `nil`.  Which then cascaded into the logic for
determining the remainder of the results.

For further discussion see the inline comments and specs that I wrote.

In addition to the above, I'm also reusing
`Articles::Feeds::FindFeaturedStory`

Prior to this commit, the `Articles::Feeds::WeightedQueryStrategy` first
grabbed the featured story, then grabbed the remaining articles.  This
is different than the implementation of the
`Articles::Feeds::LargeForemExperimental` in which we first grab all the
articles then claim one as the featured.

In the WeightedQueryStrategy, the articles would not include the
featured.  However, in the LargeForemExperimental it would.  This
results in upstream logic in [app/javascript/articles/Feed.jsx][2]
going through and removing one of the articles.

[1]:c1a3ba99eb/app/controllers/stories_controller.rb (L237-L271)
[2]:c1a3ba99eb/app/javascript/articles/Feed.jsx (L57-L63)
2021-12-03 08:32:02 -05:00
Julianna Tetreault
a5a1f16c70
Replaces hardcoded URL with app_url path helper in terms (#15661) 2021-12-03 06:01:39 -07:00
Daniel Uber
c1a3ba99eb
Save article (to cache tags) before updating follow points (#15637)
Fixes a failure where the follow did not calculate implicit
points correctly.

The underlying issue was that the factory created `article` did not have
a cached_tags value containing `tag.name`
saved (`article.tags.pluck(:name)` was correct, but the cached_tags
was not). This happens automatically when saving an article from the
post editor, and any time we subsequently modify an article.

Supersedes #15456
2021-12-02 14:41:27 -06:00
yheuhtozr
39b84f471d
fix missing i18n strings & keys in views/comments (#15657) 2021-12-02 14:24:57 -06:00
Fernando Valverde
6b5d511ea0
Update Android PN integration fixes (#15541)
* Add missing android payload attributes

* Fix click_action in Android PN payload

* Native bridge fixes to interact with PN + Podcast + Video features
2021-12-02 13:56:28 -06:00
dependabot[bot]
105086f976
Bump sidekiq-unique-jobs from 7.1.11 to 7.1.12 (#15656)
Bumps [sidekiq-unique-jobs](https://mhenrixon.github.io/sidekiq-unique-jobs) from 7.1.11 to 7.1.12.

---
updated-dependencies:
- dependency-name: sidekiq-unique-jobs
  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-12-02 11:25:46 -07:00
yheuhtozr
a1e8f29fe6
user settings i18n (#15098)
Co-authored-by: Nick Taylor <nick@dev.to>
2021-12-02 11:35:08 -05:00
ludwiczakpawel
03f97d4625
pullToRefresh adjustments - fixing scrolling hijacking (#15644)
* increase scorllable area

* fix

* fix

* ..

* adjustments

* revert previous wannabe fixes

* revert previous wannabe fixes

* revert previous wannabe fixes
2021-12-02 17:00:02 +01:00
Julianna Tetreault
59765b7ba6
Ensure COC and TOS Links Open on the Creator Settings Form (#15634)
* Opens COC and TOS links in new window, w/o redirects

* Removes superfluous > from the Creator Settings _form
2021-12-02 08:10:08 -07:00
Josh Puetz
4e980b72ff
Remove beta tag from mobile notification settings (#15636) 2021-12-02 08:52:46 -06:00
Jeremy Friesen
6787ee0f26
Refactoring to use StringAttributeCleaner (#15641)
* Refactoring to use StringAttributeCleaner

In #15281, we introduced the StringAttributeCleaner.  Let's use it!

* Adding StringAttributeCleaner for User properties

* Parameterizing callback for attribute cleaning

* Reading and applying the example for attribute cleaner
2021-12-02 08:55:27 -05:00
Jeremy Friesen
c1e5d4884d
Deprecating User#trusted in favor of User#trusted? (#15639)
`User#trusted?` is more Ruby idiomatic than `User#trusted`.  This helps
align the various "User#question?" methods.

I've added a deprecation warning, but don't believe that this is active
in the code-base.
2021-12-02 08:54:58 -05:00
Suzanne Aitchison
6a7b9361db
announce image upload success via aria live (#15650) 2021-12-02 12:46:33 +00:00
Ridhwana
842e18a0fc
chore: remove max-height (#15647) 2021-12-02 11:38:20 +02:00
Ridhwana
19bc43360b
logo (#15643) 2021-12-02 10:11:30 +02:00
Nick Taylor
3f2569b938
Forem Creation: Logo Upload & Resizing (#15499)
* wip - Got logo upload working

* Now have the logo rendering in the header and in the admin image config section.

* Small layout tweak for admin -> config -> images -> logo.

* feat: create a logo uploader with some tests

* feat: use the logoUploader instead of the ArticleImageUploader

* feat: return early because svg's do not contain exif or gps data

* chore: we can move the raise outside the transaction as the rest of the transaction won't execute if we raise an error

* feat: add a size range

* WIP: resize an image to a random number for now

* hid the logo behind a feature flag and kept logo_svg as is in the site header.

* Added the jpe file type to the logo uploader.

* Skipped the resizing of an image if it's an SVG in the logo uploader.

* Added content types to the content type logo uploader allow list.

* Synced logo validation with frontend and backend.

* Removed unnecessary ALLOWED_PARAMS elements.

* feat: update the logo upoader and tests

* chore: remove comments

* chore: remove comments

* feat: update the resizing for the images + add the correct content type

* spec: test the versions

* fix: update the Constant

* feat: add the versions of the logo

* feat: populate the settings correctly and consistently

* feat: add an random string to the file name to avoid caching issues

* feat: amend the logo layout

* chore: remove comments

* spec: update

* feat: image type whitelist

* feat: update the logo css and  also just use resized_logo and remove mobile resize

* feat: add a max-height

* only add site-logo if the feature flag is off

* Renamed IMAGE_TYPE_WHITELIST to IMAGE_TYPE_ALLOWLIST

* Update app/controllers/admin/creator_settings_controller.rb

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

* Update app/uploaders/logo_uploader.rb

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

* Update app/uploaders/logo_uploader.rb

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

* Update app/uploaders/logo_uploader.rb

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

* Update spec/uploaders/logo_uploader_spec.rb

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

* Update spec/uploaders/logo_uploader_spec.rb

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

* chore: revert admin change

* refactor: use a static value for directory

* feat: freeze constants

* feat: remove the logo requirement

* chore: spacing

* remove logo requirement

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
Co-authored-by: Michael Kohl <citizen428@forem.com>
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2021-12-02 09:49:09 +02:00
Nick Taylor
07d04f2d66
Fixed lint:frontend npm script (#15631)
* Set no-var eslint rule to error.

* Fixed npm script lint:frontend

* Replaced vars with lets as per new no-var erroring out rule.

* Fixed lint errors that surfaced after fixing the lint:frontend npm script.
2021-12-02 07:42:30 +00:00
Jeremy Friesen
5ee8764749
Factoring code to define Article.approved (#15600)
As I'm working on #15359 I wanted to favor using scopes over the raw
`where(approved: true)`.
2021-12-01 22:45:32 -05:00
Arit Amana
abec2e58e9
First Few Unified Embed implementations (Liquid Tags) (#15550)
* Adding {% embed %} for liquid tags

This commit introduces the crease for us to unify our embed experience.
The main concept is introducing a lookup function for the given "link".
And with that lookup function find the underlying `LiquidTagBase` that
can handle the specific URL.

This is part proof of concept and part laying the foundation for a
plugin architecture of different LiquidTags.

We have a lot more work ahead of us to normalize this:

- Update and migrate existing data (not required but hopefully helps us
  deprecate existing liquid tags)
- Move these "embeddable" tags into a module space that eases lookup.
- Document how someone might make a Railstie gem to inject new
  embeddable formats into their application.

Related to #15099

* start adding UnifiedEmbeds to LiqTag models

* add specs for asciinema and codepen liqtags

* new tags and their specs

* complete first pass of liqtag models

* complete implementation for JsFiddleTag

* fixing twittertimeline tag

* almost done with YoutubeTag embed

* remove Medium UnifiedEmbed due to broken image in prod

* remove semi-working unified embed

* update specs

* Address PR review feedback

* add missing spec

* implement PR feedback

* last of PR review-related changes

* fix failing spec

Co-authored-by: Jeremy Friesen <jeremy.n.friesen@gmail.com>
2021-12-01 19:33:34 -05:00
Jeremy Friesen
61b94b5176
Renaming method to reduce surprise (#15632)
Given that we have the roles of `:tech_admin`, `:admin`, and
`:super_admin`, I don't want the surprise of assuming that `user.admin?`
means that they have the role of `:admin`.
2021-12-01 16:38:26 -05:00
dependabot[bot]
719ce073c3
Bump ddtrace from 0.54.0 to 0.54.1 (#15630)
Bumps [ddtrace](https://github.com/DataDog/dd-trace-rb) from 0.54.0 to 0.54.1.
- [Release notes](https://github.com/DataDog/dd-trace-rb/releases)
- [Changelog](https://github.com/DataDog/dd-trace-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/DataDog/dd-trace-rb/compare/v0.54.0...v0.54.1)

---
updated-dependencies:
- dependency-name: ddtrace
  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-12-01 14:37:22 -07:00
Jeremy Friesen
6d1268f19b
Fixing logic error for feed (#15611)
* Fixing logic error for feed

Prior to this change, we were forcing features into the feed.

* Adding spec to help ensure parameter match

Prior to this commit, but before I had merged changes into main, the I
had implemented `alias default_home_feed call`.  However, this broke the
interface assumed in the feeds controller.
2021-12-01 13:48:02 -05:00
Jeremy Friesen
4efcf8c3d3
Refactoring to use scope (#15625)
* Refactoring to use scope

Prior to this commit, four methods had similar purpose but different
implementations.  This commit normalizes that and extracts a few
`ActiveRecord::Base` scopes.

Related to #15624

* Fixing typo and tests
2021-12-01 13:14:40 -05:00
Jeremy Friesen
e1bddb5bf8
Replacing User#warned with User#warned? (#15628)
A simply refactor to introduce more idiomatic method names.

Related to #15624
2021-12-01 13:14:16 -05:00
Jamie Gaskins
172906271c
Block more bots (#15626) 2021-12-01 13:06:28 -05:00
Jeremy Friesen
3860f5c7b5
Extracting Article.featured scope (#15612)
In addition adding commentary on the oddly named
`Articles::Feeds::FindFeaturedStory` class given that it never filters
on "featured".
2021-12-01 12:16:32 -05:00
yheuhtozr
cca3bed043
views/shared/authentication etc i18n (#15131)
* views/shared/authentication etc i18n

* remove ja.yml

* Update _providers_registration_form.html.erb

* Update registrations_spec.rb

* Update _email_registration_form.html.erb

* Update _forem_creator_signup.html.erb

* Update spec/requests/registrations_spec.rb

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

* Update dashboard_spec.rb

* Update dashboard_spec.rb

* Update _forem_creator_signup.html.erb

* Update _forem_creator_signup.html.erb

Co-authored-by: Michael Kohl <citizen428@forem.com>
2021-12-01 18:56:33 +02:00
Ridhwana
25dd42704e
Validate the color contrast ratio before submitting the Creator Settings Form (#15444)
* feat: add a color contrast utility

* feat: add an error when the color contrast is low

* feat: add form validations

* refactor: treat WCAGColorContrast as a library that can be intercanged at any time

* fix: styling

* test: add a test for the contrast

* feat: add test for WCAGColorContrast

* feat: update cypress tests for brand color and color contrast ratios

* feat: update the message to read better

* chore: update the styling

* refactor: address all feedback/suggestions

* Update cypress/integration/creatorOnboardingFlows/creatorSettings.spec.js

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>

* Replaced other .trigger('change')s with .blur()

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Nick Taylor <nick@dev.to>
2021-12-01 18:49:11 +02:00
Daniel Uber
d0c6088253
quote localized strings in credits/purchase embedded script (#15623)
* Add view test for change submit button

Expect a quoted string for the button values.

* Quote button text in calls to changeSubmitButton

This fixes a parse error (locally now I get an error about not having
a stripe publishing id, which is expected).
2021-12-01 10:07:55 -06:00
Michael Kohl
8be270d3d9
Remove some README badges (#15614) 2021-12-01 10:54:02 -05:00
Suzanne Aitchison
666f105cfb
Revert "Bump @storybook/builder-webpack5 from 6.3.12 to 6.4.1 (#15533)" (#15622)
This reverts commit 90dcb5af47.
2021-12-01 15:40:59 +00:00
Nick Taylor
6b21fe2bac
Fixed test that breaks once upgraded to Node 16. (#15621) 2021-12-01 09:24:03 -06:00
Julianna Tetreault
567dda620f
Remove italics from Community Name field (#15619) 2021-12-01 07:53:45 -07:00
Fernando Valverde
50a73e035e
Avoid email reassignment when connecting OAuth provider (#15609)
* Avoid email reassignment when connecting oauth provider

* Use less intrusive approach (we still want to preserve <provider>_username assignment)

* Add spec to avoid regressions
2021-12-01 09:13:12 -05:00
ludwiczakpawel
eaf0827286
Increase scrollable area on toolbar (#15615)
* increase scorllable area

* fix

* fix

* ..
2021-12-01 13:59:03 +01:00
Jeremy Friesen
0242781b98
Refactoring spec (#15610)
Prior to this change, for each of the context's specs, we first visited
the /top/week path then in all but one case immediately visited another
path.

This created extra requests that weren't necessary.

Relates to #15292 and #15475
2021-12-01 14:45:12 +02:00
Siddeshwar Navaneetharan
da9705b02b
Remove z-index from liquid tags (#15596)
* Remove z-index from liquid tags

Remove the z-index:1 from liquid tags present in 'GithubReadmeTag.scss', 'GithubTag.scss' and 'TwitterTimelineTag.scss'.
The removal of this eliminates the weird visibility issue when the article-show-more-dropdown overlaps the pretty embeds on the page.

* restart build

Co-authored-by: Paweł Ludwiczak <ludwiczakpawel@gmail.com>
2021-12-01 10:35:45 +01:00