Commit graph

929 commits

Author SHA1 Message Date
zeotuan
9dcb332f4a
Fix Bugs in the "Copy article URL to clipboard" feature #14242 (#14243)
* change readonly input to p tag

* add pointer cursor and focus on copy post url option

* add Enter keypress eventListener to copy post url option

* add test for enter press event, refractor some test to click on copy post url option instead of just the image

* make copy post url font bold

* add scss class sidebar for dropdown && fix sidebar dropdown reaching under topheader in large screen resolution

* resolve conflict with main

* Update _actions.html.erb

* changin markup to improve accessibility

* make variable name appropriate, switch cypress to imitate user interaction

* remove dump file, fix test to use alias
2021-07-20 15:09:24 +01:00
Fernando Valverde
50601efe9b
Remove useEffect from RuntimeBanner component (#14248) 2021-07-15 10:57:57 -06:00
Fernando Valverde
8095fdb891
Runtime Banner v2 (#14119)
* Banner v2 - first working version

* Move pack_with_chunks_tag up + removing comments

* Trying to fix unlrelated tests

* Revert experiment

* Defer initialization until page is ready

* Test refactor + trying out UDL Server refactor

* Revert experiment - to be handled in separate PR

* refactor to use function component

* Cleanup unused lines in cypress test

* Update app/javascript/runtimeBanner/RuntimeBanner.jsx

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

* Apply review feedback

* Update app/javascript/runtimeBanner/RuntimeBanner.jsx

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

* Add import clause + extract functions outside of component

Co-authored-by: Nick Taylor <nick@forem.com>
2021-07-14 14:44:07 -06:00
Julien Maury
75144aaaf3
Move Article Search JavaScript in a separate file (#14194)
* search js in a separate file

* add file searchParams and import utilities

* fix imports

* use global header eslint

* add spaces in eslint comments in searchParams.js

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

Co-authored-by: rhymes <github@rhymes.dev>
2021-07-14 16:29:29 +02:00
Nick Taylor
96f54d02cd
[15 min fix] Fixed an issue with the moderation button not appearing on some posts (#14184)
* Fixed an issue with the moderation button not appearing on some posts.

* Added some E2E tests to ensure moderation button is on posts for trusted users.

* Added some more tests.

* Added a test to ensure moderation button does not appear when logged out.
2021-07-13 10:31:00 +02:00
Suzanne Aitchison
904d9846a5
use userId in path, remove need to pass preview card id (#14171) 2021-07-12 13:09:12 +01:00
Suzanne Aitchison
6a93ad914a
fetch preview card follow buttons in one network call (#14085)
* fetch preview card follow buttons in one network call

* when new comment is submitted, only fetch new comment status

* make sure individual button follow requests continue to init

* Add follow-user class to all follow user buttons via the application helper

Co-authored-by: mstruve <mollylbs@gmail.com>
2021-07-09 09:24:57 +01:00
Molly Struve
e87dead7ad
Use new UserSetting and UserNotificationSettings and Ignore Related User Table Fields (#14121)
* schema file undelete description

* feat: v1 of the script

* Flesh out remaining enums under their categories

* complete UsersSettings data update script

* complete DUS for relevant attributes in users and profiles tables

* complete DUS for users_notification_settings

* alphabetize user_settings sql file

* safeguard against null values for "null: false" settings

* Set up actual UsersSettings DUS and specs files

* fix broken DUS script

* complete specs for UsersSetting DUS

* Address QA of specs

* complete specs for users_notification_settings DUS

* fix the typos (thanks Julianna!)

* begin implementation

* still building

* add missing attribute "email_membership_newsletter"

* complete sync code (except race condition for user profile)

* complete implementation, remains tests

* Address PR review and fix Travis fails

* remove superfluous Profile.new

* fix travis fails

* feat: update the users_notification_setting attributes from the user model

* feat: use the config fonts enums to display the fonts

* feat: loop through the keys

* fix profile = nil blowing up; add specs for notification_setting model

* remove unneeded spec

* remove feed validation until after sync code removed; fixes feed_import spec failures

* remove spec associated with feed_url validation in user_setting model

* fix failing spec 😅

* add TODO

* feat: set the user settings in the user controller  and use it in the customization form

* feat: move some update logic to the users settings controller thats being used from customization

* feat: show the updated values form the users_settingd and not the user instance

* Generalize redirect back to current tab

* still trying to reflect changed theme upon refresh

* customizations take effect on refresh

* remove 'with_feed' scope from user model

Co-authored-by: Jamie Gaskins <jamie@forem.com>

* start with takeover for fields previously in profiles table

* Takeover code for `publishing_from_rss` section in Settings (#13914)

* implement takeover code part 1

* implement takeover code

* fix feed fetch

* need rhymes help

* complete implementation; specs pending

* fix STUPID omission that caused so many headaches 😫

* implement profile fields pointing to users_settings 🎉

* run migrations

* implement inbox type & guidelines takeover code; specs pending (#13911)

* Point changes in notification settings to `users_notification_settings` table (#13910)

* implement takeover code; remains specs

* address PR feedback; remove related sync code

* address PR review feedback

* need help with routing and specs

* address pr review

* addressing pr review

* Treat implementation edge cases and omissions 😅

* fix uncommented comment

* fixing implementation cases

* address more PR review feedback

* fixing notifications use-cases

* refactor settings controller

* more pr review changes

* solving bugs

* fix broken onboarding

* handle eperience_level calls

* more fixes

* remove unneeded mappings

* add To-dos for quety updates

* remove done TODO

* purge done TODOs

* update notification_settings-related queries

* start fixing specs

* fixing specs

* fix notification and lrg_forem specs

* fixing broken specs

* still fixing

* fix line dif and remove reloads from user.rb

* run specs

* silence bullet and other fixes

* remove setting migration scripts and specs, fix more settings for specs

* handle missing user for article builder and fix notification specs

* fix some final controller specs and re-add incorrectly removed specs

* remove deprecated data update scripts and related workers, put travis back

* refactor admin tags mods controller, write/move specs for users notifications settings controller

* schema cleanup and other small refactors for consistency

* set field we can invalidate in spec via active record instead of at the db level

* remove I think an uneccessary hook call from subscribe_to_mailchimp_newsletter

* use bnefore_create to setup settings, please dont blow up the test suite

* mailchimp bot fix

* remove decorator in favor of single model method

Co-authored-by: Arit Amana <msarit@gmail.com>
Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
Co-authored-by: Arit Amana <32520970+msarit@users.noreply.github.com>
Co-authored-by: Jamie Gaskins <jamie@forem.com>
2021-07-08 09:31:34 -05:00
Nick Taylor
56bd0f9d2a
[15 min fix] Fixed regression for reverting changes in the article editor (#13365) 2021-07-07 08:30:36 -04:00
dependabot[bot]
a9449501a3
Bump @storybook/addon-a11y from 6.2.9 to 6.3.1 (#14094)
* Bump @storybook/addon-a11y from 6.2.9 to 6.3.1

Bumps [@storybook/addon-a11y](https://github.com/storybookjs/storybook/tree/HEAD/addons/a11y) from 6.2.9 to 6.3.1.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.1/addons/a11y)

---
updated-dependencies:
- dependency-name: "@storybook/addon-a11y"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

* add TODOs and exclusions for known a11y issues waiting on bugfixes

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-06-29 14:19:28 +02:00
rhymes
c2a7038406
Chat: disconnect IntersectionObserver (#14091) 2021-06-29 11:13:56 +02:00
Suzanne Aitchison
845a5fade5
Profile Preview Cards (RFC#222) - author name in comments (#14056)
* show dropdowns on pre-existing comments

* show preview on comments, v rough version of showing preview on recently added comments

* tidy up error, add some comments

* show the ama icon when appropriate

* add to comment on article cypress spec

* add test for preview card on article comment

* tidy up

* small refactors

* wait for button init in cypress test

* add test for article author byline on organization post

* Trigger CI builds

* Trigger CI builds
2021-06-25 10:05:37 +01:00
Fernando Valverde
f34b2203d3
Make Consumer Apps dictate aasa results (#14015)
* Makes Consumer Apps dictate aasa results

* progress with ConsumerApp query

* Adds Team ID migration + Stimulus consumer_app_controller.js

* Adds cypress tests

* Adds Backfill data_update_script + more specs & tweaks

* Remove file added by mistake

* Comment typo

* Small tweaks + improved specs

* Update lib/data_update_scripts/20210622145212_backfill_forem_consumer_app_team_id.rb

Co-authored-by: Jamie Gaskins <jamie@forem.com>

* Update spec/lib/data_update_scripts/backfill_forem_consumer_app_team_id_spec.rb

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

* Make use of create! and log errors to ForemStatsClient

* Fix specs

* Add mock_rpush call as suggested in review

* Add Review suggestions

* Fix tests

* Remove redundant assert in spec

Co-authored-by: Jamie Gaskins <jamie@forem.com>
Co-authored-by: rhymes <github@rhymes.dev>
2021-06-24 08:36:11 -06:00
Suzanne Aitchison
f8e56b356e
create definite handles to listeners in initialize function (#14033) 2021-06-23 15:09:03 +01:00
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
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
rhymes
a9e7bc4361
Reading list: fix broken pagination (#14031) 2021-06-22 08:24:23 +02: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
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
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
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
Suzanne Aitchison
f607cf8722
Optimise dropdowns for accessibility - Profile page (#13916)
* use initializedropdown in profileDropdown

* improve aria in html

* add cypress tests, stop buttons and dropdown initializing twice or more

* make sure dropdown shows when logged out
2021-06-14 12:31:23 +01:00
Julien Maury
a2677cc0a9
Remove defer attributes from inline scripts - gist embeds (#13407)
* replace inline attribute defer with external js - show.html.erb

* fix typo in filename

* disable no-undef and bail if not defined

* put js on subfolder utilities

* refactor jsx instead of loading chunk with defer

* fix typo in desc

* better name for global gist helper

* use InstantClick

* working script on preview AND single view, not dynamic import, though

* embed only if gists

* combine all approaches to make dynamic import work

* make gist embeds work on submit comment form

* make gist embeds work on preview comment

* refactor - preview comments and submit

* add pack editComment + helper embedGistsInComments

* comment gist helper

* delete useless file utility

* use new syntax for events

* put code in method embedGistsInComments

* delete older pack gist

* handle edge case 'view full discussion'

* resolve conflict with package ibm-openapi-validator

* resolve conflict with package husky

* empty commit to test random error travis

* better name for class dismiss

* handle future events submit

* delete test code on click toggle form

* delete unused file

* rename pack as js file, not jsx

* Added POC using MutationObserver.

* missing case: notification page

* use custom pack notification page

* add e2e test for comment with embed gist

* add e2e test for preview post with embed gist

* add an extra step in tests to check gist is present

Co-authored-by: Nick Taylor <nick@dev.to>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-06-11 08:22:50 +01:00
Julianna Tetreault
b12ebfa0e5
RFC #74, Pt. 2: Private Forem Landing Page (#13819)
* Adds landing_page checkbox for Landing Page

* Adds landing_page to page_params in Admin::Pages::Controller

* Adds landing_page to admin_manages_pages and admin_creates_pages specs

* Adjusts copy for Landing Page in pages/_form.html.erb

* Places #post_a_job before #privacy in Pages::Controller
  - Ensures that all page-related methods are properly
 alphabetized

* Alphabetizes remaining out-of-order page-related methods
  - Ensures that all page-related methods within the
 Pages::Controller are in alphabetical order, following
 the order of the other methods

* Adds landing_page check to ApplicationController#verify_private_forem

* Adds a single_landing_page validation to the Page model

* Adds a lock.svg to /images and uses it in the pages index

* Adjusts buttons and checkboxes to use crayons class in pages partial

* Ensures that pages/_form.html.erb destroy button uses crayons

* Adds a landing_page validation-related test to page_spec.rb

* Updates #single_landing_page validation and error message

* WIP: Adds JS modal upon landing_page error in pages/_form.html.erb

* Adds a working modal upon error in pages/_form.html.erb
- Removes redundant #single_landing_page validation from Page
- Adds #has_a_landing_page? in place of #single_landing_page
- Conditionally renders the landing_page checkbox in _form.html.erb
- Adds styles to locked screen/landing page modal
- Adds copy to locked screen/landing page modal
- Beings adding buttons to overwrite current landing_page

* Updates the data-modal-selectors and ids in pages/_form.html.erb

* Uses #landing_page_path within pages/_form.html.erb modal
- Adds a link_to to link to the current landing page in the modal
- Adds styles to buttons and link_to in modal

* Adds back single_landing_page validation to Page.rb

* Reverts changes and updates methods within Page.rb
 - Reverts changes to #single_landing_page
 - Refactors #has_a_landing_page? and #landing_page_path
 - Updates div id in pages/_form.html.erb

* Adjusts #single_landing_page error message slightly

* Adds a test for landing_pages in stories_index_spec.rb

* Adds an overwrite attribute to Pages for the modal in _form
  - Fixes anonymous spelling

* Refactors pages/_form.html.erb and cleans up spelling

* Adds a safe operator to landing_page.path in Page
  - Adjusts the placement of the hidden value in pages/_form.html.erb

* Updates styling for Current Locked Screen link

* Adds the ability to overwrite an active landing page on click
  - Adds Admin::PagesController#update_and_overwrite and refactors
AdminPages::Controller#udpate to work with new method
  - Adds a remote attribute, overwrite, to Admin::PagesController
via a hidden_field in pages/_form.html.erb and an attr_accessor in
the Page model
  - Adds a toggleOverwrite() function to pages/_form.html.erb to
toggle the (soon to be hidden) overwrite checkbox in the form --
the checkbox is toggled on button click

* Adds a guard clause to #landing_page_path in Page.rb

* Adds a safe naviagtor to Admin::PagesController#update_and_overwrite_landing_page

* Adds a type and return to Overwrite button to prevent submit

* Adds a hidden class to the overwrite checkbox field in _form.html.erb
  - Hides the overwrite checkbox since it is only used to overwrite
the landing_page boolean on click of the "Overwrite current locked
screen" button

* Adds Admin::PagesController#create_and_overwrite and removes hidden class

* Adds landing page-related tests to admin_manages_pages_spec.rb

* Remove messy commented out code and place it in GH comment instead

* PR Review Feedback: Renames remote attr, defines class methods, updates views
  - Renames remote attribute to overwrite_landing_page
  - Updates all necessary views, methods, etc. w/ new attr
  - Defines two class methods to make code more extensible
  - Updates all necessary views, methods, etc. w/ new methods

* Remove unnecessary comments and revert changes to ternary in _form.html.erb

* Adjustments for accessibility within _form and index
  - Adds a descriptive id to <p> in _form.html.erb
  - Adds an ariadescribedby field to _form.html.erb
  - Adjusts title within index.html.erb

* Refactors landing_page-related code per PR review requests
  - Adds a landing_page_modal_controller.js that handles
and further customizes the dismiss and overwrite button, and
handles opening the modal
  - Adds a _landing_page_modal partial to extract modal-specific
html outside of the _form.html.erb partial
  - Refactors _form.html.erb to account for the _landing_page_modal
partial and the landing_page_modal_controller.js
  - Refactors the overwrite checkbox to be a hidden_field rather than
a hidden checkbox and removes existing hidden_field to accomodate it
  - Loads the @landing_page within Admin::PagesController#edit for
use by the _landing_page_modal.html.erb partial
  - Refactors Page#single_landing_page to be more readable
  - Removes useless JS from _form.html.erb

* Removes #landing_page_exists? class method since it isnt used now

* Uses the #landing_page class method within ApplicationController

* Removes pending status from test in admin_manages_pages_spec.rb

* Adds an e2e test for landing pages and adds to seeds_e2e
  - Adds a landingPage.spec.js to test landing pages
  - Adds a Page to seeds_e2e.rb for landingPage.spec.js

* Removes references to articles from e2e test and adds clickable link

* Adds another Page to seeds_e2e.rb and updates link names in test

* Adds the Current Locked Screen title to modal and opens in new link

* Renames Dismiss to Cancel and updates all necessary code

* Adjusts landingPage.spec.js

* check for existing landing page before showing modal

* Update Cypress tests and fix bug in LandingPageModalController

* Apply suggestions from code review

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

* Orders Pages by created_at desc in /admin/pages/index.html.erb for consistency

* Targets specific edit button in landingPage.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: rhymes <github@rhymes.dev>
2021-06-10 11:46:24 -06:00
Suzanne Aitchison
8358571b29
Get a11y lint script paths from rails helper (#13912)
* retrieve paths from rails helper

* move assets to vendor folder, precompile in assets config

* drop coverage on lines

* remove unneeded line
2021-06-10 09:25:29 +01:00
Suzanne Aitchison
be15f31122
Optimise dropdowns for accessibility: Dashboard and Manage pages (#13909)
* use dropdownutils in dashboard and manage pages

* add tests for the toggle menu on dashboard

* add test for archiving from manage post view

* small tweak to avoid unhandled errors

* small tweaks to form methods
2021-06-04 10:19:56 +01:00
rhymes
99ddd31058
Pin posts to feed (#13807)
* Add SiteConfig.feed_pinned_article and validation

* Display pinned article at the top of feed

* Add (basic) functionality to pin/unpin post

* Admins can pin other users posts as well

* Hide the button if looking at the non pinned post

* Add pinned/unpinned snackbar message

* Rename SiteConfig usage to Settings::General

* Add pinned article to the Admin articles index

* Show the pin post button when there's no pinned article

* Move pinning to a separate controller

* Fix SiteConfig reference

* Hide PinController actions to unauthorized users

* PinnedArticlesController#show action and refactor some of the code

* Add Modal interaction

* Fix modal-pinned checkbox interaction

* Fixed pin/unpin post

* Add ArticleDecorator#pinned? specs

* Add PinnedArticlePolicy and PinnedArticlesController specs

* Add ability to actually pin an article from the admin after submit

* Add partial Cypress pin/unpin spec

* Fix pinned article and add basic Cypress interaction tests

* Add Crayons styling to modal

* Only render the pinned article on the default Feed page

* Use persisted?

* Add some comments

* Update app/javascript/articles/Article.jsx

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

* Update app/javascript/packs/homePageFeed.jsx

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

* Fix Cypress tests

* Update app/javascript/admin/controllers/article_controller.js

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

* Fix pinning in article show page

* Used PinnedArticle domain model

* Fix spec

* Update cypress/integration/adminFlows/articles/pinArticle.spec.js

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

* Update cypress/integration/adminFlows/articles/pinArticle.spec.js

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

* Update cypress/integration/adminFlows/articles/pinArticle.spec.js

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

* Update cypress/integration/adminFlows/articles/pinArticle.spec.js

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

* Update cypress/integration/adminFlows/articles/pinArticle.spec.js

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

* Update cypress/integration/articleFlows/pinArticle.spec.js

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

* Update cypress/integration/articleFlows/pinArticle.spec.js

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

* Update app/views/admin/articles/index.html.erb

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

* Fix merge woes

* Add missing article pin post flows

* Add missing admin article flows

* Add Unpin to Admin as well

* Add Audit::Log entries for pin/unpin actions

* Update app/controllers/stories/feeds_controller.rb

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

* Do not rate limit in E2E tests

* Use .find instead of .filter

* Rename ArticleIdValidator to ExistingArticleIdValidator

* Treat draft and deleted articles the same

* Make sure posts can be pinned after the pinned article is unpublished or deleted

* Use .get directly

* Fix spec and fix PinnedArticlesController#show

* Strengthen pinArticle Cypress tests

* Add Cypress test heading guard

* Add another Cypress test heading guard

* Remove duplicate validator

* Try using the Tools: header instead of the article title

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
Co-authored-by: Michael Kohl <citizen428@dev.to>
2021-06-04 10:54:53 +02:00
Suzanne Aitchison
573c78d032
Advise users about potential accessibility failings in their posts - RFC #58 (#13745)
* initial rough version

* link to relevant rules, extract image text, only show if more than 0 errors

* jsdoc and tweaks

* refactors

* add tests

* open info links in new tab

* add new window link icon
2021-06-03 10:27:12 +01:00
Suzanne Aitchison
7e322e4f7b
Optimise dropdowns for accessibility - Post comments and share (#13868)
* WIP - basic init of comment dropdowns with open and close on click

* WIP - initialize the share dropdown

* initialize all post dropdowns within packs, init copy to clipboard announcer

* refactor and add JSDocs to helper

* undo changes to base jsx

* update accessible name of post actions button in cypress test

* make sure dropdowns pack loaded on comment index page

* undo prettier changes in base jsx

* undo prettier changes in base jsx

* initialize comment dropdowns in podcasts

* add test for the post actions

* add article comment tests

* add cypress tests for comment dropdowns
2021-06-03 09:13:17 +01:00
rhymes
3be26dae97
Remove duplicate jquery import, remove jquery-rails and use @rails/ujs (#13891)
* Remove unused jQuery include in Listings

* Use @rails/ujs in the admin

* Remove jquery-rails

* Content is mandatory for listings

* form_with defaults to local: true

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

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

* Update cypress/integration/listingFlows/deleteListing.spec.js

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

* Update cypress/integration/listingFlows/deleteListing.spec.js

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

* Update cypress/integration/listingFlows/deleteListing.spec.js

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

* Apply feedback on e2e and fix a bullet warning

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-06-01 15:28:09 +02:00
Suzanne Aitchison
9b326e3638
show the sidebar on all logged in feed views (#13877) 2021-06-01 09:55:13 +01:00
Dan Wallis
521bb09394
Add loading=lazy to image tags (#10888)
* Add loading=lazy to image tags

* Fix test

* Lazy-load some obvious templates

* Lazy-load more verified templates
2021-05-27 19:01:21 +02:00
Lisa Sy
e925d95f71
Rename WRITE A POST to CREATE POST (#13855)
* Rename WRITE A POST to CREATE POST

* Revert schema line removal
2021-05-25 10:30:30 -07:00
Andrew Bone
61cd4b3e14
🚑 Quick fix prevent grammarly from running on chromium based browsers (#13820) 2021-05-25 06:54:32 -04:00
Michael Kohl
6dfabd578f
Rename SiteConfig to Settings::General (#13573)
* Rename SiteConfig

* More renaming

* Update spec

* Update mandatory settings mapping

* More renaming

* e2e test fixes

* You have a rename, and you have a rename

* Spec fix

* More changes

* Temporarily disable specs

* After-merge update

* Undo rename for migration

* undo rename of DUS

* Fix DUS

* Fix merge problem

* Remove redundant DUS

* Fix specs

* Remove unused code

* Change wrong class name

* More cleanup

* Re-add missing values to constant

* Fix constant

* Fix spec

* Remove obsolete fields

* Add accidentally removed field

* Update spec

* Move methods from Settings::General to ForemInstance

* Remove unneeded model

* Change mentions of 'site config'
2021-05-21 14:45:37 +02:00
Fernando Valverde
5832d146de
Add error handling to clipboard promise - post editor (#13798)
* Adds error handling to clipboard promise - post editor

* Adds a reload when rendering the Editor to get missing navigator.clipboard

* Remove reload logic from Post Editor

* Adds Honeybadger notify on error handling
2021-05-20 09:46:37 -06:00
Alex
795cf7b10a
Don't show articles from blocked users in the feed (#13752)
* Update element identifier for blocked articles

* Update confirmation wording

* Add specs
2021-05-14 09:41:50 +02:00
Andrew Bone
f6e222f12e
Fix layout shift on active crayons-tabs change. (#13300) 2021-05-12 11:45:36 -04:00
Suzanne Aitchison
2829c7f848
stop adding a false class (#13710) 2021-05-10 13:54:23 +01:00
Suzanne Aitchison
783fb6fa24
Accessibility enhancements to navigation tabs (#13559)
* update storybook example and docs

* update desktop home feed tabs with a11y enhancements

* update storybook to reflect buttons usage, update post editor buttons

* update admin html variants tabs

* update admin sponsorships tabs

* re-add flex to the crayons-tab class to prevent regression in tab components not updated

* Revert "update admin sponsorships tabs"

This reverts commit d9e4a5e4b0d362e38a11c795b35ceb4442bc4d90.

* Revert "update admin html variants tabs"

This reverts commit 3d9f119e88dc2f2f102d664c57a1f56413490a36.

* update search tabs

* update v2 form erb html

* update tag index tabs

* update notifications tabs

* label the notifications nav

* update mod sidebar tabs

* update main analytics page tabs

* add cypress tests for home feed tabs

* add tab tests for the post editor

* add cypress tests for tags index navigation

* fix UI issue with search tabs, add search cypress tests

* add tests for the analytics dashboard tabs

* add mod nav tests

* add notifications navigation tests

* get new handles after view switch

* replace hardcoded mod paths

* apply review suggestions
2021-05-07 15:24:34 +01:00
Andrew Bone
38214380dd
Fix a bug with moderator dropdowns and add aria tags (#13623) 2021-05-06 07:56:28 -04:00
Rafi
41cc771839
Refactoring help component (and fragmenting it too) (#10895)
* Refactoring Help component

* Fixing typo

* Adding missing prop types

* Removing setCommonProps

* Moving show to parent component

* Renaming Format component

* Converting help component to functional component

* Removing html from state

* Fixing modal toggle and eslint errors

* Adding arria hidden

* Using optional chaining

* Fixing variable names

* Renaming state variable

* Adding jsdoc

Co-authored-by: Nick Taylor <nick@dev.to>
2021-05-05 12:58:40 +07:00
Suzanne Aitchison
ad43dbe0b3
Add prefer object destructuring lint rule (#13183)
* add prefer object destructuring lint rule

* fix typo

* sweep up lint errors missed in config controller

* Revert "fix typo"

This reverts commit 44f9d57e3f0dc4007ab9020c8c659c2f770230c2.

* Revert "sweep up lint errors missed in config controller"

This reverts commit 3f8d5d782fe110607c2172b713c74c08c883eda3.

* make this a warning rather than error for now

* undo auto change
2021-05-04 12:10:32 +01:00
Rafi
ca50e5750e
Fixing dom structure of Tags to follow (#13184)
* Using buttons instead of checkbox

* Adding svg icon

* Update app/javascript/onboarding/components/FollowTags.jsx

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

* Adding condition for crayons-btn-icon-left

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

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-05-03 17:20:26 +01:00
Suzanne Aitchison
4aebfb62f2
Improve keyboard accessibility of comment rate limit and error modals (#13536)
* add modal code to Forem namespace, use showModal in the rate limit modal generator

* add cypress tests for both modals

* styling tweaks

* tidy up

* make sure modal trap selector is unique to page, update Modal JSDoc

* add additional jest test for focusTrapSelector
2021-05-03 07:14:23 +01:00
Suzanne Aitchison
1868537294
fix some landmark issues in listings (#13602) 2021-04-30 18:34:27 +02:00
Suzanne Aitchison
2e9ba2334a
15 min fix for chart js errors (#13598) 2021-04-30 13:28:20 +01:00