[CORL-129] Render Community Guidelines (#2191)

* chore: Rename InnerProps to Props

* feat: Render community guidelines

* chore: refactor schema communityGuidelines* settings into it's own type

* test: update snapshots
This commit is contained in:
Kiwi
2019-02-13 18:06:42 +01:00
committed by GitHub
parent f4037ce6fb
commit 51880bcfc9
64 changed files with 1365 additions and 184 deletions
@@ -131,8 +131,8 @@ exports[`renders configure general 1`] = `
checked={false}
className="RadioButton-input"
disabled={false}
id="communityGuidelinesEnable-true"
name="communityGuidelinesEnable"
id="communityGuidelines.enabled-true"
name="communityGuidelines.enabled"
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
@@ -141,7 +141,7 @@ exports[`renders configure general 1`] = `
/>
<label
className="RadioButton-label"
htmlFor="communityGuidelinesEnable-true"
htmlFor="communityGuidelines.enabled-true"
>
On
</label>
@@ -153,8 +153,8 @@ exports[`renders configure general 1`] = `
checked={true}
className="RadioButton-input"
disabled={false}
id="communityGuidelinesEnable-fase"
name="communityGuidelinesEnable"
id="communityGuidelines.enabled-fase"
name="communityGuidelines.enabled"
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
@@ -163,7 +163,7 @@ exports[`renders configure general 1`] = `
/>
<label
className="RadioButton-label"
htmlFor="communityGuidelinesEnable-fase"
htmlFor="communityGuidelines.enabled-fase"
>
Off
</label>
@@ -201,7 +201,7 @@ Markdown can be found
>
<textarea
id="configure-general-guidelines-content"
name="communityGuidelines"
name="communityGuidelines.content"
onChange={[Function]}
value=""
/>
@@ -72,10 +72,10 @@ it("change community guidlines", async () => {
let settingsRecord = cloneDeep(settings);
const updateSettingsStub = createSinonStub(s =>
s.onFirstCall().callsFake((_: any, data: any) => {
expect(data.input.settings.communityGuidelines).toEqual(
expect(data.input.settings.communityGuidelines.content).toEqual(
"This is the community guidlines summary"
);
expect(data.input.settings.communityGuidelinesEnable).toEqual(true);
expect(data.input.settings.communityGuidelines.enabled).toEqual(true);
settingsRecord = merge(settingsRecord, data.input.settings);
return {
settings: settingsRecord,
+4 -2
View File
@@ -17,8 +17,10 @@ export const settings = {
customCssUrl: null,
domains: ["localhost:8080"],
editCommentWindowLength: 30000,
communityGuidelinesEnable: false,
communityGuidelines: "",
communityGuidelines: {
enabled: false,
content: "",
},
organizationContactEmail: "coral@test.com",
organizationName: "Coral",
integrations: {