-
Notifications
You must be signed in to change notification settings - Fork 7
Item 7767: View details section of ErrorPage Redesign - Story 2 #1589
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
Conversation
cnathe
left a comment
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.
Just some quick comments. I'll do a more thorough code review after manual testing.
| If you are subscribed to LabKey, then reach out to your account manager for immediate help. If you are using | ||
| the community edition, your support ticket will be resolved within the next 2 to 3 weeks. | ||
| </div> | ||
| <br /> | ||
| <div className="labkey-error-details"> | ||
| {helpLinkNode('default', 'LabKey support documentation')} is another immediate resource that is available to | ||
| all users. A search through the documentation or previous forum questions may also help troubleshoot your | ||
| issue. |
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.
Does anyone know if this text has been reviewed by the support team? Looking at this page, it looks like the response time of community forum posts is "as time allows". Ankur, if you haven't chatted with the support team and reviewed these pages with them yet, I'm happy to do so.
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 asked the services team around the wording of config exception in the specs but not all the pages. Yes, it'd be great if you don't mind chatting with the team. Thanks.
# Conflicts: # assay/package-lock.json # assay/package.json # core/package-lock.json # core/package.json # experiment/package-lock.json # experiment/package.json # issues/package-lock.json # issues/package.json # list/package-lock.json # list/package.json # query/package-lock.json # query/package.json # study/package-lock.json # study/package.json
…ffering media page widths
| </li> | ||
| </ul> | ||
| </div> | ||
| {getServerContext().impersonatingUser !== undefined && ( |
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 would be good to get some jest tests for the various different displays here for the permissions error with and without the impersonate user.
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.
Not sure how to impersonate in jest tests, do you have any pointers to existing example?
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.
If it is just a matter of setting some specific context on the LABKEY object for a certain test case (i.e. the LABKEY.impersonatingUser in this case), then we have an example of that in labkey-ui-components which might work here:
labkey-ui-components/packages/components/src/internal/app/utils.spec.ts
|
@labkey-ankurj I've closed the related |
labkey-nicka
left a comment
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'd like to discuss the different usages of ErrorView and see if we can consolidate them so that the implementation that is specific to the view isn't the callers responsibility.
experiment/src/org/labkey/experiment/controllers/exp/ExperimentController.java
Outdated
Show resolved
Hide resolved
experiment/src/org/labkey/experiment/controllers/exp/ExperimentController.java
Outdated
Show resolved
Hide resolved
| super.setStatus(HttpServletResponse.SC_OK); | ||
| } | ||
| } | ||
| else if (CONTENT_TYPE_HTML.equals(getRequest().getHeader("Content-Type)")) || |
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.
@labkey-nicka Let me know if this looks right. I tried to test through the URL link that you showed yesterday and it renders the error page in browser since the content type is text/html but returns json when apt content type is passed in the 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.
Yes, this is now appropriately scoped and looks to still respond with JSON.
It is now assuming that the response code is 404 (not found) but then returning a status of 400 (bad request). What happens if a different type of error occurs? If is a 404 shouldn't we respond as such?
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.
updated the status code here, but error type here I think should always be not found as this is being utilized only for not found pages.
| super.setStatus(HttpServletResponse.SC_OK); | ||
| } | ||
| } | ||
| else if (CONTENT_TYPE_HTML.equals(getRequest().getHeader("Content-Type)")) || |
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 now appropriately scoped and looks to still respond with JSON.
It is now assuming that the response code is 404 (not found) but then returning a status of 400 (bad request). What happens if a different type of error occurs? If is a 404 shouldn't we respond as such?
labkey-nicka
left a comment
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.
Looks good to me. Only a couple nit items. I'll let @cnathe approve the PR once he's reviewed again.
| LABKEY.requiresScript('core/gen/errorHandler.js', function() { | ||
| // LABKEY.requiresScript('http://localhost:3001/errorHandler.js', function() { | ||
| LABKEY.App.__app__.isDOMContentLoaded = true; |
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.
@labkey-ankurj Can you open a ticket to me about this. It's fine to leave this "as-is" in this PR but the app loader should correctly identify when the DOM is loaded so you don't have to touch it's "private" state.
| message: "<%=unsafe(model.getHeading())%>", | ||
| errorType: "<%=unsafe(model.getErrorType())%>" | ||
| // pulling in theme based css for the not found pages to still respect the site's theme | ||
| LABKEY.requiresCss(<%=q("/core/css/" + PageFlowUtil.resolveThemeName(getContainer()) + ".css")%>); |
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.
nit: I might further update this comment to state why the CSS is being pulled in here rather than in the client dependencies for the JSP. Something like:
This error page may be invoked without the themes having been loaded for this container. We load the theme artifact for this container here to ensure the correct theme is loaded as this cannot be resolved during "addClientDependencies()" for this view.
| catch (Exception e) | ||
| { | ||
| // config exceptions that occur before jsps have been initialized | ||
| if (ex instanceof ConfigurationException && e instanceof NullPointerException) |
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.
Can we do a more direct check if JSPs are ready to render? What's null that's causing this exception?
Rationale
This is the continued work of error page redesign.
Related Pull Requests
Changes