Commit graph

53 commits

Author SHA1 Message Date
Rajat Talesra
cce51588db
Replace uses of toBeDefined with toExist (#19862)
* Replaced toBeDefined with toExist

* Revert db changes
2023-08-04 19:58:58 +05:30
Rajat Talesra
895c40c2a7
Updated storybook (#18559) 2022-10-11 12:54:50 +05:30
ludwiczakpawel
086a53ba93
Storybook updates (#15848)
* updates

* updating doc

* Fixed broken documentation in Storybook stories.

* bring back a element

* md --> mdx

* c-* doc update

Co-authored-by: Nick Taylor <nick@dev.to>
2022-01-14 11:06:23 +01:00
ludwiczakpawel
ea28093bbb
Implementing new buttons (#15843)
* buttons

* view archive link block

* revert font weight change

* save draft title

* revert

* fix

* specs

* specs

* spec

* spec

* for fcks  sake

* Change spec for unarchive/archive button from .find to .findByRole

* fix help icon

* improve a11y on close.jsx

* bring back the focus

* .

* Update cypress/integration/seededFlows/publishingFlows/uploadImage.spec.js

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

* drop icons.jsx

Co-authored-by: Nick Taylor <nick@dev.to>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-01-14 10:28:31 +01:00
Josh Soref
5324eb1477
Spelling fixes to live code (#15670)
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2021-12-06 12:11:25 +02:00
Jeferson S. Brito
a0e15f7bd6
Add Snackbar component on reading list (#15235) 2021-11-15 13:06:21 +02: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
ludwiczakpawel
15b9c0be96
CSS cleanups (#15198)
* cleanups

* whoops

* ...

* add pseudo snackbar
2021-11-02 09:29:57 +01:00
ludwiczakpawel
88a3b573ea
Page headers unified (#15158)
* fix; remove the bottom 100%

* dashboard

* fixes + magic border-radius

* everything

* fix

* fix

* spec

* split PRs

* Update app/assets/stylesheets/views/listings.scss

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

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2021-10-25 21:41:29 +02:00
ludwiczakpawel
d1aac57053
Podcasts fixes (#15130) 2021-10-22 11:06:11 +02: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
dependabot[bot]
62e150f5af
Bump eslint-config-preact from 1.1.3 to 1.1.4 (#13516)
* Bump eslint-config-preact from 1.1.3 to 1.1.4

Bumps [eslint-config-preact](https://github.com/preactjs/eslint-config-preact) from 1.1.3 to 1.1.4.
- [Release notes](https://github.com/preactjs/eslint-config-preact/releases)
- [Commits](https://github.com/preactjs/eslint-config-preact/compare/v1.1.3...v1.1.4)

Signed-off-by: dependabot[bot] <support@github.com>

* Add missing key prop for elements in iterators where necessary

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2021-04-27 18:54:43 +02:00
Suzanne Aitchison
2998cb4555
remove extra key handler on archive button (#13392) 2021-04-14 13:34:47 +01:00
Nick Taylor
37d7cdbef7
Now the load more button only appears (if necessary) when the reading list is finished loading. (#13327) 2021-04-09 10:17:52 +02:00
Nick Taylor
86deddbb75
Fixed Reading List on Mobile + Small Improvements (#12755)
* Some div soup to semantic markup.

* Small refactor to inline mapping of available tags.

* Renamed <ItemListTags /> component to <TagList />.

* Now a select is used for picking a tag to filter on.

* Added custom Cypress command to create an article.

* Added documentation for the create article custom command.

* Removed unnecesary properties from payload to create an article.

* reading list mobile view wip.

* Reworked styles in <TagList />.

* Reworked reading list to use <MediaQuery /> component.

* Removed bottom padding from reading list header.

* styling tweaks if there are no available tags.

* Added some E2E tests.

* Removed reading list component test in favour of e2e test.

* Made breakpoint values numbers.

* Added some padding and more grid gap to filter on small screens.

* Adjusted jest coverage thresholds as we're moving some tests to e2e tests.

* Reverting a VS Code setting change caused by one of my extensions.

* First pass for E2E tests for the reading list.

* Added some more grid gap.

* Fixed load next page to send tags properly.

* Added some more tests.

* Improved label and placeholder for text filter in reading list.

* Added more tests

* Fixed media queries so it works in Chrome as well.

* Removed aside as tag filters are not complimentary information.

* Update app/javascript/readingList/components/TagList.jsx

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

* Update docs/tests/e2e-tests.md

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

* Turned off deprecated rule in jsx-a11y eslint plugin.

* Reverted to links instead of radio buttons.

* Added an all tags link and select option.

* Fixed relayout issue.

* Fixed View Archive button size.

* Fixed styling of the load more button.

* Fixed empty list issue toggling between archive and reading list.

* Fixed request changes from PR review.

* Removed CSS change that is no longer required.

* Trigger Build

* Fixed centering of items in top fieldset.

* Fixed issue with search text field resetting reading list.

* Fixed component tests for the reading list.

* Fixed empty state popping up between search queries.

* Fixed casing of fixture filenames.

* Update app/javascript/readingList/readingList.jsx

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

* Reverted change in reading list component test.

* Added missing JSDoc comment.

* Now links are in an unordered list.

* Promoted some CSS classes from the <nav /> to the <ul /> for spacing.

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-04-08 12:53:43 +01:00
Vaidehi Joshi
95055b2a89
Remove pro role + expose analytics to all users via dashboard (#13156)
* Remove pro role on user, expose pro dashboard to all users as analytics

* Remove pro from Elasticsearch mappings

* Update user role docs to use :trusted over :pro

* Remove pro from Role model spec

* Remove more references to pro, as noted by @rhymes
2021-03-30 15:02:18 -07:00
rhymes
83852038e4
[Search 2.0] Reading list (#13052)
* Step one in populating the reading list with PG

This first attempt tries to recycle the `Search::ArticleSerializer` which is only
used in input in ES, but we're using it in output in PG.
For this reason it's currently 15.55x times slower

* Serialize only what is requested by the frontend

`Search::ArticleSerializer` which is only used in ES in the indexing step aims
to add as much info as possible for broader purposes, in this case
(with serialization in output) we should aim to save only what's requested from
the frontend.

* Optimize selection of articles columns

* Select only needed columns for users

* Compute total of reading list items

* Attach the basic filtering based on PG on the search controller

* Restructure in methods

* Add tags support

* Use LIKE on articles.cached_tag_list

* Fix tags as nil

* Fix default pagination

* Add optional FTS for reading list

* Reworded the tags comment explaining why

* Add index to reactions.status

* Fix total counter in Preact readingList component

* Fix total count in reading list backend search

* Add GIN index to articles.cached_tag_list

* Add service tests

* Add search request specs

* Added missing early return

* Update spec/requests/search_spec.rb

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

* Extract MAX_PER_PAGE constant and add comments

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2021-03-24 15:40:00 +01:00
Nick Taylor
d90e5662ef
Created the <MediaQuery /> component and useMediaQuery hook. (#12809)
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-02-25 14:28:44 -05:00
Suzanne Aitchison
5abe88c69b
Add skip links to readinglist, podcasts, and listings (#12769)
* add skip link functionality to readinglist, listings and podcasts

* fix initscrolling reference to podcasts
2021-02-23 08:33:26 +00:00
Nick Taylor
13803d94a9
Reading List 15 minute fixes to prepare for #11983 (#12710)
* Some div soup to semantic markup.

* Converted an import to use our webpack @utilities alias.

* Removed unnecessary t variable to house .

* Removed state that can be derived from other component state.

* Removed unused state property .

* Reverted to <div /> as per PR feedback.
2021-02-18 11:16:50 +01:00
Nick Taylor
66e4747d3f
Change fetch to our request utility function. (#12709) 2021-02-17 10:37:05 -05:00
Katie Davis
76453b41fb
Updates ESLint rules to error on default imports (#12512)
* add rule

* add named imports

* more missed files

* so many files
2021-02-02 10:24:03 -05:00
Nick Taylor
425c3072f7
Fix broken test pre-Preact upgrade (#12328)
* Removed import of xss as it already happens in testSetup.js

* Fixed invalid setting for a the children prop.
2021-01-18 14:39:17 -05:00
Nick Taylor
779551916a
Fix frontend test setup file (#11623) 2020-11-25 15:27:06 -05:00
Michael Kohl
2fd724d191
Update empty reading list copy (#11565)
* Change wording

* Add icon

* Update app/javascript/readingList/readingList.jsx

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

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
2020-11-24 09:40:04 +07:00
Nick Taylor
bf7780cd2c
Ran prettier on *.js, *.jsx and *.md files. (#11586) 2020-11-23 20:45:50 -05:00
Nick Taylor
8c22bbd17b
filterXSS is now set up in testSetup.js (#11579) 2020-11-23 14:08:13 -05:00
Andy Zhao
97e6c2295d
Filter by tags of reading list items not tags you follow (#11394)
* Filter by tags of reading list items not tags followed

* Sort the reading list tags
2020-11-13 10:45:32 -05:00
ludwiczakpawel
bf8e2e53f1
Titles & subtitles cleanup (#10508)
* .

* .

* .
2020-10-02 12:37:39 +02:00
ludwiczakpawel
b6bc589a4f
Crayonisification of "Reading list" (#10428)
* saved

* saved

* headers level

* maybe i can test

* revert renaming

* fix
2020-09-28 15:53:20 -04:00
Molly Struve
86cb66e858
[deploy] Feature: Serve Reading List from FeedContent Index (#10294)
* Feature:Serve Reading List from FeedContent Index
* Fix paging, order ID desc, improve comments
2020-09-17 17:20:14 -05:00
ludwiczakpawel
3a69f349be
[deploy] Refactor code blocks styling (#8975)
* flare tag line height

* .

* dropdown fix + actions bar fix

* actions bar on mob

* .

* missing bit

* document

* .

* little fix

* btn--highlight
2020-06-29 21:15:11 -04:00
Nick Taylor
a7938ed287
Fixed a bunch of linting issues in components (#8921) 2020-06-26 10:26:02 -04:00
Nick Taylor
63b4d9fdc0
More frontend test cleanup (#8919) 2020-06-25 18:04:01 -04:00
Nick Taylor
09bb730f9d
Added a11y tests to frontend tests that were missing them (#8873) 2020-06-24 14:38:39 -04:00
Nick Taylor
568ada8fe6
Cleaned up some tests. (#8817) 2020-06-22 10:25:39 +02:00
Nick Taylor
653ec12300
Upgrade to Preact 10.4.4 (#8739)
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2020-06-18 10:07:17 -04:00
Nick Taylor
b376d109ef
Moved src/components/Item* to readingList/components (#7876) 2020-05-15 11:00:06 -04:00
Nick Taylor
03ff779ca3
Moved src/utils out of src/ folder to utilities/ folder. (#7875) 2020-05-15 10:07:42 -04:00
Molly Struve
4ab202ab0a
[deploy] Execute Reading List searches in Elasticsearch (#7440)
* Execute Reading List searches in Elasticsearch

* add additional readinglist front tests
2020-04-24 10:30:17 -04:00
Vaidehi Joshi
a66dc2693a
Refactor debounce usage into debounceAction util (#6506)
* Refactor debounce usage into debounceAction util

* Allow debounceAction's config to be merged, allow for named arguments

Also clean up the documentation as necessary!
2020-03-09 17:38:39 -04:00
Mehdi Vasigh
42771beb5d add heading and clear all btn to tag filters (#4620) 2019-10-28 09:39:47 -04:00
RakChamp25
00f6f45334 Refactor readingList.jsx (#4388) [ci skip] 2019-10-16 10:40:01 -04:00
rhymes
209b0ba607 History and reading list refactoring (#3338)
* Make readingList testable

* Make history and readingList more similar

* Extract ItemListTags component

* Simplify load next page logic

* History and reading list load more should be the same

* Extract ItemListLoadMoreButton component

* Use the same exact CSS for both

* Use empty instead of 0

* Extract ItemListItem component

* Remove unnecessary else

* Same search function

* Use a common module to group related functionality

* Extract loadNextPage and fix load more button presence logic

* Extract toggleTag

* Refactor toggleStatusView and pass page

* Added additional tests
2019-07-02 09:22:21 -04:00
Bolarinwa Balogun
bd360c7cf4 Make item count 'empty' instead of '0' when reading list is empty (#3320) 2019-06-28 07:55:43 -04:00
Bolarinwa Balogun
bc54f30365 Add Item Count to Reading List Header (#3162) 2019-06-25 09:41:28 -04:00
Thanawat Senawat
6fc17a29cb Feature/reading list loadmore button (#3221)
* Add Load More Button to Reading List

* Set state showLoadMoreButton is false
2019-06-20 13:33:02 -04:00
rhymes
2bf54edb9c Pro: History (#3220)
* Add base history support

* Add tags and ranking and make it work

* Fix styling

* Add article title and text excerpt to the index

* Add pagination support

* Debounce the search to 300ms

* Show history only to pro users

* Use routing helpers instead of hardcoding

* Raise the page size to 100

* Remove console log

* A bit of regrouping
2019-06-18 14:58:24 -04:00
Mario See
8359ab555f Add reading time to reading list (#2929)
* init

- add reading_time to reactions
- make migration
- add to algolia index in reaction model
- add method in reaction model to define reading time based on reactable reading time

* add time to front end

* Revert "Return errors instead of raising an exception on ArticleCreation (#2922)"

This reverts commit 09a99d93a3.

* Revert "init"

This reverts commit 53650ebcc3c93c54e396977f7c34f7aa35a589c4.

* Revert "Revert "Return errors instead of raising an exception on ArticleCreation (#2922)""

This reverts commit e8cf1f3a290dd06b937247e3ff7593e7c7036553.

* Update reaction.rb

* remove duplicate searchableAttribute
2019-05-31 16:45:29 -04:00
briwa
4f31c6d07a fix(reading-list): even spacing for Save and Bookmark span (#3000) 2019-05-29 11:19:01 -04:00