From e6fd4bea35d311f9d2a3569fb0165bbaaf9c593b Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Tue, 16 Jan 2018 14:15:28 +0900 Subject: [PATCH 01/11] Stop duplicate CI with Pull Request (#6265) see also https://blog.travis-ci.com/2012-08-13-build-workflow-around-pull-requests --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 777ca581cb..59d495c433 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,9 @@ cache: - tmp/cache/babel-loader dist: trusty sudo: required +branches: + only: + - master notifications: email: false From 9a28052e92702463098570a181b2f7b2e8859b1e Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Tue, 16 Jan 2018 14:26:46 +0900 Subject: [PATCH 02/11] Change image URL in mailer to full path (#6264) --- app/mailers/user_mailer.rb | 2 ++ app/views/layouts/mailer.html.haml | 4 ++-- app/views/user_mailer/confirmation_instructions.html.haml | 2 +- app/views/user_mailer/email_changed.html.haml | 2 +- app/views/user_mailer/password_change.html.haml | 2 +- app/views/user_mailer/reconfirmation_instructions.html.haml | 2 +- app/views/user_mailer/reset_password_instructions.html.haml | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 7821be32b2..a7efa73c1c 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -5,6 +5,8 @@ class UserMailer < Devise::Mailer helper :instance + add_template_helper RoutingHelper + def confirmation_instructions(user, token, **) @resource = user @token = token diff --git a/app/views/layouts/mailer.html.haml b/app/views/layouts/mailer.html.haml index 8a7ce43691..e41b910699 100644 --- a/app/views/layouts/mailer.html.haml +++ b/app/views/layouts/mailer.html.haml @@ -24,7 +24,7 @@ %tr %td.column-cell = link_to root_url do - = image_tag asset_pack_path('logo_full.svg'), height: 34, class: 'logo' + = image_tag full_pack_url('logo_full.svg'), alt: 'Mastodon', height: 34, class: 'logo' = yield @@ -52,4 +52,4 @@ %tbody %td.column-cell.text-right = link_to root_url do - = image_tag asset_pack_path('logo_transparent.svg'), height: 24 + = image_tag full_pack_url('logo_transparent.svg'), alt: 'Mastodon', height: 24 diff --git a/app/views/user_mailer/confirmation_instructions.html.haml b/app/views/user_mailer/confirmation_instructions.html.haml index 7a148ec727..0f999bcbcb 100644 --- a/app/views/user_mailer/confirmation_instructions.html.haml +++ b/app/views/user_mailer/confirmation_instructions.html.haml @@ -17,7 +17,7 @@ %tbody %tr %td - = image_tag asset_pack_path('icon_email.svg') + = image_tag full_pack_url('icon_email.svg'), alt: '' %h1= t 'devise.mailer.confirmation_instructions.title' diff --git a/app/views/user_mailer/email_changed.html.haml b/app/views/user_mailer/email_changed.html.haml index e526f3a2c2..45dc066509 100644 --- a/app/views/user_mailer/email_changed.html.haml +++ b/app/views/user_mailer/email_changed.html.haml @@ -17,7 +17,7 @@ %tbody %tr %td - = image_tag asset_pack_path('icon_email.svg') + = image_tag full_pack_url('icon_email.svg'), alt: '' %h1= t 'devise.mailer.email_changed.title' %p.lead= t 'devise.mailer.email_changed.explanation' diff --git a/app/views/user_mailer/password_change.html.haml b/app/views/user_mailer/password_change.html.haml index a0afd59305..2e9377dff1 100644 --- a/app/views/user_mailer/password_change.html.haml +++ b/app/views/user_mailer/password_change.html.haml @@ -17,7 +17,7 @@ %tbody %tr %td - = image_tag asset_pack_path('icon_lock_open.svg') + = image_tag full_pack_url('icon_lock_open.svg'), alt: '' %h1= t 'devise.mailer.password_change.title' %p.lead= t 'devise.mailer.password_change.explanation' diff --git a/app/views/user_mailer/reconfirmation_instructions.html.haml b/app/views/user_mailer/reconfirmation_instructions.html.haml index 52855e2232..3ae2260939 100644 --- a/app/views/user_mailer/reconfirmation_instructions.html.haml +++ b/app/views/user_mailer/reconfirmation_instructions.html.haml @@ -17,7 +17,7 @@ %tbody %tr %td - = image_tag asset_pack_path('icon_email.svg') + = image_tag full_pack_url('icon_email.svg'), alt: '' %h1= t 'devise.mailer.reconfirmation_instructions.title' %p.lead= t 'devise.mailer.reconfirmation_instructions.explanation' diff --git a/app/views/user_mailer/reset_password_instructions.html.haml b/app/views/user_mailer/reset_password_instructions.html.haml index c6a9d4bf6e..c0e6775d4a 100644 --- a/app/views/user_mailer/reset_password_instructions.html.haml +++ b/app/views/user_mailer/reset_password_instructions.html.haml @@ -17,7 +17,7 @@ %tbody %tr %td - = image_tag asset_pack_path('icon_lock_open.svg') + = image_tag full_pack_url('icon_lock_open.svg'), alt: '' %h1= t 'devise.mailer.reset_password_instructions.title' %p.lead= t 'devise.mailer.reset_password_instructions.explanation' From 3323b4173edad987a049c6c1c2903781ed5be059 Mon Sep 17 00:00:00 2001 From: SerCom_KC Date: Tue, 16 Jan 2018 13:44:57 +0800 Subject: [PATCH 03/11] Change disclaimer in email according to #5817 (#6266) --- config/locales/devise.en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml index 4b3f81edb8..19c1463224 100644 --- a/config/locales/devise.en.yml +++ b/config/locales/devise.en.yml @@ -19,7 +19,7 @@ en: confirmation_instructions: action: Verify email address explanation: You have created an account on %{host} with this email address. You are one click away from activating it. If this wasn't you, please ignore this e-mail. - extra_html: Please also check out our terms of service and privacy policy. + extra_html: Please also check out the rules of the instance and our terms of service. subject: 'Mastodon: Confirmation instructions for %{instance}' title: Verify e-mail address email_changed: From 02194838dd64558cd974e68cb0bf800dffd25c91 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 16 Jan 2018 20:20:15 +0100 Subject: [PATCH 04/11] HTML e-mails for NotificationMailer (#6263) * HTML e-mails for NotificationMailer (except digest) * Add HTML template for digest * Fix build --- app/javascript/images/icon_cached.svg | 4 + app/javascript/images/icon_grade.svg | 4 + app/javascript/images/icon_person_add.svg | 4 + app/javascript/images/icon_reply.svg | 4 + app/javascript/styles/mailer.scss | 78 +++++++++++++++++++ app/mailers/notification_mailer.rb | 4 +- .../notification_mailer/_status.html.haml | 30 +++++++ .../notification_mailer/digest.html.haml | 44 +++++++++++ .../notification_mailer/favourite.html.haml | 45 +++++++++++ .../notification_mailer/follow.html.haml | 43 ++++++++++ .../follow_request.html.haml | 43 ++++++++++ .../notification_mailer/mention.html.haml | 45 +++++++++++ .../notification_mailer/reblog.html.haml | 45 +++++++++++ config/locales/en.yml | 16 +++- .../previews/notification_mailer_preview.rb | 6 ++ 15 files changed, 410 insertions(+), 5 deletions(-) create mode 100644 app/javascript/images/icon_cached.svg create mode 100644 app/javascript/images/icon_grade.svg create mode 100644 app/javascript/images/icon_person_add.svg create mode 100644 app/javascript/images/icon_reply.svg create mode 100644 app/views/notification_mailer/_status.html.haml create mode 100644 app/views/notification_mailer/digest.html.haml create mode 100644 app/views/notification_mailer/favourite.html.haml create mode 100644 app/views/notification_mailer/follow.html.haml create mode 100644 app/views/notification_mailer/follow_request.html.haml create mode 100644 app/views/notification_mailer/mention.html.haml create mode 100644 app/views/notification_mailer/reblog.html.haml diff --git a/app/javascript/images/icon_cached.svg b/app/javascript/images/icon_cached.svg new file mode 100644 index 0000000000..8fdd63f44d --- /dev/null +++ b/app/javascript/images/icon_cached.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/javascript/images/icon_grade.svg b/app/javascript/images/icon_grade.svg new file mode 100644 index 0000000000..f48b468899 --- /dev/null +++ b/app/javascript/images/icon_grade.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/javascript/images/icon_person_add.svg b/app/javascript/images/icon_person_add.svg new file mode 100644 index 0000000000..068b8ae7cc --- /dev/null +++ b/app/javascript/images/icon_person_add.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/javascript/images/icon_reply.svg b/app/javascript/images/icon_reply.svg new file mode 100644 index 0000000000..cf6a09abc6 --- /dev/null +++ b/app/javascript/images/icon_reply.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/javascript/styles/mailer.scss b/app/javascript/styles/mailer.scss index 2fd3f26610..d84763612e 100644 --- a/app/javascript/styles/mailer.scss +++ b/app/javascript/styles/mailer.scss @@ -254,6 +254,10 @@ h3 { .content-cell { background-color: darken($ui-base-color, 4%); + + &.darker { + background-color: darken($ui-base-color, 8%); + } } .hero { @@ -261,6 +265,18 @@ h3 { padding-top: 20px; } +.hero-with-button { + h1 { + margin-bottom: 4px; + } + + p.lead { + margin-bottom: 32px; + } + + padding-bottom: 16px; +} + .header { border-radius: 5px 5px 0 0; background-color: darken($ui-base-color, 8%); @@ -385,6 +401,68 @@ h3 { } } +.hr { + width: 100%; + + td { + font-size: 0; + line-height: 1px; + mso-line-height-rule: exactly; + min-height: 1px; + overflow: hidden; + height: 2px; + background-color: transparent !important; + border-top: 1px solid lighten($ui-base-color, 8%); + } +} + +.status { + padding-bottom: 32px; + + .status-header { + td { + font-size: 14px; + padding-bottom: 15px; + } + + bdi { + color: $white; + font-size: 16px; + display: block; + font-weight: 500; + } + + td:first-child { + padding-right: 10px; + } + + img { + width: 48px; + height: 48px; + border-radius: 4px; + } + } + + p { + font-size: 19px; + margin-bottom: 20px; + + &.status-footer { + color: lighten($ui-base-color, 26%); + font-size: 14px; + margin-bottom: 0; + + a { + color: lighten($ui-base-color, 26%); + } + } + } +} + +.border-top { + border-top: 1px solid lighten($ui-base-color, 8%); +} + @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: landscape) { body { min-height: 1024px !important; diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb index 07992102da..9fed4a6369 100644 --- a/app/mailers/notification_mailer.rb +++ b/app/mailers/notification_mailer.rb @@ -1,10 +1,10 @@ # frozen_string_literal: true class NotificationMailer < ApplicationMailer - layout 'plain_mailer' - helper :stream_entries + add_template_helper RoutingHelper + def mention(recipient, notification) @me = recipient @status = notification.target_status diff --git a/app/views/notification_mailer/_status.html.haml b/app/views/notification_mailer/_status.html.haml new file mode 100644 index 0000000000..1e796ed294 --- /dev/null +++ b/app/views/notification_mailer/_status.html.haml @@ -0,0 +1,30 @@ +- i ||= 0 + +%table.email-table{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.email-body + .email-container + %table.content-section{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.content-cell{ class: i.zero? ? 'content-start' : nil } + .email-row + .col-6 + %table.column{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.column-cell.padded.status + %table.status-header{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td{ align: 'left', width: 48 } + = image_tag status.account.avatar + %td{ align: 'left' } + %bdi= display_name(status.account) + = "@#{status.account.acct}" + + = Formatter.instance.format(status) + + %p.status-footer + = link_to l(status.created_at), web_url("statuses/#{status.id}") diff --git a/app/views/notification_mailer/digest.html.haml b/app/views/notification_mailer/digest.html.haml new file mode 100644 index 0000000000..10e44f8dde --- /dev/null +++ b/app/views/notification_mailer/digest.html.haml @@ -0,0 +1,44 @@ +%table.email-table{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.email-body + .email-container + %table.content-section{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.content-cell.darker.hero-with-button + .email-row + .col-6 + %table.column{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.column-cell.text-center.padded + %h1= t 'notification_mailer.digest.title' + %p.lead= t('notification_mailer.digest.body', since: l(@since.to_date, format: :short), instance: site_hostname) + %table.button{ align: 'center', cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.button-primary + = link_to web_url do + %span= t 'notification_mailer.digest.action' + +- @notifications.each_with_index do |n, i| + = render 'status', status: n.target_status, i: i + +- unless @follows_since.zero? + %table.email-table{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.email-body + .email-container + %table.content-section{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.content-cell.content-start.border-top + .email-row + .col-6 + %table.column{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.column-cell.text-center + %p= t('notification_mailer.digest.new_followers_summary', count: @follows_since) diff --git a/app/views/notification_mailer/favourite.html.haml b/app/views/notification_mailer/favourite.html.haml new file mode 100644 index 0000000000..6cbc552faa --- /dev/null +++ b/app/views/notification_mailer/favourite.html.haml @@ -0,0 +1,45 @@ +%table.email-table{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.email-body + .email-container + %table.content-section{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.content-cell.hero + .email-row + .col-6 + %table.column{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.column-cell.text-center.padded + %table.hero-icon{ align: 'center', cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td + = image_tag asset_pack_path('icon_grade.svg') + + %h1= t 'notification_mailer.favourite.title' + %p.lead= t('notification_mailer.favourite.body', name: @account.acct) + += render 'status', status: @status + +%table.email-table{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.email-body + .email-container + %table.content-section{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.content-cell.content-start.border-top + %table.column{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.column-cell.button-cell + %table.button{ align: 'center', cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.button-primary + = link_to web_url("statuses/#{@status.id}") do + %span= t 'application_mailer.view_status' diff --git a/app/views/notification_mailer/follow.html.haml b/app/views/notification_mailer/follow.html.haml new file mode 100644 index 0000000000..d1ae18ea96 --- /dev/null +++ b/app/views/notification_mailer/follow.html.haml @@ -0,0 +1,43 @@ +%table.email-table{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.email-body + .email-container + %table.content-section{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.content-cell.hero + .email-row + .col-6 + %table.column{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.column-cell.text-center.padded + %table.hero-icon{ align: 'center', cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td + = image_tag asset_pack_path('icon_person_add.svg') + + %h1= t 'notification_mailer.follow.title' + %p.lead= t('notification_mailer.follow.body', name: @account.acct) + +%table.email-table{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.email-body + .email-container + %table.content-section{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.content-cell.content-start + %table.column{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.column-cell.button-cell + %table.button{ align: 'center', cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.button-primary + = link_to web_url("accounts/#{@account.id}") do + %span= t 'application_mailer.view_profile' diff --git a/app/views/notification_mailer/follow_request.html.haml b/app/views/notification_mailer/follow_request.html.haml new file mode 100644 index 0000000000..ce5f578b11 --- /dev/null +++ b/app/views/notification_mailer/follow_request.html.haml @@ -0,0 +1,43 @@ +%table.email-table{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.email-body + .email-container + %table.content-section{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.content-cell.hero + .email-row + .col-6 + %table.column{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.column-cell.text-center.padded + %table.hero-icon{ align: 'center', cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td + = image_tag asset_pack_path('icon_person_add.svg') + + %h1= t 'notification_mailer.follow_request.title' + %p.lead= t('notification_mailer.follow_request.body', name: @account.acct) + +%table.email-table{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.email-body + .email-container + %table.content-section{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.content-cell.content-start + %table.column{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.column-cell.button-cell + %table.button{ align: 'center', cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.button-primary + = link_to web_url("follow_requests") do + %span= t 'notification_mailer.follow_request.action' diff --git a/app/views/notification_mailer/mention.html.haml b/app/views/notification_mailer/mention.html.haml new file mode 100644 index 0000000000..9ecbe8550d --- /dev/null +++ b/app/views/notification_mailer/mention.html.haml @@ -0,0 +1,45 @@ +%table.email-table{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.email-body + .email-container + %table.content-section{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.content-cell.hero + .email-row + .col-6 + %table.column{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.column-cell.text-center.padded + %table.hero-icon{ align: 'center', cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td + = image_tag asset_pack_path('icon_reply.svg') + + %h1= t 'notification_mailer.mention.title' + %p.lead= t('notification_mailer.mention.body', name: @status.account.acct) + += render 'status', status: @status + +%table.email-table{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.email-body + .email-container + %table.content-section{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.content-cell.content-start.border-top + %table.column{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.column-cell.button-cell + %table.button{ align: 'center', cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.button-primary + = link_to web_url("statuses/#{@status.id}") do + %span= t 'notification_mailer.mention.action' diff --git a/app/views/notification_mailer/reblog.html.haml b/app/views/notification_mailer/reblog.html.haml new file mode 100644 index 0000000000..895e903ea5 --- /dev/null +++ b/app/views/notification_mailer/reblog.html.haml @@ -0,0 +1,45 @@ +%table.email-table{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.email-body + .email-container + %table.content-section{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.content-cell.hero + .email-row + .col-6 + %table.column{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.column-cell.text-center.padded + %table.hero-icon{ align: 'center', cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td + = image_tag asset_pack_path('icon_cached.svg') + + %h1= t 'notification_mailer.reblog.title' + %p.lead= t('notification_mailer.reblog.body', name: @account.acct) + += render 'status', status: @status + +%table.email-table{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.email-body + .email-container + %table.content-section{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.content-cell.content-start.border-top + %table.column{ cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.column-cell.button-cell + %table.button{ align: 'center', cellspacing: 0, cellpadding: 0 } + %tbody + %tr + %td.button-primary + = link_to web_url("statuses/#{@status.id}") do + %span= t 'application_mailer.view_status' diff --git a/config/locales/en.yml b/config/locales/en.yml index 93ff88fd8f..7b9a1f15d2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -343,6 +343,7 @@ en: settings: 'Change e-mail preferences: %{link}' signature: Mastodon notifications from %{instance} view: 'View:' + view_status: View status applications: created: Application successfully created destroyed: Application successfully deleted @@ -483,29 +484,38 @@ en: title: Moderation notification_mailer: digest: - body: 'Here is a brief summary of what you missed on %{instance} since your last visit on %{since}:' + action: View all notifications + body: Here is a brief summary of the messages you missed since your last visit on %{since} mention: "%{name} mentioned you in:" new_followers_summary: - one: You have acquired one new follower! Yay! - other: You have gotten %{count} new followers! Amazing! + one: Also, you have acquired one new follower while being away! Yay! + other: Also, you have acquired %{count} new followers while being away! Amazing! subject: one: "1 new notification since your last visit \U0001F418" other: "%{count} new notifications since your last visit \U0001F418" + title: In your absence… favourite: body: 'Your status was favourited by %{name}:' subject: "%{name} favourited your status" + title: New favourite follow: body: "%{name} is now following you!" subject: "%{name} is now following you" + title: New follower follow_request: + action: Manage follow requests body: "%{name} has requested to follow you" subject: 'Pending follower: %{name}' + title: New follow request mention: + action: Reply body: 'You were mentioned by %{name} in:' subject: You were mentioned by %{name} + title: New mention reblog: body: 'Your status was boosted by %{name}:' subject: "%{name} boosted your status" + title: New boost number: human: decimal_units: diff --git a/spec/mailers/previews/notification_mailer_preview.rb b/spec/mailers/previews/notification_mailer_preview.rb index 99495d8621..e31445c365 100644 --- a/spec/mailers/previews/notification_mailer_preview.rb +++ b/spec/mailers/previews/notification_mailer_preview.rb @@ -13,6 +13,12 @@ class NotificationMailerPreview < ActionMailer::Preview NotificationMailer.follow(f.target_account, Notification.find_by(activity: f)) end + # Preview this email at http://localhost:3000/rails/mailers/notification_mailer/follow_request + def follow_request + f = Follow.last + NotificationMailer.follow_request(f.target_account, Notification.find_by(activity: f)) + end + # Preview this email at http://localhost:3000/rails/mailers/notification_mailer/favourite def favourite f = Favourite.last From eed7484cd6541b93452cd7aa62a3f61c361c89cc Mon Sep 17 00:00:00 2001 From: mayaeh Date: Wed, 17 Jan 2018 20:41:24 +0900 Subject: [PATCH 05/11] Change mailer image url (#6279) * Change image URL in mailer to full path * Add application_mailer.view_profile localization. --- app/views/notification_mailer/favourite.html.haml | 2 +- app/views/notification_mailer/follow.html.haml | 2 +- app/views/notification_mailer/follow_request.html.haml | 2 +- app/views/notification_mailer/mention.html.haml | 2 +- app/views/notification_mailer/reblog.html.haml | 2 +- config/locales/en.yml | 1 + 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/views/notification_mailer/favourite.html.haml b/app/views/notification_mailer/favourite.html.haml index 6cbc552faa..f26b08b18e 100644 --- a/app/views/notification_mailer/favourite.html.haml +++ b/app/views/notification_mailer/favourite.html.haml @@ -17,7 +17,7 @@ %tbody %tr %td - = image_tag asset_pack_path('icon_grade.svg') + = image_tag full_pack_url('icon_grade.svg'), alt:'' %h1= t 'notification_mailer.favourite.title' %p.lead= t('notification_mailer.favourite.body', name: @account.acct) diff --git a/app/views/notification_mailer/follow.html.haml b/app/views/notification_mailer/follow.html.haml index d1ae18ea96..1290e2bc41 100644 --- a/app/views/notification_mailer/follow.html.haml +++ b/app/views/notification_mailer/follow.html.haml @@ -17,7 +17,7 @@ %tbody %tr %td - = image_tag asset_pack_path('icon_person_add.svg') + = image_tag full_pack_url('icon_person_add.svg'), alt: '' %h1= t 'notification_mailer.follow.title' %p.lead= t('notification_mailer.follow.body', name: @account.acct) diff --git a/app/views/notification_mailer/follow_request.html.haml b/app/views/notification_mailer/follow_request.html.haml index ce5f578b11..41efeafaf6 100644 --- a/app/views/notification_mailer/follow_request.html.haml +++ b/app/views/notification_mailer/follow_request.html.haml @@ -17,7 +17,7 @@ %tbody %tr %td - = image_tag asset_pack_path('icon_person_add.svg') + = image_tag full_pack_url('icon_person_add.svg'), alt: '' %h1= t 'notification_mailer.follow_request.title' %p.lead= t('notification_mailer.follow_request.body', name: @account.acct) diff --git a/app/views/notification_mailer/mention.html.haml b/app/views/notification_mailer/mention.html.haml index 9ecbe8550d..619c580ce7 100644 --- a/app/views/notification_mailer/mention.html.haml +++ b/app/views/notification_mailer/mention.html.haml @@ -17,7 +17,7 @@ %tbody %tr %td - = image_tag asset_pack_path('icon_reply.svg') + = image_tag full_pack_url('icon_reply.svg'), alt: '' %h1= t 'notification_mailer.mention.title' %p.lead= t('notification_mailer.mention.body', name: @status.account.acct) diff --git a/app/views/notification_mailer/reblog.html.haml b/app/views/notification_mailer/reblog.html.haml index 895e903ea5..61c6ee6be8 100644 --- a/app/views/notification_mailer/reblog.html.haml +++ b/app/views/notification_mailer/reblog.html.haml @@ -17,7 +17,7 @@ %tbody %tr %td - = image_tag asset_pack_path('icon_cached.svg') + = image_tag full_pack_url('icon_cached.svg'), alt: '' %h1= t 'notification_mailer.reblog.title' %p.lead= t('notification_mailer.reblog.body', name: @account.acct) diff --git a/config/locales/en.yml b/config/locales/en.yml index 7b9a1f15d2..f23f35a897 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -343,6 +343,7 @@ en: settings: 'Change e-mail preferences: %{link}' signature: Mastodon notifications from %{instance} view: 'View:' + view_profile: View Profile view_status: View status applications: created: Application successfully created From acb982fc6677e727980ac71f58e64d35e9576a3b Mon Sep 17 00:00:00 2001 From: Jeong Arm Date: Wed, 17 Jan 2018 20:42:11 +0900 Subject: [PATCH 06/11] Korean translate (#6277) * Translate Korean * Translate Korean #6263 --- config/locales/ko.yml | 64 +++++++++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 9e3505a721..b0bac4c1df 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -48,8 +48,8 @@ ko: remote_follow: 리모트 팔로우 reserved_username: 이 아이디는 예약되어 있습니다. roles: - admin: Admin - moderator: 모드 + admin: 관리자 + moderator: 모더레이터 unfollow: 팔로우 해제 admin: account_moderation_notes: @@ -105,7 +105,7 @@ ko: perform_full_suspension: 완전히 정지시키기 profile_url: 프로필 URL promote: 모더레이터로 승급 - protocol: Protocol + protocol: 프로토콜 public: 전체 공개 push_subscription_expires: PuSH 구독 기간 만료 redownload: 아바타 업데이트 @@ -133,7 +133,7 @@ ko: undo_suspension: 정지 해제 unsubscribe: 구독 해제 username: 아이디 - web: Web + web: 웹 action_logs: actions: confirm_user: "%{name}이 %{target}의 이메일 주소를 컨펌했습니다" @@ -338,9 +338,12 @@ ko: body: "%{reporter} 가 %{target} 를 신고했습니다" subject: "%{instance} 에 새 신고 등록됨 (#%{id})" application_mailer: + notification_preferences: 메일 설정 변경 settings: '메일 설정을 변경: %{link}' signature: Mastodon %{instance} 인스턴스로에서 알림 view: 'View:' + view_profile: 프로필 보기 + view_status: 게시물 보기 applications: created: 애플리케이션이 작성되었습니다. destroyed: 애플리케이션이 삭제되었습니다. @@ -481,6 +484,7 @@ ko: title: 모더레이션 notification_mailer: digest: + action: 모든 알림 보기 body: "%{instance} 에서 마지막 로그인 뒤로 일어난 일:" mention: "%{name} 님이 답장했습니다:" new_followers_summary: @@ -489,21 +493,29 @@ ko: subject: one: "1건의 새로운 알림 \U0001F418" other: "%{count}건의 새로운 알림 \U0001F418" + title: 당신이 없는 동안에… favourite: body: "%{name} 님이 내 툿을 즐겨찾기에 등록했습니다." subject: "%{name} 님이 내 툿을 즐겨찾기에 등록했습니다" + title: 새 즐겨찾기 follow: body: "%{name} 님이 나를 팔로우 했습니다" subject: "%{name} 님이 나를 팔로우 했습니다" + title: 새 팔로워 follow_request: + action: 팔로우 요청 관리 body: "%{name} 님이 내게 팔로우 요청을 보냈습니다." subject: "%{name} 님이 보낸 팔로우 요청" + title: 새 팔로우 요청 mention: + action: 답장 body: "%{name} 님이 답장을 보냈습니다:" subject: "%{name} 님이 답장을 보냈습니다" + title: 새 멘션 reblog: body: "%{name} 님이 내 툿을 부스트 했습니다:" subject: "%{name} 님이 내 툿을 부스트 했습니다" + title: 새 부스트 number: human: decimal_units: @@ -547,38 +559,38 @@ ko: activity: 마지막 활동 browser: 브라우저 browsers: - alipay: Alipay - blackberry: Blackberry - chrome: Chrome - edge: Microsoft Edge - firefox: Firefox + alipay: 알리페이 + blackberry: 블랙베리 + chrome: 크롬 + edge: 엣지 + firefox: 파이어폭스 generic: 알 수 없는 브라우저 - ie: Internet Explorer + ie: IE micro_messenger: MicroMessenger - nokia: Nokia S40 Ovi Browser - opera: Opera + nokia: 노키아 S40 Ovi 브라우저 + opera: 오페라 phantom_js: PhantomJS - qq: QQ Browser - safari: Safari + qq: QQ 브라우저 + safari: 사파리 uc_browser: UCBrowser - weibo: Weibo + weibo: 웨이보 current_session: 현재 세션 - description: "%{browser} on %{platform}" + description: "%{platform}의 %{browser}" explanation: 내 Mastodon 계정에 현재 로그인 중인 웹 브라우저 목록입니다. ip: IP platforms: - adobe_air: Adobe Air - android: Android - blackberry: Blackberry - chrome_os: ChromeOS - firefox_os: Firefox OS + adobe_air: 어도비 에어 + android: 안드로이드 + blackberry: 블랙베리 + chrome_os: 크롬OS + firefox_os: 파이어폭스OS ios: iOS - linux: Linux - mac: Mac + linux: 리눅스 + mac: 맥 other: 알 수 없는 플랫폼 - windows: Windows - windows_mobile: Windows Mobile - windows_phone: Windows Phone + windows: 윈도우즈 + windows_mobile: 윈도우즈 모바일 + windows_phone: 윈도우즈 폰 revoke: 삭제 revoke_success: 세션이 삭제되었습니다. title: 세션 From ea75ae2d1fd987075f600fca66003e2f69cc6cca Mon Sep 17 00:00:00 2001 From: Mike Burns Date: Wed, 17 Jan 2018 06:45:09 -0500 Subject: [PATCH 07/11] Use be_within instead of eq for a to_f test match (#6275) Floating point values are notoriously hard to pin down, so use the `be_within` matcher to verify the approximate value. --- spec/services/precompute_feed_service_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/services/precompute_feed_service_spec.rb b/spec/services/precompute_feed_service_spec.rb index d1ef6c1843..396a3c3fba 100644 --- a/spec/services/precompute_feed_service_spec.rb +++ b/spec/services/precompute_feed_service_spec.rb @@ -16,7 +16,7 @@ RSpec.describe PrecomputeFeedService do subject.call(account) - expect(Redis.current.zscore(FeedManager.instance.key(:home, account.id), reblog.id)).to eq status.id.to_f + expect(Redis.current.zscore(FeedManager.instance.key(:home, account.id), reblog.id)).to be_within(0.1).of(status.id.to_f) end it 'does not raise an error even if it could not find any status' do From 6f244ba82c5821e2e8af11597ff970e7af445160 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 17 Jan 2018 14:12:59 +0100 Subject: [PATCH 08/11] Use better reblog icon and improve contrast in HTML e-mails (#6272) --- app/javascript/images/icon_cached.svg | 6 ++---- app/javascript/styles/mailer.scss | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/javascript/images/icon_cached.svg b/app/javascript/images/icon_cached.svg index 8fdd63f44d..1087c43503 100644 --- a/app/javascript/images/icon_cached.svg +++ b/app/javascript/images/icon_cached.svg @@ -1,4 +1,2 @@ - - - - \ No newline at end of file + + diff --git a/app/javascript/styles/mailer.scss b/app/javascript/styles/mailer.scss index d84763612e..e6422b2ea5 100644 --- a/app/javascript/styles/mailer.scss +++ b/app/javascript/styles/mailer.scss @@ -300,7 +300,7 @@ h3 { .footer { .column-cell, p { - color: lighten($ui-base-color, 26%); + color: lighten($ui-base-color, 34%); } p { @@ -313,7 +313,7 @@ h3 { } a { - color: lighten($ui-base-color, 26%); + color: lighten($ui-base-color, 34%); text-decoration: underline; } @@ -363,7 +363,7 @@ h3 { } .button-primary { - background-color: $ui-highlight-color; + background-color: darken($ui-highlight-color, 3%); } .text-center { From fb16c37d2a780c385e0ce00d136f749036778314 Mon Sep 17 00:00:00 2001 From: SerCom_KC Date: Wed, 17 Jan 2018 23:47:25 +0800 Subject: [PATCH 09/11] Update Simplified Chinese translations (#6280) * i18n: (zh-CN) Update translation for #6252 * e-mail -> email * i18n: (zh-CN) Update translations for #6256 * i18n: (zh-CN) Minor Improvements * i18n: (zh-CN) Update translations for #6263 * i18n: (zh-CN) Update translations for #6279 --- app/javascript/mastodon/locales/zh-CN.json | 12 ++++++------ config/locales/devise.en.yml | 4 ++-- config/locales/devise.zh-CN.yml | 21 +++++++++++++++++++-- config/locales/simple_form.zh-CN.yml | 2 +- config/locales/zh-CN.yml | 18 +++++++++++++++--- 5 files changed, 43 insertions(+), 14 deletions(-) diff --git a/app/javascript/mastodon/locales/zh-CN.json b/app/javascript/mastodon/locales/zh-CN.json index ef850256c4..b6435a2606 100644 --- a/app/javascript/mastodon/locales/zh-CN.json +++ b/app/javascript/mastodon/locales/zh-CN.json @@ -170,10 +170,10 @@ "notifications.column_settings.sound": "播放音效", "onboarding.done": "出发!", "onboarding.next": "下一步", - "onboarding.page_five.public_timelines": "本站时间轴显示的是由本站({domain})用户发布的所有公开嘟文。跨站公共时间轴显示的的是由本站用户关注对象所发布的所有公开嘟文。这些就是寻人好去处的公共时间轴啦。", - "onboarding.page_four.home": "你的主页时间轴上显示的是你的关注对象所发布的嘟文。", - "onboarding.page_four.notifications": "如果有人与你互动了,他们就会出现在通知栏中哦~", - "onboarding.page_one.federation": "Mastodon 是由一系列独立的服务器共同打造的强大的社交网络,我们将这些各自独立而又相互连接的服务器叫做实例。", + "onboarding.page_five.public_timelines": "“本站时间轴”显示的是由本站({domain})用户发布的所有公开嘟文。“跨站公共时间轴”显示的的是由本站用户关注对象所发布的所有公开嘟文。这些就是寻人好去处的公共时间轴啦。", + "onboarding.page_four.home": "你的“主页”时间轴上显示的是你的关注对象所发布的嘟文。", + "onboarding.page_four.notifications": "如果有人与你互动了,他们就会出现在“通知”栏中哦~", + "onboarding.page_one.federation": "Mastodon 是由一系列独立的服务器共同打造的强大的社交网络,我们将这些各自独立而又相互连接的服务器叫做“实例”。", "onboarding.page_one.handle": "你是在 {domain} 上注册的,所以你的完整用户地址是 {handle}。", "onboarding.page_one.welcome": "欢迎来到 Mastodon!", "onboarding.page_six.admin": "{admin} 是你所在服务器实例的管理员。", @@ -184,8 +184,8 @@ "onboarding.page_six.guidelines": "社区指南", "onboarding.page_six.read_guidelines": "别忘了看看 {domain} 的{guidelines}!", "onboarding.page_six.various_app": "移动设备应用", - "onboarding.page_three.profile": "你可以修改你的个人资料,比如头像、简介和昵称等偏好设置。", - "onboarding.page_three.search": "你可以通过搜索功能寻找用户和话题标签,比如{illustration}或者{introductions}。如果你想搜索其他实例上的用户,就需要输入完整用户地址(@用户名@域名)哦。", + "onboarding.page_three.profile": "你还可以修改你的个人资料,比如头像、简介和昵称等偏好设置。", + "onboarding.page_three.search": "你可以通过搜索功能寻找用户和话题标签,比如“{illustration}”,或是“{introductions}”。如果你想搜索其他实例上的用户,就需要输入完整用户地址(@用户名@域名)哦。", "onboarding.page_two.compose": "在撰写栏中开始嘟嘟吧!下方的按钮分别可以用来上传图片、修改嘟文可见范围,以及添加警告信息。", "onboarding.skip": "跳过", "privacy.change": "设置嘟文可见范围", diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml index 19c1463224..20938e47b6 100644 --- a/config/locales/devise.en.yml +++ b/config/locales/devise.en.yml @@ -18,10 +18,10 @@ en: mailer: confirmation_instructions: action: Verify email address - explanation: You have created an account on %{host} with this email address. You are one click away from activating it. If this wasn't you, please ignore this e-mail. + explanation: You have created an account on %{host} with this email address. You are one click away from activating it. If this wasn't you, please ignore this email. extra_html: Please also check out the rules of the instance and our terms of service. subject: 'Mastodon: Confirmation instructions for %{instance}' - title: Verify e-mail address + title: Verify email address email_changed: explanation: 'The email address for your account is being changed to:' extra: If you did not change your email, it is likely that someone has gained access to your account. Please change your password immediately or contact the instance admin if you're locked out of your account. diff --git a/config/locales/devise.zh-CN.yml b/config/locales/devise.zh-CN.yml index 0bd8551374..dd6b48795c 100644 --- a/config/locales/devise.zh-CN.yml +++ b/config/locales/devise.zh-CN.yml @@ -17,15 +17,32 @@ zh-CN: unconfirmed: 继续操作前请先确认你的帐户。 mailer: confirmation_instructions: + action: 验证电子邮件地址 + explanation: 你在 %{host} 上使用这个电子邮件地址创建了一个帐户。只需点击下面的按钮,即可完成激活。如果你并没有创建过帐户,请忽略此邮件。 + extra_html: 请记得阅读本实例的相关规定我们的使用条款。 subject: Mastodon:确认 %{instance} 帐户信息 + title: 验证电子邮件地址 email_changed: - subject: Mastodon:电子邮件地址已被修改 + explanation: 你的帐户的电子邮件地址即将变更为: + extra: 如果你并没有请求更改你的电子邮件地址,则他人很有可能已经入侵你的帐户。请立即更改你的密码;如果你已经无法访问你的帐户,请联系实例的管理员请求协助。 + subject: Mastodon:电子邮件地址已被更改 + title: 新电子邮件地址 password_change: - subject: Mastodon:密码已被重置 + explanation: 你的帐户的密码已被更改。 + extra: 如果你并没有请求更改你的密码,则他人很有可能已经入侵你的帐户。请立即更改你的密码;如果你已经无法访问你的帐户,请联系实例的管理员请求协助。 + subject: Mastodon:密码已被更改 + title: 密码已被重置 reconfirmation_instructions: + explanation: 请确认你的新电子邮件地址以完成更改。 + extra: 如果你并没有请求本次变更,请忽略此邮件。Mastodon 帐户的电子邮件地址只有在你点击上面的链接后才会更改。 subject: Mastodon:确认 %{instance} 电子邮件地址 + title: 验证电子邮件地址 reset_password_instructions: + action: 更改密码 + explanation: 你正在请求更改帐户的密码。 + extra: 如果你并没有请求本次变更,请忽略此邮件。你的密码只有在你点击上面的链接并输入新密码后才会更改。 subject: Mastodon:重置密码信息 + title: 重置密码 unlock_instructions: subject: Mastodon:帐户解锁信息 omniauth_callbacks: diff --git a/config/locales/simple_form.zh-CN.yml b/config/locales/simple_form.zh-CN.yml index 1f2fa173d4..4eb993e526 100644 --- a/config/locales/simple_form.zh-CN.yml +++ b/config/locales/simple_form.zh-CN.yml @@ -4,7 +4,7 @@ zh-CN: hints: defaults: avatar: 文件大小限制 2MB,只支持 PNG、GIF 或 JPG 格式。图片分辨率将会压缩至 120×120px - digest: 在你长时间未登录的情况下,我们会向你发送一份含有提及你的嘟文的摘要邮件 + digest: 仅在你长时间未登录,且收到了私信时发送 display_name: 还能输入 %{count} 个字符 header: 文件大小限制 2MB,只支持 PNG、GIF 或 JPG 格式。图片分辨率将会压缩至 700×335px locked: 你需要手动审核所有关注请求 diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index bb9f45e93e..14382331bf 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -336,10 +336,13 @@ zh-CN: body: "%{reporter} 举报了用户 %{target}。" subject: 来自 %{instance} 的用户举报(#%{id}) application_mailer: + notification_preferences: 更改电子邮件首选项 salutation: "%{name}:" settings: 使用此链接更改你的电子邮件首选项:%{link} signature: 这是一封来自 %{instance} 的 Mastodon 电子邮件通知。 view: 点此链接查看详情: + view_profile: 查看个人资料页 + view_status: 查看嘟文 applications: created: 应用创建成功 destroyed: 应用删除成功 @@ -476,27 +479,36 @@ zh-CN: title: 运营 notification_mailer: digest: - body: 自从你最后一次(时间是%{since})登录 %{instance} 以来,你错过了这些嘟嘟滴滴: + action: 查看所有通知 + body: 以下是自%{since}你最后一次登录以来错过的消息的摘要 mention: "%{name} 在嘟文中提到了你:" new_followers_summary: - one: 有个人关注了你!耶! - other: 有 %{count} 个人关注了你!好棒! + one: 而且,你不在的时候,有一个人关注了你!耶! + other: 而且,你不在的时候,有 %{count} 个人关注了你!好棒! subject: "自从你最后一次登录以来,你错过了 %{count} 条新通知 \U0001F418" + title: 在你不在的这段时间…… favourite: body: 你的嘟文被 %{name} 收藏了: subject: "%{name} 收藏了你的嘟文" + title: 新的收藏 follow: body: "%{name} 关注了你!" subject: "%{name} 关注了你" + title: 新的关注者 follow_request: + action: 处理关注请求 body: "%{name} 向你发送了关注请求!" subject: 来自 %{name} 的关注请求 + title: 新的关注请求 mention: + action: 回复 body: "%{name} 在嘟文中提到了你:" subject: "%{name} 提到了你" + title: 新的提及 reblog: body: 你的嘟文被 %{name} 转嘟了: subject: "%{name} 转嘟了你的嘟文" + title: 新的转嘟 number: human: decimal_units: From 0a103c774977cda29e5c02e697b4632f98bcc621 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Thu, 18 Jan 2018 00:57:15 +0900 Subject: [PATCH 10/11] Upgrade ESLint to version 4.x (#6276) --- .codeclimate.yml | 1 + .eslintrc.yml | 19 +- .../mastodon/components/attachment_list.js | 4 +- .../mastodon/components/collapsable.js | 4 +- .../mastodon/components/icon_button.js | 4 +- app/javascript/mastodon/components/status.js | 18 +- .../features/account/components/header.js | 4 +- .../features/account_gallery/index.js | 4 +- .../compose/components/privacy_dropdown.js | 4 +- .../compose/components/search_results.js | 4 +- .../mastodon/features/compose/index.js | 4 +- .../features/compose/util/url_regex.js | 192 +++---- .../features/emoji/__tests__/emoji-test.js | 4 +- .../mastodon/features/list_editor/index.js | 4 +- .../features/ui/components/column_header.js | 2 +- .../features/ui/components/modal_root.js | 12 +- .../features/ui/components/upload_area.js | 4 +- package.json | 10 +- yarn.lock | 501 +++++++++--------- 19 files changed, 411 insertions(+), 388 deletions(-) diff --git a/.codeclimate.yml b/.codeclimate.yml index 47e3e6ab9d..21e6b33bf0 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -27,6 +27,7 @@ plugins: enabled: true eslint: enabled: true + channel: eslint-4 rubocop: enabled: true scss-lint: diff --git a/.eslintrc.yml b/.eslintrc.yml index 7c6da9d57a..cf276a16fd 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -17,11 +17,9 @@ plugins: parserOptions: sourceType: module ecmaFeatures: - arrowFunctions: true + experimentalObjectRestSpread: true jsx: true - destructuring: true - modules: true - spread: true + ecmaVersion: 2018 settings: import/extensions: @@ -109,6 +107,7 @@ rules: react/self-closing-comp: error jsx-a11y/accessible-emoji: warn + jsx-a11y/alt-text: warn jsx-a11y/anchor-has-content: warn jsx-a11y/aria-activedescendant-has-tabindex: warn jsx-a11y/aria-props: warn @@ -119,16 +118,22 @@ rules: jsx-a11y/href-no-hash: warn jsx-a11y/html-has-lang: warn jsx-a11y/iframe-has-title: warn - jsx-a11y/img-has-alt: warn jsx-a11y/img-redundant-alt: warn + jsx-a11y/interactive-supports-focus: warn jsx-a11y/label-has-for: off jsx-a11y/mouse-events-have-key-events: warn jsx-a11y/no-access-key: warn jsx-a11y/no-distracting-elements: warn + jsx-a11y/no-noninteractive-element-interactions: + - warn + - handlers: + - onClick jsx-a11y/no-onchange: warn jsx-a11y/no-redundant-roles: warn - jsx-a11y/onclick-has-focus: warn - jsx-a11y/onclick-has-role: warn + jsx-a11y/no-static-element-interactions: + - warn + - handlers: + - onClick jsx-a11y/role-has-required-aria-props: warn jsx-a11y/role-supports-aria-props: off jsx-a11y/scope: warn diff --git a/app/javascript/mastodon/components/attachment_list.js b/app/javascript/mastodon/components/attachment_list.js index b3d00b3357..9f2d46ddd7 100644 --- a/app/javascript/mastodon/components/attachment_list.js +++ b/app/javascript/mastodon/components/attachment_list.js @@ -20,11 +20,11 @@ export default class AttachmentList extends ImmutablePureComponent { ); diff --git a/app/javascript/mastodon/components/collapsable.js b/app/javascript/mastodon/components/collapsable.js index 42ea37ec22..d5d4311864 100644 --- a/app/javascript/mastodon/components/collapsable.js +++ b/app/javascript/mastodon/components/collapsable.js @@ -5,11 +5,11 @@ import PropTypes from 'prop-types'; const Collapsable = ({ fullHeight, isVisible, children }) => ( - {({ opacity, height }) => + {({ opacity, height }) => (
{children}
- } + )}
); diff --git a/app/javascript/mastodon/components/icon_button.js b/app/javascript/mastodon/components/icon_button.js index 06f53841d2..b96e48fd09 100644 --- a/app/javascript/mastodon/components/icon_button.js +++ b/app/javascript/mastodon/components/icon_button.js @@ -93,7 +93,7 @@ export default class IconButton extends React.PureComponent { return ( - {({ rotate }) => + {({ rotate }) => (