Merge remote-tracking branch 'upstream/master' into glitch-soc/merge-upstream

Conflicts:
- Gemfile.lock
- config/webpack/rules/css.js
- package.json
- yarn.lock
This commit is contained in:
Thibaut Girka 2019-06-03 14:54:30 +02:00
commit 76918554a6
18 changed files with 896 additions and 846 deletions

View File

@ -131,7 +131,7 @@ group :development do
gem 'letter_opener', '~> 1.7' gem 'letter_opener', '~> 1.7'
gem 'letter_opener_web', '~> 1.3' gem 'letter_opener_web', '~> 1.3'
gem 'memory_profiler' gem 'memory_profiler'
gem 'rubocop', '~> 0.70', require: false gem 'rubocop', '~> 0.71', require: false
gem 'brakeman', '~> 4.5', require: false gem 'brakeman', '~> 4.5', require: false
gem 'bundler-audit', '~> 0.6', require: false gem 'bundler-audit', '~> 0.6', require: false
gem 'scss_lint', '~> 0.58', require: false gem 'scss_lint', '~> 0.58', require: false

View File

@ -481,7 +481,7 @@ GEM
rdf-normalize (0.3.3) rdf-normalize (0.3.3)
rdf (>= 2.2, < 4.0) rdf (>= 2.2, < 4.0)
redcarpet (3.4.0) redcarpet (3.4.0)
redis (4.1.1) redis (4.1.2)
redis-actionpack (5.0.2) redis-actionpack (5.0.2)
actionpack (>= 4.0, < 6) actionpack (>= 4.0, < 6)
redis-rack (>= 1, < 3) redis-rack (>= 1, < 3)
@ -530,14 +530,14 @@ GEM
rspec-core (~> 3.0, >= 3.0.0) rspec-core (~> 3.0, >= 3.0.0)
sidekiq (>= 2.4.0) sidekiq (>= 2.4.0)
rspec-support (3.8.0) rspec-support (3.8.0)
rubocop (0.70.0) rubocop (0.71.0)
jaro_winkler (~> 1.5.1) jaro_winkler (~> 1.5.1)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 2.6) parser (>= 2.6)
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7) unicode-display_width (>= 1.4.0, < 1.7)
ruby-progressbar (1.10.0) ruby-progressbar (1.10.1)
ruby-saml (1.9.0) ruby-saml (1.9.0)
nokogiri (>= 1.5.10) nokogiri (>= 1.5.10)
rufus-scheduler (3.5.2) rufus-scheduler (3.5.2)
@ -636,7 +636,7 @@ GEM
addressable (>= 2.3.6) addressable (>= 2.3.6)
crack (>= 0.3.2) crack (>= 0.3.2)
hashdiff hashdiff
webpacker (4.0.4) webpacker (4.0.6)
activesupport (>= 4.2) activesupport (>= 4.2)
rack-proxy (>= 0.6.1) rack-proxy (>= 0.6.1)
railties (>= 4.2) railties (>= 4.2)
@ -750,7 +750,7 @@ DEPENDENCIES
rqrcode (~> 0.10) rqrcode (~> 0.10)
rspec-rails (~> 3.8) rspec-rails (~> 3.8)
rspec-sidekiq (~> 3.0) rspec-sidekiq (~> 3.0)
rubocop (~> 0.70) rubocop (~> 0.71)
sanitize (~> 5.0) sanitize (~> 5.0)
scss_lint (~> 0.58) scss_lint (~> 0.58)
sidekiq (~> 5.2) sidekiq (~> 5.2)

View File

@ -189,7 +189,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
} }
render () { render () {
const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus } = this.props; const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, children } = this.props;
const { suggestionsHidden } = this.state; const { suggestionsHidden } = this.state;
const style = { direction: 'ltr' }; const style = { direction: 'ltr' };
@ -197,7 +197,8 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
style.direction = 'rtl'; style.direction = 'rtl';
} }
return ( return [
<div className='compose-form__autosuggest-wrapper'>
<div className='autosuggest-textarea'> <div className='autosuggest-textarea'>
<label> <label>
<span style={{ display: 'none' }}>{placeholder}</span> <span style={{ display: 'none' }}>{placeholder}</span>
@ -219,12 +220,15 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
aria-autocomplete='list' aria-autocomplete='list'
/> />
</label> </label>
</div>
{children}
</div>,
<div className='autosuggest-textarea__suggestions-wrapper'>
<div className={`autosuggest-textarea__suggestions ${suggestionsHidden || suggestions.isEmpty() ? '' : 'autosuggest-textarea__suggestions--visible'}`}> <div className={`autosuggest-textarea__suggestions ${suggestionsHidden || suggestions.isEmpty() ? '' : 'autosuggest-textarea__suggestions--visible'}`}>
{suggestions.map(this.renderSuggestion)} {suggestions.map(this.renderSuggestion)}
</div> </div>
</div> </div>,
); ];
} }
} }

