Commit graph

333 commits

Author SHA1 Message Date
Fernando Valverde
e48abdc586
Fix the way we check for AndroidBridge global (#11969)
* Change the way we check for AndroidBridge global

* Modify logic to check for not undefined
2020-12-18 09:44:53 -06:00
ludwiczakpawel
73e560f7a2
Updating navigation (especially mobile) (#10424)
* .

* .

* .

* .

* .

* specs

* specs

* .

* .

* merge

* moving cheese around

* layout

* .

* merge

* Fixed invalid selector for search.

* Fixed issue with URL not updating after a search.

* do things better

* kinda merge

* whoops

* whoops

* .

* .

* im a backend developer

* tooltips 1.0.1

* tooltips 1.0.1

* fix

* specs

* .

* reduce the spacing

* schema drop

* reverts

* revert

* reverts

* revert

* drop unused nav

* drop unused nav

* drop unused nav

* drop unused nav

* typos

* paths fixes

* speeding up JS

* js

* search

* Reworked initializeTopBarIcons.js

* Reworked initializeNavigation.js

* Small refactor and updated exported function API docs.

* Fixed a bug I created when refactoring the top navigation icons.

* sidebar nav links

* spec

* Fixed issues with logged out experience for top nav icons.

* Small refactor of top nav icons.

* Small refactor and added some API docs.

* Added @testing-library/dom

* Added tests for top navigation utilities.

* spec

* spec

Co-authored-by: Nick Taylor <nick@dev.to>
2020-12-08 15:59:21 +01:00
Ridhwana
57b13ffa72
Move the color picker to its own initializer file (#11693)
* refactor: move the color picker to its own initializer file

* fix:wrap in the initializecolorpicker function with use strict
2020-12-01 15:34:44 +02:00
Nick Taylor
bf7780cd2c
Ran prettier on *.js, *.jsx and *.md files. (#11586) 2020-11-23 20:45:50 -05:00
ludwiczakpawel
70706d0a62
Comments UI update (#11283)
* tooltips 1.0.1

* tooltips 1.0.1

* init

* .

* drop not needed files

* .

* init

* init

* .

* comments

* border

* missing bits

* build comment JS

* .

* .

* specs

* sloan avatar fix

* bunch of fixes

* specs and fixes

* specs

* .

* swap order of links

* contrast

* js for dropdown

* icons

* op-author

* three dots icon

* reverts

* test: capybara- make sure that we click the dropdown before clicking on edit

* permalink --> link

* tiny fixes

* aria-label on form

* proper alt on user's avatar

* aria has popup

* use UL > LI instead of DIV

* add aria-labels to dropdown items

* another aria-label

* better links: nav

* contrast

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2020-11-18 18:21:19 -05:00
rhymes
f9506affb5
Use faster JS selection methods (#11409)
* Add JS tips section to frontend documentation

* Replace document.getElementsByTagName('body') with document.body

* Replace querySelectorAll with faster selecting methods where appropriate

* Replace querySelector with faster selecting methods where appropriate

* Fix typo

* Fix forEach and getElementsByClassName

* Change querySelector* to faster methods in erb files

* Change querySelector* to faster methods in ruby files

* Fix runkit tag

* Various fixes

* Update app/assets/javascripts/initializers/initializeEllipsisMenu.js

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

* Update app/assets/javascripts/utilities/slideSidebar.js

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

* Commenting out flaky spec

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2020-11-16 17:35:50 +01:00
irmela
9af120561c
Make markup for dashboard ellipsis menu more consistent (#10764)
* Make markup for dashboard ellipsis menu more consistent

* Rename js-dashboard-row-more to js-ellipsis-menu
2020-11-15 14:26:37 +01:00
Ben Halpern
badefcabeb
Developer experience/security: Make dev/test blow up if current_user is used erroneously (#11237)
* Let dev/test blow up if current_user is used erroneously

* Fix logic

* Fix click-to-edit permissions

* Change test to check for new behavior

* linting

* Edit tests

* Change test

* Clean up implementation

* Update comment

* Fix instance vars

* Update app/controllers/concerns/caching_headers.rb

* Merge origin and add request_store gem
2020-11-12 11:54:23 -05:00
ludwiczakpawel
ab34b37c49
Badges area on profile (#11384)
* tooltips 1.0.1

* tooltips 1.0.1

* badges size

* badges size

* .

* button style

* pawel messing with controllers

* math is stupid

* good boys write docs

* typos
2020-11-12 15:53:14 +01:00
ludwiczakpawel
de5a22ecf7
Profile UI update (#11357)
* tooltips 1.0.1

* tooltips 1.0.1

* profile layout

* fix

* whoops

* better github repos

* spec

* brining back doc, and making liitle fixes

* button placement, stats styling

* rename
2020-11-12 08:47:04 +01:00
Nizar
7058d628af
Added Copy Permalink Functionality to Comment Dropdown (#8311)
* Added Copy Permalink Functionality to Comment Dropdown

Copy functionality is similar to the way 'copy article link' is implemented. It checks for the android bridge first, then the navigator, then fallsback to the default document copy command

Since the codes were really similar, I moved the copy functionality to a function of its own with callbacks and fallbacks as lambdas, and triggered it with the copyArticleLink and the copyPermalink

* Replaced Copy Permalink Callbacks with Promises

* Keep anchor tags instead of buttons (#1)

* copy permalink using anchor tag

* Missing closing button tag

* Adds 'Copied to Clipboard' Snackbar Message

* Patches bug introduced in #10323

Patch suggested in following comment: https://github.com/forem/forem/pull/8311\#pullrequestreview-492011202

* Removes import statement for addSnackbarItem and Suppresses ESLint Error

Initializer runs in global scope

* Unhandles exception when copying permalink so Honeybadger can handle it

* Replaces ButtonListener suffix for copyPermalink method with Listener

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
2020-11-11 08:32:10 -05:00
Fernando Valverde
756acebaed
Podcast + Video player native bridge small refactor (#11345) 2020-11-10 07:36:05 -06:00
Fernando Valverde
f11523f29a
Makes Runtime.js detect the generalized ForemWebView User Agent (#11288)
* Makes Runtime.js detect the generalized ForemWebView User Agent extension

* Adds tests
2020-11-05 14:18:17 -06:00
Josh Puetz
542ee58ab8
Rate Limit Modal - Comments (#11102)
* Non-preact modal

* Some cleanup

* Toggle modal on navigation

* Use rate limit modal on comments page

* Added JSdocs

* Remove explanation link

* Comment rate limit test

* Tests and method renaming
2020-11-03 15:49:20 -06:00
ludwiczakpawel
5d3691bcc5
Notifications redesign (#11084)
* notifications

* fix

* .

* REVERT

* .

* drop ccss

* REVERT

* specs

* drop colons

* fixse

* fix

* spec 1

* eh

* Fix notification specs

Co-authored-by: Molly Struve <mollylbs@gmail.com>
2020-10-29 20:38:17 +01:00
ludwiczakpawel
1636bdf4c8
Autoresize on comment textarea + comment submit on CMD/CTRL+Return (#11115)
* .

* whoops

* revert typo

* Handle glitches and edge cases.

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-10-29 09:33:11 +01:00
Ben Halpern
531f26bad6
Add admin shortcut to tag page (#11092)
* Add admin shortcut to tag page

* Fix spec

* Add more check

* Change admin location
2020-10-28 12:19:21 -04:00
Molly Struve
dbfed77f37
Flaky Spec Fix:Remove js:true From Local Timestamp Checks and js Fix attempt code (#11087) 2020-10-26 10:20:51 -05:00
Molly Struve
4a394f1b96
[deploy] Bug Fix:Only Require Timemachine for Testing envs (#11085) 2020-10-26 08:57:16 -05:00
Molly Struve
3884009f08
Spec Fix:Set Javascript Locale to Match Time.zone (#11025) 2020-10-26 07:51:32 -05:00
Ben Halpern
6fac74b741
[deploy] Experiment with the removal of inline critical path css (#11027)
* Experiment with the removal of inline critical path css

* Fix up tests, remove reference to deleted file

* Change docs

* Fix typo
2020-10-22 19:22:28 -04:00
Elliot
6a1f560f65
[deploy] Fix dropdowns breaking after adding comment (#10976)
What was wrong?
`initializeCommentDropdown` is called when a new comment is added.
`initializeCommentDropdown` calls `addDropdownListener(dropdown)` on all
`.dropbtn` elements. Elements with the `.dropbtn` class already exist on
the page so an extra listener is added to it whenever a comment is
added.

How was it fixed?
Whenever a dropdown listener is added to an element with the
`.dropbtn` class, an attribute is set on that element so we know it
already has a dropdown listener. When we add listeners to elements with
the `.dropbtn` class in the future, we don't add them to elements with
the attribute.
2020-10-21 08:15:10 -04:00
Ben Halpern
467e99556c
[deploy] Fix tag display bug and crayonsify area (#10868)
* Fix tag display bug and crayonsify

* Fix some specs

* Remove unused tag js

* Adjust to remove crayons card bg

* Adjust padding

* add spacing below nav

* drop unnecessary classname

* cleanup headers

* links

* Finalize style and add hint to eliminate div jump

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
2020-10-20 16:07:17 -04:00
ludwiczakpawel
95619a9c92
Adding admin link for admins (#10926)
* adding admin link for admins

* ok, workaround
2020-10-19 12:44:17 -04:00
Ben Halpern
c60566b8a5
[deploy] Modify code to deal with flaky tests (#10616)
* Modify code to deal with flaky tests

* Remove uneeded x
2020-10-05 14:54:11 -04:00
Ben Halpern
c0d5486023
[deploy] Fix current_user cache issue in comments (#10609) 2020-10-05 10:52:12 -04:00
ludwiczakpawel
1375e8a4df
[deploy] Redesigned Comment Form (#10355)
* init

* .

* .

* better

* last bits

* specs

* merge

* fix response templates for replies

* copy

* active inactive buttons + cleanup

* labels

* specs

* specs

* response templates fix

* ....

* wtf

* .
2020-10-05 12:01:48 +02:00
ludwiczakpawel
9d384e1a93
CSS Cleanups, part 2 (#10527)
* padding-top on body

* padding-top on body

* move cheese around

* .

* :(

* rename
2020-10-03 06:57:57 +02:00
Robin Gagnon
87590e77d3
[deploy] feat: Disable autoplay on native videos (#10516) 2020-10-01 16:52:12 -06:00
Mac Siri
02bd3111af
[deploy] Refactor: Create setCurrentUserToNavBar (#10501) 2020-09-30 16:20:23 -04:00
narender2031
649c23f854
add no console rule front-end (#10362)
* add no console rule front-end

* add no-console to root eslintrc

* disbale no console rule

* remove console
2020-09-29 09:56:37 +02:00
Fernando Valverde
b5309c4a21
[deploy] User agent check fix for native iOS (#10472) 2020-09-28 14:45:36 -04:00
Molly Struve
6193ceeace
[deploy] Refactor: Cleanup Frontend Code (#10466) 2020-09-28 08:57:34 -05:00
ludwiczakpawel
3e9b56a7dd
[deploy] Frontend cleanups (#10416) 2020-09-24 08:15:12 -05:00
Ben Halpern
3e09a7768f
[deploy] Remove need for ENV vars during asset precompile (#10349)
* Remove need for ENV vars during asset precompile

* Add open-search test
2020-09-16 13:57:05 -04:00
Fernando Valverde
1aa8233d9e
Adds runtime copy to clipboard (#10323) 2020-09-14 14:45:54 -04:00
Vaidehi Joshi
abe2489394
Hide active broadcasts from /connect routes (#10312)
Fixes https://github.com/forem/forem/issues/9683.
Also refactors the initializeBroadcast function to handle all
broadcast-related logic, and removes broadcast checks from the articleForm component.
2020-09-14 11:28:18 +02:00
Ben Halpern
a1f664ab5b
Fetch GA Tracking ID from SiteConfig (#10262) 2020-09-09 18:17:44 -04:00
ludwiczakpawel
74b398d876
New Profile Header (#10185)
* init

* profile header

* merge

* two headers

* centerd

* link fix

* remove comments

* whoops

* Fix specs

Co-authored-by: rhymes <rhymes@hey.com>
2020-09-03 16:47:01 +02:00
Lisa Sy
54c071856e
[deploy] Update top-header for logged-out user (#9874)
* Create first start at desktop top header updates

* Update mobile styling of top header

* Stylize sign in widget card

* Update nav menu and top bar

* Changes based on user being logged-in or not

* Uses user_signed_in? on top nav bar

* Fix lingering old cloudinary helper method

* Trigger CI

* Fixes specs

* Adds redirect_using_referer_spec, fixes other specs & cleanup

* Adds nav-menu.scss to layouts/_styles.html.erb for inline & small edit in referer check

* Remove logged-out styles to make it more uniform with logged in

* Remove nav-menu.scss file

* cleanup markup and JS a little

* Fixes FB auth specs to new login links

* Makes sure unauthenticated /new redirects back to editor

* CI fix Sing in with -> Continue with

* Update db/schema.rb

* Update db/schema.rb

* Update db/schema.rb

Co-authored-by: Fernando Valverde <fdov88@gmail.com>
Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-08-31 18:12:22 -04:00
Fernando Valverde
9da71a47c7
[deploy] Introduces Runtime class for standardized & other native cleanup + replace podcast GA with ahoy (#10026) 2020-08-28 05:52:04 -06:00
ludwiczakpawel
1776377234
Improve styling for series (#9893)
* .

* flare tag line height

* .

* series switcher

* .

* revert

* editor preview fix

* Fix broken spec

Co-authored-by: Mac Siri <krairit.siri@gmail.com>
Co-authored-by: rhymes <rhymes@hey.com>
2020-08-24 09:53:51 +02:00
Andy Zhao
f4b50a11b4
Check for meta payment pointer first before attempting to load (#9722) 2020-08-10 18:12:48 -04:00
Fernando Valverde
5d55299ac3
[deploy] Removes intrusive mobile video autoplay & adds ahoy for visibility (#9539)
* Removes intrusive mobile video autoplay & adds ahoy for visibility

* web video has autoplay enabled

* Implements feedback on video player ahoy events

* use strict equality
2020-07-27 13:11:40 -06:00
Alberto Pérez de Rada Fiol
e35f4a699d
Don't show badge when reading list is left empty (#9437) 2020-07-22 08:55:33 -04:00
Lisa Sy
949b092dbd
[deploy] Update broadcast styling (#9411) 2020-07-20 20:17:53 -04:00
Fernando Valverde
154a3629ee
Add Native bridge video support (#9303) 2020-07-20 11:22:32 -04:00
Pavel Tkachenko
9e94b80741
[deploy] Add local_date helper to handle dates with respect of user timezone (#9285)
* Add local_date helper to handle dates with respect of user timezone

* Fix date timezone bug for articles/show

* Fix date_helper to meet system specs requirements
2020-07-16 08:45:44 -06:00
Vaidehi Joshi
2fadc24d28
Fix TypeError: null is not an object in initializeArticleReactions.js (#9297) [deploy]
* Fix TypeError: null is not an object in initializeArticleReactions.js

Should fix https://app.honeybadger.io/fault/67192/6f9b4fdf475e2229c968fa26d785b90f

* Return 0 rather than undefined if reactionEl doesn't exist
2020-07-14 08:12:07 -07:00
Vaidehi Joshi
3391593de1
Fix TypeError: userData is null in initializeOnboardingTaskCard.js (#9298) [deploy]
* Fix TypeError: userData is null in initializeOnboardingTaskCard.js

Should fix https://app.honeybadger.io/fault/67192/65045742fda3390a067960f53a894e87.

* Combine return statements in initializeOnboardingTaskCard
2020-07-14 07:32:57 -07:00