Commit graph

40 commits

Author SHA1 Message Date
Ben Halpern
b3b0eafe76
Implement MVP frontend for Algolia search (#20909)
* Add proper frontend for Algolia search

* Update app/models/concerns/algolia_searchable/searchable_comment.rb

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

* Update app/models/concerns/algolia_searchable/searchable_article.rb

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

* Fix formatting

* Fix: copy to clipboard message (#20898)

* fix: copy to clipboard message

* chore: deletion of unused imports

* Pick winner in header field test (#20911)

* Updated the twitter icon to X icon - solved icon issue #20356  (#20910)

* changed the twitter icon to X icon in assets/images/twitter.svg

* Changed the twitter icon to X in assets/images/twitter.svg

* Add field test for Digest article list design (#20912)

* Add field test for Digest article list design

* Add check for cached user

* Include cached user in select (#20913)

* Include cached user in select

* Add tags

* update style for new follower email (#20908)

* Fix #19037 (#20917)

* Add alternate returns for html

* Remove console log

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Iasmim Pereira <100351576+IasmimCristina@users.noreply.github.com>
Co-authored-by: Darshan Padia <darshanpadia5@gmail.com>
Co-authored-by: Philip How <philip.j.how@gmail.com>
2024-05-06 15:20:53 -04:00
PJ
3f7d1fbc1a
Create feed impression and click events (#20043)
* getting started: model setup

* basic controller action & spec

* somewhat working click events

* pick up on impressions

* there was an attempt at batching without duplicates

* (better) bulk upsert service

* fix specs?

* touch up feed events JS

* end-to-end specs??

* workers wip

* fix failing user delete spec
2023-09-11 13:32:36 +01:00
Mac Siri
e98b00b45f
Update search result rendering for Organization (#19740) 2023-07-12 11:53:08 -04:00
Ben Halpern
d8ac9e27fb
Fix profile_image bug in org search (#19444) 2023-05-09 17:54:22 +02:00
Lawrence
2da9b9a0af
Organization Search Filtering (#19430)
* add org fitlering init logic

* further styling of the org block

* add tests and fix sort by error

* serializer spec

* org slug instead of twitter

* add utility CSS
2023-05-08 14:58:25 -05:00
yheuhtozr
a6030022f6
[CP] fix multiple reaction icons joined by commas (#19288) 2023-04-04 22:34:18 +05:30
Joshua Wehner
b812ca5955
(Really) Enable multiple reactions on #index (#19202) 2023-03-22 10:20:00 -04:00
Joshua Wehner
727705dc89
Revert "Enable multiple reactions on #index (including front-end render)" (#19197) 2023-03-03 09:59:51 -05:00
Joshua Wehner
8a45a4bf67
Enable multiple reactions on #index (including front-end render) (#19169)
* Revert "(Temporarily) Remove multiple reactions from #index (#19142)"

This reverts commit a45d300639.

* Clean up reaction category count mechanism for #index

* Remove, unnecessary

* Expose reaction categories in JSON response

* Update test with new categories

* Fix flaky sample / minimum floor

* buildArticle (infinite scroll) with multiple reactions

* If we're doing #index front-end, we aren't feature-flag'd

* nbsp

* react (home feed) has multiple_reactions

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

Co-authored-by: Rajat Talesra <rajat@forem.com>

* Clean up Reactable#reaction_categories

* Use 'multiple_reactions_icons_container'

* Try adding a ReactionCount test

* Adapt memory fix from 76dd53d

* Try adding categories to fixture

* Attempt to eager-load distinct public categories

* Setting dependent to the default for rubocop

* Try making image assets more public?

* Revert "Fix flaky sample / minimum floor"

---------

Co-authored-by: Rajat Talesra <rajat@forem.com>
Co-authored-by: Mac Siri <mac@forem.com>
2023-03-03 15:17:19 +01:00
Rajat Talesra
d4d7d8f409
CSS: Dark mode minor fixes (#19014)
* Dark mode fixes

* Bookmark fix
2023-01-26 15:31:46 +05:30
Eevis Panula
09e327b7c2
Add more descriptive accessible names for save/bookmark-buttons (#18583) 2022-11-10 09:48:13 -05:00
Jeferson S. Brito
e0638d391c
Replace article's save button with bookmark (#17893) 2022-08-19 12:03:57 -04:00
Jhonatan Hidalgo
998d39cd4c
Focus comment box when entering by "comments" button from home feed (#18132) 2022-07-28 14:17:46 -05:00
Suzanne Aitchison
9bb600168b
filter xss on user name (#18026) 2022-07-01 16:03:07 +01:00
Arit Amana
0d023163ba
Hide 'Save' button on posts that belong to the current user (#17293)
* implement change

* struggling with tests

* extend implementation to relevant views

* update Article.test.jsx snapshot

* fix failing specs

* query userData more robustly

* default saveable value in SaveButton component

* fix spec

* fetch currentUser async
2022-04-28 12:33:01 -04:00
Suzanne Aitchison
ac7f1a6db6
Fix error in feed follow buttons where user name has apostrophe (#16758)
* escape apostrophes in names

* woops
2022-03-02 15:53:48 -05:00
ludwiczakpawel
1abf02d94b
Generator updates (#16339)
* generator

* mod tools update
2022-01-28 12:20:30 +01:00
Anna Buianova
3fdb87ee66
Added "Tags" category to search results (#16265)
* Added tag search to nav menu

* Added tag search

* Improved tags search results view

* Removed commented lines from the controller

* Fix specs for Search::Tag

* Prepare for tags search pagination

* Fixed Search::Tag specs

* styling

Co-authored-by: Paweł Ludwiczak <ludwiczakpawel@gmail.com>
2022-01-26 20:51:15 +03:00
Jeremy Friesen
3253ba2c7a
Patching ERB rendering of the data-info JSON (#16067)
Prior to this commit, we were somewhat naively rendering Hash style data
attributes in our ERB templates.  By rendering each hash attribute
separately, we were rendering characters that could break the
javascript (e.g. double hack or backslash `"` or `\`).

By moving to this view_object rendering, we leverage Rails's `to_json`
behavior to ensure properly escaped values.  As part of this exercise, I
generalized the method to allow for other places to benefit from this
behavior.

This generalization also helps ensure that we have a more conformant
rendering (e.g. we should always have an :id, :className, and :name
value in our data-info hash).

_Note: I've updated the user's names for Cypress tests as they are more
likely to catch the particular issue than anything else.  I assume that
I'm going to break some cypress tests and will need some help fixing
them._

Closes #15916, #14704

Supersedes #15983

How to test locally:

Assuming you have seeded database (e.g. `rails db:seed`), checkout the
"main" branch.  Then in `rails console` find a user that's written articles:

```ruby
user = Article.last.user

user.update(name: "\\: #{user.name}")

user.articles.each(&:save)
```

Now, again on the "main" branch, start your application (e.g.,
`bin/startup`).

Then get a logged in and a logged out browser session going.  Open your
web inspector and open console.  Then go to the local instances homepage
(e.g., http://localhost:3000) and look for JS errors.

On the main branch, you should see an exception around
`JSON.parse(button.data.info)` (assuming that the `user`'s article is
rendered on the homepage).

Then go to the user's page (e.g. https://localhost:3000/:user-slug) and
look for JS parse errors.

On this PR's branch (e.g.,
`jeremyf/take-two-at-resolving-gh-15916`)
you shouldn't see those console errors.

More importantly, the Follow buttons should work.
2022-01-14 08:30:49 -05:00
ludwiczakpawel
09db50b296
Update tag's style (#15266)
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Michael Kohl <citizen428@forem.com>
2021-11-11 14:03:31 -05:00
Pramod
ce4ba84184
fix: accessibility issue with feeds comment section (#14958)
* fix: accessibility issue with feeds comment section

* fix: comments section name for logged out scenario and search results

* fix: review changes for logged in scenario

* fix: updated comments section aria label
2021-10-07 17:01:42 +01:00
ludwiczakpawel
987c48771c
padding fix (#14766) 2021-09-20 17:45:18 +02:00
ludwiczakpawel
f2f2c34673
3d drop shadows (#14701)
* remove 3d box shadow

* profile cards fixes

* little fix

* dark mode + listings modal

* dropdowns padding

* whoops
2021-09-13 11:02:53 +02:00
Keshav Biswa
42c9a10f57
Accessible names for follow buttons (#14389)
* added follow hidden tags for accessibility

* fixed failing tests

* replaced hidden span with screen-reader-only with aria-label

* add aria-label dynamically to follow buttons

* fixed followButtons

* fixed cypress tests and updated addAriaLabelToButton helper

* Fixed failing tests

* fixed failing tests

* Update cypress/integration/seededFlows/notificationsFlows/followUserFromNotifications.spec.js

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

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-09-07 16:09:06 +01:00
Suzanne Aitchison
bfb4f00aae
Add copy to HTML feature for storybook (#14599)
* Add copy to HTML feature for storybook, inc fix for article markup

* remove html stories no longer needed
2021-08-27 16:09:21 +01: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
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
Jacob Herrington
0c6f4113f2
Fix irregular comment count buttons (#12724)
* Fix irregular comment count buttons

* Fix irregular comments button on tag and user page

* Add regression tests for irregular comment buttons
2021-02-22 12:11:44 -06:00
Arit Amana
23f3386f3f
Don't display '0 reactions' on article feed (#12425)
* Implement for Feed Card only

* update snapshot

* write tests

* Implement changes in other article-feed-card views

* modify failing spec

* Address code review comments
2021-01-27 11:13:10 -05:00
Mac Siri
ab95635dc6
Filter XSS in navigationLink's title (#12003) 2020-12-22 12:05:41 +01: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
Robin Gagnon
4fabc3a5e6
fix: Add hidden navigation link to article HTML (#11465) 2020-11-18 14:50:19 +01:00
Fernando Valverde
449cf89737
Uses template literals to more clearly interpolate a complex string in buildArticleHTML.js (#11457) 2020-11-17 14:45:32 -06:00
Robin Gagnon
27a3df7d73
A11y: Add keyboard navigation to article feed (#10468)
Co-authored-by: Andrew Bone <AndrewB05@gmail.com>
Co-authored-by: Nick Taylor <nick@dev.to>
2020-11-10 22:38:15 -05:00
Robin Gagnon
10d7da2878
feat: Add shortcut to bookmark an article (#11116) 2020-10-27 12:44:03 -04:00
Akshay Mahajan
ff918daa20
Remove flare tag from title and hightlight it within the tags row (#10528)
* Remove flare tag from title and hightlight it within the tags row

* wrap flare tag # in a span with class crayons-tag__prefix

* updated buildArticleHTML.js to show flare tag in the tags row

* updated _single_story.html.erb to show flare tag in the tags row

* fixed missing opening tag

* removed crayons-story__flare-tag class and containers

* added .crayons-story__flare-tag back to stories.scss for search results

* added check for undefined tagList in buildArticleHTML.js
2020-10-15 16:09:14 +02:00
ludwiczakpawel
4bf69e64c5
Update search menu to use Crayons styling, v2 (#10347)
* Replace old query style with crayons link block

* Add Crayons layout

* Rename nav file and refactor how it's referenced in parent file

* Rename sidebar file

* style updates

* more changes

* podcasts

* .

* code format

Co-authored-by: Lisa Sy <lisasyis@gmail.com>
2020-09-16 22:03:34 +02:00
ludwiczakpawel
503b1e3be6
Remove dimmed buttons on feed (#9894)
* flare tag line height

* .

* dropdown fix + actions bar fix

* actions bar on mob

* fix
2020-08-26 08:08:31 +02:00
ludwiczakpawel
dbbe158d21
Buttons: Ghost Dimmed (#9626)
* flare tag line height

* .

* dropdown fix + actions bar fix

* actions bar on mob

* ghost dimmed

* add to page/crayons
2020-08-06 11:03:06 +02:00
rhymes
ce28c0b5e5
[deploy] Remove ERB pre-processing from pure JS files and cleanup (#8030) 2020-05-27 08:25:39 -05:00