[CORL-645] Add Slack support for v5 (#2713)

* Create preliminary schema for setting Slack channels

CORL-645

* Implement preliminary slack notification using tenant slack channels

CORL-645

* Very preliminarily get data loading with FieldArray's for slack channels

CORL-645

* Update settings input on schema to allow saving Slack settings to tenant

CORL-645

* Filter off UNMODERATED queue events from slack channels

We don't send these to slack through our filters, we only care
about pending, reported, and featured

CORL-645

* Include a moderation link in comments pushed to Slack

CORL-645

* Hook up proper callback functions for adding/removing slack channels

CORL-645

* Add missing translation for Slack navigation item

CORL-645

* Update snapshots for preliminary Slack configuration changes

CORL-645

* Add some FormField wrappers around slack config elements

Makes the UI appear a little nicer

CORL-645

* Set up slack config to only provide one slack channel

We need to do this until we can get ArrayField's working
in final-form.

CORL-645

* Disable the other trigger checkboxes when "All Comments" is checked

CORL-645

* Clean up the formatting of Slack messages

CORL-645

* Add error handling around sending comments to Slack

CORL-645

* Add links to external Slack setup documentation

CORL-645

* Replace form state with wrapped field element

CORL-645

* Clean up fetch request sending Slack notifications

CORL-645

* Prefer global string replacement over RegEx

CORL-645

* Use URL class to construct comment URL's

CORL-645

* Require slack configuration in schema

CORL-645

* Initialize Slack in fixtures

Also fix up a flaky test that wasn't waiting
on form submission and on-change events.

CORL-645

* Preliminarily fix up styles to match other config pages

CORL-645

* Create placeholder add/remove buttons

* Convert SlackConfigContainer to FunctionalComponent

CORL-645

* Add name field to slack channels

CORL-645

* Disable inner fields on Slack channel when not enabled

CORL-645

* Improve the delete channel button

CORL-645

* Use pureMerge to extract slack channel settings

CORL-645

* Do a bit of cleanup on the add channel button

CORL-645
This commit is contained in:
Nick Funk
2019-12-03 16:06:38 -05:00
committed by Kim Gardner
parent c109188efe
commit 54296fa484
34 changed files with 1057 additions and 19 deletions
@@ -79,6 +79,15 @@ exports[`renders configure advanced 1`] = `
Email
</a>
</li>
<li>
<a
className="Link-link"
href="/admin/configure/slack"
onClick={[Function]}
>
Slack
</a>
</li>
<li>
<a
className="Link-link Link-linkActive"
@@ -79,6 +79,15 @@ exports[`renders configure auth 1`] = `
Email
</a>
</li>
<li>
<a
className="Link-link"
href="/admin/configure/slack"
onClick={[Function]}
>
Slack
</a>
</li>
<li>
<a
className="Link-link"
@@ -79,6 +79,15 @@ exports[`renders configure general 1`] = `
Email
</a>
</li>
<li>
<a
className="Link-link"
href="/admin/configure/slack"
onClick={[Function]}
>
Slack
</a>
</li>
<li>
<a
className="Link-link"
@@ -79,6 +79,15 @@ exports[`renders configure moderation 1`] = `
Email
</a>
</li>
<li>
<a
className="Link-link"
href="/admin/configure/slack"
onClick={[Function]}
>
Slack
</a>
</li>
<li>
<a
className="Link-link"
@@ -79,6 +79,15 @@ exports[`renders configure organization 1`] = `
Email
</a>
</li>
<li>
<a
className="Link-link"
href="/admin/configure/slack"
onClick={[Function]}
>
Slack
</a>
</li>
<li>
<a
className="Link-link"
@@ -79,6 +79,15 @@ exports[`renders configure wordList 1`] = `
Email
</a>
</li>
<li>
<a
className="Link-link"
href="/admin/configure/slack"
onClick={[Function]}
>
Slack
</a>
</li>
<li>
<a
className="Link-link"
@@ -90,14 +90,16 @@ it("change language", async () => {
act(() => languageField.props.onChange("es"));
// Send form
act(() => {
within(configureContainer)
await act(async () => {
await within(configureContainer)
.getByType("form")
.props.onSubmit();
});
// Submit button and text field should be disabled.
expect(saveChangesButton.props.disabled).toBe(true);
await wait(() => {
expect(saveChangesButton.props.disabled).toBe(true);
});
// Wait for submission to be finished
await act(async () => {
+3
View File
@@ -161,6 +161,9 @@ export const settings = createFixture<GQLSettings>({
changeUsername: true,
deleteAccount: true,
},
slack: {
channels: [],
},
});
export const settingsWithEmptyAuth = createFixture<GQLSettings>(