Skip to content

Commit a049f8f

Browse files
authored
Merge pull request #4572 from serlo/refactor/simplify-plugin-config
refactor(editor): simplify editor plugin config, remove testingsecret image upload
2 parents ba5eb82 + a165731 commit a049f8f

File tree

76 files changed

+528
-1213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+528
-1213
lines changed

apps/web/src/components/pages/editor/education-plugin-examples.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,7 @@ function ExampleWithEditSwitch({
179179
]}
180180
styleReset={false}
181181
initialState={exampleState}
182-
onChange={(state) => {
183-
void debouncedSetState(state.document)
184-
}}
182+
onChange={(state) => debouncedSetState(state.document)}
185183
extraSerloPlugins={extraSerloPlugins}
186184
extraSerloRenderers={extraSerloRenderers}
187185
>
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { H5pPlugin } from './h5p'
2-
import { imagePlugin } from './image-with-serlo-config'
32

43
export const extraSerloPlugins = {
54
h5p: H5pPlugin,
6-
image: imagePlugin,
75
}

apps/web/src/serlo-editor-integration/image-with-serlo-config.ts

Lines changed: 0 additions & 171 deletions
This file was deleted.

packages/editor-web-component/src/editor-web-component.tsx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ export class EditorWebComponent extends HTMLElement {
3636
private _initialState: InitialState = exampleInitialState
3737
private _currentState: unknown
3838

39-
private _testingSecret: string | null = null
40-
4139
private _editorVariant: EditorVariant = 'unknown'
4240

4341
private _plugins = defaultPlugins
@@ -129,14 +127,6 @@ export class EditorWebComponent extends HTMLElement {
129127
return this._history
130128
}
131129

132-
get testingSecret(): string | null {
133-
return this._testingSecret
134-
}
135-
136-
set testingSecret(newTestingSecret) {
137-
if (newTestingSecret) this.setAttribute('testing-secret', newTestingSecret)
138-
}
139-
140130
get editorVariant(): EditorVariant {
141131
return this._editorVariant
142132
}
@@ -212,7 +202,6 @@ export class EditorWebComponent extends HTMLElement {
212202

213203
mountReactComponent() {
214204
const initialStateAttr = this.getAttribute('initial-state')
215-
const testingSecretAttr = this.getAttribute('testing-secret')
216205

217206
const initialState: InitialState = initialStateAttr
218207
? (JSON.parse(initialStateAttr) as unknown as any)
@@ -237,7 +226,6 @@ export class EditorWebComponent extends HTMLElement {
237226
<LazySerloEditor
238227
editorVariant={this.editorVariant}
239228
initialState={this.initialState}
240-
_testingSecret={testingSecretAttr}
241229
plugins={this.plugins}
242230
isProductionEnvironment={this.isProductionEnvironment}
243231
onChange={(newState) => {

packages/editor/src/core/contexts/editor-meta-context.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ export interface EditorMeta {
55
editorVariant: EditorVariant
66
userId?: string
77
ltik?: string
8+
disableMediaUpload?: boolean
9+
isProductionEnvironment?: boolean
810
}
911

1012
export const EditorMetaContext = createContext<EditorMeta>({

0 commit comments

Comments
 (0)