Move modal to BBUI and update usages
This commit is contained in:
parent
40d1d15b8e
commit
d24679bc33
|
@ -4,7 +4,6 @@
|
||||||
import { routes } from "../routify/routes"
|
import { routes } from "../routify/routes"
|
||||||
import { initialise } from "builderStore"
|
import { initialise } from "builderStore"
|
||||||
import NotificationDisplay from "components/common/Notification/NotificationDisplay.svelte"
|
import NotificationDisplay from "components/common/Notification/NotificationDisplay.svelte"
|
||||||
import { ModalContainer } from "components/common/Modal"
|
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
await initialise()
|
await initialise()
|
||||||
|
@ -15,4 +14,3 @@
|
||||||
|
|
||||||
<NotificationDisplay />
|
<NotificationDisplay />
|
||||||
<Router {routes} />
|
<Router {routes} />
|
||||||
<ModalContainer />
|
|
||||||
|
|
|
@ -2,10 +2,9 @@
|
||||||
import { onMount } from "svelte"
|
import { onMount } from "svelte"
|
||||||
import { automationStore } from "builderStore"
|
import { automationStore } from "builderStore"
|
||||||
import CreateAutomationModal from "./CreateAutomationModal.svelte"
|
import CreateAutomationModal from "./CreateAutomationModal.svelte"
|
||||||
import { Button } from "@budibase/bbui"
|
import { Button, Modal } from "@budibase/bbui"
|
||||||
import { Modal } from "components/common/Modal"
|
|
||||||
|
|
||||||
let modalVisible = false
|
let modal
|
||||||
|
|
||||||
$: selectedAutomationId = $automationStore.selectedAutomation?.automation?._id
|
$: selectedAutomationId = $automationStore.selectedAutomation?.automation?._id
|
||||||
|
|
||||||
|
@ -15,9 +14,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<Button primary wide on:click={() => (modalVisible = true)}>
|
<Button primary wide on:click={modal.show}>Create New Automation</Button>
|
||||||
Create New Automation
|
|
||||||
</Button>
|
|
||||||
<ul>
|
<ul>
|
||||||
{#each $automationStore.automations as automation}
|
{#each $automationStore.automations as automation}
|
||||||
<li
|
<li
|
||||||
|
@ -30,9 +27,9 @@
|
||||||
{/each}
|
{/each}
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
{#if modalVisible}
|
<Modal bind:this={modal}>
|
||||||
<CreateAutomationModal bind:visible={modalVisible} />
|
<CreateAutomationModal />
|
||||||
{/if}
|
</Modal>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
section {
|
section {
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
<script>
|
<script>
|
||||||
import { store, backendUiStore, automationStore } from "builderStore"
|
import { store, backendUiStore, automationStore } from "builderStore"
|
||||||
import { notifier } from "builderStore/store/notifications"
|
import { notifier } from "builderStore/store/notifications"
|
||||||
import { Input } from "@budibase/bbui"
|
import { Input, ModalContent } from "@budibase/bbui"
|
||||||
import analytics from "analytics"
|
import analytics from "analytics"
|
||||||
import { Modal } from "components/common/Modal"
|
|
||||||
|
|
||||||
export let visible
|
|
||||||
|
|
||||||
let name
|
let name
|
||||||
|
|
||||||
|
@ -29,8 +26,7 @@
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Modal
|
<ModalContent
|
||||||
bind:visible
|
|
||||||
title="Create Automation"
|
title="Create Automation"
|
||||||
confirmText="Create"
|
confirmText="Create"
|
||||||
onConfirm={createAutomation}
|
onConfirm={createAutomation}
|
||||||
|
@ -44,7 +40,7 @@
|
||||||
<span>Learn about automations</span>
|
<span>Learn about automations</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</ModalContent>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
a {
|
a {
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
<script>
|
<script>
|
||||||
import { TextButton as Button, Icon } from "@budibase/bbui"
|
import { TextButton as Button, Icon, Modal } from "@budibase/bbui"
|
||||||
import CreateEditRecordModal from "../modals/CreateEditRecordModal.svelte"
|
import CreateEditRecordModal from "../modals/CreateEditRecordModal.svelte"
|
||||||
import { Modal } from "components/common/Modal"
|
|
||||||
|
|
||||||
let modalVisible
|
let modal
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<Button text small on:click={() => (modalVisible = true)}>
|
<Button text small on:click={modal.show}>
|
||||||
<Icon name="addrow" />
|
<Icon name="addrow" />
|
||||||
Create New Row
|
Create New Row
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
{#if modalVisible}
|
<Modal bind:this={modal}>
|
||||||
<CreateEditRecordModal bind:visible={modalVisible} />
|
<CreateEditRecordModal />
|
||||||
{/if}
|
</Modal>
|
||||||
|
|
|
@ -3,13 +3,11 @@
|
||||||
import { notifier } from "builderStore/store/notifications"
|
import { notifier } from "builderStore/store/notifications"
|
||||||
import RecordFieldControl from "../RecordFieldControl.svelte"
|
import RecordFieldControl from "../RecordFieldControl.svelte"
|
||||||
import * as api from "../api"
|
import * as api from "../api"
|
||||||
import { Modal } from "components/common/Modal"
|
import { ModalContent } from "@budibase/bbui"
|
||||||
import ErrorsBox from "components/common/ErrorsBox.svelte"
|
import ErrorsBox from "components/common/ErrorsBox.svelte"
|
||||||
|
|
||||||
export let record = {}
|
export let record = {}
|
||||||
export let visible
|
|
||||||
|
|
||||||
let modal
|
|
||||||
let errors = []
|
let errors = []
|
||||||
|
|
||||||
$: creating = record?._id == null
|
$: creating = record?._id == null
|
||||||
|
@ -35,8 +33,7 @@
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Modal
|
<ModalContent
|
||||||
bind:visible
|
|
||||||
title={creating ? 'Create Row' : 'Edit Row'}
|
title={creating ? 'Create Row' : 'Edit Row'}
|
||||||
confirmText={creating ? 'Create Row' : 'Save Row'}
|
confirmText={creating ? 'Create Row' : 'Save Row'}
|
||||||
onConfirm={saveRecord}>
|
onConfirm={saveRecord}>
|
||||||
|
@ -46,4 +43,4 @@
|
||||||
<RecordFieldControl {meta} bind:value={record[key]} />
|
<RecordFieldControl {meta} bind:value={record[key]} />
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
</Modal>
|
</ModalContent>
|
||||||
|
|
|
@ -1,22 +1,21 @@
|
||||||
<script>
|
<script>
|
||||||
import { backendUiStore } from "builderStore"
|
import { backendUiStore } from "builderStore"
|
||||||
import { DropdownMenu, Icon } from "@budibase/bbui"
|
import { DropdownMenu, Icon, Modal } from "@budibase/bbui"
|
||||||
import CreateEditRecordModal from "../modals/CreateEditRecordModal.svelte"
|
import CreateEditRecordModal from "../modals/CreateEditRecordModal.svelte"
|
||||||
import * as api from "../api"
|
import * as api from "../api"
|
||||||
import { notifier } from "builderStore/store/notifications"
|
import { notifier } from "builderStore/store/notifications"
|
||||||
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
||||||
import { Modal } from "components/common/Modal"
|
|
||||||
|
|
||||||
export let row
|
export let row
|
||||||
|
|
||||||
let anchor
|
let anchor
|
||||||
let dropdown
|
let dropdown
|
||||||
let confirmDeleteDialog
|
let confirmDeleteDialog
|
||||||
let editModalVisible
|
let modal
|
||||||
|
|
||||||
function showModal() {
|
function showModal() {
|
||||||
dropdown.hide()
|
dropdown.hide()
|
||||||
editModalVisible = true
|
modal.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
function showDelete() {
|
function showDelete() {
|
||||||
|
@ -52,9 +51,9 @@
|
||||||
okText="Delete Row"
|
okText="Delete Row"
|
||||||
onOk={deleteRow}
|
onOk={deleteRow}
|
||||||
title="Confirm Delete" />
|
title="Confirm Delete" />
|
||||||
{#if editModalVisible}
|
<Modal bind:this={modal}>
|
||||||
<CreateEditRecordModal bind:visible={editModalVisible} record={row} />
|
<CreateEditRecordModal record={row} />
|
||||||
{/if}
|
</Modal>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.ri-more-line:hover {
|
.ri-more-line:hover {
|
||||||
|
|
|
@ -2,25 +2,21 @@
|
||||||
import { goto } from "@sveltech/routify"
|
import { goto } from "@sveltech/routify"
|
||||||
import { backendUiStore } from "builderStore"
|
import { backendUiStore } from "builderStore"
|
||||||
import { notifier } from "builderStore/store/notifications"
|
import { notifier } from "builderStore/store/notifications"
|
||||||
import { Button, Input, Label } from "@budibase/bbui"
|
import { Button, Input, Label, ModalContent, Modal } from "@budibase/bbui"
|
||||||
import Spinner from "components/common/Spinner.svelte"
|
import Spinner from "components/common/Spinner.svelte"
|
||||||
import TableDataImport from "../TableDataImport.svelte"
|
import TableDataImport from "../TableDataImport.svelte"
|
||||||
import analytics from "analytics"
|
import analytics from "analytics"
|
||||||
import { Modal } from "components/common/Modal"
|
|
||||||
|
|
||||||
let visible = false
|
let modal
|
||||||
let name
|
let name
|
||||||
let dataImport
|
let dataImport
|
||||||
let loading = false
|
|
||||||
|
|
||||||
function resetState() {
|
function resetState() {
|
||||||
name = ""
|
name = ""
|
||||||
dataImport = undefined
|
dataImport = undefined
|
||||||
loading = false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function saveTable() {
|
async function saveTable() {
|
||||||
loading = true
|
|
||||||
const model = await backendUiStore.actions.models.save({
|
const model = await backendUiStore.actions.models.save({
|
||||||
name,
|
name,
|
||||||
schema: dataImport.schema || {},
|
schema: dataImport.schema || {},
|
||||||
|
@ -29,28 +25,24 @@
|
||||||
notifier.success(`Table ${name} created successfully.`)
|
notifier.success(`Table ${name} created successfully.`)
|
||||||
$goto(`./model/${model._id}`)
|
$goto(`./model/${model._id}`)
|
||||||
analytics.captureEvent("Table Created", { name })
|
analytics.captureEvent("Table Created", { name })
|
||||||
visible = false
|
|
||||||
resetState()
|
|
||||||
}
|
|
||||||
|
|
||||||
function onClosed() {
|
|
||||||
visible = false
|
|
||||||
resetState()
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Button primary wide on:click={() => (visible = true)}>Create New Table</Button>
|
<Button primary wide on:click={modal.show}>Create New Table</Button>
|
||||||
<Modal
|
<Modal bind:this={modal} on:hide={resetState}>
|
||||||
bind:visible
|
<ModalContent
|
||||||
{loading}
|
|
||||||
title="Create Table"
|
title="Create Table"
|
||||||
on:hide={onClosed}
|
|
||||||
confirmText="Create"
|
confirmText="Create"
|
||||||
onConfirm={saveTable}
|
onConfirm={saveTable}
|
||||||
disabled={!name || (dataImport && !dataImport.valid)}>
|
disabled={!name || (dataImport && !dataImport.valid)}>
|
||||||
<Input data-cy="table-name-input" thin label="Table Name" bind:value={name} />
|
<Input
|
||||||
|
data-cy="table-name-input"
|
||||||
|
thin
|
||||||
|
label="Table Name"
|
||||||
|
bind:value={name} />
|
||||||
<div>
|
<div>
|
||||||
<Label grey extraSmall>Create Table from CSV (Optional)</Label>
|
<Label grey extraSmall>Create Table from CSV (Optional)</Label>
|
||||||
<TableDataImport bind:dataImport />
|
<TableDataImport bind:dataImport />
|
||||||
</div>
|
</div>
|
||||||
|
</ModalContent>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -1,33 +1,27 @@
|
||||||
<script>
|
<script>
|
||||||
import { Modal } from "components/common/Modal"
|
import { Modal, ModalContent } from "@budibase/bbui"
|
||||||
|
|
||||||
export let title = ""
|
export let title = ""
|
||||||
export let body = ""
|
export let body = ""
|
||||||
export let okText = "Confirm"
|
export let okText = "Confirm"
|
||||||
export let cancelText = "Cancel"
|
export let cancelText = "Cancel"
|
||||||
export let onOk = () => {}
|
export let onOk = undefined
|
||||||
export let onCancel = () => {}
|
export let onCancel = undefined
|
||||||
|
|
||||||
let visible = false
|
let modal
|
||||||
|
|
||||||
export const show = () => {
|
export const show = () => {
|
||||||
visible = true
|
modal.show()
|
||||||
}
|
}
|
||||||
export const hide = () => {
|
export const hide = () => {
|
||||||
visible = false
|
modal.hide()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Modal
|
<Modal bind:this={modal} on:hide={onCancel}>
|
||||||
id={title}
|
<ModalContent onConfirm={onOk} {title} confirmText={okText} {cancelText} red>
|
||||||
bind:visible
|
|
||||||
on:hide={onCancel}
|
|
||||||
{title}
|
|
||||||
confirmText={okText}
|
|
||||||
{cancelText}
|
|
||||||
onConfirm={onOk}
|
|
||||||
red>
|
|
||||||
<div class="body">{body}</div>
|
<div class="body">{body}</div>
|
||||||
|
</ModalContent>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
<script>
|
<script>
|
||||||
import SettingsModal from "./SettingsModal.svelte"
|
import SettingsModal from "./SettingsModal.svelte"
|
||||||
import { SettingsIcon } from "components/common/Icons/"
|
import { SettingsIcon } from "components/common/Icons/"
|
||||||
import { Modal } from "components/common/Modal"
|
import { Modal } from "@budibase/bbui"
|
||||||
|
|
||||||
let modalVisible
|
let modal
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<span class="topnavitemright settings" on:click={() => (modalVisible = true)}>
|
<span class="topnavitemright settings" on:click={modal.show}>
|
||||||
<SettingsIcon />
|
<SettingsIcon />
|
||||||
</span>
|
</span>
|
||||||
{#if modalVisible}
|
<Modal bind:this={modal} width="600px">
|
||||||
<SettingsModal bind:visible={modalVisible} />
|
<SettingsModal />
|
||||||
{/if}
|
</Modal>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
span:first-letter {
|
span:first-letter {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { General, Users, DangerZone, APIKeys } from "./tabs"
|
import { General, Users, DangerZone, APIKeys } from "./tabs"
|
||||||
import { Switcher } from "@budibase/bbui"
|
import { Switcher, ModalContent } from "@budibase/bbui"
|
||||||
import { Modal } from "components/common/Modal"
|
|
||||||
|
|
||||||
const tabs = [
|
const tabs = [
|
||||||
{
|
{
|
||||||
|
@ -26,17 +25,13 @@
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
export let visible
|
|
||||||
|
|
||||||
let value = "GENERAL"
|
let value = "GENERAL"
|
||||||
|
|
||||||
$: selectedTab = tabs.find(tab => tab.key === value).component
|
$: selectedTab = tabs.find(tab => tab.key === value).component
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Modal
|
<ModalContent
|
||||||
title="Settings"
|
title="Settings"
|
||||||
wide
|
|
||||||
bind:visible
|
|
||||||
showConfirmButton={false}
|
showConfirmButton={false}
|
||||||
showCancelButton={false}>
|
showCancelButton={false}>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
@ -44,7 +39,7 @@
|
||||||
<svelte:component this={selectedTab} />
|
<svelte:component this={selectedTab} />
|
||||||
</Switcher>
|
</Switcher>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</ModalContent>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.container :global(section > header) {
|
.container :global(section > header) {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import { writable } from "svelte/store"
|
import { writable } from "svelte/store"
|
||||||
import { Modal } from "components/common/Modal"
|
|
||||||
import { store, automationStore, backendUiStore } from "builderStore"
|
import { store, automationStore, backendUiStore } from "builderStore"
|
||||||
import { string, object } from "yup"
|
import { string, object } from "yup"
|
||||||
import api, { get } from "builderStore/api"
|
import api, { get } from "builderStore/api"
|
||||||
|
@ -18,7 +17,6 @@
|
||||||
//Move this to context="module" once svelte-forms is updated so that it can bind to stores correctly
|
//Move this to context="module" once svelte-forms is updated so that it can bind to stores correctly
|
||||||
const createAppStore = writable({ currentStep: 0, values: {} })
|
const createAppStore = writable({ currentStep: 0, values: {} })
|
||||||
|
|
||||||
export let visible
|
|
||||||
export let hasKey
|
export let hasKey
|
||||||
export let template
|
export let template
|
||||||
|
|
||||||
|
@ -201,13 +199,7 @@
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Modal
|
<div class="container">
|
||||||
bind:visible
|
|
||||||
wide
|
|
||||||
padded={false}
|
|
||||||
showCancelButton={false}
|
|
||||||
showConfirmButton={false}>
|
|
||||||
<div class="container">
|
|
||||||
<div class="sidebar">
|
<div class="sidebar">
|
||||||
{#each steps as { active, done }, i}
|
{#each steps as { active, done }, i}
|
||||||
<Indicator
|
<Indicator
|
||||||
|
@ -261,8 +253,7 @@
|
||||||
<span class="spinner-text">Creating your app...</span>
|
<span class="spinner-text">Creating your app...</span>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.container {
|
.container {
|
||||||
|
|
|
@ -3,21 +3,18 @@
|
||||||
import {
|
import {
|
||||||
TextButton,
|
TextButton,
|
||||||
Button,
|
Button,
|
||||||
Heading,
|
|
||||||
Body,
|
Body,
|
||||||
Spacer,
|
|
||||||
DropdownMenu,
|
DropdownMenu,
|
||||||
|
ModalContent,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import { AddIcon, ArrowDownIcon } from "components/common/Icons/"
|
import { AddIcon, ArrowDownIcon } from "components/common/Icons/"
|
||||||
import { EVENT_TYPE_MEMBER_NAME } from "../../common/eventHandlers"
|
import { EVENT_TYPE_MEMBER_NAME } from "../../common/eventHandlers"
|
||||||
import actionTypes from "./actions"
|
import actionTypes from "./actions"
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
import { Modal } from "components/common/Modal"
|
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
|
|
||||||
export let event
|
export let event
|
||||||
export let visible
|
|
||||||
|
|
||||||
let addActionButton
|
let addActionButton
|
||||||
let addActionDropdown
|
let addActionDropdown
|
||||||
|
@ -60,12 +57,7 @@
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Modal
|
<ModalContent title="Actions" confirmText="Save" onConfirm={saveEventData}>
|
||||||
bind:visible
|
|
||||||
title="Actions"
|
|
||||||
wide
|
|
||||||
confirmText="Save"
|
|
||||||
onConfirm={saveEventData}>
|
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<div bind:this={addActionButton}>
|
<div bind:this={addActionButton}>
|
||||||
<TextButton text small blue on:click={addActionDropdown.show}>
|
<TextButton text small blue on:click={addActionDropdown.show}>
|
||||||
|
@ -121,7 +113,7 @@
|
||||||
<div slot="footer">
|
<div slot="footer">
|
||||||
<a href="https://docs.budibase.com">Learn more about Actions</a>
|
<a href="https://docs.budibase.com">Learn more about Actions</a>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</ModalContent>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.action-header {
|
.action-header {
|
||||||
|
|
|
@ -1,23 +1,17 @@
|
||||||
<script>
|
<script>
|
||||||
import { Button, Modal } from "@budibase/bbui"
|
import { Button, Modal } from "@budibase/bbui"
|
||||||
import EventEditorModal from "./EventEditorModal.svelte"
|
import EventEditorModal from "./EventEditorModal.svelte"
|
||||||
import { createEventDispatcher, onMount } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
|
|
||||||
export let value
|
export let value
|
||||||
export let name
|
export let name
|
||||||
|
|
||||||
let modalVisible = false
|
let modal
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Button secondary small on:click={() => (modalVisible = true)}>
|
<Button secondary small on:click={modal.show}>Define Actions</Button>
|
||||||
Define Actions
|
|
||||||
</Button>
|
|
||||||
|
|
||||||
{#if modalVisible}
|
<Modal bind:this={modal}>
|
||||||
<EventEditorModal
|
<EventEditorModal event={value} eventType={name} on:change />
|
||||||
bind:visible={modalVisible}
|
</Modal>
|
||||||
event={value}
|
|
||||||
eventType={name}
|
|
||||||
on:change />
|
|
||||||
{/if}
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { keys, map, includes, filter } from "lodash/fp"
|
import { keys, map, includes, filter } from "lodash/fp"
|
||||||
import EventEditorModal from "./EventEditorModal.svelte"
|
import EventEditorModal from "./EventEditorModal.svelte"
|
||||||
import { Modal } from "components/common/Modal"
|
import { Modal } from "@budibase/bbui"
|
||||||
|
|
||||||
export const EVENT_TYPE = "event"
|
export const EVENT_TYPE = "event"
|
||||||
export let component
|
export let component
|
||||||
|
@ -47,11 +47,8 @@
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Modal bind:this={modal}>
|
<Modal bind:this={modal} width="600px">
|
||||||
<EventEditorModal
|
<EventEditorModal eventOptions={events} event={selectedEvent} />
|
||||||
eventOptions={events}
|
|
||||||
event={selectedEvent}
|
|
||||||
on:hide={() => (selectedEvent = null)} />
|
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
<script>
|
<script>
|
||||||
import { store, backendUiStore } from "builderStore"
|
import { store } from "builderStore"
|
||||||
import ComponentsHierarchy from "components/userInterface/ComponentsHierarchy.svelte"
|
import ComponentsHierarchy from "components/userInterface/ComponentsHierarchy.svelte"
|
||||||
import PageLayout from "components/userInterface/PageLayout.svelte"
|
import PageLayout from "components/userInterface/PageLayout.svelte"
|
||||||
import PagesList from "components/userInterface/PagesList.svelte"
|
import PagesList from "components/userInterface/PagesList.svelte"
|
||||||
import NewScreen from "components/userInterface/NewScreen.svelte"
|
import NewScreenModal from "components/userInterface/NewScreenModal.svelte"
|
||||||
import { Button } from "@budibase/bbui"
|
import { Button, Spacer, Modal } from "@budibase/bbui"
|
||||||
import { Spacer } from "@budibase/bbui"
|
|
||||||
|
|
||||||
let modalVisible = false
|
let modal
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<PagesList />
|
<PagesList />
|
||||||
|
|
||||||
<Spacer medium />
|
<Spacer medium />
|
||||||
<Button primary wide on:click={() => (modalVisible = true)}>
|
<Button primary wide on:click={modal.show}>Create New Screen</Button>
|
||||||
Create New Screen
|
|
||||||
</Button>
|
|
||||||
<Spacer medium />
|
<Spacer medium />
|
||||||
<PageLayout layout={$store.pages[$store.currentPageName]} />
|
<PageLayout layout={$store.pages[$store.currentPageName]} />
|
||||||
|
|
||||||
|
@ -23,38 +20,6 @@
|
||||||
<ComponentsHierarchy screens={$store.screens} />
|
<ComponentsHierarchy screens={$store.screens} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if modalVisible}
|
<Modal bind:this={modal}>
|
||||||
<NewScreen bind:visible={modalVisible} />
|
<NewScreenModal />
|
||||||
{/if}
|
</Modal>
|
||||||
|
|
||||||
<style>
|
|
||||||
.newscreen {
|
|
||||||
cursor: pointer;
|
|
||||||
border: 1px solid var(--purple);
|
|
||||||
border-radius: 5px;
|
|
||||||
width: 100%;
|
|
||||||
height: 36px;
|
|
||||||
padding: 8px 16px;
|
|
||||||
margin: 20px 0px 12px 0px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
background: var(--purple);
|
|
||||||
color: var(--white);
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 500;
|
|
||||||
transition: all 3ms;
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.newscreen:hover {
|
|
||||||
background: var(--purple-light);
|
|
||||||
color: var(--purple);
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon {
|
|
||||||
color: var(--ink);
|
|
||||||
font-size: 16px;
|
|
||||||
margin-right: 4px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { store } from "builderStore"
|
import { store } from "builderStore"
|
||||||
import { pipe } from "components/common/core"
|
import { Input, Select, ModalContent } from "@budibase/bbui"
|
||||||
import { isRootComponent } from "./pagesParsing/searchComponents"
|
import { find, filter, some } from "lodash/fp"
|
||||||
import { splitName } from "./pagesParsing/splitRootComponentName.js"
|
|
||||||
import { Input, Select, Button, Spacer, ModalContent } from "@budibase/bbui"
|
|
||||||
import { find, filter, some, map, includes } from "lodash/fp"
|
|
||||||
import { assign } from "lodash"
|
|
||||||
|
|
||||||
let dialog
|
let dialog
|
||||||
let layoutComponents
|
let layoutComponents
|
||||||
|
|
|
@ -4,19 +4,20 @@
|
||||||
import PageLayout from "./PageLayout.svelte"
|
import PageLayout from "./PageLayout.svelte"
|
||||||
import PagesList from "./PagesList.svelte"
|
import PagesList from "./PagesList.svelte"
|
||||||
import { store } from "builderStore"
|
import { store } from "builderStore"
|
||||||
import NewScreen from "./NewScreen.svelte"
|
import NewScreenModal from "./NewScreenModal.svelte"
|
||||||
import CurrentItemPreview from "./CurrentItemPreview.svelte"
|
import CurrentItemPreview from "./AppPreview/CurrentItemPreview.svelte"
|
||||||
import SettingsView from "./SettingsView.svelte"
|
import SettingsView from "./SettingsView.svelte"
|
||||||
import ComponentsPaneSwitcher from "./ComponentsPaneSwitcher.svelte"
|
import ComponentsPaneSwitcher from "./ComponentsPaneSwitcher.svelte"
|
||||||
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
||||||
import { last } from "lodash/fp"
|
import { last } from "lodash/fp"
|
||||||
import { AddIcon } from "components/common/Icons"
|
import { AddIcon } from "components/common/Icons"
|
||||||
|
import { Modal } from "@budibase/bbui"
|
||||||
|
|
||||||
let newScreenPicker
|
let newScreenPicker
|
||||||
let confirmDeleteDialog
|
let confirmDeleteDialog
|
||||||
let componentToDelete = ""
|
let componentToDelete = ""
|
||||||
let settingsView
|
let settingsView
|
||||||
let modalVisible = false
|
let modal
|
||||||
|
|
||||||
const settings = () => {
|
const settings = () => {
|
||||||
settingsView.show()
|
settingsView.show()
|
||||||
|
@ -26,30 +27,24 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="root">
|
<div class="root">
|
||||||
|
|
||||||
<div class="ui-nav">
|
<div class="ui-nav">
|
||||||
|
|
||||||
<div class="pages-list-container">
|
<div class="pages-list-container">
|
||||||
<div class="nav-header">
|
<div class="nav-header">
|
||||||
<span class="navigator-title">Navigator</span>
|
<span class="navigator-title">Navigator</span>
|
||||||
|
|
||||||
<span class="components-nav-page">Pages</span>
|
<span class="components-nav-page">Pages</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="nav-items-container">
|
<div class="nav-items-container">
|
||||||
<PagesList />
|
<PagesList />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<PageLayout layout={$store.pages[$store.currentPageName]} />
|
<PageLayout layout={$store.pages[$store.currentPageName]} />
|
||||||
|
|
||||||
<div class="components-list-container">
|
<div class="components-list-container">
|
||||||
<div class="nav-group-header">
|
<div class="nav-group-header">
|
||||||
<span class="components-nav-header" style="margin-top: 0;">
|
<span class="components-nav-header" style="margin-top: 0;">
|
||||||
Screens
|
Screens
|
||||||
</span>
|
</span>
|
||||||
<div>
|
<div>
|
||||||
<button on:click={() => (modalVisible = true)}>
|
<button on:click={modal.show}>
|
||||||
<AddIcon />
|
<AddIcon />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -58,24 +53,21 @@
|
||||||
<ComponentsHierarchy screens={$store.screens} />
|
<ComponentsHierarchy screens={$store.screens} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="preview-pane">
|
<div class="preview-pane">
|
||||||
<CurrentItemPreview />
|
<CurrentItemPreview />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if $store.currentFrontEndType === 'screen' || $store.currentFrontEndType === 'page'}
|
{#if $store.currentFrontEndType === 'screen' || $store.currentFrontEndType === 'page'}
|
||||||
<div class="components-pane">
|
<div class="components-pane">
|
||||||
<ComponentsPaneSwitcher />
|
<ComponentsPaneSwitcher />
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if modalVisible}
|
<Modal bind:this={modal}>
|
||||||
<NewScreen bind:visible={modalVisible} />
|
<NewScreenModal />
|
||||||
{/if}
|
</Modal>
|
||||||
|
|
||||||
<SettingsView bind:this={settingsView} />
|
<SettingsView bind:this={settingsView} />
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
@ -7,15 +7,14 @@
|
||||||
import { get } from "builderStore/api"
|
import { get } from "builderStore/api"
|
||||||
import Spinner from "components/common/Spinner.svelte"
|
import Spinner from "components/common/Spinner.svelte"
|
||||||
import CreateAppModal from "components/start/CreateAppModal.svelte"
|
import CreateAppModal from "components/start/CreateAppModal.svelte"
|
||||||
import { Button, Heading } from "@budibase/bbui"
|
import { Button, Heading, Modal } from "@budibase/bbui"
|
||||||
import TemplateList from "components/start/TemplateList.svelte"
|
import TemplateList from "components/start/TemplateList.svelte"
|
||||||
import analytics from "analytics"
|
import analytics from "analytics"
|
||||||
import { Modal } from "components/common/Modal"
|
|
||||||
|
|
||||||
let promise = getApps()
|
let promise = getApps()
|
||||||
let hasKey
|
let hasKey
|
||||||
let template
|
let template
|
||||||
let modalVisible = false
|
let modal
|
||||||
|
|
||||||
async function getApps() {
|
async function getApps() {
|
||||||
const res = await get("/api/applications")
|
const res = await get("/api/applications")
|
||||||
|
@ -42,13 +41,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!keys.budibase) {
|
if (!keys.budibase) {
|
||||||
modalVisible = true
|
modal.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectTemplate(newTemplate) {
|
function selectTemplate(newTemplate) {
|
||||||
template = newTemplate
|
template = newTemplate
|
||||||
modalVisible = true
|
modal.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
checkIfKeysAndApps()
|
checkIfKeysAndApps()
|
||||||
|
@ -57,9 +56,7 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<Heading medium black>Welcome to the Budibase Beta</Heading>
|
<Heading medium black>Welcome to the Budibase Beta</Heading>
|
||||||
<Button primary purple on:click={() => (modalVisible = true)}>
|
<Button primary purple on:click={modal.show}>Create New Web App</Button>
|
||||||
Create New Web App
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="banner">
|
<div class="banner">
|
||||||
|
@ -72,12 +69,12 @@
|
||||||
<TemplateList onSelect={selectTemplate} />
|
<TemplateList onSelect={selectTemplate} />
|
||||||
|
|
||||||
<AppList />
|
<AppList />
|
||||||
|
|
||||||
{#if modalVisible}
|
|
||||||
<CreateAppModal bind:visible={modalVisible} {hasKey} {template} />
|
|
||||||
{/if}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<Modal bind:this={modal} padding={false} width="600px">
|
||||||
|
<CreateAppModal {hasKey} {template} />
|
||||||
|
</Modal>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.container {
|
.container {
|
||||||
display: grid;
|
display: grid;
|
||||||
|
|
Loading…
Reference in New Issue