Skip to content

feat(user-widget): fix bugs in search by term; creates infinite scroll#201

Merged
renan-vtex merged 2 commits intovtex-apps:masterfrom
tiago-freire:feat/user-widget-organizations-infinite-scroll
Oct 9, 2025
Merged

feat(user-widget): fix bugs in search by term; creates infinite scroll#201
renan-vtex merged 2 commits intovtex-apps:masterfrom
tiago-freire:feat/user-widget-organizations-infinite-scroll

Conversation

@tiago-freire
Copy link
Contributor

@tiago-freire tiago-freire commented Sep 2, 2025

What problem is this solving?

  • Fixes bugs in the textual search for the user active organizations. The issue occurred due to React key collisions in elements created during the list iteration when the organization/cost center combination was repeated.
  • Creates an infinite scroll that loads organizations in the DOM according to the user's scrolling.

Note: The list of the user active organizations is loaded in its entirety into memory because it is not possible to retrieve the filtered data from the masterdata in this case, since the organization and cost center name fields are in the organizations and cost_centers entities, and the search is performed on the b2b_users entity, which contains only the orgId and costId. The organization and cost center names displayed in the table are from field resolvers that search in the organizations and cost_centers entities based on these IDs with the masterdata b2b_users search already performed. The benefit here is in loading the DOM, since too many elements will not be loaded initially.

How to test it?

  • Link this branch on a B2B VTEX account
  • Log in to the store with a user with more than 15 linked active organizations/cost centers
  • Open the user widget modal

Workspace

Screenshots or example usage:

tiago--b2bstore005-myvtex-com.webm

@vtex-io-ci-cd
Copy link

vtex-io-ci-cd bot commented Sep 2, 2025

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

  • Patch (backwards-compatible bug fixes)

  • Minor (backwards-compatible functionality)

  • Major (incompatible API changes)

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

  • No thanks, I would rather do it manually 😞

@vtex-io-docs-bot
Copy link

vtex-io-docs-bot bot commented Sep 2, 2025

Beep boop 🤖

I noticed you didn't make any changes at the docs/ folder

  • There's nothing new to document 🤔
  • I'll do it later 😞

In order to keep track, I'll create an issue if you decide now is not a good time

  • I just updated 🎉🎉

Comment on lines -158 to -159
dataList: [],
totalDataList: 0,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For performance improvement, we removed these derived states to simply derive the query result (see below in this file).

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

Messages
📖 ❤️ Thanks!
📖

🎉 PR additions = 229, PR deletions = 90

Generated by 🚫 dangerJS against f69e17e

@renan-vtex renan-vtex merged commit 255b1ba into vtex-apps:master Oct 9, 2025
35 of 39 checks passed
@vtex-io-ci-cd
Copy link

vtex-io-ci-cd bot commented Oct 9, 2025

Your PR has been merged! App is being published. 🚀
Version 3.0.1 → 3.1.0

After the publishing process has been completed (check #vtex-io-releases) and doing A/B tests with the new version, you can deploy your release by running:

vtex deploy vtex.b2b-organizations@3.1.0

After that your app will be updated on all accounts.

For more information on the deployment process check the docs. 📖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants