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(entity-consumers): optimize consumer data fetching in <AddConsumerModal /> and <AddToGroupModal /> #935

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

nekolab
Copy link
Contributor

@nekolab nekolab commented Nov 21, 2023

Previously, <AddConsumerModal /> and <AddToGroupModal /> triggers loadItems during onBeforeMount, leading to premature and unnecessary data fetching, especially in scenarios where only browsing the list is required.

This fetching strategy also resulted in outdated, non-refreshable data. To resolve this, loadItems has been shifted to a watch block, ensuring timely and relevant data fetching.

Additionally, the sandbox page now references VITE_KONG_MANAGER_CONSUMER_GROUP_ID for dynamic consumer group ID handling, replacing the previously hardcoded value.

Summary

PR Checklist

  • Naming & Structure: the files and package structure use the conventions outlined in the Creating a Package docs.
  • Tests pass: check the output of all package unit and/or component tests.
    • If this PR is the result of a bug, test coverage was added accordingly.
  • Functional: all changes do not break existing APIs, but if so, a BREAKING CHANGE commit is in place to bump the major version.
  • Conventional Commits all commits follow the conventional commit standards outlined in the main README.
  • Docs: includes a technically accurate README, and the docs have been updated accordingly based on the changes in this PR.

@nekolab nekolab force-pushed the fix/add-consumer-modal-fetch branch from 170f22c to eebe605 Compare November 22, 2023 08:55
@nekolab nekolab marked this pull request as ready for review November 22, 2023 08:55
@nekolab nekolab requested review from a team, adamdehaven, ValeryG and jillztom as code owners November 22, 2023 08:55
Copy link
Member

@Leopoldthecoder Leopoldthecoder left a comment

Choose a reason for hiding this comment

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

LGTM

@nekolab nekolab enabled auto-merge (squash) November 22, 2023 09:23
@nekolab nekolab disabled auto-merge November 22, 2023 09:32
…erModal />`

Previously, `<AddConsumerModal />` and `<AddToGroupModal />` triggers `loadItems`
during `onBeforeMount`, leading to premature and unnecessary data fetching,
especially in scenarios where only browsing the list is required.

This fetching strategy also resulted in outdated, non-refreshable data.
To resolve this, `loadItems` has been shifted to a `watch` block, ensuring timely
and relevant data fetching.

Additionally, the sandbox page now references `VITE_KONG_MANAGER_CONSUMER_GROUP_ID`
for dynamic consumer group ID handling, replacing the previously hardcoded value.
@nekolab nekolab changed the title fix(entity-consumers): optimize consumer data fetching in <AddConsumerModal /> fix(entity-consumers): optimize consumer data fetching in <AddConsumerModal /> and <AddToGroupModal /> Nov 22, 2023
@Leopoldthecoder Leopoldthecoder merged commit b2f8cc5 into main Nov 22, 2023
7 checks passed
@Leopoldthecoder Leopoldthecoder deleted the fix/add-consumer-modal-fetch branch November 22, 2023 11:18
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.

3 participants