Browse Source

bugfix: links not respecting appRootPath

pull/4023/head
Michael Shanks 6 years ago
parent
commit
82d0f1ea86
  1. 1
      packages/server/src/api/index.js
  2. 3
      packages/server/src/utilities/builder/buildPage.js
  3. 2
      packages/standard-components/src/Link.svelte

1
packages/server/src/api/index.js

@ -38,6 +38,7 @@ router
ctx.config = {
latestPackagesFolder: budibaseAppsDir(),
jwtSecret: env.JWT_SECRET,
useAppRootPath: true,
}
ctx.isDev = env.NODE_ENV !== "production" && env.NODE_ENV !== "jest"
await next()

3
packages/server/src/utilities/builder/buildPage.js

@ -28,8 +28,7 @@ module.exports = async (config, appId, pageName, pkg) => {
await savePageJson(appPath, pageName, pkg)
}
const rootPath = (config, appname) =>
config.useAppRootPath ? `/${appname}` : ""
const rootPath = (config, appId) => (config.useAppRootPath ? `/${appId}` : "")
const copyClientLib = async (appPath, pageName) => {
const sourcepath = require.resolve("@budibase/client")

2
packages/standard-components/src/Link.svelte

@ -13,7 +13,7 @@
$: target = openInNewTab ? "_blank" : "_self"
</script>
<a href={url} bind:this={anchorElement} {target}>{text}</a>
<a href={_bb.relativeUrl(url)} bind:this={anchorElement} {target}>{text}</a>
<style>
.textDecoration {

Loading…
Cancel
Save