-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4447 from coralproject/develop
8.6.2
- Loading branch information
Showing
60 changed files
with
890 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
client/src/core/client/admin/components/ModerateCard/DecisionDetailsContainer.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.wrapper { | ||
background-color: var(--palette-grey-200); | ||
font-family: var(--font-family-primary); | ||
} | ||
|
||
.full { | ||
width: 100%; | ||
} | ||
|
||
.label { | ||
font-size: var(--font-size-1); | ||
font-weight: var(--font-weight-primary-semi-bold); | ||
text-transform: uppercase; | ||
color: var(--palette-grey-500); | ||
} | ||
|
||
.rejected { | ||
color: var(--palette-text-000); | ||
background-color: var(--palette-error-500); | ||
text-transform: uppercase; | ||
padding: var(--spacing-1) var(--spacing-2); | ||
width: fit-content; | ||
font-size: var(--font-size-1); | ||
font-weight: var(--font-weight-primary-semi-bold); | ||
} | ||
|
||
.info { | ||
font-size: var(--font-size-2); | ||
} |
102 changes: 102 additions & 0 deletions
102
client/src/core/client/admin/components/ModerateCard/DecisionDetailsContainer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
import { Localized } from "@fluent/react/compat"; | ||
import React, { FunctionComponent } from "react"; | ||
import { graphql } from "react-relay"; | ||
|
||
import { withFragmentContainer } from "coral-framework/lib/relay"; | ||
import { Flex, HorizontalGutter, Timestamp } from "coral-ui/components/v2"; | ||
|
||
import { DecisionDetailsContainer_comment } from "coral-admin/__generated__/DecisionDetailsContainer_comment.graphql"; | ||
|
||
import styles from "./DecisionDetailsContainer.css"; | ||
|
||
import { unsnake } from "../ModerationReason/formatting"; | ||
|
||
interface Props { | ||
comment: DecisionDetailsContainer_comment; | ||
} | ||
|
||
const DecisionDetailsContainer: FunctionComponent<Props> = ({ comment }) => { | ||
const statusHistory = comment.statusHistory.edges[0].node; | ||
const { rejectionReason, createdAt } = statusHistory; | ||
|
||
return ( | ||
<HorizontalGutter className={styles.wrapper} padding={3}> | ||
<Flex> | ||
<Flex direction="column" className={styles.full}> | ||
<Localized id="moderate-decisionDetails-decisionLabel"> | ||
<div className={styles.label}>Decision</div> | ||
</Localized> | ||
<Localized id="moderate-decisionDetails-rejected"> | ||
<div className={styles.rejected}>Rejected</div> | ||
</Localized> | ||
</Flex> | ||
{rejectionReason && rejectionReason.code && ( | ||
<Flex direction="column" className={styles.full}> | ||
<Localized id="moderate-decisionDetails-reasonLabel"> | ||
<div className={styles.label}>Reason</div> | ||
</Localized> | ||
<Localized | ||
id={`common-moderationReason-rejectionReason-${rejectionReason.code}`} | ||
> | ||
<div className={styles.info}>{unsnake(rejectionReason.code)}</div> | ||
</Localized> | ||
</Flex> | ||
)} | ||
</Flex> | ||
{rejectionReason?.legalGrounds && ( | ||
<Flex direction="column"> | ||
<Localized id="moderate-decisionDetails-lawBrokenLabel"> | ||
<div className={styles.label}>Law broken</div> | ||
</Localized> | ||
<div className={styles.info}>{rejectionReason?.legalGrounds}</div> | ||
</Flex> | ||
)} | ||
{rejectionReason?.customReason && ( | ||
<Flex direction="column"> | ||
<Localized id="moderate-decisionDetails-customReasonLabel"> | ||
<div className={styles.label}>Custom reason</div> | ||
</Localized> | ||
<div className={styles.info}>{rejectionReason?.customReason}</div> | ||
</Flex> | ||
)} | ||
{rejectionReason?.detailedExplanation && ( | ||
<Flex direction="column"> | ||
<Localized id="moderate-decisionDetails-detailedExplanationLabel"> | ||
<div className={styles.label}>Detailed explanation</div> | ||
</Localized> | ||
<div className={styles.info}> | ||
{rejectionReason?.detailedExplanation} | ||
</div> | ||
</Flex> | ||
)} | ||
<Flex> | ||
<div className={styles.label}> | ||
<Timestamp>{createdAt}</Timestamp> | ||
</div> | ||
</Flex> | ||
</HorizontalGutter> | ||
); | ||
}; | ||
|
||
const enhanced = withFragmentContainer<Props>({ | ||
comment: graphql` | ||
fragment DecisionDetailsContainer_comment on Comment { | ||
id | ||
statusHistory(first: 1) { | ||
edges { | ||
node { | ||
createdAt | ||
rejectionReason { | ||
code | ||
legalGrounds | ||
detailedExplanation | ||
customReason | ||
} | ||
} | ||
} | ||
} | ||
} | ||
`, | ||
})(DecisionDetailsContainer); | ||
|
||
export default enhanced; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.