Skip to content

Commit a01dae1

Browse files
committed
wip
1 parent 2508b6b commit a01dae1

File tree

7 files changed

+20
-9
lines changed

7 files changed

+20
-9
lines changed

packages/webui/src/client/lib/ui/icons/notifications.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { JSX } from 'react'
2+
import { ROOT_URL_PATH_PREFIX } from '../../../url'
23

34
export function CriticalIcon(): JSX.Element {
45
return (
@@ -167,7 +168,7 @@ export function WarningIconSmall(): JSX.Element {
167168
// }
168169

169170
export function WarningIconSmallWorkingOnIt(): JSX.Element {
170-
return <img src="/images/warning-transferring.webp" width="20" height="20" alt="Warning" />
171+
return <img src={ROOT_URL_PATH_PREFIX + '/images/warning-transferring.webp'} width="20" height="20" alt="Warning" />
171172
}
172173

173174
export function InformationIconSmall(): JSX.Element {

packages/webui/src/client/ui/App.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,16 @@ export const App: React.FC = function App() {
146146
})
147147
}, [])
148148

149-
console.log('setup router', ROOT_URL_PATH_PREFIX)
150-
151149
return (
152150
<UserPermissionsContext.Provider value={roles}>
153151
<Router getUserConfirmation={onNavigationUserConfirmation} basename={ROOT_URL_PATH_PREFIX}>
154-
<div className="container-fluid header-clear">
152+
<div
153+
className="container-fluid header-clear"
154+
style={{
155+
// @ts-expect-error custom variable
156+
'--url-base-path': ROOT_URL_PATH_PREFIX,
157+
}}
158+
>
155159
{/* Header switch - render the usual header for all pages but the rundown view */}
156160
<ErrorBoundary>
157161
<Switch>

packages/webui/src/client/ui/FloatingInspectors/NoraFloatingInspector.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React, { useEffect, useImperativeHandle } from 'react'
33
import _ from 'underscore'
44
import { getNoraContentSteps } from '../SegmentContainer/PieceMultistepChevron'
55
import Escape from './../../lib/Escape'
6+
import { ROOT_URL_PATH_PREFIX } from '../../url'
67

78
interface IPropsHeader {
89
noraContent: NoraContent | undefined
@@ -206,7 +207,7 @@ export class NoraPreviewRenderer extends React.Component<{}, IStateHeader> {
206207
ref={this._setRootElement}
207208
>
208209
<div className="preview">
209-
<img src="/images/previewBG.jpg" alt="" />
210+
<img src={ROOT_URL_PATH_PREFIX + '/images/previewBG.jpg'} alt="" />
210211
{rendererUrl && (
211212
<iframe
212213
key={rendererUrl} // Use the url as the key, so that the old renderer unloads immediately when changing url

packages/webui/src/client/ui/Settings/SystemManagement.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { WrappedOverridableItemNormal, useOverrideOpHelper } from './util/Overri
3030
import { CheckboxControl } from '../../lib/Components/Checkbox'
3131
import { CombinedMultiLineTextInputControl, MultiLineTextInputControl } from '../../lib/Components/MultiLineTextInput'
3232
import { TextInputControl } from '../../lib/Components/TextInput'
33+
import { createPrivateApiPath } from '../../url'
3334

3435
interface WithCoreSystemProps {
3536
coreSystem: ICoreSystem

packages/webui/src/client/ui/StudioScreenSaver/StudioScreenSaver.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { StudioId } from '@sofie-automation/corelib/dist/dataModel/Ids'
1414
import { RundownPlaylists } from '../../collections'
1515
import { CorelibPubSub } from '@sofie-automation/corelib/dist/pubsub'
1616
import { withTranslation } from 'react-i18next'
17+
import { ROOT_URL_PATH_PREFIX } from '../../url'
1718

1819
interface IProps {
1920
// the studio to be displayed in the screen saver
@@ -337,7 +338,7 @@ const StudioScreenSaverContent = withTranslation()(
337338
>
338339
<object
339340
className="studio-screen-saver__bkg"
340-
data="/images/screen-saver-bkg.svg"
341+
data={ROOT_URL_PATH_PREFIX + '/images/screen-saver-bkg.svg'}
341342
type="image/svg+xml"
342343
></object>
343344
<div

packages/webui/src/client/ui/i18n.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { interpollateTranslation } from '@sofie-automation/corelib/dist/Translat
1414
import { TranslationsBundleId } from '@sofie-automation/corelib/dist/dataModel/Ids'
1515
import { TranslationsBundles } from '../collections'
1616
import { catchError } from '../lib/lib'
17+
import { ROOT_URL_PATH_PREFIX } from '../url'
1718

1819
const i18nOptions = {
1920
fallbackLng: {
@@ -45,7 +46,7 @@ const i18nOptions = {
4546
},
4647

4748
backend: {
48-
loadPath: '/locales/{{lng}}/{{ns}}.json',
49+
loadPath: ROOT_URL_PATH_PREFIX + '/locales/{{lng}}/{{ns}}.json',
4950
},
5051

5152
detection: {

scripts/run.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ function watchMeteor() {
4343
console.log('No meteor-settings.json')
4444
}
4545

46+
const rootUrl = process.env.ROOT_URL ? new URL(process.env.ROOT_URL) : null
47+
4648
return [
4749
{
4850
command: "yarn watch-types --preserveWatchOutput",
@@ -67,8 +69,8 @@ function watchMeteor() {
6769
name: "VITE",
6870
prefixColor: "yellow",
6971
env: {
70-
SOFIE_BASE_PATH: '/sofie', // nocommit - HACK
71-
}
72+
SOFIE_BASE_PATH: rootUrl.pathname.length > 1 ? rootUrl.pathname : '',
73+
},
7274
},
7375
];
7476
}

0 commit comments

Comments
 (0)