add warning modals to app export buttons

This commit is contained in:
Peter Clement 2023-02-01 14:44:53 +00:00
parent 46d5c58d95
commit 12cc927b16
4 changed files with 31 additions and 14 deletions

View File

@ -246,11 +246,6 @@
.spectrum-Popover.spectrum-Popover--bottom.spectrum-Picker-popover.is-open {
width: 100%;
}
.no-variables-height {
height: 100px;
}
.no-variables-text {
padding: var(--spacing-m);
color: var(--spectrum-global-color-gray-600);

View File

@ -22,6 +22,8 @@
let developmentValue
let useProductionValue = true
const HasSpacesRegex = /[\\"\s]/
const deleteVariable = async name => {
try {
await environment.deleteVariable(name)
@ -47,10 +49,16 @@
</script>
<ModalContent
disabled={HasSpacesRegex.test(name)}
onConfirm={() => saveVariable()}
title={!row ? "Add new environment variable" : "Edit environment variable"}
>
<Input disabled={row} label="Name" bind:value={name} />
<Input
disabled={row}
label="Name"
bind:value={name}
error={HasSpacesRegex.test(name) && "Must not include spaces"}
/>
<div>
<Heading size="XS">Production</Heading>
<Input

View File

@ -1,6 +1,5 @@
<script>
import { ModalContent, Toggle, Body, InlineAlert } from "@budibase/bbui"
import { licensing } from "stores/portal"
export let app
export let published
@ -17,11 +16,9 @@
</script>
<ModalContent {title} {confirmText} onConfirm={exportApp}>
{#if licensing.environmentVariablesEnabled}
<InlineAlert
header="Do not share your budibase application exports publicly as they may contain sensitive information such as database credentials or secret keys."
/>
{/if}
<InlineAlert
header="Do not share your budibase application exports publicly as they may contain sensitive information such as database credentials or secret keys."
/>
<Body
>Apps can be exported with or without data that is within internal tables -
select this below.</Body

View File

@ -11,15 +11,17 @@
Body,
Icon,
Search,
InlineAlert,
} from "@budibase/bbui"
import Spinner from "components/common/Spinner.svelte"
import CreateAppModal from "components/start/CreateAppModal.svelte"
import AppLimitModal from "components/portal/licensing/AppLimitModal.svelte"
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
import { store, automationStore } from "builderStore"
import { API } from "api"
import { onMount } from "svelte"
import { apps, auth, admin, licensing } from "stores/portal"
import { apps, auth, admin, licensing, environment } from "stores/portal"
import { goto } from "@roxi/routify"
import AppRow from "components/start/AppRow.svelte"
import { AppStatus } from "constants"
@ -35,6 +37,7 @@
let creatingFromTemplate = false
let automationErrors
let accessFilterList = null
let confirmDownloadDialog
$: welcomeHeader = `Welcome ${$auth?.user?.firstName || "back"}`
$: enrichedApps = enrichApps($apps, $auth.user, sortBy)
@ -193,6 +196,7 @@
onMount(async () => {
try {
await environment.loadVariables()
// If the portal is loaded from an external URL with a template param
const initInfo = await auth.getInitInfo()
if (initInfo?.init_template) {
@ -275,7 +279,8 @@
<Icon
name="Download"
hoverable
on:click={initiateAppsExport}
tooltip="test"
on:click={confirmDownloadDialog.show}
/>
{/if}
<Select
@ -323,6 +328,18 @@
<AppLimitModal bind:this={appLimitModal} />
<ConfirmDialog
bind:this={confirmDownloadDialog}
okText="Continue"
onOk={initiateAppsExport}
warning={false}
title="Download all apps"
>
<InlineAlert
header="Do not share your budibase application exports publicly as they may contain sensitive information such as database credentials or secret keys."
/>
</ConfirmDialog>
<style>
.title {
display: flex;