View File

@ -201,7 +201,10 @@ class ComposeForm extends ImmutablePureComponent {
/> />
</div> </div>
<div className='compose-form__autosuggest-wrapper'> <div className='emoji-picker-wrapper'>
<EmojiPickerDropdown onPickEmoji={this.handleEmojiPick} />
</div>
<AutosuggestTextarea <AutosuggestTextarea
ref={this.setAutosuggestTextarea} ref={this.setAutosuggestTextarea}
placeholder={intl.formatMessage(messages.placeholder)} placeholder={intl.formatMessage(messages.placeholder)}
@ -215,15 +218,12 @@ class ComposeForm extends ImmutablePureComponent {
onSuggestionSelected={this.onSuggestionSelected} onSuggestionSelected={this.onSuggestionSelected}
onPaste={onPaste} onPaste={onPaste}
autoFocus={!showSearch && !isMobile(window.innerWidth)} autoFocus={!showSearch && !isMobile(window.innerWidth)}
/> >
<EmojiPickerDropdown onPickEmoji={this.handleEmojiPick} />
</div>
<div className='compose-form__modifiers'> <div className='compose-form__modifiers'>
<UploadFormContainer /> <UploadFormContainer />
<PollFormContainer /> <PollFormContainer />
</div> </div>
</AutosuggestTextarea>
<div className='compose-form__buttons-wrapper'> <div className='compose-form__buttons-wrapper'>
<div className='compose-form__buttons'> <div className='compose-form__buttons'>

View File

@ -9,9 +9,6 @@ const ComposePanel = () => (
<SearchContainer openInRoute /> <SearchContainer openInRoute />
<NavigationContainer /> <NavigationContainer />
<ComposeFormContainer /> <ComposeFormContainer />
<div className='flex-spacer' />
<LinkFooter withHotkeys /> <LinkFooter withHotkeys />
</div> </div>
); );

View File

@ -68,6 +68,7 @@
margin: 0; margin: 0;
border-radius: 4px; border-radius: 4px;
background: darken($ui-base-color, 8%); background: darken($ui-base-color, 8%);
object-fit: cover;
} }
} }

View File

