Skip to content
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

Bug 1801419: Show an error dialog when creation of a connection fails #4274

Merged

Conversation

jeff-phillips-18
Copy link
Member

@jeff-phillips-18 jeff-phillips-18 commented Feb 10, 2020

Fixes:
https://issues.redhat.com/browse/ODC-2962

Analysis / Root cause:
On a failure to create the connection, the results were ignored

Solution Description:
Catch the rejection for the creation of the connection and display an error dialog containing the returned error message. Added checks to safe guard against attempting to create a connection from a node to itself.

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

/kind bug

@openshift-ci-robot openshift-ci-robot added kind/bug Categorizes issue or PR as related to a bug. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Feb 10, 2020
@openshift-ci-robot
Copy link
Contributor

@jeff-phillips-18: This pull request references Bugzilla bug 1801419, which is valid.

In response to this:

Bug 1801419: Show an error dialog when creation of a connection fails

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 10, 2020
@openshift-ci-robot
Copy link
Contributor

@jeff-phillips-18: This pull request references Bugzilla bug 1801419, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Bug 1801419: Show an error dialog when creation of a connection fails

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added component/core Related to console core functionality component/dev-console Related to dev-console labels Feb 10, 2020
@christianvogt
Copy link
Contributor

Tested using SBR and turn off the network in chrome:
image

return null;
};

const removeConnectorCallback = (edge: Edge): void => {
removeConnection(edge);
removeConnection(edge).catch((error) => {
errorModal({ title: 'Error removing connection', error: error.message });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why no icon here but there's an icon in the other error?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oversight, I will update

Comment on lines 8 to 18
export const ModalErrorContent = ({
error,
title = 'Error',
cancel = undefined,
showIcon = false,
}) => (
<div className="modal-content">
<ModalTitle>{title}</ModalTitle>
<ModalTitle className={classNames('modal-header', { 'co-error-modal__icon-header': showIcon })}>
{showIcon && <RedExclamationCircleIcon className="co-error-modal__icon" />}
{title}
</ModalTitle>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should include the error icon always?
Thoughts @benjaminapetersen @spadgett ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed the changes to add the error icon. That can be determined at a later date.

Copy link
Member

@rhamilto rhamilto Feb 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should include the error icon always?
Thoughts @benjaminapetersen @spadgett ?

I say, "yes." Especially in light of #4259 (comment)

I should add, note the icon is on the modal text and not the heading.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm inclined to agree, an error that is important enough to be visible to a user prob should have the icon and be treated consistently.

Copy link
Contributor

@serenamarie125 serenamarie125 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the button in the modal
(1) be a default button and blue
(2) have focus?
(3) i'm unsure what the convention is regarding the button label - if it should be OK or Close. As long as you're using a common utility, I guess we should be consistent!

@christianvogt
Copy link
Contributor

@serenamarie125 this is the standard error modal that console uses. Only change is that @jeff-phillips-18 added the error icon.

@openshift-ci-robot openshift-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 14, 2020
@openshift-ci-robot
Copy link
Contributor

@jeff-phillips-18: This pull request references Bugzilla bug 1801419, which is valid.

In response to this:

Bug 1801419: Show an error dialog when creation of a connection fails

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@christianvogt
Copy link
Contributor

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 14, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christianvogt, jeff-phillips-18

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 14, 2020
@openshift-merge-robot openshift-merge-robot merged commit f776af2 into openshift:master Feb 14, 2020
@openshift-ci-robot
Copy link
Contributor

@jeff-phillips-18: All pull requests linked via external trackers have merged. Bugzilla bug 1801419 has been moved to the MODIFIED state.

In response to this:

Bug 1801419: Show an error dialog when creation of a connection fails

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot
Copy link
Contributor

@jeff-phillips-18: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-gcp-console f317eaa link /test e2e-gcp-console

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@spadgett spadgett added this to the v4.4 milestone Feb 17, 2020
@jeff-phillips-18 jeff-phillips-18 deleted the error-message branch December 2, 2020 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/core Related to console core functionality component/dev-console Related to dev-console kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants