diff --git a/src/qqq/pages/records/query/RecordQuery.tsx b/src/qqq/pages/records/query/RecordQuery.tsx
index 2780a70..ade6cc5 100644
--- a/src/qqq/pages/records/query/RecordQuery.tsx
+++ b/src/qqq/pages/records/query/RecordQuery.tsx
@@ -89,7 +89,7 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
const location = useLocation();
const navigate = useNavigate();
- const pathParts = location.pathname.split("/");
+ const pathParts = location.pathname.replace(/\/+$/, "").split("/");
////////////////////////////////////////////
// look for defaults in the local storage //
@@ -995,6 +995,7 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
+
@@ -1131,103 +1132,104 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
return (
- {/*
- // see above code that would use this
-
- */}
-
- {alertContent ? (
-
-
- {
- setAlertContent(null);
- }}
- >
- {alertContent}
-
-
- ) : (
- ""
- )}
- {
- (tableLabel && showSuccessfullyDeletedAlert) ? (
-
- {
- setShowSuccessfullyDeletedAlert(false);
- }}>
- {`${tableLabel} successfully deleted`}
-
- ) : null
- }
-
-
-
-
-
-
-
- {renderActionsMenu}
-
+
+ {/*
+ // see above code that would use this
+
+ */}
+
+ {alertContent ? (
+
+
+ {
+ setAlertContent(null);
+ }}
+ >
+ {alertContent}
+
+
+ ) : (
+ ""
+ )}
{
- table.capabilities.has(Capability.TABLE_INSERT) && table.insertPermission &&
-
+ (tableLabel && showSuccessfullyDeletedAlert) ? (
+
+ {
+ setShowSuccessfullyDeletedAlert(false);
+ }}>
+ {`${tableLabel} successfully deleted`}
+
+ ) : null
}
+
+
+
+
+
+
+
+ {renderActionsMenu}
+
+ {
+ table.capabilities.has(Capability.TABLE_INSERT) && table.insertPermission &&
+
+ }
-
-
-
- "auto"} // maybe nice? wraps values in cells...
- columns={columnsModel}
- rowBuffer={10}
- rowCount={totalRecords === null || totalRecords === undefined ? 0 : totalRecords}
- onPageSizeChange={handleRowsPerPageChange}
- onRowClick={handleRowClick}
- onStateChange={handleStateChange}
- density={density}
- loading={loading}
- filterModel={filterModel}
- onFilterModelChange={handleFilterChange}
- columnVisibilityModel={columnVisibilityModel}
- onColumnVisibilityModelChange={handleColumnVisibilityChange}
- onColumnOrderChange={handleColumnOrderChange}
- onSelectionModelChange={selectionChanged}
- onSortModelChange={handleSortChange}
- sortingOrder={[ "asc", "desc" ]}
- sortModel={columnSortModel}
- getRowClassName={(params) => (params.indexRelativeToCurrentPage % 2 === 0 ? "even" : "odd")}
- />
-
-
-
- {
- activeModalProcess &&
-
closeModalProcess(event, reason)}>
-
-
- }
+
+
+ "auto"} // maybe nice? wraps values in cells...
+ columns={columnsModel}
+ rowBuffer={10}
+ rowCount={totalRecords === null || totalRecords === undefined ? 0 : totalRecords}
+ onPageSizeChange={handleRowsPerPageChange}
+ onRowClick={handleRowClick}
+ onStateChange={handleStateChange}
+ density={density}
+ loading={loading}
+ filterModel={filterModel}
+ onFilterModelChange={handleFilterChange}
+ columnVisibilityModel={columnVisibilityModel}
+ onColumnVisibilityModelChange={handleColumnVisibilityChange}
+ onColumnOrderChange={handleColumnOrderChange}
+ onSelectionModelChange={selectionChanged}
+ onSortModelChange={handleSortChange}
+ sortingOrder={[ "asc", "desc" ]}
+ sortModel={columnSortModel}
+ getRowClassName={(params) => (params.indexRelativeToCurrentPage % 2 === 0 ? "even" : "odd")}
+ />
+
+
+
+ {
+ activeModalProcess &&
+
closeModalProcess(event, reason)}>
+
+
+ }
+
);
}
diff --git a/src/qqq/pages/records/view/RecordView.tsx b/src/qqq/pages/records/view/RecordView.tsx
index 55416f5..37e3101 100644
--- a/src/qqq/pages/records/view/RecordView.tsx
+++ b/src/qqq/pages/records/view/RecordView.tsx
@@ -81,7 +81,7 @@ function RecordView({table, launchProcess}: Props): JSX.Element
const location = useLocation();
const navigate = useNavigate();
- const pathParts = location.pathname.split("/");
+ const pathParts = location.pathname.replace(/\/+$/, "").split("/");
const tableName = table.name;
const [asyncLoadInited, setAsyncLoadInited] = useState(false);
@@ -122,6 +122,7 @@ function RecordView({table, launchProcess}: Props): JSX.Element
setNonT1TableSections([]);
setTableProcesses([]);
setTableSections(null);
+ setShowAudit(false);
};
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -458,6 +459,14 @@ function RecordView({table, launchProcess}: Props): JSX.Element
openModalProcess(process);
}
+ let hasEditOrDelete = (table.capabilities.has(Capability.TABLE_UPDATE) && table.editPermission) || (table.capabilities.has(Capability.TABLE_DELETE) && table.deletePermission);
+
+ function gotoCreate()
+ {
+ const path = `${pathParts.slice(0, -1).join("/")}/create`;
+ navigate(path);
+ }
+
const renderActionsMenu = (