Skip to content

Commit

Permalink
Add setting option for callback system name
Browse files Browse the repository at this point in the history
This allows to specify a system name to be displayed in the callback button instead of a generic name.
  • Loading branch information
Dennis Benz committed Sep 20, 2023
1 parent 4c8ac97 commit b88c774
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Options which are usually specified in the configuration file are documented in
| mediaPackageId ||| Deprecated. Use `id` instead. |
| allowedCallbackPrefixes ||| Allowed callback prefixes in callback url. |
| callbackUrl ||| Callback url to go back after finish. |
| callbackSystem ||| Callback system name to go back to. |
| opencast.url ||| URL of the opencast server to connect to. |
| opencast.name ||| Opencast user to use. For demo purposes only. |
| opencast.password ||| Password to use for authentication. For demo purposes only. |
Expand Down
6 changes: 6 additions & 0 deletions editor-settings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
# Default: undefined
#callbackUrl =

# Name of system to go back to
# If undefined, a generic system name is used instead of a speficic name
# Type: string | undefined
# Default: undefined
#callbackSystem =


####
# Metadata
Expand Down
1 change: 1 addition & 0 deletions public/editor-settings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ id = 'ID-dual-stream-demo'
# Callback to develop.opencast.org
allowedCallbackPrefixes = ["https://develop.opencast.org"]
callbackUrl = "https://develop.opencast.org"
callbackSystem = "OPENCAST"

[opencast]
# Connect to develop.opencast.org and use the default demo user
Expand Down
3 changes: 3 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ interface iSettings {
id: string | undefined,
allowedCallbackPrefixes: string[],
callbackUrl: string | undefined,
callbackSystem: string | undefined,
opencast: {
url: string,
name: string | undefined,
Expand Down Expand Up @@ -80,6 +81,7 @@ const defaultSettings: iSettings = {
id: undefined,
allowedCallbackPrefixes: [],
callbackUrl: undefined,
callbackSystem: undefined,
opencast: {
url: window.location.origin,
name: undefined,
Expand Down Expand Up @@ -389,6 +391,7 @@ const SCHEMA = {
id: types.string,
allowedCallbackPrefixes: types.array,
callbackUrl: types.string,
callbackSystem: types.string,
opencast: {
url: types.string,
name: types.string,
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/locales/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@
"error-details-text": "Details: {{errorMessage}}\n",
"error-text": "Ein Fehler ist aufgetreten. Bitte versuchen Sie es später noch einmal.",
"goBack-button": "Nein, zurück",
"callback-button": "Zurück zum vorigen System"
"callback-button-system": "Zurück zu {{system}}",
"callback-button-generic": "Zurück zum vorigen System"
},
"trackSelection": {
"title": "Spur(en) für die Verarbeitung auswählen",
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@
"error-details-text": "Details: {{errorMessage}}\n",
"error-text": "An error has occurred. Please wait a bit and try again.",
"goBack-button": "No, take me back",
"callback-button": "Back to previous system"
"callback-button-system": "Back to {{system}}",
"callback-button-generic": "Back to previous system"
},

"trackSelection": {
Expand Down
2 changes: 1 addition & 1 deletion src/main/Finish.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const CallbackButton : React.FC = () => {
openCallbackUrl()
} }}>
<LuDoorOpen />
<span>{t("various.callback-button")}</span>
<span>{settings.callbackSystem ? t("various.callback-button-system", {system: settings.callbackSystem}) : t("various.callback-button-generic")}</span>
</div>
}
</>
Expand Down

0 comments on commit b88c774

Please sign in to comment.