-
Notifications
You must be signed in to change notification settings - Fork 356
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 #4328 from coralproject/feat/CORL-2892-allow-addit…
…ional-origins [CORL-2892]: allow additional origins for oembed api calls
- Loading branch information
Showing
15 changed files
with
167 additions
and
67 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
52 changes: 0 additions & 52 deletions
52
...src/core/client/admin/routes/Configure/sections/Advanced/EmbeddedCommentRepliesConfig.tsx
This file was deleted.
Oops, something went wrong.
72 changes: 72 additions & 0 deletions
72
client/src/core/client/admin/routes/Configure/sections/Advanced/EmbeddedCommentsConfig.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,72 @@ | ||
import { Localized } from "@fluent/react/compat"; | ||
import React, { FunctionComponent } from "react"; | ||
import { graphql } from "react-relay"; | ||
|
||
import { FormField, HelperText, Label } from "coral-ui/components/v2"; | ||
|
||
import ConfigBox from "../../ConfigBox"; | ||
import Header from "../../Header"; | ||
import OnOffField from "../../OnOffField"; | ||
import Subheader from "../../Subheader"; | ||
import AllowedOriginsTextarea from "../Sites/AllowedOriginsTextarea"; | ||
|
||
// eslint-disable-next-line no-unused-expressions | ||
graphql` | ||
fragment EmbeddedCommentsConfig_formValues on Settings { | ||
embeddedComments { | ||
allowReplies | ||
oEmbedAllowedOrigins | ||
} | ||
} | ||
`; | ||
|
||
interface Props { | ||
disabled: boolean; | ||
} | ||
|
||
const EmbeddedCommentsConfig: FunctionComponent<Props> = ({ disabled }) => ( | ||
<ConfigBox | ||
data-testid="embedded-comments-config" | ||
title={ | ||
<Localized id="configure-advanced-embeddedComments"> | ||
<Header htmlFor="configure-advanced-embeddedComments"> | ||
Embedded comments | ||
</Header> | ||
</Localized> | ||
} | ||
> | ||
<FormField> | ||
<Localized id="configure-advanced-embeddedCommentReplies-label"> | ||
<Label>Allow replies to embedded comments</Label> | ||
</Localized> | ||
<Localized id="configure-advanced-embeddedCommentReplies-explanation"> | ||
<HelperText> | ||
When enabled, a reply button will appear with each embedded comment to | ||
encourage additional discussion on that specific comment or story. | ||
</HelperText> | ||
</Localized> | ||
<OnOffField name="embeddedComments.allowReplies" disabled={disabled} /> | ||
</FormField> | ||
<Localized id="configure-advanced-embeddedComments-subheader"> | ||
<Subheader>For sites using oEmbed</Subheader> | ||
</Localized> | ||
<FormField> | ||
<Localized id="configure-advanced-oembedAllowedOrigins-label"> | ||
<Label>oEmbed permitted domains</Label> | ||
</Localized> | ||
<Localized id="configure-advanced-oembedAllowedOrigins-description"> | ||
<HelperText> | ||
Domains that are permitted to make calls to the oEmbed API (ex. | ||
http://localhost:3000, https://staging.domain.com, | ||
https://domain.com). | ||
</HelperText> | ||
</Localized> | ||
<AllowedOriginsTextarea | ||
name="embeddedComments.oEmbedAllowedOrigins" | ||
disabled={disabled} | ||
/> | ||
</FormField> | ||
</ConfigBox> | ||
); | ||
|
||
export default EmbeddedCommentsConfig; |
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
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
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