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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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 pre-created dictionary.

Refs: UIBULKED-571

Copy link

github-actions bot commented Dec 10, 2024

Jest Unit Test Statistics

    1 files  ±0    47 suites  ±0   3m 7s ⏱️ +2s
306 tests +6  306 ✔️ +6  0 💤 ±0  0 ±0 
312 runs  +6  312 ✔️ +6  0 💤 ±0  0 ±0 

Results for commit 6432548. ± Comparison against base commit 7db3438.

♻️ 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 6432548. ± Comparison against base commit 7db3438.

♻️ This comment has been updated with latest results.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
78.9% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@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.

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.

3 participants