Commit graph

1153 commits

Author SHA1 Message Date
Viviane Dias
27373c6cf8
Improves UI unit tests by correcting wrong use of queries (#17599)
* test(cover-image): uses correct queries for ui unit tests

* test(form): replaces queries to getByRole and adds expect where necessary

* feat(help): adds expect assert and uses within to test inside specific block

* feat(image-uploader): uses correct queries to validate behaviour

* test: corrects queries and adds expect assertions to some unit tests
2022-05-09 14:23:56 +01:00
Suzanne Aitchison
26af4d951a
Update crayons Modal to add sheet variant (#17576)
* update Modal to add sheet variant

* dont use prompt title for modal sheet stories, to better reflect intended purpose

* Apply suggestions from code review

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

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2022-05-05 14:32:35 +01:00
Suzanne Aitchison
50d2359049
add crayons modal to gdpr confirm delete flow (#17568) 2022-05-05 08:19:34 +01:00
Takuya N
275cdadb60
Pass options correctly to chart.js on articles#stats (#17435)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-05-04 09:42:55 +01:00
Suzanne Aitchison
648c86c612
Add prop for user-defined selections in MultiSelectAutocomplete (#17402)
* add new prop and update specs

* update storybook
2022-04-29 09:39:25 +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
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
dependabot[bot]
2bc63d6650
Bump focus-trap from 6.7.3 to 6.8.1 (#17425)
* Bump focus-trap from 6.7.3 to 6.8.1

Bumps [focus-trap](https://github.com/focus-trap/focus-trap) from 6.7.3 to 6.8.1.
- [Release notes](https://github.com/focus-trap/focus-trap/releases)
- [Changelog](https://github.com/focus-trap/focus-trap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/focus-trap/focus-trap/compare/v6.7.3...v6.8.1)

---
updated-dependencies:
- dependency-name: focus-trap
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* mock tabbable in jest

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-04-27 08:09:21 -06:00
Suzanne Aitchison
e6c4e3ba2e
ignore fetched suggestions if input already cleared (#17419) 2022-04-25 16:03:36 +01:00
Takuya N
aed1b9f8c8
Remove @storybook/addon-notes 5 (#17399)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-04-22 07:35:00 -04:00
Suzanne Aitchison
9d9bf8763a
fix bug in search and filter indicators (#17341) 2022-04-20 17:57:57 +01:00
Takuya N
3eee116104
Enable error tracking on sendFollowUser (#17328)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-04-18 22:13:31 -04:00
Takuya N
63c3229e36
Remove use of jQuery on admin config JS (#17206)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-04-15 07:13:00 -06:00
Ridhwana
2746e77fd5
Adding a modal for the CSV export (#17259) 2022-04-14 18:19:28 +02:00
ludwiczakpawel
3a753cd7f6
one checkbox (#17212) 2022-04-14 10:51:40 +02:00
dependabot[bot]
3f3b13f382
Bump @testing-library/user-event from 13.5.0 to 14.1.0 (#17253)
* Bump @testing-library/user-event from 13.5.0 to 14.1.0

Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 13.5.0 to 14.1.0.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v13.5.0...v14.1)

---
updated-dependencies:
- dependency-name: "@testing-library/user-event"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

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

* refactor to account for breaking changes

* remove redundant cleanup

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-04-13 10:41:08 -06:00
Suzanne Aitchison
64ed2c6dec
move showModal helper into its own pack file (#17266) 2022-04-13 14:15:07 +01:00
Miguel Nieto A
13c433cd56
fix: 🐛 Fix Color displaying over button in settings (#17172) 2022-04-11 10:59:57 +02:00
ludwiczakpawel
d6f204afc1
Toggle component (#17126)
* toggle

* box-sizing

* fixes

* whoopsy

* add specs for toggle component

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-04-11 09:44:43 +02:00
Suzanne Aitchison
bd097bca25
Member index: add copy email to clipboard functionality (#17146)
* functioning on large screen view

* layout tweak

* tidy up

* remove redundant change

* refocus dropdown button when clipboard copy executes and closes dropdown

* add cypress test

* add missed attr

* implement in responsive layouts

* use runtime copy utility
2022-04-08 14:08:15 +01:00
Suzanne Aitchison
be64f43c1a
Refactor runtime to webpacker JS (#17142)
* add runtime utilities in webpack land, refactor webpack JS using old class

* access Runtime in legacy JS code via window.Forem namespace

* refactor

* make sure data-runtime added only after page does initial load
2022-04-07 15:39:38 +01:00
Suzanne Aitchison
eae8557cf1
Admin member index: update responsive layouts (#17124)
* add an xl breakpoint and use in member index view

* expand search controls at medium breakpoint

* tweak small screen layout options per breakpoint, add overflow button

* small fix

* switch where role appears depending on breakpoint

* adjust for smallest layout

* tweaks for medium layout

* tweaks for large layout

* tweaks for XL table
2022-04-07 14:36:43 +01:00
Jeremy Friesen
c3c884f4d0
Conditional rendering of "Create Post" link (#17076)
* WIP - Conditional rendering of "Create Post" link

This PR builds on the conversation from forem/forem#17056 and moves in a
slightly different direction.

Important in all of this is that the ability to create a post is
enforced on the server.  If the "Create Post" button were to be visible
but the user couldn't create a post when they clicked the button, they
would get an authorization error (or some such response).

This PR posits a different and perhaps competing approach to
forem/forem#16606.  This PR provides a general approach in which we add
class attributes in our HTML erb files.

Note: I have not included Cypress tests as I don't want to yet commit
that time.  I'm also wondering if this is the "right" thing to do.  I
definitely think we want to add some JS tests.  But could we do JS and
unit tests?  (How do we reach consensus regarding our test approach?)

Again, thank you for the conversation and expect an even more "complete"
PR after we have our discussion.

* Extracting AsyncInfo model to ease testing

* Renaming forbidden to visible

* Adding cypress test to assert no 'Create Post'

These are always treacherous.  What happens when we rename the button?
The test will continue to work.

* Apply suggestions from code review

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

* Switching to pack file for policy

Follows on [Suzanne's comment](https://github.com/forem/forem/pull/17076#issuecomment-1088567286)

* Update app/javascript/packs/applyApplicationPolicyToggles.js

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

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-04-05 12:47:12 -04:00
Jeremy Friesen
2fda726409
Revert "Added a way to sort comments on an article (#16686)" (#17093)
This reverts commit 1345334b33.
2022-04-04 08:36:34 -04:00
VISHAL DEEPAK
1345334b33
Added a way to sort comments on an article (#16686)
* Added a way to sort comments on an article

* Sorting of comments now uses crayons-dropwn. Some minor fixes as per comments on PR

* Add and fix test cases for sorting comments functionality

* Changes in code for sort comments.  Code  is more aligned with forem's conventions

* Added cyperss tests for sort comments on an article. Cleaned up code to better follow forem conventions

* Get fresh handle of triggerButton everytime clickOustideListener is clicked. Fix Cypress test cases to reflect the earlier.
2022-04-01 09:26:18 -05:00
Michael Kohl
33195929aa
Bump to Rails 7.0.2.2 MVP (#15908)
* Update gems

* Update more gems

* Update @rails/ujs package

* Explicitly add sprockets-rails

* Gemfile update

* Run bin/rails app:setup

* Update redis-actionpack

* Update stats initializer autoloading

* Update acts-as-taggable-on

* Disable signed: true option in session store

* Switch back to released version of redis-actionpack

* Update Gemfile.lock

* WIP

* Update Rails and gems

* Move hair_trigger back to released gem

* Add explicit requires to initializers

* Update Rails version

* Add more explicit require_relative calls

* Re-enable ForemStatsDriver

* Update schema

* Temp spec changes

* Bullet started raising errors?

* Fix broken spec

* Temporarily disable hair_trigger_spec

* Refactor

* Fix spec

* Enable use_rfc4122_namespaced_uuids

* Revert "Enable use_rfc4122_namespaced_uuids"

This reverts commit 5dac3722284bb08049586bfa943405f8a01289df.

* Temporarily deploy to canary

* Revert "Temporarily deploy to canary"

This reverts commit 04f8469501fab2a3177450baf051ff6259c41827.

* Update Containerfile

* Add comments to specs

Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2022-03-30 15:00:33 -04:00
Miguel Nieto A
148f242892
Replace listings tag component (#16855)
* wip

* feat:  Use MultiSelectAutocomplete for Tags

* feat:  Add additional tags for listings

* refactor: ♻️ Use preact/hooks and refactor propTypes

* fix: 🐛 Fix addiional tags support depending on the selected category

- Add slug to returned array in select_options_for_categories helper
- Differentiate the fields categoryId and categorySlug

* fix: 🐛 Adjust propTypes

* test: 🚨 Change test for select_options_for_categories helper

* refactor: ♻️ Apply requested changes

* refactor: ♻️ Remove border prop - default is true

* test: 🚨 Add test suite for ListingTagsField component

* refactor: ♻️ Apply requested changes

* refactor: ♻️ Remove unnecessary forEach + Improve code legibility

* docs: 📚 Remove topTags from hook documentation

* refactor: ♻️ Use the alias for crayons folder + Use loclaCompare in sort

* test: 🚨 Clean up mock response

* fix: 🐛 Reorder styles

* style: 🎨 Add comment to TagAutocompleteOption/Selection components
2022-03-30 16:51:40 +01:00
Suzanne Aitchison
70a5e9437f
Admin member index: show/hide search and filter controls (#17009)
* initial work to show the expand/collapse search and filter on member index

* replace icon with actual button

* simplify logic in pack

* add cypress tests

* make sure both fields part of same form

* add an indicator in mobile view when field has a value

* make sure empty params treated same as missing params

* make sure indicators stay in step with current user input

* partials for inputs

* rename pack file
2022-03-29 15:37:37 +01:00
MrFuku
847cd594ba
Add toggle button to 'New Forem Secret' form (#17016)
* Add toggle button to 'New Forem Secret' form

* Display messages using i18n

* Fix from snake case to kebab case

* Fix a bug when the specified class did not exist
2022-03-29 08:29:29 -06:00
ludwiczakpawel
0bf6839a81
Admin analytics (#16528) 2022-03-28 21:51:51 +02:00
Suzanne Aitchison
fcdb9d3fe5
Improvements to home feed profile preview card cypress spec (#17011)
* improvements to profile preview card cypress spec

* woops - missed staging files

* make sure follow buttons have been initialized

* wait on follow button fetching on load
2022-03-25 13:57:48 -04:00
Jeremy Friesen
ea3bc697e2
Removing a JS message about connect (#16982)
* Removing a JS message about connect

Related to forem/forem#14734

* Remvoing another reference

I ran `rg Connect[^i]` to see about any remaining references to
Connect.  This one seems to be the last.
2022-03-23 12:30:59 -04:00
Suzanne Aitchison
b498dd9867
Revert "Refactor editor tags selector to fetch all tag info in one network call (#16841)" (#16900)
This reverts commit 7c1993604c.
2022-03-17 10:49:35 +00:00
Suzanne Aitchison
7c1993604c
Refactor editor tags selector to fetch all tag info in one network call (#16841)
* use bulk get of tags in editor

* prefer tag_ids if both tag_ids and tag_names are present

* undo changes to public api tags

* use new endpoint
2022-03-17 09:30:09 +00:00
Fernando Valverde
445b5ba584
Re-enable imageUpload native integration (#15487)
* Re-enable imageUpload native integration

* remove temporary inline comments

* move addEventListener to useEffect hook

* console.log on native messages from image upload integration

* Debug suggestions

* store text area in ref rather than state

* call error callback from native message handler

* Remove debug logs

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-03-11 08:45:25 -06:00
Arit Amana
34bfc491b0
Check validity of embed URLs (#16704)
* start link validation check

* keep PRs small

* rearrange check flow

* need a change to switch accounts

* Rescue from SocketError to surface a better error message

* some updates

* handle 301s

* address Travis failures

* implement request stub

* add needed unified-embed tag spec

* add needed unified-embed tag spec

* nudge Travis

* Address PR review comments

* special-case displaying "base"

* undo change to errors.add

* nudge Travis

* more succinct code

Co-authored-by: aritmock <aritmock@example.com>
Co-authored-by: Dwight Scott <dwight@forem.com>
2022-03-10 13:18:59 -05:00
Suzanne Aitchison
db288c0b4b
Use the Preact ColorPicker in creator onboarding (#16731)
* use Preact ColorPicker in creator onboarding

* update tests

* update comments

* Update app/javascript/packs/admin/creatorOnboarding.jsx

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

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2022-03-03 08:22:10 +00:00
Andy Zhao
33e9bac0f7
Filter admin users by status (#16238)
* Use correct table heading for username

* WIP add role filter and crayonsify forms

* styling

* responsive

* Add form back in that was removed by merge conflict fix

* Suggest only valid search options

* Add basic tests for search and filter by role

* Add aria for search field

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

* Add email to aria

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

Co-authored-by: Paweł Ludwiczak <ludwiczakpawel@gmail.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2022-03-02 11:13:59 -05:00
Daniel Uber
c5a90173bd
handle getElementById failures in articlePage (#16743)
* when there is no div for it, don't render CommentSubscription

* Retrigger CI

* Retrigger CI

* don't write an error to the comment div if its gone

This fixes an issue seen in tests, where the page transitioned while
we were running the articlePage async handler, so the article-body
element was gone (can't access dataset of null), and the error handler
catch block tried to access the innerHTML of another getElementById.

* Use existing found element `root` when setting the error message

No need to find a new comment-subscription div to write the error to,
we already named the one we're interested in at the beginning of the function
2022-03-02 09:56:53 -06:00
Miguel Nieto A
6cc341e70e
Remove dots from chart when time range is Infinity (#16720)
* Remove dots from chart when time range is Infinity

* refactor: 🐛 Remove dots using the chart options

* refactor: ♻️ Improve params of drawChart func

* refactor: ♻️ Use a variable showPoints
2022-03-02 15:20:36 +00:00
Suzanne Aitchison
9e19b71e7b
Only init mod tools if we're still on article page (#16733)
* only init mod tools if we're still on article page

* Update app/javascript/packs/articleModerationTools.js

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

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2022-03-01 16:59:28 +00:00
ludwiczakpawel
b321d1ec11
Removing bootstrap: admin sidebar navigation (#16618)
* nav

* nav

* move cheese around

* helpers

* optimize

* optimize

* optimization

* optimization

* children helper

* children helper

* Update app/views/admin/shared/_nested_sidebar.html.erb

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

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-03-01 15:46:45 +01:00
Suzanne Aitchison
1dcd593c10
✂️ Remove clipboard packages no longer needed ✂️ (#16683)
* remove clipboard copy packages no longer needed

* add to tests to make sure clipboard populated
2022-02-24 16:47:22 +00:00
Suzanne Aitchison
24d02b6a53
Add new ColorPicker to organization settings (#16642)
* Use new color picker in org settings

* add cypress spec

* remove i18n keys no longer needed
2022-02-23 09:05:39 +00:00
Suzanne Aitchison
b358c3810c
Revert "Only make one network call to fetch all existing tags in editor (#16610)" (#16641)
This reverts commit c76909a428.
2022-02-18 11:54:38 +00:00
Ben Halpern
66b32215f3
Small win: Add "Feature post" button alongside new "admin actions" drawer in mod panel. (#16544)
* Initial hack

* Begin functionality implementation

* Add proper route

* Finish up

* Fix test and formatting

* Fix test vars

* Update app/views/moderations/actions_panel.html.erb

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

* Update app/views/moderations/actions_panel.html.erb

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

* Update app/views/moderations/actions_panel.html.erb

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

* Update app/controllers/articles_controller.rb

Co-authored-by: Michael Kohl <me@citizen428.net>

* Update file to not use keys that are not needed

* Finalize featured logic

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Michael Kohl <me@citizen428.net>
2022-02-17 12:43:27 -05:00
Jeferson S. Brito
7733ae45b8
Fix pinned post not showing on feed tabs (#16574)
* Fix pinned post not showing on feed tabs

* Remove featured story from feed items

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

* Refact articlet o use pinned prop

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-02-17 15:49:26 +00:00
Suzanne Aitchison
2fd5de8383
Use new ColorPicker in tag edit form (#16607)
* Use new ColorPicker in tag edit form

* use classnames, add comment
2022-02-17 14:59:09 +00:00
Suzanne Aitchison
c76909a428
Only make one network call to fetch all existing tags in editor (#16610)
* use bulk get of tags in editor

* prefer tag_ids if both tag_ids and tag_names are present
2022-02-17 14:57:40 +00:00
Arit Amana
846ef0cbba
Unified Embed Documentation (#16601)
* starting doc update

* ongoing

* progressing

* still updating

* continue doc update

* note about old liqtags

* add link to create bug-issue

* remove tabular list of supported embeds

* do away with the table!

* address PR review comments

* nudge Travis
2022-02-16 13:15:15 -05:00