Editor embeds (#680)
- [x] Make deleting an embed easier - [x] Add document level ability to disable embeds - [x] Add team level ability to disable embeds - [x] GitHub - [x] Numeracy - [x] Mode Analytics - [x] Figma - [x] Airtable - [x] Vimeo - [x] RealtimeBoard - [x] Loom - [x] Lucidcharts - [x] Framer - [x] InVision - [x] Typeform - [x] Marvel - [x] Spotify - [x] Codepen - [x] Trello
This commit is contained in:
@@ -277,7 +277,8 @@ class DocumentScene extends React.Component<Props> {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { location, match } = this.props;
|
||||
const { location, auth, match } = this.props;
|
||||
const team = auth.team;
|
||||
const Editor = this.editorComponent;
|
||||
const document = this.document;
|
||||
const revision = this.revision;
|
||||
@@ -296,7 +297,7 @@ class DocumentScene extends React.Component<Props> {
|
||||
);
|
||||
}
|
||||
|
||||
if (!document || !Editor) {
|
||||
if (!document || !team || !Editor) {
|
||||
return (
|
||||
<Container column auto>
|
||||
<PageTitle title={location.state ? location.state.title : ''} />
|
||||
@@ -307,6 +308,8 @@ class DocumentScene extends React.Component<Props> {
|
||||
);
|
||||
}
|
||||
|
||||
const embedsDisabled = document.embedsDisabled || !team.documentEmbeds;
|
||||
|
||||
return (
|
||||
<ErrorBoundary>
|
||||
<Container
|
||||
@@ -359,10 +362,12 @@ class DocumentScene extends React.Component<Props> {
|
||||
)}
|
||||
<MaxWidth column auto>
|
||||
<Editor
|
||||
key={embedsDisabled ? 'embeds-disabled' : 'embeds-enabled'}
|
||||
titlePlaceholder="Start with a title…"
|
||||
bodyPlaceholder="…the rest is your canvas"
|
||||
defaultValue={revision ? revision.text : document.text}
|
||||
pretitle={document.emoji}
|
||||
disableEmbeds={embedsDisabled}
|
||||
onImageUploadStart={this.onImageUploadStart}
|
||||
onImageUploadStop={this.onImageUploadStop}
|
||||
onSearchLink={this.onSearchLink}
|
||||
|
||||
Reference in New Issue
Block a user