Merge branch 'fix/formula-response-types' of github.com:Budibase/budibase into fix/formula-response-types
This commit is contained in:
commit
02ba433860
|
@ -199,18 +199,22 @@ jobs:
|
||||||
env:
|
env:
|
||||||
DATASOURCE: ${{ matrix.datasource }}
|
DATASOURCE: ${{ matrix.datasource }}
|
||||||
run: |
|
run: |
|
||||||
AFFECTED=$(yarn --silent nx show projects --affected -t test --base=${{ env.NX_BASE_BRANCH }} -p @budibase/server)
|
if ${{ env.ONLY_AFFECTED_TASKS }}; then
|
||||||
if [ -n "$AFFECTED" ]; then
|
AFFECTED=$(yarn --silent nx show projects --affected -t test --base=${{ env.NX_BASE_BRANCH }} -p @budibase/server)
|
||||||
cd packages/server
|
if [ -z "$AFFECTED" ]; then
|
||||||
if [ "${{ matrix.datasource }}" == "none" ]; then
|
echo "No affected tests to run"
|
||||||
yarn test --filter ./src/tests/filters/non-datasource-tests.js --passWithNoTests
|
exit 0
|
||||||
else
|
|
||||||
yarn test --filter ./src/tests/filters/datasource-tests.js --passWithNoTests
|
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
echo "No affected tests to run"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
FILTER="./src/tests/filters/datasource-tests.js"
|
||||||
|
if [ "${{ matrix.datasource }}" == "none" ]; then
|
||||||
|
FILTER="./src/tests/filters/non-datasource-tests.js"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd packages/server
|
||||||
|
yarn test --filter $FILTER --passWithNoTests
|
||||||
|
|
||||||
check-pro-submodule:
|
check-pro-submodule:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: inputs.run_as_oss != true && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase')
|
if: inputs.run_as_oss != true && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase')
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
|
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
|
||||||
"version": "3.2.3",
|
"version": "3.2.4",
|
||||||
"npmClient": "yarn",
|
"npmClient": "yarn",
|
||||||
"packages": [
|
"packages": [
|
||||||
"packages/*",
|
"packages/*",
|
||||||
|
|
|
@ -231,9 +231,6 @@ const environment = {
|
||||||
MIN_VERSION_WITHOUT_POWER_ROLE:
|
MIN_VERSION_WITHOUT_POWER_ROLE:
|
||||||
process.env.MIN_VERSION_WITHOUT_POWER_ROLE || "3.0.0",
|
process.env.MIN_VERSION_WITHOUT_POWER_ROLE || "3.0.0",
|
||||||
DISABLE_CONTENT_SECURITY_POLICY: process.env.DISABLE_CONTENT_SECURITY_POLICY,
|
DISABLE_CONTENT_SECURITY_POLICY: process.env.DISABLE_CONTENT_SECURITY_POLICY,
|
||||||
// stopgap migration strategy until we can ensure backwards compat without unsafe-inline in CSP
|
|
||||||
DISABLE_CSP_UNSAFE_INLINE_SCRIPTS:
|
|
||||||
process.env.DISABLE_CSP_UNSAFE_INLINE_SCRIPTS,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setEnv(newEnvVars: Partial<typeof environment>): () => void {
|
export function setEnv(newEnvVars: Partial<typeof environment>): () => void {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import crypto from "crypto"
|
import crypto from "crypto"
|
||||||
import env from "../environment"
|
|
||||||
|
|
||||||
const CSP_DIRECTIVES = {
|
const CSP_DIRECTIVES = {
|
||||||
"default-src": ["'self'"],
|
"default-src": ["'self'"],
|
||||||
|
@ -97,10 +96,6 @@ export async function contentSecurityPolicy(ctx: any, next: any) {
|
||||||
`'nonce-${nonce}'`,
|
`'nonce-${nonce}'`,
|
||||||
]
|
]
|
||||||
|
|
||||||
if (!env.DISABLE_CSP_UNSAFE_INLINE_SCRIPTS) {
|
|
||||||
directives["script-src"].push("'unsafe-inline'")
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.state.nonce = nonce
|
ctx.state.nonce = nonce
|
||||||
|
|
||||||
const cspHeader = Object.entries(directives)
|
const cspHeader = Object.entries(directives)
|
||||||
|
|
|
@ -81,6 +81,7 @@
|
||||||
"@spectrum-css/typography": "3.0.1",
|
"@spectrum-css/typography": "3.0.1",
|
||||||
"@spectrum-css/underlay": "2.0.9",
|
"@spectrum-css/underlay": "2.0.9",
|
||||||
"@spectrum-css/vars": "3.0.1",
|
"@spectrum-css/vars": "3.0.1",
|
||||||
|
"atrament": "^4.3.0",
|
||||||
"dayjs": "^1.10.8",
|
"dayjs": "^1.10.8",
|
||||||
"easymde": "^2.16.1",
|
"easymde": "^2.16.1",
|
||||||
"svelte-dnd-action": "^0.9.8",
|
"svelte-dnd-action": "^0.9.8",
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
|
import { tick } from "svelte"
|
||||||
import {
|
import {
|
||||||
ModalContent,
|
ModalContent,
|
||||||
TextArea,
|
TextArea,
|
||||||
|
@ -8,7 +9,6 @@
|
||||||
import { automationStore, selectedAutomation } from "stores/builder"
|
import { automationStore, selectedAutomation } from "stores/builder"
|
||||||
import AutomationBlockSetup from "../../SetupPanel/AutomationBlockSetup.svelte"
|
import AutomationBlockSetup from "../../SetupPanel/AutomationBlockSetup.svelte"
|
||||||
import { cloneDeep } from "lodash/fp"
|
import { cloneDeep } from "lodash/fp"
|
||||||
import { memo } from "@budibase/frontend-core"
|
|
||||||
import { AutomationEventType } from "@budibase/types"
|
import { AutomationEventType } from "@budibase/types"
|
||||||
|
|
||||||
let failedParse = null
|
let failedParse = null
|
||||||
|
@ -63,8 +63,7 @@
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
const memoTestData = memo(parseTestData($selectedAutomation.data.testData))
|
$: testData = testData || parseTestData($selectedAutomation.data.testData)
|
||||||
$: memoTestData.set(parseTestData($selectedAutomation.data.testData))
|
|
||||||
|
|
||||||
$: {
|
$: {
|
||||||
// clone the trigger so we're not mutating the reference
|
// clone the trigger so we're not mutating the reference
|
||||||
|
@ -83,7 +82,7 @@
|
||||||
$: isError =
|
$: isError =
|
||||||
!isTriggerValid(trigger) ||
|
!isTriggerValid(trigger) ||
|
||||||
!(trigger.schema.outputs.required || []).every(
|
!(trigger.schema.outputs.required || []).every(
|
||||||
required => $memoTestData?.[required] || required !== "row"
|
required => testData?.[required] || required !== "row"
|
||||||
)
|
)
|
||||||
|
|
||||||
function parseTestJSON(e) {
|
function parseTestJSON(e) {
|
||||||
|
@ -110,11 +109,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const testAutomation = async () => {
|
const testAutomation = async () => {
|
||||||
|
// Ensure testData reactiveness is processed
|
||||||
|
await tick()
|
||||||
try {
|
try {
|
||||||
await automationStore.actions.test(
|
await automationStore.actions.test($selectedAutomation.data, testData)
|
||||||
$selectedAutomation.data,
|
|
||||||
$memoTestData
|
|
||||||
)
|
|
||||||
$automationStore.showTestPanel = true
|
$automationStore.showTestPanel = true
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
notifications.error(error)
|
notifications.error(error)
|
||||||
|
@ -152,7 +150,7 @@
|
||||||
{#if selectedValues}
|
{#if selectedValues}
|
||||||
<div class="tab-content-padding">
|
<div class="tab-content-padding">
|
||||||
<AutomationBlockSetup
|
<AutomationBlockSetup
|
||||||
testData={$memoTestData}
|
bind:testData
|
||||||
{schemaProperties}
|
{schemaProperties}
|
||||||
isTestModal
|
isTestModal
|
||||||
block={trigger}
|
block={trigger}
|
||||||
|
|
|
@ -503,7 +503,15 @@
|
||||||
row: { "Active": true, "Order Id" : 14, ... }
|
row: { "Active": true, "Order Id" : 14, ... }
|
||||||
})
|
})
|
||||||
*/
|
*/
|
||||||
const onChange = Utils.sequential(async update => {
|
const onChange = async update => {
|
||||||
|
if (isTestModal) {
|
||||||
|
testData = update
|
||||||
|
}
|
||||||
|
|
||||||
|
updateAutomation(update)
|
||||||
|
}
|
||||||
|
|
||||||
|
const updateAutomation = Utils.sequential(async update => {
|
||||||
const request = cloneDeep(update)
|
const request = cloneDeep(update)
|
||||||
// Process app trigger updates
|
// Process app trigger updates
|
||||||
if (isTrigger && !isTestModal) {
|
if (isTrigger && !isTestModal) {
|
||||||
|
|
|
@ -84,8 +84,8 @@
|
||||||
on:mouseleave
|
on:mouseleave
|
||||||
on:click={onClick}
|
on:click={onClick}
|
||||||
on:contextmenu
|
on:contextmenu
|
||||||
ondragover="return false"
|
on:dragover={e => e.preventDefault()}
|
||||||
ondragenter="return false"
|
on:dragenter={e => e.preventDefault()}
|
||||||
{id}
|
{id}
|
||||||
{style}
|
{style}
|
||||||
{draggable}
|
{draggable}
|
||||||
|
|
|
@ -68,8 +68,8 @@
|
||||||
on:scroll
|
on:scroll
|
||||||
bind:this={scrollRef}
|
bind:this={scrollRef}
|
||||||
on:drop={onDrop}
|
on:drop={onDrop}
|
||||||
ondragover="return false"
|
on:dragover={e => e.preventDefault()}
|
||||||
ondragenter="return false"
|
on:dragenter={e => e.preventDefault()}
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -33,8 +33,7 @@
|
||||||
"sanitize-html": "^2.13.0",
|
"sanitize-html": "^2.13.0",
|
||||||
"screenfull": "^6.0.1",
|
"screenfull": "^6.0.1",
|
||||||
"shortid": "^2.2.15",
|
"shortid": "^2.2.15",
|
||||||
"svelte-spa-router": "^4.0.1",
|
"svelte-spa-router": "^4.0.1"
|
||||||
"atrament": "^4.3.0"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-alias": "^5.1.0",
|
"@rollup/plugin-alias": "^5.1.0",
|
||||||
|
|
Loading…
Reference in New Issue