Skip to content

Commit

Permalink
Merge pull request #1297 from geichelberger/vite-base
Browse files Browse the repository at this point in the history
Set vite base
  • Loading branch information
KatrinIhler authored Apr 16, 2024
2 parents 9acd178 + eba0cd4 commit c84a20e
Show file tree
Hide file tree
Showing 8 changed files with 232 additions and 6 deletions.
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
}
]
}
]
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
4 changes: 2 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export const init = async () => {
const loadContextSettings = async () => {

// Try to retrieve the context settings.
let basepath = import.meta.env.PUBLIC_URL || "/";
let basepath = import.meta.env.BASE_URL || "/";
if (!basepath.endsWith("/")) {
basepath += "/";
}
Expand All @@ -190,7 +190,7 @@ const loadContextSettings = async () => {
// server root.
const settingsPath = import.meta.env.VITE_APP_SETTINGS_PATH || CONTEXT_SETTINGS_FILE;
const base = settingsPath.startsWith("/") ? "" : basepath;
const url = `${window.location.origin}${base}${settingsPath}`;
const url = new URL(base.concat(settingsPath), window.location.origin);
let response;
try {
response = await fetch(url);
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import i18next, { InitOptions } from "i18next";
import { initReactI18next } from "react-i18next";
import LanguageDetector from "i18next-browser-languagedetector";

import locales from "./locales/locales.json";
import locales from "./locales.json";

const debug = Boolean(new URLSearchParams(window.location.search).get("debug"));

Expand Down
9 changes: 9 additions & 0 deletions src/i18n/locales.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
"de-DE.json",
"en-US.json",
"es-ES.json",
"fr-FR.json",
"nl-NL.json",
"zh-CN.json",
"zh-TW.json"
]
1 change: 0 additions & 1 deletion src/i18n/locales/locales.json

This file was deleted.

2 changes: 1 addition & 1 deletion tests/metadata.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ test.describe('Test Metadata-Page', () => {
});

const input = ['title', 'subject', 'rightsHolder', 'duration', 'location', 'source'];
const iValue = ['Dual-Stream Demo', '', '', '00:00:00', '', ''];
const iValue = ['Dual-Stream Demo', '', '', '00:01:04', '', ''];
const iFill = ['Test-Title', 'Test-Subject', 'Test-Rights', '00:02:45', 'Test-Location', 'Test-Source'];

const dropdown = ['language', 'license', 'isPartOf', 'creator', 'contributor'];
Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const commitHash = child.execSync("git rev-parse HEAD").toString().trim();
// https://vitejs.dev/config/
export default defineConfig(() => {
return {
base: process.env.PUBLIC_URL || "",
server: {
open: true,
},
Expand Down

0 comments on commit c84a20e

Please sign in to comment.