formatting
This commit is contained in:
parent
e83816df1c
commit
c8dd48b507
|
@ -29,4 +29,3 @@
|
|||
<Modal>
|
||||
<Router {routes} />
|
||||
</Modal>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { cloneDeep, values } from "lodash/fp"
|
||||
import { backendUiStore } from "builderStore";
|
||||
import { backendUiStore } from "builderStore"
|
||||
import * as backendStoreActions from "./backend"
|
||||
import { writable, get } from "svelte/store"
|
||||
import api from "../api"
|
||||
|
@ -194,7 +194,7 @@ const setCurrentScreen = store => screenName => {
|
|||
const deleteScreen = store => name => {
|
||||
store.update(s => {
|
||||
const components = s.components.filter(c => c.name !== name)
|
||||
const screens = s.screens.filter(c => c.name !== name);
|
||||
const screens = s.screens.filter(c => c.name !== name)
|
||||
|
||||
s.components = components
|
||||
s.screens = screens
|
||||
|
@ -351,12 +351,16 @@ const addChildComponent = store => (componentToAdd, presetName) => {
|
|||
|
||||
const presetProps = presetName ? component.presets[presetName] : {}
|
||||
|
||||
const instanceId = get(backendUiStore).selectedDatabase._id;
|
||||
const instanceId = get(backendUiStore).selectedDatabase._id
|
||||
|
||||
const newComponent = createProps(component, {
|
||||
...presetProps,
|
||||
_instanceId: instanceId
|
||||
}, state)
|
||||
const newComponent = createProps(
|
||||
component,
|
||||
{
|
||||
...presetProps,
|
||||
_instanceId: instanceId,
|
||||
},
|
||||
state
|
||||
)
|
||||
|
||||
state.currentComponentInfo._children = state.currentComponentInfo._children.concat(
|
||||
newComponent.props
|
||||
|
|
|
@ -9,10 +9,7 @@
|
|||
let databaseName
|
||||
|
||||
async function createDatabase() {
|
||||
const response = await api.createDatabase(
|
||||
$store.appId,
|
||||
databaseName
|
||||
)
|
||||
const response = await api.createDatabase($store.appId, databaseName)
|
||||
store.createDatabaseForApp(response)
|
||||
onClosed()
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
import { store } from "builderStore";
|
||||
import { store } from "builderStore"
|
||||
import Modal from "../../common/Modal.svelte"
|
||||
import HandlerSelector from "./HandlerSelector.svelte"
|
||||
import IconButton from "../../common/IconButton.svelte"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
import { store } from "builderStore";
|
||||
import { store } from "builderStore"
|
||||
import Checkbox from "../common/Checkbox.svelte"
|
||||
import Textbox from "../common/Textbox.svelte"
|
||||
import Dropdown from "../common/Dropdown.svelte"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
import { backendUiStore } from "builderStore";
|
||||
import { backendUiStore } from "builderStore"
|
||||
import IconButton from "../common/IconButton.svelte"
|
||||
import Input from "../common/Input.svelte"
|
||||
import PropertyCascader from "./PropertyCascader"
|
||||
|
@ -13,7 +13,6 @@
|
|||
export let styleBindingProperty = ""
|
||||
|
||||
$: bindOptionToStyle = !!styleBindingProperty
|
||||
|
||||
</script>
|
||||
|
||||
<div class="unbound-container">
|
||||
|
|
|
@ -25,7 +25,7 @@ export const createProps = (componentDefinition, derivedFromProps) => {
|
|||
_id: uuid(),
|
||||
_component: componentDefinition._component,
|
||||
_styles: { position: {}, layout: {} },
|
||||
_code: ""
|
||||
_code: "",
|
||||
}
|
||||
|
||||
const errors = []
|
||||
|
|
|
@ -22,5 +22,5 @@ export const TYPE_MAP = {
|
|||
},
|
||||
models: {
|
||||
default: [],
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import "./global.css"
|
||||
import "./fonts.css"
|
||||
import "./budibase.css";
|
||||
import "./budibase.css"
|
||||
import "/assets/roboto-v20-latin-ext_latin-300"
|
||||
import "/assets/roboto-v20-latin-ext_latin-400"
|
||||
import "/assets/roboto-v20-latin-ext_latin-500"
|
||||
|
|
|
@ -15,7 +15,7 @@ export const loadBudibase = async opts => {
|
|||
// TODO: update
|
||||
const user = {}
|
||||
|
||||
const componentLibraryModules = opts && opts.componentLibraries || {}
|
||||
const componentLibraryModules = (opts && opts.componentLibraries) || {}
|
||||
|
||||
const libraries = frontendDefinition.libraries || []
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ const env = require("../../environment")
|
|||
exports.create = async function(ctx) {
|
||||
const instanceName = ctx.request.body.name
|
||||
const uid = uuid.v4().replace(/-/g, "")
|
||||
const instanceId = `inst_${ctx.params.applicationId.substring(0,7)}_${uid}`
|
||||
const instanceId = `inst_${ctx.params.applicationId.substring(0, 7)}_${uid}`
|
||||
const { applicationId } = ctx.params
|
||||
const clientId = env.CLIENT_ID
|
||||
const db = new CouchDB(instanceId)
|
||||
|
|
|
@ -3,7 +3,7 @@ const { create, destroy } = require("../../../db/clientDb")
|
|||
const supertest = require("supertest")
|
||||
const app = require("../../../app")
|
||||
|
||||
const TEST_CLIENT_ID = "test-client-id";
|
||||
const TEST_CLIENT_ID = "test-client-id"
|
||||
|
||||
exports.supertest = async () => {
|
||||
let request
|
||||
|
@ -51,7 +51,7 @@ exports.createModel = async (request, instanceId, model) => {
|
|||
return res.body
|
||||
}
|
||||
|
||||
exports.createClientDatabase = async () => await create(TEST_CLIENT_ID);
|
||||
exports.createClientDatabase = async () => await create(TEST_CLIENT_ID)
|
||||
|
||||
exports.createApplication = async (request, name = "test_application") => {
|
||||
const res = await request
|
||||
|
@ -63,7 +63,7 @@ exports.createApplication = async (request, name = "test_application") => {
|
|||
return res.body
|
||||
}
|
||||
|
||||
exports.destroyClientDatabase = async () => await destroy(TEST_CLIENT_ID);
|
||||
exports.destroyClientDatabase = async () => await destroy(TEST_CLIENT_ID)
|
||||
|
||||
exports.createInstance = async (request, appId) => {
|
||||
const res = await request
|
||||
|
|
|
@ -7,15 +7,15 @@ const COUCH_DB_URL = env.COUCH_DB_URL || `leveldb://${budibaseAppsDir()}/.data/`
|
|||
const isInMemory = env.NODE_ENV === "jest"
|
||||
|
||||
let POUCH_DB_DEFAULTS = {
|
||||
prefix: COUCH_DB_URL
|
||||
};
|
||||
prefix: COUCH_DB_URL,
|
||||
}
|
||||
|
||||
if (isInMemory) {
|
||||
PouchDB.plugin(require("pouchdb-adapter-memory"))
|
||||
POUCH_DB_DEFAULTS = {
|
||||
prefix: undefined,
|
||||
adapter: "memory"
|
||||
};
|
||||
adapter: "memory",
|
||||
}
|
||||
}
|
||||
|
||||
const Pouch = PouchDB.defaults(POUCH_DB_DEFAULTS)
|
||||
|
|
|
@ -1,47 +1,46 @@
|
|||
const { app, BrowserWindow } = require("electron");
|
||||
const { join } = require("path");
|
||||
const { homedir } = require("os");
|
||||
const isDev = require("electron-is-dev");
|
||||
const { autoUpdater } = require("electron-updater");
|
||||
const unhandled = require("electron-unhandled");
|
||||
const { app, BrowserWindow } = require("electron")
|
||||
const { join } = require("path")
|
||||
const { homedir } = require("os")
|
||||
const isDev = require("electron-is-dev")
|
||||
const { autoUpdater } = require("electron-updater")
|
||||
const unhandled = require("electron-unhandled")
|
||||
|
||||
require("dotenv").config({ path: join(homedir(), ".budibase", ".env") });
|
||||
require("dotenv").config({ path: join(homedir(), ".budibase", ".env") })
|
||||
|
||||
if (isDev) {
|
||||
unhandled({
|
||||
showDialog: true
|
||||
});
|
||||
showDialog: true,
|
||||
})
|
||||
}
|
||||
|
||||
const APP_URL = "http://localhost:4001";
|
||||
const APP_TITLE = "Budibase Builder";
|
||||
const APP_URL = "http://localhost:4001"
|
||||
const APP_TITLE = "Budibase Builder"
|
||||
|
||||
let win
|
||||
|
||||
function createWindow() {
|
||||
app.server = require("./app");
|
||||
win = new BrowserWindow({ width: 1920, height: 1080 });
|
||||
win.setTitle(APP_TITLE);
|
||||
win.loadURL(APP_URL);
|
||||
app.server = require("./app")
|
||||
win = new BrowserWindow({ width: 1920, height: 1080 })
|
||||
win.setTitle(APP_TITLE)
|
||||
win.loadURL(APP_URL)
|
||||
if (isDev) {
|
||||
win.webContents.openDevTools();
|
||||
win.webContents.openDevTools()
|
||||
} else {
|
||||
autoUpdater.checkForUpdatesAndNotify();
|
||||
autoUpdater.checkForUpdatesAndNotify()
|
||||
}
|
||||
}
|
||||
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on("window-all-closed", () => {
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== "darwin") app.quit();
|
||||
});
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== "darwin") app.quit()
|
||||
})
|
||||
|
||||
app.on("activate", () => {
|
||||
// On macOS it's common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (win === null) createWindow();
|
||||
});
|
||||
// On macOS it's common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (win === null) createWindow()
|
||||
})
|
||||
|
|
|
@ -95,8 +95,8 @@ const buildFrontendAppDefinition = async (config, appId, pageName, pkg) => {
|
|||
screens: pkg.screens,
|
||||
libraries: [
|
||||
"@budibase/materialdesign-components",
|
||||
"@budibase/standard-components"
|
||||
]
|
||||
"@budibase/standard-components",
|
||||
],
|
||||
})
|
||||
|
||||
await writeFile(
|
||||
|
|
|
@ -19,6 +19,6 @@ export default {
|
|||
resolve({
|
||||
browser: true,
|
||||
}),
|
||||
commonjs()
|
||||
commonjs(),
|
||||
],
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<script>
|
||||
import { onMount } from "svelte";
|
||||
import FusionCharts from "fusioncharts";
|
||||
import Charts from "fusioncharts/fusioncharts.charts";
|
||||
import FusionTheme from "fusioncharts/themes/fusioncharts.theme.fusion";
|
||||
import SvelteFC, {fcRoot} from 'svelte-fusioncharts';
|
||||
import { onMount } from "svelte"
|
||||
import FusionCharts from "fusioncharts"
|
||||
import Charts from "fusioncharts/fusioncharts.charts"
|
||||
import FusionTheme from "fusioncharts/themes/fusioncharts.theme.fusion"
|
||||
import SvelteFC, { fcRoot } from "svelte-fusioncharts"
|
||||
|
||||
fcRoot(FusionCharts, Charts, FusionTheme);
|
||||
fcRoot(FusionCharts, Charts, FusionTheme)
|
||||
|
||||
export let _bb
|
||||
export let _instanceId
|
||||
|
@ -16,12 +16,12 @@
|
|||
|
||||
$: chartConfigs = {
|
||||
type,
|
||||
width: '600',
|
||||
height: '400',
|
||||
dataFormat: 'json',
|
||||
width: "600",
|
||||
height: "400",
|
||||
dataFormat: "json",
|
||||
dataSource: {
|
||||
data: $store[model._id] || []
|
||||
}
|
||||
data: $store[model._id] || [],
|
||||
},
|
||||
}
|
||||
|
||||
async function fetchData() {
|
||||
|
@ -41,7 +41,6 @@
|
|||
onMount(async () => {
|
||||
await fetchData()
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<div id="container">
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
let username
|
||||
let password
|
||||
let newModel = {
|
||||
modelId: model._id
|
||||
modelId: model._id,
|
||||
}
|
||||
let store = _bb.store
|
||||
|
||||
|
@ -16,16 +16,13 @@
|
|||
|
||||
async function save() {
|
||||
const SAVE_RECORD_URL = `/api/${_instanceId}/records`
|
||||
const response = await _bb.api.post(SAVE_RECORD_URL, newModel);
|
||||
const json = await response.json();
|
||||
const response = await _bb.api.post(SAVE_RECORD_URL, newModel)
|
||||
const json = await response.json()
|
||||
|
||||
store.update(state => {
|
||||
state[model._id] = [
|
||||
...state[model._id],
|
||||
json
|
||||
]
|
||||
state[model._id] = [...state[model._id], json]
|
||||
return state
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
const handleInput = field => event => {
|
||||
|
@ -56,15 +53,12 @@
|
|||
<label class="form-label" for="form-stacked-text">{field}</label>
|
||||
<input
|
||||
class="uk-input"
|
||||
type={model.schema[field].type === "string" ? "text" : model.schema[field].type}
|
||||
on:change={handleInput(field)}
|
||||
/>
|
||||
type={model.schema[field].type === 'string' ? 'text' : model.schema[field].type}
|
||||
on:change={handleInput(field)} />
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
<button on:click={save}>
|
||||
SAVE
|
||||
</button>
|
||||
<button on:click={save}>SAVE</button>
|
||||
</form>
|
||||
|
||||
<style>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
store.update(state => {
|
||||
state[model._id] = json
|
||||
return state
|
||||
});
|
||||
})
|
||||
} else {
|
||||
throw new Error("Failed to fetch records.", response)
|
||||
}
|
||||
|
@ -31,21 +31,14 @@
|
|||
})
|
||||
</script>
|
||||
|
||||
<section
|
||||
class:grid={layout === "grid"}
|
||||
class:list={layout === "list"}
|
||||
>
|
||||
<section class:grid={layout === 'grid'} class:list={layout === 'list'}>
|
||||
{#each data as data}
|
||||
<div class="data-card">
|
||||
<ul>
|
||||
{#each Object.keys(data) as key}
|
||||
<li>
|
||||
<span class="data-key">
|
||||
{key}:
|
||||
</span>
|
||||
<span class="data-value">
|
||||
{data[key]}
|
||||
</span>
|
||||
<span class="data-key">{key}:</span>
|
||||
<span class="data-value">{data[key]}</span>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
import { GoogleMap } from '@beyonk/svelte-googlemaps'
|
||||
import { GoogleMap } from "@beyonk/svelte-googlemaps"
|
||||
|
||||
// export let _bb
|
||||
// export let onLoad
|
||||
|
@ -28,4 +28,4 @@
|
|||
// }
|
||||
</script>
|
||||
|
||||
<GoogleMap apiKey={"AIzaSyCPJ_eiSIbhRMmKBiVYXgh4HFHmbC4ZL5U"} />
|
||||
<GoogleMap apiKey={'AIzaSyCPJ_eiSIbhRMmKBiVYXgh4HFHmbC4ZL5U'} />
|
||||
|
|
|
@ -5,13 +5,11 @@
|
|||
let searchValue = ""
|
||||
|
||||
function search() {
|
||||
const SEARCH_URL =
|
||||
_bb.api.get(``);
|
||||
const SEARCH_URL = _bb.api.get(``)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<input type="text" bind:value={searchValue}>
|
||||
<input type="text" bind:value={searchValue} />
|
||||
<button on:click={search}>Search</button>
|
||||
</div>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
store.update(state => {
|
||||
state[model._id] = json
|
||||
return state
|
||||
});
|
||||
})
|
||||
|
||||
headers = Object.keys(json[0]).filter(key => !key.startsWith("_"))
|
||||
} else {
|
||||
|
|
|
@ -9,13 +9,13 @@
|
|||
|
||||
const fs = require("fs")
|
||||
const { resolve } = require("path")
|
||||
const rimraf = require("rimraf");
|
||||
const rimraf = require("rimraf")
|
||||
const {
|
||||
budibaseTempDir,
|
||||
} = require("../packages/server/src/utilities/budibaseDir")
|
||||
const devDir = budibaseTempDir()
|
||||
|
||||
rimraf.sync(devDir);
|
||||
rimraf.sync(devDir)
|
||||
fs.mkdirSync(`${devDir}/@budibase`, { recursive: true })
|
||||
|
||||
const SYMLINK_PATHS = [
|
||||
|
|
Loading…
Reference in New Issue