chore: updated all VITE_KC_SITE_BASE_URL locations, need to do raw urls next
This commit is contained in:
@ -53,7 +53,6 @@ import {
|
|||||||
WASM_INIT_FAILED_TOAST_ID,
|
WASM_INIT_FAILED_TOAST_ID,
|
||||||
} from '@src/lib/constants'
|
} from '@src/lib/constants'
|
||||||
import { isPlaywright } from '@src/lib/isPlaywright'
|
import { isPlaywright } from '@src/lib/isPlaywright'
|
||||||
import { VITE_KC_SITE_BASE_URL } from '@src/env'
|
|
||||||
import { useNetworkHealthStatus } from '@src/components/NetworkHealthIndicator'
|
import { useNetworkHealthStatus } from '@src/components/NetworkHealthIndicator'
|
||||||
import { useNetworkMachineStatus } from '@src/components/NetworkMachineIndicator'
|
import { useNetworkMachineStatus } from '@src/components/NetworkMachineIndicator'
|
||||||
import {
|
import {
|
||||||
@ -65,6 +64,7 @@ import { useModelingContext } from '@src/hooks/useModelingContext'
|
|||||||
import { xStateValueToString } from '@src/lib/xStateValueToString'
|
import { xStateValueToString } from '@src/lib/xStateValueToString'
|
||||||
import { getSelectionTypeDisplayText } from '@src/lib/selections'
|
import { getSelectionTypeDisplayText } from '@src/lib/selections'
|
||||||
import type { StatusBarItemType } from '@src/components/StatusBar/statusBarTypes'
|
import type { StatusBarItemType } from '@src/components/StatusBar/statusBarTypes'
|
||||||
|
import {withSiteBaseURL} from '@src/lib/withBaseURL'
|
||||||
|
|
||||||
// CYCLIC REF
|
// CYCLIC REF
|
||||||
sceneInfra.camControls.engineStreamActor = engineStreamActor
|
sceneInfra.camControls.engineStreamActor = engineStreamActor
|
||||||
@ -189,7 +189,8 @@ export function App() {
|
|||||||
() =>
|
() =>
|
||||||
DownloadAppToast({
|
DownloadAppToast({
|
||||||
onAccept: () => {
|
onAccept: () => {
|
||||||
openWindow(`${VITE_KC_SITE_BASE_URL}/${APP_DOWNLOAD_PATH}`)
|
const url = withSiteBaseURL(`/${APP_DOWNLOAD_PATH}`)
|
||||||
|
openWindow(url)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
toast.dismiss(DOWNLOAD_APP_TOAST_ID)
|
toast.dismiss(DOWNLOAD_APP_TOAST_ID)
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import { Transition } from '@headlessui/react'
|
import { Transition } from '@headlessui/react'
|
||||||
import { VITE_KC_SITE_BASE_URL } from '@src/env'
|
|
||||||
import { useSearchParams } from 'react-router-dom'
|
import { useSearchParams } from 'react-router-dom'
|
||||||
import { base64ToString } from '@src/lib/base64'
|
import { base64ToString } from '@src/lib/base64'
|
||||||
|
|
||||||
|
|||||||
@ -12,9 +12,9 @@ import { Popover } from '@headlessui/react'
|
|||||||
import Tooltip from '@src/components/Tooltip'
|
import Tooltip from '@src/components/Tooltip'
|
||||||
import { HelpMenu } from '@src/components/HelpMenu'
|
import { HelpMenu } from '@src/components/HelpMenu'
|
||||||
import { isDesktop } from '@src/lib/isDesktop'
|
import { isDesktop } from '@src/lib/isDesktop'
|
||||||
import { VITE_KC_SITE_BASE_URL } from '@src/env'
|
|
||||||
import { APP_DOWNLOAD_PATH } from '@src/lib/constants'
|
import { APP_DOWNLOAD_PATH } from '@src/lib/constants'
|
||||||
import { desktopAppPitchMessage } from '@src/components/DownloadAppToast'
|
import { desktopAppPitchMessage } from '@src/components/DownloadAppToast'
|
||||||
|
import { withSiteBaseURL} from '@src/lib/withBaseURL'
|
||||||
|
|
||||||
export const defaultGlobalStatusBarItems = ({
|
export const defaultGlobalStatusBarItems = ({
|
||||||
location,
|
location,
|
||||||
@ -37,7 +37,7 @@ export const defaultGlobalStatusBarItems = ({
|
|||||||
id: 'download-desktop-app',
|
id: 'download-desktop-app',
|
||||||
element: 'externalLink',
|
element: 'externalLink',
|
||||||
label: 'Download the app',
|
label: 'Download the app',
|
||||||
href: `${VITE_KC_SITE_BASE_URL}/${APP_DOWNLOAD_PATH}`,
|
href: withSiteBaseURL(`/${APP_DOWNLOAD_PATH}`),
|
||||||
icon: 'download',
|
icon: 'download',
|
||||||
toolTip: {
|
toolTip: {
|
||||||
children: desktopAppPitchMessage,
|
children: desktopAppPitchMessage,
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
import type { SelectionRange } from '@codemirror/state'
|
import type { SelectionRange } from '@codemirror/state'
|
||||||
import { EditorSelection, Transaction } from '@codemirror/state'
|
import { EditorSelection, Transaction } from '@codemirror/state'
|
||||||
import type { Models } from '@kittycad/lib'
|
import type { Models } from '@kittycad/lib'
|
||||||
import { VITE_KC_SITE_BASE_URL } from '@src/env'
|
|
||||||
import { diffLines } from 'diff'
|
import { diffLines } from 'diff'
|
||||||
import toast from 'react-hot-toast'
|
import toast from 'react-hot-toast'
|
||||||
import type { TextToCadMultiFileIteration_type } from '@kittycad/lib/dist/types/src/models'
|
import type { TextToCadMultiFileIteration_type } from '@kittycad/lib/dist/types/src/models'
|
||||||
@ -28,7 +27,7 @@ import { uuidv4 } from '@src/lib/utils'
|
|||||||
import type { File as KittyCadLibFile } from '@kittycad/lib/dist/types/src/models'
|
import type { File as KittyCadLibFile } from '@kittycad/lib/dist/types/src/models'
|
||||||
import type { FileMeta } from '@src/lib/types'
|
import type { FileMeta } from '@src/lib/types'
|
||||||
import type { RequestedKCLFile } from '@src/machines/systemIO/utils'
|
import type { RequestedKCLFile } from '@src/machines/systemIO/utils'
|
||||||
import { withAPIBaseURL } from '@src/lib/withBaseURL'
|
import { withAPIBaseURL, withSiteBaseURL } from '@src/lib/withBaseURL'
|
||||||
|
|
||||||
type KclFileMetaMap = {
|
type KclFileMetaMap = {
|
||||||
[execStateFileNamesIndex: number]: Extract<FileMeta, { type: 'kcl' }>
|
[execStateFileNamesIndex: number]: Extract<FileMeta, { type: 'kcl' }>
|
||||||
@ -439,7 +438,7 @@ export async function promptToEditFlow({
|
|||||||
return Promise.reject(result)
|
return Promise.reject(result)
|
||||||
}
|
}
|
||||||
const oldCodeWebAppOnly = codeManager.code
|
const oldCodeWebAppOnly = codeManager.code
|
||||||
const downloadLink = `${VITE_KC_SITE_BASE_URL}/${APP_DOWNLOAD_PATH}`
|
const downloadLink = withSiteBaseURL(`/${APP_DOWNLOAD_PATH}`)
|
||||||
|
|
||||||
if (!isDesktop() && Object.values(result.outputs).length > 1) {
|
if (!isDesktop() && Object.values(result.outputs).length > 1) {
|
||||||
const toastId = uuidv4()
|
const toastId = uuidv4()
|
||||||
|
|||||||
@ -30,7 +30,7 @@ import {
|
|||||||
browserAxialFan,
|
browserAxialFan,
|
||||||
browserAxialFanAfterTextToCad,
|
browserAxialFanAfterTextToCad,
|
||||||
} from '@src/lib/exampleKcl'
|
} from '@src/lib/exampleKcl'
|
||||||
import {withSiteBaseURL} from "@src/lib/withBaseURL"
|
import { withSiteBaseURL } from '@src/lib/withBaseURL'
|
||||||
|
|
||||||
type BrowserOnboaringRoute = RouteObject & {
|
type BrowserOnboaringRoute = RouteObject & {
|
||||||
path: keyof typeof browserOnboardingPaths
|
path: keyof typeof browserOnboardingPaths
|
||||||
|
|||||||
@ -28,7 +28,7 @@ import {
|
|||||||
modifiedParametersDesktop,
|
modifiedParametersDesktop,
|
||||||
} from '@src/lib/exampleKcl'
|
} from '@src/lib/exampleKcl'
|
||||||
import { openExternalBrowserIfDesktop } from '@src/lib/openWindow'
|
import { openExternalBrowserIfDesktop } from '@src/lib/openWindow'
|
||||||
import {withSiteBaseURL} from '@src/lib/withBaseURL'
|
import { withSiteBaseURL } from '@src/lib/withBaseURL'
|
||||||
|
|
||||||
type DesktopOnboardingRoute = RouteObject & {
|
type DesktopOnboardingRoute = RouteObject & {
|
||||||
path: keyof typeof desktopOnboardingPaths
|
path: keyof typeof desktopOnboardingPaths
|
||||||
@ -642,9 +642,7 @@ function OnboardingConclusion() {
|
|||||||
project, click the Zoo button in the top left. To learn more detailed
|
project, click the Zoo button in the top left. To learn more detailed
|
||||||
and advanced techniques,{' '}
|
and advanced techniques,{' '}
|
||||||
<a
|
<a
|
||||||
onClick={openExternalBrowserIfDesktop(
|
onClick={openExternalBrowserIfDesktop(withSiteBaseURL('/docs'))}
|
||||||
withSiteBaseURL('/docs')
|
|
||||||
)}
|
|
||||||
href={`${withSiteBaseURL('/docs')}`}
|
href={`${withSiteBaseURL('/docs')}`}
|
||||||
>
|
>
|
||||||
check out our docs
|
check out our docs
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import {
|
|||||||
IMMEDIATE_SIGN_IN_IF_NECESSARY_QUERY_PARAM,
|
IMMEDIATE_SIGN_IN_IF_NECESSARY_QUERY_PARAM,
|
||||||
} from '@src/lib/constants'
|
} from '@src/lib/constants'
|
||||||
import { PATHS } from '@src/lib/paths'
|
import { PATHS } from '@src/lib/paths'
|
||||||
import {withSiteBaseURL} from '@src/lib/withBaseURL'
|
import { withSiteBaseURL } from '@src/lib/withBaseURL'
|
||||||
|
|
||||||
const isTestEnv = window?.localStorage.getItem(IS_PLAYWRIGHT_KEY) === 'true'
|
const isTestEnv = window?.localStorage.getItem(IS_PLAYWRIGHT_KEY) === 'true'
|
||||||
|
|
||||||
@ -55,5 +55,7 @@ export function generateSignInUrl() {
|
|||||||
'?'
|
'?'
|
||||||
)
|
)
|
||||||
|
|
||||||
return withSiteBaseURL(`${PATHS.SIGN_IN}?callbackUrl=${encodeURIComponent(finalURL)}`)
|
return withSiteBaseURL(
|
||||||
|
`${PATHS.SIGN_IN}?callbackUrl=${encodeURIComponent(finalURL)}`
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user