Skip to content
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

UIBULKED-571 Errors in response to UI calls #661

Merged
merged 6 commits into from
Dec 24, 2024
Merged

UIBULKED-571 Errors in response to UI calls #661

merged 6 commits into from
Dec 24, 2024

Conversation

vashjs
Copy link
Contributor

@vashjs vashjs commented Dec 10, 2024

Based on the new requirements, for all non bulk-operation modules to which the UI makes requests, errors should be generated according to the following template:

<module-name> returns status code: <status-code> - <error details>.

Since some models do not have a message and the message consists only of a status code, additional logic has been added for such cases. Depending on the specific case, a basic HTTP error will be shown based on the dictionary from http-status-codes library.

Refs: UIBULKED-571

Copy link

github-actions bot commented Dec 10, 2024

Jest Unit Test Statistics

    1 files  ±0    50 suites  +1   3m 12s ⏱️ +2s
319 tests +9  319 ✔️ +9  0 💤 ±0  0 ±0 
326 runs  +9  326 ✔️ +9  0 💤 ±0  0 ±0 

Results for commit b91c680. ± Comparison against base commit 4af6b4a.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Dec 10, 2024

BigTest Unit Test Statistics

0 tests  ±0   0 ✔️ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ±0 

Results for commit b91c680. ± Comparison against base commit 4af6b4a.

♻️ This comment has been updated with latest results.

@vashjs vashjs marked this pull request as ready for review December 10, 2024 23:25
@vashjs vashjs requested review from UladzislauKutarkin and a team December 10, 2024 23:25
@vashjs
Copy link
Contributor Author

vashjs commented Dec 16, 2024

@folio-org/fe-tl-reviewers please review

Copy link

@JohnC-80 JohnC-80 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do better than the static lists contained in this - HTTP codes/messages or UI module names... as the capabilities of bulk-edit increase, the static list of module names would have to be updated. Blocking until further PO feedback is obtained.

Copy link

@JohnC-80 JohnC-80 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A static npm library is better than keeping the code : message mapping in our own code, but only just so. If this information is intended for developers to fix the issue, a lack of an error response from the server is most definitely an issue - but that isn't helped if an error message is contrived by the UI. UI modules should not make up for the shortcomings of backend modules.
FOLIO generally keeps a separation between the UI and the backend via interface - this said, backend modules can change without the UI caring, so long as the same interface is still provided. Now with the static list in place, the UI for Bulk Edit has to concern itself with potential changes. Future developments will see if we can make this functionality more dynamic... until then, here we are.

@JohnC-80 JohnC-80 self-requested a review December 20, 2024 17:37
@JohnC-80 JohnC-80 dismissed their stale review December 20, 2024 17:42

See my comment for the architectural issues in this approach. I can only ask for these aspects of this work to be reconsidered.

@vashjs vashjs merged commit 008d69a into master Dec 24, 2024
6 checks passed
@vashjs vashjs deleted the UIBULKED-571 branch December 24, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants