Commit graph

1084 commits

Author SHA1 Message Date
Josh Puetz
4f24c5ff43
Constantize broadcast messages (#16219) 2022-01-20 11:47:01 -06:00
yheuhtozr
53564c2849
app/mailers i18n (#16191)
* app/mailers i18n

* delete ja.yml
2022-01-20 07:33:29 -07:00
yheuhtozr
71b2724faa
app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
yheuhtozr
adc757f5a5
app/validators i18n (#16166) 2022-01-19 05:25:39 -05:00
Jamie Gaskins
ebdaaaf15b
Revert "Support alternate S3 endpoints" (#16173) 2022-01-18 14:11:18 -05:00
Jamie Gaskins
8bdb2b6d8b
Support alternate S3 endpoints (#15445)
* Support alternate S3 endpoints

* Add missing comma

This is why we should use trailing commas

* Provide sample S3 endpoint config

* Comment out S3 image-storage config in .env_sample

See https://github.com/forem/forem/pull/15445#discussion_r754525723
2022-01-18 11:34:42 -05:00
yheuhtozr
617d66c4e5
app/liquid_tags i18n (#16125) 2022-01-18 11:28:38 -05:00
Ben Halpern
8159f4383c
Feed experiment 4: Final order (#16128)
* Feed experiment 4: Final order

* Remove development line

* Fix text in tests

* Fix text in tests

* Switch query to greatest of
2022-01-17 17:05:43 -05:00
Faruk Nasir
c7c83ea84f
Fix: grammatical error (#16127)
* fix: grammatical error

* fix: grammatical error
2022-01-17 07:07:25 -07:00
Michael Kohl
fef3001bfe
Reconfigure session store, upgrade redis-actionpack (#16088) 2022-01-14 11:02:43 -05:00
yheuhtozr
f1c3138839
app/helpers i18n (#16003)
* app/helpers i18n

* tidy key names

* fix keys

* delete ja.yml

* fix spec

* fix spec 2

* fix for PR

* remove one key for PR

* delete ja.yml
2022-01-13 11:46:32 -05:00
Josh Puetz
629c7114da
Login with Google (#15986) 2022-01-13 10:25:52 -06:00
Michael Kohl
681ab3aac2
Enable use_cookies_with_metadata option (#16087) 2022-01-13 10:27:19 -05:00
Michael Kohl
813222a414
Remove explicit Zeitwerk config, require hack (#16086) 2022-01-13 20:56:47 +07: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
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
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
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
Michael Kohl
6c26a8b40e
Update framework defaults (#15988)
* Update framework defaults to 6.0

* Update application.rb
2022-01-10 13:35:28 -05:00
Ben Halpern
c5e57f71b3
Update precision config on field test dashboard (#15947) 2022-01-04 14:06:13 -05:00
Jeremy Friesen
6269aa4108
Proposing a new feed experiment (#15789)
* Proposing a new feed experiment

This commit involves tweaking a few subtle aspects of the challenger:

1) Remove the sort by published date on the relevance score.  The
   articles will now be listed in the order of perceived relevance.
2) Disable a few levers that did little.  There really aren't any
   `articles.featured = true` articles in the database.
3) Gently increase the weight of each comment in a linear manner.
4) Give a little more weight to posts that don't have followed tags.

In addition, it involves renaming the conversions to better convey their
implementation.  This renaming helps create more descriptive labels for
the test results at `/admin/abtests`.

This commit also adds logic to repurpose the AbExperiment feed_strategy
logic; I envision adjusting the weighted feed strategy levers with some
frequency.

Per discussions, I'm also disabling the "not logged in" feed testing.
We'll use the LargeForemExperimental for this.

* Flipping attribute name to positive

Mentally "not disabled" is harder to parse than "enabled".  This change
helps with setting an optimistic attribute.

* Bump for travis

* Bump for travis

* Removing file committed by mistake

* Extracting method
2022-01-03 14:38:14 -05:00
Michael Kohl
466f111712
Remove sign in/up link from navlinks (#15922)
* Remove sign in/up link from navlinks

* Remove translations

* Update spec
2022-01-03 22:20:29 +07:00
Derek Crosson
ae27d15be7
Prevent whitespace unicode characters from being used in article title and tag (#14909)
* test: whitespace unicode characters cannot be used as titles or tags

* feat: add localized error message

* refactor: use localized error message

* fix: whitespace unicode characters cannot be used as titles or tags

* chore: fix locale after merge

* refactor: fix indentation

* Fix spelling of prohibited in method names

Additionally, rubocop removed a redundant user_id validation since
Article belongs to user.

* Fix spelling

Missed one method call on the same line (fixed the first of two
instances needing changes)

* add failing test cases

The reorganization to remove let was due to a limit on nesting rspec
contexts (it inside context inside describe inside describe when
trying to use different titles in let blocks in contexts)

The first test was clarified (the "U+202D" string that looks like the
code for a unicode point is valid, but the character \u202d is
expected to be invalid

The remaining two tests are based on the feedback I'd given in the PR,
failing because we don't assert title is present after removing
unicode whitespace, and we don't actually set the title (gsub is
non-destructive, returning a value).

* Set title to sanitized title

contains_prohibitied_unicode_characters? was using == (which is not a
good match for strings to regexes), use =~ instead

Change invalid example characters in titles from \u202d (bidi override) to
\u200a (hair space)

Assert that the empty title is blank and can't be blank (even though
it contains no prohibitd characters after replacement)

* change the definition of prohibited characters

From the description, it looks like "unicode space characters" was the
desired rejection set. It was unclear what the existing regex was
matching on (I couldn't get the expected examples to match correctly).

Given the intent, I select "unicode space property, except the ascii
space character", which may _also_ be incorrect but passed the tests.

* Remove now-invalid expectation for presence of user id

Since this was redundant (belongs_to user), we no longer will validate
presence of user id, and we should not test for it.

* Only reject bidirectional text controls

The original issue pointed to the BIDI controls as problematic.

While they called out other "whitespace" characters, as we accept a
wider range of input languages, the need to handle non-printing
punctuation (for example a group separating space for some asian
languages).

It's possible a wider list of characters should be added - if that's
the case I suggest this regex and the sanitization be moved to a
standalone class, and each of the recommendations in
https://www.w3.org/TR/unicode-xml/#Charlist be checked for
applicability.

* Check for blank title after sanitizing disallowed characters

Since validate_title modifies the title, and doesn't set error
messages on the model itself, check for non-empty title _after_
potentially removing any disallowed characters.

* Remove invalid characters before validation

Remove the validate_title and contains_prohibited_characters methods,
and center all logic on the remove prohibitied unicode characters
method.

Remove unneeded and unused arguments (input string is always title,
replacement is always removal/empty string).

* handle case when validating null title

If the title's nil, we don't want to call match? since it will fail.

Title will sometimes be nil when validating.

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
Co-authored-by: Dan Uber <dan@forem.com>
2022-01-03 09:37:03 -05:00
yheuhtozr
3acd4e9deb
delete and add back i18n keys (#15905) 2021-12-30 10:12:40 -05:00
Michael Kohl
06d6b68d9d
Remove webhooks and related code (#15827) 2021-12-28 10:56:37 +07:00
dependabot[bot]
2d98e3346b
Bump rubocop from 1.23.0 to 1.24.0 (#15872)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Kohl <me@citizen428.net>
2021-12-27 10:04:59 -05:00
yheuhtozr
5253717797
fix character limits i18n (#15830) 2021-12-21 07:15:21 -05:00
Michael Kohl
872b007c30
Remove Doorkeeper gem (#15749) 2021-12-21 12:29:58 +07:00
yheuhtozr
021ed9708e
restore i18n key _footer.html.erb (#15831) 2021-12-20 16:33:41 -06:00
ludwiczakpawel
d125617e13
CSS Variables cleanup (#15828)
* variables cleanup

* little fix
2021-12-20 15:42:40 +01:00
ludwiczakpawel
9b7503fde3
Update left sidebar links with new Crayons components (#15757)
* update

* hamburger fix

* Update app/views/shared/_hamburger.html.erb

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

* updates

* spec

* social media icons

* reading list counter

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-12-20 08:46:30 +01:00
Jamie Gaskins
329f33448f
Disallow null user agent and obsolete browser (#15817)
We were previously disallowing empty user agents, but we weren't
blocking requests where the User-Agent header wasn't set at all. This
commit blocks those requests.

This commit also blocks Chrome 74. It's a 2.5-year-old version of an
evergreen browser that releases every 6 weeks, so this is clearly a bot
spoofing this header.
2021-12-17 15:02:30 -05:00
Josh Puetz
731849a068
Mobile mention notifications (#15780) 2021-12-16 11:06:54 -06:00
Mac Siri
dfb0d0300c
Monkey-patch instead of forking cypress-rails gem (#15797) 2021-12-16 11:36:45 -05:00
yheuhtozr
65fe8247a6
clean up views i18n entries (#15731)
* clean up views i18n entries

* Update edit.html.erb

* Update edit.html.erb
2021-12-14 09:23:26 +00:00
Jamie Gaskins
e188eac55d
Fix Fastly bot block for Ruby Net::HTTP clients (#15713)
I was using the wrong VCL request property. It's `req.url`, not `req.http.url`.

https://developer.fastly.com/reference/vcl/variables/client-request/req-url/
2021-12-08 12:32:04 -05:00
yheuhtozr
74b065be58
I18nize views misc & non-HTML templates (#15136) 2021-12-08 11:28:16 -05:00
Jeremy Friesen
bd36ed087b
Removing the stackbit integration (#15701)
* Removing the stackbit integration

The feature didn't quite work and Stackbit no longer supports this
integration.

Yes there are a few places where the webhooks has a string of "stackbit"
but I'm hesitant to remove that, as they are the part of the Webhooks
tests.

Closes #15700

* Update lib/data_update_scripts/20211206222716_remove_stackbit_page.rb

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

Co-authored-by: Michael Kohl <citizen428@forem.com>
2021-12-08 10:20:15 -05:00
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
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
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
yheuhtozr
39b84f471d
fix missing i18n strings & keys in views/comments (#15657) 2021-12-02 14:24:57 -06:00
yheuhtozr
a1e8f29fe6
user settings i18n (#15098)
Co-authored-by: Nick Taylor <nick@dev.to>
2021-12-02 11:35:08 -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
Jamie Gaskins
172906271c
Block more bots (#15626) 2021-12-01 13:06:28 -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