mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-30 10:58:23 -05:00
Revert "Add new mute message types"
This commit is contained in:
parent
6d8cac4239
commit
1575ed06cf
4 changed files with 7 additions and 64 deletions
|
@ -15,7 +15,6 @@
|
||||||
}
|
}
|
||||||
.mute-content {
|
.mute-content {
|
||||||
padding-top: 16px;
|
padding-top: 16px;
|
||||||
justify-content: flex-start;
|
|
||||||
}
|
}
|
||||||
.mute-inner-content {
|
.mute-inner-content {
|
||||||
padding: 0 32px;
|
padding: 0 32px;
|
||||||
|
|
|
@ -48,9 +48,7 @@ class ComposeComment extends React.Component {
|
||||||
error: null,
|
error: null,
|
||||||
appealId: null,
|
appealId: null,
|
||||||
muteOpen: false,
|
muteOpen: false,
|
||||||
muteExpiresAtMs: this.props.muteStatus.muteExpiresAt ?
|
muteExpiresAtMs: this.props.muteStatus.muteExpiresAt * 1000, // convert to ms
|
||||||
this.props.muteStatus.muteExpiresAt * 1000 : 0, // convert to ms
|
|
||||||
muteType: this.props.muteStatus.currentMessageType,
|
|
||||||
showWarning: this.props.muteStatus.showWarning ? this.props.muteStatus.showWarning : false
|
showWarning: this.props.muteStatus.showWarning ? this.props.muteStatus.showWarning : false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -99,7 +97,6 @@ class ComposeComment extends React.Component {
|
||||||
appealId: body.appealId,
|
appealId: body.appealId,
|
||||||
muteOpen: muteOpen,
|
muteOpen: muteOpen,
|
||||||
muteExpiresAtMs: muteExpiresAtMs,
|
muteExpiresAtMs: muteExpiresAtMs,
|
||||||
muteType: body.status.mute_status.currentMessageType,
|
|
||||||
showWarning: showWarning
|
showWarning: showWarning
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
@ -174,34 +171,13 @@ class ComposeComment extends React.Component {
|
||||||
|
|
||||||
getMuteMessageInfo () {
|
getMuteMessageInfo () {
|
||||||
// return the ids for the messages that are shown for this mute type
|
// 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
|
// If mute modals have more than one unique "step" we could pass an array of steps
|
||||||
const messageInfo = {
|
return {
|
||||||
pii: {
|
commentType: 'comment.type.disrespectful',
|
||||||
commentType: 'comment.type.pii',
|
muteStepHeader: 'comment.disrespectful.header',
|
||||||
muteStepHeader: 'comment.pii.header',
|
muteStepContent: ['comment.disrespectful.content1', 'comment.disrespectful.content2']
|
||||||
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 () {
|
handleCancel () {
|
||||||
|
@ -213,7 +189,6 @@ class ComposeComment extends React.Component {
|
||||||
});
|
});
|
||||||
if (this.props.onCancel) this.props.onCancel();
|
if (this.props.onCancel) this.props.onCancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
|
@ -339,7 +314,6 @@ ComposeComment.propTypes = {
|
||||||
muteStatus: PropTypes.shape({
|
muteStatus: PropTypes.shape({
|
||||||
offenses: PropTypes.array,
|
offenses: PropTypes.array,
|
||||||
muteExpiresAt: PropTypes.number,
|
muteExpiresAt: PropTypes.number,
|
||||||
currentMessageType: PropTypes.string,
|
|
||||||
showWarning: PropTypes.bool
|
showWarning: PropTypes.bool
|
||||||
}),
|
}),
|
||||||
onAddComment: PropTypes.func,
|
onAddComment: PropTypes.func,
|
||||||
|
|
|
@ -49,18 +49,5 @@
|
||||||
"comment.type.disrespectful": "Scratch thinks your most recent comment was disrespectful.",
|
"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.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.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."
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -335,21 +335,4 @@ describe('Compose Comment test', () => {
|
||||||
expect(commentInstance.isMuted()).toBe(false);
|
expect(commentInstance.isMuted()).toBe(false);
|
||||||
global.Date.now = realDateNow;
|
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');
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue