Merge remote-tracking branch 'origin/develop' into feature/app-overview-section

This commit is contained in:
Dean 2022-05-11 16:21:15 +01:00
commit 7607d5c8e8
16 changed files with 86 additions and 64 deletions

View File

@ -1,5 +1,5 @@
{ {
"version": "1.0.148-alpha.1", "version": "1.0.151-alpha.2",
"npmClient": "yarn", "npmClient": "yarn",
"packages": [ "packages": [
"packages/*" "packages/*"

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/backend-core", "name": "@budibase/backend-core",
"version": "1.0.148-alpha.1", "version": "1.0.151-alpha.2",
"description": "Budibase backend core libraries used in server and worker", "description": "Budibase backend core libraries used in server and worker",
"main": "src/index.js", "main": "src/index.js",
"author": "Budibase", "author": "Budibase",

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/bbui", "name": "@budibase/bbui",
"description": "A UI solution used in the different Budibase projects.", "description": "A UI solution used in the different Budibase projects.",
"version": "1.0.148-alpha.1", "version": "1.0.151-alpha.2",
"license": "MPL-2.0", "license": "MPL-2.0",
"svelte": "src/index.js", "svelte": "src/index.js",
"module": "dist/bbui.es.js", "module": "dist/bbui.es.js",
@ -38,7 +38,7 @@
], ],
"dependencies": { "dependencies": {
"@adobe/spectrum-css-workflow-icons": "^1.2.1", "@adobe/spectrum-css-workflow-icons": "^1.2.1",
"@budibase/string-templates": "^1.0.148-alpha.1", "@budibase/string-templates": "^1.0.151-alpha.2",
"@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actionbutton": "^1.0.1",
"@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1",
"@spectrum-css/avatar": "^3.0.2", "@spectrum-css/avatar": "^3.0.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/builder", "name": "@budibase/builder",
"version": "1.0.148-alpha.1", "version": "1.0.151-alpha.2",
"license": "GPL-3.0", "license": "GPL-3.0",
"private": true, "private": true,
"scripts": { "scripts": {
@ -67,10 +67,10 @@
} }
}, },
"dependencies": { "dependencies": {
"@budibase/bbui": "^1.0.148-alpha.1", "@budibase/bbui": "^1.0.151-alpha.2",
"@budibase/client": "^1.0.148-alpha.1", "@budibase/client": "^1.0.151-alpha.2",
"@budibase/frontend-core": "^1.0.148-alpha.1", "@budibase/frontend-core": "^1.0.151-alpha.2",
"@budibase/string-templates": "^1.0.148-alpha.1", "@budibase/string-templates": "^1.0.151-alpha.2",
"@sentry/browser": "5.19.1", "@sentry/browser": "5.19.1",
"@spectrum-css/page": "^3.0.1", "@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1", "@spectrum-css/vars": "^3.0.1",

View File

@ -53,6 +53,7 @@
: { schema: {} } : { schema: {} }
$: schema = getSchemaForTable(tableId, { searchableSchema: true }).schema $: schema = getSchemaForTable(tableId, { searchableSchema: true }).schema
$: schemaFields = Object.values(schema || {}) $: schemaFields = Object.values(schema || {})
$: queryLimit = tableId?.includes("datasource") ? "∞" : "1000"
const onChange = Utils.sequential(async (e, key) => { const onChange = Utils.sequential(async (e, key) => {
try { try {
@ -330,6 +331,7 @@
on:change={e => onChange(e, key)} on:change={e => onChange(e, key)}
{bindings} {bindings}
updateOnChange={false} updateOnChange={false}
placeholder={value.customType === "queryLimit" ? queryLimit : ""}
/> />
</div> </div>
{/if} {/if}

View File

@ -12,6 +12,7 @@
export let appOverview export let appOverview
export let releaseLock export let releaseLock
export let editIcon export let editIcon
export let copyAppId
</script> </script>
<div class="title" data-cy={`${app.devId}`}> <div class="title" data-cy={`${app.devId}`}>
@ -75,6 +76,9 @@
<MenuItem on:click={() => unpublishApp(app)} icon="GlobeRemove"> <MenuItem on:click={() => unpublishApp(app)} icon="GlobeRemove">
Unpublish Unpublish
</MenuItem> </MenuItem>
<MenuItem on:click={() => copyAppId(app)} icon="Copy">
Copy App ID
</MenuItem>
{/if} {/if}
{#if !app.deployed} {#if !app.deployed}
<MenuItem on:click={() => updateApp(app)} icon="Edit">Edit</MenuItem> <MenuItem on:click={() => updateApp(app)} icon="Edit">Edit</MenuItem>

View File

@ -11,6 +11,7 @@
Body, Body,
Search, Search,
Divider, Divider,
Helpers,
} from "@budibase/bbui" } from "@budibase/bbui"
import TemplateDisplay from "components/common/TemplateDisplay.svelte" import TemplateDisplay from "components/common/TemplateDisplay.svelte"
import Spinner from "components/common/Spinner.svelte" import Spinner from "components/common/Spinner.svelte"
@ -264,6 +265,11 @@
} }
} }
const copyAppId = async app => {
await Helpers.copyToClipboard(app.prodId)
notifications.success("App ID copied to clipboard.")
}
function createAppFromTemplateUrl(templateKey) { function createAppFromTemplateUrl(templateKey) {
// validate the template key just to make sure // validate the template key just to make sure
const templateParts = templateKey.split("/") const templateParts = templateKey.split("/")
@ -412,6 +418,7 @@
<div class="appTable"> <div class="appTable">
{#each filteredApps as app (app.appId)} {#each filteredApps as app (app.appId)}
<AppRow <AppRow
{copyAppId}
{releaseLock} {releaseLock}
{editIcon} {editIcon}
{app} {app}

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/cli", "name": "@budibase/cli",
"version": "1.0.148-alpha.1", "version": "1.0.151-alpha.2",
"description": "Budibase CLI, for developers, self hosting and migrations.", "description": "Budibase CLI, for developers, self hosting and migrations.",
"main": "src/index.js", "main": "src/index.js",
"bin": { "bin": {

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/client", "name": "@budibase/client",
"version": "1.0.148-alpha.1", "version": "1.0.151-alpha.2",
"license": "MPL-2.0", "license": "MPL-2.0",
"module": "dist/budibase-client.js", "module": "dist/budibase-client.js",
"main": "dist/budibase-client.js", "main": "dist/budibase-client.js",
@ -19,9 +19,9 @@
"dev:builder": "rollup -cw" "dev:builder": "rollup -cw"
}, },
"dependencies": { "dependencies": {
"@budibase/bbui": "^1.0.148-alpha.1", "@budibase/bbui": "^1.0.151-alpha.2",
"@budibase/frontend-core": "^1.0.148-alpha.1", "@budibase/frontend-core": "^1.0.151-alpha.2",
"@budibase/string-templates": "^1.0.148-alpha.1", "@budibase/string-templates": "^1.0.151-alpha.2",
"@spectrum-css/button": "^3.0.3", "@spectrum-css/button": "^3.0.3",
"@spectrum-css/card": "^3.0.3", "@spectrum-css/card": "^3.0.3",
"@spectrum-css/divider": "^1.0.3", "@spectrum-css/divider": "^1.0.3",

View File

@ -1,12 +1,12 @@
{ {
"name": "@budibase/frontend-core", "name": "@budibase/frontend-core",
"version": "1.0.148-alpha.1", "version": "1.0.151-alpha.2",
"description": "Budibase frontend core libraries used in builder and client", "description": "Budibase frontend core libraries used in builder and client",
"author": "Budibase", "author": "Budibase",
"license": "MPL-2.0", "license": "MPL-2.0",
"svelte": "src/index.js", "svelte": "src/index.js",
"dependencies": { "dependencies": {
"@budibase/bbui": "^1.0.148-alpha.1", "@budibase/bbui": "^1.0.151-alpha.2",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"svelte": "^3.46.2" "svelte": "^3.46.2"
} }

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/server", "name": "@budibase/server",
"email": "hi@budibase.com", "email": "hi@budibase.com",
"version": "1.0.148-alpha.1", "version": "1.0.151-alpha.2",
"description": "Budibase Web Server", "description": "Budibase Web Server",
"main": "src/index.ts", "main": "src/index.ts",
"repository": { "repository": {
@ -68,10 +68,10 @@
"license": "GPL-3.0", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"@apidevtools/swagger-parser": "^10.0.3", "@apidevtools/swagger-parser": "^10.0.3",
"@budibase/backend-core": "^1.0.148-alpha.1", "@budibase/backend-core": "^1.0.151-alpha.2",
"@budibase/client": "^1.0.148-alpha.1", "@budibase/client": "^1.0.151-alpha.2",
"@budibase/pro": "1.0.148-alpha.1", "@budibase/pro": "1.0.151-alpha.2",
"@budibase/string-templates": "^1.0.148-alpha.1", "@budibase/string-templates": "^1.0.151-alpha.2",
"@bull-board/api": "^3.7.0", "@bull-board/api": "^3.7.0",
"@bull-board/koa": "^3.7.0", "@bull-board/koa": "^3.7.0",
"@elastic/elasticsearch": "7.10.0", "@elastic/elasticsearch": "7.10.0",

View File

@ -6,7 +6,7 @@ exports.csv = function (headers, rows) {
.map(header => { .map(header => {
let val = row[header] let val = row[header]
val = val =
typeof val === "object" typeof val === "object" && !(val instanceof Date)
? `"${JSON.stringify(val).replace(/"/g, "'")}"` ? `"${JSON.stringify(val).replace(/"/g, "'")}"`
: `"${val}"` : `"${val}"`
return val.trim() return val.trim()

View File

@ -50,6 +50,7 @@ exports.definition = {
limit: { limit: {
type: "number", type: "number",
title: "Limit", title: "Limit",
customType: "queryLimit",
}, },
}, },
required: ["tableId"], required: ["tableId"],

View File

@ -147,7 +147,7 @@ module PostgresModule {
return parts.join(" || ") return parts.join(" || ")
} }
async internalQuery(query: SqlQuery) { async internalQuery(query: SqlQuery, close: boolean = true) {
const client = this.client const client = this.client
this.index = 1 this.index = 1
// need to handle a specific issue with json data types in postgres, // need to handle a specific issue with json data types in postgres,
@ -164,10 +164,11 @@ module PostgresModule {
try { try {
return await client.query(query.sql, query.bindings || []) return await client.query(query.sql, query.bindings || [])
} catch (err) { } catch (err) {
await this.client.end()
// @ts-ignore // @ts-ignore
throw new Error(err) throw new Error(err)
} finally { } finally {
await this.client.end() if (close) await this.client.end()
} }
} }
@ -204,11 +205,11 @@ module PostgresModule {
} }
} catch (err) { } catch (err) {
tableKeys = {} tableKeys = {}
} finally {
await this.client.close()
} }
try {
const columnsResponse = await this.client.query(this.COLUMNS_SQL) const columnsResponse = await this.client.query(this.COLUMNS_SQL)
const tables: { [key: string]: Table } = {} const tables: { [key: string]: Table } = {}
for (let column of columnsResponse.rows) { for (let column of columnsResponse.rows) {
@ -246,6 +247,12 @@ module PostgresModule {
const final = finaliseExternalTables(tables, entities) const final = finaliseExternalTables(tables, entities)
this.tables = final.tables this.tables = final.tables
this.schemaErrors = final.errors this.schemaErrors = final.errors
} catch (err) {
// @ts-ignore
throw new Error(err)
} finally {
await this.client.end()
}
} }
async create(query: SqlQuery | string) { async create(query: SqlQuery | string) {
@ -274,8 +281,9 @@ module PostgresModule {
if (Array.isArray(input)) { if (Array.isArray(input)) {
const responses = [] const responses = []
for (let query of input) { for (let query of input) {
responses.push(await this.internalQuery(query)) responses.push(await this.internalQuery(query, false))
} }
await this.client.end()
return responses return responses
} else { } else {
const response = await this.internalQuery(input) const response = await this.internalQuery(input)

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/string-templates", "name": "@budibase/string-templates",
"version": "1.0.148-alpha.1", "version": "1.0.151-alpha.2",
"description": "Handlebars wrapper for Budibase templating.", "description": "Handlebars wrapper for Budibase templating.",
"main": "src/index.cjs", "main": "src/index.cjs",
"module": "dist/bundle.mjs", "module": "dist/bundle.mjs",

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/worker", "name": "@budibase/worker",
"email": "hi@budibase.com", "email": "hi@budibase.com",
"version": "1.0.148-alpha.1", "version": "1.0.151-alpha.2",
"description": "Budibase background service", "description": "Budibase background service",
"main": "src/index.ts", "main": "src/index.ts",
"repository": { "repository": {
@ -31,9 +31,9 @@
"author": "Budibase", "author": "Budibase",
"license": "GPL-3.0", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"@budibase/backend-core": "^1.0.148-alpha.1", "@budibase/backend-core": "^1.0.151-alpha.2",
"@budibase/pro": "1.0.148-alpha.1", "@budibase/pro": "1.0.151-alpha.2",
"@budibase/string-templates": "^1.0.148-alpha.1", "@budibase/string-templates": "^1.0.151-alpha.2",
"@koa/router": "^8.0.0", "@koa/router": "^8.0.0",
"@sentry/node": "6.17.7", "@sentry/node": "6.17.7",
"@techpass/passport-openidconnect": "^0.3.0", "@techpass/passport-openidconnect": "^0.3.0",