[CORL-846] Restructure the slack comment message format (#2794)

* Restructure the slack comment message format

CORL-846

* feat: removed all comments

Co-authored-by: Wyatt Johnson <accounts+github@wyattjoh.ca>
This commit is contained in:
Nick Funk
2020-01-14 22:26:33 +00:00
committed by Wyatt Johnson
co-authored by Wyatt Johnson
parent e8fb234838
commit 533d7633e1
5 changed files with 90 additions and 146 deletions
@@ -151,93 +151,63 @@ const SlackChannel: FunctionComponent<Props> = ({
<Label>Receive notifications in this Slack channel for</Label>
</Localized>
</div>
<Field
name={`${channel}.triggers.allComments`}
subscription={{ value: true }}
>
{({ input: { value: allCommentsValue } }) => (
<div className={styles.notificationToggles}>
<Field
name={`${channel}.triggers.allComments`}
type="checkbox"
parse={parseBool}
<div className={styles.notificationToggles}>
<Field
name={`${channel}.triggers.reportedComments`}
type="checkbox"
parse={parseBool}
>
{({ input }) => (
<CheckBox
id={`configure-slack-channel-triggers-reportedComments-${input.name}`}
disabled={disabled || !channelEnabled}
className={styles.trigger}
{...input}
>
{({ input }) => (
<CheckBox
id={`configure-slack-channel-triggers-allComments-${input.name}`}
disabled={disabled || !channelEnabled}
className={styles.trigger}
{...input}
>
<Localized id="configure-slack-channel-triggers-allComments">
All Comments
</Localized>
</CheckBox>
)}
</Field>
<Field
name={`${channel}.triggers.reportedComments`}
type="checkbox"
parse={parseBool}
<Localized id="configure-slack-channel-triggers-reportedComments">
Reported Comments
</Localized>
</CheckBox>
)}
</Field>
<Field
name={`${channel}.triggers.pendingComments`}
type="checkbox"
parse={parseBool}
>
{({ input }) => (
<CheckBox
id={`configure-slack-channel-triggers-pendingComments-${input.name}`}
disabled={disabled || !channelEnabled}
className={styles.trigger}
{...input}
>
{({ input }) => (
<CheckBox
id={`configure-slack-channel-triggers-reportedComments-${input.name}`}
disabled={
disabled || allCommentsValue || !channelEnabled
}
className={styles.trigger}
{...input}
>
<Localized id="configure-slack-channel-triggers-reportedComments">
Reported Comments
</Localized>
</CheckBox>
)}
</Field>
<Field
name={`${channel}.triggers.pendingComments`}
type="checkbox"
parse={parseBool}
<Localized id="configure-slack-channel-triggers-pendingComments">
Pending Comments
</Localized>
</CheckBox>
)}
</Field>
<Field
name={`${channel}.triggers.featuredComments`}
type="checkbox"
parse={parseBool}
>
{({ input }) => (
<CheckBox
id={`configure-slack-channel-triggers-featuredComments-${input.name}`}
disabled={disabled || !channelEnabled}
className={styles.trigger}
{...input}
>
{({ input }) => (
<CheckBox
id={`configure-slack-channel-triggers-pendingComments-${input.name}`}
disabled={
disabled || allCommentsValue || !channelEnabled
}
className={styles.trigger}
{...input}
>
<Localized id="configure-slack-channel-triggers-pendingComments">
Pending Comments
</Localized>
</CheckBox>
)}
</Field>
<Field
name={`${channel}.triggers.featuredComments`}
type="checkbox"
parse={parseBool}
>
{({ input }) => (
<CheckBox
id={`configure-slack-channel-triggers-featuredComments-${input.name}`}
disabled={
disabled || allCommentsValue || !channelEnabled
}
className={styles.trigger}
{...input}
>
<Localized id="configure-slack-channel-triggers-featuredComments">
Featured Comments
</Localized>
</CheckBox>
)}
</Field>
</div>
)}
</Field>
<Localized id="configure-slack-channel-triggers-featuredComments">
Featured Comments
</Localized>
</CheckBox>
)}
</Field>
</div>
</FormField>
<div>
<Button
@@ -41,7 +41,6 @@ const SlackConfigContainer: FunctionComponent<Props> = ({ form, settings }) => {
name: "",
hookURL: "",
triggers: {
allComments: false,
reportedComments: false,
pendingComments: false,
featuredComments: false,
@@ -57,7 +56,6 @@ const SlackConfigContainer: FunctionComponent<Props> = ({ form, settings }) => {
enabled: true,
hookURL: "",
triggers: {
allComments: false,
reportedComments: false,
pendingComments: false,
featuredComments: false,
@@ -143,7 +141,6 @@ const enhanced = withFragmentContainer<Props>({
name
hookURL
triggers {
allComments
reportedComments
pendingComments
featuredComments