Browse Source
Merge pull request #2630 from mslourens/invalid_route_settings_section
Sanitise urls after change
gh-pages
Martin McKeaveney
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
9 additions and
2 deletions
-
packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte
-
packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte
|
|
@ -5,6 +5,7 @@ |
|
|
import { Input, Select, ModalContent, Toggle } from "@budibase/bbui" |
|
|
import { Input, Select, ModalContent, Toggle } from "@budibase/bbui" |
|
|
import getTemplates from "builderStore/store/screenTemplates" |
|
|
import getTemplates from "builderStore/store/screenTemplates" |
|
|
import analytics, { Events } from "analytics" |
|
|
import analytics, { Events } from "analytics" |
|
|
|
|
|
import sanitizeUrl from "builderStore/store/screenTemplates/utils/sanitizeUrl" |
|
|
|
|
|
|
|
|
const CONTAINER = "@budibase/standard-components/container" |
|
|
const CONTAINER = "@budibase/standard-components/container" |
|
|
|
|
|
|
|
|
@ -84,7 +85,7 @@ |
|
|
if (!event.detail.startsWith("/")) { |
|
|
if (!event.detail.startsWith("/")) { |
|
|
route = "/" + event.detail |
|
|
route = "/" + event.detail |
|
|
} |
|
|
} |
|
|
route = route.replace(/ +/g, "-") |
|
|
route = sanitizeUrl(route) |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
@ -7,6 +7,7 @@ |
|
|
import RoleSelect from "./PropertyControls/RoleSelect.svelte" |
|
|
import RoleSelect from "./PropertyControls/RoleSelect.svelte" |
|
|
import { currentAsset, store } from "builderStore" |
|
|
import { currentAsset, store } from "builderStore" |
|
|
import { FrontendTypes } from "constants" |
|
|
import { FrontendTypes } from "constants" |
|
|
|
|
|
import sanitizeUrl from "builderStore/store/screenTemplates/utils/sanitizeUrl" |
|
|
|
|
|
|
|
|
export let componentInstance |
|
|
export let componentInstance |
|
|
export let bindings |
|
|
export let bindings |
|
|
@ -37,7 +38,12 @@ |
|
|
key: "routing.route", |
|
|
key: "routing.route", |
|
|
label: "Route", |
|
|
label: "Route", |
|
|
control: Input, |
|
|
control: Input, |
|
|
parser: val => val.replace(/ +/g, "-"), |
|
|
parser: val => { |
|
|
|
|
|
if (!val.startsWith("/")) { |
|
|
|
|
|
val = "/" + val |
|
|
|
|
|
} |
|
|
|
|
|
return sanitizeUrl(val) |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ key: "routing.roleId", label: "Access", control: RoleSelect }, |
|
|
{ key: "routing.roleId", label: "Access", control: RoleSelect }, |
|
|
{ key: "layoutId", label: "Layout", control: LayoutSelect }, |
|
|
{ key: "layoutId", label: "Layout", control: LayoutSelect }, |
|
|
|