Commit graph

16 commits

Author SHA1 Message Date
Fernando Valverde
affc704c9b
Runtime Banner for Mobile Deep Linking (#13190)
* First version using custom schemes for iOS

* Starting to take shape with /r/mobile redirect page

* Wording and aasa

* Adds e2e tests

* Trigger CI

* Tweaks to AASA

* Uses external pivot domain to trigger Universal Links

* Add missing external domain deep link

* Fix test by enabling runtime_banner only in E2E tests

* Fix URL encoding mismatch in Cypress test

* banner sttyling

* Cleanup unrelated changes

* Add AASA tests + remove lingering Gemfile.lock changes

* Fix cypress test

* Remove unnecessary window global assignment

* Trigger Travis

* Replace querySelectorAll with querySelector

* Apply suggestions from code review

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>

* Refactor inline comments, extract URL.deep_link logic and other review feedback

* Small tweaks

* Remove untrusted user-provided redirect (CodeQL suggestion)

* Fix failing tests

* Whoops - another test fix

* Use Forem's UDL server

* Extract timeoutDelay and add comment clarifying

* Add target='_blank' to deep link

* Add TODO comment for replacing hardcoded identifiers

* Apply suggestions from code review

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

* Add a11y attributes

Co-authored-by: Paweł Ludwiczak <ludwiczakpawel@gmail.com>
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-04-23 15:45:34 -06:00
Daniel Uber
6884a3d7f1
Clean up initializePage (#13236)
* Remove early call to setup local storage for user

The first thing the callInitializers function does is re-invoke
initializeLocalStorageRender, calling the same function twice (for a
different outcome?) seems like it's not effective.

I tried to trace down how long it had been that way, and came to the
very first commit in the repo -
301c6080e3, where the pattern already
existed, so it's unclear at what point (prior to 2018) this was added,
and what problem it was trying to solve.

If we inlined callInitializers (by renaming it initializePage and
deleting the bottom function), the duplication would be especially
evident. This is the only call site for callInitializers, which would
be the other reason we _might_ want to have redundancy.

* Inline function call

Since initializePage only acted as a new name for
callInitializers (immediately transferring control to the
callInitializer function), remove the wrapper function and rename
the *actual* code with the public name initializePage.

No logic/behavior should change, unless we were unit testing callInitializers.

* Shorten method by moving long list of logicless calls to a helper

"We don't want to make a habit of pandering to Code Climate and its
metrics blindly".

Appease the robot by moving about 20 lines of uninteresting sequential
code out of the initializePage function and into a "callInitializers"
function, which is also the name of the function I just inlined.
2021-04-12 09:57:40 -05:00
Fernando Valverde
f0b8754d4f
Feature: Runtime Content Filter (#13007)
* Working version of Runtime Filter with banner behind Feature Flag

* First attempt to add a cypress test

* Adds simplified test

* Cleanup global references

* Add multi-platform e2e test

* Use --runtime-display var with fallback to block

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

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

* Add FeatureFlag stub to fix unrelated specs

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-03-25 12:04:45 -06:00
Marcy Sutton
f072730f0f
Header navigation dropdown accessibility (#11509)
* Improve keyboard a11y of header menu dropdown

This commit also includes some cleanup of unnecessary functions that seemed to degrade performance.

Closes https://github.com/forem/forem/issues/1154

* Add temporary focus style on navigation-button

* Put menu items in a list

* Adjust menu button based on VoiceOver testing

* Refactor menu logic to be reusable/work on touch

* Preserve admin link visibility

* Focus on first item on menu open

* Clean up some HTML and CSS

* Apply suggestions from code review

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>

* Ensure menu hides on click outside

* Rename toggle function and adjust formatting

* Update nav button focus style

* Clean up padding on header avatar focus style

* Make button show focus state for keyboard only

Using .focus-visible:focus targets keyboard focus and eliminates a flash of the blue border on click before focus is moved to the child item (which also has no focus style on mouse click)

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

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>

* Add some defensive programming

* Removed initializeTouchDevice from base.js.erb

* navigation-butt ID is now member-menu-button

* Moved all the logic from initializeTouchDevice.js into a pack file/utilities.

* committing re-ordered schema after setup

* add tests for initializeTouchDevice

* remove some unneeded html setup

* make sure menu doesn't close if user tabs back from sign out

* Revert "committing re-ordered schema after setup"

This reverts commit a41a1c861cca3b97d8a7b8a99268b8afaae9f028.

* optimized code

* small tweaks, only show outline when focused

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Co-authored-by: rhymes <rhymes@hey.com>
Co-authored-by: Nick Taylor <nick@dev.to>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-01-27 09:39:17 +00: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
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
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
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
Molly Struve
3d4a079572
[deploy] Refactor: Remove Additional Content Box Code (#8776) 2020-06-22 10:36:23 -05:00
ludwiczakpawel
9c471640b6
Footer redesign (#8684)
* flare tag line height

* .

* init

* moar

* user siteconfig for mascot

* .
2020-06-18 12:52:03 +02:00
Ben Halpern
c1dca335c7
[deploy] Allow users to set a payment pointer for their content (#8304)
* Initial user payment pointer work

* Finalize functionality and tests

* Fix schema

* Update app/views/shared/_payment_pointer.html.erb

* Add function to list
2020-06-09 16:28:16 -04:00
Vaidehi Joshi
f04b0a7336
Display site-wide announcements (#8301)
* Serialize broadcast_data within AsyncInfoController::base_data

Adds a `broadcast:` key to our `base_data`, regardless of whether a user is logged in or not.
If a broadcast is not present, passes along a `nil` value.

* Initialize active broadcast (if present) when rendering main page

* Allow admins to preview a broadcast's processed_html when editing

* Add some fixed position styling to active broadcast

* Add system specs around broadcasts on homepage

* Use sanitize in place of html_safe when previewing broadcast

* Do not initialize broadcast if no broadcastData available

* Render default value on broadcast in options_for_select

* JS cleanup

* Unset fixed positioning for static navbar config

Also add some default styling for an active broadcast
2020-06-08 13:52:53 -04:00
rhymes
ce28c0b5e5
[deploy] Remove ERB pre-processing from pure JS files and cleanup (#8030) 2020-05-27 08:25:39 -05:00