Skip to content

Commit 42668f5

Browse files
committed
Merge branch 'more-text-for-embed-modal' of Arnei/opencast-admin-interface into r/17.x
Pull request #1391 Fixes #1272 More explanations for embedd modal
2 parents 75453f8 + df05d66 commit 42668f5

2 files changed

Lines changed: 32 additions & 5 deletions

File tree

src/components/events/partials/modals/EmbeddingCodeModal.tsx

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useTranslation } from "react-i18next";
33
import { getSourceURL } from "../../../../utils/embeddedCodeUtils";
44
import ButtonLikeAnchor from "../../../shared/ButtonLikeAnchor";
55
import BaseButton from "../../../shared/BaseButton";
6+
import { ParseKeys } from "i18next";
67

78
/**
89
* This component renders the embedding code modal
@@ -82,39 +83,56 @@ const EmbeddingCodeModal = ({
8283
return (
8384
<>
8485
{/* embed size buttons */}
86+
<div className="list-obj">
87+
<div className="obj-container">
88+
<span>
89+
{t("EMBEDDING_CODE.DESCRIPTION")}
90+
</span>
91+
</div>
92+
</div>
8593
<div className="embedded-code-boxes">
8694
<ButtonLikeAnchor
8795
id="620x349"
8896
className="embedSizeButton size_620x349"
89-
onClick={(e) => updateTextArea(e)}
97+
onClick={e => updateTextArea(e)}
98+
tooltipText={t("EMBEDDING_CODE.GENERATE_TOOLTIP", { size: "620x349" }) as ParseKeys}
99+
aria-label={t("EMBEDDING_CODE.GENERATE_TOOLTIP", { size: "620x349" }) as ParseKeys}
90100
>
91101
<span className="span-embedded-code">620x349</span>
92102
</ButtonLikeAnchor>
93103
<ButtonLikeAnchor
94104
id="540x304"
95105
className="embedSizeButton size_540x304"
96-
onClick={(e) => updateTextArea(e)}
106+
onClick={e => updateTextArea(e)}
107+
tooltipText={t("EMBEDDING_CODE.GENERATE_TOOLTIP", { size: "540x304" }) as ParseKeys}
108+
aria-label={t("EMBEDDING_CODE.GENERATE_TOOLTIP", { size: "540x304" }) as ParseKeys}
97109
>
98110
<span className="span-embedded-code">540x304</span>
99111
</ButtonLikeAnchor>
100112
<ButtonLikeAnchor
101113
id="460x259"
102114
className="embedSizeButton size_460x259"
103-
onClick={(e) => updateTextArea(e)}
115+
onClick={e => updateTextArea(e)}
116+
tooltipText={t("EMBEDDING_CODE.GENERATE_TOOLTIP", { size: "460x259" }) as ParseKeys}
117+
aria-label={t("EMBEDDING_CODE.GENERATE_TOOLTIP", { size: "460x259" }) as ParseKeys}
104118
>
105119
<span className="span-embedded-code">460x259</span>
106120
</ButtonLikeAnchor>
107121
<ButtonLikeAnchor
108122
id="380x214"
109123
className="embedSizeButton size_380x214"
110-
onClick={(e) => updateTextArea(e)}
124+
onClick={e => updateTextArea(e)}
125+
tooltipText={t("EMBEDDING_CODE.GENERATE_TOOLTIP", { size: "380x214" }) as ParseKeys}
126+
aria-label={t("EMBEDDING_CODE.GENERATE_TOOLTIP", { size: "380x214" }) as ParseKeys}
111127
>
112128
<span className="span-embedded-code">380x214</span>
113129
</ButtonLikeAnchor>
114130
<ButtonLikeAnchor
115131
id="300x169"
116132
className="embedSizeButton size_300x169"
117-
onClick={(e) => updateTextArea(e)}
133+
onClick={e => updateTextArea(e)}
134+
tooltipText={t("EMBEDDING_CODE.GENERATE_TOOLTIP", { size: "300x169" }) as ParseKeys}
135+
aria-label={t("EMBEDDING_CODE.GENERATE_TOOLTIP", { size: "300x169" }) as ParseKeys}
118136
>
119137
<span className="span-embedded-code">300x169</span>
120138
</ButtonLikeAnchor>
@@ -132,6 +150,7 @@ const EmbeddingCodeModal = ({
132150
rows={2}
133151
value={textAreaContent}
134152
cols={1}
153+
aria-label={t("EMBEDDING_CODE.EMBEDD_CODE_TEXTAREA_ARIA")}
135154
/>
136155
</div>
137156

@@ -151,6 +170,8 @@ const EmbeddingCodeModal = ({
151170
className="cancel-btn"
152171
style={{ fontSize: "14px" }}
153172
onClick={() => copy()}
173+
tooltipText="EMBEDDING_CODE.COPY_BUTTON_TOOLTIP"
174+
aria-label={t("EMBEDDING_CODE.COPY_BUTTON_TOOLTIP")}
154175
>
155176
{t("COPY")}
156177
</BaseButton>

src/i18n/org/opencastproject/adminui/languages/lang-en_US.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@
153153
"HOTKEY_CHEAT_SHEET": "Keyboard Shortcuts",
154154
"ADOPTER_REGISTRATION": "Adopter Registration"
155155
},
156+
"EMBEDDING_CODE": {
157+
"DESCRIPTION": "Generate an embed code of the desired size by clicking on the respective button",
158+
"GENERATE_TOOLTIP": "Generate an embed code of size {{ size }}",
159+
"EMBEDD_CODE_TEXTAREA_ARIA": "This text field holds a generated embed code for copying.",
160+
"COPY_BUTTON_TOOLTIP": "Copies a generated embed code to your clipboard."
161+
},
156162
"NOTIFICATIONS": {
157163
"ACL_ADDED": "The access policy has been created",
158164
"ACL_NOT_SAVED": "The access policy could not be saved",

0 commit comments

Comments
 (0)