From ccd3ebc5d18028c66aa5d8c86fb388d2299a0bb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Fri, 4 Aug 2023 10:13:25 +0200 Subject: [PATCH] Support entities with `key` property --- bin/initialize-dev-db.mjs | 21 +++++++++++++++++++++ src/EntitiesTable.tsx | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/bin/initialize-dev-db.mjs b/bin/initialize-dev-db.mjs index 78f8556..ecc7bc4 100755 --- a/bin/initialize-dev-db.mjs +++ b/bin/initialize-dev-db.mjs @@ -278,6 +278,27 @@ await call("commit", { ], }); +await call("commit", { + mode: "NON_TRANSACTIONAL", + mutations: [ + { + insert: { + key: { + partitionId: { + projectId: projectID, + }, + path: [{ kind: "KindWithKeyProperty", name: "Entity" }], + }, + properties: { + key: { + integerValue: 14, + }, + }, + }, + }, + ], +}); + await call("commit", { mode: "NON_TRANSACTIONAL", mutations: [ diff --git a/src/EntitiesTable.tsx b/src/EntitiesTable.tsx index 6ebc82a..906b4af 100644 --- a/src/EntitiesTable.tsx +++ b/src/EntitiesTable.tsx @@ -160,7 +160,7 @@ function EntitiesTable({ {p} ), - id: p, + id: `property:${p}`, accessor: ({ properties }: Entity) => (properties ?? {})[p], Cell: ({ value }: { value?: PropertyValue }) => { return value == null ? (