Fix routing setting and add initial role ID setting to screens for testing
This commit is contained in:
parent
68ed9e9f32
commit
c65425d631
|
@ -6,6 +6,7 @@
|
||||||
import CategoryTab from "./CategoryTab.svelte"
|
import CategoryTab from "./CategoryTab.svelte"
|
||||||
import DesignView from "./DesignView.svelte"
|
import DesignView from "./DesignView.svelte"
|
||||||
import SettingsView from "./SettingsView.svelte"
|
import SettingsView from "./SettingsView.svelte"
|
||||||
|
import { setWith } from "lodash"
|
||||||
|
|
||||||
let flattenedPanel = flattenComponents(panelStructure.categories)
|
let flattenedPanel = flattenComponents(panelStructure.categories)
|
||||||
let categories = [
|
let categories = [
|
||||||
|
@ -69,7 +70,7 @@
|
||||||
) {
|
) {
|
||||||
selectedAsset.props._instanceName = value
|
selectedAsset.props._instanceName = value
|
||||||
} else {
|
} else {
|
||||||
selectedAsset[name] = value
|
setWith(selectedAsset, name.split("."), value, Object)
|
||||||
}
|
}
|
||||||
return state
|
return state
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
|
import { get } from "lodash"
|
||||||
import { isEmpty } from "lodash/fp"
|
import { isEmpty } from "lodash/fp"
|
||||||
import { FrontendTypes } from "constants"
|
import { FrontendTypes } from "constants"
|
||||||
import PropertyControl from "./PropertyControl.svelte"
|
import PropertyControl from "./PropertyControl.svelte"
|
||||||
|
@ -16,7 +17,13 @@
|
||||||
export let displayNameField = false
|
export let displayNameField = false
|
||||||
export let assetInstance
|
export let assetInstance
|
||||||
|
|
||||||
let assetProps = ["title", "description", "route", "layoutId"]
|
let assetProps = [
|
||||||
|
"title",
|
||||||
|
"description",
|
||||||
|
"routing.route",
|
||||||
|
"layoutId",
|
||||||
|
"routing.roleId",
|
||||||
|
]
|
||||||
let duplicateName = false
|
let duplicateName = false
|
||||||
|
|
||||||
const propExistsOnComponentDef = prop =>
|
const propExistsOnComponentDef = prop =>
|
||||||
|
@ -28,8 +35,9 @@
|
||||||
|
|
||||||
const screenDefinition = [
|
const screenDefinition = [
|
||||||
{ key: "description", label: "Description", control: Input },
|
{ key: "description", label: "Description", control: Input },
|
||||||
{ key: "route", label: "Route", control: Input },
|
{ key: "routing.route", label: "Route", control: Input },
|
||||||
{ key: "layoutId", label: "Layout", control: LayoutSelect },
|
{ key: "layoutId", label: "Layout", control: LayoutSelect },
|
||||||
|
{ key: "routing.roleId", label: "Role", control: Input },
|
||||||
]
|
]
|
||||||
|
|
||||||
const layoutDefinition = [{ key: "title", label: "Title", control: Input }]
|
const layoutDefinition = [{ key: "title", label: "Title", control: Input }]
|
||||||
|
@ -92,7 +100,7 @@
|
||||||
control={def.control}
|
control={def.control}
|
||||||
label={def.label}
|
label={def.label}
|
||||||
key={def.key}
|
key={def.key}
|
||||||
value={assetInstance[def.key]}
|
value={get(assetInstance, def.key)}
|
||||||
onChange={onScreenPropChange}
|
onChange={onScreenPropChange}
|
||||||
props={{ ...excludeProps(def, ['control', 'label']) }} />
|
props={{ ...excludeProps(def, ['control', 'label']) }} />
|
||||||
{/each}
|
{/each}
|
||||||
|
|
Loading…
Reference in New Issue