From c7da267d06a03bd4045e45c3e1ce5baca0fdcbf6 Mon Sep 17 00:00:00 2001 From: Henrik Nygren Date: Mon, 9 Sep 2024 15:58:15 +0300 Subject: [PATCH] Fixes 4422 (#1310) * Disable ligatures in more places * Make instructions box easier to edit * Remove accessibility link from thinglink * Edit exam - fix related courses can be completed automatically checkbox --- .../InstructionBox/InstructionBoxEditor.tsx | 6 ++++-- .../core/embeds/variants/ThingLinkEmbedBlock.tsx | 15 --------------- .../CodeBlock/SyntaxHighlightedContainer.tsx | 1 + .../src/components/forms/EditExamForm.tsx | 1 + .../common/src/locales/en/course-material.json | 1 - .../common/src/locales/fi/course-material.json | 1 - .../packages/common/src/styles/GlobalStyles.tsx | 2 ++ 7 files changed, 8 insertions(+), 19 deletions(-) diff --git a/services/cms/src/blocks/InstructionBox/InstructionBoxEditor.tsx b/services/cms/src/blocks/InstructionBox/InstructionBoxEditor.tsx index ba21ccc77674..1c9f4a656e59 100644 --- a/services/cms/src/blocks/InstructionBox/InstructionBoxEditor.tsx +++ b/services/cms/src/blocks/InstructionBox/InstructionBoxEditor.tsx @@ -23,8 +23,10 @@ const InstructionBoxEditor: React.FC< `} > setAttributes({ content: value })} placeholder={"Write a text here"} diff --git a/services/course-material/src/components/ContentRenderer/core/embeds/variants/ThingLinkEmbedBlock.tsx b/services/course-material/src/components/ContentRenderer/core/embeds/variants/ThingLinkEmbedBlock.tsx index e2d135e5c530..059a0fbb6396 100644 --- a/services/course-material/src/components/ContentRenderer/core/embeds/variants/ThingLinkEmbedBlock.tsx +++ b/services/course-material/src/components/ContentRenderer/core/embeds/variants/ThingLinkEmbedBlock.tsx @@ -1,5 +1,4 @@ import { css } from "@emotion/css" -import { useTranslation } from "react-i18next" import { EmbedAttributes } from "../../../../../../types/GutenbergBlockAttributes" import { sanitizeCourseMaterialHtml } from "../../../../../utils/sanitizeCourseMaterialHtml" @@ -8,19 +7,10 @@ import BreakFromCentered from "@/shared-module/common/components/Centering/Break import { baseTheme } from "@/shared-module/common/styles/theme" const THINGLINK = "thinglink" -const GET_NUMERIC_ID_FROM_STRING_REGEX = /\/(\d+)/g export const ThingLinkEmbedBlock: React.FC< React.PropsWithChildren > = (props) => { - const { t } = useTranslation() - let id: string | null = null - - if (props.url) { - const groups = props.url.matchAll(GET_NUMERIC_ID_FROM_STRING_REGEX) - id = groups.next()?.value[1] - } - return (
)} - {id && ( - - {t("link-text-open-accessible-view-of-this-content")} - - )}
diff --git a/services/course-material/src/components/ContentRenderer/core/formatting/CodeBlock/SyntaxHighlightedContainer.tsx b/services/course-material/src/components/ContentRenderer/core/formatting/CodeBlock/SyntaxHighlightedContainer.tsx index 2fe3027b6538..212834bb37da 100644 --- a/services/course-material/src/components/ContentRenderer/core/formatting/CodeBlock/SyntaxHighlightedContainer.tsx +++ b/services/course-material/src/components/ContentRenderer/core/formatting/CodeBlock/SyntaxHighlightedContainer.tsx @@ -32,6 +32,7 @@ const SyntaxHighlightedContainer: React.FC = ({ background-color: #1a2333; border-radius: 4px; font-variant-ligatures: none; + font-feature-settings: "liga" 0; `} ref={ref} dangerouslySetInnerHTML={{ __html: sanitizeCourseMaterialHtml(replacedContent) }} diff --git a/services/main-frontend/src/components/forms/EditExamForm.tsx b/services/main-frontend/src/components/forms/EditExamForm.tsx index 84361459db4a..fa80b5bed992 100644 --- a/services/main-frontend/src/components/forms/EditExamForm.tsx +++ b/services/main-frontend/src/components/forms/EditExamForm.tsx @@ -97,6 +97,7 @@ const EditExamForm: React.FC> = ({ {...register("manualGradingEnabled")} /> diff --git a/shared-module/packages/common/src/locales/en/course-material.json b/shared-module/packages/common/src/locales/en/course-material.json index b20206a43736..0f9d75bf3285 100644 --- a/shared-module/packages/common/src/locales/en/course-material.json +++ b/shared-module/packages/common/src/locales/en/course-material.json @@ -114,7 +114,6 @@ "label-message": "Message", "label-name": "Name", "language-language": "Language: {{language}}", - "link-text-open-accessible-view-of-this-content": "Open an accessible view of this content.", "loading": "Loading", "map-disclaimer": "*On the map, you'll find the breakdown of students per country. Other students will only see the total student count for your country.", "map-instruction": "To begin, please your country of residence. Once you've made your selection, a map will display the countries where fellow students are living.", diff --git a/shared-module/packages/common/src/locales/fi/course-material.json b/shared-module/packages/common/src/locales/fi/course-material.json index 1a75de2e729f..ab8d1e8a0620 100644 --- a/shared-module/packages/common/src/locales/fi/course-material.json +++ b/shared-module/packages/common/src/locales/fi/course-material.json @@ -116,7 +116,6 @@ "label-message": "Viesti", "label-name": "Nimi", "language-language": "Kieli: {{language}}", - "link-text-open-accessible-view-of-this-content": "Avaa saavutettava näkymä tästä sisällöstä", "loading": "Lataa", "map-disclaimer": "*Kartalla näet opiskelijamäärät maakohtaisesti. Muut opiskelijat näkevät vain kuinka paljon maastasi on opiskelijoita yhteensä.", "map-instruction": "Valitse asuinmaasi aloittaaksesi. Kun olet tehnyt valintasi kartta näyttää maat, joissa muut opiskelijat asuvat.", diff --git a/shared-module/packages/common/src/styles/GlobalStyles.tsx b/shared-module/packages/common/src/styles/GlobalStyles.tsx index 2b7cc5ba3ab0..97cfe84021d2 100644 --- a/shared-module/packages/common/src/styles/GlobalStyles.tsx +++ b/shared-module/packages/common/src/styles/GlobalStyles.tsx @@ -64,6 +64,8 @@ const globalCss = css` kbd, tt { font-family: ${monospaceFont}; + font-variant-ligatures: none; + font-feature-settings: "liga" 0; } .screen-reader-only { position: absolute;