Repository navigation
fix(tablev2): make Table status required so an empty table no longer shows "No results" while loading - #1255
eve-ci-cd[bot] wants to merge 7 commits into
Conversation
… in context (CUI-44) Part of the implementation plan from scality/agent-task#613. Issue: CUI-44
… is empty (CUI-44) Part of the implementation plan from scality/agent-task#613. Issue: CUI-44
Part of the implementation plan from scality/agent-task#613. Issue: CUI-44
…y (CUI-44) Part of the implementation plan from scality/agent-task#613. Issue: CUI-44
Part of the implementation plan from scality/agent-task#613. Issue: CUI-44
…(CUI-44) Part of the implementation plan from scality/agent-task#613. Issue: CUI-44
|
/approve |
Hello eve-ci-cd[bot],My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: The following options are set: approve |
…e (CUI-44) Part of the implementation plan from #1255.
Cerebro ci-fix round — fix pushed❌ CI verified: one or more checks are failing on the head commit. CI fix:
|
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: The following options are set: approve |
🔴 Request changesWhy the tests need changes
Findings
This review is advisory and does not block the merge. Full reviewThe test exercises code without verifying any outcome
Findings
|
Summary
Tabletreated an omittedstatuslike'success', so emptydatarendered "No results found" while the consumer was still fetching. This PR makesstatusa required prop onTableProps/TableContextType. It also adds a runtime safety net inTableRows: if an untyped caller omitsstatusand the rawdatais empty, the table shows the loader and logs oneconsole.warn. With non-empty data and no status, rows still render, and a filter that matches nothing still shows "No results". Every<Table>call site in the repo, the stories and the Table guideline now passstatusexplicitly.Steps
statusis required onTablePropsandTableContextType, its JSDoc is rewritten to describe the fetch state, andisDataEmpty(from the rawdata.length) is added to the context.UnsuccessfulResultand warns once through a module-level flag. With non-empty data it renders as for'success'.AttachmentTable,AttachmentConfirmationModal,Tablev2.test.tsx,MultiSelectableContent.test.tsx).describe('status')).Breaking change / release note
statusis now required onTable. I checked whereTableis exported: it comes only fromsrc/lib/next.ts, not from the stablesrc/lib/index.ts. CLAUDE.md / CONTRIBUTING allow narrowing a type "behind a major or innext.ts", so this falls within the documented policy. Downstream consumers of@scality/core-ui/next(MetalK8s, zenko-ui, xCore) still need to passstatuswhen they bump. Put this in the release notes, since there is no CHANGELOG file. react-query v5 users must map'pending'to'loading'themselves.'pending'was deliberately left out of the union because this repo uses react-query v3.Runtime trade-off: a caller that is untyped or uses
as any, has a genuinely empty dataset and passes nostatusnow sees the loader indefinitely, plus one warning.Declared deviations (approved by the reviewer)
@jbwatenbergscality/storybook-webmcp)MultiSelectableContent.test.tsxandTablev2.test.tsx(a long import, oneexpect).LoadingTabletwice, at line 633 (added in step 4, with empty data) and line 665 (the original, with data)."LoadingEmptyTable), because a duplicateexport constbreaks the build and Storybook.describe('status')sits inside a seconddescribe('TableV2', ...)block appended at the end of the file, not inside the firstdescribe('TableV2')block."Reviewer notes
status… shows the loading placeholder and warns". That is only true whendatais empty. With non-empty data, rows still render. Consider tightening the wording.TableCommon.tsx. It is the only test that renders an empty table with no status, so it is order-safe today. A future test that does the same would interfere with it.@ts-expect-error status is requiredtest only has an effect undertsc, because the Jest transform is babel-only.development/1.0, the default branch this was cut from. The plan resolved no fixVersion branch. Retarget by hand if needed.Test strategy
New tests in
src/lib/components/tablev2/Tablev2.test.tsx:data=[]shows the loader, does not show "No results found", and callsconsole.warnexactly once, including after a rerender. This fails on the unfixed code.globalFilterthat matches nothing shows "No results found", both with'success'and with status omitted. (c)status="loading"with[]shows the loader. (d)status="success"with[]shows "No results found".// @ts-expect-error status is requiredon a<Table>that has nostatus.These tests were not run locally: dependency install failed (npm ci 401 on GitHub Packages,
jest-environment-jsdommissing). CI needs to confirmnpm testandnpm run build.CI replication
CI was not replicated before this PR was opened: none of the pull-request jobs in .github/workflows can be replicated outside Actions.
.github/workflows/codeql.yaml› analyze (uses github/codeql-action/init, which cannot be replicated outside Actions);.github/workflows/dependency-review.yaml› dependency-review (uses actions/dependency-review-action, which cannot be replicated outside Actions);.github/workflows/review.yml› review (calls a reusable workflow);.github/workflows/storybook-build.yml› build-storybook (uses Actions expressions (secrets, matrix, context) only Actions can evaluate)Verification
The implementation agent ran 47 shell commands in this run (12 exited non-zero).
git×20 ·ls×6 ·grep×5 ·cat×4 ·npx×4 ·python3×2 ·(nohup×1 ·(npm×1 · +4 more