Skip to content

feat/AB#106234_EIS-improve-messages-for-file-download #2708

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

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

Conversation

unai-reliefapp
Copy link
Contributor

Description

feat: add new interceptor for csApi requests error handling
feat: add interceptor in all projects
feat: add cs api error builder to be able to build error message based on the returned error status from the interceptor
feat: change snackbar to be able to handle line breaks in the given string

Useful links

  • Link to ticket
  • Please insert link to back-end branch if any
  • Please insert any useful link ( documentation you used for example )

Type of change

Please delete options that are not relevant.

  • Improvement (refactor or addition to existing functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

  • Test A
  • Test B

Screenshots

image

Sin título

Checklist:

( * == Mandatory )

  • * I have set myself as assignee of the pull request
  • * My code follows the style guidelines of this project
  • * Linting does not generate new warnings
  • * I have performed a self-review of my own code
  • * I have put the ticket for review, adding the oort-frontend team to the list of reviewers
  • * I have commented my code, particularly in hard-to-understand areas
  • * I have put JSDoc comment in all required places
  • * My changes generate no new warnings
  • * I have included screenshots describing my changes if relevant
  • * I have selected labels in the Pull Request, according to the changes with code brings
  • I have made corresponding changes to the documentation ( if required )
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

More explanation

https://www.loom.com/share/05a716d61b9744faaf51fb304c21d1e5?sid=f87cf896-582a-4f76-93ae-8ceed801b145

…nterceptor for csApi requests error handling feat: add interceptor in all projects feat: add cs api error builder to be able to build error message based on the returned error status from the interceptor feat: change snackbar to be able to handle line breaks in the given string
@unai-reliefapp unai-reliefapp added the alpha To be released on alpha branch label Nov 25, 2024
@unai-reliefapp unai-reliefapp self-assigned this Nov 25, 2024
@unai-reliefapp
Copy link
Contributor Author

@AntoineRelief , those are example messages.
Also it took me so much time because the message sent from their API had a strange format, plus i could only fetch the error response metadata using an interceptor and stringifying it's content back to the service layer, idk why if i threw the error response from the interceptor as it is i only received a stack and message properties from the service layer without any useful metadata

KR, Unai

if (request.url.startsWith(this.environment.csApiUrl)) {
return next.handle(request).pipe(
catchError((err) => {
return throwError(
Copy link
Collaborator

Choose a reason for hiding this comment

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

@unai-reliefapp

indeed, it's due to the responseType

Not sure an interceptor is a good solution, as it's just one request
I'll check that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha To be released on alpha branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants