Skip to content

Commit

Permalink
Merge pull request mastodon#1242 from ThibG/glitch-soc/merge-upstream
Browse files Browse the repository at this point in the history
Merge upstream changes
  • Loading branch information
ClearlyClaire committed Nov 7, 2019
2 parents 00793a8 + f63dad5 commit dd2ec97
Show file tree
Hide file tree
Showing 42 changed files with 562 additions and 329 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Expand Up @@ -9,6 +9,7 @@ aliases:
DB_HOST: localhost
DB_USER: root
RAILS_ENV: test
NODE_ENV: test
PARALLEL_TEST_PROCESSORS: 4
ALLOW_NOPAM: true
CONTINUOUS_INTEGRATION: true
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -55,6 +55,9 @@ npm-debug.log
yarn-error.log
yarn-debug.log

# Ignore vagrant log files
ubuntu-xenial-16.04-cloudimg-console.log

# Ignore Docker option files
docker-compose.override.yml

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -54,7 +54,7 @@ Bug reports and feature suggestions can be submitted to [GitHub Issues](https://

You can submit translations via [Crowdin](https://crowdin.com/project/mastodon). They are periodically merged into the codebase.

[![Crowdin](https://d322cqt584bo4o.cloudfront.net/mastodon/localized.svg)][crowdin]
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/mastodon/localized.svg)](https://crowdin.com/project/mastodon)

## Pull requests

Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Expand Up @@ -123,3 +123,4 @@ RUN cd ~ && \
# Set the work dir and the container entry point
WORKDIR /opt/mastodon
ENTRYPOINT ["/tini", "--"]
EXPOSE 3000 4000
14 changes: 7 additions & 7 deletions Gemfile
Expand Up @@ -3,7 +3,7 @@
source 'https://rubygems.org'
ruby '>= 2.4.0', '< 2.7.0'

gem 'pkg-config', '~> 1.3'
gem 'pkg-config', '~> 1.4'

gem 'puma', '~> 4.2'
gem 'rails', '~> 5.2.3'
Expand All @@ -15,7 +15,7 @@ gem 'makara', '~> 0.4'
gem 'pghero', '~> 2.3'
gem 'dotenv-rails', '~> 2.7'

gem 'aws-sdk-s3', '~> 1.48', require: false
gem 'aws-sdk-s3', '~> 1.52', require: false
gem 'fog-core', '<= 2.1.0'
gem 'fog-openstack', '~> 0.3', require: false
gem 'paperclip', '~> 6.0'
Expand Down Expand Up @@ -86,7 +86,7 @@ gem 'sidekiq-scheduler', '~> 3.0'
gem 'sidekiq-unique-jobs', '~> 6.0'
gem 'sidekiq-bulk', '~>0.2.0'
gem 'simple-navigation', '~> 4.1'
gem 'simple_form', '~> 4.1'
gem 'simple_form', '~> 5.0'
gem 'sprockets-rails', '~> 3.2', require: 'sprockets/railtie'
gem 'stoplight', '~> 2.1.3'
gem 'strong_migrations', '~> 0.4'
Expand All @@ -109,7 +109,7 @@ group :development, :test do
gem 'i18n-tasks', '~> 0.9', require: false
gem 'pry-byebug', '~> 3.7'
gem 'pry-rails', '~> 0.3'
gem 'rspec-rails', '~> 3.8'
gem 'rspec-rails', '~> 3.9'
end

group :production, :test do
Expand All @@ -119,7 +119,7 @@ end
group :test do
gem 'capybara', '~> 3.29'
gem 'climate_control', '~> 0.2'
gem 'faker', '~> 2.5'
gem 'faker', '~> 2.6'
gem 'microformats', '~> 4.1'
gem 'rails-controller-testing', '~> 1.0'
gem 'rspec-sidekiq', '~> 3.0'
Expand All @@ -129,8 +129,8 @@ group :test do
end

group :development do
gem 'active_record_query_trace', '~> 1.6'
gem 'annotate', '~> 2.7'
gem 'active_record_query_trace', '~> 1.7'
gem 'annotate', '~> 3.0'
gem 'better_errors', '~> 2.5'
gem 'binding_of_caller', '~> 0.7'
gem 'bullet', '~> 6.0'
Expand Down
76 changes: 38 additions & 38 deletions Gemfile.lock
Expand Up @@ -72,7 +72,7 @@ GEM
activemodel (>= 4.1, < 6.1)
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
active_record_query_trace (1.6.2)
active_record_query_trace (1.7)
activejob (5.2.3)
activesupport (= 5.2.3)
globalid (>= 0.3.6)
Expand All @@ -95,7 +95,7 @@ GEM
public_suffix (>= 2.0.2, < 5.0)
airbrussh (1.3.4)
sshkit (>= 1.6.1, != 1.7.0)
annotate (2.7.5)
annotate (3.0.2)
activerecord (>= 3.2, < 7.0)
rake (>= 10.4, < 13.0)
arel (9.0.0)
Expand All @@ -105,17 +105,17 @@ GEM
av (0.9.0)
cocaine (~> 0.5.3)
aws-eventstream (1.0.3)
aws-partitions (1.207.0)
aws-sdk-core (3.65.1)
aws-partitions (1.230.0)
aws-sdk-core (3.72.0)
aws-eventstream (~> 1.0, >= 1.0.2)
aws-partitions (~> 1.0)
aws-partitions (~> 1, >= 1.228.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.24.0)
aws-sdk-core (~> 3, >= 3.61.1)
aws-sdk-kms (1.25.0)
aws-sdk-core (~> 3, >= 3.71.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.48.0)
aws-sdk-core (~> 3, >= 3.61.1)
aws-sdk-s3 (1.52.0)
aws-sdk-core (~> 3, >= 3.71.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.1.0)
Expand Down Expand Up @@ -235,13 +235,13 @@ GEM
multi_json
encryptor (3.0.0)
equatable (0.6.1)
erubi (1.8.0)
erubi (1.9.0)
et-orbi (1.1.6)
tzinfo
excon (0.62.0)
fabrication (2.20.2)
faker (2.5.0)
i18n (~> 1.6.0)
faker (2.6.0)
i18n (>= 1.6, < 1.8)
faraday (0.15.4)
multipart-post (>= 1.2, < 3)
fast_blank (1.0.0)
Expand Down Expand Up @@ -307,7 +307,7 @@ GEM
httplog (1.3.2)
rack (>= 1.0)
rainbow (>= 2.0.0)
i18n (1.6.0)
i18n (1.7.0)
concurrent-ruby (~> 1.0)
i18n-tasks (0.9.29)
activesupport (>= 4.0.2)
Expand Down Expand Up @@ -380,7 +380,7 @@ GEM
mimemagic (0.3.3)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.12.0)
minitest (5.12.2)
msgpack (1.3.1)
multi_json (1.13.1)
multipart-post (2.1.1)
Expand Down Expand Up @@ -437,7 +437,7 @@ GEM
pg (1.1.4)
pghero (2.3.0)
activerecord (>= 5)
pkg-config (1.3.9)
pkg-config (1.4.0)
premailer (1.11.1)
addressable
css_parser (>= 1.6.0)
Expand Down Expand Up @@ -490,8 +490,8 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.2.0)
loofah (~> 2.2, >= 2.2.2)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
rails-i18n (5.1.3)
i18n (>= 0.7, < 2)
railties (>= 5.0, < 6)
Expand Down Expand Up @@ -540,26 +540,26 @@ GEM
rpam2 (4.0.2)
rqrcode (0.10.1)
chunky_png (~> 1.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.2)
rspec-core (3.9.0)
rspec-support (~> 3.9.0)
rspec-expectations (3.9.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-rails (3.8.2)
rspec-support (~> 3.9.0)
rspec-rails (3.9.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-support (~> 3.8.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-support (~> 3.9.0)
rspec-sidekiq (3.0.3)
rspec-core (~> 3.0, >= 3.0.0)
sidekiq (>= 2.4.0)
rspec-support (3.8.0)
rspec-support (3.9.0)
rubocop (0.75.1)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
Expand Down Expand Up @@ -599,7 +599,7 @@ GEM
thor (~> 0)
simple-navigation (4.1.0)
activesupport (>= 2.3.2)
simple_form (4.1.0)
simple_form (5.0.1)
actionpack (>= 5.0)
activemodel (>= 5.0)
simplecov (0.17.1)
Expand All @@ -622,7 +622,7 @@ GEM
stoplight (2.1.3)
streamio-ffmpeg (3.0.2)
multi_json (~> 1.8)
strong_migrations (0.4.1)
strong_migrations (0.4.2)
activerecord (>= 5)
temple (0.8.1)
terminal-table (1.8.0)
Expand Down Expand Up @@ -681,10 +681,10 @@ PLATFORMS

DEPENDENCIES
active_model_serializers (~> 0.10)
active_record_query_trace (~> 1.6)
active_record_query_trace (~> 1.7)
addressable (~> 2.7)
annotate (~> 2.7)
aws-sdk-s3 (~> 1.48)
annotate (~> 3.0)
aws-sdk-s3 (~> 1.52)
better_errors (~> 2.5)
binding_of_caller (~> 0.7)
blurhash (~> 0.1)
Expand Down Expand Up @@ -712,7 +712,7 @@ DEPENDENCIES
doorkeeper (~> 5.2)
dotenv-rails (~> 2.7)
fabrication (~> 2.20)
faker (~> 2.5)
faker (~> 2.6)
fast_blank (~> 1.0)
fastimage
fog-core (<= 2.1.0)
Expand Down Expand Up @@ -760,7 +760,7 @@ DEPENDENCIES
parslet
pg (~> 1.1)
pghero (~> 2.3)
pkg-config (~> 1.3)
pkg-config (~> 1.4)
posix-spawn!
premailer-rails
private_address_check (~> 0.5)
Expand All @@ -780,7 +780,7 @@ DEPENDENCIES
redis-namespace (~> 1.5)
redis-rails (~> 5.0)
rqrcode (~> 0.10)
rspec-rails (~> 3.8)
rspec-rails (~> 3.9)
rspec-sidekiq (~> 3.0)
rubocop (~> 0.75)
rubocop-rails (~> 2.3)
Expand All @@ -791,7 +791,7 @@ DEPENDENCIES
sidekiq-scheduler (~> 3.0)
sidekiq-unique-jobs (~> 6.0)
simple-navigation (~> 4.1)
simple_form (~> 4.1)
simple_form (~> 5.0)
simplecov (~> 0.17)
sprockets-rails (~> 3.2)
stackprof
Expand Down
1 change: 1 addition & 0 deletions app/javascript/flavours/glitch/components/modal_root.js
@@ -1,5 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import 'wicg-inert';
import createHistory from 'history/createBrowserHistory';

export default class ModalRoot extends React.PureComponent {
Expand Down
3 changes: 2 additions & 1 deletion app/javascript/flavours/glitch/components/poll.js
Expand Up @@ -39,7 +39,8 @@ class Poll extends ImmutablePureComponent {

static getDerivedStateFromProps (props, state) {
const { poll, intl } = props;
const expired = poll.get('expired') || (new Date(poll.get('expires_at'))).getTime() < intl.now();
const expires_at = poll.get('expires_at');
const expired = poll.get('expired') || expires_at !== null && (new Date(expires_at)).getTime() < intl.now();
return (expired === state.expired) ? null : { expired };
}

Expand Down
22 changes: 16 additions & 6 deletions app/javascript/flavours/glitch/components/status_prepend.js
Expand Up @@ -4,6 +4,7 @@ import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { FormattedMessage } from 'react-intl';
import Icon from 'flavours/glitch/components/icon';
import { me } from 'flavours/glitch/util/initial_state';

export default class StatusPrepend extends React.PureComponent {

Expand Down Expand Up @@ -64,12 +65,21 @@ export default class StatusPrepend extends React.PureComponent {
/>
);
case 'poll':
return (
<FormattedMessage
id='notification.poll'
defaultMessage='A poll you have voted in has ended'
/>
);
if (me === account.get('id')) {
return (
<FormattedMessage
id='notification.own_poll'
defaultMessage='Your poll has ended'
/>
);
} else {
return (
<FormattedMessage
id='notification.poll'
defaultMessage='A poll you have voted in has ended'
/>
);
}
}
return null;
}
Expand Down
Expand Up @@ -184,6 +184,15 @@ class FocalPointModal extends ImmutablePureComponent {
this.setState({ description: e.target.value, dirty: true });
}

handleKeyDown = (e) => {
if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) {
e.preventDefault();
e.stopPropagation();
this.setState({ description: e.target.value, dirty: true });
this.handleSubmit();
}
}

handleSubmit = () => {
this.props.onSave(this.state.description, this.state.focusX, this.state.focusY);
this.props.onClose();
Expand Down Expand Up @@ -254,6 +263,7 @@ class FocalPointModal extends ImmutablePureComponent {
className='setting-text light'
value={detecting ? '…' : description}
onChange={this.handleChange}
onKeyDown={this.handleKeyDown}
disabled={detecting}
autoFocus
/>
Expand Down
Expand Up @@ -19,9 +19,9 @@ const getRegex = createSelector([
return regex;
});

const makeGetStatusIds = () => createSelector([
const makeGetStatusIds = (pending = false) => createSelector([
(state, { type }) => state.getIn(['settings', type], ImmutableMap()),
(state, { type }) => state.getIn(['timelines', type, 'items'], ImmutableList()),
(state, { type }) => state.getIn(['timelines', type, pending ? 'pendingItems' : 'items'], ImmutableList()),
(state) => state.get('statuses'),
getRegex,
], (columnSettings, statusIds, statuses, regex) => {
Expand Down Expand Up @@ -56,13 +56,14 @@ const makeGetStatusIds = () => createSelector([

const makeMapStateToProps = () => {
const getStatusIds = makeGetStatusIds();
const getPendingStatusIds = makeGetStatusIds(true);

const mapStateToProps = (state, { timelineId }) => ({
statusIds: getStatusIds(state, { type: timelineId }),
isLoading: state.getIn(['timelines', timelineId, 'isLoading'], true),
isPartial: state.getIn(['timelines', timelineId, 'isPartial'], false),
hasMore: state.getIn(['timelines', timelineId, 'hasMore']),
numPending: state.getIn(['timelines', timelineId, 'pendingItems'], ImmutableList()).size,
numPending: getPendingStatusIds(state, { type: timelineId }).size,
});

return mapStateToProps;
Expand Down

0 comments on commit dd2ec97

Please sign in to comment.