worked on requested changes

This commit is contained in:
Anish Roy
2023-04-19 19:28:01 +05:30
parent ee5de5e0b7
commit f5557f8072
6 changed files with 13 additions and 13 deletions

View File

@@ -44,7 +44,7 @@ export default function FieldsDropdown({
const requireCloudFunctionSetup =
fieldConfig.requireCloudFunction && !projectSettings.rowyRunUrl;
const requireCollectionTable =
tableSettings.isNotACollection === true &&
tableSettings.isCollection === false &&
fieldConfig.requireCollectionTable === true;
return {
label: fieldConfig.name,

View File

@@ -34,7 +34,7 @@ export default function EmptyTable() {
: false;
let contents = <></>;
if (!tableSettings.isNotACollection && hasData) {
if (tableSettings.isCollection !== false && hasData) {
contents = (
<>
<div>
@@ -72,7 +72,7 @@ export default function EmptyTable() {
Get started
</Typography>
<Typography>
{tableSettings.isNotACollection === true
{tableSettings.isCollection === false
? "There is no data in this Array Sub Table:"
: "There is no data in the Firestore collection:"}
<br />
@@ -84,7 +84,7 @@ export default function EmptyTable() {
</Typography>
</div>
<Grid container spacing={1}>
{!tableSettings.isNotACollection && (
{tableSettings.isCollection !== false && (
<>
<Grid item xs>
<Typography paragraph>

View File

@@ -95,10 +95,14 @@ export default function TableToolbar({
},
}}
>
{tableSettings.isNotACollection ? <AddRowArraySubTable /> : <AddRow />}
{tableSettings.isCollection === false ? (
<AddRowArraySubTable />
) : (
<AddRow />
)}
<div /> {/* Spacer */}
<HiddenFields />
{tableSettings.isNotACollection ? (
{tableSettings.isCollection === false ? (
<Button
variant="outlined"
color="primary"

View File

@@ -74,7 +74,7 @@ export default function ProvidedArraySubTablePage() {
collection: subTableCollection,
id: subTableId,
subTableKey,
isNotACollection: true,
isCollection: false,
tableType: "primaryCollection" as "primaryCollection",
name: sourceColumn?.name || subTableKey || "",
};
@@ -139,7 +139,6 @@ export default function ProvidedArraySubTablePage() {
<DebugAtoms scope={tableScope} />
<ArraySubTableSourceFirestore />
<TablePage
tableNotACollection={true}
disabledTools={[
"import",
"export",

View File

@@ -54,9 +54,7 @@ export interface ITablePageProps {
disableModals?: boolean;
/** Disable side drawer */
disableSideDrawer?: boolean;
/* Array table is not a collection */
tableNotACollection?: boolean;
/** list of table tools to be disabled */
disabledTools?: TableToolsType;
}
@@ -76,7 +74,6 @@ export interface ITablePageProps {
export default function TablePage({
disableModals,
disableSideDrawer,
tableNotACollection,
disabledTools,
}: ITablePageProps) {
const [userRoles] = useAtom(userRolesAtom, projectScope);

View File

@@ -75,7 +75,7 @@ export type TableSettings = {
/** Roles that can see this table in the UI and navigate. Firestore Rules need to be set to give access to the data */
roles: string[];
isNotACollection?: boolean;
isCollection?: boolean;
subTableKey?: string | undefined;
section: string;
description?: string;