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

Adds a toggle between one-off and recurring runs to NewRun page #1274

Merged

Conversation

rileyjbauer
Copy link
Contributor

@rileyjbauer rileyjbauer commented May 2, 2019

Changes are mainly around lines 272 and 445 of NewRun.tsx.

Other changes, are primarily cleanup and tests.

Fixes #1217

Examples of the toggle:
One-off:
image

Recurring:
image


This change is Reviewable

@@ -33,6 +33,10 @@ class TestNewRun extends NewRun {
public async _pipelineSelectorClosed(confirmed: boolean): Promise<void> {
return await super._pipelineSelectorClosed(confirmed);
}

public _updateRecurringRunState(isRecurringRun: boolean): void {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if you can just do something like "public x = super.x;" rather than a function wrapper.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep! Good call

{pipeline && Array.isArray(pipeline.parameters) && !!pipeline.parameters.length && (
<div>
{pipeline.parameters.map((param, i) =>
<TextField id={`newRunPipelineParam${i}`} key={i} variant='outlined'
label={param.name} value={param.value || ''}
onChange={(ev) => this._handleParamChange(i, ev.target.value || '')}
style={{ height: 40, maxWidth: 600 }} className={commonCss.textField} />)}
style={{ maxWidth: 600 }} className={commonCss.textField}/>)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove height? What happens when you have long parameter names?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Height here is a bit of a misnomer here. I've actually go a follow-up that uses InputProps to change what you'd expect height to change. This change is essentially a noop in this case. Extremely long parameter names go off the end of the text box, but I don't think this is something we'll have to worry about

@@ -416,6 +442,14 @@ class NewRun extends Page<{}, NewRunState> {
}, () => this._validate());
}

protected _updateRecurringRunState(isRecurringRun: boolean): void {
this.props.updateToolbar({
actions: this.props.toolbarProps.actions,
Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC this line is optional?

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, this isn't needed

@@ -535,10 +569,9 @@ class NewRun extends Page<{}, NewRunState> {
}

private _start(): void {
const { pipelineFromRun, pipeline, usePipelineFromRun } = this.state;
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Consistency mostly. We were pulling a few variables out of state like this, and not doing so for others within this same function, and it didn't seem like we were getting much for doing so

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

@k8s-ci-robot k8s-ci-robot merged commit 25cb766 into kubeflow:master May 4, 2019
hamedhsn pushed a commit to hamedhsn/pipelines that referenced this pull request May 5, 2019
…flow#1274)

* Allows toggling between one-off and recurring runs in the new run page

* Clean up and adds tests

* Fix integration test - account for extra field in form

* Cleanup and PR comments
@rileyjbauer rileyjbauer deleted the add-recurring-run-option-to-new-run branch May 6, 2019 22:11
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.

Can only create recurring run from within experiment page
4 participants