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 1797702: remove search button and search status/result for deploy image #4187

Merged
merged 1 commit into from Feb 20, 2020

Conversation

sahil143
Copy link
Contributor

@sahil143 sahil143 commented Feb 4, 2020

ODC-bug: https://issues.redhat.com/browse/ODC-2337

This PR makes the changes suggested by UX on the Deploy image page.

default state
Screenshot from 2020-02-04 22-37-43

error state
Screenshot from 2020-02-04 22-28-26

success
Screenshot from 2020-02-04 23-00-43

@openshift-ci-robot
Copy link
Contributor

@sahil143: This pull request references Bugzilla bug 1797702, 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 1797702: remove search button and search status/result for deploy image

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 bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Feb 4, 2020
@sahil143
Copy link
Contributor Author

sahil143 commented Feb 4, 2020

cc: @serenamarie125 @openshift/team-devconsole-ux

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 4, 2020
@openshift-ci-robot
Copy link
Contributor

@sahil143: This pull request references Bugzilla bug 1797702, which is valid.

In response to this:

Bug 1797702: remove search button and search status/result for deploy image

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.

@serenamarie125
Copy link
Contributor

@sahil143 can we utilize the PF4 component shown here ? https://www.patternfly.org/v4/documentation/react/components/form#invalid

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.

If possible, I think that the icon should be in the text field itself. Although that should NOT hold up this PR from a UX perspective, because getting these usability improvements merged is high priority from my perspective!

@andrewballantyne
Copy link
Contributor

It would appear there is a style break in the patternfly variable. The font-size-md variable is printing out $font-size-base instead of the value 14px (or 1rem) that is stored in that variable.

I overrode the variable locally, and got it to work:

DeployImageFontSizeFix

Not the solution I would think... but gives a place to start investigating.


Also I want to note the empty-state error is pretty bad. I am not sure if we even want to show an empty-state error? @openshift/team-devconsole-ux thoughts?

Screen Shot 2020-02-04 at 2 36 10 PM

@andrewballantyne
Copy link
Contributor

If possible, I think that the icon should be in the text field itself. Although that should NOT hold up this PR from a UX perspective, because getting these usability improvements merged is high priority from my perspective!

@serenamarie125 how do you feel about the experience in the git flow?

Success
image

Error
image

@andrewballantyne
Copy link
Contributor

/kind bug

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Feb 4, 2020
@openshift-ci-robot
Copy link
Contributor

@sahil143: This pull request references Bugzilla bug 1797702, which is valid.

In response to this:

Bug 1797702: remove search button and search status/result for deploy image

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.

@sahil143
Copy link
Contributor Author

sahil143 commented Feb 7, 2020

@andrewballantyne I have updated the error for empty input field.
Screenshot from 2020-02-07 14-59-02

@andrewballantyne
Copy link
Contributor

Thanks @sahil143 I think that's consistent with the git flow. They probably should be in sync for their error / validating / success states.

@christianvogt
Copy link
Contributor

Fyi there's a pr by @jeff-phillips-18 that willl clash here.

@serenamarie125
Copy link
Contributor

thanks for updating!

Copy link
Contributor

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

There are a slew of visual issues I find with the validation text (see below). We shouldn't be showing internal variable ids in error messages.

Once you get an error - as you start typing (or select a browser autocomplete value) you get this error:
Screen Shot 2020-02-12 at 1 27 10 PM

I think our errors should always start with a capital letter:
Screen Shot 2020-02-12 at 1 28 58 PM

If you start with an invalid character, like a /, you see the field id:
Screen Shot 2020-02-12 at 1 29 27 PM

If you use capitals, you also get to see the field id:
Screen Shot 2020-02-12 at 1 30 09 PM

Comment on lines 3 to 7
export enum VALIDATED {
default = 'default',
success = 'success',
error = 'error',
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we go with enum variables being PascalCase and enum types being ALL_CAPS?

Not sure we actually have a standard here, but I think that aligns with other enums I am seeing in the console.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Imported ValidatedOptions from Patternfly

Copy link
Contributor

Choose a reason for hiding this comment

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

That works too... note the PascalCase 😉

Comment on lines 93 to 116
return (
<span style={{ fontWeight: 'bold' }}>
<LoadingInline />
</span>
);
}
if (!values.isSearchingForImage && validated === VALIDATED.success) {
return (
<span style={{ fontWeight: 'bold', color: 'var(--pf-global--success-color--200)' }}>
<CheckCircleIcon /> Validated
</span>
);
}

return '';
};

const getHelpTextInvalid =
validated === VALIDATED.error ? (
<span style={{ color: 'var(--pf-global--danger-color--200)' }}>
<ExclamationCircleIcon />
&nbsp;
{values.searchTerm === '' ? 'Required' : values.isi.status}
</span>
Copy link
Contributor

Choose a reason for hiding this comment

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

Definitely should be putting this stuff into sass. Please create a styles file and move this content into there. Inline styles are only useful when we have dynamic values, not for static values.

Copy link
Contributor

Choose a reason for hiding this comment

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

Heh, I highlighted this whole area because there were multiple inline styles haha

return '';
};

const getHelpTextInvalid =
Copy link
Contributor

Choose a reason for hiding this comment

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

Variables which start with get should not be immediately evaluated... get is typically used for a lazy-retrieval, and not for sometime that is immediately available. Suggest renaming to invalidHelpText or something similar.

