diff --git a/www/src/components/Table/ColumnMenu/FieldSettings/DefaultValueInput.tsx b/www/src/components/Table/ColumnMenu/FieldSettings/DefaultValueInput.tsx
index 5321d49a..5069e25f 100644
--- a/www/src/components/Table/ColumnMenu/FieldSettings/DefaultValueInput.tsx
+++ b/www/src/components/Table/ColumnMenu/FieldSettings/DefaultValueInput.tsx
@@ -9,13 +9,18 @@ import {
TextField,
MenuItem,
ListItemText,
+ Box,
+ Tooltip,
+ Button,
} from "@material-ui/core";
import Subheading from "../Subheading";
import { getFieldProp } from "components/fields";
-import CodeEditor from "components/CodeEditor";
+import CodeEditor from "components/Table/editors/CodeEditor";
import FormAutosave from "./FormAutosave";
import { FieldType } from "constants/fields";
+import { useFiretableContext } from "contexts/FiretableContext";
+import OpenIcon from "@material-ui/icons/OpenInNew";
const useStyles = makeStyles((theme) =>
createStyles({
@@ -58,6 +63,7 @@ export default function DefaultValueInput({
config.defaultValue?.value ?? getFieldProp("initialValue", _type),
},
});
+ const { tableState } = useFiretableContext();
return (
<>
@@ -128,18 +134,65 @@ export default function DefaultValueInput({
)}
{config.defaultValue?.type === "dynamic" && (
-
-
-
+ <>
+
+
+ You have access to:{" "}
+
+ You have acces to the object "row" at the top level. Typing
+ "row" in the code editor to get auto completion. Below are
+ the fields of row you can use in this table:
+
+
+ {Object.keys(tableState?.columns!).join(", ")}
+ >
+ }
+ >
+ row
+
+ ,{" "}
+
+ You have acces to the db object that represents the
+ firestore database object. Typing "db" in the code editor to
+ get auto completion.
+ >
+ }
+ >
+ db
+
+
+ }
+ target="_blank"
+ href="https://github.com/FiretableProject/firetable/wiki/Getting-Started" // TODO add doc link
+ >
+ Examples & Docs
+
+
+