Unverified Commit bbac7357 authored by Eric Rosenbaum's avatar Eric Rosenbaum Committed by GitHub

Merge pull request #4845 from LLK/develop

merge from develop to release branch
parents a2d89c2a 59634304
This diff is collapsed.
......@@ -11,10 +11,11 @@
}
.mute-step {
display: flex;
padding: 48px 16px;
padding: 36px 16px 28px 16px;
}
.mute-content {
padding-top: 16px;
justify-content: flex-start;
}
.mute-inner-content {
padding: 0 32px;
......@@ -29,7 +30,7 @@
line-height: 2rem;
}
.mute-bottom-row {
padding-top: 32px;
padding-top: 12px;
}
.bottom-img {
width: 380px;
......@@ -47,7 +48,7 @@
.mute-nav {
display:flex;
justify-content: space-between;
padding: 24px 0;
padding: 20px 0;
}
.back-button {
margin-top: 0;
......
......@@ -53,6 +53,9 @@
</head>
<body>
<noscript>
<p>Your browser has Javascript disabled. Please go to your browser preferences and enable Javascript in order to use Scratch.</p>
</noscript>
<div id="app"></div>
<!-- Vendor & Initialize (Session & Localization)-->
......
......@@ -2,7 +2,6 @@ const bindAll = require('lodash.bindall');
const classNames = require('classnames');
const React = require('react');
const MediaQuery = require('react-responsive').default;
const FormattedHTMLMessage = require('react-intl').FormattedHTMLMessage;
const FormattedMessage = require('react-intl').FormattedMessage;
const injectIntl = require('react-intl').injectIntl;
const intlShape = require('react-intl').intlShape;
......@@ -1994,11 +1993,11 @@ class AnnualReport extends React.Component {
<FormattedMessage id="annualReport.supportersTitle" />
</h2>
<p>
<FormattedHTMLMessage id="annualReport.supportersIntro" />
<FormattedMessage id="annualReport.supportersIntro" />
</p>
</div>
<div className="subsection-tag">
<FormattedHTMLMessage id="annualReport.supportersSpotlightTitle" />
<FormattedMessage id="annualReport.supportersSpotlightTitle" />
</div>
<div className="supporters-subsection">
<div className="supporters-blurb">
......@@ -2033,53 +2032,53 @@ class AnnualReport extends React.Component {
<div className="supporters-subsection supporters-lists">
<div className="supporters-blurb">
<h4>
<FormattedHTMLMessage id="annualReport.supportersThankYou" />
<FormattedMessage id="annualReport.supportersThankYou" />
</h4>
<p>
<FormattedHTMLMessage id="annualReport.supportersAllDescription" />
<FormattedMessage id="annualReport.supportersAllDescription" />
</p>
<p className="founding-partners-blurb">
<FormattedHTMLMessage id="annualReport.supportersFoundingDescription" />
<FormattedMessage id="annualReport.supportersFoundingDescription" />
</p>
</div>
<div className="supporters-level">
<h5>
<FormattedHTMLMessage id="annualReport.supportersFoundingTitle" />
<FormattedMessage id="annualReport.supportersFoundingTitle" />
</h5>
<hr />
{createSupportersLists(Supporters.founding)}
</div>
<div className="supporters-level">
<h5>
<FormattedHTMLMessage id="annualReport.supportersCreativityTitle" />
<FormattedMessage id="annualReport.supportersCreativityTitle" />
</h5>
<hr />
{createSupportersLists(Supporters.creativity)}
</div>
<div className="supporters-level">
<h5>
<FormattedHTMLMessage id="annualReport.supportersCollaborationTitle" />
<FormattedMessage id="annualReport.supportersCollaborationTitle" />
</h5>
<hr />
{createSupportersLists(Supporters.collaboration)}
</div>
<div className="supporters-level">
<h5>
<FormattedHTMLMessage id="annualReport.supportersImaginationTitle" />
<FormattedMessage id="annualReport.supportersImaginationTitle" />
</h5>
<hr />
{createSupportersLists(Supporters.imagination)}
</div>
<div className="supporters-level">
<h5>
<FormattedHTMLMessage id="annualReport.supportersInspirationTitle" />
<FormattedMessage id="annualReport.supportersInspirationTitle" />
</h5>
<hr />
{createSupportersLists(Supporters.inspiration)}
</div>
<div className="supporters-level">
<h5>
<FormattedHTMLMessage id="annualReport.supportersExplorationTitle" />
<FormattedMessage id="annualReport.supportersExplorationTitle" />
</h5>
<hr />
{createSupportersLists(Supporters.exploration)}
......@@ -2088,7 +2087,7 @@ class AnnualReport extends React.Component {
<div className="supporters-subsection supporters-lists">
<div className="supporters-level">
<h3>
<FormattedHTMLMessage id="annualReport.supportersInKindTitle" />
<FormattedMessage id="annualReport.supportersInKindTitle" />
</h3>
{createSupportersLists(Supporters.inKind)}
</div>
......
......@@ -48,7 +48,9 @@ class ComposeComment extends React.Component {
error: null,
appealId: null,
muteOpen: false,
muteExpiresAtMs: this.props.muteStatus.muteExpiresAt * 1000, // convert to ms
muteExpiresAtMs: this.props.muteStatus.muteExpiresAt ?
this.props.muteStatus.muteExpiresAt * 1000 : 0, // convert to ms
muteType: this.props.muteStatus.currentMessageType,
showWarning: this.props.muteStatus.showWarning ? this.props.muteStatus.showWarning : false
};
}
......@@ -82,6 +84,7 @@ class ComposeComment extends React.Component {
let muteExpiresAtMs = 0;
let rejectedStatus = ComposeStatus.REJECTED;
let showWarning = false;
let muteType = null;
if (body.status && body.status.mute_status) {
muteExpiresAtMs = body.status.mute_status.muteExpiresAt * 1000; // convert to ms
rejectedStatus = ComposeStatus.REJECTED_MUTE;
......@@ -89,6 +92,7 @@ class ComposeComment extends React.Component {
muteOpen = true;
}
showWarning = body.status.mute_status.showWarning;
muteType = body.status.mute_status.muteType;
}
// Note: does not reset the message state
this.setState({
......@@ -97,6 +101,7 @@ class ComposeComment extends React.Component {
appealId: body.appealId,
muteOpen: muteOpen,
muteExpiresAtMs: muteExpiresAtMs,
muteType: muteType,
showWarning: showWarning
});
return;
......@@ -171,13 +176,34 @@ class ComposeComment extends React.Component {
getMuteMessageInfo () {
// return the ids for the messages that are shown for this mute type
// Note, it will probably be passed a 'type', but right now there's only one
// If mute modals have more than one unique "step" we could pass an array of steps
return {
commentType: 'comment.type.disrespectful',
muteStepHeader: 'comment.disrespectful.header',
muteStepContent: ['comment.disrespectful.content1', 'comment.disrespectful.content2']
const messageInfo = {
pii: {
commentType: 'comment.type.pii',
muteStepHeader: 'comment.pii.header',
muteStepContent: ['comment.pii.content1', 'comment.pii.content2', 'comment.pii.content3']
},
unconstructive: {
commentType: 'comment.type.unconstructive',
muteStepHeader: 'comment.unconstructive.header',
muteStepContent: ['comment.unconstructive.content1', 'comment.unconstructive.content2']
},
vulgarity: {
commentType: 'comment.type.vulgarity',
muteStepHeader: 'comment.vulgarity.header',
muteStepContent: ['comment.vulgarity.content1', 'comment.vulgar.content2']
},
general: {
commentType: 'comment.type.disrespectful',
muteStepHeader: 'comment.disrespectful.header',
muteStepContent: ['comment.disrespectful.content1', 'comment.disrespectful.content2']
}
};
if (this.state.muteType && messageInfo[this.state.muteType]) {
return messageInfo[this.state.muteType];
}
return messageInfo.general;
}
handleCancel () {
......@@ -189,6 +215,7 @@ class ComposeComment extends React.Component {
});
if (this.props.onCancel) this.props.onCancel();
}
render () {
return (
<React.Fragment>
......@@ -314,6 +341,7 @@ ComposeComment.propTypes = {
muteStatus: PropTypes.shape({
offenses: PropTypes.array,
muteExpiresAt: PropTypes.number,
currentMessageType: PropTypes.string,
showWarning: PropTypes.bool
}),
onAddComment: PropTypes.func,
......
......@@ -49,5 +49,18 @@
"comment.type.disrespectful": "Scratch thinks your most recent comment was disrespectful.",
"comment.disrespectful.header": "Make sure to be friendly and respectful when using Scratch.",
"comment.disrespectful.content1": "The Scratch comment filter thinks your comment was disrespectful.",
"comment.disrespectful.content2": "Remember: There is a person behind every Scratch account and unfriendly comments can really hurt someone's feelings."
"comment.disrespectful.content2": "Remember: There is a person behind every Scratch account and unfriendly comments can really hurt someone's feelings.",
"comment.type.pii": "The Scratch comment filter thought your most recent comment was sharing or asking for private information.",
"comment.pii.header": "Make sure not to share private information on Scratch.",
"comment.pii.content1": "The Scratch comment filter thinks that in your comment, you were sharing or asking for private information.",
"comment.pii.content2": "Things you share on Scratch can be seen by everyone, and can appear in search engines. Private information can be used by other people in harmful ways, so it’s important to keep it private.",
"comment.pii.content3": "This is a serious safety issue.",
"comment.type.unconstructive": "The Scratch comment filter thought your most recent comment was saying something bad about someone’s project.",
"comment.unconstructive.header": "Make sure to be supportive when commenting on other people’s projects",
"comment.unconstructive.content1": "The Scratch comment filter thinks your comment was saying something bad or mean about someone’s project.",
"comment.unconstructive.content2": "If you think something could be better, you can say something you like about the project, and make a suggestion about how to improve it.",
"comment.type.vulgarity": "The Scratch comment filter thought your most recent comment contained a bad word.",
"comment.vulgarity.header": "Make sure to use language that’s appropriate for all ages",
"comment.vulgarity.content1": "The Scratch comment filter thinks your comment contains a bad word.",
"comment.vulgarity.content2": "Scratch has users of all ages, so it’s important to use language that is appropriate for all Scratchers."
}
......@@ -152,6 +152,7 @@ $base-bg: $ui-white;
background-color: $ui-gray;
padding-bottom: 32px;
width: 100%;
overflow-anchor: none;
.button {
display: block;
......
......@@ -335,4 +335,21 @@ describe('Compose Comment test', () => {
expect(commentInstance.isMuted()).toBe(false);
global.Date.now = realDateNow;
});
test('getMuteMessageInfo: muteType set', () => {
const commentInstance = getComposeCommentWrapper({}).instance();
commentInstance.setState({muteType: 'unconstructive'});
expect(commentInstance.getMuteMessageInfo().commentType).toBe('comment.type.unconstructive');
});
test('getMuteMessageInfo: muteType not set', () => {
const commentInstance = getComposeCommentWrapper({}).instance();
expect(commentInstance.getMuteMessageInfo().commentType).toBe('comment.type.disrespectful');
});
test('getMuteMessageInfo: muteType set to something we don\'t have messages for', () => {
const commentInstance = getComposeCommentWrapper({}).instance();
commentInstance.setState({muteType: 'spaghetti'});
expect(commentInstance.getMuteMessageInfo().commentType).toBe('comment.type.disrespectful');
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment