Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tell editors to not reply other's reply + translations #465

Merged
merged 6 commits into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 28 additions & 15 deletions components/NewReplySection/ReplyForm/ReasonEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,27 @@ const StickerIcon = props => (

const { BULLETED, NUMBERED } = LIST_STYLES;

/**
* @param {'NOT_ARTICLE' | 'NOT_RUMOR' | 'OPINIONATED' | 'RUMOR'} replyType
* @returns {string}
*/
function getReasonHint(replyType) {
switch (replyType) {
case 'NOT_ARTICLE':
return t`Please briefly explain why this message should not be processed in Cofacts.`;
case 'NOT_RUMOR':
return t`As a brief intro for the references, please point out which part of the message is correct.`;
case 'OPINIONATED':
return t`Please briefly
1. explain which part of the message contains personal opinion
2. remind the audience that this is not factual`;
case 'RUMOR':
return t`As a brief intro for the references, please point out which part of the message is incorrect.`;
default:
return '';
}
}

const ReasonEditor = ({
value,
onSuggestionAdd,
Expand Down Expand Up @@ -220,6 +241,12 @@ const ReasonEditor = ({
setSearch('');
};

const multipleReplyHint =
existingReplyIds.length === 0
? ''
: '\n\n' +
t`Note: This is not a comment section! Please write your reply in response to the reported message above, NOT to other editors' replies below. Please use the thumb-down button below each reply if you find it not good enough.`;

return (
<div className={classes.editor}>
{showHelp && (
Expand Down Expand Up @@ -257,21 +284,7 @@ const ReasonEditor = ({
required
className={classes.inputArea}
ref={editorRef}
placeholder={(() => {
if (replyType === 'NOT_ARTICLE') {
return t`Please briefly explain why this message should not be processed in Cofacts.`;
} else if (replyType === 'NOT_RUMOR') {
return t`As a brief intro for the references, please point out which part of the message is correct.`;
} else if (replyType === 'OPINIONATED') {
return t`Please briefly
1. explain which part of the message contains personal opinion
2. remind the audience that this is not factual`;
} else if (replyType === 'RUMOR') {
return t`As a brief intro for the references, please point out which part of the message is incorrect.`;
} else {
return '';
}
})()}
placeholder={getReasonHint(replyType) + multipleReplyHint}
onChange={handleChange}
onKeyDown={handleKeyPress}
value={value}
Expand Down
Loading