Commit graph

10218 commits

Author SHA1 Message Date
Ridhwana
83b4a6db81
feat: update the description to more concise (#15416) 2021-11-18 15:47:50 +02:00
Suzanne Aitchison
15fed1cce4
Revise skip link behaviour (#15401)
* Revise skip link route change behaviour

* remove cypress test for divergent behaviour no longer needed

* fix import path

* remove duplicate styles - woops

* use translated string
2021-11-18 13:45:08 +00:00
Anna Buianova
4cab190285
Hiding comments: an option to hide or keep children (#15178)
* Optional hiding child comments (start)

* Changed confirm button in comments hide form

* Hide children comments if hide_children was passed

* Added a spec for hidden child comment notifications

* Hide only explicitly hidden comments

* Hide comment modal on article page

* Prevent default behaviour for hide comment link

* Improved hide comments modal looks

* Improved hide comments modal looks

* Removed unused code

* Send hide comment form via fetch

* Hide comment descendants when hide_children was passed

* Don't hide hidden comments descendants on permalink

* Removed unnecesary span

* Improved hide comments modal styling

* Removed unused styles and js, improved styling

* Clickable label

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>

* Fixed showing hidden comments spoiler for article author

* Fixed hideArticleComments.spec.js

* Fixed displaying hidden comments text for artice author, added specs

* Target hide comments modal inside the modal when adding a listener

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

* Replaced hide comment link with a button

* Refactored adding hide_children url param

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

* Fixed cypress hide comments test

* Removed aria-label for submit on the hide comments modal

* Fixed formatting

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-11-18 11:57:40 +03:00
Jeremy Friesen
91b951eb05
Refactoring and extending article spam behavior (#15399)
* Refactoring and extending article spam behavior

Prior to this refactor, we were checking an Article's title for
spaminess.  This change now checks the Article's title and
body_markdown.

In addition, the encapsulates the regular expression implementations in
favor of asking the Settings::RateLimit class to determine if the passed
in text is "spammy".

Furthermore, instead of having lots of inline logic within the article,
this refactor introduces a `Spam::ArticleHandler` class.  This helps
tidy up the already busy Article specs by delegating the business logic
of Spam handling to it's own class.

There are further refactors for Comments and Users that would follow
this pattern, but this change is more important to get out the door.

Closes #15396

* Adding comments to clarify behavior of spam handling

* Adding missing expectation to spec
2021-11-17 17:09:17 -05:00
Nick Taylor
52ec967de5
Fixed issue where element didn't exist in the config Stimulus controller. (#15408) 2021-11-17 15:25:17 -05:00
Julianna Tetreault
4d3237ecfb
Remove Setup Banner from Creator Onboarding Flow (#15310)
* Removes the 'Setup not complete' banner from the Creator Onboarding flow

* Chains the safe navigation operator to current_user in #creator_setup_mode?

* Replaces current_user with User.with_role(:creator) in creator_setup_mode?

* Checks for URL rather than path helper in #creator_setup_path?

* Consistently remove setup banner on the creator settings form

* Reverts changes to verify_setup_complete.rb

* Adds a setup-banner ID for removal of the gobal setup banner

* Replaces Rspec test with creatorSettings E2E test

* Wraps setup text in regex in creatorSettings.js.spec
2021-11-17 13:20:16 -07:00
Daniel Uber
8c44bf46a4
Remove broken link "events" from the admin sidebar (#15407)
Gives a 404 (no route /admin/apps/events).
2021-11-17 13:57:56 -06:00
Jeremy Friesen
7aa9c5b0eb
Moving blocked registration domains up (#15403)
* Moving blocked registration domains up

Prior to this commit, the field "worked" but you had to toggle email
authentication to enabled, then fill it out.  You could then disable
email notification and it would work.

This builds on #15397

* Update app/views/admin/settings/forms/_authentication.html.erb

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

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-11-17 11:28:37 -05:00
Lewis Sparlin
ca6719b9b1
Issue #9077 has already been resolved, added specs (#15342)
* Prove #9077 has been resolved

* Do no create mentions for any @mention-like syntax from embedded liquid, add spec
2021-11-17 11:27:50 +02:00
Jeremy Friesen
3782db891a
Adding ability to block domains from registration (#15397)
Prior to this commit, we had filtering options for email registration:

1. Specific allowed domains.
2. Implicitly allow all domains if no allowed domains specified.

With this commit, we add another option: The adminstrator may block one
or more domains from registering.

Closes forem/rfcs#281
2021-11-16 18:56:01 -05:00
Christina
ad0c5c8ae3
Updating to GitHub discussions for feature requests 2021-11-16 15:27:06 -06:00
dependabot[bot]
0862b7ed3f
Bump stripe from 5.40.0 to 5.41.0 (#15395)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-16 14:50:49 -05:00
ludwiczakpawel
1f685d93d1
Remove unused assets (#15367)
* remove unused assets

* spec update

* spec

* spec

* minus

* whoops

* whoops
2021-11-16 19:57:37 +01:00
Jeremy Friesen
f5243ea844
Normalizing feed page size (#15326)
This commit removes a handful of magic numbers and instead relies on a
constant.

This has a small impact in that the Basic feed will now return 50
articles instead of 25.  However, normalizing the feed pagination window
size helps reduce some oddities in reporting.

In addition, this might be something we consider giving administrators
the ability to set (with default options, because we shouldn't allow
page sizes of 10_000 as that's a massive memory hog).

Related to #14709
2021-11-16 11:12:01 -05:00
dependabot[bot]
f712b796b2
Bump @testing-library/dom from 8.11.0 to 8.11.1 (#15384)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-15 17:13:32 -05:00
dependabot[bot]
318632809e
Bump eslint-plugin-jsx-a11y from 6.4.1 to 6.5.1 (#15376)
Bumps [eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y) from 6.4.1 to 6.5.1.
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/compare/v6.4.1...v6.5.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsx-a11y
  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-11-15 14:22:57 -07:00
dependabot[bot]
4d12d25cd7
Bump eslint-plugin-react from 7.26.1 to 7.27.0 (#15375)
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.26.1 to 7.27.0.
- [Release notes](https://github.com/yannickcr/eslint-plugin-react/releases)
- [Changelog](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yannickcr/eslint-plugin-react/compare/v7.26.1...v7.27.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-react
  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-11-15 14:03:10 -07:00
Daniel Uber
845bc01c69
Remove name from allowed tag params in admin (#15382)
Don't allow passing `tag[name]=` in post params to admin tag update.

There's no field for this in the view, it's not expected that someone
change the name (it serves as a natural key) - it's preferrable to
alias an old name to a new tag if a renaming is desired.
2021-11-15 14:58:24 -06:00
dependabot[bot]
321bc8d5cc
Bump jsdom from 18.0.1 to 18.1.0 (#15380)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-15 15:35:16 -05:00
dependabot[bot]
9cac7b63c9
Bump eslint-plugin-import from 2.25.2 to 2.25.3 (#15383)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-15 15:34:39 -05:00
dependabot[bot]
2c5c332638
Bump pg_query from 2.1.1 to 2.1.2 (#15377)
Bumps [pg_query](https://github.com/pganalyze/pg_query) from 2.1.1 to 2.1.2.
- [Release notes](https://github.com/pganalyze/pg_query/releases)
- [Changelog](https://github.com/pganalyze/pg_query/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pganalyze/pg_query/compare/v2.1.1...v2.1.2)

---
updated-dependencies:
- dependency-name: pg_query
  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-11-15 15:10:06 -05:00
dependabot[bot]
566fd5f273
Bump jbuilder from 2.11.2 to 2.11.3 (#15379)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-15 13:53:39 -06:00
dependabot[bot]
e99d8f28a2
Bump rubocop from 1.22.3 to 1.23.0 (#15381)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.22.3 to 1.23.0.
- [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.3...v1.23.0)

---
updated-dependencies:
- dependency-name: rubocop
  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-11-15 12:50:36 -07:00
dependabot[bot]
3c0e3fc2c9
Bump lint-staged from 11.2.6 to 12.0.2 (#15378)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 11.2.6 to 12.0.2.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v11.2.6...v12.0.2)

---
updated-dependencies:
- dependency-name: lint-staged
  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-11-15 12:45:20 -07:00
Suzanne Aitchison
41e0ac9e63
Fix timestamp typo (#15369) 2021-11-15 17:04:04 +00:00
Nick Taylor
9f998b470d
Now labels with the CSS class crayons-btn that wrap inputs of type file have focus states (#15368) 2021-11-15 11:12:01 -05:00
Jeferson S. Brito
a0e15f7bd6
Add Snackbar component on reading list (#15235) 2021-11-15 13:06:21 +02:00
Daniel Uber
90c3ee2e6a
Nullify invalid tag colors (#15361)
* Nullify invalid tag colors

Set bg_color_hex and text_color_hex to nil when they were an empty
string.

This is a cleanup of legacy data (from form submissions, when the
field was unset and another attribute was updated, the value could be
saved as '' rather than set nil). This is no longer possible due to
validations added in #10495 so only needs to be handled once.
2021-11-12 14:35:08 -06:00
dependabot[bot]
3ef4da21b2
Bump stripe from 5.39.0 to 5.40.0 (#15362)
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 5.39.0 to 5.40.0.
- [Release notes](https://github.com/stripe/stripe-ruby/releases)
- [Changelog](https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stripe/stripe-ruby/compare/v5.39.0...v5.40.0)

---
updated-dependencies:
- dependency-name: stripe
  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-11-12 12:05:56 -07:00
Jeremy Friesen
e35f4880d9
Using same markdown config as other instances (#15341)
Prior to this commit, this instantiation of `Redcarpet::Markdown` was
different from the other instantiations.  The other ones all included
the second paramenter (e.g., `Constants::Redcarpet::CONFIG`).

My question is, should we (or can we) be using the same configuration in
all cases?
2021-11-12 09:25:33 -05:00
ludwiczakpawel
f6dc6c1112
fix (#15360) 2021-11-12 12:35:36 +01:00
Daniel Uber
89ac6f1b5a
Check for presence rather than falsey when detecting tag color (#15356)
Fallback on empty string as well as nil to the site default tag color
2021-11-11 15:53:32 -05:00
ludwiczakpawel
09db50b296
Update tag's style (#15266)
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Michael Kohl <citizen428@forem.com>
2021-11-11 14:03:31 -05:00
Daniel Uber
14caad86a7
handle deleted article's comments page with a 404 response (#15351)
* Add a failing test for comments index of deleted article

After https://github.com/forem/forem/pull/15052 removed the (also
broken) deleted commentable template and the redirect, requests for
comments from deleted articles raise no method errors (initially
trying to set the page title to "Comments for commentable.title" but
the assumption that @commentable is non-nil is present in several
other places.

This test currently fails (by design). Either we want to update the
controller so that comments from deleted articles are no longer
viewable (returning not found, as we did prior to
https://github.com/forem/forem/pull/5199 or making the view safe for
the case where @commentable is nil and no @root_comment is present.

These requests are happening quite frequently (@maestromac and I
suspect the sitemap may contain these pages and crawlers are visiting
the site from a published link), as evidenced by
https://app.honeybadger.io/projects/66984/faults/81994265

* Add request spec for deleted article scenario

Additionally, relabel the legacy spec (updated during #15052) to
clarify we do not render the deleted_commentable_comment view (this is
testing the comment.path, rather than the article.path/comments index

The scenario with comment.path sets `@root_comment` in the controller,
so does not trigger errors on the `@commentable` method calls.

* Update view

pass 1: get the errors to stop (need to check the rendered page is
also usable, the comment tree is not shown when commentable is nil and
this might be a huge usability/correctness issue).

* extract logic from comments index to methods and update tests

We no longer expect deleted article's comments index to render (should
return 404), only direct links to comments of deleted articles.

Only assign @article in the index for the view if it is in fact an
article (not a podcast episode, it's possible `@root_comment` was for
a podcast episode).

* remove unneeded (and soon to be incorrect spec)

No longer want or need to test for the case where root comment is nil
and so is commentable. This was an exploratory spec (scaffolding) and
can be removed.

* Undo nil safety changes to comments index

and fix typo in comments spec
2021-11-11 12:56:14 -06:00
Julianna Tetreault
807e11b80c
Provide "Help" on the Creator Onboarding Setup Page (#15308)
* Adds a help icon to the creator settings setup page

* Moves the help icon styles from the a tag to the inline_svg_tag

* Removes reused class and aligns help icon to the right

* Refactors help icon out into a partial used across necessary views

* Moves .admin-help-button class from admin.scss to scaffolds.scss

* Adds further utility classes to align help icon as expected
2021-11-11 08:42:56 -07:00
Ridhwana
2e31b4ba02
Redirect to creator settings page where necessary (#15298)
* fix: closing divs and  alignments

* fix: closing divs, alignments and add z-elevate

* refactor: remove the confirm email css annd add it to setup_mode

* improve mobile responsiveness

* feat: redirect directly to the new_admin_creator_setting_path from the confirmation email adn the signup

* feat: update the test to no longer show the referral which seems no longer relevant

* fix: update the tests to conform to the new URLS

* update the link
2021-11-11 14:44:49 +02:00
Daniel Uber
8f7e0b1744
Let users purchase credits (#15346)
* Dark Theme preference is a user setting and not delegated

Resolves NoMethodError

* Add a view spec

This ensures the /credits/purchase page is rendered

* Test both styles based on user setting

Add an actual expectation to the view test
2021-11-10 15:18:52 -06:00
dependabot[bot]
8184b9b9ae
Bump view_component from 2.43.0 to 2.43.1 (#15345)
Bumps [view_component](https://github.com/github/view_component) from 2.43.0 to 2.43.1.
- [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.43.0...v2.43.1)

---
updated-dependencies:
- dependency-name: view_component
  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-11-10 11:29:17 -07:00
Daniel Uber
0a47910e30
Skip badge awards for spam accounts (#15344)
* Don't award badges to banished users

* Assert badges aren't created for spam accounts
2021-11-10 10:48:01 -06:00
yheuhtozr
f7474ed369
views/credits i18n (#15134)
* views/credits i18n

* remove ja.yml
2021-11-10 09:12:09 -06:00
Suzanne Aitchison
1dda5b4058
fix some prop type errors on the home page (#15314) 2021-11-10 13:47:55 +00:00
yheuhtozr
a6f08ae215
views/stories, views/layouts and other homepage i18n (#15083)
* views/stories and home related i18n

* PR key names fixes

* remove ja.yml

* Update en.yml

* Update fr.yml

* Update articles_search_spec.rb

* Update _meta.html.erb

* Update index.html.erb

* Update _meta.html.erb

* Update articles_search_spec.rb

text in HTML should not contain raw brackets

* Update articles_search_spec.rb

* Update _signup_modal.html.erb

* Add back missing Search text

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
2021-11-10 07:38:43 -06:00
Suzanne Aitchison
832d0d3a4d
Markdown toolbar: add 'undo' functionality (#15239)
* WIP - main formatters with undo syntax

* tests for new text area utils

* WIP: formatters undoing and formatting, tests to follow

* small tweak

* WIP - tweaks to heading

* add heading level tests

* refactor link formatting into separate functions, flesh out tests

* add missing test case, adjust link undo
2021-11-10 12:06:25 +00:00
Nick Taylor
dad0f9d4cc
Added a skip link for the admin area. (#15340) 2021-11-10 06:37:48 -05:00
Daniel Uber
eec738710b
Rerun migrate themes script (#15312)
Because of the way the the scripts to run works, there's always
already a script with this file name by the time this starts.

Remove the guard clause and let it run.
2021-11-09 10:38:17 -06:00
Michael Kohl
6b2160f307
Theming cleanup (#15237)
* Theming cleanup

* Fix specs

* Use correct method

* Update storybook theme switcher
2021-11-09 10:11:55 -05:00
Arit Amana
dcf1e08477
Remove chars-count from user fields; fix inconsistent loading (#15309)
* remove chars-count from user fields; fix inconsistent loading

* remove "if loaded" check

* simplify iteration
2021-11-09 08:27:18 -05:00
Ridhwana
04c7d61dd5
Update the Creator Settings Page (#15295)
* fix: closing divs and  alignments

* fix: closing divs, alignments and add z-elevate

* refactor: remove the confirm email css annd add it to setup_mode

* improve mobile responsiveness
2021-11-09 12:42:24 +02:00
dependabot[bot]
5c0fa0add7
Bump postcss-cli from 9.0.1 to 9.0.2 (#15303)
Bumps [postcss-cli](https://github.com/postcss/postcss-cli) from 9.0.1 to 9.0.2.
- [Release notes](https://github.com/postcss/postcss-cli/releases)
- [Changelog](https://github.com/postcss/postcss-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss-cli/compare/9.0.1...9.0.2)

---
updated-dependencies:
- dependency-name: postcss-cli
  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-11-08 14:36:40 -06:00
dependabot[bot]
7f2a163eee
Bump core-js from 3.19.0 to 3.19.1 (#15300)
Bumps [core-js](https://github.com/zloirock/core-js) from 3.19.0 to 3.19.1.
- [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.19.0...v3.19.1)

---
updated-dependencies:
- dependency-name: core-js
  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-11-08 13:55:54 -06:00