Conversation
Every microfrontend ships its own TableEmptyResults, TableErrorState and TableEmptyState (dns, kubernetes, teams, volumes, vpc; NoResults in compute, settings and billing) to feed the `emptyState` and `errorState` slots, all with the same layout and copy. `VirtualizedTable.EmptyState` is the base layout (image, title, description, action). `VirtualizedTable.EmptyResults` is the filtered-to-nothing variant and `VirtualizedTable.ErrorState` the fetch failure variant; both read the table id from the new `tableId` context value and send the reset-filters / refresh event on their own, so consumers no longer need to thread `sendResetFiltersEvent(tableId)` or a refresh handler through. `onResetFilters` and `onRetry` take over when provided. Nothing is rendered by default when `emptyState` / `errorState` are not passed, so existing tables keep their current behaviour.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every microfrontend ships its own
TableEmptyResults,TableErrorStateandTableEmptyState(dns, kubernetes, teams, volumes, vpc;NoResultsin compute, settings and billing) to feed theemptyState/errorStateslots, all with the same layout and copy. This adds them to the library as sub-components:VirtualizedTable.EmptyState: base layout withimage,title,description,action.VirtualizedTable.EmptyResults: the filtered-to-nothing state. Reads the table id from context and sends the reset-filters event on its own;onResetFilterstakes over when provided. Copy (title,description,resetLabel) andimageare overridable.VirtualizedTable.ErrorState: the fetch-failure state. Sends the refresh event for its table by default;onRetry,title,description,retryLabel,iconare overridable. Works with theerrorState={(error) => ...}callback form to showerror.message.tableIdis now exposed in the table context so sub-components rendered inside the table can target it.Nothing renders by default when
emptyState/errorStateare not passed, so existing tables keep their behaviour.Test plan
npx vitest run lib/components/VirtualizedTable(81 tests, 15 new)npm run lint,npm run check:types, prettierVirtualizedTable/LightandDark→ErrorStateand the newEmptyResultsstories