From ac54da939413836733e30627def9ca645d3735d4 Mon Sep 17 00:00:00 2001 From: Eugen <eugen@zeonfederated.com> Date: Thu, 13 Apr 2017 19:36:41 +0200 Subject: [PATCH] Fix #1220, fix #1671 - Hook up comment box to the Redux comment value (#1699) Fix username styling regression introduced in #1063 Fix report screen background regression introduced in #1415 --- app/assets/javascripts/components/actions/reports.jsx | 10 +++++++++- .../notifications/components/column_settings.jsx | 2 +- .../javascripts/components/features/report/index.jsx | 7 ++++--- app/assets/javascripts/components/reducers/reports.jsx | 5 ++++- app/lib/formatter.rb | 2 +- 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/components/actions/reports.jsx b/app/assets/javascripts/components/actions/reports.jsx index 2c1245dc4e..094670d62c 100644 --- a/app/assets/javascripts/components/actions/reports.jsx +++ b/app/assets/javascripts/components/actions/reports.jsx @@ -7,7 +7,8 @@ export const REPORT_SUBMIT_REQUEST = 'REPORT_SUBMIT_REQUEST'; export const REPORT_SUBMIT_SUCCESS = 'REPORT_SUBMIT_SUCCESS'; export const REPORT_SUBMIT_FAIL = 'REPORT_SUBMIT_FAIL'; -export const REPORT_STATUS_TOGGLE = 'REPORT_STATUS_TOGGLE'; +export const REPORT_STATUS_TOGGLE = 'REPORT_STATUS_TOGGLE'; +export const REPORT_COMMENT_CHANGE = 'REPORT_COMMENT_CHANGE'; export function initReport(account, status) { return { @@ -62,3 +63,10 @@ export function submitReportFail(error) { error }; }; + +export function changeReportComment(comment) { + return { + type: REPORT_COMMENT_CHANGE, + comment + }; +}; diff --git a/app/assets/javascripts/components/features/notifications/components/column_settings.jsx b/app/assets/javascripts/components/features/notifications/components/column_settings.jsx index 9dfc8ba8b9..2edf98292d 100644 --- a/app/assets/javascripts/components/features/notifications/components/column_settings.jsx +++ b/app/assets/javascripts/components/features/notifications/components/column_settings.jsx @@ -27,7 +27,7 @@ const ColumnSettings = React.createClass({ propTypes: { settings: ImmutablePropTypes.map.isRequired, - intl: ImmutablePropTypes.object.isRequired, + intl: React.PropTypes.object.isRequired, onChange: React.PropTypes.func.isRequired, onSave: React.PropTypes.func.isRequired, }, diff --git a/app/assets/javascripts/components/features/report/index.jsx b/app/assets/javascripts/components/features/report/index.jsx index 3177d28b1d..fc8e543c53 100644 --- a/app/assets/javascripts/components/features/report/index.jsx +++ b/app/assets/javascripts/components/features/report/index.jsx @@ -47,7 +47,7 @@ const Report = React.createClass({ propTypes: { isSubmitting: React.PropTypes.bool, account: ImmutablePropTypes.map, - statusIds: ImmutablePropTypes.list.isRequired, + statusIds: ImmutablePropTypes.orderedSet.isRequired, comment: React.PropTypes.string.isRequired, dispatch: React.PropTypes.func.isRequired, intl: React.PropTypes.object.isRequired @@ -94,7 +94,8 @@ const Report = React.createClass({ return ( <Column heading={intl.formatMessage(messages.heading)} icon='flag'> <ColumnBackButtonSlim /> - <div className='report' style={{ display: 'flex', flexDirection: 'column', maxHeight: '100%', boxSizing: 'border-box' }}> + + <div className='report scrollable' style={{ display: 'flex', flexDirection: 'column', maxHeight: '100%', boxSizing: 'border-box' }}> <div className='report__target' style={{ flex: '0 0 auto', padding: '10px' }}> <FormattedMessage id='report.target' defaultMessage='Reporting' /> <strong>{account.get('acct')}</strong> @@ -106,7 +107,7 @@ const Report = React.createClass({ </div> </div> - <div style={{ flex: '0 0 160px', padding: '10px' }}> + <div style={{ flex: '0 0 100px', padding: '10px' }}> <textarea className='report__textarea' placeholder={intl.formatMessage(messages.placeholder)} diff --git a/app/assets/javascripts/components/reducers/reports.jsx b/app/assets/javascripts/components/reducers/reports.jsx index e1cce1c5fa..eab0043774 100644 --- a/app/assets/javascripts/components/reducers/reports.jsx +++ b/app/assets/javascripts/components/reducers/reports.jsx @@ -4,7 +4,8 @@ import { REPORT_SUBMIT_SUCCESS, REPORT_SUBMIT_FAIL, REPORT_CANCEL, - REPORT_STATUS_TOGGLE + REPORT_STATUS_TOGGLE, + REPORT_COMMENT_CHANGE } from '../actions/reports'; import Immutable from 'immutable'; @@ -39,6 +40,8 @@ export default function reports(state = initialState, action) { return set.remove(action.statusId); }); + case REPORT_COMMENT_CHANGE: + return state.setIn(['new', 'comment'], action.comment); case REPORT_SUBMIT_REQUEST: return state.setIn(['new', 'isSubmitting'], true); case REPORT_SUBMIT_FAIL: diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb index 64349e68eb..64b1f86d45 100644 --- a/app/lib/formatter.rb +++ b/app/lib/formatter.rb @@ -96,6 +96,6 @@ class Formatter end def mention_html(match, account) - "#{match.split('@').first}<span class=\"h-card\"><a href=\"#{TagManager.instance.url_for(account)}\" class=\"u-url mention\">@#{account.username}</a></span>" + "#{match.split('@').first}<span class=\"h-card\"><a href=\"#{TagManager.instance.url_for(account)}\" class=\"u-url mention\">@<span>#{account.username}</span></a></span>" end end -- GitLab