Commit graph

743 commits

Author SHA1 Message Date
Mac Siri
a1efd86e6d Fix typo (#644) 2018-09-12 17:31:47 -04:00
Ben Halpern
eeb408511a
Add extra caching to home query (#643)
* Update home feed logic and display

* Remove console log

* Add extra caching to home query

* Fix conflict
2018-09-12 16:34:10 -04:00
Claudio B
a4346172cc Docs: Fix underscores to italic in markdown (#636) 2018-09-12 16:21:13 -04:00
Ben Halpern
91f99036df
Update feed for slightly more customized top articles (#642)
* Update home feed logic and display

* Remove console log
2018-09-12 15:27:54 -04:00
Peter Frank
5255078475 Add hosting your own instance info to Docs (#633)
Added a new page to the Docs re: eventually standing up your own
version of DEV
2018-09-12 14:37:28 -04:00
Jess Lee
6117777841 fix badge sizing on internal user show page (#641) 2018-09-12 14:32:49 -04:00
Derek Hopper
9e35b25ac1 Finalize Article Editor v2 (#522)
* Run prettier on articleForm.jsx and tags.jsx

The only thing this commit does is run prettier on files
we'll be modifying to update the <Tags /> component.

* Add basic snapshot test for ArticleForm

I had to move algoliasearch setup to the constructor.
Otherwise, the setup happens when you import ArticleForm.

Feel free to let me know if there's a better way.

* Add a snapshot test to exercise algoliasearch

This test adds a mock for algoliasearch. We trigger handleTagKeyUp
to test that tagList and tagOptions are updated once the mock
search returns.

* Add test for selecting tags

There are two tests so far.

1. You can click on a tag to add it to the list.
2. You can type a comma which will also add the tag to the list.

* Add constants for key codes

* Change onKeyUp to onInput when typing tags

I believe <Tags> is meant to be a controlled component. Using onKeyUp
sort've acts as both uncontrolled and controlled. The value of the
textarea has already been changed in the DOM, then we try to change
it again using setState. This leads to some weird issues where what
you type gets mangled. For example, you may type "javascript", but end
up with something like "jvascrit".

Switching this to onInput lets us control everything and gets rid of
the weird issue of missing characters as you type.

* Refactor the way we add tags to the input

We add tags when you click on a search result or hit enter on
a search result. I'm doing this because I think it will help insert
tags at any location in the textarea. Currently, it only supports
adding tags to the end of the list.

* Allow editing of tag based on cursor position

If you use the arrow keys or the mouse to go back to edit a tag
you've typed, it'd be nice if the search results could replace
that tag. Before this, if you click or hit enter on a search result,
the tag gets added to the end of the list.

This commit will replace the tag you're editing.

* Move __mocks__ outside of __tests__

This was causing anything inside __mocks__ to be considered as a test.

* Add 2 tests around editing tags

1. That we query for the correct tags based on what we're editing
2. That we replace the correct tag when we choose a new one

* Enforce max tags limit

* Refactor article form tests

Extracts building of <ArticleForm /> component since we're using
it in a number of places for test setup.

* Add a space after inserting a tag

There appears to be an issue with the input losing the cursor position
when it rerenders. I'm not sure if this is an issue with the code
or an issue with preact. I'm leaning toward an issue with the code,
but I'm not really sure.

* Refactor <Tags /> to class

This is to prep for moving any tags related behavior from
<ArticleForm /> to <Tags />.

* Move tags behavior to <Tags /> component

The <Tags /> component seems like the right place to perform
searching and managing of selected tags. We can pass a function
to <Tags /> so the tag list can be updated when needed.

* Move <Tags /> selected state to a getter

We already have `props.defaultValue` which is already a kind of "state"
for selected tags. Keeping track of an array of selected tags
seems like overkill here. We can transform the defaultValue string
to a list of selected tags when needed.

* Use linkState to manage tagList

We're already using linkState elsewhere so I think it makes sense
to use it here as well.

* Extract key handling behavior to methods

We were performing quite a bit of logic when handling key down events.
This commit extracts this logic to small methods.

For example, we need to check if we're at the top or bottom of the
search results. We also need to clear search results and reset the
selected search result. My hope is to make this logic a little bit
clearer with methods named by what they do.

* Move clearing of search results into search method

If the query is blank, it seems to make sense that we'd clear
search results inside the search method. That's an empty query
and the search method is simply returning no search results in
that case.

However, if we don't wrap the resetting of search results with a
Promise, we end up with a double render where the cursor moves to the
end of the textarea. The Promise feels a little hacky to me, but
I couldn't come up with something better.

* Refactor naming of logic to insert a space following a comma

This would've been hard to understand in the future. I named
the conditionals a little bit better and extracted logic to
insert a space at a given position.

* Fix issue with duplicates appearing in search results

This now uses the getter for selected tags as a filter.
2018-09-11 21:33:48 -04:00
Gaurav Shankar
4e297053ee Feature/share to linkedin (#624)
* Fixed the overflowing user name in the top bar under profile thumbnail

* Fixed by adding hidden and ellipsis

* Added the share to linkedin for sharing articles on LinkedIn

* Changed the summary param to article.description
2018-09-11 17:41:15 -04:00
Mac Siri
b946bb5530 Render canonical url (#632) 2018-09-11 17:40:04 -04:00
Jess Lee
191588b34b Adds method to create bulk mentorship matches (#631)
* add mentorship module

* update spec file name for consistency
2018-09-11 16:46:01 -04:00
Andy Zhao
13ab37951c Update analytics controller with new policy (#630) 2018-09-11 16:45:27 -04:00
Jess Lee
4451e5eb38 Update User Dashboard With Mentorship Admin Features (#440)
* create mentor relationship table and begin dashboard

* add missing files from previous commit

* add mentorship relationship status

* remove uniqueness validation

* add multiple notes

* ban from mentorship deactives all relationships

* add untracked files

* fix logic issue and add specs

* add model specs

* add request specs

* add request specs and fix linting

* fix internal users spec

* remove phantom columns

* remove bizzaro character

* move all attr_accessor to one line
2018-09-11 15:59:25 -04:00
Nathan Sebhastian
e0b7df7fc5 update article path when username is changed (#626) 2018-09-11 13:38:42 -04:00
Andy Zhao
ff9d2c7f7a Update gist tag regex (#628) 2018-09-11 13:29:28 -04:00
Ben Halpern
746329d4ef
Add check for @user in email template (which may not have @user) (#629) 2018-09-11 13:27:36 -04:00
dependabot[bot]
7b8fff6e1a Bump puma from 3.11.2 to 3.12.0 (#545)
Bumps [puma](https://github.com/puma/puma) from 3.11.2 to 3.12.0.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](https://github.com/puma/puma/compare/v3.11.2...v3.12.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-11 12:50:20 -04:00
dependabot[bot]
4ca7cb7bac Bump stream_rails from 2.5.2 to 2.6.5 (#468) [ci skip]
Bumps [stream_rails](https://github.com/GetStream/stream-rails) from 2.5.2 to 2.6.5.
- [Release notes](https://github.com/GetStream/stream-rails/releases)
- [Commits](https://github.com/GetStream/stream-rails/compare/v2.5.2...v2.6.5)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-11 12:49:04 -04:00
dependabot[bot]
4526b4453f Bump recaptcha from 4.6.4 to 4.12.0 (#546)
Bumps [recaptcha](https://github.com/ambethia/recaptcha) from 4.6.4 to 4.12.0.
- [Release notes](https://github.com/ambethia/recaptcha/releases)
- [Changelog](https://github.com/ambethia/recaptcha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ambethia/recaptcha/compare/v4.6.4...v4.12.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-11 12:25:52 -04:00
dependabot[bot]
060fa1ce16 Bump rouge from 3.1.1 to 3.2.1 (#544) [ci skip]
Bumps [rouge](https://github.com/jneen/rouge) from 3.1.1 to 3.2.1.
- [Release notes](https://github.com/jneen/rouge/releases)
- [Changelog](https://github.com/jneen/rouge/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jneen/rouge/compare/v3.1.1...v3.2.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-11 12:25:26 -04:00
Andy Zhao
744c2d4fff Fix email formatting (#627) 2018-09-11 10:25:21 -04:00
Mac Siri
be69958b92
Remove redundant dependencies (#613) 2018-09-10 17:59:36 -04:00
Timothy Ng
b32ebdb9b9 Update profile links regex to allow trailing slash (#614)
* Update url validation specs to include multiple cases of usernames

* Allow trailing slash in profile links

* Add username with dot separators to list of valid fb usernames

* Update fb url regex to allow dots in between words

* Push existing fb regex allowing for dot separators

* Revert to old regex with added period to character class

* Revert length restriction on fb regex
2018-09-10 16:34:45 -04:00
dependabot[bot]
b2dc1f2b7e Bump pundit from 1.1.0 to 2.0.0 (#557)
Bumps [pundit](https://github.com/varvet/pundit) from 1.1.0 to 2.0.0.
- [Release notes](https://github.com/varvet/pundit/releases)
- [Changelog](https://github.com/varvet/pundit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/varvet/pundit/compare/v1.1.0...v2.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-10 16:15:25 -04:00
Kohei Sugi
f34c717027 Fix rubocop lint (#583)
* $ rm .rubocop_todo.yml && rubocop --auto-gen

* 👮 Layout/AlignHash

* 👮 Layout/IndentationConsistency

* 👮 Layout/TrailingBlankLines

* 👮 Lint/UnusedBlockArgument

* 👮 Style/TrailingCommaInHashLiteral

* Fix rubocop.yml setting

* Delete last conma

* Style/TrailingCommaInArguments and Style/TrailingCommaInArrayLiteral are comma style
2018-09-10 11:19:11 -04:00
dependabot[bot]
be6d2a24d5 Bump eslint-plugin-babel from 5.1.0 to 5.2.0 (#621) [ci skip]
Bumps [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/babel/eslint-plugin-babel/releases)
- [Commits](https://github.com/babel/eslint-plugin-babel/compare/v5.1.0...v5.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-10 11:17:32 -04:00
Jess Lee
0120477126 include notes on duplicate accounts and browser extensions (#617) [ci skip] 2018-09-07 12:39:33 -04:00
Mac Siri
78238cdc0f
Include CloudinaryHelper in MarkdownParser 2018-09-06 17:58:35 -04:00
Andy Zhao
b8cc33abee Make authorship optional for notes (#616) 2018-09-06 17:50:46 -04:00
Andy Zhao
49428cc09f Add liquid variable class and specs (#615) 2018-09-06 14:24:14 -04:00
Andy Zhao
e9dfe8be6a Fix user moderation button (#611) 2018-09-06 12:34:22 -04:00
dependabot[bot]
9ca474a7b9 Bump preact from 8.2.5 to 8.3.1 (#559)
Bumps [preact](https://github.com/developit/preact) from 8.2.5 to 8.3.1.
- [Release notes](https://github.com/developit/preact/releases)
- [Commits](https://github.com/developit/preact/compare/8.2.5...8.3.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-06 11:54:42 -04:00
dependabot[bot]
b623354b08 Bump css-loader from 0.28.11 to 1.0.0 (#581) [ci skip]
Bumps [css-loader](https://github.com/webpack-contrib/css-loader) from 0.28.11 to 1.0.0.
- [Release notes](https://github.com/webpack-contrib/css-loader/releases)
- [Changelog](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/css-loader/compare/v0.28.11...v1.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-06 11:53:05 -04:00
dependabot[bot]
fd31ba189f Bump eslint-plugin-import from 2.10.0 to 2.14.0 (#599) [ci skip]
Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.10.0 to 2.14.0.
- [Release notes](https://github.com/benmosher/eslint-plugin-import/releases)
- [Changelog](https://github.com/benmosher/eslint-plugin-import/blob/master/CHANGELOG.md)
- [Commits](https://github.com/benmosher/eslint-plugin-import/compare/v2.10.0...v2.14.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-06 11:52:38 -04:00
dependabot[bot]
406d9b73dc Bump twilio-video from 1.10.0 to 1.14.0 (#601) [ci skip]
Bumps [twilio-video](https://github.com/twilio/twilio-video.js) from 1.10.0 to 1.14.0.
- [Release notes](https://github.com/twilio/twilio-video.js/releases)
- [Changelog](https://github.com/twilio/twilio-video.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/twilio/twilio-video.js/compare/1.10.0...1.14.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-06 11:52:21 -04:00
dependabot[bot]
67bc912965 Bump @rails/webpacker from 3.5.3 to 3.5.5 (#605) [ci skip]
Bumps [@rails/webpacker](https://github.com/rails/webpacker) from 3.5.3 to 3.5.5.
- [Release notes](https://github.com/rails/webpacker/releases)
- [Changelog](https://github.com/rails/webpacker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/webpacker/compare/v3.5.3...v3.5.5)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-06 11:51:48 -04:00
Andy Zhao
a4c3d97aa9 Fix Liquid Filters and Fix DevComment Tag (#608)
* Update standard filters

* Update comment tag and rename devcomment tag

* Update tests with new file name

* Refactor liquid tags into null tag

* Fix renaming issue and refactor

* Fix useless assignment via codeclimate

* Add test for null tag

* Update LiquidTags.scss with new file name
2018-09-05 17:42:47 -04:00
Ben Halpern
9009a1a977 Fix button height and modify video styling (#609) 2018-09-05 16:51:01 -04:00
dependabot[bot]
e1aaa3b6f6 Bump babel-core from 6.26.0 to 6.26.3 (#598) [ci skip]
Bumps [babel-core](https://github.com/babel/babel) from 6.26.0 to 6.26.3.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v6.26.0...v6.26.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-05 14:30:51 -04:00
dependabot[bot]
f8e198fce7 Bump eslint-plugin-jsx-a11y from 6.0.2 to 6.1.1 (#603) [ci skip]
Bumps [eslint-plugin-jsx-a11y](https://github.com/evcohen/eslint-plugin-jsx-a11y) from 6.0.2 to 6.1.1.
- [Release notes](https://github.com/evcohen/eslint-plugin-jsx-a11y/releases)
- [Changelog](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/CHANGELOG.md)
- [Commits](https://github.com/evcohen/eslint-plugin-jsx-a11y/compare/v6.0.2...v6.1.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-05 14:28:26 -04:00
dependabot[bot]
876202b828 Bump eslint from 5.4.0 to 5.5.0 (#602) [ci skip]
Bumps [eslint](https://github.com/eslint/eslint) from 5.4.0 to 5.5.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v5.4.0...v5.5.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-05 13:29:22 -04:00
dependabot[bot]
200b5e7f21 Bump pusher-js from 4.3.0 to 4.3.1 (#604) [ci skip]
Bumps [pusher-js](https://github.com/pusher/pusher-js) from 4.3.0 to 4.3.1.
- [Release notes](https://github.com/pusher/pusher-js/releases)
- [Changelog](https://github.com/pusher/pusher-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pusher/pusher-js/compare/v4.3.0...4.3.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-05 13:25:39 -04:00
Mac Siri
17f10810f5
Delete .codeclimate.yml 2018-09-05 12:33:49 -04:00
Andy Zhao
178d0205eb Update standard filters for Liquid (#607) 2018-09-05 12:15:55 -04:00
Gaurav Shankar
99d98d75b4 Fix long username in navbar (#588)
* Fixed the overflowing user name in the top bar under profile thumbnail

* Fixed by adding hidden and ellipsis
2018-09-05 11:58:07 -04:00
Antony Garand
fdec71455a Add nvm-windows to frontend doc (#591) [ci skip] 2018-09-05 11:39:39 -04:00
Edison Yap
20082e2d78 Add a link to Reading List for easier access (#570) 2018-09-05 11:09:38 -04:00
Andy Zhao
56f2a6479c Eager load reporter and notes (#594) 2018-09-04 18:11:07 -04:00
Kohei Sugi
1ccfdd4651 Fix Naming/UncommunicativeMethodParamName lint (#501)
* Fix Naming/UncommunicativeMethodParamName

* code climate
2018-09-04 18:00:26 -04:00
Ben Halpern
044be9e162
Modify instantclick to follow 404/500/302 statuses etc. (#593) 2018-09-04 17:20:13 -04:00
Andy Zhao
7d7863da1f Add nofollow to /moderate links (#592) 2018-09-04 17:09:28 -04:00