Commit graph

9282 commits

Author SHA1 Message Date
Monica Mateiu
dbdd24c729
add org analytics menu if user has organizations (#13995)
* add organizations menu to analytics page

* Update app/views/dashboards/analytics.erb

Co-authored-by: rhymes <github@rhymes.dev>

* replace querySelector with getElementsByClassName for better performance

* Update app/javascript/packs/analyticsDashboard.js

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

* Update app/views/dashboards/analytics.erb

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

* refactor analytics view and add specs

* skip flakey analyticsNavigation spec

Co-authored-by: rhymes <github@rhymes.dev>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-06-23 14:35:23 +02:00
Julianna Tetreault
281fdc499c
[15-Minute Fix] Fix Broken Admin Tags #create and #update Forms (#14049)
* Adds name to ALLOWED_PARAMS in Admin::TagsController

* Adds local: true to /admin/tags/_form.html.erb
  - Sets local: true in tags partial for proper
redirects and to properly render flash messages
for both the #create and #update actions

* Adds local: true to the Add Moderator button for tags

* Adds and updates systems specs for tags
  - Updates the admin_updates_tag_spec.rb system spec
  - Adds an admin_creates_new_tag_spec.rb system spec
  - Updates the success flash message in Admin::TagsController
2021-06-23 14:30:17 +02:00
Julianna Tetreault
6b0d2b6173
Uncomments line 26 in admin_manages_organizations_spec.rb (#14051) 2021-06-23 09:22:59 +02:00
Meg Gutshall
ef474fd919
LinkTag: correctly display organization avatar (#13928)
* Set up Docker

* Add conditional to render org logo with user avatar

* Create styling for logo with avatar

* Update app/views/articles/_liquid.html.erb

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

* Update app/views/articles/_liquid.html.erb

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

* update rspec test

* Restore schema.rb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Michael Kohl <me@citizen428.net>
2021-06-23 10:25:29 +07:00
Mac Siri
3b20edc944
Resolve sitemap's undefined variable (#14050) 2021-06-22 16:18:21 -04:00
Andy Zhao
7d3bf4b753
[15-min-fix] Ensure mention worker delivers email (#14038)
* Ensure mention worker delivers email

* Fix spec to appropriately check if mailer was touched
2021-06-22 14:29:56 -04:00
Michael Kohl
f03d56c8c9
Remove badge notice from /settings/profile (#14019) 2021-06-22 14:27:39 -04:00
dependabot[bot]
f24d3d157f
Bump rubocop-rails from 2.10.1 to 2.11.0 (#14043)
* Bump rubocop-rails from 2.10.1 to 2.11.0

Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.10.1 to 2.11.0.
- [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.10.1...v2.11.0)

---
updated-dependencies:
- dependency-name: rubocop-rails
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Enable new cops and fix violations

* Remove expected string literal

As we're passing a block (that yields a string) there are no arguments
to the debug call.

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: rhymes <github@rhymes.dev>
Co-authored-by: Dan Uber <dan@forem.com>
2021-06-22 11:25:28 -05:00
Suzanne Aitchison
a64611c03e
disable message options spec (#14047) 2021-06-22 16:46:40 +01:00
Jamie Gaskins
f17d808cec
Fix sitemap for self host, including memory leak (#14036)
* Only load Rake tasks once

* Use local sitemap if AWS credentials are not set

* Leave generated sitemaps out of git
2021-06-22 11:11:08 -04:00
Suzanne Aitchison
d448abae19
remove instantclick change listener on analytics dashboard (#14046) 2021-06-22 16:00:07 +01:00
Suzanne Aitchison
546e64a029
Always show preview card on hover (#14032)
* always show preview on hover

* avoid use of important
2021-06-22 15:56:07 +01:00
dependabot[bot]
d1c32b4e12
Bump rails-settings-cached from 2.5.2 to 2.6.0 (#14042)
* Bump rails-settings-cached from 2.5.2 to 2.6.0

Bumps [rails-settings-cached](https://github.com/huacnlee/rails-settings-cached) from 2.5.2 to 2.6.0.
- [Release notes](https://github.com/huacnlee/rails-settings-cached/releases)
- [Changelog](https://github.com/huacnlee/rails-settings-cached/blob/main/CHANGELOG.md)
- [Commits](https://github.com/huacnlee/rails-settings-cached/compare/v2.5.2...v2.6.0)

---
updated-dependencies:
- dependency-name: rails-settings-cached
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Empty commit for travis

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dan Uber <dan@forem.com>
2021-06-22 08:52:24 -05:00
dependabot[bot]
bde3ebda8b
Bump @babel/preset-env from 7.14.4 to 7.14.7 (#14044)
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.14.4 to 7.14.7.
- [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.14.7/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  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-06-22 13:21:25 +01:00
dependabot[bot]
767e1efdfe
Bump core-js from 3.14.0 to 3.15.0 (#14026)
Bumps [core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js) from 3.14.0 to 3.15.0.
- [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/commits/v3.15.0/packages/core-js)

---
updated-dependencies:
- dependency-name: core-js
  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-06-22 13:15:58 +01:00
dependabot[bot]
49e53bb817
Bump @babel/core from 7.14.3 to 7.14.6 (#14024)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.14.3 to 7.14.6.
- [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.14.6/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  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-06-22 12:18:50 +01:00
rhymes
a9e7bc4361
Reading list: fix broken pagination (#14031) 2021-06-22 08:24:23 +02:00
dependabot[bot]
e56009bcda
Bump set-getter from 0.1.0 to 0.1.1 (#14039)
Bumps [set-getter](https://github.com/doowb/set-getter) from 0.1.0 to 0.1.1.
- [Release notes](https://github.com/doowb/set-getter/releases)
- [Commits](https://github.com/doowb/set-getter/commits/0.1.1)

---
updated-dependencies:
- dependency-name: set-getter
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-22 08:23:11 +02:00
Michael Kohl
7fe5c54161
Consistently use ForemInstance.private? (#14021) 2021-06-22 08:16:19 +07:00
Mac Siri
7ba3c3a81c
Add container tag expiration (#14040) 2021-06-21 19:41:10 -04:00
dependabot[bot]
5a75e303bd
Bump acts-as-taggable-on from 8.0.0 to 8.1.0 (#14027)
Bumps [acts-as-taggable-on](https://github.com/mbleigh/acts-as-taggable-on) from 8.0.0 to 8.1.0.
- [Release notes](https://github.com/mbleigh/acts-as-taggable-on/releases)
- [Changelog](https://github.com/mbleigh/acts-as-taggable-on/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mbleigh/acts-as-taggable-on/compare/v8.0.0...v8.1.0)

---
updated-dependencies:
- dependency-name: acts-as-taggable-on
  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-06-21 10:13:00 -05:00
Suzanne Aitchison
1a417174c3
Profile Preview Cards (RFC #222): Article page author byline (#13990)
* move current profile card content to shared view, create profile preview card shared view

* article page: show link in small screens, button with preview card in larger

* initialize the hover and click functionality

* tweak class names

* make sure modals sit at highest elevation level

* add cypress tests

* add a test to make sure mobile view unaffected

* make sure follow buttons initialized in test before asserting on them
2021-06-21 08:38:47 +01:00
Julien Maury
aba55f2a77
stories list script as separate js file - defer attribute (#13993)
* stories list script as separate js file - defer attribute

* change name storiesListScript for storiesList

* remove legacy function hasClass()

* add description to js pack

* remove case that triggers nothing

* Revert "remove case that triggers nothing"

 the if statement is on the element not its parents

This reverts commit f4402f5456e15da122f9820917f5965a1ebc50a4.

* remove deprecated code from storiesList pack

* remove unused code
2021-06-21 10:59:30 +07:00
Supritha
f67e6d01d9
Fixed typo 'SlideSare' (#14011) 2021-06-21 09:39:16 +07:00
Michael Kohl
23fe4dd9de
Clean up forem:setup task (#13998) 2021-06-18 09:34:18 +07:00
Michael Kohl
8f42828028
Change signature of Feeds::ImportArticlesWorker (#13971) 2021-06-17 14:28:23 -04:00
Michael Kohl
68a34f4015
Remove navigation links from footer on private Forems (#14006) 2021-06-17 15:01:02 +00:00
Suzanne Aitchison
6146fcd56b
15 min fix - only initialise article buttons once (#14007) 2021-06-17 14:59:45 +02:00
Jamie Gaskins
d946b9fdc3
Don't use Honeycomb test mode in production (#13997)
* Don't use Honeycomb test mode in production

* Treat an empty Honeycomb API key the same as nil

* Avoid repeated RELEASE_FOOTPRINT warnings
2021-06-16 16:18:58 -04:00
dependabot[bot]
08720a69c4
Bump peter-evans/create-or-update-comment from 1 to 1.4.5 (#13740)
Bumps [peter-evans/create-or-update-comment](https://github.com/peter-evans/create-or-update-comment) from 1 to 1.4.5.
- [Release notes](https://github.com/peter-evans/create-or-update-comment/releases)
- [Commits](https://github.com/peter-evans/create-or-update-comment/compare/v1...v1.4.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-16 08:57:36 -06:00
dependabot[bot]
dc8e061861
Bump rubocop from 1.16.1 to 1.17.0 (#13999)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.16.1 to 1.17.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.16.1...v1.17.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-06-16 07:53:15 -06:00
rhymes
ff3be35d6e
API: Remove orphan Admin Config jbuilder file (#13953) 2021-06-15 18:18:52 +02:00
rhymes
686965c9ff
[15 min fix] Refactor private landing pages model code (#13982)
* Add LandingPage domain model

* Rely on Rails data integrity and remove previous code

* Remove superfluous equality check

* Restore landing_page class method

* Add and fix specs

* Do not attach landing page modal controller unnecessarily
2021-06-15 18:17:15 +02:00
Julien Maury
3f7ef05a9d
include extra space when adding attr aria curent (#13991) 2021-06-15 11:02:20 -05:00
rhymes
43f84c12ef
Send Devise emails asynchronously (#13985)
* Change send_devise_notification to deliver later

* Add tests to invitation emails

* Fix spec
2021-06-15 07:50:34 -06:00
Fernando Valverde
c347efd11b
Use navigator.share on mobile devices (#13809)
* First commit

* Standardize Runtime Filters to use -only suffix

* Always present native share option if available

* Reorder native share option

* Remove unused Desktop-only CSS rule

* Adding ahoy (first commit)

* Add Ahoy stats

* Trigger Travis

* Add optional chaining

* Move ahoy stat collection to different component

* Coverage threshold update

* Add missing Desktop-only CSS rule that was missing

* Add assert in Cypress test

* Apply review feedback

* Isolate navigator.share related assertions

* Fix tests

* Test

* Update app/javascript/packs/articlePage.jsx

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

* Isolate tests in separate spec

* Fix tests (fingers crossed)

* Remove changes to unchanged spec

Co-authored-by: Nick Taylor <nick@forem.com>
2021-06-15 06:39:33 -06:00
Suzanne Aitchison
af517bc5aa
Optimise dropdowns for accessibility: Preact component usages (#13948)
* use the dropdown initializer in post editor options

* use dropdown initializer in comment subs dropdown

* use Dropdown component in listings

* show the dropdown button when it's focused

* update storybook notes and components

* add cypress tests for post options dropdown

* add comment subscription tests

* make sure page is properly initialized before setting button functionality

* add jsdoc comments, props types, rely on optional chaining

* Update app/javascript/crayons/Dropdown/__stories__/dropdowns.md

Co-authored-by: rhymes <github@rhymes.dev>

* Update app/javascript/crayons/Dropdown/__stories__/dropdowns.md

Co-authored-by: rhymes <github@rhymes.dev>

Co-authored-by: rhymes <github@rhymes.dev>
2021-06-15 12:06:27 +01:00
Julien Maury
f7cc60e84f
fix usage of aria current - html error (#13963)
* fix usage of aria current - html error

* delete tests for aria current empty value

* delete tests for aria current empty value - tag nav

* missing occurrences should have attr aria current

* e2e tests: make sure other nagivation items do not have attr aria-curent

* e2e tests (tagged nav): make sure other nagivation items do not have attr aria-curent

* missing case @latest

* @latest is only for tagged nav

* every single nav item needs the test for aria-current
2021-06-15 12:06:17 +01:00
Suzanne Aitchison
2f356dd3a4
[15 min fix] Improve reliability of profile dropdown test (#13986)
* wait for profile init

* complete logged out tests first

* add comment
2021-06-15 11:46:18 +01:00
Suzanne Aitchison
e0798b88e0
Message context menu in connect is not accessible #12250 (#13806)
* make connect message dropdown accessible

* add a cypress test

* use crayons buttons throughout

* fix some unhandled error affecting cypress

* make message options a list

* minor tweak to test

* guard against filter error being triggered in test

* utilise newer dropdown helpers

* wait for message to fully send

* use optional chaining
2021-06-15 11:13:31 +01:00
dependabot[bot]
a26925dfd9
Bump oj from 3.11.5 to 3.11.6 (#13984)
Bumps [oj](https://github.com/ohler55/oj) from 3.11.5 to 3.11.6.
- [Release notes](https://github.com/ohler55/oj/releases)
- [Changelog](https://github.com/ohler55/oj/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/ohler55/oj/compare/v3.11.5...v3.11.6)

---
updated-dependencies:
- dependency-name: oj
  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-06-15 14:09:49 +07:00
dependabot[bot]
3e3c9607ff
Bump redoc-cli from 0.11.4 to 0.12.1 (#13975)
Bumps [redoc-cli](https://github.com/Redocly/redoc) from 0.11.4 to 0.12.1.
- [Release notes](https://github.com/Redocly/redoc/releases)
- [Changelog](https://github.com/Redocly/redoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Redocly/redoc/commits)

---
updated-dependencies:
- dependency-name: redoc-cli
  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-06-15 07:28:25 +02:00
Michael Kohl
0d193ab75c
Refactor admin settings view into partials (#13950)
* Reactor admin settings view into partials

* Fix Stimulus problem

* Add SMTP partial
2021-06-15 10:30:24 +07:00
Michael Kohl
974266a610
Refactor credit purchasing (#13955)
* Refactor credit purchasing

* Add comment about legacy API

* Re-arrange steps
2021-06-15 09:04:51 +07:00
Mac Siri
aba6033d9b
Revert dynamic email config changes (#13983)
* Add missing clear_cache in spec

* Fix broken spec

* Temporarily bring back old config

* Disable specs
2021-06-14 13:08:24 -04:00
Andy Zhao
ffc0bcd345
Remove check for blank mailchimp newsletter ID (#13966) 2021-06-14 12:07:02 -04:00
Daniel Uber
8158ea3cd2
Use a counter and append the index to make sure slugs are unique (#13981)
There's a unique index page on slugs that failed today during a PR
merge, where 'et' was the `Faker::Lorem.word` selected both times.

Add a suffix to the generated word to ensure these are unique and an
index collision doesn't happen.
2021-06-14 09:55:12 -05:00
Mac Siri
e38196df6f
Create Settings::SMTP (#13943)
* Fix typo

* Add SMTP configs to Settings::General

* Expand Settings's show page

* Expand Settings::General's constants

* Move smtp_enabled? logic to ApplicationMailer

* Apply suggestions from code review

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

* Add missing descriptions and placeholders

* Remove production guard clause

* Change delivery_method to a callback

* Create Settings::SMTP

* Run migration

* Move constants

* Remove SMTP from Settings::General

* Create SMTPSettingsController

* Add back guard clause

* Change which perform_deliveries configuration to use from

* Update config/environments/production.rb

* Rename migration to singular

* Run migration again

* Fix name

* Alphabetize and add validation for authentication

* Move settings and enabled? logic to Settings::SMTP

* Change after_action to before_action

* Fix broken spec

* Fix broken spec

* Create SMTP specs

* Provide default for port

* Create spec for ApplicationMailer

* Fix broken spec

* Move smtp_enabled?

* Search and replace

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2021-06-14 10:29:43 -04:00
Takuma
7e969fa682
Call subscribe_to_mailchimp_newsletter after the transaction is commited (#13969)
* Call subscribe_to_mailchimp_newsletter by after_commit instead of after_save

* s/save/commit
2021-06-14 16:05:46 +02:00
Fernando Valverde
e37346845d
Revert "Bump jest-watch-typeahead from 0.6.3 to 0.6.4 (#13973)" (#13980)
This reverts commit f10a538498.
2021-06-14 16:05:36 +02:00