Commit graph

111 commits

Author SHA1 Message Date
Ben Halpern
221c363af0
Reduce queries in typical stories#show response + small fixes (#903)
* Reduce queries in typical stories#show response + small fixes

* Change const to git in non-es6 code
2018-10-13 19:38:38 -04:00
Sheldon Nunes
8c70c95cea Fix on-boarding typo (#892) 2018-10-12 09:06:44 -04:00
Ben Halpern
b13c09583f
Adjust modal to not interfere with pull-to-refresh (#888)
* Remove unnecessary code from onboarding

* Adjust pull-to-refresh button to account for open modal scenario
2018-10-11 16:45:43 -04:00
Ben Halpern
991458d1c3
Adjust onboarding slides (#882)
* Modify onboarding slides

* Remove user controller changes

* Modify onboarding slide font size

* Adjust small onboarding issues

* Modify onboarding styling

* Remove flash unstyles content
2018-10-10 16:00:20 -04:00
Ben Halpern
3ae3fb0652
Adjust placement of image button on small screen (#867)
* Adjust placement of image button on small screen

* Adjust orgsettings css for small screen

* Update snapshot for article form
2018-10-08 20:32:00 -04:00
Ben Halpern
f269c0887d
Fix editor render conflict issue (#865) 2018-10-08 18:54:15 -04:00
Ben Halpern
f52f8b6437
Update image area and other editor functionality (#847) 2018-10-07 12:52:13 -04:00
Ben Halpern
87a7067a5c
Spruce up V2 editor look and feel (almost ready 🙂) (#846)
* Spruce up editor look and feel

* Update jest snapshots for editor

* Fix editor guide scoping issue
2018-10-07 11:06:52 -04:00
Ali Spittel
6ae540cafd add alt text to sidebar images (#842)
* add alt text to sidebar images

* add alt text to emoji heart

* add alt text to sponsor logos

* add aria-label to search bar

* update snapshot for Search
2018-10-07 10:39:57 -04:00
Ben Halpern
ecb9645775
Make changes to editor (#837)
* Make changes to editor

* Make minor fixes and console log removals

* Fix test in article form

* Adjust rspec test
2018-10-05 16:03:06 -04:00
Ben Halpern
2545b8d77f
Modify styling and classes for iOS safari /connect (#701) 2018-09-19 18:25:36 -04:00
38elements
69794dfacf Remove unnecessary code in .eslintrc.js (#672) [ci skip] 2018-09-17 16:24:57 -04:00
Jess Lee
fa3e582973 add ga tracking to onboarding (#653)
* add ga tracking

* Add ga availability check
2018-09-17 12:09:03 -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
Nick Taylor
24621b03f2 Restructure pack files part I (#377)
* Renamed pack file from chat.jsx to Chat.jsx.

* refactor

* Missed a js pack where chat.js -> Chat.jsx

* 👷Refactor

* 👷Refactor

* 👷Refactor

* 👷Refactor

* Tests

* Fixed some wording in a test description.
2018-08-29 12:59:20 -04:00
Ben Halpern
95908ddde1
Fix /live styling issues (#519) 2018-08-28 11:50:25 -04:00
Ben Halpern
05789f6ef6
Add client-side /connect maxlength and add badge setting on model only (#660) 2018-08-06 10:45:01 -04:00
Andy Zhao
1dd95b636b Fix old typo (#655) 2018-08-03 10:17:12 -04:00
Ben Halpern
57d1bc48d5
Fix navigation issue in connect and allow leaving channels (#635)
* Fix navigation issue in connect and allow leaving channels

* Fix chat channel memberships request spec
2018-07-30 18:40:30 -04:00
Mac Siri
0f3342bcec [WIP] Implement non front-matter editor (#415)
* Create alternate editor

* Install linkstate (?)

Not sure how it disappear in the first place

* Run yarn install

* Modulize ArticleForm component

* Refactor

* Isolating css WIP

* Implement simplified frontmatter-less editor

* Modulize individual form element

* Ajust props names

* Transform json params to snakecase

* Remove codes

* Update /new, almost there for release

* Fix editor resize issues

* Change defaultvalue to value in article form tag element

* Modify html buttons in article form
2018-07-27 20:12:33 -07:00
Mac Siri
ce965bcedf Reduce Airbrake's error output (#628)
* Remove chmod for after_deploy

* Fix lint

* Ignore Pundit::NotAuthorizedError

* Update Travis config

* Turn off Travis' pr notification

* Add CommonsChunkPlugin to Webpacker
2018-07-27 09:04:52 -07:00
Nick Taylor
9a387660a9 Fixed bug where + in querystring didn't decode to a space. (#623) 2018-07-25 11:06:00 -07:00
Nick Taylor
18980034d3 Nick/feature/search to preact (#532)
* Works, but lots of cleanup/questions.

* Fixed comment.

* Only want the search script to load once with InstantClick active.

* Removed unnecessary DOMContentLoaded from copy paste.

* 🔧 Enabled (P)React Devtools.

* Updated comment about reactToEvent.

* Removed unnecessary server-side generated JS for search.

* <Search /> component now has component state.

* Search functions are in there own module now.

* 👷Refactor

* Render propped it up.

* Fixed issue with encoding of search term.

* Removed data-no-instant attr from script.

* 👷Refactor

* Now flash of search loading is avoided..

* Moved search under components folder.

* Tests

* fixedEncodeURIComponent does not need to be exported.

* Tests

* Folders to ignore from the VS Code Local History extension.

* Tests

* Snapshot test for <Search /> component.

* Tests

* Now the <SearchContainer /> handles the '/' key shortcut.

* Made the search box ID a prop defaulting to 'nav-search'

* Excluded barrel files from code coverage.

* Componentized search CSS.

* Storybook stories for <Search /> component.

* Removed extension folders to ignore.

* Fixed logic for "/" key triggering search.

* updated jest snapshot for <Search /> component.

* updated package.json lock file.

* Disabled the import/prefer-default-export rule.

* Now search term clears if not on a non-search results page.

* removed comment that is no longer valid.

* No longer using render prop for Search. Doesn't make sense as it's not stuff that is reused.

* Added preact-render-spy do dev deps.
2018-07-19 17:02:48 -04:00
Ben Halpern
e2dbd7cfcc
Remove beta label on /connect and other small changes (#589)
* Remove beta label on /connect and other small changes

* Add better placeholder for narrow screens

* Adjust comma/bracket placement

* Add description to chat channels
2018-07-16 14:48:38 -04:00
Ben Halpern
5a2c549927
Add reactions to /connect content (#585) 2018-07-13 20:05:47 -04:00
Ben Halpern
e995e081ad
Add rich links to /connect and remove auto sidecar opening (#582) 2018-07-13 16:56:26 -04:00
Ben Halpern
926991f5fc
Fix timezone issues and small adjustment to connect features (#548) 2018-07-05 16:39:04 -04:00
Ben Halpern
fcac6575d1 Merge branch 'master' of github.com:thepracticaldev/dev.to_core 2018-07-03 19:06:39 -04:00
Ben Halpern
eaa13a53fb Update serviceworker notficiations 2018-07-03 19:06:23 -04:00
Ben Halpern
4638768d79
Remove channel member count limit (#545)
* check for dataset content in triggeractive

* Remove channel member count limit
2018-07-03 16:50:53 -04:00
Ben Halpern
53c925a148
check for dataset content in triggeractive (#544) 2018-07-03 15:43:36 -04:00
Ben Halpern
84568cd860
Remove video DM limitation (#543) 2018-07-03 15:04:35 -04:00
Ben Halpern
50bc2f259c
Add max channel members (#542)
* Add max channel members

* Change number

* Remove console.log
2018-07-03 13:54:57 -04:00
Ben Halpern
424be43865
Add chat_channel_membership roles and invite functionality (#541) 2018-07-03 13:16:48 -04:00
Ben Halpern
94e5154668
Add initial invitation framework for chat channels (#528)
* Add initial invitation framework for chat channels

* Update chat_channel specs

* Add DIY concept of accepting invite

* Add some js and fix spec

* Add full invite accept functionality

* Remove console.log from chat
2018-07-02 16:31:20 -04:00
Ben Halpern
799aa16378
Fix /live for workshop (#516) 2018-06-28 14:28:24 -04:00
Ben Halpern
441a1ba8b8
Make channels list scroll to top on change (#514) 2018-06-27 22:30:38 -04:00
Ben Halpern
51ddc2f4fa
Track query across filters (#513) 2018-06-27 22:21:18 -04:00
Ben Halpern
62fc45865c
Add sticky activechannel during filtering (#511) 2018-06-27 21:46:58 -04:00
Ben Halpern
5842b73d6c
Add filters (#510) 2018-06-27 21:25:25 -04:00
Ben Halpern
258a6ea74f
Add filter buttons to /connect (#508) 2018-06-27 21:14:06 -04:00
Ben Halpern
b8d2c0033e
Get /connect pagination working (for real in prod I hope) (#507) 2018-06-27 18:47:06 -04:00
Ben Halpern
aaba866b87
Modify /connect to try to get pagination working in prod (#505) 2018-06-27 17:51:38 -04:00
Ben Halpern
a89433596b
Small /connect adjustment (#504) 2018-06-27 16:24:35 -04:00
Ben Halpern
5194c9828c
Add proper pagination and fix small issues with /connect (#503)
* Add proper pagination and fix small issues with /connect
2018-06-27 16:06:15 -04:00
Yechiel Kalmenson
23ee1004be fix grammar in the chat screen (#457) 2018-06-20 10:23:09 -04:00
Mac Siri
d31e1b0594 Remove Sendbird (#421)
* Remove Sendbird

* Remove more remnant of sendbird

* Remove puts
2018-06-19 17:51:10 -04:00
Ben Halpern
914102f19f Add basic github support to /connect 2018-06-19 13:46:10 -04:00
Ben Halpern
74d098f580 Fix bugs and add video 2018-06-18 12:53:43 -04:00
Ben Halpern
6e35875f2c Adjust location of timestamps 2018-06-14 18:54:40 -04:00