fix: display errors when adding a new repo#1120
Conversation
✅ Deploy Preview for endearing-brigadeiros-63f9d0 canceled.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1120 +/- ##
==========================================
+ Coverage 82.76% 82.78% +0.01%
==========================================
Files 66 66
Lines 2780 2783 +3
Branches 332 332
==========================================
+ Hits 2301 2304 +3
Misses 431 431
Partials 48 48 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Juan Escalada <97265671+jescalada@users.noreply.github.com>
kriswest
left a comment
There was a problem hiding this comment.
Needs a rebase, there are a handful of conflicting/similar changes in main.
I think there are some other cases where the errors aren't displayed that would benefit from similar changes, such as cancelling a push in the dashboard when you are not allowed. That's no doubt a separate issue ;-)
kriswest
left a comment
There was a problem hiding this comment.
LGTM - couple of minor comments.
The data-testid tags might be worth noting in the testing guide @jescalada is working on in #1147
Co-authored-by: Kris West <kristopher.west@natwest.com> Signed-off-by: Andy Pols <andy@pols.co.uk>
|
@finos/git-proxy-maintainers Please can someone merge this - thanks |
Summary
This PR fixes a bug where the client silently ignored server-side errors when adding a new repository. As a result, users were led to believe the repository was added successfully, only to see it disappear upon refreshing the page.
Root Cause
The
NewRepo.tsxcomponent (src/ui/views/RepoList/Components/NewRepo.tsx) always closed the modal, regardless of whether the server request succeeded or failed.Fix
Display server errors returned by addRepo in
src/ui/services/repo.js.Extended Cypress tests to:
Notes
Adding unit tests for the React components is desirable but considered out of scope for this PR.