merge with master
This commit is contained in:
commit
4f3d105018
13 changed files with 82 additions and 63 deletions
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "1.0.148-alpha.1",
|
||||
"version": "1.0.150",
|
||||
"npmClient": "yarn",
|
||||
"packages": [
|
||||
"packages/*"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/backend-core",
|
||||
"version": "1.0.148-alpha.1",
|
||||
"version": "1.0.150",
|
||||
"description": "Budibase backend core libraries used in server and worker",
|
||||
"main": "src/index.js",
|
||||
"author": "Budibase",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@budibase/bbui",
|
||||
"description": "A UI solution used in the different Budibase projects.",
|
||||
"version": "1.0.148-alpha.1",
|
||||
"version": "1.0.150",
|
||||
"license": "MPL-2.0",
|
||||
"svelte": "src/index.js",
|
||||
"module": "dist/bbui.es.js",
|
||||
|
@ -38,7 +38,7 @@
|
|||
],
|
||||
"dependencies": {
|
||||
"@adobe/spectrum-css-workflow-icons": "^1.2.1",
|
||||
"@budibase/string-templates": "^1.0.148-alpha.1",
|
||||
"@budibase/string-templates": "^1.0.150",
|
||||
"@spectrum-css/actionbutton": "^1.0.1",
|
||||
"@spectrum-css/actiongroup": "^1.0.1",
|
||||
"@spectrum-css/avatar": "^3.0.2",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/builder",
|
||||
"version": "1.0.148-alpha.1",
|
||||
"version": "1.0.150",
|
||||
"license": "GPL-3.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
@ -67,10 +67,10 @@
|
|||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@budibase/bbui": "^1.0.148-alpha.1",
|
||||
"@budibase/client": "^1.0.148-alpha.1",
|
||||
"@budibase/frontend-core": "^1.0.148-alpha.1",
|
||||
"@budibase/string-templates": "^1.0.148-alpha.1",
|
||||
"@budibase/bbui": "^1.0.150",
|
||||
"@budibase/client": "^1.0.150",
|
||||
"@budibase/frontend-core": "^1.0.150",
|
||||
"@budibase/string-templates": "^1.0.150",
|
||||
"@sentry/browser": "5.19.1",
|
||||
"@spectrum-css/page": "^3.0.1",
|
||||
"@spectrum-css/vars": "^3.0.1",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
export let unpublishApp
|
||||
export let releaseLock
|
||||
export let editIcon
|
||||
export let copyAppId
|
||||
</script>
|
||||
|
||||
<div class="title">
|
||||
|
@ -102,6 +103,9 @@
|
|||
<MenuItem on:click={() => unpublishApp(app)} icon="GlobeRemove">
|
||||
Unpublish
|
||||
</MenuItem>
|
||||
<MenuItem on:click={() => copyAppId(app)} icon="Copy">
|
||||
Copy App ID
|
||||
</MenuItem>
|
||||
{/if}
|
||||
{#if !app.deployed}
|
||||
<MenuItem on:click={() => updateApp(app)} icon="Edit">Edit</MenuItem>
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
Body,
|
||||
Search,
|
||||
Divider,
|
||||
Helpers,
|
||||
} from "@budibase/bbui"
|
||||
import TemplateDisplay from "components/common/TemplateDisplay.svelte"
|
||||
import Spinner from "components/common/Spinner.svelte"
|
||||
|
@ -261,6 +262,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
const copyAppId = async app => {
|
||||
await Helpers.copyToClipboard(app.prodId)
|
||||
notifications.success("App ID copied to clipboard.")
|
||||
}
|
||||
|
||||
function createAppFromTemplateUrl(templateKey) {
|
||||
// validate the template key just to make sure
|
||||
const templateParts = templateKey.split("/")
|
||||
|
@ -394,6 +400,7 @@
|
|||
<div class="appTable">
|
||||
{#each filteredApps as app (app.appId)}
|
||||
<AppRow
|
||||
{copyAppId}
|
||||
{releaseLock}
|
||||
{editIcon}
|
||||
{app}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/cli",
|
||||
"version": "1.0.148-alpha.1",
|
||||
"version": "1.0.150",
|
||||
"description": "Budibase CLI, for developers, self hosting and migrations.",
|
||||
"main": "src/index.js",
|
||||
"bin": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/client",
|
||||
"version": "1.0.148-alpha.1",
|
||||
"version": "1.0.150",
|
||||
"license": "MPL-2.0",
|
||||
"module": "dist/budibase-client.js",
|
||||
"main": "dist/budibase-client.js",
|
||||
|
@ -19,9 +19,9 @@
|
|||
"dev:builder": "rollup -cw"
|
||||
},
|
||||
"dependencies": {
|
||||
"@budibase/bbui": "^1.0.148-alpha.1",
|
||||
"@budibase/frontend-core": "^1.0.148-alpha.1",
|
||||
"@budibase/string-templates": "^1.0.148-alpha.1",
|
||||
"@budibase/bbui": "^1.0.150",
|
||||
"@budibase/frontend-core": "^1.0.150",
|
||||
"@budibase/string-templates": "^1.0.150",
|
||||
"@spectrum-css/button": "^3.0.3",
|
||||
"@spectrum-css/card": "^3.0.3",
|
||||
"@spectrum-css/divider": "^1.0.3",
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@budibase/frontend-core",
|
||||
"version": "1.0.148-alpha.1",
|
||||
"version": "1.0.150",
|
||||
"description": "Budibase frontend core libraries used in builder and client",
|
||||
"author": "Budibase",
|
||||
"license": "MPL-2.0",
|
||||
"svelte": "src/index.js",
|
||||
"dependencies": {
|
||||
"@budibase/bbui": "^1.0.148-alpha.1",
|
||||
"@budibase/bbui": "^1.0.150",
|
||||
"lodash": "^4.17.21",
|
||||
"svelte": "^3.46.2"
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@budibase/server",
|
||||
"email": "hi@budibase.com",
|
||||
"version": "1.0.148-alpha.1",
|
||||
"version": "1.0.150",
|
||||
"description": "Budibase Web Server",
|
||||
"main": "src/index.ts",
|
||||
"repository": {
|
||||
|
@ -68,10 +68,10 @@
|
|||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"@apidevtools/swagger-parser": "^10.0.3",
|
||||
"@budibase/backend-core": "^1.0.148-alpha.1",
|
||||
"@budibase/client": "^1.0.148-alpha.1",
|
||||
"@budibase/pro": "1.0.148-alpha.1",
|
||||
"@budibase/string-templates": "^1.0.148-alpha.1",
|
||||
"@budibase/backend-core": "^1.0.150",
|
||||
"@budibase/client": "^1.0.150",
|
||||
"@budibase/pro": "1.0.150",
|
||||
"@budibase/string-templates": "^1.0.150",
|
||||
"@bull-board/api": "^3.7.0",
|
||||
"@bull-board/koa": "^3.7.0",
|
||||
"@elastic/elasticsearch": "7.10.0",
|
||||
|
|
|
@ -147,7 +147,7 @@ module PostgresModule {
|
|||
return parts.join(" || ")
|
||||
}
|
||||
|
||||
async internalQuery(query: SqlQuery) {
|
||||
async internalQuery(query: SqlQuery, close: boolean = true) {
|
||||
const client = this.client
|
||||
this.index = 1
|
||||
// need to handle a specific issue with json data types in postgres,
|
||||
|
@ -164,10 +164,11 @@ module PostgresModule {
|
|||
try {
|
||||
return await client.query(query.sql, query.bindings || [])
|
||||
} catch (err) {
|
||||
await this.client.end()
|
||||
// @ts-ignore
|
||||
throw new Error(err)
|
||||
} finally {
|
||||
await this.client.end()
|
||||
if (close) await this.client.end()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -204,48 +205,54 @@ module PostgresModule {
|
|||
}
|
||||
} catch (err) {
|
||||
tableKeys = {}
|
||||
} finally {
|
||||
await this.client.close()
|
||||
}
|
||||
|
||||
const columnsResponse = await this.client.query(this.COLUMNS_SQL)
|
||||
const tables: { [key: string]: Table } = {}
|
||||
try {
|
||||
const columnsResponse = await this.client.query(this.COLUMNS_SQL)
|
||||
|
||||
for (let column of columnsResponse.rows) {
|
||||
const tableName: string = column.table_name
|
||||
const columnName: string = column.column_name
|
||||
const tables: { [key: string]: Table } = {}
|
||||
|
||||
// table key doesn't exist yet
|
||||
if (!tables[tableName] || !tables[tableName].schema) {
|
||||
tables[tableName] = {
|
||||
_id: buildExternalTableId(datasourceId, tableName),
|
||||
primary: tableKeys[tableName] || [],
|
||||
name: tableName,
|
||||
schema: {},
|
||||
for (let column of columnsResponse.rows) {
|
||||
const tableName: string = column.table_name
|
||||
const columnName: string = column.column_name
|
||||
|
||||
// table key doesn't exist yet
|
||||
if (!tables[tableName] || !tables[tableName].schema) {
|
||||
tables[tableName] = {
|
||||
_id: buildExternalTableId(datasourceId, tableName),
|
||||
primary: tableKeys[tableName] || [],
|
||||
name: tableName,
|
||||
schema: {},
|
||||
}
|
||||
}
|
||||
|
||||
const identity = !!(
|
||||
column.identity_generation ||
|
||||
column.identity_start ||
|
||||
column.identity_increment
|
||||
)
|
||||
const hasDefault =
|
||||
typeof column.column_default === "string" &&
|
||||
column.column_default.startsWith("nextval")
|
||||
const isGenerated =
|
||||
column.is_generated && column.is_generated !== "NEVER"
|
||||
const isAuto: boolean = hasDefault || identity || isGenerated
|
||||
tables[tableName].schema[columnName] = {
|
||||
autocolumn: isAuto,
|
||||
name: columnName,
|
||||
...convertSqlType(column.data_type),
|
||||
}
|
||||
}
|
||||
|
||||
const identity = !!(
|
||||
column.identity_generation ||
|
||||
column.identity_start ||
|
||||
column.identity_increment
|
||||
)
|
||||
const hasDefault =
|
||||
typeof column.column_default === "string" &&
|
||||
column.column_default.startsWith("nextval")
|
||||
const isGenerated =
|
||||
column.is_generated && column.is_generated !== "NEVER"
|
||||
const isAuto: boolean = hasDefault || identity || isGenerated
|
||||
tables[tableName].schema[columnName] = {
|
||||
autocolumn: isAuto,
|
||||
name: columnName,
|
||||
...convertSqlType(column.data_type),
|
||||
}
|
||||
const final = finaliseExternalTables(tables, entities)
|
||||
this.tables = final.tables
|
||||
this.schemaErrors = final.errors
|
||||
} catch (err) {
|
||||
// @ts-ignore
|
||||
throw new Error(err)
|
||||
} finally {
|
||||
await this.client.end()
|
||||
}
|
||||
|
||||
const final = finaliseExternalTables(tables, entities)
|
||||
this.tables = final.tables
|
||||
this.schemaErrors = final.errors
|
||||
}
|
||||
|
||||
async create(query: SqlQuery | string) {
|
||||
|
@ -274,8 +281,9 @@ module PostgresModule {
|
|||
if (Array.isArray(input)) {
|
||||
const responses = []
|
||||
for (let query of input) {
|
||||
responses.push(await this.internalQuery(query))
|
||||
responses.push(await this.internalQuery(query, false))
|
||||
}
|
||||
await this.client.end()
|
||||
return responses
|
||||
} else {
|
||||
const response = await this.internalQuery(input)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/string-templates",
|
||||
"version": "1.0.148-alpha.1",
|
||||
"version": "1.0.150",
|
||||
"description": "Handlebars wrapper for Budibase templating.",
|
||||
"main": "src/index.cjs",
|
||||
"module": "dist/bundle.mjs",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@budibase/worker",
|
||||
"email": "hi@budibase.com",
|
||||
"version": "1.0.148-alpha.1",
|
||||
"version": "1.0.150",
|
||||
"description": "Budibase background service",
|
||||
"main": "src/index.ts",
|
||||
"repository": {
|
||||
|
@ -31,9 +31,9 @@
|
|||
"author": "Budibase",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"@budibase/backend-core": "^1.0.148-alpha.1",
|
||||
"@budibase/pro": "1.0.148-alpha.1",
|
||||
"@budibase/string-templates": "^1.0.148-alpha.1",
|
||||
"@budibase/backend-core": "^1.0.150",
|
||||
"@budibase/pro": "1.0.150",
|
||||
"@budibase/string-templates": "^1.0.150",
|
||||
"@koa/router": "^8.0.0",
|
||||
"@sentry/node": "6.17.7",
|
||||
"@techpass/passport-openidconnect": "^0.3.0",
|
||||
|
|
Loading…
Reference in a new issue