From 77d17e143d3d4fdbe8198e52ec65f13f076b6e58 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Sat, 11 Dec 2021 09:59:09 +0000 Subject: [PATCH] Auth config forms --- packages/bbui/src/Modal/ModalContent.svelte | 8 +- .../rest/RestExtraConfigForm.svelte | 2 +- .../rest/auth/AuthTypeRenderer.svelte | 4 +- .../auth/RestAuthenticationBuilder.svelte | 86 ++----- .../rest/auth/RestAuthenticationModal.svelte | 215 ++++++++++++++++++ 5 files changed, 246 insertions(+), 69 deletions(-) create mode 100644 packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/rest/auth/RestAuthenticationModal.svelte diff --git a/packages/bbui/src/Modal/ModalContent.svelte b/packages/bbui/src/Modal/ModalContent.svelte index 7f2d7fbdb9..c18be1e4e1 100644 --- a/packages/bbui/src/Modal/ModalContent.svelte +++ b/packages/bbui/src/Modal/ModalContent.svelte @@ -21,6 +21,7 @@ export let showSecondaryButton = false export let secondaryButtonText = undefined export let secondaryAction = undefined + export let secondaryButtonWarning = false const { hide, cancel } = getContext(Context.Modal) let loading = false @@ -88,8 +89,11 @@ {#if showSecondaryButton && secondaryButtonText && secondaryAction}
- {secondaryButtonText}
{/if} diff --git a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/rest/RestExtraConfigForm.svelte b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/rest/RestExtraConfigForm.svelte index c77f2900b0..0272463d92 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/rest/RestExtraConfigForm.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/rest/RestExtraConfigForm.svelte @@ -41,7 +41,7 @@ Create an authentication config that can be shared with queries. - + diff --git a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/rest/auth/RestAuthenticationModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/rest/auth/RestAuthenticationModal.svelte new file mode 100644 index 0000000000..79dc19f439 --- /dev/null +++ b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/rest/auth/RestAuthenticationModal.svelte @@ -0,0 +1,215 @@ + + + + + + The authorization header will be automatically generated when you send the + request. + + (blurred.name = true)} + error={blurred.name ? errors.name : null} + /> + (blurred.basic.username = true)} + error={blurred.basic.username ? errors.basic.username : null} + /> + (blurred.basic.password = true)} + error={blurred.basic.password ? errors.basic.password : null} + /> + {/if} + {#if form.type === AUTH_TYPES.BEARER} + (blurred.bearer.token = true)} + error={blurred.bearer.token ? errors.bearer.token : null} + /> + {/if} + + + +