Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Fields not visible 2022 4 #1934

Merged
merged 3 commits into from Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -178,9 +178,9 @@ export class FormBuilder extends React.Component<{
return <></>;
}

const isHidden =
(!getRowStateAllowRead(property, rowId || "", property.id) ||
getRowStateMayCauseFlicker(property)) && !!row;
let mayCauseFlicker = getRowStateMayCauseFlicker(property);
let rowStateAllowRead = getRowStateAllowRead(property, rowId || "", property.id);
const isHidden = (!rowStateAllowRead || mayCauseFlicker) && !!row;

if (property.column === "CheckBox") {
return (
Expand Down
12 changes: 9 additions & 3 deletions frontend-html/src/model/entities/RowState.ts
Expand Up @@ -23,12 +23,11 @@ import { getEntity } from "model/selectors/DataView/getEntity";
import { getApi } from "model/selectors/getApi";
import { getSessionId } from "model/selectors/getSessionId";
import { flashColor2htmlColor } from "utils/flashColorFormat";
import { IRowState, IRowStateColumnItem, IRowStateData, IRowStateItem } from "./types/IRowState";
import { IRowState, IRowStateColumnItem, IRowStateItem } from "./types/IRowState";
import { FlowBusyMonitor } from "utils/flow";
import { handleError } from "model/actions/handleError";
import { visibleRowsChanged } from "gui/Components/ScreenElements/Table/TableRendering/renderTable";
import { getDataSource } from "model/selectors/DataSources/getDataSource";
import { CancellablePromise } from "mobx/lib/api/flow";

const defaultRowStatesToFetch = 100;

Expand All @@ -51,7 +50,14 @@ export class RowState implements IRowState {
if (!visibleRows || dataSource.identifier !== visibleRows.dataSourceId) {
return;
}
this.visibleRowIds = visibleRows.rowIds;
// The event is sometimes raised with no ids, then some ids, then no ids...
// Ignoring the no ids makes sure that the triggerLoadDebounced will not run with no ids
// when some are actually visible. This problem was not really observed so may be the
// "if" statement could be removed if this results in more RowState calls then necessary.
if(visibleRows.rowIds.length > 0){
this.visibleRowIds = visibleRows.rowIds;
}
this.triggerLoadDebounced();
});
}

Expand Down