mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
worked on requested changes
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
|
||||
2
src/types/table.d.ts
vendored
2
src/types/table.d.ts
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user