Extending documentation... (#10156)

* textarea component

* docs / faq: add new follower

* credits

* lang

* moving copy higher

* typo

* Update docs/faqs.md typo

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

* Update docs/faqs.md lang

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

* Update docs/faqs.md lang

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

* Update docs/faqs.md

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

* Update docs/faqs.md

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

* Update docs/faqs.md

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

* Update docs/faqs.md

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

* Update docs/faqs.md

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

* Update docs/faqs.md

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

* Update app/javascript/article-form/components/Title.jsx

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

* Update docs/faqs.md

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

* Update docs/faqs.md

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

* Update docs/faqs.md

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

* Update docs/faqs.md

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

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
This commit is contained in:
ludwiczakpawel 2020-09-03 16:53:22 +02:00 committed by GitHub
parent e990323997
commit 11831e72c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 58 additions and 0 deletions

View file

@ -1,5 +1,14 @@
import { h } from 'preact';
import PropTypes from 'prop-types';
// We use this magic Textarea component for title field because it's automatically
// resizable. Even though it looks like a classic input, if you enter long title
// it would wrap the text to the next line automatically resizing itself. It helps keep
// the entire layout the way it is without having unnecessary scrolling and white spaces.
// Keep in mind this is what happens only here - in preact component.
// I'm mentioning this because the entire "Write a post" view is a preact component
// BUT it is also a classic .html.erb view which is being loaded BEFORE this component
// to give a feeling of blazing fast page load. And we do NOT use this magic autoresizing
// functionality on .html.erb view because there's no point of it.
import Textarea from 'preact-textarea-autosize';
export const Title = ({ onChange, defaultValue, switchHelpContext }) => {

View file

@ -25,3 +25,52 @@ export RAILS_LOG_TO_STDOUT=true
```
to your own `.env` file.
## How do I see comments in the Feed?
On the home Feed, we only show comments above certain "score". It's likely the
comments in the local environment will never meet this score. If you want to see comments locally, you will need to
update the score of your local comments manually. Here's how:
1. Open the terminal.
2. Run `psql PracticalDeveloper_development` to open `psql`, the PostgreSQL terminal.
3. Enter `update comments set score = 30;`.
4. Type `exit` to leave the PostgreSQL terminal.
Once you refresh the app, you should be able to see some comments in the Feed.
## How do I make someone follow me on my local environment?
In certain cases, for example when testing various functionalities, you may need
to be able to make some user follow you. Here's how:
1. Open the rails console by running `rails c` in your terminal.
2. Get any user you want to follow you, for example `user = User.first`.
3. Then make this user follow you: `user.follow(your_username)`.
Boom, you have a new follower!
## How do I remove / leave organization I created?
1. Open the rails console by running `rails c` in your terminal.
2. Enter the following commands:
```ruby
user = User.find_by(username: "your_username")
organization_id = Organization.find_by(slug: "organization_slug").id
user.organization_memberships.where(organization_id: organization_id).destroy_all
```
## How do I add credits to my account?
If you ever want to add Listings locally, you must have credits on your account
to "pay" for listing. Here's how:
1. Open the rails console `rails c`.
2. Enter the following commands:
```ruby
user = User.find_by(username: "your_username")
Credit.add_to(user, 1000)
```
^ This will add 1000 credits to your account. But you know, you can't really buy
anything with it :D