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

Removes the magic in Input, reducing it to a styled TextField #150

Merged
merged 2 commits into from
Nov 10, 2018

Conversation

rileyjbauer
Copy link
Contributor

@rileyjbauer rileyjbauer commented Nov 8, 2018

Input previously took its parent's instance as a prop in order to automatically update the field in its parent's state using just the field name, however, this caused an additional copy of the instance to be made for each Input element in the parent.


This change is Reviewable

frontend/src/atoms/Input.test.tsx Outdated Show resolved Hide resolved
frontend/src/components/UploadPipelineDialog.tsx Outdated Show resolved Hide resolved

{experimentName && (
<div>
<div>This run will be associated with the following experiment</div>
<Input label='Experiment' instance={this} disabled={true} field='experimentName' />
<Input label='Experiment' onChange={this.handleChange('experimentName')}
disabled={true} value={experimentName} />
</div>
)}

Copy link
Contributor

Choose a reason for hiding this comment

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

Down below on line 177, we're using a plain TextField, and I think the reason is because we wanted a custom onChange handler, so it makes sense to make that an Input now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll make this change in the branch where I'm working on NewRun tests

const { height, width, ...rest } = props;
return (
<TextField variant='outlined' className={commonCss.textField} spellCheck={false}
style={{ height: height || 40, maxWidth: 600, width: width || '100%' }} {...rest}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to set height: 'auto' automatically if the prop multiline === true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I believe so.

@google-prow-robot
Copy link
Collaborator

@rileyjbauer: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
mlpipeline-build-image 69e36a9 link /test mlpipeline-build-image
mlpipeline-presubmit-unit-test 69e36a9 link /test mlpipeline-presubmit-unit-test

Full PR test history. Your PR dashboard.

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.

@rileyjbauer
Copy link
Contributor Author

/retest

Copy link
Contributor

@yebrahim yebrahim left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yebrahim

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

1 similar comment
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yebrahim

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

@yebrahim
Copy link
Contributor

I saw all tests finish successfully on this. For a few minutes, I could see Github's three green buttons here and could merge manually, then saw this test failure. @IronPan any ideas what's happening here?

@rileyjbauer
Copy link
Contributor Author

/retest

1 similar comment
@Ark-kun
Copy link
Contributor

Ark-kun commented Nov 10, 2018

/retest

@k8s-ci-robot k8s-ci-robot merged commit 5d9f85c into master Nov 10, 2018
IronPan added a commit that referenced this pull request Nov 11, 2018
@rileyjbauer rileyjbauer deleted the simplify-inputs branch November 12, 2018 17:50
magdalenakuhn17 pushed a commit to magdalenakuhn17/pipelines that referenced this pull request Oct 22, 2023
* Fix test error by golint

* Enable travis to make test

* Keep mini change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants