Skip to content

Commit

Permalink
Merge branch 'main' into dont-show-track-selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnei committed May 14, 2024
2 parents 58553e6 + 813a1ab commit 48c70df
Show file tree
Hide file tree
Showing 68 changed files with 9,416 additions and 15,703 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.dockerignore
.git/
.github/
build/
Dockerfile
node_modules/
5 changes: 0 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
module.exports = {
extends: [
"@opencast/eslint-config-ts-react",
"react-app/jest",
],
rules: {
// Currently 120 warnings.
"@typescript-eslint/no-explicit-any": "off",
},
overrides: [
{
files: ["./*.js"],
Expand Down
2 changes: 1 addition & 1 deletion .github/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Build integrated version
rm -rf build/
export PUBLIC_URL=/editor-ui
export REACT_APP_SETTINGS_PATH="/ui/config/editor/editor-settings.toml"
export VITE_APP_SETTINGS_PATH="/ui/config/editor/editor-settings.toml"
npm run build

FILENAME="oc-editor-$(date --utc +%F).tar.gz"
Expand Down
42 changes: 42 additions & 0 deletions .github/generate-lngs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

declare -A country_language_map
declare -a order

# Loop through each file in the directory
for file in ??-??.json; do
if [ -f "$file" ]; then
# Extract country name and language code from the filename
country=$(basename "$file" .json | cut -d '-' -f 1)
language_code=$(basename "$file" .json)

if [ ! "${country_language_map[$country]}" ]; then
order+=("$country")
fi

# Check if the country already exists in the map
if [ -n "${country_language_map[$country]}" ]; then
country_language_map["$country"]+=" $language_code"
else
country_language_map["$country"]="$language_code"
fi
fi
done

echo "export const languages = new Map<string, string>(["
# Print the country-language mappings
for i in "${!order[@]}"; do
country=${order[$i]}
languages=()
for language in ${country_language_map[$country]}; do
languages+=("$language")
done
if [ ${#languages[@]} -eq 1 ]; then
echo " [\"$country\", \"${languages[0]}\"],"
else
for language in "${languages[@]}"; do
echo " [\"$language\", \"$language\"],"
done
fi
done
echo "]);"
218 changes: 217 additions & 1 deletion .github/mock/editor/ID-dual-stream-demo/metadata.json
Original file line number Diff line number Diff line change
@@ -1 +1,217 @@
[{"flavor":"dublincore\/episode","title":"EVENTS.EVENTS.DETAILS.CATALOG.EPISODE","fields":[{"readOnly":false,"id":"title","label":"EVENTS.EVENTS.DETAILS.METADATA.TITLE","type":"text","value":"Dual-Stream Demo","required":true},{"readOnly":false,"id":"subject","label":"EVENTS.EVENTS.DETAILS.METADATA.SUBJECT","type":"text","value":"","required":false},{"readOnly":false,"id":"description","label":"EVENTS.EVENTS.DETAILS.METADATA.DESCRIPTION","type":"text_long","value":"","required":false},{"translatable":true,"readOnly":false,"id":"language","label":"EVENTS.EVENTS.DETAILS.METADATA.LANGUAGE","collection":{"LANGUAGES.SLOVENIAN":"slv","LANGUAGES.PORTUGUESE":"por","LANGUAGES.ROMANSH":"roh","LANGUAGES.ARABIC":"ara","LANGUAGES.POLISH":"pol","LANGUAGES.ITALIAN":"ita","LANGUAGES.CHINESE":"zho","LANGUAGES.FINNISH":"fin","LANGUAGES.DANISH":"dan","LANGUAGES.UKRAINIAN":"ukr","LANGUAGES.FRENCH":"fra","LANGUAGES.SPANISH":"spa","LANGUAGES.GERMAN_CH":"gsw","LANGUAGES.NORWEGIAN":"nor","LANGUAGES.RUSSIAN":"rus","LANGUAGES.JAPANESE":"jpx","LANGUAGES.DUTCH":"nld","LANGUAGES.TURKISH":"tur","LANGUAGES.HINDI":"hin","LANGUAGES.SWEDISH":"swa","LANGUAGES.ENGLISH":"eng","LANGUAGES.GERMAN":"deu"},"type":"text","value":"","required":false},{"readOnly":false,"id":"rightsHolder","label":"EVENTS.EVENTS.DETAILS.METADATA.RIGHTS","type":"text","value":"","required":false},{"translatable":true,"readOnly":false,"id":"license","label":"EVENTS.EVENTS.DETAILS.METADATA.LICENSE","collection":{"{\"label\":\"EVENTS.LICENSE.CC0\", \"order\":8, \"selectable\": true}":"CC0","{\"label\":\"EVENTS.LICENSE.CCBYND\", \"order\":4, \"selectable\": true}":"CC-BY-ND","{\"label\":\"EVENTS.LICENSE.CCBYNCND\", \"order\":7, \"selectable\": true}":"CC-BY-NC-ND","{\"label\":\"EVENTS.LICENSE.CCBYNCSA\", \"order\":6, \"selectable\": true}":"CC-BY-NC-SA","{\"label\":\"EVENTS.LICENSE.ALLRIGHTS\", \"order\":1, \"selectable\": true}":"ALLRIGHTS","{\"label\":\"EVENTS.LICENSE.CCBYSA\", \"order\":3, \"selectable\": true}":"CC-BY-SA","{\"label\":\"EVENTS.LICENSE.CCBYNC\", \"order\":5, \"selectable\": true}":"CC-BY-NC","{\"label\":\"EVENTS.LICENSE.CCBY\", \"order\":2, \"selectable\": true}":"CC-BY"},"type":"ordered_text","value":"CC-BY-SA","required":false},{"translatable":false,"readOnly":false,"id":"isPartOf","label":"EVENTS.EVENTS.DETAILS.METADATA.SERIES","collection":{"Wiki Commons Content":"ID-wiki-commons","AV-Portal Content":"ID-av-portal","Open Media for Opencast":"ID-openmedia-opencast","Blender Foundation Productions":"ID-blender-foundation"},"type":"text","value":"","required":false},{"translatable":false,"readOnly":false,"id":"creator","label":"EVENTS.EVENTS.DETAILS.METADATA.PRESENTERS","collection":{"NASA Johnson":"NASA Johnson","NASA":"NASA","Rosatrieu":"Rosatrieu","I. Elgamal":"I. Elgamal","TIB AV-Portal Hannover":"TIB AV-Portal Hannover","Wiki Commons":"Wiki Commons","Lars Kiesow":"Lars Kiesow","Andy Goralczyk":"Andy Goralczyk","Olaf Schulte":"Olaf Schulte","Administrator":"Administrator","Nature Stock Videos":"Nature Stock Videos","Capture Agent":"Capture Agent","Blender Foundation":"Blender Foundation","Pixabay":"Pixabay","System User":"System User"},"type":"mixed_text","value":["Lars Kiesow"],"required":false},{"translatable":false,"readOnly":false,"id":"contributor","label":"EVENTS.EVENTS.DETAILS.METADATA.CONTRIBUTORS","collection":{"NASA Johnson":"NASA Johnson","NASA":"NASA","Rosatrieu":"Rosatrieu","I. Elgamal":"I. Elgamal","TIB AV-Portal Hannover":"TIB AV-Portal Hannover","Wiki Commons":"Wiki Commons","Lars Kiesow":"Lars Kiesow","Andy Goralczyk":"Andy Goralczyk","Olaf Schulte":"Olaf Schulte","Administrator":"Administrator","Nature Stock Videos":"Nature Stock Videos","Capture Agent":"Capture Agent","Blender Foundation":"Blender Foundation","Pixabay":"Pixabay","System User":"System User"},"type":"mixed_text","value":[],"required":false},{"readOnly":false,"id":"startDate","label":"EVENTS.EVENTS.DETAILS.METADATA.START_DATE","type":"date","value":"2022-02-03T01:02:00.000Z","required":false},{"readOnly":false,"id":"duration","label":"EVENTS.EVENTS.DETAILS.METADATA.DURATION","type":"text","value":"00:00:00","required":false},{"readOnly":false,"id":"location","label":"EVENTS.EVENTS.DETAILS.METADATA.LOCATION","type":"text","value":"","required":false},{"readOnly":false,"id":"source","label":"EVENTS.EVENTS.DETAILS.METADATA.SOURCE","type":"text","value":"","required":false},{"readOnly":true,"id":"created","label":"EVENTS.EVENTS.DETAILS.METADATA.CREATED","type":"date","value":"2022-02-03T01:02:00.000Z","required":false},{"readOnly":true,"id":"publisher","label":"EVENTS.EVENTS.DETAILS.METADATA.PUBLISHER","type":"text","value":"","required":false},{"readOnly":true,"id":"identifier","label":"EVENTS.EVENTS.DETAILS.METADATA.ID","type":"text","value":"ID-dual-stream-demo","required":false}]}]
[
{
"flavor": "dublincore\/episode",
"title": "EVENTS.EVENTS.DETAILS.CATALOG.EPISODE",
"fields": [
{
"readOnly": false,
"id": "title",
"label": "EVENTS.EVENTS.DETAILS.METADATA.TITLE",
"type": "text",
"value": "Dual-Stream Demo",
"required": true
},
{
"readOnly": false,
"id": "subject",
"label": "EVENTS.EVENTS.DETAILS.METADATA.SUBJECT",
"type": "text",
"value": "",
"required": false
},
{
"readOnly": false,
"id": "description",
"label": "EVENTS.EVENTS.DETAILS.METADATA.DESCRIPTION",
"type": "text_long",
"value": "",
"required": false
},
{
"translatable": true,
"readOnly": false,
"id": "language",
"label": "EVENTS.EVENTS.DETAILS.METADATA.LANGUAGE",
"collection": {
"LANGUAGES.SLOVENIAN": "slv",
"LANGUAGES.PORTUGUESE": "por",
"LANGUAGES.ROMANSH": "roh",
"LANGUAGES.ARABIC": "ara",
"LANGUAGES.POLISH": "pol",
"LANGUAGES.ITALIAN": "ita",
"LANGUAGES.CHINESE": "zho",
"LANGUAGES.FINNISH": "fin",
"LANGUAGES.DANISH": "dan",
"LANGUAGES.UKRAINIAN": "ukr",
"LANGUAGES.FRENCH": "fra",
"LANGUAGES.SPANISH": "spa",
"LANGUAGES.GERMAN_CH": "gsw",
"LANGUAGES.NORWEGIAN": "nor",
"LANGUAGES.RUSSIAN": "rus",
"LANGUAGES.JAPANESE": "jpx",
"LANGUAGES.DUTCH": "nld",
"LANGUAGES.TURKISH": "tur",
"LANGUAGES.HINDI": "hin",
"LANGUAGES.SWEDISH": "swa",
"LANGUAGES.ENGLISH": "eng",
"LANGUAGES.GERMAN": "deu"
},
"type": "text",
"value": "",
"required": false
},
{
"readOnly": false,
"id": "rightsHolder",
"label": "EVENTS.EVENTS.DETAILS.METADATA.RIGHTS",
"type": "text",
"value": "",
"required": false
},
{
"translatable": true,
"readOnly": false,
"id": "license",
"label": "EVENTS.EVENTS.DETAILS.METADATA.LICENSE",
"collection": {
"{\"label\":\"EVENTS.LICENSE.CC0\", \"order\":8, \"selectable\": true}": "CC0",
"{\"label\":\"EVENTS.LICENSE.CCBYND\", \"order\":4, \"selectable\": true}": "CC-BY-ND",
"{\"label\":\"EVENTS.LICENSE.CCBYNCND\", \"order\":7, \"selectable\": true}": "CC-BY-NC-ND",
"{\"label\":\"EVENTS.LICENSE.CCBYNCSA\", \"order\":6, \"selectable\": true}": "CC-BY-NC-SA",
"{\"label\":\"EVENTS.LICENSE.ALLRIGHTS\", \"order\":1, \"selectable\": true}": "ALLRIGHTS",
"{\"label\":\"EVENTS.LICENSE.CCBYSA\", \"order\":3, \"selectable\": true}": "CC-BY-SA",
"{\"label\":\"EVENTS.LICENSE.CCBYNC\", \"order\":5, \"selectable\": true}": "CC-BY-NC",
"{\"label\":\"EVENTS.LICENSE.CCBY\", \"order\":2, \"selectable\": true}": "CC-BY"
},
"type": "ordered_text",
"value": "CC-BY-SA",
"required": false
},
{
"translatable": false,
"readOnly": false,
"id": "isPartOf",
"label": "EVENTS.EVENTS.DETAILS.METADATA.SERIES",
"collection": {
"Wiki Commons Content": "ID-wiki-commons",
"AV-Portal Content": "ID-av-portal",
"Open Media for Opencast": "ID-openmedia-opencast",
"Blender Foundation Productions": "ID-blender-foundation"
},
"type": "text",
"value": "",
"required": false
},
{
"translatable": false,
"readOnly": false,
"id": "creator",
"label": "EVENTS.EVENTS.DETAILS.METADATA.PRESENTERS",
"collection": {
"NASA Johnson": "NASA Johnson",
"NASA": "NASA",
"Rosatrieu": "Rosatrieu",
"I. Elgamal": "I. Elgamal",
"TIB AV-Portal Hannover": "TIB AV-Portal Hannover",
"Wiki Commons": "Wiki Commons",
"Lars Kiesow": "Lars Kiesow",
"Andy Goralczyk": "Andy Goralczyk",
"Olaf Schulte": "Olaf Schulte",
"Administrator": "Administrator",
"Nature Stock Videos": "Nature Stock Videos",
"Capture Agent": "Capture Agent",
"Blender Foundation": "Blender Foundation",
"Pixabay": "Pixabay",
"System User": "System User"
},
"type": "mixed_text",
"value": [
"Lars Kiesow"
],
"required": false
},
{
"translatable": false,
"readOnly": false,
"id": "contributor",
"label": "EVENTS.EVENTS.DETAILS.METADATA.CONTRIBUTORS",
"collection": {
"NASA Johnson": "NASA Johnson",
"NASA": "NASA",
"Rosatrieu": "Rosatrieu",
"I. Elgamal": "I. Elgamal",
"TIB AV-Portal Hannover": "TIB AV-Portal Hannover",
"Wiki Commons": "Wiki Commons",
"Lars Kiesow": "Lars Kiesow",
"Andy Goralczyk": "Andy Goralczyk",
"Olaf Schulte": "Olaf Schulte",
"Administrator": "Administrator",
"Nature Stock Videos": "Nature Stock Videos",
"Capture Agent": "Capture Agent",
"Blender Foundation": "Blender Foundation",
"Pixabay": "Pixabay",
"System User": "System User"
},
"type": "mixed_text",
"value": [],
"required": false
},
{
"readOnly": false,
"id": "startDate",
"label": "EVENTS.EVENTS.DETAILS.METADATA.START_DATE",
"type": "date",
"value": "2022-02-03T01:02:00.000Z",
"required": false
},
{
"readOnly": false,
"id": "duration",
"label": "EVENTS.EVENTS.DETAILS.METADATA.DURATION",
"type": "text",
"value": "00:01:04",
"required": false
},
{
"readOnly": false,
"id": "location",
"label": "EVENTS.EVENTS.DETAILS.METADATA.LOCATION",
"type": "text",
"value": "",
"required": false
},
{
"readOnly": false,
"id": "source",
"label": "EVENTS.EVENTS.DETAILS.METADATA.SOURCE",
"type": "text",
"value": "",
"required": false
},
{
"readOnly": true,
"id": "created",
"label": "EVENTS.EVENTS.DETAILS.METADATA.CREATED",
"type": "date",
"value": "2022-02-03T01:02:00.000Z",
"required": false
},
{
"readOnly": true,
"id": "publisher",
"label": "EVENTS.EVENTS.DETAILS.METADATA.PUBLISHER",
"type": "text",
"value": "",
"required": false
},
{
"readOnly": true,
"id": "identifier",
"label": "EVENTS.EVENTS.DETAILS.METADATA.ID",
"type": "text",
"value": "ID-dual-stream-demo",
"required": false
}
]
}
]
3 changes: 2 additions & 1 deletion .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ changelog:
- title: New Features
labels:
- type:feature
- type:enhancement

- title: Usability and Accessibility
labels:
Expand All @@ -30,4 +31,4 @@ changelog:

- title: Other Changes
labels:
- "type:*"
- "*"
4 changes: 2 additions & 2 deletions .github/workflows/playwright-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Prepare configuration
run: >
sed -i
's_https://develop.opencast.org_http://localhost:3000_'
's_https://develop.opencast.org_http://localhost:5173_'
public/editor-settings.toml
- name: Prepare mock files
Expand All @@ -46,7 +46,7 @@ jobs:
cp public/editor-settings.toml build/
- name: Use production build for testing
run: sed -i 's/npm run start/python -m http.server --bind 127.0.0.1 --directory build 3000/' playwright.config.ts
run: sed -i 's/npm run start/python -m http.server --bind 127.0.0.1 --directory build 5173/' playwright.config.ts

- name: Run playwright-test
run: npx playwright test --config=playwright.config.ts
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/update-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ jobs:
- name: update language list
working-directory: src/i18n/locales
run: |
echo -n '[ "' > locales.json
echo -n ??-??.json | sed 's/ */", "/g' >> locales.json
echo '" ]' >> locales.json
run: $GITHUB_WORKSPACE/.github/generate-lngs.sh > ../lngs-generated.ts

- name: upload translations
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

# testing
/coverage
/playwright-report

# production
/build
Expand Down
Loading

0 comments on commit 48c70df

Please sign in to comment.