commit
2d909fae30
|
@ -16,17 +16,20 @@ const _builderProxy = proxy("/_builder", {
|
|||
pathRewrite: { "^/_builder": "" },
|
||||
})
|
||||
|
||||
const apiProxy = proxy(["/_builder/assets/**", "/_builder/api/**", "/_builder/**/componentlibrary"], {
|
||||
target,
|
||||
logLevel: "debug",
|
||||
changeOrigin: true,
|
||||
cookieDomainRewrite: true,
|
||||
onProxyReq(proxyReq) {
|
||||
if (proxyReq.getHeader("origin")) {
|
||||
proxyReq.setHeader("origin", target)
|
||||
}
|
||||
},
|
||||
})
|
||||
const apiProxy = proxy(
|
||||
["/_builder/assets/**", "/_builder/api/**", "/_builder/**/componentlibrary"],
|
||||
{
|
||||
target,
|
||||
logLevel: "debug",
|
||||
changeOrigin: true,
|
||||
cookieDomainRewrite: true,
|
||||
onProxyReq(proxyReq) {
|
||||
if (proxyReq.getHeader("origin")) {
|
||||
proxyReq.setHeader("origin", target)
|
||||
}
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
const production = !process.env.ROLLUP_WATCH
|
||||
|
||||
|
|
|
@ -24,12 +24,18 @@
|
|||
((!p2.nodeKey && !p1.nodeKey) || p2.nodeKey === p1.nodeKey)
|
||||
|
||||
const hasPermission = hasPerm =>
|
||||
some(p => matchPermissions(p, hasPerm))(clonedLevel.permissions)
|
||||
clonedLevel.permissions.some(permission =>
|
||||
matchPermissions(permission, hasPerm)
|
||||
)
|
||||
|
||||
$: permissionMatrix = map(p => ({
|
||||
permission: p,
|
||||
hasPermission: hasPermission(p),
|
||||
}))(allPermissions)
|
||||
$: permissionMatrix = allPermissions.map(permission => ({
|
||||
permission,
|
||||
hasPermission: hasPermission(permission),
|
||||
}))
|
||||
|
||||
$: allPermissionsSelected = permissionMatrix.every(
|
||||
permission => permission.hasPermission
|
||||
)
|
||||
|
||||
const getPermissionName = perm =>
|
||||
perm.nodeKey ? `${perm.type} - ${perm.nodeKey}` : perm.type
|
||||
|
@ -37,7 +43,7 @@
|
|||
const save = () => {
|
||||
const newLevels = isNew
|
||||
? [...allLevels, clonedLevel]
|
||||
: [...filter(l => l.name !== level.name)(allLevels), clonedLevel]
|
||||
: [...allLevels.filter(l => l.name !== level.name), clonedLevel]
|
||||
|
||||
errors = validateAccessLevels(hierarchy, actions, newLevels)
|
||||
|
||||
|
@ -56,6 +62,7 @@
|
|||
clonedLevel.permissions
|
||||
)
|
||||
}
|
||||
allPermissions = allPermissions
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -68,6 +75,15 @@
|
|||
<Textbox label="Access Level Name" bind:text={clonedLevel.name} />
|
||||
|
||||
<h4 class="budibase__title--4">Permissions</h4>
|
||||
|
||||
<Checkbox
|
||||
label={'Select All'}
|
||||
checked={allPermissionsSelected}
|
||||
on:change={ev => {
|
||||
permissionMatrix.forEach(permission =>
|
||||
permissionChanged(permission.permission)(ev)
|
||||
)
|
||||
}} />
|
||||
{#each permissionMatrix as permission}
|
||||
<div class="permission-container">
|
||||
<Checkbox
|
||||
|
@ -92,6 +108,7 @@
|
|||
|
||||
<style>
|
||||
.permission-container {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
</script>
|
||||
|
||||
<div class="select-container">
|
||||
<select on:change {value}>
|
||||
<select on:change bind:value>
|
||||
<slot />
|
||||
</select>
|
||||
<span class="arrow">
|
||||
|
@ -23,6 +23,7 @@
|
|||
}
|
||||
|
||||
select {
|
||||
height: 35px;
|
||||
display: block;
|
||||
font-family: sans-serif;
|
||||
font-weight: 500;
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
import PropsView from "./PropsView.svelte"
|
||||
import Textbox from "../common/Textbox.svelte"
|
||||
import Button from "../common/Button.svelte"
|
||||
import ActionButton from "../common/ActionButton.svelte"
|
||||
import ButtonGroup from "../common/ButtonGroup.svelte"
|
||||
import { pipe } from "../common/core"
|
||||
import UIkit from "uikit"
|
||||
|
@ -122,8 +123,8 @@
|
|||
</div>
|
||||
|
||||
<ButtonGroup style="float: right;">
|
||||
<Button color="primary" grouped on:click={save}>Create Screen</Button>
|
||||
<Button color="tertiary" grouped on:click={cancel}>Cancel</Button>
|
||||
<ActionButton primary on:click={save}>Create Screen</ActionButton>
|
||||
<ActionButton alert on:click={cancel}>Cancel</ActionButton>
|
||||
</ButtonGroup>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -38,10 +38,10 @@ const tableProps = (index, indexSchema) => ({
|
|||
"##eventHandlerType": "List Records",
|
||||
parameters: {
|
||||
indexKey: "/all_contacts",
|
||||
statePath: "all_contacts"
|
||||
}
|
||||
}
|
||||
]
|
||||
statePath: "all_contacts",
|
||||
},
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
const columnHeaders = indexSchema =>
|
||||
|
|
|
@ -309,26 +309,20 @@ module.exports = (config, app) => {
|
|||
})
|
||||
.post("/:appname/api/listRecords/*", async ctx => {
|
||||
const indexkey = getRecordKey(ctx.params.appname, ctx.request.path)
|
||||
ctx.body = await ctx.instance.indexApi.listItems(
|
||||
indexkey,
|
||||
{
|
||||
rangeStartParams: ctx.request.body.rangeStartParams,
|
||||
rangeEndParams: ctx.request.body.rangeEndParams,
|
||||
searchPhrase: ctx.request.body.searchPhrase,
|
||||
}
|
||||
)
|
||||
ctx.body = await ctx.instance.indexApi.listItems(indexkey, {
|
||||
rangeStartParams: ctx.request.body.rangeStartParams,
|
||||
rangeEndParams: ctx.request.body.rangeEndParams,
|
||||
searchPhrase: ctx.request.body.searchPhrase,
|
||||
})
|
||||
ctx.response.status = StatusCodes.OK
|
||||
})
|
||||
.post("/:appname/api/aggregates/*", async ctx => {
|
||||
const indexkey = getRecordKey(ctx.params.appname, ctx.request.path)
|
||||
ctx.body = await ctx.instance.indexApi.aggregates(
|
||||
indexkey,
|
||||
{
|
||||
rangeStartParams: ctx.request.body.rangeStartParams,
|
||||
rangeEndParams: ctx.request.body.rangeEndParams,
|
||||
searchPhrase: ctx.request.body.searchPhrase,
|
||||
}
|
||||
)
|
||||
ctx.body = await ctx.instance.indexApi.aggregates(indexkey, {
|
||||
rangeStartParams: ctx.request.body.rangeStartParams,
|
||||
rangeEndParams: ctx.request.body.rangeEndParams,
|
||||
searchPhrase: ctx.request.body.searchPhrase,
|
||||
})
|
||||
ctx.response.status = StatusCodes.OK
|
||||
})
|
||||
.post("/:appname/api/files/*", async ctx => {
|
||||
|
|
|
@ -30,7 +30,10 @@ module.exports.appsFolder = config => appPackageFolder(config, "")
|
|||
|
||||
module.exports.masterAppPackage = context => {
|
||||
const { config } = context
|
||||
const standardPackage = createAppPackage(context, `${__dirname}/../appPackages/_master`)
|
||||
const standardPackage = createAppPackage(
|
||||
context,
|
||||
`${__dirname}/../appPackages/_master`
|
||||
)
|
||||
|
||||
const customizeMaster =
|
||||
config && config.customizeMaster ? config.customizeMaster : a => a
|
||||
|
|
Loading…
Reference in New Issue