{values.searchTerm === '' ? 'Required' : values.isi.status}
</span>
) : (
''
Copy link
Contributor

Choose a reason for hiding this comment

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

You should almost never have to equate something down to an empty string. Controlled input values is the only thing I can think of... but you're creating a DOM element, which a falsy value should do fine.

Ie:

  const invalidHelpText = validated === VALIDATED.error && (
    <span className="odc-...">
      <ExclamationCircleIcon />
      {' '}
      {values.searchTerm === '' ? 'Required' : values.isi.status}
    </span>
  );

@andrewballantyne
Copy link
Contributor

andrewballantyne commented Feb 12, 2020

Fyi there's a pr by @jeff-phillips-18 that willl clash here.

@christianvogt do you mean PR #4268? Because this is Deploy Image, and that is Import Git.

Ah, I guess you mean in the Formik elements, not the ImageSearch stuff...

@sahil143
Copy link
Contributor Author

There are a slew of visual issues I find with the validation text (see below). We shouldn't be showing internal variable ids in error messages.

@andrewballantyne We show the same errors in current implementation as well.
Screenshot from 2020-02-13 14-52-20

And In the UX doc, It specifically says Note: We will show a detailed error message specifying why we couldn’t load the image.
https://docs.google.com/document/d/1cUF_DXuNkMLeIPNsG1pEHA8t-5iq_JVkRJvZkGPVSKU/edit#

name="searchTerm"
label="Image Name"
onSearch={handleSearch}
placeholder="Enter an image name"
Copy link
Member

Choose a reason for hiding this comment

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

@sahil143 seems the removal of data-test-id="deploy-image-search-term" willl impact integration tests

Screenshot 2020-02-13 at 5 09 02 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@invincibleJai added data-test-id

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch @invincibleJai - we need to be careful not to remove data-test-ids.

@andrewballantyne
Copy link
Contributor

andrewballantyne commented Feb 13, 2020

There are a slew of visual issues I find with the validation text (see below). We shouldn't be showing internal variable ids in error messages.

@andrewballantyne We show the same errors in current implementation as well.
Screenshot from 2020-02-13 14-52-20

And In the UX doc, It specifically says Note: We will show a detailed error message specifying why we couldn’t load the image.
https://docs.google.com/document/d/1cUF_DXuNkMLeIPNsG1pEHA8t-5iq_JVkRJvZkGPVSKU/edit#

A detailed error message is not a detailed debug error message. Exposing our internal names of the field helps no one but the developers debugging (and we have better tools than an error message). This is not the same thing as say explaining a lack of permissions to access an image vs "no can do, stuff happened".

We should clean up our past mistakes and hide the specifics of our field names.

Apparently this is a server error... that sucks. Wish those could be cleaner.

@openshift-ci-robot
Copy link
Contributor

@spadgett: This pull request references Bugzilla bug 1797702, which is invalid:

  • expected the bug to target the "4.5.0" release, but it targets "4.4.0" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/bugzilla refresh

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 needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 20, 2020
@christianvogt
Copy link
Contributor

I agree that the internal registry error handling shouldn't failed because of user input. So it's an exceptional case. Looking closer at the code, while error dialogs is the general solution to exceptional error handling, for these forms it may make more sense to keep the error closer to the input fields.

For the sake of completing this PR, could we just wrap the internal registry form in a FormGroup and do the same inline error? This may be the least effort fix here.

add validated text

show field required when searchTerm is empty

create scss file  for image search component,  use patternfly validatedOption enum

add data-test-id to ImageSearch component

add classes for success help text

s

remove styles

removed funtional test because Input search button is removed and no longer used

remove $

fix functional tests

show inline error for ImageStream

add error

refactor

reorder Imports
@sahil143
Copy link
Contributor Author

For the sake of completing this PR, could we just wrap the internal registry form in a FormGroup and do the same inline error? This may be the least effort fix here.

This sounds good, made the changes accordingly. If there is any we would show it inline. (Mock error in the screenshot, Not actual one)
Screenshot from 2020-02-20 23-57-51

Also, did some refactor to keep it consistent after the rebase because PR #4376 made some changes to InputField.

External Registery:
Success
Screenshot from 2020-02-21 00-35-30

Error:
Screenshot from 2020-02-21 00-34-50
Screenshot from 2020-02-21 00-38-09

@sahil143
Copy link
Contributor Author

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Feb 20, 2020
@openshift-ci-robot
Copy link
Contributor

@sahil143: This pull request references Bugzilla bug 1797702, which is valid.

In response to this:

/bugzilla refresh

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 removed bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Feb 20, 2020
@christianvogt
Copy link
Contributor

The design doc had two criteria, but isn't clear what the final outcome was.

  • validate when the user leaves the field
  • validate while the user types after some time lapse has passed from last key stroke
    • this part isn't done but I'd rather see it added in another PR. Please log another issue for this.

@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 20, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@andrewballantyne
Copy link
Contributor

andrewballantyne commented Feb 20, 2020

The design doc had two criteria, but isn't clear what the final outcome was.
...

  • validate while the user types after some time lapse has passed from last key stroke
    • this part isn't done but I'd rather see it added in another PR. Please log another issue for this.

@christianvogt I think we need to update Git and Deploy Image as the user types at the same time too. Perhaps we just enhance https://issues.redhat.com/browse/ODC-2451

@andrewballantyne
Copy link
Contributor

andrewballantyne commented Feb 20, 2020

/retest

EDIT: Looks like a connection error on the CI server

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@christianvogt
Copy link
Contributor

/cherrypick release-4.4

@openshift-cherrypick-robot

@christianvogt: once the present PR merges, I will cherry-pick it on top of release-4.4 in a new PR and assign it to you.

In response to this:

/cherrypick release-4.4

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-cherrypick-robot

@christianvogt: new pull request created: #4403

In response to this:

/cherrypick release-4.4

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

@sahil143: All pull requests linked via external trackers have merged. Bugzilla bug 1797702 has been moved to the MODIFIED state.

In response to this:

Bug 1797702: remove search button and search status/result for deploy image

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.

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/dev-console Related to dev-console component/shared Related to console-shared kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet