-
Notifications
You must be signed in to change notification settings - Fork 52
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
Detect if dashboard has been accessed due to workspace idle redirect + workspace idle error #556
Conversation
Skipping CI for Draft Pull Request. |
60e6ef4
to
27d0aa5
Compare
Codecov Report
@@ Coverage Diff @@
## main #556 +/- ##
==========================================
- Coverage 56.22% 56.12% -0.10%
==========================================
Files 217 217
Lines 7374 7410 +36
Branches 1264 1270 +6
==========================================
+ Hits 4146 4159 +13
- Misses 3049 3071 +22
- Partials 179 180 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-556 |
This feature would need to be throughly tested. While trying to record the demo video, I ran into a situation where the 'workspace stopped' error page appears when it shouldn't. The bug can be seen at about 0:33s of this video: workspace-idled-bugged.movThere is a |
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-556 |
packages/dashboard-frontend/src/Layout/ErrorReporter/Issue/index.tsx
Outdated
Show resolved
Hide resolved
With the latest commit, the links in the error page have been implemented The first link directs the user to First link demo: Second link demo: |
27d0aa5
to
e8973de
Compare
e8973de
to
d685db2
Compare
type: IssueType; | ||
error: Error; | ||
data?: T; |
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.
Hello @olexii4 @akurinnoy , how does adding data
here this look? I added this to pass extra links for when rendering the error page:
che-dashboard/packages/dashboard-frontend/src/Layout/ErrorReporter/Issue/index.tsx
Lines 35 to 39 in d685db2
case 'workspaceStopped': | |
return this.renderWorkspaceStoppedError( | |
issue.error, | |
(issue as Issue<WorkspaceRoutes>).data, | |
); |
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 don't think that we are going to extend this part very often
As for me, I prefer to use just WorkspaceRoutes
until we will need something else. I don't think we will extend this part in the near future.
@akurinnoy WDYT?
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 for me, I prefer to use just WorkspaceRoutes until we will need something else.
Do you mean add a private field for WorkspaceRoutes
inside of IssuesReporterService
?
che-dashboard/packages/dashboard-frontend/src/services/bootstrap/issuesReporter.ts
Line 25 in 4a4d43c
export class IssuesReporterService { |
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.
Thank you for the suggestion, in my latest push, I've changed:
data?: T;
to
data?: WorkspaceRoutes
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-556 |
1 similar comment
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-556 |
d685db2
to
84b1724
Compare
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-556 |
84b1724
to
80734ce
Compare
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-556 |
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.
Well done!
Tested. It works as expected.
06cc24e
to
249074a
Compare
249074a
to
8c5d418
Compare
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-556 |
/retest |
here | ||
</a> | ||
to restart your workspace. | ||
</p> | ||
<p | ||
className="" | ||
data-pf-content={true} | ||
> | ||
Click | ||
<a | ||
onClick={[Function]} | ||
> | ||
here |
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.
here
is UX antipattern [1] that we should try to avoid, so let's probably have just restart
and return
links
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.
packages/dashboard-frontend/src/Layout/ErrorReporter/Issue/index.tsx
Outdated
Show resolved
Hide resolved
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.
Great improvement 👍
@dkwon17 just please remove here
links before merging
Signed-off-by: David Kwon <dakwon@redhat.com>
8c5d418
to
fe00e0f
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: akurinnoy, dkwon17, ibuziuk, olexii4 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-556 |
Signed-off-by: David Kwon dakwon@redhat.com
What does this PR do?
eclipse-che/che-operator#1392 reroutes a workspace's
mainUrl
(ex.https://<che-host>/workspacee3dab47b6f6441c6/theia-ide/3100/#/
)to the dashboard.
This PR reads and stores the
window.location.pathname
from the dashboard frontend preload script to determine whether the dashboard is being accessed via workspace idle redirection. Thewindow.location.pathname
is stored in the browser's sessionStorage.To check whether the workspace idle error page is displayed, the PR checks the sessionStorage for the initial
window.location.pathname
and checks if there is a devworkspace with the same mainUrl in the redux store. If yes, the error page is displayed.Error page provided by this PR:
Here is a demo:
demo.mov
What issues does this PR fix or reference?
Part of eclipse-che/che#20599
Is it tested? How?
For testing, please see #556 (comment)
Release Notes
Docs PR