Commit graph

10511 commits

Author SHA1 Message Date
dependabot[bot]
2f47b47c32
Bump bullet from 6.1.5 to 7.0.0 (#15833)
Bumps [bullet](https://github.com/flyerhzm/bullet) from 6.1.5 to 7.0.0.
- [Release notes](https://github.com/flyerhzm/bullet/releases)
- [Changelog](https://github.com/flyerhzm/bullet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/flyerhzm/bullet/compare/6.1.5...7.0.0)

---
updated-dependencies:
- dependency-name: bullet
  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-12-20 14:21:50 -06:00
dependabot[bot]
a2f324a2dc
Bump rouge from 3.26.1 to 3.27.0 (#15791)
Bumps [rouge](https://github.com/rouge-ruby/rouge) from 3.26.1 to 3.27.0.
- [Release notes](https://github.com/rouge-ruby/rouge/releases)
- [Changelog](https://github.com/rouge-ruby/rouge/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rouge-ruby/rouge/compare/v3.26.1...v3.27.0)

---
updated-dependencies:
- dependency-name: rouge
  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-12-20 11:09:31 -05:00
ludwiczakpawel
d125617e13
CSS Variables cleanup (#15828)
* variables cleanup

* little fix
2021-12-20 15:42:40 +01:00
ludwiczakpawel
5e098df276
fix (#15829) 2021-12-20 13:38:29 +01:00
Anna Buianova
9f688be406
Moved setting old_username from before_validation to Users::Update (#15782)
* Moved setting old_username from before_validation to Users::Update

* Removed unused code

* Fixed specs after moving setting old_usernames
2021-12-20 11:08:09 +03: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
Andy Zhao
8a7e5a5566
Escape periods and display the group name properly (#15819)
* Escape periods and display the group name properly

* Rename method to dom_safe_name and move to admin helper

* Replace beginning of string digit with underscore then digit
2021-12-17 17:35:42 -05:00
Andy Zhao
6335f9a7e9
Remove profile when banish (#15818)
* Clear profile when banishing user

* Add test for clearing profile when banishing

* Also clear any social usernames
2021-12-17 15:36:35 -05: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
Dwight Scott
325a9f9e3f
Add me (Dwight) to readme :) (#15816) 2021-12-17 14:50:45 -05:00
dependabot[bot]
fb758a3bbe
Bump strong_migrations from 0.7.8 to 0.7.9 (#15812)
Bumps [strong_migrations](https://github.com/ankane/strong_migrations) from 0.7.8 to 0.7.9.
- [Release notes](https://github.com/ankane/strong_migrations/releases)
- [Changelog](https://github.com/ankane/strong_migrations/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ankane/strong_migrations/compare/v0.7.8...v0.7.9)

---
updated-dependencies:
- dependency-name: strong_migrations
  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-17 13:31:53 -05:00
dependabot[bot]
c6ed3b6a2b
Bump field_test from 0.5.1 to 0.5.2 (#15813)
Bumps [field_test](https://github.com/ankane/field_test) from 0.5.1 to 0.5.2.
- [Release notes](https://github.com/ankane/field_test/releases)
- [Changelog](https://github.com/ankane/field_test/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ankane/field_test/compare/v0.5.1...v0.5.2)

---
updated-dependencies:
- dependency-name: field_test
  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-17 13:29:57 -05:00
dependabot[bot]
c047dd2631
Bump jbuilder from 2.11.3 to 2.11.4 (#15815)
Bumps [jbuilder](https://github.com/rails/jbuilder) from 2.11.3 to 2.11.4.
- [Release notes](https://github.com/rails/jbuilder/releases)
- [Changelog](https://github.com/rails/jbuilder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/jbuilder/compare/v2.11.3...v2.11.4)

---
updated-dependencies:
- dependency-name: jbuilder
  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-17 12:28:36 -06:00
Arit Amana
dee0b36981
Implement Unified Embed for CodeSandbox URLs (#15808)
* Implement embed and write specs

* fix slight regex ommision

* remove error over invalid options; add specs to cover

* account for missing options when using embed keyword

* no videos, no ns video_id 🤦🏾‍♀️
2021-12-17 12:12:54 -05:00
Daniel Uber
4b93684dab
Don't raise error when empty community emoji setting submitted (#15723)
* Don't raise NoMethodError when validating emoji settings

Cargo culted the unique cross model slug validator setup (which is why
value is called name here in the validatable).

Don't raise an error when validating a nil emoji, and assert nil and
empty string are permitted values.

This expects no non-emoji characters (so an empty string would be
permitted), and nil should be permitted.

I believe this might have been introduced by the string settings
cleaner (exchanging "" for nil in form inputs).

* Update app/validators/emoji_only_validator.rb

guard for value, and then validate value
2021-12-17 09:29:55 -06:00
Daniel Uber
7b5d90d252
Add DISABLE_SPRING environment variable to gitpod forem server task (#15807)
https://www.gitpod.io/docs/environment-variables#terminal-specific-environment-variables

Without this I'm seeing the ENV["APP_DOMAIN"] not set when spring is
loaded (this prevents browsing the site from within gitpod).
2021-12-16 15:24:22 -06:00
dependabot[bot]
d2bf8e9b77
Bump brakeman from 5.1.2 to 5.2.0 (#15805)
Bumps [brakeman](https://github.com/presidentbeef/brakeman) from 5.1.2 to 5.2.0.
- [Release notes](https://github.com/presidentbeef/brakeman/releases)
- [Changelog](https://github.com/presidentbeef/brakeman/blob/main/CHANGES.md)
- [Commits](https://github.com/presidentbeef/brakeman/compare/v5.1.2...v5.2.0)

---
updated-dependencies:
- dependency-name: brakeman
  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-12-16 12:31:47 -07:00
dependabot[bot]
12fd5441cb
Bump fastimage from 2.2.5 to 2.2.6 (#15806)
Bumps [fastimage](https://github.com/sdsykes/fastimage) from 2.2.5 to 2.2.6.
- [Release notes](https://github.com/sdsykes/fastimage/releases)
- [Changelog](https://github.com/sdsykes/fastimage/blob/master/CHANGELOG)
- [Commits](https://github.com/sdsykes/fastimage/compare/v2.2.5...v2.2.6)

---
updated-dependencies:
- dependency-name: fastimage
  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-16 12:25:05 -07:00
dependabot[bot]
8cba3e54e6
Bump devise from 4.8.0 to 4.8.1 (#15802)
Bumps [devise](https://github.com/heartcombo/devise) from 4.8.0 to 4.8.1.
- [Release notes](https://github.com/heartcombo/devise/releases)
- [Changelog](https://github.com/heartcombo/devise/blob/main/CHANGELOG.md)
- [Commits](https://github.com/heartcombo/devise/compare/v4.8.0...v4.8.1)

---
updated-dependencies:
- dependency-name: devise
  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-16 12:08:24 -07:00
dependabot[bot]
ef703219fe
Bump rails from 6.1.4.3 to 6.1.4.4 (#15803)
Bumps [rails](https://github.com/rails/rails) from 6.1.4.3 to 6.1.4.4.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v6.1.4.3...v6.1.4.4)

---
updated-dependencies:
- dependency-name: rails
  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-16 12:08:09 -07:00
dependabot[bot]
db43fd2a40
Bump pghero from 2.8.1 to 2.8.2 (#15804)
Bumps [pghero](https://github.com/ankane/pghero) from 2.8.1 to 2.8.2.
- [Release notes](https://github.com/ankane/pghero/releases)
- [Changelog](https://github.com/ankane/pghero/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ankane/pghero/compare/v2.8.1...v2.8.2)

---
updated-dependencies:
- dependency-name: pghero
  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-16 13:50:30 -05:00
Nick Taylor
780ef90baf
Added some retries to cookie clearing (#15798) 2021-12-16 13:28:40 -05:00
Alex
51f2bf7aab
Add article and comment count to instance API (#15794) 2021-12-16 13:05:49 -05:00
Arit Amana
5c13d9d8fd
Implement embed tag and specs (#15801) 2021-12-16 12:58:43 -05:00
Daniel Uber
57ebd8e0fc
Skip notification interaction with replies spec (#15799)
* Skip notification interaction with replies spec

This had been failing in builds (my assumption is that the state flag
for .reacted was either out of sync or not yet ready/unhidden, I'm
still getting more information about this).

The behavior being tested is that clicking the greyed out heart on a
reply enables the .reacted class, and clicking again disables
it. There's a similar test for an admin clicking heart, thumbsdown,
and monocle/flag/vomit icons one by one and checking the state on the
page.

This is a good candidate to move to a cypress test.

* Skip admin interacting with replies to notifications

Same issue as the user interaction - the .reacted class is not
reliably present after a click event.
2021-12-16 11:54:58 -06:00
Jeremy Friesen
aa7712a80e
Extracting container for allowed tags & attrs (#15338)
* Extracting container for allowed tags & attrs

Prior to this commit, we had several different locations in which we
specified ALLOWED_TAGS and ALLOWED_ATTRIBUTES for HTML rendering and
sanitization.

Curious to see how these either intersected or didn't, I opted to
create a container module that allows for us to more readily normalize
these allowed tags and attributes.  It's possible that we won't do any
normalization, but this work helps make that easier.

Ideally, I'd love us to contextualize "why did we choose the
tags/attributes we chose?"  But for now, I think consolidating these
tags and attributes will help make adding a `details` and `summary` tag
easier.

This relates to forem/rfcs#296

See [Google Sheet][1] for analysis of what tags/attributes are used, the
intersection and union.

[1]:https://docs.google.com/spreadsheets/d/1yj-a1qus1o0o4cj-_gOMP5yteeg-_f3s5z7kvK0Y7RM/edit#gid=0

* Fixing misnamed constant

* Fixing misnamed constant

* Extracting additional HtmlRendering use cases

* Adding comparative documentation for HTML tags

* Fixing broken parameter signature

* Moving constants into MarkdownProcessor
2021-12-16 12:24:45 -05:00
Josh Puetz
731849a068
Mobile mention notifications (#15780) 2021-12-16 11:06:54 -06:00
Josh Puetz
3fd03b5ed6
Remove line break after linking username mentions (#15788) 2021-12-16 10:39:07 -06:00
Mac Siri
dfb0d0300c
Monkey-patch instead of forking cypress-rails gem (#15797) 2021-12-16 11:36:45 -05:00
Michael Kohl
b22ad4c976
Remove Doorkeeper from API (#15750)
Co-authored-by: Dan Uber <dan@forem.com>
2021-12-16 09:57:26 -06:00
Nick Taylor
2063d73459
Changed members only copy for radio button label to invite only. (#15795) 2021-12-16 08:31:31 -05:00
Nick Taylor
70e233953c
Disabled Spring for E2E databse when run locally (#15793) 2021-12-15 15:58:13 -05:00
Arit Amana
19d8cad1e9
Implement IG unified embed; add specs (#15792) 2021-12-15 15:35:43 -05:00
ludwiczakpawel
0cce606938
Error message after authentication failure due to email address not being whitelisted (#15779)
* cosmetics

* cosmetics

* Build restart

* generator failing build?

* generator failing build?
2021-12-15 21:25:27 +01:00
ludwiczakpawel
a96d69faab
✂️✂️✂️ Drop PWA (#15781)
* drop pwa stuff

* this was breaking the build... shrug.gif

* Update app/assets/javascripts/initializers/runtime.js

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

* shorthand for if

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-12-15 21:25:04 +01:00
ludwiczakpawel
2e82b92435
fix (#15783) 2021-12-15 20:39:15 +01:00
Nick Taylor
6df9309284
Added the logo upload to the admin -> customization -> config -> images section. (#15729)
Co-authored-by: Michael Kohl <citizen428@forem.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Mac Siri <mac@forem.com>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2021-12-15 14:10:27 -05:00
Jamie Gaskins
cde4e08534
Automatically create user profile if it's missing (#15787)
I don't know how it's nil, but it is, so we can remediate that here
2021-12-15 14:03:51 -05:00
dependabot[bot]
9f6419ca6b
Bump devise_invitable from 2.0.5 to 2.0.6 (#15790)
Bumps [devise_invitable](https://github.com/scambra/devise_invitable) from 2.0.5 to 2.0.6.
- [Release notes](https://github.com/scambra/devise_invitable/releases)
- [Changelog](https://github.com/scambra/devise_invitable/blob/master/CHANGELOG.md)
- [Commits](https://github.com/scambra/devise_invitable/compare/v2.0.5...v2.0.6)

---
updated-dependencies:
- dependency-name: devise_invitable
  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-15 12:22:14 -06:00
Jeremy Friesen
fa093b0a92
Refactoring instance variable usage in tagged articles controller (#15687)
* Refactoring away from instance variables

Having both `@tag` and `@tag_model` as variable names can be confusing.

Given that in the prior implementation `@tag_model.name == @tag`, I
figured I would refactor the controller to remove an instance variable.

In addition, this refactor addresses the temporal coupling of methods;
that is to say we call a method which sets an instance variable then
call another dependent on that instance variable.

Yes, ivars are useful to allow for implicit state.  However, by favoring
parameters its easier to notice temporal dependencies in method calls.

This helps ensure that we're calling methods in the right order.

Futher, we have a guard clause in place, so let's avoid setting any
additional instance variables that aren't needed if the guard clause
executes.

Related to #15359

* Update app/controllers/stories/tagged_articles_controller.rb

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

* Favoring constants and Rails where constructs

Prior to this commit, we had a magic array.  That magic array was a
duplicate of the Timeframe constant.  Likewise, we had a magic string.

This change removes that duplication.

Furthermore, this change favors the `where(key: range..)` construct
instead of "raw" SQL and parameter substition.

Co-authored-by: Michael Kohl <citizen428@forem.com>
2021-12-15 10:49:50 -05:00
Jeremy Friesen
a5058d3744
Consolidating role query logic (#15773)
* Consolidating role query logic

Prior to this commit, we had two logically identical chunks of code.

With this commit, we consolidate that logic into a single method.  In
addition, we remove one place where the application knows about the
roles implementation.

Loosely related to #15624.

* Bump for travis
2021-12-15 10:49:32 -05:00
Ridhwana
0c51185232
Bust cache after we update the Settings in the Creator Onboarding (#15785)
* feat: bust caches after th create actionon the creator_settings

* spec: update to make sure that we update the cache key
2021-12-15 16:27:58 +02:00
Mac Siri
a5de970341
Bump Rails to 6.1.4.3 (#15784) 2021-12-15 08:54:02 -05:00
dependabot[bot]
15e6e56c39
Bump postcss from 8.4.4 to 8.4.5 (#15752)
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.4 to 8.4.5.
- [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.4.4...8.4.5)

---
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-12-15 13:46:59 +00:00
dependabot[bot]
361ff1c287
Bump @babel/plugin-transform-react-jsx from 7.16.0 to 7.16.5 (#15767)
Bumps [@babel/plugin-transform-react-jsx](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-react-jsx) from 7.16.0 to 7.16.5.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.5/packages/babel-plugin-transform-react-jsx)

---
updated-dependencies:
- dependency-name: "@babel/plugin-transform-react-jsx"
  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-15 06:44:21 -07:00
Mac Siri
aac9569a84
Replace honeybadger-js with @honeybadger-io/js (#15770) 2021-12-15 08:39:08 -05:00
Suzanne Aitchison
0295dbeabf
Update a11y of ButtonGroup component (#15765) 2021-12-15 12:52:33 +00:00
dependabot[bot]
0669ebbfa3
Bump preact from 10.6.2 to 10.6.4 (#15771)
Bumps [preact](https://github.com/preactjs/preact) from 10.6.2 to 10.6.4.
- [Release notes](https://github.com/preactjs/preact/releases)
- [Commits](https://github.com/preactjs/preact/compare/10.6.2...10.6.4)

---
updated-dependencies:
- dependency-name: preact
  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-14 13:59:24 -07:00
dependabot[bot]
1fdd2e9534
Bump prettier from 2.5.0 to 2.5.1 (#15761)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-14 15:56:32 -05:00
Nick Taylor
33e7deee55
Put back default community name. (#15777) 2021-12-14 13:48:38 -07:00