-
Notifications
You must be signed in to change notification settings - Fork 4
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
[DUOS][risk=no] translate page x2 - added error handling, added no results block, updated url to be hardcoded #1799
Conversation
The actual endpoint throws a CORS error - Please correct me I'm wrong, but there's nothing we can do about that, and it might be okay in dev? But if any fixes need to happen, it's in the api? |
The CORS error is because we're not going through the local proxy. |
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.
was able to test it ok, the changes themselves look good, once we figure out the config stuff I will retry + approve.
src/pages/Translator.js
Outdated
@@ -133,7 +117,14 @@ export default function Translator() { | |||
style: { width: '100%', justifyContent: 'center' } | |||
}, [Spinner]), | |||
|
|||
div({ isRendered: !isLoading, className: 'row no-margin' }, [ | |||
div({ isRendered: error }, [ | |||
'There was an error running your request' |
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.
do we want to use error to show something more specific
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.
i dont want to show the error message if it's something wrong with our servers or our code, only if it's a user error (that they can do something about). For now, I think this is okay, since I'm just trying to rush this code in real quick ^_^;
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.
👍🏽
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.
UI code is hitting the endpoint and relaying the results to the client.
The url is now up and running (despite CORS error), so had to make a few tweaks to this code
Have you read Terra's Contributing Guide lately? If not, do that first.