Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes 4422 #1310

Merged
merged 4 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ const InstructionBoxEditor: React.FC<
`}
>
<RichText
className="has-text-align-center wp-block-heading"
tagName="span"
className={css`
width: 100%;
`}
tagName="div"
value={content}
onChange={(value: string) => setAttributes({ content: value })}
placeholder={"Write a text here"}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { css } from "@emotion/css"
import { useTranslation } from "react-i18next"

import { EmbedAttributes } from "../../../../../../types/GutenbergBlockAttributes"
import { sanitizeCourseMaterialHtml } from "../../../../../utils/sanitizeCourseMaterialHtml"
Expand All @@ -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<EmbedAttributes & { dontAllowBlockToBeWiderThanContainerWidth: boolean }>
> = (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 (
<BreakFromCentered sidebar={false} disabled={props.dontAllowBlockToBeWiderThanContainerWidth}>
<figure
Expand Down Expand Up @@ -55,11 +45,6 @@ export const ThingLinkEmbedBlock: React.FC<
{props.caption && (
<div dangerouslySetInnerHTML={{ __html: sanitizeCourseMaterialHtml(props.caption) }} />
)}
{id && (
<a href={`https://www.thinglink.com/view/scene/${id}/accessibility`}>
{t("link-text-open-accessible-view-of-this-content")}
</a>
)}
</figcaption>
</figure>
</BreakFromCentered>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const SyntaxHighlightedContainer: React.FC<SyntaxHighlightedContainerProps> = ({
background-color: #1a2333;
border-radius: 4px;
font-variant-ligatures: none;
font-feature-settings: "liga" 0;
`}
ref={ref}
dangerouslySetInnerHTML={{ __html: sanitizeCourseMaterialHtml(replacedContent) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ const EditExamForm: React.FC<React.PropsWithChildren<EditExamFormProps>> = ({
{...register("manualGradingEnabled")}
/>
<CheckBox
defaultChecked={initialData?.minimum_points_treshold !== 0}
label={t("label-related-courses-can-be-completed-automatically")}
{...register("automaticCompletionEnabled")}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
2 changes: 2 additions & 0 deletions shared-module/packages/common/src/styles/GlobalStyles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading