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

Feature: Infinite scrolling for searching foreign key values in the ToolJet database. #9785

Conversation

ganesh8056
Copy link
Collaborator

Previously we don't support infinite scroll on searching the Foreign key values in ToolJet database. Now the ToolJet database has a feature that allows for infinite scrolling to search for foreign key values.

Copy link

Copy link
Collaborator

@akshaysasidrn akshaysasidrn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have put some small comments, please take a look.

Also, can we solve this behaviour? It is tedious to scroll to the bottom value every time a re-fetch happens.
infinite-scroll

});
}
}
let debouncedHandleSearchInSelectBox;
if (scrollEventForColumnValus) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spell error: Values

let scrollTop = target?.scrollTop;
const scrollPercentage = ((scrollTop + target?.clientHeight) / target?.scrollHeight) * 100;
const totalFKRecords = headers['content-range'].split('/')[1] || 0;
if (Array.isArray(data) && data?.length > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can skip optional chaining


if (isFirstPageLoaded && offset >= totalRecords) return;
setIsLoadingFKDetails(true);
const referencedColumns = foreignKeys?.find((item) => item.column_names[0] === cellColumnName);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we handle foreign keys missing instead of optional chaining?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to handle null and undefined cases explicitly instead of relying on optional chaining as these null/undefined values will trickle down and make it hard to reason about code IMHO. Only use them if we can't predict the optional part at all.

…atabase for varchar datatype possible search results will be returned and for other datatype strict matching is followed
akshaysasidrn
akshaysasidrn previously approved these changes May 22, 2024
@ganesh8056 ganesh8056 dismissed akshaysasidrn’s stale review May 22, 2024 12:57

The merge-base changed after approval.

akshaysasidrn
akshaysasidrn previously approved these changes May 23, 2024
@ganesh8056 ganesh8056 dismissed akshaysasidrn’s stale review May 23, 2024 08:45

The merge-base changed after approval.

Copy link

Copy link

github-actions bot commented Jun 3, 2024

* fix: filtered out null values and brought empty string to top in the foreign key drop down

* fix: review comments addressed

* fix: while creating or editing FK relation the source column drop down will not list empty column names

* stylefix: cell was not clickable on empty string
Copy link

github-actions bot commented Jun 3, 2024

@akshaysasidrn akshaysasidrn merged commit 35e8d11 into release/database-1.1.1 Jun 4, 2024
7 checks passed
@akshaysasidrn akshaysasidrn deleted the feature/infinitescroll-for-foreignkeydata-tjdb branch June 4, 2024 12:20
Copy link

@Mapuppy09 Mapuppy09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good , it needed more about foreign key access please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants