Commit graph

956 commits

Author SHA1 Message Date
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
Suzanne Aitchison
75b6c8ed96
Use a single listener for all follow buttons on a page (#14246)
* create new pack, handle user follow buttons, use pack on article page, remove initializeUserFollowButts

* init all follow button types, add pack to tag index and podcast episode pages

* add pack to all relevant pages, listen for newly inserted follow buttons

* change to searchParams to remove follow button initializer calls

* fix bug with tag page, add pack to notifications page

* fix issue with follow back inner text

* update cypress specs

* run the followbuttons code on sponsors page

* remove extra foreach

* add test for follow from article sidebar

* add test for follow and unfollow tag

* add test for the tag index page

* add spec for organisation profile follow

* add tests for follow buttons in search results

* add tests for notification follows

* commit missed file - woops

* show login modal if user is logged out when they click

* add cypress tests for logged out state

* change tag button initialization

* remove data-button-initialized

* init follow buttons from base pack

* handle the case where multiple follow buttons exist on a page for the same user

* account for instantclick and userdata not being defined, lower coverage for jest

* use getInstantClick

* fix issue with set initialisation

* only listen for mutations in areas we know follow buttons may be added dynamically

* small refactors
2021-07-27 10:45:50 +01:00
rhymes
a118b9095a
Add JSON representation of Profile Preview Card info (#14296)
* Add tests and Railsify a few things

* Adds JSON representation of ProfilePreviewCardsController

* Load profile and setting eagerly

* Add profile preview card color
2021-07-21 16:23:54 +01:00
Suzanne Aitchison
1adf66260d
Delay the hover appearance of preview card (#14222)
* delay the hover appearance of preview card

* don't run animation if the dropdown is already held open by click

* wake up travis

* Trigger Travis CI

* remove unncessary document queries
2021-07-21 11:15:10 +01:00
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