Daniel Hunsaker [Mon, 29 May 2017 15:59:18 +0000 (09:59 -0600)]
[nanobox] Adjustments for Nanobox development (#3295)
Because Nanobox doesn't run data components in the same container as the code, there are a few tweaks that need to be made in the configuration to get WebPack to work properly in development mode.
The same differences lead to needing to use `DATABASE_URL` by default in the `.env` file for Rails to work correctly.
Limitations of our `.env` loader for Node.js mean the `.env` file needs to be compiled everywhere in order to work, so we compile it in development, now, too. Also, all the `.env.production` tweaks have been consolidated into a single command.
Finally, since Nanobox actually creates the database when it sets up the database server, using the existence of the database alone to determine whether to migrate or setup is insufficient. So we add a condition to `rake db:migrate:setup` to check whether any migrations have run - if the database doesn't exist yet, `db:setup` will be called; if it does, but no migrations have been run, `db:migrate` and `db:seed` are called instead (the same basic idea as what `db:setup` does, but it skips `db:create`, which will only cause problems with an existing DB); otherwise, only `db:migrate` is called.
None of these changes should affect development, and all are designed not to interfere with existing behaviors in other environments.
Atsushi Yamamoto [Mon, 29 May 2017 15:56:13 +0000 (11:56 -0400)]
Add preference setting for delete toot modal (#3368)
* Set delete_modal preference to true by default
* Does not show confirmation modal if delete_modal is false
* Add ja translation for preference setting page
Eugen Rochko [Sun, 28 May 2017 17:11:47 +0000 (19:11 +0200)]
Fix video having black border on top due to regression from #2608 (#3392)
The combination of object-fit, relative position 50% from top and translating it
back upwards 50% is what allows us to crop the video properly, so it needs to
be +50%-50%
Eugen Rochko [Sat, 27 May 2017 14:55:09 +0000 (16:55 +0200)]
Fix #2922 - Load stylesheet from "custom.css" entrypoint when present (#3332)
* Fix #2922 - Load stylesheet from "custom.css" entrypoint when present
This is pretty much the same way it worked as before, albeit with
having to create app/javascript/packs/custom.js with
require('../styles/custom.scss') (or whatever you want really), which
will be a blank slate for you to import whatever you want
* Remove old assets directory
* Extract font-awesome into common.css and always load it
unarist [Fri, 26 May 2017 14:34:08 +0000 (23:34 +0900)]
Remove status context construction in the React side (#3331)
because it may causes flicker on the conversation when it contains blocked/muted user's status.
We use `/api/v1/statuses/{id}/context` to obtain status ids in the
conversation which filters blocked/muted user, but also uses internal
cache constructed from `in_reply_to_id` by `normalizeStatus()` in
`reducers/timelines.js` on each status loading which doesn't filter.
So statuses appears in conversation if those are cached, even those
statuses are from blocked/muted user. Then context cache will be updated
with the result of the context API and those statuses will be removed.
I have left the `normalizeStatus()` function itself which is called many
functions in the file as a placeholder for now, but maybe it should be
removed completely.
Akinori MUSHA [Fri, 26 May 2017 12:14:03 +0000 (21:14 +0900)]
Go to root after login in single user mode (#3289)
In single user mode, visitors are redirected to the single user's
profile page. So, if you are the owner without a session, you start
from that page, click the login button and authenticate yourself
expecting you'll soon get started with the home page, but in reality
you'll get redirected back to where you started from -- your own
profile page.
This fixes the behavior by redirecting you home after login if you
have started from your own profile page.
unarist [Fri, 26 May 2017 12:07:48 +0000 (21:07 +0900)]
Fix "Cannot read property" on missing status (#3322)
I've found this issue when I clicked replies to muted user on the timeline.
Properties I've removed in here were added with lazy loading using
IntersectionObserver (8e4d1cba), but those statuses are not need to be
tracked anyway because it will be rendered as only empty div.
Matt Jankowski [Thu, 25 May 2017 19:15:14 +0000 (15:15 -0400)]
Disable the Rubocop Style/GuardClause cop (#3316)
There are many spots throughout the codebase which are showing as covered by
specs in the simplecov output -- but which are not actually run, because they
are on the same line as a guard clause.
I plan on fixing some of these issues, but don't want to keep triggering this
rubocop style violation.
My preference would be that we use the PR review process to identify places
where a guard clause might be appropriate, but that we leave this cop turned off
by default.
unarist [Thu, 25 May 2017 15:09:13 +0000 (00:09 +0900)]
More use of next link header on account (media) timelines (#3311)
This will reduce requests on who have only few statuses.
- Use next link header to detect more items from first request
- Omit next link header if result items are fewer than requested count
(It had omit it only if result was empty before)