Commit graph

5723 commits

Author SHA1 Message Date
Michael Kohl
9c2d33bda0
Check Connect feature flag in more places (#14795) 2021-09-23 09:02:27 -05:00
Angel Barros
bb8b32bdf2
Zappat0n/add rate limit model everywhere 11500 (#14609)
* Create showModalAfterError function

* Show modal when comments rate limit is reached

* Show modal when article reaction rate limit is reached

* Show modal when follow user rate limit is reached

* Show form error when listing creation rate limit is reached

* Show form error when feedback messages rate limit is reached

* Rename functions for listings rate limit checks

* Show modal when notifications reaction rate limit is reached

* Show modal when picture upload rate limit reached

* Show modal for reactable objects when rate limit reached

* Add and modify tests

* empty commit

* Match modal messages to tests

* Fix error updating Modals

Co-authored-by: Dan Uber <dan@forem.com>
2021-09-23 10:49:19 +01:00
Keshav Biswa
086813afd4
Accessible names for follow buttons (#14687)
* added aria-pressed value to all follow_buttons

* added check to remove aria pressed attribute and added cypress tests

* removed unfollow aria-label setting and cypress test fixes

* fixed cypress failing tests

* failing cypress test fix

* added steps to check correct states are loaded when page refreshed

* refreshed alias after page reload
2021-09-22 10:34:34 +07:00
Josh Puetz
7f88e4a722
Add mutable flag to APNS notifcation payload (#14777) 2021-09-21 15:37:43 -05:00
Ridhwana
9d16aa0166
chcek if the element exists before calling onclick on it (#14785) 2021-09-21 18:34:49 +02:00
Spencer
234156de7d
Fix organization's admin unable to view an article's stats (#14767)
* update stats action in article_policy

* add rspec test
2021-09-21 16:05:34 +01:00
Michael Kohl
9f0dfa3181
Add internal top tags API (#14752)
* Add internal top tags API

* Add rules_html to tag API

* Move tags autocomplete to custom route

* Simplify spec

* Change route from autocomplete to suggest
2021-09-21 15:24:53 +01:00
Suzanne Aitchison
b7d63a6e8d
workaround getComputedStyle issues in all jest tests (#14737) 2021-09-21 10:52:54 +01:00
Suzanne Aitchison
634ec98f11
fix error adding removing tags from article mod tools (#14769) 2021-09-21 10:52:37 +01:00
ludwiczakpawel
987c48771c
padding fix (#14766) 2021-09-20 17:45:18 +02:00
Michael Kohl
75d1025023
No longer allow Connect messaging for listings (#14741) 2021-09-20 06:20:13 -04:00
Andy Zhao
e1606bcb0c
Move pin post to admin ✂️ (#14739)
* Update pin post button to be an admin articles button instead

* Rename file since we don't pin posts on show page

* Don't use instant click for admin link

* Update tests to visit the article from the start
2021-09-17 14:25:39 -04:00
ludwiczakpawel
e7af2bfc86
Little frontend refactor (#14755)
* profile dropdown update
* dropdown fixes
* preview cards fix
2021-09-17 16:23:51 +02:00
Daniel Uber
57561b1815
Check required inputs for apple authentication (#14750)
All providers except apple use a common key/secret form partial, but
the apple authentication section uses client_id, key_id, pem, and
team_id.

Assuming all four of these are required, when the enabled provider
name is 'apple', check for those values. For other providers (github,
facebook, etc) only check secret and key as before.
2021-09-17 07:39:53 -05:00
ludwiczakpawel
abd252315a
Style updates (#14736)
* style fixes

* remove nav headline

* fixes

* spec

* specs again

* specs... geeeeeeez
2021-09-17 08:47:45 +02:00
Michael Kohl
c7ba9d81db
Clean up feed-related code (#14707)
* Start cleaning up feed code

* Move published_articles_by_tag to service

* Add timeframe and latest feed services

* fixup! Move published_articles_by_tag to service

* Move constant to correct location

* Fix spec
2021-09-17 09:23:32 +07:00
ludwiczakpawel
0b547bf8cd
Tabs (#14738)
* sliding tabs

* Add aria-label to the navigation

This supports the cypress tests, as well as retaining existing accessibility features.

* Adapt feedNavigation cypress test to handle new navigation layout

Before looking for week, month, year, or infinity top feeds, select
"Top" and wait for the page refresh.

* increasing tappable area + making foucs outline visible

Co-authored-by: Dan Uber <dan@forem.com>
2021-09-16 21:42:55 +02:00
Daniel Uber
7147ae4053
Use a textarea for apple_pem in admin (#14744)
* Since we're pasting a multi-line key, use a textarea for apple_pem

* Update app/views/admin/settings/forms/authentication/_apple_auth_provider_settings.html.erb

set style on pem input to show expected input size.

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
2021-09-16 12:56:57 -05:00
Ridhwana
69b4c6c5e3
Fix Forem Ownership Field (#14730)
* fix: mistakenly renamed forem_owner_secret to owner_secret

* chore: revert change from merge

* refactor: use the Forem Instance model

* extra .
2021-09-16 06:56:59 -04:00
Arit Amana
aa5f18b234
Admin Save Confirmation - Removing Badge Achievements (#14684)
* schema file undelete description

* update with main

* update with origin

* update

* create controller; hook up to badge_achievements

* almost done with implementation

* push up what I have

* complete implementation; generalize snackbar usage

* start writing tests

* add confirmation text entry step to test

* Fix delete via JS

* implement danger notice for errors

* complete cypress test

* create ErrorAlert CustomEvent and implement

* fix failing badge_achievements spec

* start applying PR review changes

* hook up Preact Modal

* fix cypress tests

* remove old comment

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

* consolidate messaging functions

Co-authored-by: Michael Kohl <citizen428@forem.com>
Co-authored-by: Nick Taylor <nick@forem.com>
2021-09-15 21:25:01 -04:00
ludwiczakpawel
f1c8de4024
Shortcut for "Following tags" (#14708)
* following tags shortcut

* rails helper
2021-09-15 20:54:18 +02:00
Alex
a024efcc45
Add display_in_directory setting (#14733)
* Add display_in_directory setting

* Remove setting from constants

* Update spec to use change
2021-09-15 13:34:31 -04:00
Mac Siri
94d2261d42
Remove #sanitize_and_decode (#14727) 2021-09-15 11:05:06 -04:00
Andy Zhao
84d931136e
Fix bug where OAuth signups were not pulling in OAuth provider's profile image (#14711)
* Use regex to replace with https

* Refactor a bit

* Update logic to handle edge cases

* url being nil
* url not a valid URL (weak validation, checks for starting
string of http)

* Add new test case for http to https conversion
2021-09-14 22:13:16 -04:00
Daniel Uber
21e9966ccb
Relax tag validation restriction to permit non-ascii strings (#14710)
* Relax tag validation restriction to permit alphanumeric strings

Non-word symbols like musical notes are still blocked, but most
languages should work.

* Handle redirect after tag edit

The URI.parse(tag.name) was not updated in #13720

Move reused logic into tag_path method in URL module.

* FactoryBot generated tags are non-ascii

This should help expose any cases where we're mistakenly counting on
ascii-only content in tags by causing all generated tags without a
specified name to be of the form `tag你好#{n}` instead of `tag#{n}`.

* Revert "FactoryBot generated tags are non-ascii"

This reverts commit ed1035cd1e91619b2c1599e521b6ddf962c97f80.

It was useful to see how many places the path knowledge is in the
tests (a lot of requests have GET /t/tag.name and need to have GET
URL.tag_path instead).

https://app.travis-ci.com/github/forem/forem/builds/237542600 has the
results.

Reverting because those test-side changes seem like a secondary
concern to the change in this PR (I'll file a follow on issue)
2021-09-14 14:03:54 -05:00
Alex
d6a1b16a45
Add context to Instance API (#14731) 2021-09-14 13:09:20 -04:00
dependabot[bot]
f0700b2588
Bump jest from 26.6.3 to 27.2.0 (#14722)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-09-14 11:20:15 -04:00
Michael Kohl
a32b50d46c
Make Rubocop happy again (#14729) 2021-09-14 09:15:01 -05:00
ludwiczakpawel
d6aa9e058b
Forem background (#14700)
* forem background styles

* cleanup

* layout updates

* couple fixes

* cypress
2021-09-14 14:47:48 +02:00
Michael Kohl
099b4672ad
Don't try to create invalid RatingVote (#14706) 2021-09-14 09:41:59 +07:00
Josh Puetz
ed1731fd95
Change mobile new comment notification text and add sound (#14678) 2021-09-13 11:15:58 -05:00
Michael Kohl
0aa27f3d1e
Refactor profile refreshing (#14643)
* Refactor profile refreshing

* Fix guard in ProfileFields::Remove

* Add more comments to Profile

* Fix typo

* Rephrase comment

* Fix regular expression

* Clean up Profile

* Fix remove spec

* Also remove setter from store accessors

* Remove RUBY_THREAD_VM_STACK_SIZE workaround

* Travis, wake up
2021-09-13 12:15:04 -04:00
Daniel Uber
324265e24e
Handle GibbonError when Mailchimp api key was not set (#14695)
* When an api key was not set - handle gibbon error as mailchimp error

see https://app.honeybadger.io/projects/72638/faults/73753178

It's possible the right answer is instead to either (1) not make the
call at all (2) not log as a mailchimp error but treat distinctly

* Only report error if GibbonError, don't attempt to resubscribe

Separate the rescue blocks since resubscribing doesn't make sense if
we're handling a gibbon error rather than a mailchimp error

* Add test for gibbon error being raised (and rescued)

Copied the existing test specifying that resubscribe is attempted on a
raised mailchimp error.

* Remove irrelevant resubscribe check - assert error is handled only
2021-09-13 10:30:35 -05:00
Michael Kohl
c946d0bf6b
Add feature flag for Connect (#14644)
* Add feature flag for connect

* Start using Connect feature flag

* Add feature flag check to plaintext mailers

* Minor fixes/formatting issues

* Fix typo

* Enable Connect feature flag for tests

* Fix feature flag in tests

* Update rails_helper

* Fix typo

* (╯°□°)╯︵ ┻━┻

* One more try

* connect announcement

* Use connect feature flag in admin and admin routes

* Add aria-live attribute to announcement

* Undo schema.rb changes

Co-authored-by: Paweł Ludwiczak <ludwiczakpawel@gmail.com>
2021-09-13 10:45:56 -04:00
ludwiczakpawel
f2f2c34673
3d drop shadows (#14701)
* remove 3d box shadow

* profile cards fixes

* little fix

* dark mode + listings modal

* dropdowns padding

* whoops
2021-09-13 11:02:53 +02:00
ludwiczakpawel
00ce30e636
Warmer shades of grey (#14665)
* warmer grey
2021-09-09 21:35:51 +02:00
Suzanne Aitchison
ba7fa0ad11
add temporary ahoy stats for tag sidebar clicks (#14688) 2021-09-09 08:31:27 -05:00
VISHAL DEEPAK
c88f8dcdaa
In dashboard show api eager load collection with articles (#14677)
* In dashboard show api eager load collection with articles

* Dashboard Article Row view now loads collection to suppress bullet warning of eager loading
2021-09-09 11:11:03 +01:00
Fernando Valverde
a3da4f9bc4
Remove outdated notice (#14679) 2021-09-08 14:46:34 +02:00
Keshav Biswa
42c9a10f57
Accessible names for follow buttons (#14389)
* added follow hidden tags for accessibility

* fixed failing tests

* replaced hidden span with screen-reader-only with aria-label

* add aria-label dynamically to follow buttons

* fixed followButtons

* fixed cypress tests and updated addAriaLabelToButton helper

* Fixed failing tests

* fixed failing tests

* Update cypress/integration/seededFlows/notificationsFlows/followUserFromNotifications.spec.js

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

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-09-07 16:09:06 +01:00
Arit Amana
877cb5c322
Save Confirmation - Admin (Part 1 of 2) (#14418) 2021-09-02 11:49:05 -04:00
Fernando Valverde
49efd6e41d
Removes target=_blank and small banner redirect tweak (#14548) 2021-09-01 08:27:24 -06:00
Suzanne Aitchison
dcecc8bf00
Log prop-types warnings to console in development (#14635)
* enable debug for warnings in dev env

* remove preact/devtools call no longer needed

* fix majority of proptype errors on home page

* sweep up proptype errors from listings page

* fix article form error
2021-09-01 09:27:58 +01:00
Fernando Valverde
e45b6c5ab2
Adds validations to avoid creating unnecessary PNs (#14621)
* Adds validations to avoid creating unnecessary PNs

* Fix conditional + add tests

* Trigger CI

* Trigger CI

* Add missing rpush mock in spec

* Mock before testing d'oh

* Extend ability to mock rpush in helpers

* Remove unnecessary user3 from spec
2021-08-31 15:00:30 -06:00
Michael Kohl
e59fccabb3
Only tech admins can manage page feature flags (#14618) 2021-08-31 15:35:42 -04:00
Jamie Gaskins
94841d5934
Remove Database.table_available? (#14639)
ActiveRecord already implements this at the model level and also makes
use of the ActiveRecord schema cache. `Database.table_available?` did
not use this query cache and ended up sending *all* of those queries to
Postgres every single time.
2021-08-31 13:53:34 -04:00
Suzanne Aitchison
89632249bd
make sure input can scroll into view on mobile (#14619) 2021-08-31 08:11:00 +01:00
Manoj Naidu
909f5ae263
Fixed button styling (#14617) 2021-08-31 08:09:40 +01:00
Michael Kohl
baa94a0abd
Various cleanups (#14616)
* Remove unused constant

* Remove unused column from OrganizationMembership

* Remove outdated comment

* Remove references to no longer existing roles

* Remove legacy service worker code

* Remove duration_in_seconds_column from podcast_episodes

* Remove app_bundle from devices
2021-08-31 09:17:24 +07:00
Suzanne Aitchison
3b67810b9d
Add support for JSX copy paste in Storybook (#14591)
* add support for JSX and HTML copy paste

* remove html addon, refactor dropdown story

* undo html addon settings
2021-08-30 09:36:01 +01:00