+
+ );
+ }
+
+ render() {
+ const {open, onCancel} = this.props;
+ const {step} = this.state;
+ return (
+
+ );
+ }
+}
+
+SuspendUserDialog.propTypes = {
+ open: PropTypes.bool.isRequired,
+ onCancel: PropTypes.func.isRequired,
+ onPerform: PropTypes.func.isRequired,
+ username: PropTypes.string.isRequired,
+};
+
+export default SuspendUserDialog;
diff --git a/client/coral-admin/src/reducers/moderation.js b/client/coral-admin/src/reducers/moderation.js
index 8f51cea6b..67fd8700b 100644
--- a/client/coral-admin/src/reducers/moderation.js
+++ b/client/coral-admin/src/reducers/moderation.js
@@ -1,14 +1,21 @@
-import {Map} from 'immutable';
+import {fromJS, Map} from 'immutable';
import * as actions from '../constants/moderation';
-const initialState = Map({
+const initialState = fromJS({
singleView: false,
modalOpen: false,
- user: Map({}),
+ user: {},
commentId: null,
commentStatus: null,
banDialog: false,
- shortcutsNoteVisible: window.localStorage.getItem('coral:shortcutsNote') || 'show'
+ shortcutsNoteVisible: window.localStorage.getItem('coral:shortcutsNote') || 'show',
+ suspendUserDialog: {
+ show: false,
+ userId: null,
+ username: '',
+ commentId: null,
+ commentStatus: '',
+ },
});
export default function moderation (state = initialState, action) {
@@ -26,6 +33,19 @@ export default function moderation (state = initialState, action) {
showRejectedNote: action.showRejectedNote,
banDialog: true
});
+ case actions.SHOW_SUSPEND_USER_DIALOG:
+ return state
+ .mergeDeep({
+ suspendUserDialog: {
+ show: true,
+ username: action.username,
+ commentId: action.commentId,
+ commentStatus: action.commentStatus,
+ }
+ });
+ case actions.HIDE_SUSPEND_USER_DIALOG:
+ return state
+ .setIn(['suspendUserDialog', 'show'], false);
case actions.SET_ACTIVE_TAB:
return state
.set('activeTab', action.activeTab);
diff --git a/client/coral-admin/src/translations.json b/client/coral-admin/src/translations.json
index 68a3b93d5..174217930 100644
--- a/client/coral-admin/src/translations.json
+++ b/client/coral-admin/src/translations.json
@@ -140,19 +140,28 @@
"yes_ban_user": "Yes, Ban User"
},
"suspenduser": {
- "title": "Suspend a user",
- "title_0": "We noticed you rejected a username",
- "description_0": "Would you like to temporarily ban this user because of their {0}? Doing so will temporarily hide their comments until they rewrite their {0}.",
- "title_1": "Notify the user of their temporary suspension",
- "description_1": "Suspending this user will temporarily disable their account and hide all of their comments on the site.",
+ "title_suspend": "Suspend User",
+ "description_suspend": "You are suspending {0}. This comment will go to the Rejected queue, and {0} will not be allowed to like, report, reply or post until the suspension time is complete.",
+ "select_duration": "Select suspension duration",
+ "title_reject": "We noticed you rejected a username",
+ "description_reject": "Would you like to temporarily ban this user because of their {0}? Doing so will temporarily hide their comments until they rewrite their {0}.",
+
+ "title_notify": "Notify the user of their temporary suspension",
+ "description_notify": "Suspending this user will temporarily disable their account and hide all of their comments on the site.",
"no_cancel": "No, cancel",
"yes_suspend": "Yes, suspend",
"send": "Send",
"bio": "bio",
"username": "username",
"email_subject": "Your account has been suspended",
- "email": "Another member of the community recently flagged your username for review. Because of its content your user was rejected. This means you can no longer comment, like, or flag content until you rewrite your username. Please e-mail us if you have any questions or concerns.",
- "write_message": "Write a message"
+ "email_message_reject": "Another member of the community recently flagged your username for review. Because of its content your user was rejected. This means you can no longer comment, like, or flag content until you rewrite your username. Please e-mail us if you have any questions or concerns.",
+ "email_message_suspend": "Your user account has been suspended. This means you can no longer comment, like, or flag content until you rewrite your username. Please e-mail us if you have any questions or concerns.",
+ "write_message": "Write a message",
+ "hours": "{0} hours",
+ "days": "{0} days",
+ "suspend_user": "Suspend User",
+ "cancel": "Cancel",
+ "error_email_message_empty": "You must specify an E-Mail message."
},
"dashboard": {
"next-update": "{0} minutes until next update.",
@@ -217,19 +226,23 @@
"yes_ban_user": "Si, Suspendan el usuario"
},
"suspenduser": {
- "title": "Suspendiendo un usuario",
- "title_0": "Esta queriendo suspender un usuario?",
- "description_0": "Le gustaria suspender a esta usuaria temporarianmente por su nombre de usuario? Si lo hace sus comentarios serán escondidos temporariamente hasta que puedan reescribir su nombre de usuario.",
- "title_1": "Enviarle una nota al usuario sobre su cuenta suspendida",
- "description_1": "Si suspende a este usuario, su cuenta va a ser deshabilitada y todos sus comentarios escondidos del sitio.",
+ "title_suspend": "Suspender Usuario",
+ "title_reject": "Esta queriendo suspender un usuario?",
+ "description_reject": "Le gustaria suspender a esta usuaria temporarianmente por su nombre de usuario? Si lo hace sus comentarios serán escondidos temporariamente hasta que puedan reescribir su nombre de usuario.",
+ "title_notify": "Enviarle una nota al usuario sobre su cuenta suspendida",
+ "description_notify": "Si suspende a este usuario, su cuenta va a ser deshabilitada y todos sus comentarios escondidos del sitio.",
"no_cancel": "No, cancelar",
"yes_suspend": "Si, suspender",
"send": "Enviar",
"username": "nombre de usuario",
"email_subject": "Su cuenta ha sido suspendida temporariamente",
- "email": "Otra persona de la comunidad recientemente marcó su nombre de usuario para ser revisado. Por su contenido, el nombre de usuario ha sido rechazado. Esto quiere decir que no puede comentar, gustar o marcar contenido hasta que modifique su nombre de usuario. Por favor, envienos un correo a moderator@newsorg.com si tiene alguna pregunta o preocupación",
+ "email_message_reject": "Otra persona de la comunidad recientemente marcó su nombre de usuario para ser revisado. Por su contenido, el nombre de usuario ha sido rechazado. Esto quiere decir que no puede comentar, gustar o marcar contenido hasta que modifique su nombre de usuario. Por favor, envienos un correo a moderator@newsorg.com si tiene alguna pregunta o preocupación",
"write_message": "Escribir un mensaje",
- "loading": "Cargando resultados"
+ "loading": "Cargando resultados",
+ "hours": "{0} horas",
+ "days": "{0} días",
+ "suspend_user": "Suspender",
+ "cancel": "Cancelar"
},
"modqueue": {
"all": "todos",
diff --git a/client/coral-ui/components/Button.css b/client/coral-ui/components/Button.css
index 219b70a65..5100d44a4 100644
--- a/client/coral-ui/components/Button.css
+++ b/client/coral-ui/components/Button.css
@@ -25,12 +25,6 @@
letter-spacing: 0.7px;
font-weight: 400;
- i {
- margin-right: 13px;
- font-size: 18px;
- vertical-align: middle;
- }
-
&:disabled {
background: #E0E0E0;
color: #4f5c67;
@@ -38,11 +32,22 @@
}
}
+.icon {
+ margin-right: 13px;
+ font-size: 18px;
+ vertical-align: middle;
+}
+
.type--black {
- color: #E0E0E0;
+ color: white;
background: #212121;
}
+.type--white {
+ color: #212121;
+ background: white;
+}
+
.type--local {
background: #E0E0E0;
color: #212121;
@@ -163,7 +168,7 @@
cursor: not-allowed;
}
-.type--ban {
+.type--ban, .type--actions {
display: block;
color: #616161;
border: solid 1px rgba(97, 97, 97, 0.77);
@@ -179,11 +184,16 @@
font-size: 14px;
width: auto;
-&:hover {
- box-shadow: none;
- color: white;
- background-color: #616161;
- }
+ &:hover {
+ box-shadow: none;
+ color: white;
+ background-color: #616161;
+ }
+
+ > .icon {
+ margin-right: 5px;
+ font-size: 14px;
+ }
}
.full {
diff --git a/client/coral-ui/components/Button.js b/client/coral-ui/components/Button.js
index 52d806adb..6d3dc94d2 100644
--- a/client/coral-ui/components/Button.js
+++ b/client/coral-ui/components/Button.js
@@ -13,7 +13,7 @@ const Button = ({cStyle = 'local', children, className, raised = false, full = f
`}
{...props}
>
- {icon && }
+ {icon && }
{children}
);
diff --git a/package.json b/package.json
index bfca21643..ce9058d18 100644
--- a/package.json
+++ b/package.json
@@ -96,14 +96,13 @@
"prop-types": "^15.5.8",
"react-apollo": "^1.1.0",
"react-recaptcha": "^2.2.6",
+ "react-toastify": "^1.5.0",
"recompose": "^0.23.1",
"redis": "^2.7.1",
- "uuid": "^3.0.1",
- "simplemde": "^1.11.2",
- "subscriptions-transport-ws": "^0.5.5-alpha.0",
"resolve": "^1.3.2",
"semver": "^5.3.0",
"simplemde": "^1.11.2",
+ "subscriptions-transport-ws": "^0.5.5-alpha.0",
"uuid": "^3.0.1"
},
"devDependencies": {
diff --git a/yarn.lock b/yarn.lock
index 99703bdf3..fd118d728 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1476,6 +1476,10 @@ chai@^3.5.0:
deep-eql "^0.1.3"
type-detect "^1.0.0"
+chain-function@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/chain-function/-/chain-function-1.0.0.tgz#0d4ab37e7e18ead0bdc47b920764118ce58733dc"
+
chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
@@ -2422,6 +2426,10 @@ doctypes@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/doctypes/-/doctypes-1.1.0.tgz#ea80b106a87538774e8a3a4a5afe293de489e0a9"
+dom-helpers@^3.2.0:
+ version "3.2.1"
+ resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-3.2.1.tgz#3203e07fed217bd1f424b019735582fc37b2825a"
+
dom-serializer@0, dom-serializer@~0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82"
@@ -6817,6 +6825,22 @@ react-tagsinput@^3.14.0:
version "3.16.1"
resolved "https://registry.yarnpkg.com/react-tagsinput/-/react-tagsinput-3.16.1.tgz#dfb3bcbe5fc4430f60c145716c17cdc2613ce117"
+react-toastify@^1.5.0:
+ version "1.5.0"
+ resolved "https://registry.yarnpkg.com/react-toastify/-/react-toastify-1.5.0.tgz#e9857e0b5d640064e5ba6caf7a96bb1578273de7"
+ dependencies:
+ prop-types "^15.5.8"
+ react-transition-group "^1.1.2"
+
+react-transition-group@^1.1.2:
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-1.1.3.tgz#5e02cf6e44a863314ff3c68a0c826c2d9d70b221"
+ dependencies:
+ chain-function "^1.0.0"
+ dom-helpers "^3.2.0"
+ prop-types "^15.5.6"
+ warning "^3.0.0"
+
react@^15.3.1, react@^15.4.2:
version "15.5.4"
resolved "https://registry.yarnpkg.com/react/-/react-15.5.4.tgz#fa83eb01506ab237cdc1c8c3b1cea8de012bf047"