Commit graph

982 commits

Author SHA1 Message Date
Arit Amana
8cbbc222e9
Heavy Confirmation Flow for Broadcast-Destroy (#14819)
* hook up frontend parts

* complete backend, save success alert issues

* fix broken existing specs

* complete snackbar confirmation on page redirect

* rollback success alert; but leave foundation for it in place

* preserve a11y features of snackbar; complete cypress tests

* test redirect after braodcast destroy
2021-09-29 07:43:00 -04:00
Ben Halpern
036d75aa6e
Admin-configurable display locale (#14620)
* Admin-configurable display locale

* Add i18n-js and namespacing

* Basic tests and clean up

* A few test adjustments

* Update vendor cache

* Fix a few tests

* Fix a few tests

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

Co-authored-by: Michael Kohl <citizen428@dev.to>

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

Co-authored-by: Michael Kohl <citizen428@dev.to>

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

Co-authored-by: Michael Kohl <citizen428@dev.to>

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

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update app/views/comments/_comment_header.html.erb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update app/views/layouts/_sidebar_tags.html.erb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update app/views/listings/index.html.erb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update spec/system/homepage/user_visits_homepage_articles_spec.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update spec/system/user/view_user_index_spec.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Alphabetical locale page

* Add activerecord custom validation error translations

* Add i18n to webpacker

* Fix a few tests

* Adjust error messages

* Add i18n-tasks

* Adjust JS to get working with jest

* Adjust the way translations are pulled in

* Adjust jest tests

* Remove time localization

* Remove superfluous public js

* Add basic tests for i18n application controller

* Remove unnecessary content

Co-authored-by: Michael Kohl <citizen428@dev.to>
2021-09-28 11:04:35 -04: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
Ridhwana
9d16aa0166
chcek if the element exists before calling onclick on it (#14785) 2021-09-21 18:34:49 +02: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
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
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
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
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
Suzanne Aitchison
ba7fa0ad11
add temporary ahoy stats for tag sidebar clicks (#14688) 2021-09-09 08:31:27 -05: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
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
Suzanne Aitchison
bfb4f00aae
Add copy to HTML feature for storybook (#14599)
* Add copy to HTML feature for storybook, inc fix for article markup

* remove html stories no longer needed
2021-08-27 16:09:21 +01:00
Nick Taylor
e0ee5e71f4
Some eslint fixes. (#14605) 2021-08-27 08:37:09 +01:00
Nikhil Taneja
ff008e4702
#12643 Add eslint rule for formatting redundant curly braces in jsx (#14592) 2021-08-26 11:15:06 -04:00
Suzanne Aitchison
e40a49e7f1
Fix error adding and removing tags as mod (#14566)
* fix error adding and removing tags

* fix login modal test

* remove unneeded property

* fix followtag spec
2021-08-24 13:44:21 +01:00
Ridhwana
5827be4ecc
RFC 190: Forem Creator Signup Page (#13875)
* chore: add my name to the chaore so that I can search after cleanup

* feat: update the forem creator signup template and copy over some stuff from the email_resgistration

* feat: update the fields

* feat: make sure that it saves

* feat: add an eye svg to the password input

* feat: update eye and eye-off svg

* feat: update the placeholder for the password field

* reveak and hide the password when clicking on the icon

* eye visiblibility functionality

* feat: display the username

* feat: show the username row when we click edit

* feat: update the interaction design

* chore: remove extra line

* chore: remove unneeded function

* feat: never show the username hint when the user field is not hidden

* feat: ensure that the username works

* chore: update the existing specs

* feat: move to packs

* refactor: manage the visibility with a avariable and not with the password type

* optimize the way we use password visibility

* chore: validate the username field

* chore: update the statement

* feat: add a background

* feat: accessibility changes

* feat: set a max length on the username

* feat: some more accessibility changes

* feat: validate the length of the password

* chore: add some margin to the error box

* feat: by_email shows the error states and we should cater for the Forem Creator

* feat: tackle any errors

* WIP/test: first pass of some integration specs

* feat: update the Cypress tests

* Update app/views/shared/authentication/_forem_creator_signup.html.erb

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

* Update app/views/shared/authentication/_forem_creator_signup.html.erb

Co-authored-by: Michael Kohl <me@citizen428.net>

* chore: temporarily disable the background on large screens

* chore: remove title

* prevent default

* feat; update the style of the button

* feat: update the tests to use accessibility tags

* feat: update icons

* chore: oops

* little forntend updates

* Update app/views/shared/authentication/_forem_creator_signup.html.erb

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

* Update cypress/integration/creatorOnboardingFlows/creatorSignup.spec.js

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

* fea: change the aria label and pressed

* feat: change to just John

* feat: update  cypress tests

* test if this is causing the test to fail

* feat: add some margin

* feat: mostly for Cypress - required is true or false based on whether the field is needed

* refactor: use the password label and skip last test

* Update app/views/shared/authentication/_forem_creator_signup.html.erb

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

* Update app/views/shared/authentication/_forem_creator_signup.html.erb

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

* fix: do not toggle  the label (accessibility)

* fix: add a comma

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Michael Kohl <me@citizen428.net>
Co-authored-by: Paweł Ludwiczak <ludwiczakpawel@gmail.com>
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
2021-08-24 10:33:26 +02:00
Andy Zhao
3b81172c56
Remove docs from repo ✂✂✂ (#14579)
* Remove docs ✂✂✂✂

* Remove all references to docs and gitdocs

* Update docs.forem.com to developers.forem.com

* Remove .gitdocs_build/

* Update yarn.lock
2021-08-23 17:23:42 -04:00
Suzanne Aitchison
f49a6ce6d5
Revise editor publish logic (#14546)
* revise publish logic

* refactor arguments
2021-08-20 09:04:11 +01:00
Michael Kohl
2b0f2bd0d4
Add bio to onboarding (#14544) 2021-08-20 09:39:01 +07:00
Fernando Valverde
5d4475549b
Remove ahoy from Share Post dropdown (#14537) 2021-08-19 08:37:58 -06:00
Fyodor
56669ec8f6
Make listing details modal close on internally-triggered navigation (#14504)
* Refactor category selection handler

* Provide a way to close modal if it's open

* Trigger Travis CI

* Add e2e test case for the fixed scenario

Co-authored-by: rhymes <github@rhymes.dev>
2021-08-18 16:46:35 +02:00
ludwiczakpawel
c2eb33caf3
Replace EmojiOne with Twemoji (#14517) 2021-08-17 21:29:21 +02:00
rhymes
7ff882b8ce
Refactor Admin Member Detail view - Tools section (#14283)
* Test with Grid layout

* Use Flexbox

* Replace with utility classes

* Wire up Tools -> Emails

* Stash: will rebase with a better commit message

* Fix transition between Email and Tools component

* Refactor Verify Email Ownership button a bit

* Use respond_to for verify_email_ownership

* Wrap the Preact Snackbar controller in Stimulus and use it from users/tools/email_controller

* Add HTML5 validation to EmailComponent

* Validation and cleanup

* Add Email history list and fix styling

* Additional styling cleanups

* Add error handling

* Close panel after email operations

* Actually use <local-time> GitHub time element correctly

* Add specs for Tools component and controller

* Email to Emails

* Add tests for Admin::Users::Tools::EmailsComponent

* Fix bug with ToolsComponent instantiation in ToolsController

* Add notes to show page

* Add ToolsComponent css

* Use Rails UJS instead of manual Stimulus to connect remote helpers

* Make Notes section come alive by adding its code

* Make Credits section come alive by adding its code

* Go back to vertical flex

* Finalize small restructuring of credits code

* Simplify ToolsComponent instantiation

* Add basic Add user to org functionality

* Make update user permissions form work

* Make remove user from org work

* Use generic Stimulus AjaxController to cleanup code

* Use Stimulus AjaxController for NotesComponent

* Use Stimulus AjaxController for CreditsComponent

* Use Stimulus AjaxController for OrganizationsController

* Add Admin::Users::Tools::ReportsComponent

* Do not display snackbar message if there is no message

* Add Admin::Users::Tools::ReactionsComponent

* Fix EmailsComponent spec

* Add CreditsComponent tests

* Fix quotes

* Add OrganizationsComponent specs

* Add ReportsComponent spec

* Add ReactionsComponent spec

* Fix rubocop violation

* Fix ToolsComponent specs

* Remove unused variable

* More tests

* Use keyword argument for ToolsComponent

* Fill in Tools requests specs

* Use Rspec shared_examples for ToolsController and EmailsController

* Add tests for Admin::Users::Tools::CreditsController

* Add tests for Admin::Users::Tools::NotesController

* Add tests for Admin::Users::Tools::OrganizationsController

* Add tests for Admin::Users::Tools::ReactionsController and ReportsController

* Fix bugs and add tests to Admin::OrganizationMembershipsController

* Add comments to deprecated sections of the UsersController

* Fix bugs and add tests to Admin::UsersController #send_email and #verify_email_ownership

* Add User model tests

* Feature flag fixes

* Add Cypress Tools - Emails tests

* Add Cypress Tools - Notes tests

* Add Cypress Tools - Credits tests

* Add Cypress Tools - Organizations tests

* Add Cypress Tools - Reports and Reactions tests

* Mark the replace target as a polite region

* Update view_component gem

* Tiny fixes

* Fix spec

* Wrap component rendering in render_component

* Move user.related_negative_reactions to a Reaction scope

* Move user.reports to a FeedbackMessage scope

* Move user.last_verification_date as EmailAuthorization class method

* Revert encapsulation to private

* Fix boxes backlinks names

* Add keyboard focus styling to boxes

* Remove duplicate styling

* Remove duplicated header element

* Improve heading hiearchy

* Fix <legend> and labels

* Backlink should be Tools not Users

* Announce section change to screen reader and fix focus

* Fix specs

* Add focus style for backlinks

* Enable email sending in e2e mode

* Use Settings instead of env variable
2021-08-17 18:55:53 +02:00
Suzanne Aitchison
a6b4d8e91d
Create crayons mobile drawer components (#14495)
* add MobileDrawer component

* WIP begin navigation component

* rough working version complete

* update story to allow for actual navigation

* add component tests

* add docs

* add HTML variants

* add a max width to the drawer
2021-08-16 08:41:26 +01:00
payapula
52346188c4
Fixes #13601 - Storybook redirects off page (#14491) 2021-08-13 08:18:44 -04:00
Suzanne Aitchison
80096f63a7
Add author profile preview cards to feed (#14340)
* Add the preview card to logged out feed initial content

* initialise the initial dropdowns added on the logged out feed

* minor tweak to selector

* flip the follow button and the summary

* add minimal preview card to build article HTML

* WIP: data fetched an inserted into card on logged out feed

* WIP: cards added to logged in feed

* create separate profile preview card component

* small style tweak, import pack on each page that shows feed cards

* rename

* tweak some styling issues

* make sure follow buttons init in cards

* populate all matching metadata placeholders after fetch

* don't render full preview card upfront on logged out feed

* refactors from PR comments

* fix issue in person search results

* remove check for article author link that will be superseded by cypress test for preview card

* Revert "remove check for article author link that will be superseded by cypress test for preview card"

This reverts commit 9b42804ffd0f051891c87293d0b791ed2bb0367f.

* Revert "fix issue in person search results"

This reverts commit 04941e3520c0895212141193b60f2933faed5ca1.

* only show the preview cards on story cards for Posts (not users etc in search results)

* correct display on collections view

* remove link check that will be replaced by cypress test

* tweaks to small issues, add a test for the logged out feed

* add tests for logged in home feed, logged out tag index

* add search test and tag index logged in test

* fixes to preview profile spec

* tweak to followauthor spec

* add cypress test for preview on series page

* use a unique test user for series test

* correct the jsdoc comments

* tweaks following PR review

* allow feed preview cards to reposition

* move to separate file from pack
2021-08-13 10:55:43 +07:00
Thomasbnt.dev
a041e5996e
Edit buttons styles for Templates responses (Mod) (#14468)
* Edit buttons styles for Templates responses (Mod)

* Update comments.scss

* Edit classic CSS buttons to SCSS

* added m-1 to submit buttons

* Deleted CSS class for .response-templates-container and added mb-3 to header

* Add crayons-btn to personal and moderator buttons

* Update app/assets/stylesheets/views/comments.scss

Co-authored-by: rhymes <github@rhymes.dev>
2021-08-12 15:57:36 +01:00
Richard Hao
228a16f90c
Fix reading list item count issue #14469 (#14471)
* Add cypress to reproduce the issue `Reading list is not reactive`

https://github.com/forem/forem/issues/14469

* Bug fixes: The reading list item count (in the title) isn't reactive

https://github.com/forem/forem/issues/14469

* Fix the cypress test cases

- to test reading list item count

* stylistic changeo

-  extract `itemsTotal` from `this.state`
2021-08-12 16:14:27 +02:00
Suzanne Aitchison
86e4c39e31
Make sure open preview cards don't collapse on scroll (#14482)
* don't close dropdown on scroll if already open

* fix minor alignment issue with author comments
2021-08-12 13:29:51 +01:00
Suzanne Aitchison
5efd72040b
change preview card dropdown position depending on viewport (#14473) 2021-08-11 18:40:11 +01:00
Aayush Gupta
71fd773cf3
Add separate section for article link to improve accessibility in the mod center (#14312)
* Initial structure for article heading insertion

* Fix clashing class names

* Draft: Switch to details element + some logic refactor, some specs failing

* Fix failing specs

* Fix compatibility issues with Safari

* Refactor code

* Shift app logic to id attribute

* Code improvements
2021-08-11 14:30:12 +07:00
Ridhwana
940241ac03
chore: use optional chaining (#14460) 2021-08-10 15:39:20 +02:00
Suzanne Aitchison
54e8fd8c8a
Refactor problematic markup for upload image (#13947) (#14431)
* refactor of ImageUploader

* refactor cover image uploader, update tests

* remove custom axe rules

* add cypress tests

* always render the hidden input

* tweaks
2021-08-09 16:00:01 +01:00
Jeferson S. Brito
b61dc606c3
Improve accessibility of top search bar (#14263)
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
2021-08-09 09:55:41 -04:00
Ridhwana
4337ce9d91
Creator Onboarding Confirmation Page (#14259)
* feat: add a first version of the confirmation page - still a wip

* feat: style the modal properly

* chore: update the text

* chore: update from master

* fix: add the correct text and layout for the feature flagged confirmation email

* feat: use the view_class functionality to assign some css styling to the confirmations class

* feat: add the Forem background

* feat: add some styling to "Click Here"

* feat: polish styles

* feat: the padding will be used for mobile

* chore: some blank lines

* feat: add some more styles

* feat; use media queries

* feat: add a callback to the modal

* feat: handle all javascript on the confirmation form

* feat: change back to a button

* feat; change from button to span for accessibility

* feat: add the callback in an if condition

* feat: add a main-content

* feat: update the confirmation page html

* feat: add Cypress test

* minimal seeded flows

* fix: rename the file

* feat: update confirm email spec

* fix: remove mistake

* refactor: rename the files appropriately

* feat: change some text

* fix: typo

* fix: update as per suggestions
2021-08-03 14:21:56 +02:00
zeotuan
2e21050f45
fix member dropdown does not remain open on mouseout when click (#14317)
* update-member-dropdown-to-remain-on-mouseout-when-click

* add test for topNavigation

* fix cypress test for member dropdown button

* fix typo, change file name

* use data-attribute isntead of empty class for clicked event

* refractor syntax

* remove unnecessary alias
2021-07-28 10:43:03 -04:00
zeotuan
7cb42da627
fix nested interactive element (#14314)
* move onclick from div to each button

* remove old test workaround and outdated comment
2021-07-27 19:22:59 +02:00