addToText(binding)}>
{binding.label}
{binding.type}
-
{binding.description || ''}
+ {#if binding.description}
+
{binding.description || ''}
+ {/if}
{/each}
{/each}
@@ -129,8 +139,12 @@
.binding {
font-size: 12px;
- padding: var(--spacing-s);
- border-radius: var(--border-radius-m);
+ border: var(--border-light);
+ border-width: 1px 0 0 0;
+ padding: var(--spacing-m) 0;
+ margin: auto 0;
+ align-items: center;
+ cursor: pointer;
}
.binding:hover {
background-color: var(--grey-2);
diff --git a/packages/builder/src/constants/backend/index.js b/packages/builder/src/constants/backend/index.js
index f7bb77db3b..de49883cf1 100644
--- a/packages/builder/src/constants/backend/index.js
+++ b/packages/builder/src/constants/backend/index.js
@@ -80,6 +80,15 @@ export const FIELDS = {
presence: false,
},
},
+ FORMULA: {
+ name: "Formula",
+ icon: "ri-braces-line",
+ type: "formula",
+ constraints: {
+ type: "string",
+ presence: false,
+ },
+ },
}
export const AUTO_COLUMN_SUB_TYPES = {
diff --git a/packages/server/src/api/controllers/user.js b/packages/server/src/api/controllers/user.js
index 1f41acc754..396428c853 100644
--- a/packages/server/src/api/controllers/user.js
+++ b/packages/server/src/api/controllers/user.js
@@ -88,6 +88,7 @@ exports.updateMetadata = async function(ctx) {
})
const metadata = {
...globalUser,
+ tableId: InternalTables.USER_METADATA,
_id: user._id || generateUserMetadataID(globalUser._id),
_rev: user._rev,
}
diff --git a/packages/server/src/constants/index.js b/packages/server/src/constants/index.js
index 9853676aa6..f9a72ec479 100644
--- a/packages/server/src/constants/index.js
+++ b/packages/server/src/constants/index.js
@@ -13,6 +13,7 @@ exports.FieldTypes = {
DATETIME: "datetime",
ATTACHMENT: "attachment",
LINK: "link",
+ FORMULA: "formula",
AUTO: "auto",
}
diff --git a/packages/server/src/db/linkedRows/index.js b/packages/server/src/db/linkedRows/index.js
index 8de2093fb2..bc58636dc7 100644
--- a/packages/server/src/db/linkedRows/index.js
+++ b/packages/server/src/db/linkedRows/index.js
@@ -10,6 +10,7 @@ const {
} = require("./linkUtils")
const { flatten } = require("lodash")
const CouchDB = require("../../db")
+const { FieldTypes } = require("../../constants")
const { getMultiIDParams } = require("../../db/utils")
/**
@@ -141,14 +142,14 @@ exports.attachLinkIDs = async (appId, rows) => {
}
/**
- * Given information about the table we can extract the display name from the linked rows, this
- * is what we do for showing the display name of each linked row when in a table format.
+ * Given a table and a list of rows this will retrieve all of the attached docs and enrich them into the row.
+ * This is required for formula fields, this may only be utilised internally (for now).
* @param {string} appId The app in which the tables/rows/links exist.
* @param {object} table The table from which the rows originated.
- * @param {array