[CORL-156] Manage user suspension status (#2419)

* wire up suspension modal

* show user suspended callout on stream

* prevent comment actions for suspended users

* set default to 3 hour suspension

* add message field to suspension

* allow custom message for suspension

* show suspend success modal

* fix type errors

* remove unused code

* update styles

* fix fixture for streams

* add suspension ui tests

* fix types

* remove warnings?

* remove snapshot

* fix merge conflicts

* allow custom email message when banning users

* fix typo

* correct message type

* use final-form in suspend modal

* refactor suspend modal to use final-form

* refactor ban modal to use final-form

* refactor userStatusChangeContainer to use useCallback

* feat: improve translated form

* fix: addressed issue caused by i18n refactor

* update getMessage to accept arguments, remove format method

* translate suspend info

* change hour format

* make message a mandatory input for suspend and ban user

* fix types in user table

* Revert "fix types in user table"

This reverts commit d396e90b88bb1bd354c5cdbdd72b6d8f1ab72929.

* fix types for user table

* fix: small review tweaks
This commit is contained in:
Tessa Thornton
2019-08-02 21:16:21 +00:00
committed by Wyatt Johnson
parent 4e548e8fbf
commit 5df2de6afc
42 changed files with 1511 additions and 276 deletions
@@ -133,6 +133,7 @@ export const Users = (ctx: TenantContext) => ({
ctx.tenant,
ctx.user!,
input.userID,
input.message,
ctx.now
),
suspend: async (input: GQLSuspendUserInput) =>
@@ -143,6 +144,7 @@ export const Users = (ctx: TenantContext) => ({
ctx.user!,
input.userID,
input.timeout,
input.message,
ctx.now
),
removeBan: async (input: GQLRemoveUserBanInput) =>
@@ -13,4 +13,5 @@ export const BanStatusHistory: Required<
return null;
},
createdAt: ({ createdAt }) => createdAt,
message: ({ message }) => message,
};
@@ -23,4 +23,5 @@ export const SuspensionStatusHistory: Required<
return null;
},
modifiedAt: ({ modifiedAt }) => modifiedAt,
message: ({ message }) => message,
};
@@ -1301,6 +1301,11 @@ type BanStatusHistory {
createdAt is the time that the given User was banned.
"""
createdAt: Time!
"""
message is sent to banned user via email.
"""
message: String!
}
"""
@@ -1375,6 +1380,11 @@ type SuspensionStatusHistory {
then the suspension has not been cancelled/edited.
"""
modifiedAt: Time
"""
message is sent to suspended user via email.
"""
message: String!
}
"""
@@ -4225,6 +4235,11 @@ input BanUserInput {
clientMutationId is required for Relay support.
"""
clientMutationId: String!
"""
message is sent to banned user via email.
"""
message: String!
}
type BanUserPayload {
@@ -4259,6 +4274,11 @@ input SuspendUserInput {
clientMutationId is required for Relay support.
"""
clientMutationId: String!
"""
message is sent to suspended user via email.
"""
message: String!
}
type SuspendUserPayload {