diff --git a/packages/bbui/src/Form/Core/TextArea.svelte b/packages/bbui/src/Form/Core/TextArea.svelte index e4738b8e55..8b530cdb03 100644 --- a/packages/bbui/src/Form/Core/TextArea.svelte +++ b/packages/bbui/src/Form/Core/TextArea.svelte @@ -7,6 +7,7 @@ export let disabled = false export let error = null export let id = null + export let height = null export const getCaretPosition = () => ({ start: textarea.selectionStart, end: textarea.selectionEnd, @@ -22,6 +23,7 @@
{ @@ -25,6 +26,7 @@ {disabled} {value} {placeholder} + {height} on:change={onChange} /> diff --git a/packages/bbui/src/Tabs/Tabs.svelte b/packages/bbui/src/Tabs/Tabs.svelte index 2a4017e605..c801ff44fd 100644 --- a/packages/bbui/src/Tabs/Tabs.svelte +++ b/packages/bbui/src/Tabs/Tabs.svelte @@ -6,6 +6,8 @@ export let selected export let vertical = false export let noPadding = false + // added as a separate option as noPadding is used for vertical padding + export let noHorizPadding = false export let quiet = false export let emphasized = false @@ -59,6 +61,7 @@
diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/_components/RestBodyInput.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/_components/RestBodyInput.svelte index 8e5d267fdf..c7f186c90d 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/_components/RestBodyInput.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/_components/RestBodyInput.svelte @@ -1,13 +1,62 @@ -{#if bodyType === RawRestBodyTypes.NONE} - The request does not have a body -{:else if bodyType === RawRestBodyTypes.FORM} - Form -{/if} +
+ {#if bodyType === RawRestBodyTypes.NONE} +
+ THE REQUEST DOES NOT HAVE A BODY +
+ {:else if objectTypes.includes(bodyType)} + + {:else if textTypes.includes(bodyType)} + (query.fields.requestBody = e.detail)} + /> + {/if} +
+ + diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/index.svelte index 47532ae3b1..0cdcb06f82 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/index.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/index.svelte @@ -12,10 +12,15 @@ Button, Heading, RadioGroup, + Label, + TextArea, + Table, } from "@budibase/bbui" import KeyValueBuilder from "components/integration/KeyValueBuilder.svelte" import EditableLabel from "components/common/inputs/EditableLabel.svelte" - import CodeMirrorEditor from "components/common/CodeMirrorEditor.svelte" + import CodeMirrorEditor, { + EditorModes, + } from "components/common/CodeMirrorEditor.svelte" import RestBodyInput from "../_components/RestBodyInput.svelte" import { capitalise } from "helpers" import { onMount } from "svelte" @@ -24,6 +29,8 @@ let query let breakQs = {} let url = "" + // test - { info: { code: 500, time: "455ms", size: "2.09KB" }} + let response $: datasource = $datasources.list.find(ds => ds._id === query?.datasourceId) $: datasourceType = datasource?.source @@ -31,6 +38,8 @@ $: queryConfig = integrationInfo?.query $: url = buildUrl(url, breakQs) $: checkQueryName(url) + $: responseSuccess = + response?.info?.code >= 200 && response?.info?.code <= 206 function getSelectedQuery() { return ( @@ -95,6 +104,8 @@ function saveQuery() {} + function sendQuery() {} + onMount(() => { query = getSelectedQuery() const qs = query?.fields.queryString @@ -138,9 +149,9 @@
- +
- + @@ -160,7 +171,7 @@ getOptionLabel={option => option.name} getOptionValue={option => option.value} /> - + @@ -175,6 +186,7 @@ {/if} (query.transformer = e.detail)} @@ -184,16 +196,72 @@
- + - Response + {#if !response} + Response + {:else} + + + (query.transformer = e.detail)} + /> + + + + + +