Skip to content

Commit

Permalink
Merge pull request #2675 from serlo/staging
Browse files Browse the repository at this point in the history
Deployment
  • Loading branch information
hejtful authored Aug 8, 2023
2 parents d212ba1 + a6808ed commit f9154ae
Show file tree
Hide file tree
Showing 227 changed files with 3,985 additions and 4,547 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 1 addition & 2 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ module.exports = withBundleAnalyzer({
defaultLocale: 'de',
localeDetection: false,
},
// TODO: reactStrictMode with react18 breaks edtr.io atm
reactStrictMode: false,
reactStrictMode: true,
productionBrowserSourceMaps: true,
transpilePackages: ['ramda'], // context: https://github.com/vercel/next.js/issues/40183
/*experimental: {
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
"reselect": "^4.1.8",
"slate": "^0.91.0",
"slate-react": "^0.91.0",
"styled-components": "^5.0.0",
"swr": "^2.0.0",
"timeago-react": "^3.0.5",
"timeago.js": "^4.0.2",
Expand Down Expand Up @@ -130,7 +129,6 @@
"@types/react-notify-toast": "^0.5.3",
"@types/react-syntax-highlighter": "^13.5.2",
"@types/slate-react": "^0.50.1",
"@types/styled-components": "^5.1.26",
"@types/uuid": "^9.0.1",
"@typescript-eslint/eslint-plugin": "^5.48.0",
"@typescript-eslint/parser": "^5.48.0",
Expand Down
7 changes: 4 additions & 3 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ model ExerciseSubmission {
@@index([entityId])
@@index([timestamp])
@@index([path(length: 50)])
}

model PrivateLinkPrototype {
Expand Down Expand Up @@ -47,6 +48,6 @@ model MitmachWoche {
}

model PrototypeThreadStatus {
threadId String @db.VarChar(24) @id
status String @db.VarChar(24)
}
threadId String @id @db.VarChar(24)
status String @db.VarChar(24)
}
8 changes: 1 addition & 7 deletions src/assets-webkit/styles/serlo-tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,6 @@
.serlo-solution-box {
@apply mx-side mb-block border-l-8 border-brand-200 py-2.5;
}
.serlo-styled-label {
@apply flex cursor-pointer items-center;
> div > * {
/* hacky selector */
@apply ml-2;
}
}
.serlo-image-centered {
@apply mb-block px-4 text-center;
}
Expand Down Expand Up @@ -194,6 +187,7 @@
@apply px-0;
}

