From 3e1c8a00335e8bc906088228e4b84ce27387d35e Mon Sep 17 00:00:00 2001 From: rishipurwar1 Date: Sat, 17 Jun 2023 10:13:27 +0530 Subject: [PATCH 1/3] Implement auto import for array subtables --- src/components/Table/EmptyTable.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/Table/EmptyTable.tsx b/src/components/Table/EmptyTable.tsx index 2fb06875e..5b96220db 100644 --- a/src/components/Table/EmptyTable.tsx +++ b/src/components/Table/EmptyTable.tsx @@ -33,7 +33,7 @@ export default function EmptyTable() { : false; let contents = <>; - if (tableSettings.isCollection !== false && hasData) { + if (hasData) { contents = ( <>
@@ -41,9 +41,15 @@ export default function EmptyTable() { Get started - There is existing data in the Firestore collection: + {tableSettings.isCollection === false + ? "There is existing data in the Array Sub Table:" + : "There is existing data in the Firestore collection:"}
- {tableSettings.collection} + + {tableSettings.collection} + {tableSettings.subTableKey?.length && + `.${tableSettings.subTableKey}`} +
From a14646093ae24bae2f262812e68374facbb080f8 Mon Sep 17 00:00:00 2001 From: rishipurwar1 Date: Sat, 17 Jun 2023 12:04:28 +0530 Subject: [PATCH 2/3] Update the if condition to check for existing data in array subtable --- src/components/Table/EmptyTable.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Table/EmptyTable.tsx b/src/components/Table/EmptyTable.tsx index 5b96220db..858d2d8d8 100644 --- a/src/components/Table/EmptyTable.tsx +++ b/src/components/Table/EmptyTable.tsx @@ -33,7 +33,11 @@ export default function EmptyTable() { : false; let contents = <>; - if (hasData) { + if ( + (tableSettings.isCollection !== false || + tableSettings.subTableKey?.length) && + hasData + ) { contents = ( <>
From 44fed6ac78876aedb91dd20abfec68e7e0eb5b7d Mon Sep 17 00:00:00 2001 From: rishipurwar1 Date: Sat, 17 Jun 2023 14:06:56 +0530 Subject: [PATCH 3/3] Update the if condition to check for existing data --- src/components/Table/EmptyTable.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/components/Table/EmptyTable.tsx b/src/components/Table/EmptyTable.tsx index 858d2d8d8..5b96220db 100644 --- a/src/components/Table/EmptyTable.tsx +++ b/src/components/Table/EmptyTable.tsx @@ -33,11 +33,7 @@ export default function EmptyTable() { : false; let contents = <>; - if ( - (tableSettings.isCollection !== false || - tableSettings.subTableKey?.length) && - hasData - ) { + if (hasData) { contents = ( <>