Commit graph

124 commits

Author SHA1 Message Date
PJ
9754d14182
Fix intermittently broken reaction images on home feed (#19779)
* move reaction icons to base layout

* fix reactions count specs??

* also fix article specs
2023-07-27 19:48:07 +01:00
Anna Buianova
ffb560c2a7
Rename DisplayAdEvent to BillboardEvent (#19833) 2023-07-26 13:57:02 -04:00
Joshua Wehner
862cd54dc7
Refactoring onboarding (#19525)
* Quick refactor onboardings controller(s)

* Quick refactor onboardings controller(s), pt2

* Quick refactor onboardings controller(s), pt3

* Quick refactor onboardings controller(s), pt4

* Quick refactor onboardings controller(s), pt5

* Add test for checkboxes
2023-05-25 10:03:12 +02:00
Lawrence
1b32e9a8e3
Hero Billboard Placement (#19467)
* init

* add option to swagger docs

* in_house validation

* filtered ad quesry changes

* styling and prioritizing home hero banner over campaign banner

* rubocop

* typo

* broken spec

* more spec fixes

* found the spec break culprit

* derp

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

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

* Update app/controllers/stories_controller.rb

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

* remove immediate return

* styling feedback and moving banner to articles index

* remove nil

* updated styling

* add signed in bool

* add feature flag

* remove feature flag data scripts

---------

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-05-18 12:37:32 -05:00
PJ
800ff397e0
Migrate initializeArticleDate and initializeArticleReactions to Webpack (#19377)
* feat: tests for series list on article page

* feat: test for jump to comments button (needs fix)

* feat: tests for reaction drawer on article page

* feat: test for full date on hover??

* feat: add full date on hover tests for all pages with publish dates

* fixed jumping to comments test

* move initialisers to packs

* fix coverage issues

* fix flaky login modal spec

* switch back to using onclick instead of addEventListener
2023-04-25 18:33:43 +01:00
fille du chaos
bef1c4a1e0
Migrate initializeDrawerSliders and initializeHeroBannerClose to Webpack (#19324)
* feat: tests for tag page sidebar drawers on mobile

* feat: tests for hero area/banner on home feed

* refactor: move ui interaction initialisers to packs

* remove old filter select implementation
2023-04-17 10:55:02 +01:00
Joshua Wehner
b812ca5955
(Really) Enable multiple reactions on #index (#19202) 2023-03-22 10:20:00 -04:00
Julianna Tetreault
806a5a774e
Backfill community_emoji data with a DUS 🌱 (#16896)
* Adds a DUS to backfill community_emoji for Forems that have one

* Adds a DUS spec to test backfilling community names

* update the script adn the tests to allow us to change the community name

* feat: add a stub for the community name

* feat: generate a later timestamp so that it doesnt cause confusion

* chcek if the emoji already appears in the community name

* feat: remove community emoji from displaying on the UI

* refactor:remove the else if completely

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2022-08-26 16:12:46 +02:00
Mac Siri
4b37f2384c
Refactor OnboardingsController (#17329)
* Refactor OnboardingsController

* Fix broken spec

* Update policy

* Fix spec

* Update config/routes.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Touchup

* Update routes

* Screw it, let's move notification_settings too

* Revert "Screw it, let's move notification_settings too"

This reverts commit aead8c05f4dda62cbc46cdd033afd0acdef2ad73.

* Temp .travis.yml changes

* Revert "Temp .travis.yml changes"

This reverts commit c26109843ba027f9a524e66282a9b01f0341f836.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-04-27 16:17:02 -04:00
Takuya N
26e10fc71e
Use the canonical URLs to link from sorted pages (#16928)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-03-22 14:51:36 +00:00
Suzanne Aitchison
03660423b9
Rename feeds + update feeds' tabs UI (#15435)
* Rename feeds + update feeds' tabs UI

* rspec updates

* change relevance to relevant
2021-11-29 07:51:24 +00:00
yheuhtozr
a6f08ae215
views/stories, views/layouts and other homepage i18n (#15083)
* views/stories and home related i18n

* PR key names fixes

* remove ja.yml

* Update en.yml

* Update fr.yml

* Update articles_search_spec.rb

* Update _meta.html.erb

* Update index.html.erb

* Update _meta.html.erb

* Update articles_search_spec.rb

text in HTML should not contain raw brackets

* Update articles_search_spec.rb

* Update _signup_modal.html.erb

* Add back missing Search text

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
2021-11-10 07:38:43 -06: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
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
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
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
Julien Maury
3f7ef05a9d
include extra space when adding attr aria curent (#13991) 2021-06-15 11:02:20 -05:00
Julien Maury
f7cc60e84f
fix usage of aria current - html error (#13963)
* fix usage of aria current - html error

* delete tests for aria current empty value

* delete tests for aria current empty value - tag nav

* missing occurrences should have attr aria current

* e2e tests: make sure other nagivation items do not have attr aria-curent

* e2e tests (tagged nav): make sure other nagivation items do not have attr aria-curent

* missing case @latest

* @latest is only for tagged nav

* every single nav item needs the test for aria-current
2021-06-15 12:06:17 +01:00
Ben Halpern
5dcf3678b2
Fix tiny mobile select bug (#13902) 2021-06-02 13:04:16 -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
Andrew Bone
f6e222f12e
Fix layout shift on active crayons-tabs change. (#13300) 2021-05-12 11:45:36 -04: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
Michael Kohl
610f6151e6
Split Settings::Community from SiteConfig (#13403)
* Add settings_community_contents model

* Add settings_communities model

* Update usage

* Add controller and update code

* Add e2e test

* Add data update script

* Update schema.rb

* Fix specs

* PR feedback

* Remove experience_* from Settings::Community

* Update spec

* Fix spec
2021-04-26 10:46:35 +02:00
Julien Maury
cb3d6f6d22
Remove HTML errors (PR n°2 - fixed) (#13350)
* delete alt attribute on span

* delete role checkbox on button - add type button

* delete wrong aria label

* sidebar-nav as class not ID

* delete duplicate attr class on single story

* delete duplicate attr class sidebar nav

* Revert "delete role checkbox on button - add type button"

This reverts commit 456fa676ff4457ffa724e9a07a3f123149dc5f39.

* delete role checkbox and modidy spec login modal js

* no need for name in cypress test showloginmodal anymore

* add attr data-test-id

* replace attr defer with DOMContentLoaded event

* delete useless class

* better a11y approach for button and cypress tests

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

* better a11y approach for button and cypress tests

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

* discussion_r612278777 : change initialize article reactions js

* revert replacing `const` with `let`

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

* revert replacing `const` with `let`

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

* apply `aria-hidden` on all reaction svg

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

* keep original text `Saved` for bookmark button

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

* fix missing aria-label on load - reaction button

* Revert "replace attr defer with DOMContentLoaded event"

This reverts commit db6a7eec051c443c18c17e23cf331132b222011f.

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-04-14 14:06:44 +02:00
Julien Maury
36adcd740d
Remove some HTML errors (#13288)
* make clean_fork executable

* fix attribute className not in a JSX context

* delete useless role main on main tag

* delete useless role banner on header
2021-04-07 11:46:12 +01:00
Suzanne Aitchison
c761c3f9a7
Provide skip links: Tweak skip link style, refactor main area ID (#12694)
* change home page main id to main-ontent, update scroll, refresh and shortcut handlers

* update articles by timeframe test with new main-content id

* tidy up css

* Trigger Travis CI

* undo unneeded changes

* small refactors
2021-02-17 10:15:31 +00:00
Mac Siri
e35c455d87
Fix incorrect datetime format (#12601) 2021-02-08 10:06:20 -05:00
Julianna Tetreault
ca6ba1af7d
Replace collective_noun with community_name (#11846) [deploy]
* Removes collective_noun and collective_noun_disabled from app

* Config Generalization: replaces community_qualified_name with community_name
  - Generalizes SiteConfig after the removal of collective_noun field
  - Updates copy where necessary to be readable with community_name
  - Makes the community_name SiteConfig description more explicit
  - Adds flexibility for Admins by removing appended "community"

* Adds a data_update script to remove collective_noun and collective_noun_disabled

* Removes appended community from stories_controller.rb

* Removes unnecessary quotation marks around SiteConfig.community_name.to_s

* Makes SiteConfig community_name description more explicit

* Removes topic from #email_from and replaces arg with _

* Removes argument from #email_from (facepalm)

* Reverts changes to application_mailer and notify_mailer_spec

* Removes default "Community" topic from application_mailer and makes topic optional

* Refactors #prepopulate_new_form to resolve Code Climate failures

* Refactors #email_from even further by use of a ternary operator per review suggestion

* Simplifies the data_update script used to remove collective_noun per review request

* Adds a data_update script to append community to community_name

* Updates data_update script to correctly append Community to community_name

* Removes RemoveCollectiveNounFromConfig and updates other script

* Removes superfluous false from data_update script

* Updates data_update script to be more idiomatic
2020-12-28 09:34:17 -07: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
Michael Kohl
5c2f27baed
Remove timeframer from app/labor (#11782)
* Move file

* Update usages

* Simplify
2020-12-08 12:52:33 +07:00
Marcy Sutton
b04b5bcb57
Headings and alt text roundup (#11721)
* Adjust heading order

No skipping levels, adding an h1 for the homepage

* Add missing image alt text

* Update after PR review

* Update test snapshot

Co-authored-by: rhymes <rhymes@hey.com>
2020-12-04 09:41:45 -05:00
Vaidehi Joshi
59ea42a372
Add community_emoji to SiteConfig (#11450)
* Add optional community_emoji to SiteConfig

* Remove hardcoded emojis, favor community_emoji instead

* Remove remaining hardcoded emojis

* Validate community_emoji field when updated
2020-11-17 14:02:04 -08: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
Vaidehi Joshi
6d1aada37b
Conditionally hide onboarding task card (#11259)
* Hide onboarding task card on feed if user hasn't completed onboarding

* Fix some typos, use consistent capitalization

* Remove unnecessary saw_onboarding: true from test users

* Use predicate method for saw_onboarding?
2020-11-04 11:04:34 -08:00
Julianna Tetreault
894de8c73f
Add following_tags_count to release_adjusted_cache_key (#11055) [deploy]
* Adds following_tags_count to release_adjusted_cache_key

* Adds following_tags_count to release_adjusted_cache_key in index.html.erb
2020-10-26 07:46:08 -06: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
Vaidehi Joshi
c4efee10bf
Do not require meta_keywords to be set (#10721)
* Remove extra character from meta_keywords in /listings/index.html.erb

* Remove meta_keywords from MANDATORY_CONFIGS

* Add and use meta_keywords_tag helper

* Use modern tag syntax instead of deprecated syntax

* Add and use meta_keywords_default helper

* Add and use meta_keywords_article helper

* Remove * from meta_keywords_field.label

* Update meta_keyword specs to account for no keywords being set
2020-10-08 10:51:25 -04:00
ludwiczakpawel
bf8e2e53f1
Titles & subtitles cleanup (#10508)
* .

* .

* .
2020-10-02 12:37:39 +02:00
ludwiczakpawel
3e9b56a7dd
[deploy] Frontend cleanups (#10416) 2020-09-24 08:15:12 -05:00
Ben Halpern
45fb6504dc
[deploy] Replace HEROKU_SLUG_COMMIT with custom footprint (naive) (#9904)
* Replace HEROKU_SLUG_COMMIT with custom footprint (naive)

* Fully set RELEASE_FOOTPRINT with the expectation of setting it before launch

* Change tests

* Fix cache
2020-08-25 13:47:14 -04:00
Ridhwana
6029948c1a
[deploy] Make the mobile Navigation icons configurable (#9056)
* chore: make the icons dynamic from site config

* feat: update the navbar icons

* feat: update the descriptions

* chore: update the icons

* chore: update the names to be more reflective

* chore: freeze  mutable objects assigned to constants

* chore: update Line is too long.

* icons

* update lightning icon

* chore: read from file

* path here is relative, so use Rails root

* revert to original icons and run svgo on it

* no newline

* feat: update height, width
2020-07-08 20:09:48 +02:00
Ben Halpern
0de6e7db5e
[deploy] Add slash back for root link (#9043) 2020-06-30 19:17:18 -04:00
Vaidehi Joshi
c4d9c4aed9
Remove trailing slashes from URLs to improve SEO (#8836) [deploy] 2020-06-22 13:44:58 -07:00
Jacob Herrington
ad9c7797ec
Fix accessibility warnings from axe (#8718) 2020-06-17 10:48:38 +02:00
Jacob Herrington
54afa3ba91
Fix a11y issues flagged by axe on homepage (#8380)
* Fix a11y issues flagged by axe on homepage

This commit brings the number of violations found on homepage (local,
not prod) down from ~100 to ~10. It should have no serious impact on the
visual layout or design of the page.

* Change aria-labels to be consistent
2020-06-10 13:58:52 -05:00
ludwiczakpawel
39295c0bea
Layout updates (#8107)
* flare tag line height

* .

* init

* widgets

* widgets lists

* new tabs on home

* instantclick

* .

* rethinking css

* .

* .

* empty space

* campaign widget

* .

* merge

* .

* update layout

* fix sidebars on home page

* .

* fix onboarding x

* spec

* test

* test

* better handling ads

* .

* spec

* card styling

* .

* i dont know what have i broken
2020-06-04 16:12:17 +02:00
ludwiczakpawel
975ddc61c4
Home Feed Tabs - Crayonsified (#7976)
* flare tag line height

* .

* new tabs on home

* instantclick

* Some JS cleanup for mobile view select event handler.

* eslint cleanup

* select arrow color

* quotes

* quotes

* .

* .

* omg

* .

* finally

* focus visible

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
2020-05-27 14:48:18 +02:00
Ben Halpern
49a438f4ec
[deploy] Adjust overflow in comments and revert inline css (#7799)
* Adjust overflow in comments and revert inline css

* Fix color
2020-05-12 12:42:49 -04:00
Ben Halpern
2b0f5db638
[deploy] Include crayons style in index view for redundency (#7795) 2020-05-12 10:45:46 -04:00
Anna Buianova
346ce44169
[deploy] Configurable meta keywords (#7591)
* Added configurable meta keywords

* Replaced hardcoded meta-keywords with the configurable ones

* Added tests for configurable meta_keywords

* Improve info for configuring meta-keywords
2020-04-29 09:40:06 -04:00