& .serlo-spacing-fix,
& .serlo-important,
& .serlo-blockquote,
& .serlo-spoiler-body,
Expand Down
7 changes: 5 additions & 2 deletions src/components/comments/dropdown-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,13 @@ export function DropdownMenu({
)

function onLinkToComment() {
const isOnEntity = window.location.href.includes(entityId.toString())
const isOnEntity =
entityId && window.location.href.includes(entityId.toString())
onAnyClick()
if (isOnEntity) highlight(id)
history.replaceState(null, '', `/${entityId}/#comment-${id}`)
if (entityId) {
history.replaceState(null, '', `/${entityId}/#comment-${id}`)
}
copyToClipboad(window.location.href)
showToastNotice('👌 ' + strings.share.copySuccess, 'success')
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/content/box.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FrontendBoxNode } from '@/frontend-node-types'
import { RenderNestedFunction } from '@/schema/article-renderer'
import { Renderer } from '@/serlo-editor/plugins/box/renderer'
import { BoxRenderer } from '@/serlo-editor/plugins/box/renderer'

type BoxProps = FrontendBoxNode & { renderNested: RenderNestedFunction }

Expand All @@ -17,7 +17,7 @@ export function Box({
const unwrappedTitle = title?.[0].children

return (
<Renderer
<BoxRenderer
boxType={boxType}
title={
unwrappedTitle ? (
Expand All @@ -27,6 +27,6 @@ export function Box({
anchorId={anchorId}
>
<>{content}</>
</Renderer>
</BoxRenderer>
)
}
2 changes: 1 addition & 1 deletion src/components/content/exercises/sc-mc-exercise.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { RenderNestedFunction } from '@/schema/article-renderer'
import {
ScMcExerciseRenderer,
ScMcExerciseRendererAnswer,
} from '@/serlo-editor/plugins/sc-mc-exercise/renderer/renderer'
} from '@/serlo-editor/plugins/sc-mc-exercise/renderer'

export interface ScMcExerciseProps {
state: EditorPluginScMcExercise['state']
Expand Down
2 changes: 1 addition & 1 deletion src/components/frontend-client-base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export function FrontendClientBase({
<PrintMode />
<AuthProvider unauthenticatedAuthorizationPayload={authorization}>
<LoggedInDataProvider value={loggedInData}>
<EntityIdProvider value={entityId || null}>
<EntityIdProvider value={entityId}>
<ConditionalWrap
condition={!noHeaderFooter}
wrapper={(kids) => <HeaderFooter>{kids}</HeaderFooter>}
Expand Down
1 change: 1 addition & 0 deletions src/components/modal-with-close-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function ModalWithCloseButton({
cursor-pointer rounded-full border-none bg-transparent text-center
leading-tight text-almost-black hover:bg-brand hover:text-white
`}
data-qa="modal-close-button"
>
<FaIcon icon={faXmark} className="h-5" />
</button>
Expand Down
21 changes: 21 additions & 0 deletions src/components/user/profile-experimental.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ export const features = {
activeInDev: true,
hideInProduction: true,
},
editorAnchorLinkCopyTool: {
cookieName: 'useEditorAnchorLinkCopyTool',
isActive: false,
activeInDev: true,
hideInProduction: true,
},
legacyDesign: {
cookieName: 'useFrontend',
isActive: false,
Expand Down Expand Up @@ -88,6 +94,21 @@ export function ProfileExperimental() {
</div>
)}
<hr className="mx-side -mt-2 mb-4" />
{features.editorAnchorLinkCopyTool && (
<div>
<h3 className="serlo-h3 mb-3">
{renderFeatureButton('editorAnchorLinkCopyTool')} Editor: Anker-Link
Tool
</h3>
<p className="serlo-p">
Ein neues Tool in der Editor-Toolbar um direkt Anker-Links auf
Editor-Plugins in die Zwischenablage zu kopieren. Wichtig:
Funktioniert nur, wenn der Inhalt ab Juli 2023 eine neue Revision
erhalten hat.
</p>
</div>
)}
<hr className="mx-side -mt-2 mb-4" />
{features.legacyDesign && (
<div>
<h3 className="serlo-h3 mb-3">
Expand Down
4 changes: 2 additions & 2 deletions src/contexts/entity-id-context.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { createContext, useContext } from 'react'

export const EntityIdContext = createContext<number | null>(null)
export const EntityIdContext = createContext<number | undefined | null>(null)

export const EntityIdProvider = EntityIdContext.Provider

export function useEntityId() {
const data = useContext(EntityIdContext)
if (!data) {
if (data === null) {
throw new Error('Attempt to use entityId outside of provider!')
}
return data
Expand Down
22 changes: 14 additions & 8 deletions src/data/de/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -602,13 +602,14 @@ export const loggedInData = {
anchor: {
title: "Sprungmarke",
description: "Füge eine Sprungmarke innerhalb deines Inhalts hinzu.",
identifier: "Name",
identifier: "Ziel-Name (z.B. \"lange-erlaerung\")",
anchorId: "Name der Sprungmarke"
},
box: {
title: "Box",
description: "Ein Rahmen für Beispiele, Zitate, Warnungen, Beweise (math.), …",
type: "Art der Box",
typeTooltip: "Wähle die Art der Box",
titlePlaceholder: "(optionaler Titel)",
anchorId: "Sprungmarke (anchor id)",
emptyContentWarning: "Boxen ohne Inhalt werden nicht angezeigt"
Expand Down Expand Up @@ -644,6 +645,7 @@ export const loggedInData = {
geogebra: {
title: 'GeoGebra Applet',
description: "Binde Applets von GeoGebra Materials via Link oder ID ein.",
chooseApplet: "Applet auswählen",
urlOrId: "GeoGebra Materials URL oder ID"
},
highlight: {
Expand All @@ -652,13 +654,14 @@ export const loggedInData = {
clickAndEnter: "Klicke hier und füge deinen Quellcode ein…",
enterHere: "Füge hier deinen Quellcode ein. Verlasse den Bereich, um eine Vorschau zu sehen.",
language: "Programmiersprache",
enterLanguage: "Programmiersprache eingeben",
showLineNumbers: "Zeilennummern anzeigen"
languageTooltip: "Wähle die Sprache für's Syntax-Highlighting",
showLineNumbers: "Zeilennummern",
lineNumbersTooltip: "Sollten die Besucher*innen Zeilennummern sehen?"
},
image: {
title: "Bild",
description: "Lade Bilder hoch oder verwende Bilder, die bereits online sind.",
upload: "Hochladen",
upload: "Hochladen",
imageUrl: "Bild-URL",
placeholderEmpty: 'https://example.com/image.png',
placeholderUploading: "Wird hochgeladen …",
Expand All @@ -678,7 +681,7 @@ export const loggedInData = {
description: "Binde einen Inhalt von serlo.org via ID ein.",
illegalInjectionFound: "Ungültige Injection gefunden",
serloEntitySrc: "Serlo Inhalt {{src}}",
serloId: "Serlo ID",
serloId: 'Serlo ID',
placeholder: "Serlo ID (z.B. 1565)"
},
layout: {
Expand Down Expand Up @@ -718,6 +721,7 @@ export const loggedInData = {
title: "Zeilen",
searchForTools: "Suche hier nach Tools…",
duplicate: "Duplizieren",
copyAnchorLink: "Link zu diesem Element kopieren",
remove: "Löschen",
close: "Schließen",
dragElement: "Verschiebe das Element innerhalb des Dokuments",
Expand Down Expand Up @@ -783,6 +787,7 @@ export const loggedInData = {
formula: "[neue Formel]",
visual: "visuell",
latex: 'LaTeX',
latexEditorTitle: "LaTeX-Editor",
onlyLatex: "Nur LaTeX verfügbar",
shortcuts: "Tastenkürzel",
fraction: "Bruch",
Expand All @@ -798,9 +803,9 @@ export const loggedInData = {
},
video: {
title: 'Video',
decription: "Binde Videos von YouTube, Vimeo, Wikimedia Commons oder BR ein.",
description: "Binde Videos von YouTube, Vimeo, Wikimedia Commons oder BR ein.",
videoUrl: 'Video URL',
description: "Beschreibung",
videoDescription: "Beschreibung",
titlePlaceholder: "Titel",
url: 'URL',
seoTitle: "Titel für Suchmaschinen"
Expand Down Expand Up @@ -951,7 +956,8 @@ export const loggedInData = {
current: "Aktuell",
author: "Verfasser",
createdAt: "Zeitstempel",
ready: "Bereit zum Speichern?"
ready: "Bereit zum Speichern?",
anchorLinkWarning: "Dieser Link funktioniert nur im Frontend und für Inhalte, die eine etwas relativ neue akzeptierte Bearbeitung haben."
},
taxonomy: {
title: "Titel"
Expand Down
20 changes: 13 additions & 7 deletions src/data/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -670,14 +670,15 @@ export const loggedInData = {
anchor: {
title: 'Anchor',
description: 'Insert an anchor.',
identifier: 'Identifier',
identifier: 'Identifier (e.g. "long-explanation")',
anchorId: 'ID of the anchor',
},
box: {
title: 'Container',
description:
'A container for examples, quotes, warnings, theorems, notes…',
type: 'Type of box',
typeTooltip: 'Choose the type of the box',
titlePlaceholder: '(optional title)',
anchorId: 'Anchor ID',
emptyContentWarning: 'Boxes without content will not be displayed',
Expand Down Expand Up @@ -715,6 +716,7 @@ export const loggedInData = {
geogebra: {
title: 'GeoGebra Applet',
description: 'Embed GeoGebra Materials applets via URL or ID.',
chooseApplet: 'Choose Applet',
urlOrId: 'GeoGebra URL or ID',
},
highlight: {
Expand All @@ -723,13 +725,14 @@ export const loggedInData = {
clickAndEnter: 'Click here and enter your source code…',
enterHere: 'Enter your source code here',
language: 'Language',
enterLanguage: 'Enter language',
showLineNumbers: 'Show line numbers',
languageTooltip: 'Choose language for syntax highlighting',
showLineNumbers: 'Line numbers',
lineNumbersTooltip: 'Should users see line numbers?',
},
image: {
title: 'Image',
description: 'Upload images.',
upload: 'Upload',
upload: 'Upload',
imageUrl: 'Image URL',
placeholderEmpty: 'https://example.com/image.png',
placeholderUploading: 'Uploading…',
Expand All @@ -749,7 +752,7 @@ export const loggedInData = {
description: 'Embed serlo.org content via their ID.',
illegalInjectionFound: 'Illegal injection found',
serloEntitySrc: 'Serlo entity {{src}}',
serloId: 'Serlo ID:',
serloId: 'Serlo ID',
placeholder: 'Serlo ID (e.g. 1565)',
},
layout: {
Expand Down Expand Up @@ -792,6 +795,7 @@ export const loggedInData = {
title: 'Rows',
searchForTools: 'Search for tools…',
duplicate: 'Duplicate',
copyAnchorLink: "Copy link to this element",
remove: 'Remove',
close: 'Close',
dragElement: 'Drag the element within the document',
Expand Down Expand Up @@ -859,6 +863,7 @@ export const loggedInData = {
formula: '[formula]',
visual: 'visual',
latex: 'LaTeX',
latexEditorTitle: 'LaTeX editor',
onlyLatex: 'Only LaTeX editor available',
shortcuts: 'Shortcuts',
fraction: 'Fraction',
Expand All @@ -874,9 +879,9 @@ export const loggedInData = {
},
video: {
title: 'Video',
decription: 'Embed YouTube, Vimeo, Wikimedia Commons or BR videos.',
description: 'Embed YouTube, Vimeo, Wikimedia Commons or BR videos.',
videoUrl: 'Video URL',
description: 'Description',
videoDescription: 'Description',
titlePlaceholder: 'Title',
url: 'URL',
seoTitle: 'Title for search engines',
Expand Down Expand Up @@ -1038,6 +1043,7 @@ export const loggedInData = {
author: 'Author',
createdAt: 'when?',
ready: 'Ready to save?',
anchorLinkWarning: 'This link will only work in the frontend and for content that has a somewhat new revision.',
},
taxonomy: {
title: 'Title',
Expand Down
Loading

1 comment on commit f9154ae

@vercel
Copy link

@vercel vercel bot commented on f9154ae Aug 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

frontend – ./

frontend-git-production-serlo.vercel.app
frontend-serlo.vercel.app
frontend.serlo.org

Please sign in to comment.