-
Notifications
You must be signed in to change notification settings - Fork 132
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
KOGITO-1299: added fallback UI when server unavailable #131
Conversation
7e7d017
to
8457ccc
Compare
Hey @srambach @kywalker-rh, Have developed pages to display 2 different things in management console,
It is just developed temporarily for now, awaiting for your comments to modify and to make it more relevant. Please have a look when you get time. |
@Sara4994 nice job! I went over them with @kywalker-rh. #2, the graphql error - we were thinking of the following changes: @cristianonicolai wdyt? |
@srambach +1 |
dbae9c6
to
60fccf0
Compare
@srambach corrections are made.. |
color="var(--pf-global--danger-color--100)" /> | ||
<Title headingLevel="h1" size="4xl">Error fetching data</Title> | ||
<EmptyStateBody> | ||
Below error occured on graphql while accessing 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.
Please change this text to An error occurred while accessing 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.
@srambach done
@@ -526,7 +526,7 @@ const DataListItemComponent: React.FC<IOwnProps> = ({ | |||
<DataListItemCells | |||
dataListCells={[ | |||
<DataListCell key={1}> | |||
<Link to={'/ProcessInstances/' + processInstanceData.id}> | |||
<Link to={{pathname:'/ProcessInstances/Process/' + processInstanceData.id, state:{ prev: location.pathname}}}> |
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.
@Sara4994 would it be something like:
<Link to={{pathname:'/ProcessInstances/Process/' + processInstanceData.id, state:{ prev: location.pathname}}}> | |
<Link to={{pathname:'/Process/' + processInstanceData.id, state:{ prev: location.pathname}}}> |
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.
that would also mean that we need to add a line here https://github.com/kiegroup/kogito-apps/blob/master/management-console/src/main/java/org/kie/kogito/mgmt/VertxRouter.java#L43
to handle the new path in the UI.
As well as updating this test https://github.com/kiegroup/kogito-apps/blob/master/management-console/src/test/java/org/kie/kogito/mgmt/VertxRouterTest.java#L17
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.
@cristianonicolai done
@Sara4994 (+1 to add the new path at VertxRouter) and it seems some .snap files have to be also updated with the new path. |
08b4d0c
to
a264bb7
Compare
d6e0a5d
to
85a76a5
Compare
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.
The PR can fix issue KOGITO-1659.
@@ -18,8 +18,6 @@ const NoDataComponent = (props) => { | |||
let prevPath; | |||
if (props.location.state !== undefined) { | |||
prevPath = props.location.state.prev; | |||
} else { | |||
prevPath = '/ProcessInstances' |
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.
@Sara4994 shouldn't this stay for when users hit url directly without a previous state?
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.
@cristianonicolai yep removed by mistake, added it back. thanks
@@ -41,6 +41,7 @@ public void init() { | |||
void setupRouter(@Observes Router router) { | |||
router.route("/").handler(ctx -> ctx.response().putHeader("location", "/ProcessInstances/").setStatusCode(302).end()); | |||
router.route("/ProcessInstances*").handler(ctx -> handle(ctx)); | |||
router.route("/Process*").handler(ctx -> handle(ctx)); |
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.
@Sara4994 The new route "/Process*" includes "/ProcessInstances*. Here I think we have to remove the line: router.route("/ProcessInstances*").handler(ctx -> handle(ctx)); and let just the new route.
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.
@nmirasch but actually these two are different routes that directs us to two different pages, '/ProcessInstances' will take us to process list page and '/Process' will take us to process details page. should we still remove the line: router.route("/ProcessInstances*").handler(ctx -> handle(ctx));?
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.
@Sara4994 point is that /Process* will also match the same urls, because of the pattern matching, so the line with /ProcessInstances* should be removed or you can simply update that one.
@@ -1,15 +1,36 @@ | |||
import '@patternfly/patternfly/patternfly.css'; | |||
import React from 'react'; | |||
import ReactDOM from 'react-dom'; | |||
import ApolloClient from 'apollo-boost'; | |||
import { ApolloClient } from 'apollo-client'; | |||
// import ApolloClient from 'apollo-boost'; |
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.
@Sara4994 maybe remove the 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.
@nmirasch this is done :)
An error occured while accessing data. <strong className="kogito-management-console--Server-Errors__text-color" onClick={() => setDisplayError(!displayError)}> See more details</strong> | ||
</EmptyStateBody> | ||
{displayError &&<EmptyStateBody> | ||
<ClipboardCopy isCode variant={ClipboardCopyVariant.expansion} isExpanded={true}>{JSON.stringify(props.message)}</ClipboardCopy> |
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 can left align the text and make it more readable by adding className="pf-u-text-align-left"
to the ClipboardCopy.
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.
@srambach done:)
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.
Sorry, one more thing - I missed that "occurred" is still spelled incorrectly. 2 r
s.
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.
@srambach done )
f23e3fe
to
a97d9cd
Compare
color="var(--pf-global--danger-color--100)" /> | ||
<Title headingLevel="h1" size="4xl">Error fetching data</Title> | ||
<EmptyStateBody> | ||
An error occurred while accessing data. <strong className="kogito-management-console--Server-Errors__text-color" onClick={() => setDisplayError(!displayError)}> See more details</strong> |
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.
The "See more details" needs to be coded as a link or button. Otherwise, it is not accessible using the keyboard. <Button variant="link" isInline onClick={() => setDisplayError(!displayError)}>See more details</Button>
should work for you I think. We don't need the <strong>
tag and don't need to set the text color or cursor with a new class since that will come from the link. So that CSS can also be removed.
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.
@srambach done. Thanks 👍
@@ -122,7 +124,8 @@ const DomainExplorerColumnPicker: React.FC<IOwnProps> = ({ | |||
} | |||
}); | |||
} catch (error) { | |||
return error; | |||
setError(error) | |||
// return error; |
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.
@Sara4994 remove comment out code please
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.
@cristianonicolai done
</PageSection> | ||
</>):(<ServerErrorsComponent message={error.message} />)} | ||
</>); | ||
{/* {!error ? |
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.
please remove comment out code
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.
@cristianonicolai done
bd035c2
to
d47c00c
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
please enter the commit message for your changes. Lines starting