Commit graph

444 commits

Author SHA1 Message Date
Michael Kohl
28dd50e718
Create settings model for rate limits (#13381)
Co-authored-by: rhymes <rhymes@hey.com>
2021-04-20 11:29:22 +07:00
Daniel Uber
2f1dad4e37
Add reading_time to articles api responses (#13446)
* Add reading_time to articles api responses

Fixes #13436

* Update api docs to match changes to the articles response

* Follow up docs updates

- increment api docs version
- add reading_time to articles/me responses
- add reading time to the show response example format

* Change reading_time attribute to reading_time_minutes

Update the article builder to use `article.reading_time` and present
it as `"reading_time_minutes"`.

Update the api spec to expect the new property name instead of the attribute.

* Update api documentation to reflect the new name

- Change reading_time -> reading_time_minutes.
- I decided to keep the (possibly redundant) description text here.
2021-04-19 17:11:55 -05:00
rhymes
f5691dbb5e
[15 min fix] Document data update scripts best practices (#13432)
* Add data update scripts best practices

* Remove leftover counter
2021-04-19 16:11:10 +02:00
Josh Puetz
9fe7be190b
Switch references to Forem master branch to main (#12325) 2021-04-16 11:51:06 -05:00
Suzanne Aitchison
65f558e4f2
add some notes re manual testing in pr template and docs (#13414) 2021-04-15 15:03:06 +01:00
rhymes
5221a26bff
API docs: rename deprecated code samples extension (#13375) 2021-04-13 16:15:18 +02:00
Michael Kohl
d1c3380161
Update GET /followers API endpoint (#13287)
* Add created_at to API followers controller

* Add sorting

* Update API docs

* Update app/controllers/api/v0/followers_controller.rb

Co-authored-by: Jamie Gaskins <jgaskins@gmail.com>

* Update app/controllers/api/v0/followers_controller.rb

Co-authored-by: Jamie Gaskins <jgaskins@gmail.com>

* Use correct date format

* Update API docs

* Add JsonApiSortParams concern

* Update controller to use concern

* Rename and add docs

* Update API docs

* Remove leftover file

* Undo gem changes

* Consistently use field vs param

* Reset vendor/cache for git dependencies

Co-authored-by: Jamie Gaskins <jgaskins@gmail.com>
2021-04-13 10:12:42 +07:00
Daniel Uber
77273267b7
Change file name to remove ERB suffix (#13237)
We moved the initializePage.js file from ERB to pure/plain js in
https://github.com/forem/forem/pull/8030, and the docs are out of sync
with the code.

Fix up the path to this file so it matches the codebase.
2021-04-03 18:50:11 -05:00
Jacob Herrington
18ce0c635c
Add endpoint for articles sorted by published date (#13137) 2021-04-01 13:36:36 -05:00
Jacob Herrington
a360d01c37
Make docs reflect code more accurately (#13219) 2021-04-01 08:21:34 -05: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
Molly Struve
2534a8aa5f
Doc Update:Remove no longer used tech from overview docs (#13192) 2021-03-30 16:41:38 -05:00
Nick Taylor
d23a5a82e7
[15 Min Fix] Added the custom Cypress command, createResponseTemplate, to create comment templates. (#13167)
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-03-29 12:39:45 -04:00
Nick Taylor
d85d327c1d
[15 minute fix] Added custom Cypress command to create an article. (#13151) 2021-03-29 06:00:49 -04:00
Vaidehi Joshi
3f6600541e
✂️ Remove the approvals gem ✂️ (#12978)
* Remove approvals fixtures

* Remove approvals initializer

* Remove approvals gem

* Remove approvals step from travis.yml

* Remove approvals from dockerignore and gitignore

* Remove references to approvals gem in docs

* Un-approvals spec/liquid_tags/codepen_tag_spec.rb

* Un-approvals spec/liquid_tags/dotnet_fiddle_tag_spec.rb

* Temporarily skip other approvals tests

We will still need to delete files in /spec/fixtures/approvals after this.

* Revert changes to dotnet_fiddle_tag_spec and codepen_tag_spec, skip those tests instead

* Temporarily skip more approvals based tests

* Attempt at moving html doc inline

* Comment out one more approvals spec

* Update dotnet fiddle and codepen liquid tag specs to not use Approvals

* Update liquid tag specs + system specs to not use Approvals

* Un-approval feed import, github issue, and tweet tag specs

* Re-add .approvals to gitignore and dockerignore

* Use Rspec compound expectations
2021-03-19 13:28:06 -07:00
Nick Taylor
7c1343be9e
Revert "Revert "Removed service worker (#12974)" (#13014)" (#13015)
This reverts commit 2416387fb4.
2021-03-17 10:57:56 -04:00
Molly Struve
2416387fb4
Revert "Removed service worker (#12974)" (#13014)
This reverts commit 4fb6230606.
2021-03-16 18:10:01 -05:00
Nick Taylor
4fb6230606
Removed service worker (#12974) 2021-03-16 15:55:31 -04:00
Rafi
dd63fe2bfe
Adding note about crayons design system in forem docs (#12838)
* Adding not about crayon in docs

* Update docs/frontend/styles.md

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

* Fixing wording

* Adding colon

Co-authored-by: Michael Kohl <me@citizen428.net>
Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
2021-03-09 10:50:14 -06:00
Daniel Uber
6853edde57
Update style guide link (#12876) 2021-03-03 11:39:05 +07:00
Jacob Herrington
92217be4ed
Add admin overview page (#12726)
* Add admin overview page

* Rename admin_portals spec

* Fix admin nav bug

* Add ahoy tracking to admin overview

* Fix PR Feedback

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

* Make decorative element more visible

* Remove inline layout styles

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2021-03-01 18:59:05 -06:00
Ben Halpern
73125c0795
Reduce service worker functionality to minimal offline page (#12834)
* Reduce service worker functionality to minimal offline page

* Update docs for service workers

* Add comment to fix test

* Include incrementable static cache

* Add TODO comments about removal

* Fix trailing whitespace
2021-03-01 19:29:26 -05:00
Andy Zhao
1fd0ec4041
Try yarn instead over npm for storybook deploys (#12376)
* Try yarn instead over npm

* Remove ignore flag and use default flag

* Add yarn version

* Remove --docs

* Use NPM :( we don't have a yarn.lock in app/javascript

* Use NPM :( we don't have a yarn.lock in app/javascript

* Updated base to root to use yarn

* hack the command with cd 🙃

* debuggng

* copy package.json and yarn.lock from root

* Set flag to use yarn explicitly

* Oops

* Try a different way

* Package.json not yarn.lock

* Maybe??

* Install yarn with npm then run yarn install??

* Add a Node version

* Try one more thing...

* Syntax error

* I think it's working...

* nvm it didn't work

* Use any 14.14 node version -- syntax correct maybe?

* Fix broken redirects smh

* Update redirects for storybook

* Remove unnecessary redirect rule

* Trigger notifications

* Trigger notifications

* Remove some unused comments
2021-02-26 10:30:56 -05:00
Nick Taylor
2bba2a6ee4
Added the @components webpack alias to the project (#12808)
* Added the @shared webpack alias to the project.

* Added some documentation.

* Fixed a copy paste error.

* Renamed @shared to @components.

* Update docs/frontend/webpacker.md

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

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-02-24 16:07:48 +01:00
rhymes
af77a47293
Remove canonical_url from API Article Create/Update examples (#12795) 2021-02-24 10:29:56 +01:00
Ridhwana
07fcbb6f0e
Parenthesis consistency for add_role and remove_role (#12661)
* chore: use consistent code styles for the parenthesis around arguments

* Revert "chore: use consistent code styles for the parenthesis around arguments"

This reverts commit 281c899a5cff0480b182fef45b10ef69979166cb.

* chore: add consistent parenthesis
2021-02-15 20:35:25 +02:00
Christina
bcbeb66c98
Update Ruby Section and Add Additional Error (#12669)
Adding additional information to the Ruby section to help contributors who are not used to Ruby.
Also explicitly stating that the project must be cloned and forked before using rbenv install $(cat .ruby-version)

Also adding a common error Nick and I encountered with a solution.
2021-02-12 10:45:34 -06:00
rhymes
456f13aa20
Add feature flags docs (#12646)
* Fix typo

* Add technical overview on feature flags in docs

* Update docs/technical-overview/feature_flags.md

Co-authored-by: Jacob Herrington <jacobherringtondeveloper@gmail.com>

* Update docs/technical-overview/feature_flags.md

Co-authored-by: Jacob Herrington <jacobherringtondeveloper@gmail.com>

* Update docs/technical-overview/feature_flags.md

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

* Update docs/technical-overview/feature_flags.md

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

* Incorporate feedback

Co-authored-by: Jacob Herrington <jacobherringtondeveloper@gmail.com>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2021-02-11 12:46:46 +01:00
Rachael Wright-Munn
8301b9f667
The GitHub authentication docs did not include the OAuth url. It has been added and the screenshot updated. (#12598) 2021-02-10 10:47:26 -06:00
Jacob Herrington
8a5db7b877
Fix broken doc links (#12615) 2021-02-09 08:20:14 -06:00
Nick Taylor
a56fef9f7c
Documentation for End to End Testing (#12459)
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-02-05 10:23:10 -05:00
Jacob Herrington
a92681a4ad
Add a tip for the SKIP_SERVICEWORKERS env variable (#12563) 2021-02-04 06:00:55 -06:00
Michael Kohl
e258e36c92
Remove language settings (#12502)
* Remove language settings

* Remove more language related code

* Remove leftover spec

* Remove language from ES mapping
2021-02-04 08:35:00 +07:00
Henry Boisdequin
ccdc5fbfa7
Fix spelling (#12484) 2021-01-29 17:31:11 +01:00
Mateusz Hajder
fcc443e1d8
Update GitDocs link (#12485)
The project is already archived, the site on Netlify is down.
2021-01-29 16:20:30 +01:00
Vaidehi Joshi
154b185f2d
Remove extra asterisks in contributing guide (#12474) 2021-01-29 06:41:29 -05:00
Vaidehi Joshi
afb2369bf4
Update Contributing guide to reflect new processes (#12472)
* Update Contributing guide to reflect new processes

* what is pluralization anyways

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

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2021-01-28 15:05:03 -08: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
Nick Taylor
86eb75cee7
Report a Message in Connect (#12229)
* Frontend Ready for Connect Report Abuse

* add feedback api

* js defination fix

* Added Hooks to the Component

* add json response in feedback

* Block popup added

* fix render issue

* Made changes in internal view

* change error message

* Added few design changes =

* add test cases

* Update app/javascript/chat/actions/requestActions.js

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>

* add PR suggestions

* add backend test cases

* report abuse form close

* Update app/javascript/chat/actions/requestActions.js

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>

* Update app/javascript/chat/ReportAbuse/index.jsx

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>

* add test cases

* Update app/javascript/chat/ReportAbuse/index.jsx

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>

* Update app/javascript/chat/ReportAbuse/index.jsx

Co-authored-by: Marcy Sutton <holla@marcysutton.com>

* Update app/javascript/chat/ReportAbuse/index.jsx

Co-authored-by: Marcy Sutton <holla@marcysutton.com>

* group the fieldset

* fix report abuse api

* fix test case

* fix request test case

* fix typo

* cleaned up markup in report abuse component.

* Fixed spacing between abuse options.

* Fixed wording in report abuse confirmation.

* Removed unnecessary data-testid and aria-label attributes.

* Added some top margin to the report abuse form.

* Update app/javascript/chat/message.jsx

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

* Added a legend to the the fieldset.

* Update app/javascript/chat/actions/requestActions.js

Co-authored-by: Michael Kohl <citizen428@dev.to>

Co-authored-by: Sarthak <7lovesharma7@gmail.com>
Co-authored-by: Narender Singh <narender2031@gmail.com>
Co-authored-by: Marcy Sutton <holla@marcysutton.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Michael Kohl <citizen428@dev.to>
2021-01-19 12:07:47 -05:00
Ben Halpern
d7732499b9
Improve cumulative layout shift on comment reactions + optimizations (#12309)
* Improve content layout shift on comment reactions + optimizations

* Clean ups, tests, and docs

* Fix test typo

* Update app/views/comments/_comment_footer.html.erb

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

* Update docs/technical-overview/architecture.md

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

* Update docs/technical-overview/architecture.md

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

* Update docs/technical-overview/architecture.md

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

* Refactor and add jsdoc

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2021-01-18 19:29:44 -05:00
Spencer
27648a938b
API: Endpoint to get an organization's articles (#12237)
* update route

* add controller action

* add article jbuilder/update shared files

* add tests

* update api docs

* add published to query

* render articles index/delete articles jbuilder

* call articles index attributes const

* put back article/flare partials

* bug fix for readinglist index

* bug fix for render partial in jbuilder
2021-01-13 13:09:58 +01:00
Abenet Tamiru
f655634847
Use yarn in scripts (#12096)
* Use yarn instead of npm in package.json

* Enable yarn for netlify
2021-01-05 09:59:17 -05:00
Alex
5d7fa454bd
Remove CacheBuster (#12080) 2020-12-30 11:55:16 -05:00
Takuma
75fd3cb2a8
Fix broken link to configuring environment variables page (#12056) 2020-12-29 16:05:24 -05:00
Nick Taylor
2925a64eb8
Added webpack bundle analyzer (#12013)
* Added webpack bundle analyzer.

* Renamed to bundleAnalyzer (no extension)

* Added some documentation.
2020-12-22 19:13:40 -05:00
Ben Halpern
68867e9384
Add config post route for admin api (#11698)
* Add config post route for admin api

* Fix params

* Extract config_params to concern

* Remove print statement

* Some changes

* A couple changes

* Change controller method name and refactor upsert

* Fix tests and method names

* Fix routes and class stuff

* Fix styles

* Fix config params

* Fix styles

* Move regex to constant

* Remove single-use after action callbacks

* Expose success? method

* Fix syntax error

* Fix success? return

* Switch to guard clause

* Final clean ups?
2020-12-22 15:50:34 -05:00
rhymes
3dae3ff797
Upgrade rubocop* packages to the latest version and fix violations (#11972)
* Update erb_lint to track newer Rubocop versions

* Update rubocop-rspec to 2.1

* Fix Rails/WhereEquals and Style/RedundantParentheses

* Upgrade rubocop to 1.1.0

* Enable Rubocop 1.1 cops

* Upgrade rubocop to 1.2.0

* Enable Rubocop 1.2 cops

* Upgrade rubocop to 1.3.0

* Enable Rubocop 1.3 cops

* Enable Rubocop 1.4 cops

* Enable Rubocop 1.5 cops

* Upgrade rubocop to 1.6.x

* Restore previous .reject

* Fork the PR to make sure we don't inject unwanted code accidentally
2020-12-21 18:29:43 +01:00
Spencer
6e2aab623e
API: Endpoint to get an organization's listings (#11823)
* add tests

* add route

* add controller action

* add jbuilder file

* update api docs

* update query

* update jbuilder listing

* add organization/user and category to listing

* update api docs/spec file
2020-12-18 12:20:35 -05:00
Fernando Valverde
fcc5c0d2a1
Add Sign in with Apple (#11934)
* Add gem omniauth-apple

* Integrate omniauth-apple

* Integrate callback

* Add fields

* Add tests, fix bugs and make it all work

* Show only enabled providers for the current user

* Add default profile image for Apple

* Remove localhost patch

* Bring over the changed Apple username if the user changes it

* More specs fixed

* Incorporate feedback from PR

* Fix specs

* Simplify code and fix spec

* Fix Broadcast generators to take into account the new provider

* Fix spec

* Generate a truly unique apple_username

* Fix user specs

* Add omniauth-apple-0.0.2 to vendor cache

* Fix merge conflict and spec

* Update VCR fastly sloan cassette

* Revert "Generate a truly unique apple_username"

This reverts commit 2462875575b0bbd6b3c1d56b25afcd3189671608.

* Fix user specs

* Fix specs

* Fix specs

* Hide Connect Apple button behind a feature flag

* Revert "Hide Connect Apple button behind a feature flag"

This reverts commit 105bde0373389a4eb9b6e948f60734c7e0e99cba.

* Fix line lengths

* Fix spec

* ES tag

* CSRF bypass for Apple callback

* custom user_nickname in Apple provider with small tweaks + omniauth-apple bump

* Fixes username specs

* Makes Apple users default image Users::ProfileImageGenerator

* Fallback to mascot_image_url in test environment to avoid breaking Travis

* Fixes Apple CSRF error + makes default nickname more readable

* Trigger Travis

* Better devise config

* Apple SiteConfig entires in /admin/config

* Fixing specs

* Adds beta_access? to Authentication::Providers::Provider

* Fixes specs

* Codeclimate double quote fix in Gemfile

* Fixes /admin/config allowed params & adds feature flag for provider beta_access?

* Remove Enfile & adds temporary docs

* Adds custom apple auth provider settings

* Fix authenticator spec

* Fix configs spec (use last instead of first to avoid apple special case)

* Remove dangling fields from /admin/config

* updates feature flag

* More test fixes

* Hide config behind feature flag too

* omniauth-apple bump

* Takes care of edge case fallback

* Reverse apple_username update

* Adds auth_time to info hash in apple omniauth mock

* Switch to next instead of nesting for feature flag

* Fixes CVE-2015-9284

* Fixes specs after auth providers initiatior refactor from GET to POST

* Spec fixes

* More spec fixes

* Fix Rails codebase reference link

Co-authored-by: rhymes <rhymesete@gmail.com>
Co-authored-by: rhymes <rhymes@hey.com>
2020-12-18 10:22:33 -06:00
rhymes
573380f2b8
Document the advanced startup setup (#11915)
* Document the advanced startup setup

* Update docs/getting-started/start-app.md

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

* Update docs/getting-started/start-app.md

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

* Update docs/getting-started/start-app.md

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

* Update docs/getting-started/start-app.md

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

* Update docs/getting-started/start-app.md

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

* Update docs/getting-started/start-app.md

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

* Update docs/getting-started/start-app.md

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

* Update docs/getting-started/start-app.md

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

* Update docs/getting-started/start-app.md

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

* Update docs/getting-started/start-app.md

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

* Update docs/getting-started/start-app.md

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

* Update docs/getting-started/start-app.md

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

* Update docs/getting-started/start-app.md

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

* Update docs/getting-started/start-app.md

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

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2020-12-16 18:13:57 +01:00