@ -333,14 +333,15 @@
} }
} }
.compose-form__autosuggest-wrapper {
position: relative;
.emoji-picker-dropdown { .emoji-picker-dropdown {
position: absolute; position: absolute;
right: 5px;
top: 5px; top: 5px;
right: 5px;
z-index: 1;
} }
.compose-form__autosuggest-wrapper {
position: relative;
} }
.autosuggest-textarea, .autosuggest-textarea,
@ -355,7 +356,8 @@
opacity: 0.0; opacity: 0.0;
&.spoiler-input--visible { &.spoiler-input--visible {
height: 47px; height: 36px;
margin-bottom: 11px;
opacity: 1.0; opacity: 1.0;
} }
} }
@ -406,6 +408,12 @@
} }
} }
.emoji-picker-wrapper,
.autosuggest-textarea__suggestions-wrapper {
position: relative;
height: 0;
}
.autosuggest-textarea__suggestions { .autosuggest-textarea__suggestions {
box-sizing: border-box; box-sizing: border-box;
display: none; display: none;
@ -566,6 +574,7 @@
border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex: 0 0 auto;
.compose-form__buttons { .compose-form__buttons {
display: flex; display: flex;
@ -614,6 +623,7 @@
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
min-width: 0; min-width: 0;
flex: 0 0 auto;
.compose-form__publish-button-wrapper { .compose-form__publish-button-wrapper {
overflow: hidden; overflow: hidden;
@ -644,6 +654,9 @@
margin-bottom: 10px; margin-bottom: 10px;
background: $ui-primary-color; background: $ui-primary-color;
padding: 10px; padding: 10px;
min-height: 23px;
overflow-y: auto;
flex: 0 2 auto;
} }
.reply-indicator__header { .reply-indicator__header {
@ -1794,7 +1807,6 @@ a.account__display-name {
height: 100%; height: 100%;
&__pane { &__pane {
flex: 1 1 auto;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
pointer-events: none; pointer-events: none;
@ -2185,7 +2197,8 @@ a.account__display-name {
margin-top: 10px; margin-top: 10px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: calc(100% - 10px);
overflow-y: hidden;
.search__input { .search__input {
line-height: 18px; line-height: 18px;
@ -2201,14 +2214,33 @@ a.account__display-name {
.navigation-bar { .navigation-bar {
padding-top: 20px; padding-top: 20px;
padding-bottom: 20px; padding-bottom: 20px;
flex: 0 1 48px;
min-height: 20px;
} }
.flex-spacer { .flex-spacer {
background: transparent; background: transparent;
} }
.compose-form {
flex: 1;
overflow-y: hidden;
display: flex;
flex-direction: column;
min-height: 310px;
padding-bottom: 71px;
margin-bottom: -71px;
}
.compose-form__autosuggest-wrapper {
overflow-y: auto;
background-color: $white;
border-radius: 4px 4px 0 0;
flex: 0 1 auto;
}
.autosuggest-textarea__textarea { .autosuggest-textarea__textarea {
max-height: 200px; overflow-y: hidden;
} }
.compose-form__upload-thumbnail { .compose-form__upload-thumbnail {
@ -2218,6 +2250,9 @@ a.account__display-name {
.navigation-panel { .navigation-panel {
margin-top: 10px; margin-top: 10px;
margin-bottom: 10px;
height: calc(100% - 20px);
overflow-y: auto;
hr { hr {
border: 0; border: 0;

View File

@ -49,7 +49,7 @@ sk:
few: Sledovateľov few: Sledovateľov
one: Sledovateľ one: Sledovateľ
other: Sledovatelia other: Sledovatelia
following: Sledovaní following: Následujem
joined: Pridal/a sa v %{date} joined: Pridal/a sa v %{date}
last_active: naposledy aktívny last_active: naposledy aktívny
link_verified_on: Vlastníctvo tohto odkazu bolo skontrolované %{date} link_verified_on: Vlastníctvo tohto odkazu bolo skontrolované %{date}
@ -214,7 +214,7 @@ sk:
silence_account: "%{name} utíšil/a účet %{target}" silence_account: "%{name} utíšil/a účet %{target}"
suspend_account: "%{name} zablokoval/a účet používateľa %{target}" suspend_account: "%{name} zablokoval/a účet používateľa %{target}"
unassigned_report: "%{name} odobral/a report od %{target}" unassigned_report: "%{name} odobral/a report od %{target}"
unsilence_account: "%{name} zrušil/a utíšenie účtu používateľa %{target}" unsilence_account: "%{name} zrušil/a stíšenie účtu používateľa %{target}"
unsuspend_account: "%{name} zrušil/a blokovanie účtu používateľa %{target}" unsuspend_account: "%{name} zrušil/a blokovanie účtu používateľa %{target}"
update_custom_emoji: "%{name} aktualizoval/a emoji %{target}" update_custom_emoji: "%{name} aktualizoval/a emoji %{target}"
update_status: "%{name} aktualizoval/a status pre %{target}" update_status: "%{name} aktualizoval/a status pre %{target}"

View File

@ -35,7 +35,7 @@ defaults: &defaults
flavour: 'glitch' flavour: 'glitch'
skin: 'default' skin: 'default'
aggregate_reblogs: true aggregate_reblogs: true
advanced_layout: true advanced_layout: false
notification_emails: notification_emails:
follow: false follow: false
reblog: false reblog: false

View File

@ -22,7 +22,6 @@ module.exports = {
loader: 'sass-loader', loader: 'sass-loader',
options: { options: {
includePaths: ['app/javascript'], includePaths: ['app/javascript'],
fiber: require('fibers'),
implementation: require('sass'), implementation: require('sass'),
sourceMap: true, sourceMap: true,
}, },

View File

@ -8,6 +8,6 @@ class CreateAccountModerationNotes < ActiveRecord::Migration[5.1]
t.timestamps t.timestamps
end end
add_foreign_key :account_moderation_notes, :accounts, column: :target_account_id safety_assured { add_foreign_key :account_moderation_notes, :accounts, column: :target_account_id }
end end
end end

View File

@ -1,5 +1,5 @@
class AddForeignKeyToAccountModerationNotes < ActiveRecord::Migration[5.1] class AddForeignKeyToAccountModerationNotes < ActiveRecord::Migration[5.1]
def change def change
add_foreign_key :account_moderation_notes, :accounts safety_assured { add_foreign_key :account_moderation_notes, :accounts }
end end
end end

View File

@ -1,6 +1,6 @@
class AddMovedToAccountIdToAccounts < ActiveRecord::Migration[5.1] class AddMovedToAccountIdToAccounts < ActiveRecord::Migration[5.1]
def change def change
add_column :accounts, :moved_to_account_id, :bigint, null: true, default: nil add_column :accounts, :moved_to_account_id, :bigint, null: true, default: nil
add_foreign_key :accounts, :accounts, column: :moved_to_account_id, on_delete: :nullify safety_assured { add_foreign_key :accounts, :accounts, column: :moved_to_account_id, on_delete: :nullify }
end end
end end

View File

@ -0,0 +1,17 @@
class PreserveOldLayoutForExistingUsers < ActiveRecord::Migration[5.2]
disable_ddl_transaction!
def up
# Assume that currently active users are already using the layout that they
# want to use, therefore ensure that it is saved explicitly and not based
# on the to-be-changed default
User.where(User.arel_table[:current_sign_in_at].gteq(1.month.ago)).find_each do |user|
next if Setting.unscoped.where(thing_type: 'User', thing_id: user.id, var: 'advanced_layout').exists?
user.settings.advanced_layout = true
end
end
def down
end
end

View File

@ -10,7 +10,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2019_05_19_130537) do ActiveRecord::Schema.define(version: 2019_05_29_143559) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"

View File

@ -73,8 +73,8 @@
"@clusterws/cws": "^0.14.0", "@clusterws/cws": "^0.14.0",
"array-includes": "^3.0.3", "array-includes": "^3.0.3",
"atrament": "^0.2.3", "atrament": "^0.2.3",
"autoprefixer": "^9.4.10", "autoprefixer": "^9.5.1",
"axios": "^0.18.0", "axios": "^0.19.0",
"babel-loader": "^8.0.5", "babel-loader": "^8.0.5",
"babel-plugin-lodash": "^3.3.4", "babel-plugin-lodash": "^3.3.4",
"babel-plugin-preval": "^3.0.1", "babel-plugin-preval": "^3.0.1",
@ -88,18 +88,16 @@
"css-loader": "^2.1.1", "css-loader": "^2.1.1",
"cssnano": "^4.1.10", "cssnano": "^4.1.10",
"detect-passive-events": "^1.0.2", "detect-passive-events": "^1.0.2",
"dotenv": "^6.2.0", "dotenv": "^8.0.0",
"emoji-mart": "Gargron/emoji-mart#build", "emoji-mart": "Gargron/emoji-mart#build",
"es6-symbol": "^3.1.1", "es6-symbol": "^3.1.1",
"escape-html": "^1.0.3", "escape-html": "^1.0.3",
"exif-js": "^2.3.0", "exif-js": "^2.3.0",
"express": "^4.17.1", "express": "^4.17.1",
"favico.js": "^0.3.10", "favico.js": "^0.3.10",
"fibers": "^3.1.1",
"file-loader": "^3.0.1", "file-loader": "^3.0.1",
"font-awesome": "^4.7.0", "font-awesome": "^4.7.0",
"glob": "^7.1.1", "glob": "^7.1.1",
"history": "^4.7.2",
"http-link-header": "^1.0.2", "http-link-header": "^1.0.2",
"immutable": "^3.8.2", "immutable": "^3.8.2",
"imports-loader": "^0.8.0", "imports-loader": "^0.8.0",
@ -117,15 +115,15 @@
"npmlog": "^4.1.2", "npmlog": "^4.1.2",
"object-assign": "^4.1.1", "object-assign": "^4.1.1",
"object-fit-images": "^3.2.3", "object-fit-images": "^3.2.3",
"object.values": "^1.0.4", "object.values": "^1.1.0",
"offline-plugin": "^5.0.6", "offline-plugin": "^5.0.7",
"path-complete-extname": "^1.0.0", "path-complete-extname": "^1.0.0",
"pg": "^6.4.0", "pg": "^6.4.0",
"postcss-loader": "^3.0.0", "postcss-loader": "^3.0.0",
"postcss-object-fit-images": "^1.1.2", "postcss-object-fit-images": "^1.1.2",
"prop-types": "^15.5.10", "prop-types": "^15.5.10",
"punycode": "^2.1.0", "punycode": "^2.1.0",
"rails-ujs": "^5.2.2", "rails-ujs": "^5.2.3",
"react": "^16.7.0", "react": "^16.7.0",
"react-dom": "^16.7.0", "react-dom": "^16.7.0",
"react-hotkeys": "^1.1.4", "react-hotkeys": "^1.1.4",
@ -140,7 +138,7 @@
"react-redux-loading-bar": "^4.0.8", "react-redux-loading-bar": "^4.0.8",
"react-router-dom": "^4.1.1", "react-router-dom": "^4.1.1",
"react-router-scroll-4": "^1.0.0-beta.1", "react-router-scroll-4": "^1.0.0-beta.1",
"react-select": "^2.2.0", "react-select": "^2.4.4",
"react-sparklines": "^1.7.0", "react-sparklines": "^1.7.0",
"react-swipeable-views": "^0.13.0", "react-swipeable-views": "^0.13.0",
"react-textarea-autosize": "^7.1.0", "react-textarea-autosize": "^7.1.0",
@ -153,7 +151,7 @@
"requestidlecallback": "^0.3.0", "requestidlecallback": "^0.3.0",
"reselect": "^4.0.0", "reselect": "^4.0.0",
"rimraf": "^2.6.3", "rimraf": "^2.6.3",
"sass": "^1.17.2", "sass": "^1.20.1",
"sass-loader": "^7.0.3", "sass-loader": "^7.0.3",
"stringz": "^1.0.0", "stringz": "^1.0.0",
"substring-trie": "^1.0.2", "substring-trie": "^1.0.2",
@ -164,25 +162,25 @@
"webpack": "^4.29.6", "webpack": "^4.29.6",
"webpack-assets-manifest": "^3.1.1", "webpack-assets-manifest": "^3.1.1",
"webpack-bundle-analyzer": "^3.1.0", "webpack-bundle-analyzer": "^3.1.0",
"webpack-cli": "^3.2.3", "webpack-cli": "^3.3.2",
"webpack-merge": "^4.2.1", "webpack-merge": "^4.2.1",
"websocket.js": "^0.1.12" "websocket.js": "^0.1.12"
}, },
"devDependencies": { "devDependencies": {
"babel-eslint": "^10.0.1", "babel-eslint": "^10.0.1",
"babel-jest": "^24.5.0", "babel-jest": "^24.8.0",
"enzyme": "^3.8.0", "enzyme": "^3.8.0",
"enzyme-adapter-react-16": "^1.7.1", "enzyme-adapter-react-16": "^1.7.1",
"eslint": "^5.11.1", "eslint": "^5.11.1",
"eslint-plugin-import": "~2.14.0", "eslint-plugin-import": "~2.14.0",
"eslint-plugin-jsx-a11y": "~6.1.2", "eslint-plugin-jsx-a11y": "~6.2.1",
"eslint-plugin-promise": "~4.0.1", "eslint-plugin-promise": "~4.1.1",
"eslint-plugin-react": "~7.12.1", "eslint-plugin-react": "~7.12.1",
"jest": "^24.5.0", "jest": "^24.8.0",
"raf": "^3.4.1", "raf": "^3.4.1",
"react-intl-translations-manager": "^5.0.3", "react-intl-translations-manager": "^5.0.3",
"react-test-renderer": "^16.7.0", "react-test-renderer": "^16.7.0",
"webpack-dev-server": "^3.2.1", "webpack-dev-server": "^3.5.1",
"yargs": "^12.0.5" "yargs": "^12.0.5"
} }
} }

View File

@ -105,7 +105,7 @@ RSpec.describe NotifyService, type: :service do
end end
it 'shows reblogs when disabled' do it 'shows reblogs when disabled' do
recipient.follow!(sender, reblogs: true) recipient.follow!(sender, reblogs: false)
is_expected.to change(Notification, :count) is_expected.to change(Notification, :count)
end end
end end

1513
yarn.lock

File diff suppressed because it is too large Load Diff