QQQ-32: added booleans, cleaned up error handling, fixed infinite loop on unauthorized login, removed all the login buttons, removed redundant qClient functions

This commit is contained in:
Tim Chamberlain
2022-08-09 11:52:32 -05:00
parent c4b72c4b11
commit 7cb3c5ee88
12 changed files with 81 additions and 104 deletions

View File

@ -87,6 +87,7 @@ function EntityList({table}: Props): JSX.Element
const columnVisibilityLocalStorageKey = `${COLUMN_VISIBILITY_LOCAL_STORAGE_KEY_ROOT}.${tableName}`;
let defaultSort = [] as GridSortItem[];
let defaultVisibility = {};
const qController = QClient.getInstance();
if (localStorage.getItem(sortLocalStorageKey))
{
@ -193,7 +194,7 @@ function EntityList({table}: Props): JSX.Element
{
(async () =>
{
const newTableMetaData = await QClient.loadTableMetaData(tableName);
const newTableMetaData = await qController.loadTableMetaData(tableName);
setTableMetaData(newTableMetaData);
if (columnSortModel.length === 0)
{
@ -206,14 +207,14 @@ function EntityList({table}: Props): JSX.Element
const qFilter = buildQFilter();
const count = await QClient.count(tableName, qFilter);
const count = await qController.count(tableName, qFilter);
setTotalRecords(count);
setButtonText(`new ${newTableMetaData.label}`);
setTableLabel(newTableMetaData.label);
const columns = [] as GridColDef[];
const results = await QClient.query(
const results = await qController.query(
tableName,
qFilter,
rowsPerPage,
@ -362,7 +363,7 @@ function EntityList({table}: Props): JSX.Element
setTableState(tableName);
setFilterModel(null);
setFiltersMenu(null);
const metaData = await QClient.loadMetaData();
const metaData = await qController.loadMetaData();
setTableProcesses(QProcessUtils.getProcessesForTable(metaData, tableName));

View File

@ -38,8 +38,9 @@ import Icon from "@mui/material/Icon";
import MDAlert from "components/MDAlert";
import MDButton from "../../../../../components/MDButton";
import QProcessUtils from "../../../../utils/QProcessUtils";
import QClient from "qqq/utils/QClient";
const qController = new QController("");
const qController = QClient.getInstance();
// Declaring props types for ViewForm
interface Props