-
Notifications
You must be signed in to change notification settings - Fork 2
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
base: master
Are you sure you want to change the base?
Conversation
Quality Gate failedFailed conditions |
@folio-org/fe-tl-reviewers please review |
There was a problem hiding this 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.
There was a problem hiding this 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.
See my comment for the architectural issues in this approach. I can only ask for these aspects of this work to be reconsidered.
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