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

[UI v2] Refactor parts of variables components #16084

Merged
merged 18 commits into from
Nov 25, 2024
Merged

Conversation

desertaxle
Copy link
Member

Now that the core functionality is in place, I went through what's been created so for to refactor and polish. The code of this refactor is to reduce prop drilling, increase readbility and increase reusability of existing functionality.

Here are some of the highlights in no particular order:

  • The existing queries for variables and variables counts have been consolidated into a single useVariables hook.
  • All query and mutation hooks have been collocated and query_key creation has been consolidated to prevent typo-based errors.
  • The pagination, filtering, and sorting state management has been consolidated into their own hooks.
  • Variable dialog state management has been encapsulated in a hook.
  • The search parameter validation has been updated to gracefully handle search parameters that don't conform to the expected typing.

Related to #15512

@desertaxle desertaxle force-pushed the ui-v2-variables-refactor branch from ec9f7fb to ddd3523 Compare November 21, 2024 20:16
@desertaxle desertaxle added the development Tech debt, refactors, CI, tests, and other related work. label Nov 21, 2024
@desertaxle desertaxle marked this pull request as ready for review November 21, 2024 20:28
@desertaxle desertaxle changed the title UI v2 variables refactor [UI v2] Refactor parts of variables components Nov 21, 2024
@aaazzam
Copy link
Collaborator

aaazzam commented Nov 24, 2024

if the tag name has one character, it'll error out with an "undefined" error

@aaazzam
Copy link
Collaborator

aaazzam commented Nov 24, 2024

filtering by variable name doesn't require pressing return, filtering by tag does. (I get why, but it's a little annoying -- not blocking)

@aaazzam
Copy link
Collaborator

aaazzam commented Nov 24, 2024

Screenshot 2024-11-24 at 10 00 30 AM

@aaazzam
Copy link
Collaborator

aaazzam commented Nov 24, 2024

Screenshot 2024-11-24 at 10 00 50 AM

@aaazzam
Copy link
Collaborator

aaazzam commented Nov 24, 2024

Screenshot 2024-11-24 at 10 01 21 AM

@aaazzam
Copy link
Collaborator

aaazzam commented Nov 24, 2024

the "X" in the sonner feels like it should be vertically aligned

Screenshot 2024-11-24 at 10 03 31 AM

Base automatically changed from ui-v2-variables-edit to main November 24, 2024 20:35
@desertaxle desertaxle force-pushed the ui-v2-variables-refactor branch from 689a6b3 to 327e3c3 Compare November 25, 2024 15:09
@desertaxle desertaxle merged commit 28fd4c3 into main Nov 25, 2024
7 checks passed
@desertaxle desertaxle deleted the ui-v2-variables-refactor branch November 25, 2024 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Tech debt, refactors, CI, tests, and other related work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants