fix(frontend): disable the per-cell result download when result export is switched off - #8539
Conversation
Automated Reviewer SuggestionsBased on the
|
Backport auto-label reportThis
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8539 +/- ##
============================================
+ Coverage 95.90% 96.07% +0.16%
Complexity 459 459
============================================
Files 589 589
Lines 33953 37054 +3101
Branches 4246 5035 +789
============================================
+ Hits 32564 35601 +3037
- Misses 811 847 +36
- Partials 578 606 +28
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…t is switched off `export-execution-result-enabled` is a deployment switch. The top menu and the context menu already honour it, but the download button on every result cell rendered regardless, and clicking it returned silently from WorkflowResultExportService.performExport: no request, no message. A reader could not tell whether the feature was broken or off. Bind the button's `disabled` state to the switch and say why in its title, the same way the menu entry is disabled. The stylesheet hardcodes the icon color and cursor, so the disabled state also gets its own look; without it the disabled button was indistinguishable from the live one. Tests cover both states through the MockGuiConfigService that the component actually receives, and the existing click test now asserts it clicks a live button. Closes apache#8538 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
39e828d to
0698dc6
Compare
What changes were proposed in this PR?
export-execution-result-enabledis a deployment switch (defaultfalseingui.conf; the k8s chart turns it on). The top menu already disables its Export entry on that switch and the context menu hides its entry, but the download button on every result cell rendered regardless. Clicking it opened the export dialog, and every action in the dialog (export to local, save to a dataset, save to a newly created dataset) returned early fromWorkflowResultExportService.performExportwith no request and no message, after which the dialog closed. On a default local deployment this looks like a broken feature rather than a disabled one.This PR binds the cell button's
disabledstate to the switch and explains it in the button's title ("Result export is disabled on this deployment"), the same way the menu entry is disabled. Nothing changes for deployments that have the switch on.result-table-frame.component.ts: a publicexportEnabledgetter overGuiConfigService.result-table-frame.component.html:[disabled]and[title]on the download button.result-table-frame.component.scss: a disabled look. The stylesheet hardcodes the icon color and cursor, so without this the disabled button was indistinguishable from the live one.The early
returninperformExportis left as is; with all three entry points now honouring the switch it is a last line of defence rather than a user-facing path.Any related issues, documentation, discussions?
Closes #8538 (includes a recording of the before state).
How was this PR tested?
result-table-frame.component.spec.ts: with the switch on the button is enabled and titled "Download data"; with it off it is disabled and titled "Result export is disabled on this deployment". The switch is driven throughMockGuiConfigService.setConfig, which is what the component receives undercommonTestProviders. The existing click test now turns the switch on first and asserts it clicks a live button, since the mock ships with the switch off.[disabled], making the title static, forcing the getter totrue, and forcing it tofalseeach turn exactly one named test red; removing the switch from the existing click test turns that test red.coverage-final.json, the getter runs 78 times in the spec).ng test --watch=false: 217 files, 5928 passed, 1 skipped (pre-existing), 0 failed.ng build --configuration=production(AOT): clean.eslinton the ts/html/spec andprettier --checkon all four files: clean.Was this PR authored or co-authored using generative AI tooling?
Yes. Generated-by: Claude Code (Claude Fable 5.1, Anthropic). Co-authored with Claude; the author reviewed the change before submission.
🤖 Generated with Claude Code