-
Notifications
You must be signed in to change notification settings - Fork 10
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(entities-*): revamp hide toolbar logic #1790
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, awesome work @Justineo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Summary
KM-709
Preview PR for
konnect-ui-apps
: https://github.com/Kong/konnect-ui-apps/pull/4896Note
I've updated this PR to a more comprehensive fix for several current issues.
Currently, logic related to table state and toolbar visibility is scattered across multiple places, leading to redundancy, inaccuracies, and visual inconsistencies. Here's a breakdown of the existing problems and their respective issues:
Each entity list observes
fetcherState
to update ahasData
flag, which determines the visibility of the create button:public-ui-components/packages/entities/entities-gateway-services/src/components/GatewayServiceList.vue
Lines 562 to 565 in 1ea901e
Each entity list observes
fetcherState
to toggle thehideTableToolbar
flag and set it totrue
when the state isFetcherStatus.NoRecords
:public-ui-components/packages/entities/entities-gateway-services/src/components/GatewayServiceList.vue
Lines 567 to 571 in 1ea901e
EntityBaseTable
also controls the visibility of toolbar content using theKTableData
's state event:public-ui-components/packages/entities/entities-shared/src/components/entity-base-table/EntityBaseTable.vue
Lines 264 to 266 in 1ea901e
Refactored Logic
To address these issues, all related logic has been centralized within the
EntityBaseTable
, ensuring consistent behavior across all use cases. The refactored workflow includes:KTableData
'shideToolbar
is now calculated by table states and queryhideToolbar
prop, which now defaults toundefined
so that we can offer the default behavior if it's not specified