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 on screen opened with a hyperlink were hidden 2023.1 #1949

Merged
merged 1 commit into from Sep 22, 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 @@ -120,6 +120,7 @@ export function renderTable(
}
visibleRowsChanged.trigger(
{
dataViewModelInstanceId: dataView().modelInstanceId,
dataSourceId: dataView().dataSource.identifier,
rowIds: visibleRowIds
});
Expand Down Expand Up @@ -185,6 +186,7 @@ export function renderCell(columnIdx: number) {
}

export interface IVisibleRowData{
dataViewModelInstanceId: string,
dataSourceId: string;
rowIds: string[];
}
Expand Down
23 changes: 15 additions & 8 deletions frontend-html/src/model/entities/RowState.ts
Expand Up @@ -39,7 +39,7 @@ export enum IIdState {
export class RowState implements IRowState {
$type_IRowState: 1 = 1;
suppressWorkingStatus: boolean = false;
visibleRowIds: string[] = [];
dataViewVisibleRows: Map<string,string[]> = new Map();

constructor(debouncingDelayMilliseconds?: number) {
this.triggerLoadDebounced = _.debounce(
Expand All @@ -54,10 +54,10 @@ export class RowState implements IRowState {
// 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;
if(visibleRows.rowIds.length > 0) {
this.dataViewVisibleRows.set(visibleRows.dataViewModelInstanceId, visibleRows.rowIds);
this.triggerLoadDebounced();
}
this.triggerLoadDebounced();
});
}

Expand All @@ -84,11 +84,18 @@ export class RowState implements IRowState {
if(loadAll){
return this.requests.values()
}
return this.visibleRowIds.length === 0
? Array.from(this.requests.values()).slice(-defaultRowStatesToFetch)
: this.visibleRowIds
if (this.dataViewVisibleRows.size === 0) {
return Array.from(this.requests.values()).slice(-defaultRowStatesToFetch);
} else {
let requestForVisibleRows: RowStateRequest[] = [];
for (let visibleRowIds of this.dataViewVisibleRows.values()) {
const requestsForDataView = visibleRowIds
.map(rowId => this.requests.get(rowId))
.filter(x => x !== undefined) as unknown as IterableIterator<RowStateRequest>;
.filter(x => x !== undefined) as unknown as IterableIterator<RowStateRequest>
requestForVisibleRows = [...requestForVisibleRows, ...requestsForDataView];
}
return requestForVisibleRows;
}
}

*triggerLoad(loadAll: boolean): any {
Expand Down