Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[ENG-6669] Institutional Access project Request Modal #2433
[ENG-6669] Institutional Access project Request Modal #2433
Changes from 1 commit
51fd954
3a29a83
5a7fe94
13f0699
0039fc6
660cee2
2fe05c7
5300c97
002ccc8
bf8ab2c
1abd4e4
d54a71d
dae4684
6fb0bee
9b21ce4
524eef0
4057df3
19fb416
4b74341
983ac69
e7f569d
715bee8
a92edbf
9a3e056
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Is there a reason why we have a
setTimeout
here? I'd like to avoid any unneeded timeouts if possibleThere 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.
Yes, I'll leave a comment here, I clarified this but only later on line 243, and not very well. The reason for the timeout is that ember bans having two dialogue modals open at the same time and the modal closing animation happens too slowly, so just
opens modal2 before the modal1 close animation is complete. Causing the framework to produce an error because there are technically two open modals. Product wanted a modal on this, because the toast message is not enough.
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.
Similar to a comment above, I would avoid using
setTimeout
to set page states if possible. In this case, I think you can just add this bit of logic in to thefinally
block like: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.
As mentioned in the comment above this actual will temporarily cause where both modals are open simultaneously.
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.
It seems like there's some redundant conditions here in this
catch
block as most of these seem to just result in the same toast message. Some of the conditions may be a bit fragile as well if they are doing aString.includes
and if the language returned from the API changes, these could break as well. I would recommend using
getApiErrorMessage(error)
and this should just find the appropriate error message from the API. Then at the end, you could just callthis.toast.error(getApiErrorMessage(error), someOptionalToastTitle)
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.
Yes this is because there isn't standardization of error messages, so some http response codes are in the payload and some are simply not there. the 429s and some 409s are not standard, however looking at this now and I think I can improve, so that it reads the response header instead of the payload.
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 typically discourage the use of
!important
in css files, as these could lead to weird one-off styles. If you can achieve the same styles without the!important
(which at first glance, I don't see anything that needs it), that would be appreciated. If it is needed, I usually leave a little comment to indicate what it is overriding or why it's neededThere 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 keep having issues with Ember "Uppercase" component's css, especially
<Button>
button's need !important to override the no border rule, because (I believe) buttons had an accessibility requirement to have boarders at some point. I'll try to fix it, but I'll leave a long comment if I can't fix it.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.
Similarly, on this CSS file, there's a couple "mystery colors" floating around. We typically try to use color variables like
$color-border-gray
instead of say#ddd
. You might find colors that match inapp/styles/_variables.scss
, so I would encourage the use of the color variables in there