1
0
Fork 0
mirror of synced 2024-10-02 01:56:57 +13:00

Merge branch 'master' of https://github.com/Budibase/budibase into feature/model-view-select

This commit is contained in:
cmack 2020-08-25 11:18:08 +01:00
commit e7f7a705e2
23 changed files with 83 additions and 188 deletions

View file

@ -1,5 +1,5 @@
{
"version": "0.1.17",
"version": "0.1.19",
"npmClient": "yarn",
"packages": [
"packages/*"

View file

@ -38,10 +38,10 @@ context('Create a Table', () => {
it('edits a record', () => {
cy.get("tbody .ri-more-line").click()
cy.get("[data-cy=edit-row]").click()
cy.get(".actions input").type("updatedRecord")
cy.get(".actions input").type("Updated")
cy.contains("Save").click()
cy.contains('updatedRecord').should('have.text', 'updatedRecord')
cy.contains('RoverUpdated').should('have.text', 'RoverUpdated')
})
it('deletes a record', () => {
@ -49,7 +49,7 @@ context('Create a Table', () => {
cy.get("[data-cy=delete-row]").click()
cy.get(".modal-actions").contains("Delete").click()
cy.contains('updatedRecord').should('not.exist')
cy.contains('RoverUpdated').should('not.exist')
})
it('deletes a column', () => {

View file

@ -1,6 +1,6 @@
{
"name": "@budibase/builder",
"version": "0.1.17",
"version": "0.1.19",
"license": "AGPL-3.0",
"private": true,
"scripts": {
@ -57,8 +57,8 @@
]
},
"dependencies": {
"@budibase/bbui": "^1.24.2",
"@budibase/client": "^0.1.17",
"@budibase/bbui": "^1.24.1",
"@budibase/client": "^0.1.19",
"@budibase/colorpicker": "^1.0.1",
"@sentry/browser": "5.19.1",
"@svelteschool/svelte-forms": "^0.7.0",

View file

@ -93,7 +93,13 @@ export const getBackendUiStore = () => {
saveField: ({ originalName, field }) => {
store.update(state => {
// delete the original if renaming
delete state.draftModel.schema[originalName]
if (originalName) {
delete state.draftModel.schema[originalName]
state.draftModel._rename = {
old: originalName,
updated: field.name,
}
}
state.draftModel.schema[field.name] = cloneDeep(field)

View file

@ -24,7 +24,7 @@
})
</script>
<div class="uk-margin">
<div class="bb-margin-m">
<label class="uk-form-label">{label}</label>
<div class="uk-form-controls">
<input

View file

@ -45,9 +45,9 @@
$: sort = $backendUiStore.sort
$: sorted = sort ? fsort(data)[sort.direction](sort.column) : data
$: headers = Object.keys($backendUiStore.selectedModel.schema).filter(
id => !INTERNAL_HEADERS.includes(id)
)
$: headers = Object.keys($backendUiStore.selectedModel.schema)
.sort()
.filter(id => !INTERNAL_HEADERS.includes(id))
$: schema = $backendUiStore.selectedModel.schema
</script>
@ -178,7 +178,6 @@
.popovers {
display: flex;
gap: var(--spacing-m);
}
.no-data {

View file

@ -132,7 +132,10 @@
.popovers {
display: flex;
gap: var(--spacing-l);
}
:global(.popovers > div) {
margin-right: var(--spacing-m);
}
.no-data {

View file

@ -46,6 +46,7 @@
const { type, constraints } = fieldDefinitions[
event.target.value.toUpperCase()
]
field.type = type
field.constraints = constraints
}
@ -58,9 +59,9 @@
secondary
thin
on:change={handleFieldConstraints}
bind:value={field.value}>
bind:value={field.type}>
{#each Object.values(fieldDefinitions) as field}
<option value={field.value}>{field.name}</option>
<option value={field.type}>{field.name}</option>
{/each}
</Select>
@ -73,28 +74,28 @@
on:change={() => (field.constraints.presence.allowEmpty = required)} />
</div>
{#if field.value === 'string' && field.constraints}
{#if field.type === 'string' && field.constraints}
<NumberBox
label="Max Length"
bind:value={field.constraints.length.maximum} />
<ValuesList
label="Categories"
bind:values={field.constraints.inclusion} />
{:else if field.value === 'datetime' && field.constraints}
{:else if field.type === 'datetime' && field.constraints}
<DatePicker
label="Min Value"
bind:value={field.constraints.datetime.earliest} />
<DatePicker
label="Max Value"
bind:value={field.constraints.datetime.latest} />
{:else if field.value === 'number' && field.constraints}
{:else if field.type === 'number' && field.constraints}
<NumberBox
label="Min Value"
bind:value={field.constraints.numericality.greaterThanOrEqualTo} />
<NumberBox
label="Max Value"
bind:value={field.constraints.numericality.lessThanOrEqualTo} />
{:else if field.value === 'link'}
{:else if field.type === 'link'}
<div class="field">
<label>Link</label>
<select class="budibase__input" bind:value={field.modelId}>

View file

@ -66,7 +66,7 @@
<ErrorsBox {errors} />
<form on:submit|preventDefault class="uk-form-stacked">
{#each modelSchema as [key, meta]}
<div class="uk-margin">
<div class="bb-margin-xl">
{#if meta.type === 'link'}
<LinkedRecordSelector
bind:linked={record[key]}

View file

@ -21,7 +21,9 @@
$: fields = Object.keys($backendUiStore.selectedModel.schema).filter(key => {
return $backendUiStore.selectedModel.schema[key].type === "number"
})
$: views = $backendUiStore.models.flatMap(model => Object.keys(model.views))
$: views = $backendUiStore.models.flatMap(model =>
Object.keys(model.views || {})
)
function saveView() {
if (views.includes(name)) {
@ -41,7 +43,7 @@
<div bind:this={anchor}>
<TextButton text small on:click={dropdown.show}>
<Icon name="addrow" />
<Icon name="view" />
Create New View
</TextButton>
</div>

View file

@ -80,11 +80,11 @@
okText="Create Screen">
<div data-cy="new-screen-dialog">
<div class="uk-margin">
<div class="bb-margin-xl">
<Input label="Name" bind:value={name} />
</div>
<div class="uk-margin">
<div class="bb-margin-xl">
<Input
label="Url"
error={routeError}
@ -92,7 +92,7 @@
on:change={routeChanged} />
</div>
<div class="uk-margin">
<div class="bb-margin-xl">
<label>Layout Component</label>
<Select bind:value={layoutComponent} secondary>
{#each layoutComponents as { _component, name }}
@ -103,10 +103,3 @@
</div>
</ConfirmDialog>
<style>
.uk-margin {
display: flex;
flex-direction: column;
}
</style>

View file

@ -23,7 +23,7 @@
}
</script>
<div class="uk-margin block-field">
<div class="bb-margin-xl block-field">
<label class="uk-form-label">Page</label>
<div class="uk-form-controls">
<select class="budibase__input" bind:value={pageName}>

View file

@ -4,7 +4,7 @@
export let value
</script>
<div class="uk-margin block-field">
<div class="bb-margin-xl block-field">
<div class="uk-form-controls">
<select class="budibase__input" bind:value>
<option value="" />

View file

@ -5,7 +5,7 @@
export let value
</script>
<div class="uk-margin block-field">
<div class="bb-margin-xl block-field">
<div class="uk-form-controls">
<select class="budibase__input" bind:value={value.model}>
{#each $backendUiStore.models as model}
@ -16,10 +16,10 @@
</div>
{#if value.model}
<div class="uk-margin block-field">
<div class="bb-margin-xl block-field">
<label class="uk-form-label fields">Fields</label>
{#each Object.keys(value.model.schema) as field}
<div class="uk-form-controls uk-margin">
<div class="uk-form-controls bb-margin-xl">
<Input bind:value={value[field]} label={field} />
</div>
{/each}

View file

@ -81,7 +81,7 @@
{/if}
</header>
{#if selectedTab === 'TEST'}
<div class="uk-margin config-item">
<div class="bb-margin-m">
{#if testResult}
<button
transition:fade
@ -111,12 +111,10 @@
<div class="panel">
<div class="panel-body">
<div class="block-label">Workflow: {workflow.name}</div>
<div class="config-item">
<Input label="Name" bind:value={workflow.name} thin />
</div>
<div class="config-item">
<label class="uk-form-label">User Access</label>
<div class="access-levels">
{#each ACCESS_LEVELS as level}
<span class="access-level">
<label>{level.name}</label>

View file

@ -3,7 +3,6 @@ export const FIELDS = {
name: "Plain Text",
icon: "ri-text",
type: "string",
value: "string",
constraints: {
type: "string",
length: {},
@ -14,7 +13,6 @@ export const FIELDS = {
name: "Number",
icon: "ri-number-1",
type: "number",
value: "number",
constraints: {
type: "number",
presence: { allowEmpty: true },
@ -25,7 +23,6 @@ export const FIELDS = {
name: "True/False",
icon: "ri-toggle-line",
type: "boolean",
value: "boolean",
constraints: {
type: "boolean",
presence: { allowEmpty: true },
@ -40,21 +37,21 @@ export const FIELDS = {
// presence: { allowEmpty: true },
// },
// },
DATETIME: {
name: "Date/Time",
icon: "ri-calendar-event-fill",
type: "string",
value: "datetime",
constraints: {
type: "string",
length: {},
presence: { allowEmpty: true },
datetime: {
latest: "",
earliest: "",
},
},
},
// DATETIME: {
// name: "Date/Time",
// icon: "ri-calendar-event-fill",
// type: "string",
// value: "datetime",
// constraints: {
// type: "string",
// length: {},
// presence: { allowEmpty: true },
// datetime: {
// latest: "",
// earliest: "",
// },
// },
// },
// IMAGE: {
// name: "File",
// icon: "ri-image-line",
@ -83,123 +80,3 @@ export const FIELDS = {
// },
// },
}
export const BLOCKS = {
NAME: {
name: "Name",
icon: "ri-text",
type: "string",
constraints: {
type: "string",
length: {},
presence: { allowEmpty: true },
},
},
COMPANY: {
name: "Company",
icon: "ri-store-line",
type: "string",
constraints: {
type: "string",
length: {},
presence: { allowEmpty: true },
},
},
EMAIL: {
name: "Email",
icon: "ri-mail-line",
type: "string",
constraints: {
type: "string",
length: {},
presence: { allowEmpty: true },
},
},
PHONE_NUMBER: {
name: "Phone No.",
icon: "ri-phone-line",
type: "number",
constraints: {
type: "number",
presence: { allowEmpty: true },
numericality: {},
},
},
VALUE: {
name: "Value",
icon: "ri-number-5",
type: "number",
constraints: {
type: "number",
presence: { allowEmpty: true },
numericality: {},
},
},
ACTIVE: {
name: "Active",
icon: "ri-toggle-line",
type: "boolean",
constraints: {
type: "boolean",
presence: { allowEmpty: true },
},
},
URL: {
name: "URL",
icon: "ri-link",
type: "string",
constraints: {
type: "string",
length: {},
presence: { allowEmpty: true },
},
},
IMAGE: {
name: "Image URL",
icon: "ri-image-line",
type: "string",
constraints: {
type: "string",
length: {},
presence: { allowEmpty: true },
},
},
// PRIORITY: {
// name: "Options",
// icon: "ri-list-check-2",
// type: "options",
// constraints: {
// type: "string",
// presence: { allowEmpty: true },
// inclusion: ["low", "medium", "high"],
// },
// },
END_DATE: {
name: "End Date",
icon: "ri-calendar-event-fill",
type: "string",
constraints: {
type: "string",
length: {},
presence: { allowEmpty: true },
},
},
// AVATAR: {
// name: "Avatar",
// icon: "ri-image-line",
// type: "image",
// constraints: {
// type: "string",
// presence: { allowEmpty: true },
// },
// },
// PDF: {
// name: "PDF",
// icon: "ri-file-line",
// type: "file",
// constraints: {
// type: "string",
// presence: { allowEmpty: true },
// },
// },
}

View file

@ -95,3 +95,18 @@ textarea {
.hoverable:hover {
cursor: pointer;
}
.bb-margin-m {
margin-bottom: var(--spacing-m);
}
* + .bb-margin-m {
margin-top: var(--spacing-m);
}
.bb-margin-xl {
margin-bottom: var(--spacing-xl);
}
* + .bb-margin-xl {
margin-top: var(--spacing-xl);
}

View file

@ -1,6 +1,6 @@
{
"name": "budibase",
"version": "0.1.17",
"version": "0.1.19",
"description": "Budibase CLI",
"repository": "https://github.com/Budibase/Budibase",
"homepage": "https://www.budibase.com",
@ -17,7 +17,7 @@
"author": "Budibase",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@budibase/server": "^0.1.17",
"@budibase/server": "^0.1.19",
"@inquirer/password": "^0.0.6-alpha.0",
"chalk": "^2.4.2",
"dotenv": "^8.2.0",

View file

@ -1,6 +1,6 @@
{
"name": "@budibase/client",
"version": "0.1.17",
"version": "0.1.19",
"license": "MPL-2.0",
"main": "dist/budibase-client.js",
"module": "dist/budibase-client.esm.mjs",

View file

@ -1,6 +1,6 @@
{
"name": "@budibase/server",
"version": "0.1.17",
"version": "0.1.19",
"description": "Budibase Web Server",
"main": "src/electron.js",
"repository": {
@ -42,7 +42,7 @@
"author": "Michael Shanks",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@budibase/client": "^0.1.17",
"@budibase/client": "^0.1.19",
"@koa/router": "^8.0.0",
"@sendgrid/mail": "^7.1.1",
"@sentry/node": "^5.19.2",

View file

@ -3,3 +3,4 @@ node_modules
yarn.lock
package-lock.json
dist/index.js
dist/index.js.map

File diff suppressed because one or more lines are too long

View file

@ -13,7 +13,7 @@
"dev:builder": "rollup -cw"
},
"devDependencies": {
"@budibase/client": "^0.1.17",
"@budibase/client": "^0.1.19",
"@rollup/plugin-commonjs": "^11.1.0",
"lodash": "^4.17.15",
"rollup": "^1.11.0",
@ -31,7 +31,7 @@
"keywords": [
"svelte"
],
"version": "0.1.17",
"version": "0.1.19",
"license": "MIT",
"gitHead": "284cceb9b703c38566c6e6363c022f79a08d5691",
"dependencies": {