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

Add new PlotType to Allow for Visualization Creation #1677

Conversation

ajchili
Copy link
Member

@ajchili ajchili commented Jul 25, 2019

  • Adds new PlotType (VISUALIZATION_CREATOR)
  • Adds new Viewer component (VisualizationCreator.tsx)
  • Adds unit tests for new Viewer component
    • Includes snapshots

This change is Reviewable

}

public render(): JSX.Element | null {
const { arguments: _arguments, inputPath, selectedType } = 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.

why the _?

Copy link
Member Author

@ajchili ajchili Jul 25, 2019

Choose a reason for hiding this comment

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

Invalid use of 'arguments'. Class definitions are automatically in strict mode.ts(1210) was provided as an error when arguments was used as the variable name.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, wondered if it might be something like that

}

class VisualizationCreator extends Viewer<VisualizationCreatorProps, VisualizationCreatorState> {
private _config = this.props.configs[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this only the first element? does the prop need to be an array?

Copy link
Member Author

Choose a reason for hiding this comment

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

It follows the notation of all the other Viewer components. Should this be changed?

Copy link
Member Author

@ajchili ajchili Jul 25, 2019

Choose a reason for hiding this comment

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

/hold
After continued testing, it appears that creating _config in this manner results in isBusy not updatable. This is because _config is set on component creation rather than when props are set/updated.

Copy link
Member Author

Choose a reason for hiding this comment

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

This issue, from the comment above, can be solved in the following manner:

const { configs } = this.props;
const config = configs[0];
const { arguments: _arguments, inputPath, selectedType } = this.state;

if (!config) {
  return null;
}

const { isBusy = false, onGenerate } = config;

However, it does not resolve the original issue of passing an array of configs as a prop to the component as mentioned by @rileyjbauer.

}}
>
{/*
Due to the swagger API definition generation, getting the keys within
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice comment 👍

Copy link
Contributor

@rileyjbauer rileyjbauer left a comment

Choose a reason for hiding this comment

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

/lgtm

}

public render(): JSX.Element | null {
const { arguments: _arguments, inputPath, selectedType } = 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.

ah, wondered if it might be something like that

@k8s-ci-robot k8s-ci-robot removed the lgtm label Jul 25, 2019
@ajchili
Copy link
Member Author

ajchili commented Jul 25, 2019

/hold cancel
Canceling hold due to previous lgtm.

@rileyjbauer
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rileyjbauer

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 f3de0c4 into kubeflow:master Jul 26, 2019
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.

3 participants