index
int64 0
0
| repo_id
stringlengths 21
232
| file_path
stringlengths 34
259
| content
stringlengths 1
14.1M
| __index_level_0__
int64 0
10k
|
---|---|---|---|---|
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/atoms/HelpButton.tsx | import Card from '@material-ui/core/Card';
import CardContent from '@material-ui/core/CardContent';
import IconButton from '@material-ui/core/IconButton';
import { withStyles } from '@material-ui/core/styles';
import Tooltip from '@material-ui/core/Tooltip';
import HelpIcon from '@material-ui/icons/Help';
import React, { ReactNode } from 'react';
import { color, fontsize } from '../Css';
const NostyleTooltip = withStyles({
tooltip: {
backgroundColor: 'transparent',
border: '0 none',
color: color.secondaryText,
fontSize: fontsize.base,
maxWidth: 220,
},
})(Tooltip);
interface HelpButtonProps {
helpText?: ReactNode;
}
export const HelpButton: React.FC<HelpButtonProps> = ({ helpText }) => {
return (
<NostyleTooltip
title={
<Card>
<CardContent>{helpText}</CardContent>
</Card>
}
interactive={true}
leaveDelay={400}
placement='top'
>
<IconButton>
<HelpIcon />
</IconButton>
</NostyleTooltip>
);
};
| 7,900 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/atoms/MD2Tabs.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import Button from '@material-ui/core/Button';
import Separator from './Separator';
import { color, fontsize } from '../Css';
import { classes, stylesheet } from 'typestyle';
import { logger } from '../lib/Utils';
interface MD2TabsProps {
onSwitch?: (tab: number) => void;
selectedTab: number;
tabs: string[];
}
const css = stylesheet({
active: {
color: `${color.theme} !important`,
fontWeight: 'bold',
},
button: {
$nest: {
'&:hover': {
backgroundColor: 'initial',
},
},
borderRadius: '4px 4px 0 0',
color: color.inactive,
fontSize: fontsize.base,
height: 33,
minHeight: 0,
padding: '0 15px',
textTransform: 'none',
},
indicator: {
backgroundColor: 'initial',
borderBottom: '3px solid ' + color.theme,
borderLeft: '3px solid transparent',
borderRight: '3px solid transparent',
bottom: 0,
left: 35,
position: 'absolute',
transition: 'width 0.3s, left 0.3s',
width: 50,
},
tabs: {
borderBottom: '1px solid ' + color.separator,
height: 33,
position: 'relative',
whiteSpace: 'nowrap',
},
});
class MD2Tabs extends React.Component<MD2TabsProps, any> {
private _rootRef = React.createRef<any>();
private _indicatorRef = React.createRef<any>();
private _tabRefs = this.props.tabs.map(t => React.createRef<HTMLSpanElement>());
private _timeoutHandle = 0;
public render(): JSX.Element {
const selected = this._getSelectedIndex();
const switchHandler = this.props.onSwitch || (() => null);
return (
<div className={css.tabs} ref={this._rootRef}>
<div className={css.indicator} ref={this._indicatorRef} />
<Separator units={20} />
{this.props.tabs.map((tab, i) => (
<Button
className={classes(css.button, i === selected ? css.active : '')}
key={i}
onClick={() => {
if (i !== selected) {
switchHandler(i);
}
}}
>
<span ref={this._tabRefs[i]}>{tab}</span>
</Button>
))}
</div>
);
}
public componentDidMount(): void {
this._timeoutHandle = setTimeout(this._updateIndicator.bind(this));
}
public componentDidUpdate(): void {
this._timeoutHandle = setTimeout(this._updateIndicator.bind(this));
}
public componentWillUnmount(): void {
clearTimeout(this._timeoutHandle);
}
private _getSelectedIndex(): number {
let selected = this.props.selectedTab;
if (this.props.tabs[selected] === undefined) {
logger.error('Out of bound index passed for selected tab');
selected = 0;
}
return selected;
}
private _updateIndicator(): void {
const selected = this._getSelectedIndex();
const activeLabelElement = this._tabRefs[selected].current as HTMLSpanElement;
if (!activeLabelElement) {
return;
}
const leftOffset =
activeLabelElement.getBoundingClientRect().left -
this._rootRef.current.getBoundingClientRect().left;
const tabIndicator = this._indicatorRef.current;
tabIndicator.style.left = leftOffset - 5 + 'px';
tabIndicator.style.width = activeLabelElement.getBoundingClientRect().width + 5 + 'px';
tabIndicator.style.display = 'block';
}
}
export default MD2Tabs;
| 7,901 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/atoms/Hr.test.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import Hr from './Hr';
import { create } from 'react-test-renderer';
describe('Hr', () => {
it('renders with the right styles', () => {
const tree = create(<Hr fields={[]} />);
expect(tree).toMatchSnapshot();
});
});
| 7,902 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/atoms/IconWithTooltip.tsx | /*
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import Tooltip from '@material-ui/core/Tooltip';
import { SvgIconProps } from '@material-ui/core/SvgIcon';
interface IconWithTooltipProps {
Icon: React.ComponentType<SvgIconProps>;
height?: number;
iconColor: string;
tooltip: string;
width?: number;
}
const IconWithTooltip = (props: IconWithTooltipProps) => {
const { height, Icon, iconColor, tooltip, width } = props;
return (
<Tooltip title={tooltip}>
<Icon
style={{
color: iconColor,
height: height || 16,
width: width || 16,
}}
/>
</Tooltip>
);
};
export default IconWithTooltip;
| 7,903 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/atoms/Hr.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { color, spacing } from '../Css';
const style = {
border: '0px none transparent',
borderTop: `1px solid ${color.divider}`,
margin: `${spacing.base}px 0`,
};
const Hr = (props: any) => <hr style={style} {...props} />;
export default Hr;
| 7,904 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/atoms/BusyButton.test.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import BusyButton from './BusyButton';
import TestIcon from '@material-ui/icons/Help';
import { create } from 'react-test-renderer';
describe('BusyButton', () => {
it('renders with just a title', () => {
const tree = create(<BusyButton title='test busy button' />);
expect(tree).toMatchSnapshot();
});
it('renders with a title and icon', () => {
const tree = create(<BusyButton title='test busy button' icon={TestIcon} />);
expect(tree).toMatchSnapshot();
});
it('renders with a title and icon, and busy', () => {
const tree = create(<BusyButton title='test busy button' icon={TestIcon} busy={true} />);
expect(tree).toMatchSnapshot();
});
it('renders disabled', () => {
const tree = create(<BusyButton title='test busy button' icon={TestIcon} disabled={true} />);
expect(tree).toMatchSnapshot();
});
it('renders a primary outlined buton', () => {
const tree = create(<BusyButton title='test busy button' outlined={true} />);
expect(tree).toMatchSnapshot();
});
});
| 7,905 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/atoms | kubeflow_public_repos/kfp-tekton-backend/frontend/src/atoms/__snapshots__/Input.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Input accepts height and width as prop overrides 1`] = `
<TextField
className="textField"
required={false}
select={false}
spellCheck={false}
style={
Object {
"height": 123,
"maxWidth": 600,
"width": 456,
}
}
value="some input value"
variant="outlined"
/>
`;
exports[`Input renders with the right styles by default 1`] = `
<TextField
className="textField"
required={false}
select={false}
spellCheck={false}
style={
Object {
"height": 40,
"maxWidth": 600,
"width": "100%",
}
}
value="some input value"
variant="outlined"
/>
`;
| 7,906 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/atoms | kubeflow_public_repos/kfp-tekton-backend/frontend/src/atoms/__snapshots__/BusyButton.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`BusyButton renders a primary outlined buton 1`] = `
<button
className="MuiButtonBase-root-27 MuiButton-root-1 MuiButton-text-3 MuiButton-textPrimary-4 MuiButton-flat-6 MuiButton-flatPrimary-7 root"
disabled={false}
onBlur={[Function]}
onContextMenu={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
onMouseDown={[Function]}
onMouseLeave={[Function]}
onMouseUp={[Function]}
onTouchEnd={[Function]}
onTouchMove={[Function]}
onTouchStart={[Function]}
tabIndex="0"
type="button"
>
<span
className="MuiButton-label-2"
>
<span>
test busy button
</span>
</span>
<span
className="MuiTouchRipple-root-30"
/>
</button>
`;
exports[`BusyButton renders disabled 1`] = `
<button
className="MuiButtonBase-root-27 MuiButtonBase-disabled-28 MuiButton-root-1 MuiButton-text-3 MuiButton-textSecondary-5 MuiButton-flat-6 MuiButton-flatSecondary-8 MuiButton-disabled-21 root"
disabled={true}
onBlur={[Function]}
onContextMenu={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
onMouseDown={[Function]}
onMouseLeave={[Function]}
onMouseUp={[Function]}
onTouchEnd={[Function]}
onTouchMove={[Function]}
onTouchStart={[Function]}
tabIndex="-1"
type="button"
>
<span
className="MuiButton-label-2"
>
<svg
aria-hidden="true"
className="MuiSvgIcon-root-37 icon"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
>
<path
d="M0 0h24v24H0z"
fill="none"
/>
<path
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"
/>
</svg>
<span>
test busy button
</span>
</span>
</button>
`;
exports[`BusyButton renders with a title and icon 1`] = `
<button
className="MuiButtonBase-root-27 MuiButton-root-1 MuiButton-text-3 MuiButton-textSecondary-5 MuiButton-flat-6 MuiButton-flatSecondary-8 root"
disabled={false}
onBlur={[Function]}
onContextMenu={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
onMouseDown={[Function]}
onMouseLeave={[Function]}
onMouseUp={[Function]}
onTouchEnd={[Function]}
onTouchMove={[Function]}
onTouchStart={[Function]}
tabIndex="0"
type="button"
>
<span
className="MuiButton-label-2"
>
<svg
aria-hidden="true"
className="MuiSvgIcon-root-37 icon"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
>
<path
d="M0 0h24v24H0z"
fill="none"
/>
<path
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"
/>
</svg>
<span>
test busy button
</span>
</span>
<span
className="MuiTouchRipple-root-30"
/>
</button>
`;
exports[`BusyButton renders with a title and icon, and busy 1`] = `
<button
className="MuiButtonBase-root-27 MuiButtonBase-disabled-28 MuiButton-root-1 MuiButton-text-3 MuiButton-textSecondary-5 MuiButton-flat-6 MuiButton-flatSecondary-8 MuiButton-disabled-21 root rootBusy"
disabled={true}
onBlur={[Function]}
onContextMenu={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
onMouseDown={[Function]}
onMouseLeave={[Function]}
onMouseUp={[Function]}
onTouchEnd={[Function]}
onTouchMove={[Function]}
onTouchStart={[Function]}
tabIndex="-1"
type="button"
>
<span
className="MuiButton-label-2"
>
<svg
aria-hidden="true"
className="MuiSvgIcon-root-37 icon"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
>
<path
d="M0 0h24v24H0z"
fill="none"
/>
<path
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"
/>
</svg>
<span>
test busy button
</span>
<div
className="MuiCircularProgress-root-46 MuiCircularProgress-colorPrimary-49 MuiCircularProgress-indeterminate-48 spinner spinnerBusy"
role="progressbar"
style={
Object {
"height": 15,
"width": 15,
}
}
>
<svg
className="MuiCircularProgress-svg-51"
viewBox="22 22 44 44"
>
<circle
className="MuiCircularProgress-circle-52 MuiCircularProgress-circleIndeterminate-54"
cx={44}
cy={44}
fill="none"
r={20.2}
strokeWidth={3.6}
style={Object {}}
/>
</svg>
</div>
</span>
</button>
`;
exports[`BusyButton renders with just a title 1`] = `
<button
className="MuiButtonBase-root-27 MuiButton-root-1 MuiButton-text-3 MuiButton-textSecondary-5 MuiButton-flat-6 MuiButton-flatSecondary-8 root"
disabled={false}
onBlur={[Function]}
onContextMenu={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
onMouseDown={[Function]}
onMouseLeave={[Function]}
onMouseUp={[Function]}
onTouchEnd={[Function]}
onTouchMove={[Function]}
onTouchStart={[Function]}
tabIndex="0"
type="button"
>
<span
className="MuiButton-label-2"
>
<span>
test busy button
</span>
</span>
<span
className="MuiTouchRipple-root-30"
/>
</button>
`;
| 7,907 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/atoms | kubeflow_public_repos/kfp-tekton-backend/frontend/src/atoms/__snapshots__/Hr.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Hr renders with the right styles 1`] = `
<hr
fields={Array []}
style={
Object {
"border": "0px none transparent",
"borderTop": "1px solid #e0e0e0",
"margin": "24px 0",
}
}
/>
`;
| 7,908 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/atoms | kubeflow_public_repos/kfp-tekton-backend/frontend/src/atoms/__snapshots__/Separator.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Separator renders with the right styles by default 1`] = `
<span
style={
Object {
"display": "inline-block",
"minWidth": 10,
"width": 10,
}
}
/>
`;
exports[`Separator renders with the specified orientation 1`] = `
<span
style={
Object {
"display": "block",
"flexShrink": 0,
"height": 10,
"minHeight": 10,
}
}
/>
`;
exports[`Separator renders with the specified units 1`] = `
<span
style={
Object {
"display": "inline-block",
"minWidth": 123,
"width": 123,
}
}
/>
`;
| 7,909 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/atoms | kubeflow_public_repos/kfp-tekton-backend/frontend/src/atoms/__snapshots__/MD2Tabs.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Input gracefully handles an out of bound selectedTab value 1`] = `
<MD2Tabs
selectedTab={100}
tabs={
Array [
"tab1",
"tab2",
]
}
>
<div
className="tabs"
>
<div
className="indicator"
/>
<Separator
units={20}
>
<span
style={
Object {
"display": "inline-block",
"minWidth": 20,
"width": 20,
}
}
/>
</Separator>
<WithStyles(Button)
className="button active"
key="0"
onClick={[Function]}
>
<Button
className="button active"
classes={
Object {
"colorInherit": "MuiButton-colorInherit-22",
"contained": "MuiButton-contained-12",
"containedPrimary": "MuiButton-containedPrimary-13",
"containedSecondary": "MuiButton-containedSecondary-14",
"disabled": "MuiButton-disabled-21",
"extendedFab": "MuiButton-extendedFab-19",
"fab": "MuiButton-fab-18",
"flat": "MuiButton-flat-6",
"flatPrimary": "MuiButton-flatPrimary-7",
"flatSecondary": "MuiButton-flatSecondary-8",
"focusVisible": "MuiButton-focusVisible-20",
"fullWidth": "MuiButton-fullWidth-26",
"label": "MuiButton-label-2",
"mini": "MuiButton-mini-23",
"outlined": "MuiButton-outlined-9",
"outlinedPrimary": "MuiButton-outlinedPrimary-10",
"outlinedSecondary": "MuiButton-outlinedSecondary-11",
"raised": "MuiButton-raised-15",
"raisedPrimary": "MuiButton-raisedPrimary-16",
"raisedSecondary": "MuiButton-raisedSecondary-17",
"root": "MuiButton-root-1",
"sizeLarge": "MuiButton-sizeLarge-25",
"sizeSmall": "MuiButton-sizeSmall-24",
"text": "MuiButton-text-3",
"textPrimary": "MuiButton-textPrimary-4",
"textSecondary": "MuiButton-textSecondary-5",
}
}
color="default"
component="button"
disableFocusRipple={false}
disabled={false}
fullWidth={false}
mini={false}
onClick={[Function]}
size="medium"
type="button"
variant="text"
>
<WithStyles(ButtonBase)
className="MuiButton-root-1 MuiButton-text-3 MuiButton-flat-6 button active"
component="button"
disabled={false}
focusRipple={true}
focusVisibleClassName="MuiButton-focusVisible-20"
onClick={[Function]}
type="button"
>
<ButtonBase
centerRipple={false}
className="MuiButton-root-1 MuiButton-text-3 MuiButton-flat-6 button active"
classes={
Object {
"disabled": "MuiButtonBase-disabled-28",
"focusVisible": "MuiButtonBase-focusVisible-29",
"root": "MuiButtonBase-root-27",
}
}
component="button"
disableRipple={false}
disableTouchRipple={false}
disabled={false}
focusRipple={true}
focusVisibleClassName="MuiButton-focusVisible-20"
onClick={[Function]}
tabIndex="0"
type="button"
>
<button
className="MuiButtonBase-root-27 MuiButton-root-1 MuiButton-text-3 MuiButton-flat-6 button active"
disabled={false}
onBlur={[Function]}
onClick={[Function]}
onContextMenu={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
onMouseDown={[Function]}
onMouseLeave={[Function]}
onMouseUp={[Function]}
onTouchEnd={[Function]}
onTouchMove={[Function]}
onTouchStart={[Function]}
tabIndex="0"
type="button"
>
<span
className="MuiButton-label-2"
>
<span>
tab1
</span>
</span>
<NoSsr
defer={false}
fallback={null}
>
<WithStyles(TouchRipple)
center={false}
innerRef={[Function]}
>
<TouchRipple
center={false}
classes={
Object {
"child": "MuiTouchRipple-child-34",
"childLeaving": "MuiTouchRipple-childLeaving-35",
"childPulsate": "MuiTouchRipple-childPulsate-36",
"ripple": "MuiTouchRipple-ripple-31",
"ripplePulsate": "MuiTouchRipple-ripplePulsate-33",
"rippleVisible": "MuiTouchRipple-rippleVisible-32",
"root": "MuiTouchRipple-root-30",
}
}
>
<TransitionGroup
childFactory={[Function]}
className="MuiTouchRipple-root-30"
component="span"
enter={true}
exit={true}
>
<span
className="MuiTouchRipple-root-30"
/>
</TransitionGroup>
</TouchRipple>
</WithStyles(TouchRipple)>
</NoSsr>
</button>
</ButtonBase>
</WithStyles(ButtonBase)>
</Button>
</WithStyles(Button)>
<WithStyles(Button)
className="button"
key="1"
onClick={[Function]}
>
<Button
className="button"
classes={
Object {
"colorInherit": "MuiButton-colorInherit-22",
"contained": "MuiButton-contained-12",
"containedPrimary": "MuiButton-containedPrimary-13",
"containedSecondary": "MuiButton-containedSecondary-14",
"disabled": "MuiButton-disabled-21",
"extendedFab": "MuiButton-extendedFab-19",
"fab": "MuiButton-fab-18",
"flat": "MuiButton-flat-6",
"flatPrimary": "MuiButton-flatPrimary-7",
"flatSecondary": "MuiButton-flatSecondary-8",
"focusVisible": "MuiButton-focusVisible-20",
"fullWidth": "MuiButton-fullWidth-26",
"label": "MuiButton-label-2",
"mini": "MuiButton-mini-23",
"outlined": "MuiButton-outlined-9",
"outlinedPrimary": "MuiButton-outlinedPrimary-10",
"outlinedSecondary": "MuiButton-outlinedSecondary-11",
"raised": "MuiButton-raised-15",
"raisedPrimary": "MuiButton-raisedPrimary-16",
"raisedSecondary": "MuiButton-raisedSecondary-17",
"root": "MuiButton-root-1",
"sizeLarge": "MuiButton-sizeLarge-25",
"sizeSmall": "MuiButton-sizeSmall-24",
"text": "MuiButton-text-3",
"textPrimary": "MuiButton-textPrimary-4",
"textSecondary": "MuiButton-textSecondary-5",
}
}
color="default"
component="button"
disableFocusRipple={false}
disabled={false}
fullWidth={false}
mini={false}
onClick={[Function]}
size="medium"
type="button"
variant="text"
>
<WithStyles(ButtonBase)
className="MuiButton-root-1 MuiButton-text-3 MuiButton-flat-6 button"
component="button"
disabled={false}
focusRipple={true}
focusVisibleClassName="MuiButton-focusVisible-20"
onClick={[Function]}
type="button"
>
<ButtonBase
centerRipple={false}
className="MuiButton-root-1 MuiButton-text-3 MuiButton-flat-6 button"
classes={
Object {
"disabled": "MuiButtonBase-disabled-28",
"focusVisible": "MuiButtonBase-focusVisible-29",
"root": "MuiButtonBase-root-27",
}
}
component="button"
disableRipple={false}
disableTouchRipple={false}
disabled={false}
focusRipple={true}
focusVisibleClassName="MuiButton-focusVisible-20"
onClick={[Function]}
tabIndex="0"
type="button"
>
<button
className="MuiButtonBase-root-27 MuiButton-root-1 MuiButton-text-3 MuiButton-flat-6 button"
disabled={false}
onBlur={[Function]}
onClick={[Function]}
onContextMenu={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
onMouseDown={[Function]}
onMouseLeave={[Function]}
onMouseUp={[Function]}
onTouchEnd={[Function]}
onTouchMove={[Function]}
onTouchStart={[Function]}
tabIndex="0"
type="button"
>
<span
className="MuiButton-label-2"
>
<span>
tab2
</span>
</span>
<NoSsr
defer={false}
fallback={null}
>
<WithStyles(TouchRipple)
center={false}
innerRef={[Function]}
>
<TouchRipple
center={false}
classes={
Object {
"child": "MuiTouchRipple-child-34",
"childLeaving": "MuiTouchRipple-childLeaving-35",
"childPulsate": "MuiTouchRipple-childPulsate-36",
"ripple": "MuiTouchRipple-ripple-31",
"ripplePulsate": "MuiTouchRipple-ripplePulsate-33",
"rippleVisible": "MuiTouchRipple-rippleVisible-32",
"root": "MuiTouchRipple-root-30",
}
}
>
<TransitionGroup
childFactory={[Function]}
className="MuiTouchRipple-root-30"
component="span"
enter={true}
exit={true}
>
<span
className="MuiTouchRipple-root-30"
/>
</TransitionGroup>
</TouchRipple>
</WithStyles(TouchRipple)>
</NoSsr>
</button>
</ButtonBase>
</WithStyles(ButtonBase)>
</Button>
</WithStyles(Button)>
</div>
</MD2Tabs>
`;
exports[`Input renders with the right styles by default 1`] = `
<div
className="tabs"
>
<div
className="indicator"
/>
<Separator
units={20}
/>
<WithStyles(Button)
className="button active"
key="0"
onClick={[Function]}
>
<span>
tab1
</span>
</WithStyles(Button)>
<WithStyles(Button)
className="button"
key="1"
onClick={[Function]}
>
<span>
tab2
</span>
</WithStyles(Button)>
</div>
`;
| 7,910 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/atoms | kubeflow_public_repos/kfp-tekton-backend/frontend/src/atoms/__snapshots__/IconWithTooltip.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`IconWithTooltip renders with height and weight 1`] = `
<svg
aria-describedby={null}
aria-hidden="true"
className="MuiSvgIcon-root-9"
focusable="false"
onBlur={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
role="presentation"
style={
Object {
"color": "green",
"height": 20,
"width": 20,
}
}
title="test icon tooltip"
viewBox="0 0 24 24"
>
<path
d="M0 0h24v24H0z"
fill="none"
/>
<path
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"
/>
</svg>
`;
exports[`IconWithTooltip renders without height or weight 1`] = `
<svg
aria-describedby={null}
aria-hidden="true"
className="MuiSvgIcon-root-9"
focusable="false"
onBlur={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
role="presentation"
style={
Object {
"color": "green",
"height": 16,
"width": 16,
}
}
title="test icon tooltip"
viewBox="0 0 24 24"
>
<path
d="M0 0h24v24H0z"
fill="none"
/>
<path
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"
/>
</svg>
`;
| 7,911 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/Description.tsx | /*
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import Markdown from 'markdown-to-jsx';
import { ExternalLink } from '../atoms/ExternalLink';
function preventEventBubbling(e: React.MouseEvent): void {
e.stopPropagation();
}
const renderExternalLink = (props: {}) => (
<ExternalLink {...props} onClick={preventEventBubbling} />
);
const options = {
overrides: { a: { component: renderExternalLink } },
};
const optionsForceInline = {
...options,
forceInline: true,
};
export const Description: React.FC<{ description: string; forceInline?: boolean }> = ({
description,
forceInline,
}) => {
return <Markdown options={forceInline ? optionsForceInline : options}>{description}</Markdown>;
};
| 7,912 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/NewRunParameters.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { commonCss } from '../Css';
import Button from '@material-ui/core/Button';
import InputAdornment from '@material-ui/core/InputAdornment';
import TextField from '@material-ui/core/TextField';
import { ApiParameter } from '../apis/pipeline';
import { classes, stylesheet } from 'typestyle';
import { color, spacing } from '../Css';
import Editor from './Editor';
export interface NewRunParametersProps {
initialParams: ApiParameter[];
titleMessage: string;
handleParamChange: (index: number, value: string) => void;
}
const css = stylesheet({
button: {
margin: 0,
padding: '3px 5px',
},
key: {
color: color.strong,
flex: '0 0 50%',
fontWeight: 'bold',
maxWidth: 300,
},
nonEditableInput: {
color: color.secondaryText,
},
row: {
borderBottom: `1px solid ${color.divider}`,
display: 'flex',
padding: `${spacing.units(-5)}px ${spacing.units(-6)}px`,
},
textfield: {
maxWidth: 600,
},
});
class NewRunParameters extends React.Component<NewRunParametersProps> {
public render(): JSX.Element | null {
const { handleParamChange, initialParams, titleMessage } = this.props;
return (
<div>
<div className={commonCss.header}>Run parameters</div>
<div>{titleMessage}</div>
{!!initialParams.length && (
<div>
{initialParams.map((param, i) => {
return (
<ParamEditor
key={i}
id={`newRunPipelineParam${i}`}
onChange={(value: string) => handleParamChange(i, value)}
param={param}
/>
);
})}
</div>
)}
</div>
);
}
}
interface ParamEditorProps {
id: string;
onChange: (value: string) => void;
param: ApiParameter;
}
interface ParamEditorState {
isEditorOpen: boolean;
isInJsonForm: boolean;
isJsonField: boolean;
}
class ParamEditor extends React.Component<ParamEditorProps, ParamEditorState> {
public static getDerivedStateFromProps(
nextProps: ParamEditorProps,
prevState: ParamEditorState,
): { isInJsonForm: boolean; isJsonField: boolean } {
let isJson = true;
try {
const displayValue = JSON.parse(nextProps.param.value || '');
// Nulls, booleans, strings, and numbers can all be parsed as JSON, but we don't care
// about rendering. Note that `typeOf null` returns 'object'
if (displayValue === null || typeof displayValue !== 'object') {
throw new Error('Parsed JSON was neither an array nor an object. Using default renderer');
}
} catch (err) {
isJson = false;
}
return {
isInJsonForm: isJson,
isJsonField: prevState.isJsonField || isJson,
};
}
public state = {
isEditorOpen: false,
isInJsonForm: false,
isJsonField: false,
};
public render(): JSX.Element | null {
const { id, onChange, param } = this.props;
const onClick = () => {
if (this.state.isInJsonForm) {
const displayValue = JSON.parse(param.value || '');
if (this.state.isEditorOpen) {
onChange(JSON.stringify(displayValue) || '');
} else {
onChange(JSON.stringify(displayValue, null, 2) || '');
}
}
this.setState({
isEditorOpen: !this.state.isEditorOpen,
});
};
return (
<>
{this.state.isJsonField ? (
<TextField
id={id}
disabled={this.state.isEditorOpen}
variant='outlined'
label={param.name}
value={param.value || ''}
onChange={ev => onChange(ev.target.value || '')}
className={classes(commonCss.textField, css.textfield)}
InputProps={{
classes: { disabled: css.nonEditableInput },
endAdornment: (
<InputAdornment position='end'>
<Button className={css.button} color='secondary' onClick={onClick}>
{this.state.isEditorOpen ? 'Close Json Editor' : 'Open Json Editor'}
</Button>
</InputAdornment>
),
readOnly: false,
}}
/>
) : (
<TextField
id={id}
variant='outlined'
label={param.name}
value={param.value || ''}
onChange={ev => onChange(ev.target.value || '')}
className={classes(commonCss.textField, css.textfield)}
/>
)}
{this.state.isJsonField && this.state.isEditorOpen && (
<div className={css.row}>
<Editor
width='100%'
minLines={3}
maxLines={20}
mode='json'
theme='github'
highlightActiveLine={true}
showGutter={true}
readOnly={false}
onChange={text => onChange(text || '')}
value={param.value || ''}
/>
</div>
)}
</>
);
}
}
export default NewRunParameters;
| 7,913 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/LogViewer.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { List, AutoSizer, ListRowProps } from 'react-virtualized';
import { fontsize, fonts } from '../Css';
import { stylesheet } from 'typestyle';
import { OverscanIndicesGetter } from 'react-virtualized/dist/es/Grid';
const css = stylesheet({
a: {
$nest: {
'&:hover': {
color: '#bcdeff',
},
'&:visited': {
color: '#bc9fff',
},
},
color: '#96cbfe',
},
line: {
$nest: {
'&:hover': {
backgroundColor: '#333',
},
},
display: 'flex',
},
number: {
color: '#999',
flex: '40px 0 0',
paddingRight: 10,
textAlign: 'right',
userSelect: 'none',
},
root: {
// We cannot easily add padding here without breaking react-virtualized size calculation, for
// details: https://github.com/bvaughn/react-virtualized/issues/992
// Specifically, a complex solution was proposed in https://github.com/bvaughn/react-virtualized/issues/992#issuecomment-371145943.
// We may consider that later.
backgroundColor: '#222',
color: '#fff',
fontFamily: fonts.code,
fontSize: fontsize.small,
// This override and listContainerStyleOverride workarounds to allow horizontal scroll.
// Reference: https://github.com/bvaughn/react-virtualized/issues/1248
overflow: 'auto !important',
whiteSpace: 'pre',
},
});
const listContainerStyleOverride = {
overflow: 'visible',
};
interface LogViewerProps {
logLines: string[];
}
// Use the same amount of overscan above and below visible rows.
//
// Why:
// * Default behavior is that when we scroll to one direction, content off
// screen on the other direction is unmounted from browser immediately. This
// caused a bug when selecting lines + scrolling.
// * With new behavior implemented below: we are now overscanning on both
// directions disregard of which direction user is scrolling to, we can ensure
// lines not exceeding maximum overscanRowCount lines off screen are still
// selectable.
const overscanOnBothDirections: OverscanIndicesGetter = ({
direction, // One of "horizontal" or "vertical"
cellCount, // Number of rows or columns in the current axis
scrollDirection, // 1 (forwards) or -1 (backwards)
overscanCellsCount, // Maximum number of cells to over-render in either direction
startIndex, // Begin of range of visible cells
stopIndex, // End of range of visible cells
}) => {
return {
overscanStartIndex: Math.max(0, startIndex - overscanCellsCount),
overscanStopIndex: Math.min(cellCount - 1, stopIndex + overscanCellsCount),
};
};
interface LogViewerState {
followNewLogs: boolean;
}
class LogViewer extends React.Component<LogViewerProps, LogViewerState> {
public state = {
followNewLogs: true,
};
private _rootRef = React.createRef<List>();
public componentDidMount(): void {
// Wait until the next frame to scroll to bottom, because doms haven't been
// rendered when running this.
setTimeout(() => {
this._scrollToEnd();
});
}
public componentDidUpdate(): void {
if (this.state.followNewLogs) {
this._scrollToEnd();
}
}
public render(): JSX.Element {
return (
<AutoSizer>
{({ height, width }) => (
<List
id='logViewer'
containerStyle={listContainerStyleOverride}
width={width}
height={height}
rowCount={this.props.logLines.length}
rowHeight={15}
className={css.root}
ref={this._rootRef}
overscanIndicesGetter={overscanOnBothDirections}
overscanRowCount={
400 /* make this large, so selecting maximum 400 lines is supported */
}
rowRenderer={this._rowRenderer.bind(this)}
onScroll={this.handleScroll}
/>
)}
</AutoSizer>
);
}
private handleScroll = (info: {
clientHeight: number;
scrollHeight: number;
scrollTop: number;
}) => {
const offsetTolerance = 20; // pixels
const isScrolledToBottom =
info.scrollHeight - info.scrollTop - info.clientHeight <= offsetTolerance;
if (isScrolledToBottom !== this.state.followNewLogs) {
this.setState({
followNewLogs: isScrolledToBottom,
});
}
};
private _scrollToEnd(): void {
const root = this._rootRef.current;
if (root) {
root.scrollToRow(this.props.logLines.length + 1);
}
}
private _rowRenderer(props: ListRowProps): React.ReactNode {
const { style, key, index } = props;
const line = this.props.logLines[index];
return (
<div key={key} className={css.line} style={style}>
<MemoedLogLine index={index} line={line} />
</div>
);
}
}
const LogLine: React.FC<{ index: number; line: string }> = ({ index, line }) => (
<>
<span className={css.number} style={getLineStyle(line)}>
{index + 1}
</span>
<span className={css.line} style={getLineStyle(line)}>
{parseLine(line).map((piece, p) => (
<span key={p}>{piece}</span>
))}
</span>
</>
);
// improve performance when rerendering, because we render a lot of logs
const MemoedLogLine = React.memo(LogLine);
function getLineStyle(line: string): React.CSSProperties {
const lineLowerCase = line.toLowerCase();
if (lineLowerCase.indexOf('error') > -1 || lineLowerCase.indexOf('fail') > -1) {
return {
backgroundColor: '#700000',
color: 'white',
};
} else if (lineLowerCase.indexOf('warn') > -1) {
return {
backgroundColor: '#545400',
color: 'white',
};
} else {
return {};
}
}
function parseLine(line: string): React.ReactNode[] {
// Linkify URLs starting with http:// or https://
// eslint-disable-next-line no-useless-escape
const urlPattern = /(\b(https?):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim;
let lastMatch = 0;
let match = urlPattern.exec(line);
const nodes = [];
while (match) {
// Append all text before URL match
nodes.push(<span>{line.substr(lastMatch, match.index)}</span>);
// Append URL via an anchor element
nodes.push(
<a href={match[0]} target='_blank' rel='noopener noreferrer' className={css.a}>
{match[0]}
</a>,
);
lastMatch = match.index + match[0].length;
match = urlPattern.exec(line);
}
// Append all text after final URL
nodes.push(<span>{line.substr(lastMatch)}</span>);
return nodes;
}
export default LogViewer;
| 7,914 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/Router.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import ArtifactList from '../pages/ArtifactList';
import ArtifactDetails from '../pages/ArtifactDetails';
import Banner, { BannerProps } from '../components/Banner';
import Button from '@material-ui/core/Button';
import Compare from '../pages/Compare';
import Dialog from '@material-ui/core/Dialog';
import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import ExecutionList from '../pages/ExecutionList';
import ExecutionDetails from '../pages/ExecutionDetails';
import ExperimentDetails from '../pages/ExperimentDetails';
import ExperimentsAndRuns, { ExperimentsAndRunsTab } from '../pages/ExperimentsAndRuns';
import ArchivedExperimentsAndRuns, {
ArchivedExperimentsAndRunsTab,
} from '../pages/ArchivedExperimentsAndRuns';
import NewExperiment from '../pages/NewExperiment';
import NewRun from '../pages/NewRun';
import Page404 from '../pages/404';
import PipelineDetails from '../pages/PipelineDetails';
import PipelineList from '../pages/PipelineList';
import RecurringRunDetails from '../pages/RecurringRunDetails';
import RunDetails from '../pages/RunDetails';
import SideNav from './SideNav';
import Snackbar, { SnackbarProps } from '@material-ui/core/Snackbar';
import Toolbar, { ToolbarProps } from './Toolbar';
import { Route, Switch, Redirect } from 'react-router-dom';
import { classes, stylesheet } from 'typestyle';
import { commonCss } from '../Css';
import NewPipelineVersion from '../pages/NewPipelineVersion';
import { GettingStarted } from '../pages/GettingStarted';
import { KFP_FLAGS, Deployments } from '../lib/Flags';
export type RouteConfig = {
path: string;
Component: React.ComponentType<any>;
view?: any;
notExact?: boolean;
};
const css = stylesheet({
dialog: {
minWidth: 250,
},
});
export enum QUERY_PARAMS {
cloneFromRun = 'cloneFromRun',
cloneFromRecurringRun = 'cloneFromRecurringRun',
experimentId = 'experimentId',
isRecurring = 'recurring',
firstRunInExperiment = 'firstRunInExperiment',
pipelineId = 'pipelineId',
pipelineVersionId = 'pipelineVersionId',
fromRunId = 'fromRun',
runlist = 'runlist',
view = 'view',
}
export enum RouteParams {
experimentId = 'eid',
pipelineId = 'pid',
pipelineVersionId = 'vid',
runId = 'rid',
// TODO: create one of these for artifact and execution?
ID = 'id',
}
// tslint:disable-next-line:variable-name
export const RoutePrefix = {
ARTIFACT: '/artifact',
EXECUTION: '/execution',
RECURRING_RUN: '/recurringrun',
};
// tslint:disable-next-line:variable-name
export const RoutePage = {
ARCHIVED_RUNS: '/archive/runs',
ARCHIVED_EXPERIMENTS: '/archive/experiments',
ARTIFACTS: '/artifacts',
ARTIFACT_DETAILS: `/artifacts/:${RouteParams.ID}`,
COMPARE: `/compare`,
EXECUTIONS: '/executions',
EXECUTION_DETAILS: `/executions/:${RouteParams.ID}`,
EXPERIMENTS: '/experiments',
EXPERIMENT_DETAILS: `/experiments/details/:${RouteParams.experimentId}`,
NEW_EXPERIMENT: '/experiments/new',
NEW_PIPELINE_VERSION: '/pipeline_versions/new',
NEW_RUN: '/runs/new',
PIPELINES: '/pipelines',
PIPELINE_DETAILS: `/pipelines/details/:${RouteParams.pipelineId}/version/:${RouteParams.pipelineVersionId}?`,
PIPELINE_DETAILS_NO_VERSION: `/pipelines/details/:${RouteParams.pipelineId}?`, // pipelineId is optional
RECURRING_RUN: `/recurringrun/details/:${RouteParams.runId}`,
RUNS: '/runs',
RUN_DETAILS: `/runs/details/:${RouteParams.runId}`,
START: '/start',
};
export const RoutePageFactory = {
artifactDetails: (artifactId: number) => {
return RoutePage.ARTIFACT_DETAILS.replace(`:${RouteParams.ID}`, '' + artifactId);
},
executionDetails: (executionId: number) => {
return RoutePage.EXECUTION_DETAILS.replace(`:${RouteParams.ID}`, '' + executionId);
},
pipelineDetails: (id: string) => {
return RoutePage.PIPELINE_DETAILS_NO_VERSION.replace(`:${RouteParams.pipelineId}`, id);
},
};
export const ExternalLinks = {
AI_HUB: 'https://aihub.cloud.google.com/u/0/s?category=pipeline',
DOCUMENTATION: 'https://www.kubeflow.org/docs/pipelines/',
GITHUB: 'https://github.com/kubeflow/pipelines',
};
export interface DialogProps {
buttons?: Array<{ onClick?: () => any; text: string }>;
// TODO: This should be generalized to any react component.
content?: string;
onClose?: () => any;
open?: boolean;
title?: string;
}
interface RouteComponentState {
bannerProps: BannerProps;
dialogProps: DialogProps;
snackbarProps: SnackbarProps;
toolbarProps: ToolbarProps;
}
export interface RouterProps {
configs?: RouteConfig[]; // only used in tests
}
const DEFAULT_ROUTE =
KFP_FLAGS.DEPLOYMENT === Deployments.MARKETPLACE ? RoutePage.START : RoutePage.PIPELINES;
// This component is made as a wrapper to separate toolbar state for different pages.
const Router: React.FC<RouterProps> = ({ configs }) => {
const routes: RouteConfig[] = configs || [
{ path: RoutePage.START, Component: GettingStarted },
{
Component: ArchivedExperimentsAndRuns,
path: RoutePage.ARCHIVED_RUNS,
view: ArchivedExperimentsAndRunsTab.RUNS,
},
{
Component: ArchivedExperimentsAndRuns,
path: RoutePage.ARCHIVED_EXPERIMENTS,
view: ArchivedExperimentsAndRunsTab.EXPERIMENTS,
},
{ path: RoutePage.ARTIFACTS, Component: ArtifactList },
{ path: RoutePage.ARTIFACT_DETAILS, Component: ArtifactDetails, notExact: true },
{ path: RoutePage.EXECUTIONS, Component: ExecutionList },
{ path: RoutePage.EXECUTION_DETAILS, Component: ExecutionDetails },
{
Component: ExperimentsAndRuns,
path: RoutePage.EXPERIMENTS,
view: ExperimentsAndRunsTab.EXPERIMENTS,
},
{ path: RoutePage.EXPERIMENT_DETAILS, Component: ExperimentDetails },
{ path: RoutePage.NEW_EXPERIMENT, Component: NewExperiment },
{ path: RoutePage.NEW_PIPELINE_VERSION, Component: NewPipelineVersion },
{ path: RoutePage.NEW_RUN, Component: NewRun },
{ path: RoutePage.PIPELINES, Component: PipelineList },
{ path: RoutePage.PIPELINE_DETAILS, Component: PipelineDetails },
{ path: RoutePage.PIPELINE_DETAILS_NO_VERSION, Component: PipelineDetails },
{ path: RoutePage.RUNS, Component: ExperimentsAndRuns, view: ExperimentsAndRunsTab.RUNS },
{ path: RoutePage.RECURRING_RUN, Component: RecurringRunDetails },
{ path: RoutePage.RUN_DETAILS, Component: RunDetails },
{ path: RoutePage.COMPARE, Component: Compare },
];
return (
// There will be only one instance of SideNav, throughout UI usage.
<SideNavLayout>
<Switch>
<Route
exact={true}
path={'/'}
render={({ ...props }) => <Redirect to={DEFAULT_ROUTE} {...props} />}
/>
{/* Normal routes */}
{routes.map((route, i) => {
const { path } = { ...route };
return (
// Setting a key here, so that two different routes are considered two instances from
// react. Therefore, they don't share toolbar state. This avoids many bugs like dangling
// network response handlers.
<Route
key={i}
exact={!route.notExact}
path={path}
render={props => <RoutedPage key={props.location.key} route={route} />}
/>
);
})}
{/* 404 */}
{
<Route>
<RoutedPage />
</Route>
}
</Switch>
</SideNavLayout>
);
};
class RoutedPage extends React.Component<{ route?: RouteConfig }, RouteComponentState> {
constructor(props: any) {
super(props);
this.state = {
bannerProps: {},
dialogProps: { open: false },
snackbarProps: { autoHideDuration: 5000, open: false },
toolbarProps: { breadcrumbs: [{ displayName: '', href: '' }], actions: [], ...props },
};
}
public render(): JSX.Element {
const childProps = {
toolbarProps: this.state.toolbarProps,
updateBanner: this._updateBanner.bind(this),
updateDialog: this._updateDialog.bind(this),
updateSnackbar: this._updateSnackbar.bind(this),
updateToolbar: this._updateToolbar.bind(this),
};
const route = this.props.route;
return (
<div className={classes(commonCss.page)}>
<Route render={({ ...props }) => <Toolbar {...this.state.toolbarProps} {...props} />} />
{this.state.bannerProps.message && (
<Banner
message={this.state.bannerProps.message}
mode={this.state.bannerProps.mode}
additionalInfo={this.state.bannerProps.additionalInfo}
refresh={this.state.bannerProps.refresh}
showTroubleshootingGuideLink={true}
/>
)}
<Switch>
{route &&
(() => {
const { path, Component, ...otherProps } = { ...route };
return (
<Route
exact={!route.notExact}
path={path}
render={({ ...props }) => (
<Component {...props} {...childProps} {...otherProps} />
)}
/>
);
})()}
{/* 404 */}
{!!route && <Route render={({ ...props }) => <Page404 {...props} {...childProps} />} />}
</Switch>
<Snackbar
autoHideDuration={this.state.snackbarProps.autoHideDuration}
message={this.state.snackbarProps.message}
open={this.state.snackbarProps.open}
onClose={this._handleSnackbarClose.bind(this)}
/>
<Dialog
open={this.state.dialogProps.open !== false}
classes={{ paper: css.dialog }}
className='dialog'
onClose={() => this._handleDialogClosed()}
>
{this.state.dialogProps.title && (
<DialogTitle> {this.state.dialogProps.title}</DialogTitle>
)}
{this.state.dialogProps.content && (
<DialogContent className={commonCss.prewrap}>
{this.state.dialogProps.content}
</DialogContent>
)}
{this.state.dialogProps.buttons && (
<DialogActions>
{this.state.dialogProps.buttons.map((b, i) => (
<Button
key={i}
onClick={() => this._handleDialogClosed(b.onClick)}
className='dialogButton'
color='secondary'
>
{b.text}
</Button>
))}
</DialogActions>
)}
</Dialog>
</div>
);
}
private _updateDialog(dialogProps: DialogProps): void {
// Assuming components will want to open the dialog by defaut.
if (dialogProps.open === undefined) {
dialogProps.open = true;
}
this.setState({ dialogProps });
}
private _handleDialogClosed(onClick?: () => void): void {
this.setState({ dialogProps: { open: false } });
if (onClick) {
onClick();
}
if (this.state.dialogProps.onClose) {
this.state.dialogProps.onClose();
}
}
private _updateToolbar(newToolbarProps: Partial<ToolbarProps>): void {
const toolbarProps = Object.assign(this.state.toolbarProps, newToolbarProps);
this.setState({ toolbarProps });
}
private _updateBanner(bannerProps: BannerProps): void {
this.setState({ bannerProps });
}
private _updateSnackbar(snackbarProps: SnackbarProps): void {
snackbarProps.autoHideDuration =
snackbarProps.autoHideDuration || this.state.snackbarProps.autoHideDuration;
this.setState({ snackbarProps });
}
private _handleSnackbarClose(): void {
this.setState({ snackbarProps: { open: false, message: '' } });
}
}
// TODO: loading/error experience until backend is reachable
export default Router;
const SideNavLayout: React.FC<{}> = ({ children }) => (
<div className={commonCss.page}>
<div className={commonCss.flexGrow}>
<Route render={({ ...props }) => <SideNav page={props.location.pathname} {...props} />} />
{children}
</div>
</div>
);
| 7,915 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/CollapseButton.test.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import CollapseButton from './CollapseButton';
import { shallow } from 'enzyme';
describe('CollapseButton', () => {
const compareComponent = {
setState: jest.fn(),
state: {
collapseSections: {},
},
} as any;
afterEach(() => (compareComponent.state.collapseSections = {}));
it('initial render', () => {
const tree = shallow(
<CollapseButton
collapseSections={compareComponent.state.collapseSections}
compareSetState={compareComponent.setState}
sectionName='testSection'
/>,
);
expect(tree).toMatchSnapshot();
});
it('renders the button collapsed if in collapsedSections', () => {
compareComponent.state.collapseSections.testSection = true;
const tree = shallow(
<CollapseButton
collapseSections={compareComponent.state.collapseSections}
compareSetState={compareComponent.setState}
sectionName='testSection'
/>,
);
expect(tree).toMatchSnapshot();
});
it('collapses given section when clicked', () => {
const tree = shallow(
<CollapseButton
collapseSections={compareComponent.state.collapseSections}
compareSetState={compareComponent.setState}
sectionName='testSection'
/>,
);
tree.find('WithStyles(Button)').simulate('click');
expect(compareComponent.setState).toHaveBeenCalledWith({
collapseSections: { testSection: true },
});
});
it('expands given section when clicked if it is collapsed', () => {
compareComponent.state.collapseSections.testSection = true;
const tree = shallow(
<CollapseButton
collapseSections={compareComponent.state.collapseSections}
compareSetState={compareComponent.setState}
sectionName='testSection'
/>,
);
tree.find('WithStyles(Button)').simulate('click');
expect(compareComponent.setState).toHaveBeenCalledWith({
collapseSections: { testSection: false },
});
});
});
| 7,916 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/DetailsTable.test.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import DetailsTable from './DetailsTable';
import { render } from '@testing-library/react';
jest.mock('./Editor', () => {
return ({ value }: { value: string }) => <pre data-testid='Editor'>{value}</pre>;
});
describe('DetailsTable', () => {
it('shows no rows', () => {
const { container } = render(<DetailsTable fields={[]} />);
expect(container).toMatchInlineSnapshot(`
<div>
<div />
</div>
`);
});
it('shows one row', () => {
const { container } = render(<DetailsTable fields={[['key', 'value']]} />);
expect(container).toMatchInlineSnapshot(`
<div>
<div>
<div
class="row"
>
<span
class="key"
>
key
</span>
<span
class="valueText"
>
value
</span>
</div>
</div>
</div>
`);
});
it('shows a row with a title', () => {
const { container } = render(<DetailsTable title='some title' fields={[['key', 'value']]} />);
expect(container).toMatchInlineSnapshot(`
<div>
<div
class="header"
>
some title
</div>
<div>
<div
class="row"
>
<span
class="key"
>
key
</span>
<span
class="valueText"
>
value
</span>
</div>
</div>
</div>
`);
});
it('shows key and value for large values', () => {
const { container } = render(
<DetailsTable
fields={[
[
'key',
`Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book. It has survived not only five
centuries, but also the leap into electronic typesetting, remaining
essentially unchanged. It was popularised in the 1960s with the release
of Letraset sheets containing Lorem Ipsum passages, and more recently
with desktop publishing software like Aldus PageMaker including versions
of Lorem Ipsum.`,
],
]}
/>,
);
expect(container).toMatchInlineSnapshot(`
<div>
<div>
<div
class="row"
>
<span
class="key"
>
key
</span>
<span
class="valueText"
>
Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book. It has survived not only five
centuries, but also the leap into electronic typesetting, remaining
essentially unchanged. It was popularised in the 1960s with the release
of Letraset sheets containing Lorem Ipsum passages, and more recently
with desktop publishing software like Aldus PageMaker including versions
of Lorem Ipsum.
</span>
</div>
</div>
</div>
`);
});
it('shows key and value in row', () => {
const { container } = render(<DetailsTable fields={[['key', 'value']]} />);
expect(container).toMatchInlineSnapshot(`
<div>
<div>
<div
class="row"
>
<span
class="key"
>
key
</span>
<span
class="valueText"
>
value
</span>
</div>
</div>
</div>
`);
});
it('shows key and JSON value in row', () => {
const { container } = render(
<DetailsTable fields={[['key', JSON.stringify([{ jsonKey: 'jsonValue' }])]]} />,
);
expect(container).toMatchInlineSnapshot(`
<div>
<div>
<div
class="row"
>
<span
class="key"
>
key
</span>
<pre
data-testid="Editor"
>
[
{
"jsonKey": "jsonValue"
}
]
</pre>
</div>
</div>
</div>
`);
});
it('does render arrays as JSON', () => {
const { container } = render(<DetailsTable fields={[['key', '[]']]} />);
expect(container).toMatchInlineSnapshot(`
<div>
<div>
<div
class="row"
>
<span
class="key"
>
key
</span>
<pre
data-testid="Editor"
>
[]
</pre>
</div>
</div>
</div>
`);
});
it('does render empty object as JSON', () => {
const { container } = render(<DetailsTable fields={[['key', '{}']]} />);
expect(container).toMatchInlineSnapshot(`
<div>
<div>
<div
class="row"
>
<span
class="key"
>
key
</span>
<pre
data-testid="Editor"
>
{}
</pre>
</div>
</div>
</div>
`);
});
it('does not render nulls as JSON', () => {
const { container } = render(<DetailsTable fields={[['key', 'null']]} />);
expect(container).toMatchInlineSnapshot(`
<div>
<div>
<div
class="row"
>
<span
class="key"
>
key
</span>
<span
class="valueText"
>
null
</span>
</div>
</div>
</div>
`);
});
it('does not render numbers as JSON', () => {
const { container } = render(<DetailsTable fields={[['key', '10']]} />);
expect(container).toMatchInlineSnapshot(`
<div>
<div>
<div
class="row"
>
<span
class="key"
>
key
</span>
<span
class="valueText"
>
10
</span>
</div>
</div>
</div>
`);
});
it('does not render strings as JSON', () => {
const { container } = render(<DetailsTable fields={[['key', '"some string"']]} />);
expect(container).toMatchInlineSnapshot(`
<div>
<div>
<div
class="row"
>
<span
class="key"
>
key
</span>
<span
class="valueText"
>
"some string"
</span>
</div>
</div>
</div>
`);
});
it('does not render booleans as JSON', () => {
const { container } = render(
<DetailsTable
fields={[
['key1', 'true'],
['key2', 'false'],
]}
/>,
);
expect(container).toMatchInlineSnapshot(`
<div>
<div>
<div
class="row"
>
<span
class="key"
>
key1
</span>
<span
class="valueText"
>
true
</span>
</div>
<div
class="row"
>
<span
class="key"
>
key2
</span>
<span
class="valueText"
>
false
</span>
</div>
</div>
</div>
`);
});
it('shows keys and values for multiple rows', () => {
const { container } = render(
<DetailsTable
fields={[
['key1', 'value1'],
['key2', JSON.stringify([{ jsonKey: 'jsonValue2' }])],
['key3', 'value3'],
['key4', 'value4'],
['key5', JSON.stringify({ jsonKey: { nestedJsonKey: 'jsonValue' } })],
['key6', 'value6'],
['key6', 'value7'],
['key', { key: 'foobar', bucket: 'bucket', endpoint: 's3.amazonaws.com' }],
]}
/>,
);
expect(container).toMatchInlineSnapshot(`
<div>
<div>
<div
class="row"
>
<span
class="key"
>
key1
</span>
<span
class="valueText"
>
value1
</span>
</div>
<div
class="row"
>
<span
class="key"
>
key2
</span>
<pre
data-testid="Editor"
>
[
{
"jsonKey": "jsonValue2"
}
]
</pre>
</div>
<div
class="row"
>
<span
class="key"
>
key3
</span>
<span
class="valueText"
>
value3
</span>
</div>
<div
class="row"
>
<span
class="key"
>
key4
</span>
<span
class="valueText"
>
value4
</span>
</div>
<div
class="row"
>
<span
class="key"
>
key5
</span>
<pre
data-testid="Editor"
>
{
"jsonKey": {
"nestedJsonKey": "jsonValue"
}
}
</pre>
</div>
<div
class="row"
>
<span
class="key"
>
key6
</span>
<span
class="valueText"
>
value6
</span>
</div>
<div
class="row"
>
<span
class="key"
>
key6
</span>
<span
class="valueText"
>
value7
</span>
</div>
<div
class="row"
>
<span
class="key"
>
key
</span>
<span
class="valueText"
>
[object Object]
</span>
</div>
</div>
</div>
`);
});
it('does render values with the provided valueComponent', () => {
const ValueComponent: React.FC<any> = ({ value, ...rest }) => (
<a data-testid='value-component' {...rest}>
{JSON.stringify(value)}
</a>
);
const { getByTestId } = render(
<DetailsTable
fields={[['key2', { key: 'foobar', bucket: 'bucket', endpoint: 's3.amazonaws.com' }]]}
valueComponent={ValueComponent}
valueComponentProps={{ extraprop: 'extra' }}
/>,
);
expect(getByTestId('value-component')).toMatchInlineSnapshot(`
<a
data-testid="value-component"
extraprop="extra"
>
{"key":"foobar","bucket":"bucket","endpoint":"s3.amazonaws.com"}
</a>
`);
});
});
| 7,917 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/Trigger.test.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import Trigger from './Trigger';
import { shallow } from 'enzyme';
import { TriggerType, PeriodicInterval } from '../lib/TriggerUtils';
const PARAMS_DEFAULT = {
catchup: true,
maxConcurrentRuns: '10',
};
const PERIODIC_DEFAULT = {
end_time: undefined,
interval_second: '60',
start_time: undefined,
};
const CRON_DEFAULT = { cron: '0 * * * * ?', end_time: undefined, start_time: undefined };
describe('Trigger', () => {
// tslint:disable-next-line:variable-name
const RealDate = Date;
function mockDate(isoDate: any): void {
(global as any).Date = class extends RealDate {
constructor() {
super();
return new RealDate(isoDate);
}
};
}
const testDate = new Date(2018, 11, 21, 7, 53);
mockDate(testDate);
it('renders periodic schedule controls for initial render', () => {
const tree = shallow(<Trigger />);
expect(tree).toMatchSnapshot();
});
it('renders periodic schedule controls if the trigger type is CRON', () => {
const tree = shallow(<Trigger />);
(tree.instance() as Trigger).handleChange('type')({ target: { value: TriggerType.CRON } });
expect(tree).toMatchSnapshot();
});
it('renders week days if the trigger type is CRON and interval is weekly', () => {
const tree = shallow(<Trigger />);
(tree.instance() as Trigger).handleChange('type')({ target: { value: TriggerType.CRON } });
(tree.instance() as Trigger).handleChange('intervalCategory')({
target: { value: PeriodicInterval.WEEK },
});
expect(tree).toMatchSnapshot();
});
it('renders all week days enabled', () => {
const tree = shallow(<Trigger />);
(tree.instance() as Trigger).handleChange('type')({ target: { value: TriggerType.CRON } });
(tree.instance() as Trigger).handleChange('intervalCategory')({
target: { value: PeriodicInterval.WEEK },
});
(tree.instance() as any)._toggleCheckAllDays();
expect(tree).toMatchSnapshot();
});
it('enables a single day on click', () => {
const tree = shallow(<Trigger />);
(tree.instance() as Trigger).handleChange('type')({ target: { value: TriggerType.CRON } });
(tree.instance() as Trigger).handleChange('intervalCategory')({
target: { value: PeriodicInterval.WEEK },
});
(tree.instance() as any)._toggleDay(1);
(tree.instance() as any)._toggleDay(3);
expect(tree).toMatchSnapshot();
});
describe('interval trigger', () => {
it('builds an every-minute trigger by default', () => {
const spy = jest.fn();
const tree = shallow(<Trigger onChange={spy} />);
(tree.instance() as Trigger).handleChange('type')({
target: { value: TriggerType.INTERVALED },
});
expect(spy).toHaveBeenLastCalledWith({
...PARAMS_DEFAULT,
trigger: {
periodic_schedule: PERIODIC_DEFAULT,
},
});
});
it('builds trigger with a start time if the checkbox is checked', () => {
const spy = jest.fn();
const tree = shallow(<Trigger onChange={spy} />);
(tree.instance() as Trigger).handleChange('type')({
target: { value: TriggerType.INTERVALED },
});
(tree.instance() as Trigger).handleChange('hasStartDate')({
target: { type: 'checkbox', checked: true },
});
expect(spy).toHaveBeenLastCalledWith({
...PARAMS_DEFAULT,
trigger: {
periodic_schedule: { ...PERIODIC_DEFAULT, start_time: testDate },
},
});
});
it('builds trigger with the entered start date/time', () => {
const spy = jest.fn();
const tree = shallow(<Trigger onChange={spy} />);
(tree.instance() as Trigger).handleChange('type')({
target: { value: TriggerType.INTERVALED },
});
(tree.instance() as Trigger).handleChange('hasStartDate')({
target: { type: 'checkbox', checked: true },
});
(tree.instance() as Trigger).handleChange('startDate')({ target: { value: '2018-11-23' } });
(tree.instance() as Trigger).handleChange('endTime')({ target: { value: '08:35' } });
expect(spy).toHaveBeenLastCalledWith({
...PARAMS_DEFAULT,
trigger: {
periodic_schedule: {
...PERIODIC_DEFAULT,
start_time: new Date(2018, 10, 23, 8, 35),
},
},
});
});
it('builds trigger without the entered start date if no time is entered', () => {
const spy = jest.fn();
const tree = shallow(<Trigger onChange={spy} />);
(tree.instance() as Trigger).handleChange('type')({
target: { value: TriggerType.INTERVALED },
});
(tree.instance() as Trigger).handleChange('hasStartDate')({
target: { type: 'checkbox', checked: true },
});
(tree.instance() as Trigger).handleChange('startDate')({ target: { value: '2018-11-23' } });
(tree.instance() as Trigger).handleChange('startTime')({ target: { value: '' } });
expect(spy).toHaveBeenLastCalledWith({
...PARAMS_DEFAULT,
trigger: {
periodic_schedule: PERIODIC_DEFAULT,
},
});
});
it('builds trigger without the entered start time if no date is entered', () => {
const spy = jest.fn();
const tree = shallow(<Trigger onChange={spy} />);
(tree.instance() as Trigger).handleChange('type')({
target: { value: TriggerType.INTERVALED },
});
(tree.instance() as Trigger).handleChange('hasStartDate')({
target: { type: 'checkbox', checked: true },
});
(tree.instance() as Trigger).handleChange('startDate')({ target: { value: '' } });
(tree.instance() as Trigger).handleChange('startTime')({ target: { value: '11:33' } });
expect(spy).toHaveBeenLastCalledWith({
...PARAMS_DEFAULT,
trigger: {
periodic_schedule: PERIODIC_DEFAULT,
},
});
});
it('builds trigger with a date if both start and end checkboxes are checked', () => {
const spy = jest.fn();
const tree = shallow(<Trigger onChange={spy} />);
(tree.instance() as Trigger).handleChange('type')({
target: { value: TriggerType.INTERVALED },
});
(tree.instance() as Trigger).handleChange('hasStartDate')({
target: { type: 'checkbox', checked: true },
});
(tree.instance() as Trigger).handleChange('hasEndDate')({
target: { type: 'checkbox', checked: true },
});
expect(spy).toHaveBeenLastCalledWith({
...PARAMS_DEFAULT,
trigger: {
periodic_schedule: { ...PERIODIC_DEFAULT, end_time: testDate, start_time: testDate },
},
});
});
it('resets trigger to no start date if it is added then removed', () => {
const spy = jest.fn();
const tree = shallow(<Trigger onChange={spy} />);
(tree.instance() as Trigger).handleChange('type')({
target: { value: TriggerType.INTERVALED },
});
(tree.instance() as Trigger).handleChange('hasStartDate')({
target: { type: 'checkbox', checked: true },
});
(tree.instance() as Trigger).handleChange('hasStartDate')({
target: { type: 'checkbox', checked: false },
});
expect(spy).toHaveBeenLastCalledWith({
...PARAMS_DEFAULT,
trigger: {
periodic_schedule: PERIODIC_DEFAULT,
},
});
});
it('builds trigger with a weekly interval', () => {
const spy = jest.fn();
const tree = shallow(<Trigger onChange={spy} />);
(tree.instance() as Trigger).handleChange('type')({
target: { value: TriggerType.INTERVALED },
});
(tree.instance() as Trigger).handleChange('intervalCategory')({
target: { value: PeriodicInterval.WEEK },
});
expect(spy).toHaveBeenLastCalledWith({
...PARAMS_DEFAULT,
trigger: {
periodic_schedule: {
...PERIODIC_DEFAULT,
interval_second: (7 * 24 * 60 * 60).toString(),
},
},
});
});
it('builds trigger with an every-three-months interval', () => {
const spy = jest.fn();
const tree = shallow(<Trigger onChange={spy} />);
(tree.instance() as Trigger).handleChange('type')({
target: { value: TriggerType.INTERVALED },
});
(tree.instance() as Trigger).handleChange('intervalCategory')({
target: { value: PeriodicInterval.MONTH },
});
(tree.instance() as Trigger).handleChange('intervalValue')({ target: { value: 3 } });
expect(spy).toHaveBeenLastCalledWith({
...PARAMS_DEFAULT,
trigger: {
periodic_schedule: {
...PERIODIC_DEFAULT,
interval_second: (3 * 30 * 24 * 60 * 60).toString(),
},
},
});
});
it('builds trigger with the specified max concurrency setting', () => {
const spy = jest.fn();
const tree = shallow(<Trigger onChange={spy} />);
(tree.instance() as Trigger).handleChange('type')({
target: { value: TriggerType.INTERVALED },
});
(tree.instance() as Trigger).handleChange('maxConcurrentRuns')({ target: { value: '3' } });
expect(spy).toHaveBeenLastCalledWith({
...PARAMS_DEFAULT,
maxConcurrentRuns: '3',
trigger: {
periodic_schedule: PERIODIC_DEFAULT,
},
});
});
it('builds trigger with the specified catchup setting', () => {
const spy = jest.fn();
const tree = shallow(<Trigger onChange={spy} />);
(tree.instance() as Trigger).handleChange('type')({
target: { value: TriggerType.INTERVALED },
});
(tree.instance() as Trigger).handleChange('catchup')({
target: { type: 'checkbox', checked: false },
});
expect(spy).toHaveBeenLastCalledWith({
...PARAMS_DEFAULT,
catchup: false,
trigger: {
periodic_schedule: PERIODIC_DEFAULT,
},
});
});
});
describe('cron', () => {
it('builds a 1-minute cron trigger by default', () => {
const spy = jest.fn();
const tree = shallow(<Trigger onChange={spy} />);
(tree.instance() as Trigger).handleChange('type')({ target: { value: TriggerType.CRON } });
expect(spy).toHaveBeenLastCalledWith({
...PARAMS_DEFAULT,
trigger: {
cron_schedule: CRON_DEFAULT,
},
});
});
it('builds a 1-minute cron trigger with specified start date', () => {
const spy = jest.fn();
const tree = shallow(<Trigger onChange={spy} />);
(tree.instance() as Trigger).handleChange('type')({ target: { value: TriggerType.CRON } });
(tree.instance() as Trigger).handleChange('hasStartDate')({
target: { type: 'checkbox', checked: true },
});
(tree.instance() as Trigger).handleChange('startDate')({ target: { value: '2018-03-23' } });
expect(spy).toHaveBeenLastCalledWith({
...PARAMS_DEFAULT,
trigger: {
cron_schedule: { ...CRON_DEFAULT, start_time: testDate },
},
});
});
it('builds a daily cron trigger with specified end date/time', () => {
const spy = jest.fn();
const tree = shallow(<Trigger onChange={spy} />);
(tree.instance() as Trigger).handleChange('type')({ target: { value: TriggerType.CRON } });
(tree.instance() as Trigger).handleChange('hasEndDate')({
target: { type: 'checkbox', checked: true },
});
(tree.instance() as Trigger).handleChange('intervalCategory')({
target: { value: PeriodicInterval.DAY },
});
expect(spy).toHaveBeenLastCalledWith({
...PARAMS_DEFAULT,
trigger: {
cron_schedule: { ...CRON_DEFAULT, end_time: testDate, cron: '0 0 0 * * ?' },
},
});
});
it('builds a weekly cron trigger that runs every Monday, Friday, and Saturday', () => {
const spy = jest.fn();
const tree = shallow(<Trigger onChange={spy} />);
(tree.instance() as Trigger).handleChange('type')({ target: { value: TriggerType.CRON } });
(tree.instance() as Trigger).handleChange('intervalCategory')({
target: { value: PeriodicInterval.WEEK },
});
(tree.instance() as any)._toggleCheckAllDays();
(tree.instance() as any)._toggleDay(1);
(tree.instance() as any)._toggleDay(5);
(tree.instance() as any)._toggleDay(6);
expect(spy).toHaveBeenLastCalledWith({
...PARAMS_DEFAULT,
trigger: {
cron_schedule: { ...CRON_DEFAULT, cron: '0 0 0 ? * 1,5,6' },
},
});
});
it('builds a cron with the manually specified cron string, even if days are toggled', () => {
const spy = jest.fn();
const tree = shallow(<Trigger onChange={spy} />);
(tree.instance() as Trigger).handleChange('type')({ target: { value: TriggerType.CRON } });
(tree.instance() as Trigger).handleChange('intervalCategory')({
target: { value: PeriodicInterval.WEEK },
});
(tree.instance() as any)._toggleCheckAllDays();
(tree.instance() as any)._toggleDay(1);
(tree.instance() as any)._toggleDay(5);
(tree.instance() as any)._toggleDay(6);
(tree.instance() as Trigger).handleChange('editCron')({
target: { type: 'checkbox', checked: true },
});
(tree.instance() as Trigger).handleChange('cron')({
target: { value: 'oops this will break!' },
});
expect(spy).toHaveBeenLastCalledWith({
...PARAMS_DEFAULT,
trigger: {
cron_schedule: { ...CRON_DEFAULT, cron: 'oops this will break!' },
},
});
});
});
});
| 7,918 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/SideNav.test.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { mount, ReactWrapper, shallow, ShallowWrapper } from 'enzyme';
import * as React from 'react';
import { MemoryRouter, RouterProps } from 'react-router';
import { GkeMetadataProvider } from 'src/lib/GkeMetadata';
import { Apis } from '../lib/Apis';
import { LocalStorage } from '../lib/LocalStorage';
import TestUtils, { diffHTML } from '../TestUtils';
import { RoutePage } from './Router';
import EnhancedSideNav, { css, SideNav } from './SideNav';
const wideWidth = 1000;
const narrowWidth = 200;
const isCollapsed = (tree: ShallowWrapper<any>) =>
tree.find('WithStyles(IconButton)').hasClass(css.collapsedChevron);
const routerProps: RouterProps = { history: {} as any };
const defaultProps = { ...routerProps, gkeMetadata: {} };
describe('SideNav', () => {
let tree: ReactWrapper | ShallowWrapper;
const consoleErrorSpy = jest.spyOn(console, 'error');
const buildInfoSpy = jest.spyOn(Apis, 'getBuildInfo');
const checkHubSpy = jest.spyOn(Apis, 'isJupyterHubAvailable');
const clusterNameSpy = jest.spyOn(Apis, 'getClusterName');
const projectIdSpy = jest.spyOn(Apis, 'getProjectId');
const localStorageHasKeySpy = jest.spyOn(LocalStorage, 'hasKey');
const localStorageIsCollapsedSpy = jest.spyOn(LocalStorage, 'isNavbarCollapsed');
beforeEach(() => {
jest.clearAllMocks();
consoleErrorSpy.mockImplementation(() => null);
buildInfoSpy.mockImplementation(() => ({
apiServerCommitHash: 'd3c4add0a95e930c70a330466d0923827784eb9a',
apiServerReady: true,
buildDate: 'Wed Jan 9 19:40:24 UTC 2019',
frontendCommitHash: '8efb2fcff9f666ba5b101647e909dc9c6889cecb',
}));
checkHubSpy.mockImplementation(() => ({ ok: true }));
clusterNameSpy.mockImplementation(() => Promise.reject('Error when fetching cluster name'));
projectIdSpy.mockImplementation(() => Promise.reject('Error when fetching project ID'));
localStorageHasKeySpy.mockImplementation(() => false);
localStorageIsCollapsedSpy.mockImplementation(() => false);
});
afterEach(async () => {
// unmount() should be called before resetAllMocks() in case any part of the unmount life cycle
// depends on mocks/spies
await tree.unmount();
jest.resetAllMocks();
(window as any).innerWidth = wideWidth;
});
it('renders expanded state', () => {
localStorageHasKeySpy.mockImplementationOnce(() => false);
(window as any).innerWidth = wideWidth;
tree = shallow(<SideNav page={RoutePage.PIPELINES} {...defaultProps} />);
expect(tree).toMatchSnapshot();
});
it('renders collapsed state', () => {
localStorageHasKeySpy.mockImplementationOnce(() => false);
(window as any).innerWidth = narrowWidth;
tree = shallow(<SideNav page={RoutePage.PIPELINES} {...defaultProps} />);
expect(tree).toMatchSnapshot();
});
it('renders Pipelines as active page', () => {
tree = shallow(<SideNav page={RoutePage.PIPELINES} {...defaultProps} />);
expect(tree).toMatchSnapshot();
});
it('renders Pipelines as active when on PipelineDetails page', () => {
tree = shallow(<SideNav page={RoutePage.PIPELINE_DETAILS} {...defaultProps} />);
expect(tree).toMatchSnapshot();
});
it('renders experiments as active page', () => {
tree = shallow(<SideNav page={RoutePage.EXPERIMENTS} {...defaultProps} />);
expect(tree).toMatchSnapshot();
});
it('renders experiments as active when on ExperimentDetails page', () => {
tree = shallow(<SideNav page={RoutePage.EXPERIMENT_DETAILS} {...defaultProps} />);
expect(tree).toMatchSnapshot();
});
it('renders experiments as active page when on NewExperiment page', () => {
tree = shallow(<SideNav page={RoutePage.NEW_EXPERIMENT} {...defaultProps} />);
expect(tree).toMatchSnapshot();
});
it('renders experiments as active page when on Compare page', () => {
tree = shallow(<SideNav page={RoutePage.COMPARE} {...defaultProps} />);
expect(tree).toMatchSnapshot();
});
it('renders experiments as active page when on AllRuns page', () => {
tree = shallow(<SideNav page={RoutePage.RUNS} {...defaultProps} />);
expect(tree).toMatchSnapshot();
});
it('renders experiments as active page when on RunDetails page', () => {
tree = shallow(<SideNav page={RoutePage.RUN_DETAILS} {...defaultProps} />);
expect(tree).toMatchSnapshot();
});
it('renders experiments as active page when on RecurringRunDetails page', () => {
tree = shallow(<SideNav page={RoutePage.RECURRING_RUN} {...defaultProps} />);
expect(tree).toMatchSnapshot();
});
it('renders experiments as active page when on NewRun page', () => {
tree = shallow(<SideNav page={RoutePage.NEW_RUN} {...defaultProps} />);
expect(tree).toMatchSnapshot();
});
it('show jupyterhub link if accessible', () => {
tree = shallow(<SideNav page={RoutePage.COMPARE} {...defaultProps} />);
tree.setState({ jupyterHubAvailable: true });
expect(tree).toMatchSnapshot();
});
it('collapses if collapse state is true localStorage', () => {
localStorageIsCollapsedSpy.mockImplementationOnce(() => true);
localStorageHasKeySpy.mockImplementationOnce(() => true);
(window as any).innerWidth = wideWidth;
tree = shallow(<SideNav page={RoutePage.COMPARE} {...defaultProps} />);
expect(isCollapsed(tree)).toBe(true);
});
it('expands if collapse state is false in localStorage', () => {
localStorageIsCollapsedSpy.mockImplementationOnce(() => false);
localStorageHasKeySpy.mockImplementationOnce(() => true);
tree = shallow(<SideNav page={RoutePage.COMPARE} {...defaultProps} />);
expect(isCollapsed(tree)).toBe(false);
});
it('collapses if no collapse state in localStorage, and window is too narrow', () => {
localStorageIsCollapsedSpy.mockImplementationOnce(() => false);
localStorageHasKeySpy.mockImplementationOnce(() => false);
(window as any).innerWidth = narrowWidth;
tree = shallow(<SideNav page={RoutePage.COMPARE} {...defaultProps} />);
expect(isCollapsed(tree)).toBe(true);
});
it('expands if no collapse state in localStorage, and window is wide', () => {
localStorageIsCollapsedSpy.mockImplementationOnce(() => false);
localStorageHasKeySpy.mockImplementationOnce(() => false);
(window as any).innerWidth = wideWidth;
tree = shallow(<SideNav page={RoutePage.COMPARE} {...defaultProps} />);
expect(isCollapsed(tree)).toBe(false);
});
it('collapses if no collapse state in localStorage, and window goes from wide to narrow', () => {
localStorageIsCollapsedSpy.mockImplementationOnce(() => false);
localStorageHasKeySpy.mockImplementationOnce(() => false);
(window as any).innerWidth = wideWidth;
tree = shallow(<SideNav page={RoutePage.COMPARE} {...defaultProps} />);
expect(isCollapsed(tree)).toBe(false);
(window as any).innerWidth = narrowWidth;
const resizeEvent = new Event('resize');
window.dispatchEvent(resizeEvent);
expect(isCollapsed(tree)).toBe(true);
});
it('expands if no collapse state in localStorage, and window goes from narrow to wide', () => {
localStorageIsCollapsedSpy.mockImplementationOnce(() => false);
localStorageHasKeySpy.mockImplementationOnce(() => false);
(window as any).innerWidth = narrowWidth;
tree = shallow(<SideNav page={RoutePage.COMPARE} {...defaultProps} />);
expect(isCollapsed(tree)).toBe(true);
(window as any).innerWidth = wideWidth;
const resizeEvent = new Event('resize');
window.dispatchEvent(resizeEvent);
expect(isCollapsed(tree)).toBe(false);
});
it('saves state in localStorage if chevron is clicked', () => {
localStorageIsCollapsedSpy.mockImplementationOnce(() => false);
localStorageHasKeySpy.mockImplementationOnce(() => false);
const spy = jest.spyOn(LocalStorage, 'saveNavbarCollapsed');
(window as any).innerWidth = narrowWidth;
tree = shallow(<SideNav page={RoutePage.COMPARE} {...defaultProps} />);
expect(isCollapsed(tree)).toBe(true);
tree.find('WithStyles(IconButton)').simulate('click');
expect(spy).toHaveBeenCalledWith(false);
});
it('does not collapse if collapse state is saved in localStorage, and window resizes', () => {
localStorageIsCollapsedSpy.mockImplementationOnce(() => false);
localStorageHasKeySpy.mockImplementationOnce(() => true);
(window as any).innerWidth = wideWidth;
tree = shallow(<SideNav page={RoutePage.COMPARE} {...defaultProps} />);
expect(isCollapsed(tree)).toBe(false);
(window as any).innerWidth = narrowWidth;
const resizeEvent = new Event('resize');
window.dispatchEvent(resizeEvent);
expect(isCollapsed(tree)).toBe(false);
});
it('populates the display build information using the response from the healthz endpoint', async () => {
const buildInfo = {
apiServerCommitHash: '0a7b9e38f2b9bcdef4bbf3234d971e1635b50cd5',
apiServerTagName: '1.0.0',
apiServerReady: true,
buildDate: 'Tue Oct 23 14:23:53 UTC 2018',
frontendCommitHash: '302e93ce99099173f387c7e0635476fe1b69ea98',
frontendTagName: '1.0.0-rc1',
};
buildInfoSpy.mockImplementationOnce(() => buildInfo);
tree = shallow(<SideNav page={RoutePage.PIPELINES} {...defaultProps} />);
await TestUtils.flushPromises();
expect(tree).toMatchSnapshot();
expect(tree.state('displayBuildInfo')).toEqual({
tagName: buildInfo.apiServerTagName,
commitHash: buildInfo.apiServerCommitHash.substring(0, 7),
commitUrl:
'https://www.github.com/kubeflow/pipelines/commit/' + buildInfo.apiServerCommitHash,
date: new Date(buildInfo.buildDate).toLocaleDateString(),
});
});
it('populates the cluster information from context', async () => {
const clusterName = 'some-cluster-name';
const projectId = 'some-project-id';
clusterNameSpy.mockImplementationOnce(() => Promise.resolve(clusterName));
projectIdSpy.mockImplementationOnce(() => Promise.resolve(projectId));
buildInfoSpy.mockImplementationOnce(() => Promise.reject('Error when fetching build info'));
tree = mount(
<GkeMetadataProvider>
<MemoryRouter>
<EnhancedSideNav page={RoutePage.PIPELINES} {...routerProps} />
</MemoryRouter>
</GkeMetadataProvider>,
);
const base = tree.html();
await TestUtils.flushPromises();
expect(
diffHTML({
base,
baseAnnotation: 'base',
update: tree.html(),
updateAnnotation: 'after GKE metadata loaded',
}),
).toMatchInlineSnapshot(`
Snapshot Diff:
- base
+ after GKE metadata loaded
@@ --- --- @@
<path fill="none" d="M0 0h24v24H0z"></path></svg></span
><span class="MuiTouchRipple-root-53"></span>
</button>
</div>
<div class="infoVisible">
+ <div
+ class="envMetadata"
+ title="Cluster name: some-cluster-name, Project ID: some-project-id"
+ >
+ <span>Cluster name: </span
+ ><a
+ href="https://console.cloud.google.com/kubernetes/list?project=some-project-id&filter=name:some-cluster-name"
+ class="link unstyled"
+ rel="noopener"
+ target="_blank"
+ >some-cluster-name</a
+ >
+ </div>
<div class="envMetadata" title="Report an Issue">
<a
href="https://github.com/kubeflow/pipelines/issues/new?template=BUG_REPORT.md"
class="link unstyled"
rel="noopener"
`);
});
it('displays the frontend tag name if the api server hash is not returned', async () => {
const buildInfo = {
apiServerReady: true,
// No apiServerCommitHash or apiServerTagName
buildDate: 'Tue Oct 23 14:23:53 UTC 2018',
frontendCommitHash: '302e93ce99099173f387c7e0635476fe1b69ea98',
frontendTagName: '1.0.0',
};
buildInfoSpy.mockImplementationOnce(() => buildInfo);
tree = shallow(<SideNav page={RoutePage.PIPELINES} {...defaultProps} />);
await TestUtils.flushPromises();
expect(tree.state('displayBuildInfo')).toEqual(
expect.objectContaining({
commitHash: buildInfo.frontendCommitHash.substring(0, 7),
tagName: buildInfo.frontendTagName,
}),
);
});
it('uses the frontend commit hash for the link URL if the api server hash is not returned', async () => {
const buildInfo = {
apiServerReady: true,
// No apiServerCommitHash
buildDate: 'Tue Oct 23 14:23:53 UTC 2018',
frontendCommitHash: '302e93ce99099173f387c7e0635476fe1b69ea98',
};
buildInfoSpy.mockImplementationOnce(() => buildInfo);
tree = shallow(<SideNav page={RoutePage.PIPELINES} {...defaultProps} />);
await TestUtils.flushPromises();
expect(tree.state('displayBuildInfo')).toEqual(
expect.objectContaining({
commitUrl:
'https://www.github.com/kubeflow/pipelines/commit/' + buildInfo.frontendCommitHash,
}),
);
});
it("displays 'unknown' if the frontend and api server tag names/commit hashes are not returned", async () => {
const buildInfo = {
apiServerReady: true,
// No apiServerCommitHash
buildDate: 'Tue Oct 23 14:23:53 UTC 2018',
// No frontendCommitHash
};
buildInfoSpy.mockImplementationOnce(() => buildInfo);
tree = shallow(<SideNav page={RoutePage.PIPELINES} {...defaultProps} />);
await TestUtils.flushPromises();
expect(tree.state('displayBuildInfo')).toEqual(
expect.objectContaining({
commitHash: 'unknown',
tagName: 'unknown',
}),
);
});
it('links to the github repo root if the frontend and api server commit hashes are not returned', async () => {
const buildInfo = {
apiServerReady: true,
// No apiServerCommitHash
buildDate: 'Tue Oct 23 14:23:53 UTC 2018',
// No frontendCommitHash
};
buildInfoSpy.mockImplementationOnce(() => buildInfo);
tree = shallow(<SideNav page={RoutePage.PIPELINES} {...defaultProps} />);
await TestUtils.flushPromises();
expect(tree.state('displayBuildInfo')).toEqual(
expect.objectContaining({
commitUrl: 'https://www.github.com/kubeflow/pipelines',
}),
);
});
it("displays 'unknown' if the date is not returned", async () => {
const buildInfo = {
apiServerCommitHash: '0a7b9e38f2b9bcdef4bbf3234d971e1635b50cd5',
apiServerReady: true,
// No buildDate
frontendCommitHash: '302e93ce99099173f387c7e0635476fe1b69ea98',
};
buildInfoSpy.mockImplementationOnce(() => buildInfo);
tree = shallow(<SideNav page={RoutePage.PIPELINES} {...defaultProps} />);
await TestUtils.flushPromises();
expect(tree.state('displayBuildInfo')).toEqual(
expect.objectContaining({
date: 'unknown',
}),
);
});
it('logs an error if the call getBuildInfo fails', async () => {
TestUtils.makeErrorResponseOnce(buildInfoSpy, 'Uh oh!');
tree = shallow(<SideNav page={RoutePage.PIPELINES} {...defaultProps} />);
await TestUtils.flushPromises();
expect(tree.state('displayBuildInfo')).toBeUndefined();
expect(consoleErrorSpy.mock.calls[0][0]).toBe('Failed to retrieve build info');
});
});
| 7,919 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/MinioArtifactPreview.test.tsx | /*
* Copyright 2019-2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import MinioArtifactPreview from './MinioArtifactPreview';
import React from 'react';
import TestUtils from '../TestUtils';
import { act, render } from '@testing-library/react';
import { Apis } from '../lib/Apis';
describe('MinioArtifactPreview', () => {
const readFile = jest.spyOn(Apis, 'readFile');
beforeEach(() => {
readFile.mockResolvedValue('preview ...');
});
afterEach(() => {
jest.resetAllMocks();
});
it('handles undefined artifact', () => {
const { container } = render(<MinioArtifactPreview value={undefined} />);
expect(container).toMatchInlineSnapshot(`<div />`);
});
it('handles null artifact', () => {
const { container } = render(<MinioArtifactPreview value={null as any} />);
expect(container).toMatchInlineSnapshot(`<div />`);
});
it('handles empty artifact', () => {
const { container } = render(<MinioArtifactPreview value={{} as any} />);
expect(container).toMatchInlineSnapshot(`<div />`);
});
it('handles invalid artifact: no bucket', () => {
const s3Artifact = {
accessKeySecret: { key: 'accesskey', optional: false, name: 'minio' },
bucket: '',
endpoint: 'minio.kubeflow',
key: 'bar',
secretKeySecret: { key: 'secretkey', optional: false, name: 'minio' },
};
const { container } = render(<MinioArtifactPreview value={s3Artifact} />);
expect(container).toMatchInlineSnapshot(`<div />`);
});
it('handles invalid artifact: no key', () => {
const s3Artifact = {
accessKeySecret: { key: 'accesskey', optional: false, name: 'minio' },
bucket: 'foo',
endpoint: 'minio.kubeflow',
key: '',
secretKeySecret: { key: 'secretkey', optional: false, name: 'minio' },
};
const { container } = render(<MinioArtifactPreview value={s3Artifact} />);
expect(container).toMatchInlineSnapshot(`<div />`);
});
it('handles string value', () => {
const { container } = render(<MinioArtifactPreview value='teststring' />);
expect(container).toMatchInlineSnapshot(`
<div>
teststring
</div>
`);
});
it('handles boolean value', () => {
const { container } = render(<MinioArtifactPreview value={false as any} />);
expect(container).toMatchInlineSnapshot(`
<div>
false
</div>
`);
});
it('handles s3 artifact', async () => {
const s3Artifact = {
accessKeySecret: { key: 'accesskey', optional: false, name: 'minio' },
bucket: 'foo',
endpoint: 's3.amazonaws.com',
key: 'bar',
secretKeySecret: { key: 'secretkey', optional: false, name: 'minio' },
};
const { container } = render(<MinioArtifactPreview value={s3Artifact} />);
await act(TestUtils.flushPromises);
expect(container).toMatchInlineSnapshot(`
<div>
<div
class="root"
>
<a
class="link"
href="artifacts/get?source=s3&bucket=foo&key=bar"
rel="noopener"
target="_blank"
title="s3://foo/bar"
>
s3://foo/bar
</a>
<div
class="preview"
>
<small>
<pre>
preview ...
</pre>
</small>
</div>
</div>
</div>
`);
});
it('handles minio artifact', async () => {
const minioArtifact = {
accessKeySecret: { key: 'accesskey', optional: false, name: 'minio' },
bucket: 'foo',
endpoint: 'minio.kubeflow',
key: 'bar',
secretKeySecret: { key: 'secretkey', optional: false, name: 'minio' },
};
const container = document.body.appendChild(document.createElement('div'));
await act(async () => {
render(<MinioArtifactPreview value={minioArtifact} />, { container });
});
expect(container).toMatchInlineSnapshot(`
<div>
<div
class="root"
>
<a
class="link"
href="artifacts/get?source=minio&bucket=foo&key=bar"
rel="noopener"
target="_blank"
title="minio://foo/bar"
>
minio://foo/bar
</a>
<div
class="preview"
>
<small>
<pre>
preview ...
</pre>
</small>
</div>
</div>
</div>
`);
});
it('handles artifact with namespace', async () => {
const minioArtifact = {
accessKeySecret: { key: 'accesskey', optional: false, name: 'minio' },
bucket: 'foo',
endpoint: 'minio.kubeflow',
key: 'bar',
secretKeySecret: { key: 'secretkey', optional: false, name: 'minio' },
};
const { container } = render(
<MinioArtifactPreview value={minioArtifact} namespace='namespace' />,
);
await act(TestUtils.flushPromises);
expect(container).toMatchInlineSnapshot(`
<div>
<div
class="root"
>
<a
class="link"
href="artifacts/get?source=minio&namespace=namespace&bucket=foo&key=bar"
rel="noopener"
target="_blank"
title="minio://foo/bar"
>
minio://foo/bar
</a>
<div
class="preview"
>
<small>
<pre>
preview ...
</pre>
</small>
</div>
</div>
</div>
`);
});
it('handles artifact cleanly even when fetch fails', async () => {
const minioArtifact = {
accessKeySecret: { key: 'accesskey', optional: false, name: 'minio' },
bucket: 'foo',
endpoint: 'minio.kubeflow',
key: 'bar',
secretKeySecret: { key: 'secretkey', optional: false, name: 'minio' },
};
readFile.mockRejectedValue('unknown error');
const { container } = render(<MinioArtifactPreview value={minioArtifact} />);
await act(TestUtils.flushPromises);
expect(container).toMatchInlineSnapshot(`
<div>
<div
class="root"
>
<a
class="link"
href="artifacts/get?source=minio&bucket=foo&key=bar"
rel="noopener"
target="_blank"
title="minio://foo/bar"
>
minio://foo/bar
</a>
</div>
</div>
`);
});
it('handles artifact that previews fully', async () => {
const minioArtifact = {
accessKeySecret: { key: 'accesskey', optional: false, name: 'minio' },
bucket: 'foo',
endpoint: 'minio.kubeflow',
key: 'bar',
secretKeySecret: { key: 'secretkey', optional: false, name: 'minio' },
};
const data = `012\n345\n678\n910`;
readFile.mockResolvedValue(data);
const { container } = render(
<MinioArtifactPreview value={minioArtifact} maxbytes={data.length} />,
);
await act(TestUtils.flushPromises);
expect(container).toMatchInlineSnapshot(`
<div>
<div
class="root"
>
<a
class="link"
href="artifacts/get?source=minio&bucket=foo&key=bar"
rel="noopener"
target="_blank"
title="minio://foo/bar"
>
minio://foo/bar
</a>
<div
class="preview"
>
<small>
<pre>
012
345
678
910
</pre>
</small>
</div>
</div>
</div>
`);
});
it('handles artifact that previews with maxlines', async () => {
const minioArtifact = {
accessKeySecret: { key: 'accesskey', optional: false, name: 'minio' },
bucket: 'foo',
endpoint: 'minio.kubeflow',
key: 'bar',
secretKeySecret: { key: 'secretkey', optional: false, name: 'minio' },
};
const data = `012\n345\n678\n910`;
readFile.mockResolvedValue(data);
const { container } = render(
<MinioArtifactPreview value={minioArtifact} maxbytes={data.length} maxlines={2} />,
);
await act(TestUtils.flushPromises);
expect(container).toMatchInlineSnapshot(`
<div>
<div
class="root"
>
<a
class="link"
href="artifacts/get?source=minio&bucket=foo&key=bar"
rel="noopener"
target="_blank"
title="minio://foo/bar"
>
minio://foo/bar
</a>
<div
class="preview"
>
<small>
<pre>
012
345
...
</pre>
</small>
</div>
</div>
</div>
`);
});
it('handles artifact that previews with maxbytes', async () => {
const minioArtifact = {
accessKeySecret: { key: 'accesskey', optional: false, name: 'minio' },
bucket: 'foo',
endpoint: 'minio.kubeflow',
key: 'bar',
secretKeySecret: { key: 'secretkey', optional: false, name: 'minio' },
};
const data = `012\n345\n678\n910`;
readFile.mockResolvedValue(data);
const { container } = render(
<MinioArtifactPreview value={minioArtifact} maxbytes={data.length - 5} />,
);
await act(TestUtils.flushPromises);
expect(container).toMatchInlineSnapshot(`
<div>
<div
class="root"
>
<a
class="link"
href="artifacts/get?source=minio&bucket=foo&key=bar"
rel="noopener"
target="_blank"
title="minio://foo/bar"
>
minio://foo/bar
</a>
<div
class="preview"
>
<small>
<pre>
012
345
67
...
</pre>
</small>
</div>
</div>
</div>
`);
});
});
| 7,920 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/SidePanel.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import Button from '@material-ui/core/Button';
import CircularProgress from '@material-ui/core/CircularProgress';
import CloseIcon from '@material-ui/icons/Close';
import Resizable from 're-resizable';
import Slide from '@material-ui/core/Slide';
import { color, commonCss, zIndex } from '../Css';
import { stylesheet } from 'typestyle';
const css = stylesheet({
closeButton: {
color: color.inactive,
margin: 15,
minHeight: 0,
minWidth: 0,
padding: 0,
},
nodeName: {
flexGrow: 1,
textAlign: 'center',
},
sidepane: {
backgroundColor: color.background,
borderLeft: 'solid 1px #ddd',
bottom: 0,
display: 'flex',
flexFlow: 'column',
position: 'absolute !important' as any,
right: 0,
top: 0,
zIndex: zIndex.SIDE_PANEL,
},
});
interface SidePanelProps {
isBusy?: boolean;
isOpen: boolean;
onClose: () => void;
title: string;
}
class SidePanel extends React.Component<SidePanelProps> {
public render(): JSX.Element {
const { isBusy, isOpen, onClose, title } = this.props;
return (
<Slide in={isOpen} direction='left'>
<Resizable
className={css.sidepane}
defaultSize={{ width: '70%' }}
maxWidth='90%'
minWidth={100}
enable={{
bottom: false,
bottomLeft: false,
bottomRight: false,
left: true,
right: false,
top: false,
topLeft: false,
topRight: false,
}}
>
{isOpen && (
<div className={commonCss.page}>
<div className={commonCss.flex}>
<Button className={css.closeButton} onClick={onClose}>
<CloseIcon />
</Button>
<div className={css.nodeName}>{title}</div>
</div>
<div className={commonCss.page}>
{isBusy === true && (
<CircularProgress size={30} className={commonCss.absoluteCenter} />
)}
<div className={commonCss.page}>{this.props.children}</div>
</div>
</div>
)}
</Resizable>
</Slide>
);
}
}
export default SidePanel;
| 7,921 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/PodYaml.tsx | import * as JsYaml from 'js-yaml';
import React from 'react';
import { Apis, JSONObject } from 'src/lib/Apis';
import { serviceErrorToString } from 'src/lib/Utils';
import Banner from './Banner';
import Editor from './Editor';
async function getPodYaml(name: string, namespace: string): Promise<string> {
const response = await Apis.getPodInfo(name, namespace);
return JsYaml.safeDump(reorderPodJson(response), { skipInvalid: true });
}
export const PodInfo: React.FC<{ name: string; namespace: string }> = ({ name, namespace }) => {
return (
<PodYaml
name={name}
namespace={namespace}
errorMessage='Warning: failed to retrieve pod info. Possible reasons include cluster autoscaling, pod preemption or pod cleaned up by time to live configuration'
getYaml={getPodYaml}
/>
);
};
async function getPodEventsYaml(name: string, namespace: string): Promise<string> {
const response = await Apis.getPodEvents(name, namespace);
return JsYaml.safeDump(response, { skipInvalid: true });
}
export const PodEvents: React.FC<{
name: string;
namespace: string;
}> = ({ name, namespace }) => {
return (
<PodYaml
name={name}
namespace={namespace}
errorMessage='Warning: failed to retrieve pod events. Possible reasons include cluster autoscaling, pod preemption or pod cleaned up by time to live configuration'
getYaml={getPodEventsYaml}
/>
);
};
const PodYaml: React.FC<{
name: string;
namespace: string;
errorMessage: string;
getYaml: (name: string, namespace: string) => Promise<string>;
}> = ({ name, namespace, getYaml, errorMessage }) => {
const [yaml, setYaml] = React.useState<string | undefined>(undefined);
const [error, setError] = React.useState<
| {
message: string;
additionalInfo: string;
}
| undefined
>(undefined);
const [refreshes, setRefresh] = React.useState(0);
React.useEffect(() => {
let aborted = false;
async function load() {
setYaml(undefined);
setError(undefined);
try {
const yaml = await getYaml(name, namespace);
if (!aborted) {
setYaml(yaml);
}
} catch (err) {
if (!aborted) {
setError({
message: errorMessage,
additionalInfo: await serviceErrorToString(err),
});
}
}
}
load();
return () => {
aborted = true;
};
}, [name, namespace, refreshes, getYaml, errorMessage]); // When refreshes change, request is fetched again.
return (
<>
{error && (
<Banner
message={error.message}
mode='warning'
additionalInfo={error.additionalInfo}
// Increases refresh counter, so it will automatically trigger a refetch.
refresh={() => setRefresh(refreshes => refreshes + 1)}
/>
)}
{!error && yaml && (
<Editor
value={yaml || ''}
height='100%'
width='100%'
mode='yaml'
theme='github'
editorProps={{ $blockScrolling: true }}
readOnly={true}
highlightActiveLine={true}
showGutter={true}
/>
)}
</>
);
};
function reorderPodJson(jsonData: JSONObject): JSONObject {
const orderedData = { ...jsonData };
if (jsonData.spec) {
// Deleting spec property and add it again moves spec to the last property in the JSON object.
delete orderedData.spec;
orderedData.spec = jsonData.spec;
}
return orderedData;
}
export const TEST_ONLY = {
PodYaml,
};
| 7,922 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/Banner.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import Button from '@material-ui/core/Button';
import Dialog from '@material-ui/core/Dialog';
import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import ErrorIcon from '@material-ui/icons/Error';
import WarningIcon from '@material-ui/icons/Warning';
import InfoIcon from '@material-ui/icons/Info';
import { classes, stylesheet } from 'typestyle';
import { color, commonCss, spacing } from '../Css';
export type Mode = 'error' | 'warning' | 'info';
export const css = stylesheet({
banner: {
border: `1px solid ${color.divider}`,
boxSizing: 'border-box',
justifyContent: 'space-between',
margin: spacing.units(-1),
minHeight: '50px',
padding: spacing.units(-4),
},
button: {
color: color.secondaryText,
maxHeight: '32px',
minWidth: '75px',
},
detailsButton: {
backgroundColor: color.background,
},
icon: {
height: '18px',
padding: spacing.units(-4),
width: '18px',
},
message: {
alignItems: 'center',
display: 'flex',
},
refreshButton: {
backgroundColor: color.background,
},
troubleShootingLink: {
alignItems: 'center',
color: color.theme,
fontWeight: 'bold',
padding: spacing.units(-4),
},
});
export interface BannerProps {
additionalInfo?: string;
message?: string;
mode?: Mode;
showTroubleshootingGuideLink?: boolean;
refresh?: () => void;
}
interface BannerState {
dialogOpen: boolean;
}
class Banner extends React.Component<BannerProps, BannerState> {
constructor(props: any) {
super(props);
this.state = {
dialogOpen: false,
};
}
public render(): JSX.Element {
// Default to error styles.
let bannerModeCss = stylesheet({
mode: { backgroundColor: color.errorBg, color: color.errorText },
});
let bannerIcon = <ErrorIcon className={css.icon} />;
let dialogTitle = 'An error occurred';
switch (this.props.mode) {
case 'error':
bannerModeCss = stylesheet({
mode: { backgroundColor: color.errorBg, color: color.errorText },
});
bannerIcon = <ErrorIcon className={css.icon} />;
dialogTitle = 'An error occurred';
break;
case 'warning':
bannerModeCss = stylesheet({
mode: { backgroundColor: color.warningBg, color: color.warningText },
});
bannerIcon = <WarningIcon className={css.icon} />;
dialogTitle = 'Warning';
break;
case 'info':
bannerModeCss = stylesheet({
mode: { backgroundColor: color.background, color: color.success },
});
bannerIcon = <InfoIcon className={css.icon} />;
dialogTitle = 'Info';
break;
default:
// Already set defaults above.
break;
}
return (
<div className={classes(commonCss.flex, css.banner, bannerModeCss.mode)}>
<div className={css.message}>
{bannerIcon}
{this.props.message}
</div>
<div className={commonCss.flex}>
{this.props.showTroubleshootingGuideLink && (
<a
className={css.troubleShootingLink}
href='https://www.kubeflow.org/docs/pipelines/troubleshooting'
>
Troubleshooting guide
</a>
)}
{this.props.additionalInfo && (
<Button
className={classes(css.button, css.detailsButton)}
onClick={this._showAdditionalInfo.bind(this)}
>
Details
</Button>
)}
{this.props.refresh && (
<Button
className={classes(css.button, css.refreshButton)}
onClick={this._refresh.bind(this)}
>
Refresh
</Button>
)}
</div>
{this.props.additionalInfo && (
<Dialog open={this.state.dialogOpen} onClose={this._dialogClosed.bind(this)}>
<DialogTitle>{dialogTitle}</DialogTitle>
<DialogContent className={commonCss.prewrap}>{this.props.additionalInfo}</DialogContent>
<DialogActions>
<Button id='dismissDialogBtn' onClick={this._dialogClosed.bind(this)}>
Dismiss
</Button>
</DialogActions>
</Dialog>
)}
</div>
);
}
private _dialogClosed(): void {
this.setState({ dialogOpen: false });
}
private _showAdditionalInfo(): void {
this.setState({ dialogOpen: true });
}
private _refresh(): void {
this.props.refresh!();
}
}
export default Banner;
| 7,923 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/Router.test.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { shallow, mount } from 'enzyme';
import Router, { RouteConfig } from './Router';
import { Router as ReactRouter } from 'react-router';
import { Page } from '../pages/Page';
import { ToolbarProps } from './Toolbar';
import { createMemoryHistory } from 'history';
describe('Router', () => {
it('initial render', () => {
const tree = shallow(<Router />);
expect(tree).toMatchSnapshot();
});
it('does not share state between pages', () => {
class ApplePage extends Page<{}, {}> {
getInitialToolbarState(): ToolbarProps {
return {
pageTitle: 'Apple',
actions: {},
breadcrumbs: [],
};
}
async refresh() {}
render() {
return <div>apple</div>;
}
}
const configs: RouteConfig[] = [
{
path: '/apple',
Component: ApplePage,
},
{
path: '/pear',
Component: () => {
return <div>pear</div>;
},
},
];
const history = createMemoryHistory({
initialEntries: ['/apple'],
});
const tree = mount(
<ReactRouter history={history}>
<Router configs={configs} />
</ReactRouter>,
);
expect(tree.getDOMNode().querySelector('[data-testid=page-title]')!.textContent).toEqual(
'Apple',
);
// When visiting the second page, page title should be reset automatically.
history.push('/pear');
expect(tree.getDOMNode().querySelector('[data-testid=page-title]')!.textContent).toEqual('');
});
});
| 7,924 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/Banner.test.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { shallow } from 'enzyme';
import Banner, { css } from './Banner';
describe('Banner', () => {
it('defaults to error mode', () => {
const tree = shallow(<Banner message={'Some message'} />);
expect(tree).toMatchSnapshot();
});
it('uses error mode when instructed', () => {
const tree = shallow(<Banner message={'Some message'} mode={'error'} />);
expect(tree).toMatchSnapshot();
});
it('uses warning mode when instructed', () => {
const tree = shallow(<Banner message={'Some message'} mode={'warning'} />);
expect(tree).toMatchSnapshot();
});
it('shows "Details" button and has dialog when there is additional info', () => {
const tree = shallow(<Banner message={'Some message'} additionalInfo={'More info'} />);
expect(tree).toMatchSnapshot();
});
it('shows "Refresh" button when passed a refresh function', () => {
const tree = shallow(
<Banner
message={'Some message'}
refresh={() => {
/* do nothing */
}}
/>,
);
expect(tree).toMatchSnapshot();
});
it('shows troubleshooting link instructed by prop', () => {
const tree = shallow(<Banner message='Some message' showTroubleshootingGuideLink={true} />);
expect(tree).toMatchInlineSnapshot(`
<div
className="flex banner mode"
>
<div
className="message"
>
<pure(ErrorIcon)
className="icon"
/>
Some message
</div>
<div
className="flex"
>
<a
className="troubleShootingLink"
href="https://www.kubeflow.org/docs/pipelines/troubleshooting"
>
Troubleshooting guide
</a>
</div>
</div>
`);
});
it('opens details dialog when button is clicked', () => {
const tree = shallow(<Banner message='hello' additionalInfo='world' />);
tree
.find('WithStyles(Button)')
.at(0)
.simulate('click');
expect(tree.state()).toHaveProperty('dialogOpen', true);
});
it('closes details dialog when cancel button is clicked', () => {
const tree = shallow(<Banner message='hello' additionalInfo='world' />);
tree
.find('WithStyles(Button)')
.at(0)
.simulate('click');
expect(tree.state()).toHaveProperty('dialogOpen', true);
tree.find('#dismissDialogBtn').simulate('click');
expect(tree.state()).toHaveProperty('dialogOpen', false);
});
it('calls refresh callback', () => {
const spy = jest.fn();
const tree = shallow(<Banner message='hello' refresh={spy} />);
tree
.find('.' + css.refreshButton)
.at(0)
.simulate('click');
expect(spy).toHaveBeenCalled();
});
});
| 7,925 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/Toolbar.test.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { shallow } from 'enzyme';
import { createBrowserHistory, createMemoryHistory } from 'history';
import Toolbar, { ToolbarActionMap } from './Toolbar';
import HelpIcon from '@material-ui/icons/Help';
import InfoIcon from '@material-ui/icons/Info';
const action1 = jest.fn();
const action2 = jest.fn();
const actions: ToolbarActionMap = {
action1: {
action: action1,
disabledTitle: 'test disabled title',
icon: HelpIcon,
id: 'test id',
title: 'test title',
tooltip: 'test tooltip',
},
action2: {
action: action2,
disabled: true,
disabledTitle: 'test disabled title2',
icon: InfoIcon,
id: 'test id2',
title: 'test title2',
tooltip: 'test tooltip2',
},
};
const breadcrumbs = [
{
displayName: 'test display name',
href: '/some/test/path',
},
{
displayName: 'test display name2',
href: '/some/test/path2',
},
];
const history = createBrowserHistory({});
describe('Toolbar', () => {
beforeAll(() => {
history.push('/pipelines');
});
it('renders nothing when there are no breadcrumbs or actions', () => {
const tree = shallow(<Toolbar breadcrumbs={[]} actions={{}} history={history} pageTitle='' />);
expect(tree).toMatchSnapshot();
});
it('renders without breadcrumbs and a string page title', () => {
const tree = shallow(
<Toolbar breadcrumbs={[]} actions={actions} history={history} pageTitle='test page title' />,
);
expect(tree).toMatchSnapshot();
});
it('renders without breadcrumbs and a component page title', () => {
const tree = shallow(
<Toolbar
breadcrumbs={[]}
actions={actions}
history={history}
pageTitle={<div id='myComponent'>test page title</div>}
/>,
);
expect(tree).toMatchSnapshot();
});
it('renders without breadcrumbs and one action', () => {
const singleAction = {
action1: {
action: action1,
disabledTitle: 'test disabled title',
icon: HelpIcon,
id: 'test id',
title: 'test title',
tooltip: 'test tooltip',
},
};
const tree = shallow(
<Toolbar
breadcrumbs={[]}
actions={singleAction}
history={history}
pageTitle='test page title'
/>,
);
expect(tree).toMatchSnapshot();
});
it('renders without actions and one breadcrumb', () => {
const tree = shallow(
<Toolbar
breadcrumbs={[breadcrumbs[0]]}
actions={{}}
history={history}
pageTitle='test page title'
/>,
);
expect(tree).toMatchSnapshot();
});
it('renders without actions, one breadcrumb, and a page name', () => {
const tree = shallow(
<Toolbar
breadcrumbs={[breadcrumbs[0]]}
actions={{}}
history={history}
pageTitle='test page title'
/>,
);
expect(tree).toMatchSnapshot();
});
it('renders without breadcrumbs and two actions', () => {
const tree = shallow(
<Toolbar breadcrumbs={[]} actions={actions} history={history} pageTitle='test page title' />,
);
expect(tree).toMatchSnapshot();
});
it('fires the right action function when button is clicked', () => {
const tree = shallow(
<Toolbar breadcrumbs={[]} actions={actions} history={history} pageTitle='test page title' />,
);
tree
.find('BusyButton')
.at(0)
.simulate('click');
expect(action1).toHaveBeenCalled();
action1.mockClear();
});
it('renders outlined action buttons', () => {
const outlinedActions = {
action1: {
action: jest.fn(),
id: 'test outlined id',
outlined: true,
title: 'test outlined title',
tooltip: 'test outlined tooltip',
},
};
const tree = shallow(
<Toolbar
breadcrumbs={breadcrumbs}
actions={outlinedActions}
pageTitle=''
history={history}
/>,
);
expect(tree).toMatchSnapshot();
});
it('renders primary action buttons', () => {
const primaryActions = {
action1: {
action: jest.fn(),
id: 'test primary id',
primary: true,
title: 'test primary title',
tooltip: 'test primary tooltip',
},
};
const tree = shallow(
<Toolbar breadcrumbs={breadcrumbs} actions={primaryActions} pageTitle='' history={history} />,
);
expect(tree).toMatchSnapshot();
});
it('renders primary action buttons without outline, even if outline is true', () => {
const outlinedPrimaryActions = {
action1: {
action: jest.fn(),
id: 'test id',
outlined: true,
primary: true,
title: 'test title',
tooltip: 'test tooltip',
},
};
const tree = shallow(
<Toolbar
breadcrumbs={breadcrumbs}
actions={outlinedPrimaryActions}
pageTitle=''
history={history}
/>,
);
expect(tree).toMatchSnapshot();
});
it('renders with two breadcrumbs and two actions', () => {
const tree = shallow(
<Toolbar breadcrumbs={breadcrumbs} actions={actions} pageTitle='' history={history} />,
);
expect(tree).toMatchSnapshot();
});
it('disables the back button when there is no browser history', () => {
// This test uses createMemoryHistory because createBroweserHistory returns a singleton, and
// there is no way to clear its entries which this test requires.
const emptyHistory = createMemoryHistory();
const tree = shallow(
<Toolbar breadcrumbs={breadcrumbs} actions={actions} history={emptyHistory} pageTitle='' />,
);
expect(tree).toMatchSnapshot();
});
});
| 7,926 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/Graph.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as dagre from 'dagre';
import * as React from 'react';
import { classes, stylesheet } from 'typestyle';
import { fontsize, color, fonts, zIndex } from '../Css';
import { Constants } from '../lib/Constants';
import Tooltip from '@material-ui/core/Tooltip';
interface Segment {
angle: number;
length: number;
x1: number;
x2: number;
y1: number;
y2: number;
}
interface Edge {
color?: string;
isPlaceholder?: boolean;
from: string;
segments: Segment[];
to: string;
}
const css = stylesheet({
arrowHead: {
borderColor: color.grey + ' transparent transparent transparent',
borderStyle: 'solid',
borderWidth: '7px 6px 0 6px',
content: `''`,
position: 'absolute',
},
icon: {
padding: '5px 7px 0px 7px',
},
label: {
color: color.strong,
flexGrow: 1,
fontFamily: fonts.secondary,
fontSize: 13,
fontWeight: 500,
lineHeight: '16px',
overflow: 'hidden',
padding: 10,
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
},
line: {
position: 'absolute',
},
node: {
$nest: {
'&:hover': {
borderColor: color.theme,
},
},
backgroundColor: color.background,
border: 'solid 1px #d6d6d6',
borderRadius: 3,
boxSizing: 'content-box',
color: '#124aa4',
cursor: 'pointer',
display: 'flex',
fontSize: fontsize.medium,
margin: 10,
position: 'absolute',
zIndex: zIndex.GRAPH_NODE,
},
nodeSelected: {
border: `solid 2px ${color.theme}`,
},
placeholderNode: {
margin: 10,
position: 'absolute',
// TODO: can this be calculated?
transform: 'translate(71px, 14px)',
},
root: {
backgroundColor: color.graphBg,
borderLeft: 'solid 1px ' + color.divider,
flexGrow: 1,
overflow: 'auto',
position: 'relative',
},
});
interface GraphProps {
graph: dagre.graphlib.Graph;
onClick?: (id: string) => void;
selectedNodeId?: string;
}
interface GraphState {
hoveredNode?: string;
}
interface GraphErrorBoundaryProps {
onError?: (message: string, additionalInfo: string) => void;
}
class GraphErrorBoundary extends React.Component<GraphErrorBoundaryProps> {
state = {
hasError: false,
};
componentDidCatch(error: Error): void {
const message = 'There was an error rendering the graph.';
const additionalInfo = `${message} This is likely a bug in Kubeflow Pipelines. Error message: '${error.message}'.`;
if (this.props.onError) {
this.props.onError(message, additionalInfo);
}
this.setState({
hasError: true,
});
}
render() {
return this.state.hasError ? <div className={css.root} /> : this.props.children;
}
}
export class Graph extends React.Component<GraphProps, GraphState> {
private LEFT_OFFSET = 100;
private TOP_OFFSET = 44;
private EDGE_THICKNESS = 2;
private EDGE_X_BUFFER = Math.round(Constants.NODE_WIDTH / 6);
constructor(props: any) {
super(props);
this.state = {};
}
public render(): JSX.Element | null {
const { graph } = this.props;
if (!graph.nodes().length) {
return null;
}
dagre.layout(graph);
const displayEdges: Edge[] = [];
// Creates the lines that constitute the edges connecting the graph.
graph.edges().forEach(edgeInfo => {
const edge = graph.edge(edgeInfo);
const segments: Segment[] = [];
if (edge.points.length > 1) {
for (let i = 1; i < edge.points.length; i++) {
let xStart = edge.points[i - 1].x;
let yStart = edge.points[i - 1].y;
let xEnd = edge.points[i].x;
let yEnd = edge.points[i].y;
const downwardPointingSegment = yStart <= yEnd;
// Adjustments made to the start of the first segment for each edge to ensure that it
// begins at the bottom of the source node and that there are at least EDGE_X_BUFFER
// pixels between it and the right and left side of the node.
// Note that these adjustments may cause edges to overlap with nodes since we are
// deviating from the explicit layout provided by dagre.
if (i === 1) {
const sourceNode = graph.node(edgeInfo.v);
if (!sourceNode) {
throw new Error(`Graph definition is invalid. Cannot get node by '${edgeInfo.v}'.`);
}
// Set the edge's first segment to start at the bottom or top of the source node.
yStart = downwardPointingSegment
? sourceNode.y + sourceNode.height / 2 - 3
: sourceNode.y - sourceNode.height / 2;
xStart = this._ensureXIsWithinNode(sourceNode, xStart);
}
const finalSegment = i === edge.points.length - 1;
// Adjustments made to the end of the final segment for each edge to ensure that it ends
// at the top of the destination node and that there are at least EDGE_X_BUFFER pixels
// between it and the right and left side of the node. The adjustments are only needed
// when there are multiple inbound edges as dagre seems to always layout a single inbound
// edge so that it terminates at the center-top of the destination node. For this reason,
// placeholder nodes do not need adjustments since they always have only a single inbound
// edge.
// Note that these adjustments may cause edges to overlap with nodes since we are
// deviating from the explicit layout provided by dagre.
if (finalSegment) {
const destinationNode = graph.node(edgeInfo.w);
// Placeholder nodes never need adjustment because they always have only a single
// incoming edge.
if (!destinationNode.isPlaceholder) {
// Set the edge's final segment to terminate at the top or bottom of the destination
// node.
yEnd = downwardPointingSegment
? destinationNode.y - this.TOP_OFFSET + 5
: destinationNode.y + destinationNode.height / 2 + 3;
xEnd = this._ensureXIsWithinNode(destinationNode, xEnd);
}
}
// For the final segment of the edge, if the segment is diagonal, split it into a diagonal
// and a vertical piece so that all edges terminate with a vertical segment.
if (finalSegment && xStart !== xEnd) {
const yHalf = (yStart + yEnd) / 2;
this._addDiagonalSegment(segments, xStart, yStart, xEnd, yHalf);
// Vertical segment
if (downwardPointingSegment) {
segments.push({
angle: 270,
length: yEnd - yHalf,
x1: xEnd - 5,
x2: xEnd,
y1: yHalf + 4,
y2: yEnd,
});
} else {
segments.push({
angle: 90,
length: yHalf - yEnd,
x1: xEnd - 5,
x2: xEnd,
y1: yHalf - 4,
y2: yEnd,
});
}
} else {
this._addDiagonalSegment(segments, xStart, yStart, xEnd, yEnd);
}
}
}
displayEdges.push({
color: edge.color,
from: edgeInfo.v,
isPlaceholder: edge.isPlaceholder,
segments,
to: edgeInfo.w,
});
});
const { hoveredNode } = this.state;
const highlightNode = this.props.selectedNodeId || hoveredNode;
return (
<div className={css.root}>
{graph
.nodes()
.map(id => Object.assign(graph.node(id), { id }))
.map((node, i) => (
<div
className={classes(
node.isPlaceholder ? css.placeholderNode : css.node,
'graphNode',
node.id === this.props.selectedNodeId ? css.nodeSelected : '',
)}
key={i}
onMouseEnter={() => {
if (!this.props.selectedNodeId) {
this.setState({ hoveredNode: node.id });
}
}}
onMouseLeave={() => {
if (this.state.hoveredNode === node.id) {
this.setState({ hoveredNode: undefined });
}
}}
onClick={() =>
!node.isPlaceholder && this.props.onClick && this.props.onClick(node.id)
}
style={{
backgroundColor: node.bgColor,
left: node.x,
maxHeight: node.height,
minHeight: node.height,
top: node.y,
transition: 'left 0.5s, top 0.5s',
width: node.width,
}}
>
{!node.isPlaceholder && (
<Tooltip title={node.label} enterDelay={300}>
<div className={css.label}>{node.label}</div>
</Tooltip>
)}
<div className={css.icon} style={{ background: node.statusColoring }}>
{node.icon}
</div>
</div>
))}
{displayEdges.map((edge, i) => {
const edgeColor = this._getEdgeColor(edge, highlightNode);
const lastSegment = edge.segments[edge.segments.length - 1];
return (
<div key={i}>
{edge.segments.map((segment, l) => (
<div
className={css.line}
key={l}
style={{
backgroundColor: edgeColor,
height: this.EDGE_THICKNESS,
left: segment.x1 + this.LEFT_OFFSET,
top: segment.y1 + this.TOP_OFFSET,
transform: `rotate(${segment.angle}deg)`,
transition: 'left 0.5s, top 0.5s',
width: segment.length,
}}
/>
))}
{/* Arrowhead */}
{!edge.isPlaceholder && lastSegment.x2 !== undefined && lastSegment.y2 !== undefined && (
<div
className={css.arrowHead}
style={{
borderTopColor: edgeColor,
left: lastSegment.x2 + this.LEFT_OFFSET - 6,
top: lastSegment.y2 + this.TOP_OFFSET - 3,
transform: `rotate(${lastSegment.angle + 90}deg)`,
}}
/>
)}
</div>
);
})}
</div>
);
}
private _addDiagonalSegment(
segments: Segment[],
xStart: number,
yStart: number,
xEnd: number,
yEnd: number,
): void {
const xMid = (xStart + xEnd) / 2;
// The + 0.5 at the end of 'length' helps fill out the elbows of the edges.
const length = Math.sqrt(Math.pow(xStart - xEnd, 2) + Math.pow(yStart - yEnd, 2)) + 0.5;
const x1 = xMid - length / 2;
const y1 = (yStart + yEnd) / 2;
const angle = (Math.atan2(yStart - yEnd, xStart - xEnd) * 180) / Math.PI;
segments.push({
angle,
length,
x1,
x2: xEnd,
y1,
y2: yEnd,
});
}
/**
* Adjusts the x positioning of the start or end of an edge so that it is at least EDGE_X_BUFFER
* pixels in from the left and right.
* @param node the node where the edge is originating from or terminating at
* @param originalX the initial x position provided by dagre
*/
private _ensureXIsWithinNode(node: dagre.Node, originalX: number): number {
// If the original X value was too far to the right, move it EDGE_X_BUFFER pixels
// in from the left end of the node.
const rightmostAcceptableLoc = node.x + node.width - this.LEFT_OFFSET - this.EDGE_X_BUFFER;
if (rightmostAcceptableLoc <= originalX) {
return rightmostAcceptableLoc;
}
// If the original X value was too far to the left, move it EDGE_X_BUFFER pixels
// in from the left end of the node.
const leftmostAcceptableLoc = node.x - this.LEFT_OFFSET + this.EDGE_X_BUFFER;
if (leftmostAcceptableLoc >= originalX) {
return leftmostAcceptableLoc;
}
return originalX;
}
private _getEdgeColor(edge: Edge, highlightNode?: string): string {
if (highlightNode) {
if (edge.from === highlightNode) {
return color.theme;
}
if (edge.to === highlightNode) {
return color.themeDarker;
}
}
if (edge.isPlaceholder) {
return color.weak;
}
return color.grey;
}
}
const EnhancedGraph = (props: GraphProps & GraphErrorBoundaryProps) => (
<GraphErrorBoundary onError={props.onError}>
<Graph {...props} />
</GraphErrorBoundary>
);
EnhancedGraph.displayName = 'EnhancedGraph';
export default EnhancedGraph;
| 7,927 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/LogViewer.test.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { mount, shallow } from 'enzyme';
import LogViewer from './LogViewer';
describe('LogViewer', () => {
it('renders an empty container when no logs passed', () => {
expect(shallow(<LogViewer logLines={[]} />)).toMatchSnapshot();
});
it('renders one log line', () => {
const logLines = ['first line'];
const logViewer = new LogViewer({ logLines });
const tree = mount((logViewer as any)._rowRenderer({ index: 0 })).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('renders two log lines', () => {
const logLines = ['first line', 'second line'];
const logViewer = new LogViewer({ logLines });
const tree = mount((logViewer as any)._rowRenderer({ index: 0 })).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('renders one long line without breaking', () => {
const line =
`Lorem Ipsum is simply dummy text of the printing and typesetting` +
`industry. Lorem Ipsum has been the industry's standard dummy text ever` +
`since the 1500s, when an unknown printer took a galley of type and` +
`scrambled it to make a type specimen book. It has survived not only five` +
`centuries, but also the leap into electronic typesetting, remaining` +
`essentially unchanged. It was popularised in the 1960s with the release` +
`of Letraset sheets containing Lorem Ipsum passages, and more recently` +
`with desktop publishing software like Aldus PageMaker including versions` +
`of Lorem Ipsum.`;
const logViewer = new LogViewer({ logLines: [line] });
const tree = mount((logViewer as any)._rowRenderer({ index: 0 })).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('renders a multi-line log', () => {
const line = `Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book. It has survived not only five
centuries, but also the leap into electronic typesetting, remaining
essentially unchanged. It was popularised in the 1960s with the release
of Letraset sheets containing Lorem Ipsum passages, and more recently
with desktop publishing software like Aldus PageMaker including versions
of Lorem Ipsum.`;
const logViewer = new LogViewer({ logLines: line.split('\n') });
const tree = mount((logViewer as any)._rowRenderer({ index: 0 })).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('linkifies standalone urls', () => {
const logLines = ['this string: http://path.com is a url'];
const logViewer = new LogViewer({ logLines });
const tree = mount((logViewer as any)._rowRenderer({ index: 0 })).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('linkifies standalone https urls', () => {
const logLines = ['this string: https://path.com is a url'];
const logViewer = new LogViewer({ logLines });
const tree = mount((logViewer as any)._rowRenderer({ index: 0 })).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('linkifies substring urls', () => {
const logLines = ['this string:http://path.com is a url'];
const logViewer = new LogViewer({ logLines });
const tree = mount((logViewer as any)._rowRenderer({ index: 0 })).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('does not linkify non http/https urls', () => {
const logLines = ['this string: gs://path is a GCS path'];
const logViewer = new LogViewer({ logLines });
const tree = mount((logViewer as any)._rowRenderer({ index: 0 })).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('scrolls to end after rendering', () => {
const spy = jest.spyOn(LogViewer.prototype as any, '_scrollToEnd');
const logs = 'this string: gs://path is a GCS path';
const tree = mount(<LogViewer logLines={[logs]} />);
tree.instance().componentDidUpdate!({}, {});
expect(spy).toHaveBeenCalled();
});
it('renders a row with given index as line number', () => {
const logViewer = new LogViewer({ logLines: ['line1', 'line2'] });
const tree = mount((logViewer as any)._rowRenderer({ index: 0 })).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('renders a row with error', () => {
const logViewer = new LogViewer({ logLines: ['line1 with error', 'line2'] });
const tree = mount((logViewer as any)._rowRenderer({ index: 0 })).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('renders a row with upper case error', () => {
const logViewer = new LogViewer({ logLines: ['line1 with ERROR', 'line2'] });
const tree = mount((logViewer as any)._rowRenderer({ index: 0 })).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('renders a row with error word as substring', () => {
const logViewer = new LogViewer({ logLines: ['line1 with errorWord', 'line2'] });
const tree = mount((logViewer as any)._rowRenderer({ index: 0 })).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('renders a row with warning', () => {
const logViewer = new LogViewer({ logLines: ['line1 with warning', 'line2'] });
const tree = mount((logViewer as any)._rowRenderer({ index: 0 })).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('renders a row with warn', () => {
const logViewer = new LogViewer({ logLines: ['line1 with warn', 'line2'] });
const tree = mount((logViewer as any)._rowRenderer({ index: 0 })).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('renders a row with upper case warning', () => {
const logViewer = new LogViewer({ logLines: ['line1 with WARNING', 'line2'] });
const tree = mount((logViewer as any)._rowRenderer({ index: 0 })).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('renders a row with warning word as substring', () => {
const logViewer = new LogViewer({ logLines: ['line1 with warning:something', 'line2'] });
const tree = mount((logViewer as any)._rowRenderer({ index: 0 })).getDOMNode();
expect(tree).toMatchSnapshot();
});
});
| 7,928 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/CompareTable.test.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { shallow } from 'enzyme';
import CompareTable from './CompareTable';
// tslint:disable-next-line:no-console
const consoleErrorBackup = console.error;
let consoleSpy: jest.Mock;
describe('CompareTable', () => {
beforeAll(() => {
consoleSpy = jest.spyOn(console, 'error').mockImplementation(() => null);
});
afterAll(() => {
// tslint:disable-next-line:no-console
console.error = consoleErrorBackup;
});
it('renders no data', () => {
const tree = shallow(<CompareTable rows={[]} xLabels={[]} yLabels={[]} />);
expect(tree).toMatchSnapshot();
});
const rows = [
['1', '2', '3'],
['4', '5', '6'],
['cell7', 'cell8', 'cell9'],
];
const xLabels = ['col1', 'col2', 'col3'];
const yLabels = ['row1', 'row2', 'row3'];
it('logs error if ylabels and rows have different lengths', () => {
shallow(<CompareTable rows={[rows[0], rows[1]]} xLabels={xLabels} yLabels={yLabels} />);
expect(consoleSpy).toHaveBeenCalledWith(
'Number of rows (2) should match the number of Y labels (3).',
);
});
it('renders one row with three columns', () => {
const tree = shallow(<CompareTable rows={rows} xLabels={xLabels} yLabels={yLabels} />);
expect(tree).toMatchSnapshot();
});
});
| 7,929 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/CustomTableNameColumn.tsx | import { CustomRendererProps } from './CustomTable';
import React from 'react';
import Tooltip from '@material-ui/core/Tooltip';
/**
* Common name custom renderer that shows a tooltip when hovered. The tooltip helps if there isn't
* enough space to show the entire name in limited space.
*/
export const NameWithTooltip: React.FC<CustomRendererProps<string>> = (
props: CustomRendererProps<string>,
) => {
return (
<Tooltip title={props.value || ''} enterDelay={300} placement='top-start'>
<span>{props.value || ''}</span>
</Tooltip>
);
};
| 7,930 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/PlotCard.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import Button from '@material-ui/core/Button';
import CloseIcon from '@material-ui/icons/Close';
import Dialog from '@material-ui/core/Dialog';
import Paper from '@material-ui/core/Paper';
import PopOutIcon from '@material-ui/icons/Launch';
import Separator from '../atoms/Separator';
import Tooltip from '@material-ui/core/Tooltip';
import ViewerContainer, { componentMap } from '../components/viewers/ViewerContainer';
import { ViewerConfig } from '../components/viewers/Viewer';
import { color, fontsize } from '../Css';
import { stylesheet, classes } from 'typestyle';
const css = stylesheet({
dialogTitle: {
color: color.strong,
fontSize: fontsize.large,
width: '100%',
},
fullscreenCloseBtn: {
minHeight: 0,
minWidth: 0,
padding: 3,
},
fullscreenDialog: {
alignItems: 'center',
justifyContent: 'center',
minHeight: '80%',
minWidth: '80%',
padding: 20,
},
fullscreenViewerContainer: {
alignItems: 'center',
boxSizing: 'border-box',
display: 'flex',
flexFlow: 'column',
flexGrow: 1,
height: '100%',
justifyContent: 'center',
margin: 20,
overflow: 'auto',
width: '100%',
},
plotCard: {
flexShrink: 0,
margin: 20,
minWidth: 250,
padding: 20,
width: 'min-content',
},
plotHeader: {
display: 'flex',
justifyContent: 'space-between',
overflow: 'hidden',
paddingBottom: 10,
},
plotTitle: {
color: color.strong,
fontSize: 12,
fontWeight: 'bold',
},
popoutIcon: {
fontSize: 18,
},
});
export interface PlotCardProps {
title: string;
configs: ViewerConfig[];
maxDimension: number;
}
interface PlotCardState {
fullscreenDialogOpen: boolean;
}
class PlotCard extends React.Component<PlotCardProps, PlotCardState> {
constructor(props: any) {
super(props);
this.state = {
fullscreenDialogOpen: false,
};
}
public shouldComponentUpdate(nextProps: PlotCardProps, nextState: PlotCardState): boolean {
return (
JSON.stringify(nextProps) !== JSON.stringify(this.props) ||
nextState.fullscreenDialogOpen !== this.state.fullscreenDialogOpen
);
}
public render(): JSX.Element | null {
const { title, configs, maxDimension, ...otherProps } = this.props;
if (!configs || !configs.length) {
return null;
}
return (
<div>
<Paper {...otherProps} className={classes(css.plotCard, 'plotCard')}>
<div className={css.plotHeader}>
<div className={css.plotTitle} title={title}>
{title}
</div>
<div>
<Button
onClick={() => this.setState({ fullscreenDialogOpen: true })}
style={{ padding: 4, minHeight: 0, minWidth: 0 }}
className='popOutButton'
>
<Tooltip title='Pop out'>
<PopOutIcon classes={{ root: css.popoutIcon }} />
</Tooltip>
</Button>
</div>
</div>
<ViewerContainer configs={configs} maxDimension={maxDimension} />
</Paper>
<Dialog
open={!!this.state.fullscreenDialogOpen}
classes={{ paper: css.fullscreenDialog }}
onClose={() => this.setState({ fullscreenDialogOpen: false })}
>
<div className={css.dialogTitle}>
<Button
onClick={() => this.setState({ fullscreenDialogOpen: false })}
className={classes(css.fullscreenCloseBtn, 'fullscreenCloseButton')}
>
<CloseIcon />
</Button>
{componentMap[configs[0].type].prototype.getDisplayName()}
<Separator />
<span style={{ color: color.inactive }}>({title})</span>
</div>
<div className={css.fullscreenViewerContainer}>
<ViewerContainer configs={configs} />
</div>
</Dialog>
</div>
);
}
}
export default PlotCard;
| 7,931 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/PodYaml.test.tsx | import React, { FC } from 'react';
import { PodInfo, PodEvents } from './PodYaml';
import { render, act, fireEvent } from '@testing-library/react';
import { Apis } from 'src/lib/Apis';
import TestUtils from 'src/TestUtils';
// Original ./Editor uses a complex external editor inside, we use a simple mock
// for testing instead.
jest.mock('./Editor', () => {
return ({ value }: { value: string }) => <pre data-testid='Editor'>{value}</pre>;
});
afterEach(async () => {
jest.resetAllMocks();
jest.restoreAllMocks();
});
describe('PodInfo', () => {
let podInfoSpy: any;
beforeEach(() => {
podInfoSpy = jest.spyOn(Apis, 'getPodInfo');
});
it('renders Editor with pod yaml', async () => {
podInfoSpy.mockImplementation(() =>
Promise.resolve({
kind: 'Pod',
metadata: {
name: 'test-pod',
},
}),
);
const { container } = render(<PodInfo name='test-pod' namespace='test-ns' />);
// Renders nothing when loading
expect(container).toMatchInlineSnapshot(`<div />`);
await act(TestUtils.flushPromises);
expect(container).toMatchInlineSnapshot(`
<div>
<pre
data-testid="Editor"
>
kind: Pod
metadata:
name: test-pod
</pre>
</div>
`);
});
it('renders pod yaml putting spec to the last section', async () => {
podInfoSpy.mockImplementation(() =>
Promise.resolve({
kind: 'Pod',
spec: {
property: 'value',
},
status: {
property: 'value2',
},
}),
);
const { container } = render(<PodInfo name='test-pod' namespace='test-ns' />);
await act(TestUtils.flushPromises);
expect(container).toMatchInlineSnapshot(`
<div>
<pre
data-testid="Editor"
>
kind: Pod
status:
property: value2
spec:
property: value
</pre>
</div>
`);
});
it('shows a warning banner when request fails', async () => {
podInfoSpy.mockImplementation(() => Promise.reject('Pod not found'));
const { getByText } = render(<PodInfo name='test-pod' namespace='test-ns' />);
await act(TestUtils.flushPromises);
getByText(
'Warning: failed to retrieve pod info. Possible reasons include cluster autoscaling, pod preemption or pod cleaned up by time to live configuration',
);
});
it('can be retried when request fails', async () => {
// Network was bad initially
podInfoSpy.mockImplementation(() => Promise.reject('Network failed'));
const { getByText } = render(<PodInfo name='test-pod' namespace='test-ns' />);
await act(TestUtils.flushPromises);
// Now network gets healthy
podInfoSpy.mockImplementation(() =>
Promise.resolve({
kind: 'Pod',
}),
);
const refreshButton = getByText('Refresh');
fireEvent.click(refreshButton);
await act(TestUtils.flushPromises);
getByText('kind: Pod');
});
it('refreshes automatically when pod name or namespace changes', async () => {
// Now network gets healthy
podInfoSpy.mockImplementation(() =>
Promise.resolve({
metadata: { name: 'pod-1' },
}),
);
const { getByText, rerender } = render(<PodInfo name='test-pod-1' namespace='test-ns' />);
expect(podInfoSpy).toHaveBeenLastCalledWith('test-pod-1', 'test-ns');
await act(TestUtils.flushPromises);
getByText(/pod-1/);
podInfoSpy.mockImplementation(() =>
Promise.resolve({
metadata: { name: 'pod-2' },
}),
);
rerender(<PodInfo name='test-pod-2' namespace='test-ns' />);
expect(podInfoSpy).toHaveBeenLastCalledWith('test-pod-2', 'test-ns');
await act(TestUtils.flushPromises);
getByText(/pod-2/);
});
});
// PodEvents is very similar to PodInfo, so we only test different parts here.
describe('PodEvents', () => {
let podEventsSpy: any;
beforeEach(() => {
podEventsSpy = jest.spyOn(Apis, 'getPodEvents');
});
it('renders Editor with pod events yaml', async () => {
podEventsSpy.mockImplementation(() =>
Promise.resolve({
kind: 'EventList',
}),
);
const { container } = render(<PodEvents name='test-pod' namespace='test-ns' />);
await act(TestUtils.flushPromises);
expect(container).toMatchInlineSnapshot(`
<div>
<pre
data-testid="Editor"
>
kind: EventList
</pre>
</div>
`);
});
it('shows a warning banner when request fails', async () => {
podEventsSpy.mockImplementation(() => Promise.reject('Pod not found'));
const { getByText } = render(<PodEvents name='test-pod' namespace='test-ns' />);
await act(TestUtils.flushPromises);
getByText(
'Warning: failed to retrieve pod events. Possible reasons include cluster autoscaling, pod preemption or pod cleaned up by time to live configuration',
);
});
});
| 7,932 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/CompareTable.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { logger } from '../lib/Utils';
import { stylesheet, classes } from 'typestyle';
import { color } from '../Css';
const borderStyle = `1px solid ${color.divider}`;
const css = stylesheet({
cell: {
border: borderStyle,
borderCollapse: 'collapse',
padding: 5,
},
labelCell: {
backgroundColor: color.lightGrey,
fontWeight: 'bold',
maxWidth: 200,
minWidth: 50,
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
},
root: {
border: borderStyle,
borderCollapse: 'collapse',
},
row: {
$nest: {
'&:hover': {
backgroundColor: '#f7f7f7',
},
},
},
});
export interface CompareTableProps {
rows: string[][];
xLabels: string[];
yLabels: string[];
}
class CompareTable extends React.PureComponent<CompareTableProps> {
public render(): JSX.Element | null {
const { rows, xLabels, yLabels } = this.props;
if (rows.length !== yLabels.length) {
logger.error(
`Number of rows (${rows.length}) should match the number of Y labels (${yLabels.length}).`,
);
}
if (!rows || rows.length === 0) {
return null;
}
return (
<table className={css.root}>
<tbody>
<tr className={css.row}>
<td className={css.labelCell} />
{/* X labels row */}
{xLabels.map((label, i) => (
<td key={i} className={classes(css.cell, css.labelCell)} title={label}>
{label}
</td>
))}
</tr>
{rows.map((row, i) => (
<tr key={i} className={css.row}>
{/* Y label */}
<td className={classes(css.cell, css.labelCell)} title={yLabels[i]}>
{yLabels[i]}
</td>
{/* Row cells */}
{row.map((cell, j) => (
<td key={j} className={css.cell} title={cell}>
{cell}
</td>
))}
</tr>
))}
</tbody>
</table>
);
}
}
export default CompareTable;
| 7,933 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/NewRunParameters.test.tsx | /*
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { mount, shallow } from 'enzyme';
import NewRunParameters, { NewRunParametersProps } from './NewRunParameters';
describe('NewRunParameters', () => {
it('shows parameters', () => {
const props = {
handleParamChange: jest.fn(),
initialParams: [{ name: 'testParam', value: 'testVal' }],
titleMessage: 'Specify parameters required by the pipeline',
} as NewRunParametersProps;
expect(shallow(<NewRunParameters {...props} />)).toMatchSnapshot();
});
it('does not display any text fields if there are no parameters', () => {
const props = {
handleParamChange: jest.fn(),
initialParams: [],
titleMessage: 'This pipeline has no parameters',
} as NewRunParametersProps;
expect(shallow(<NewRunParameters {...props} />)).toMatchSnapshot();
});
it('clicking the open editor button for json parameters displays an editor', () => {
const handleParamChange = jest.fn();
const props = {
handleParamChange,
initialParams: [{ name: 'testParam', value: '{"test":"value"}' }],
titleMessage: 'Specify json parameters required by the pipeline',
} as NewRunParametersProps;
const tree = mount(<NewRunParameters {...props} />);
tree
.findWhere(el => el.text() === 'Open Json Editor')
.hostNodes()
.find('Button')
.simulate('click');
expect(handleParamChange).toHaveBeenCalledTimes(1);
expect(handleParamChange).toHaveBeenLastCalledWith(0, '{\n "test": "value"\n}');
expect(tree.find('Editor')).toMatchSnapshot();
});
it('fires handleParamChange callback on change', () => {
const handleParamChange = jest.fn();
const props = {
handleParamChange,
initialParams: [
{ name: 'testParam1', value: 'testVal1' },
{ name: 'testParam2', value: 'testVal2' },
],
titleMessage: 'Specify parameters required by the pipeline',
} as NewRunParametersProps;
const tree = mount(<NewRunParameters {...props} />);
tree
.find('input#newRunPipelineParam1')
.simulate('change', { target: { value: 'test param value' } });
expect(handleParamChange).toHaveBeenCalledTimes(1);
expect(handleParamChange).toHaveBeenLastCalledWith(1, 'test param value');
});
});
| 7,934 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/ArtifactLink.tsx | import * as React from 'react';
import { generateGcsConsoleUri, generateMinioArtifactUrl } from '../lib/Utils';
/**
* A component that renders an artifact URL as clickable link if URL is correct
*/
export const ArtifactLink: React.FC<{ artifactUri?: string }> = ({ artifactUri }) => {
let clickableUrl: string | undefined;
if (artifactUri) {
if (artifactUri.startsWith('gs:')) {
const gcsConsoleUrl = generateGcsConsoleUri(artifactUri);
if (gcsConsoleUrl) {
clickableUrl = gcsConsoleUrl;
}
} else if (artifactUri.startsWith('http:') || artifactUri.startsWith('https:')) {
clickableUrl = artifactUri;
} else if (artifactUri.startsWith('minio:')) {
clickableUrl = generateMinioArtifactUrl(artifactUri);
}
}
if (clickableUrl) {
// Opens in new window safely
return (
<a href={clickableUrl} target={'_blank'} rel='noreferrer noopener'>
{artifactUri}
</a>
);
} else {
return <>{artifactUri}</>;
}
};
| 7,935 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/ResourceInfo.tsx | /*
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Artifact, Execution, getMetadataValue } from '@kubeflow/frontend';
import * as React from 'react';
import { stylesheet } from 'typestyle';
import { color, commonCss } from '../Css';
import { ArtifactLink } from './ArtifactLink';
export const css = stylesheet({
field: {
flexBasis: '300px',
marginBottom: '32px',
},
resourceInfo: {
display: 'flex',
flexDirection: 'row',
flexWrap: 'wrap',
},
term: {
color: color.grey,
fontSize: '12px',
letterSpacing: '0.2px',
lineHeight: '16px',
},
value: {
color: color.secondaryText,
fontSize: '14px',
letterSpacing: '0.2px',
lineHeight: '20px',
},
});
export enum ResourceType {
ARTIFACT = 'ARTIFACT',
EXECUTION = 'EXECUTION',
}
interface ArtifactProps {
resourceType: ResourceType.ARTIFACT;
resource: Artifact;
typeName: string;
}
interface ExecutionProps {
resourceType: ResourceType.EXECUTION;
resource: Execution;
typeName: string;
}
export type ResourceInfoProps = ArtifactProps | ExecutionProps;
export class ResourceInfo extends React.Component<ResourceInfoProps, {}> {
public render(): JSX.Element {
const { resource } = this.props;
const propertyMap = resource.getPropertiesMap();
const customPropertyMap = resource.getCustomPropertiesMap();
return (
<section>
<h1 className={commonCss.header}>Type: {this.props.typeName}</h1>
{(() => {
if (this.props.resourceType === ResourceType.ARTIFACT) {
return (
<>
<dt className={css.term}>URI</dt>
<dd className={css.value}>
<ArtifactLink artifactUri={this.props.resource.getUri()} />
</dd>
</>
);
}
return null;
})()}
<h2 className={commonCss.header2}>Properties</h2>
<dl className={css.resourceInfo}>
{propertyMap
.getEntryList()
// TODO: __ALL_META__ is something of a hack, is redundant, and can be ignored
.filter(k => k[0] !== '__ALL_META__')
.map(k => (
<div className={css.field} key={k[0]}>
<dt className={css.term}>{k[0]}</dt>
<dd className={css.value}>
{propertyMap && prettyPrintJsonValue(getMetadataValue(propertyMap.get(k[0])))}
</dd>
</div>
))}
</dl>
<h2 className={commonCss.header2}>Custom Properties</h2>
<dl className={css.resourceInfo}>
{customPropertyMap.getEntryList().map(k => (
<div className={css.field} key={k[0]}>
<dt className={css.term}>{k[0]}</dt>
<dd className={css.value}>
{customPropertyMap &&
prettyPrintJsonValue(getMetadataValue(customPropertyMap.get(k[0])))}
</dd>
</div>
))}
</dl>
</section>
);
}
}
function prettyPrintJsonValue(value: string | number): JSX.Element | number | string {
if (typeof value === 'number') {
return value;
}
try {
const jsonValue = JSON.parse(value);
return <pre>{JSON.stringify(jsonValue, null, 2)}</pre>;
} catch {
// not JSON, return directly
return value;
}
}
| 7,936 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/UploadPipelineDialog.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import BusyButton from '../atoms/BusyButton';
import Button from '@material-ui/core/Button';
import Dialog from '@material-ui/core/Dialog';
import DialogActions from '@material-ui/core/DialogActions';
import DialogTitle from '@material-ui/core/DialogTitle';
import Dropzone from 'react-dropzone';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import Input from '../atoms/Input';
import InputAdornment from '@material-ui/core/InputAdornment';
import Radio from '@material-ui/core/Radio';
import { TextFieldProps } from '@material-ui/core/TextField';
import { padding, commonCss, zIndex, color } from '../Css';
import { stylesheet, classes } from 'typestyle';
import { ExternalLink } from '../atoms/ExternalLink';
const css = stylesheet({
dropOverlay: {
backgroundColor: color.lightGrey,
border: '2px dashed #aaa',
bottom: 0,
left: 0,
padding: '2.5em 0',
position: 'absolute',
right: 0,
textAlign: 'center',
top: 0,
zIndex: zIndex.DROP_ZONE_OVERLAY,
},
root: {
width: 500,
},
});
export enum ImportMethod {
LOCAL = 'local',
URL = 'url',
}
interface UploadPipelineDialogProps {
open: boolean;
onClose: (
confirmed: boolean,
name: string,
file: File | null,
url: string,
method: ImportMethod,
description?: string,
) => Promise<boolean>;
}
interface UploadPipelineDialogState {
busy: boolean;
dropzoneActive: boolean;
file: File | null;
fileName: string;
fileUrl: string;
importMethod: ImportMethod;
uploadPipelineDescription: string;
uploadPipelineName: string;
}
class UploadPipelineDialog extends React.Component<
UploadPipelineDialogProps,
UploadPipelineDialogState
> {
private _dropzoneRef = React.createRef<Dropzone & HTMLDivElement>();
constructor(props: any) {
super(props);
this.state = {
busy: false,
dropzoneActive: false,
file: null,
fileName: '',
fileUrl: '',
importMethod: ImportMethod.LOCAL,
uploadPipelineDescription: '',
uploadPipelineName: '',
};
}
public render(): JSX.Element {
const {
dropzoneActive,
file,
fileName,
fileUrl,
importMethod,
uploadPipelineName,
busy,
} = this.state;
return (
<Dialog
id='uploadDialog'
onClose={() => this._uploadDialogClosed(false)}
open={this.props.open}
classes={{ paper: css.root }}
>
<DialogTitle>Upload and name your pipeline</DialogTitle>
<div className={padding(20, 'lr')}>
<div className={classes(commonCss.flex, padding(10, 'b'))}>
<FormControlLabel
id='uploadLocalFileBtn'
label='Upload a file'
checked={importMethod === ImportMethod.LOCAL}
control={<Radio color='primary' />}
onChange={() => this.setState({ importMethod: ImportMethod.LOCAL })}
/>
<FormControlLabel
id='uploadFromUrlBtn'
label='Import by URL'
checked={importMethod === ImportMethod.URL}
control={<Radio color='primary' />}
onChange={() => this.setState({ importMethod: ImportMethod.URL })}
/>
</div>
{importMethod === ImportMethod.LOCAL && (
<React.Fragment>
<Dropzone
id='dropZone'
disableClick={true}
onDrop={this._onDrop.bind(this)}
onDragEnter={this._onDropzoneDragEnter.bind(this)}
onDragLeave={this._onDropzoneDragLeave.bind(this)}
style={{ position: 'relative' }}
ref={this._dropzoneRef}
inputProps={{ tabIndex: -1 }}
>
{dropzoneActive && <div className={css.dropOverlay}>Drop files..</div>}
<div className={padding(10, 'b')}>
Choose a pipeline package file from your computer, and give the pipeline a unique
name.
<br />
You can also drag and drop the file here.
</div>
<DocumentationCompilePipeline />
<Input
onChange={this.handleChange('fileName')}
value={fileName}
required={true}
label='File'
variant='outlined'
InputProps={{
endAdornment: (
<InputAdornment position='end'>
<Button
color='secondary'
onClick={() => this._dropzoneRef.current!.open()}
style={{ padding: '3px 5px', margin: 0, whiteSpace: 'nowrap' }}
>
Choose file
</Button>
</InputAdornment>
),
readOnly: true,
}}
/>
</Dropzone>
</React.Fragment>
)}
{importMethod === ImportMethod.URL && (
<React.Fragment>
<div className={padding(10, 'b')}>URL must be publicly accessible.</div>
<DocumentationCompilePipeline />
<Input
onChange={this.handleChange('fileUrl')}
value={fileUrl}
required={true}
label='URL'
variant='outlined'
/>
</React.Fragment>
)}
<Input
id='uploadFileName'
label='Pipeline name'
onChange={this.handleChange('uploadPipelineName')}
required={true}
value={uploadPipelineName}
variant='outlined'
/>
</div>
{/* <Input label='Pipeline description'
onChange={this.handleChange('uploadPipelineDescription')}
value={uploadPipelineDescription} multiline={true} variant='outlined' /> */}
<DialogActions>
<Button id='cancelUploadBtn' onClick={() => this._uploadDialogClosed.bind(this)(false)}>
Cancel
</Button>
<BusyButton
id='confirmUploadBtn'
onClick={() => this._uploadDialogClosed.bind(this)(true)}
title='Upload'
busy={busy}
disabled={
!uploadPipelineName || (importMethod === ImportMethod.LOCAL ? !file : !fileUrl)
}
/>
</DialogActions>
</Dialog>
);
}
public handleChange = (name: string) => (event: any) => {
this.setState({
[name]: (event.target as TextFieldProps).value,
} as any);
};
private _onDropzoneDragEnter(): void {
this.setState({ dropzoneActive: true });
}
private _onDropzoneDragLeave(): void {
this.setState({ dropzoneActive: false });
}
private _onDrop(files: File[]): void {
this.setState({
dropzoneActive: false,
file: files[0],
fileName: files[0].name,
// Suggest all characters left of first . as pipeline name
uploadPipelineName: files[0].name.split('.')[0],
});
}
private _uploadDialogClosed(confirmed: boolean): void {
this.setState({ busy: true }, async () => {
const success = await this.props.onClose(
confirmed,
this.state.uploadPipelineName,
this.state.file,
this.state.fileUrl.trim(),
this.state.importMethod,
this.state.uploadPipelineDescription,
);
if (success) {
this.setState({
busy: false,
dropzoneActive: false,
file: null,
fileName: '',
fileUrl: '',
importMethod: ImportMethod.LOCAL,
uploadPipelineDescription: '',
uploadPipelineName: '',
});
} else {
this.setState({ busy: false });
}
});
}
}
export default UploadPipelineDialog;
const DocumentationCompilePipeline: React.FC = () => (
<div className={padding(10, 'b')}>
For expected file format, refer to{' '}
<ExternalLink href='https://www.kubeflow.org/docs/pipelines/sdk/build-component/#compile-the-pipeline'>
Compile Pipeline Documentation
</ExternalLink>
.
</div>
);
| 7,937 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/ExperimentList.tsx | import CustomTable, { Column, CustomRendererProps, Row, ExpandState } from './CustomTable';
import * as React from 'react';
import { Link, RouteComponentProps } from 'react-router-dom';
import {
ApiListExperimentsResponse,
ApiExperiment,
ExperimentStorageState,
} from '../apis/experiment';
import { errorToMessage } from '../lib/Utils';
import { RoutePage, RouteParams } from './Router';
import { commonCss } from '../Css';
import { Apis, ExperimentSortKeys, ListRequest } from '../lib/Apis';
import { RunStorageState } from 'src/apis/run';
import RunList from '../pages/RunList';
import { PredicateOp, ApiFilter } from '../apis/filter';
import produce from 'immer';
import Tooltip from '@material-ui/core/Tooltip';
export interface ExperimentListProps extends RouteComponentProps {
namespace?: string;
storageState?: ExperimentStorageState;
onError: (message: string, error: Error) => void;
}
interface DisplayExperiment extends ApiExperiment {
error?: string;
expandState?: ExpandState;
}
interface ExperimentListState {
displayExperiments: DisplayExperiment[];
}
export class ExperimentList extends React.PureComponent<ExperimentListProps, ExperimentListState> {
private _tableRef = React.createRef<CustomTable>();
constructor(props: any) {
super(props);
this.state = {
displayExperiments: [],
};
}
public render(): JSX.Element {
const columns: Column[] = [
{
customRenderer: this._nameCustomRenderer,
flex: 1,
label: 'Experiment name',
sortKey: ExperimentSortKeys.NAME,
},
{
flex: 2,
label: 'Description',
},
];
const rows: Row[] = this.state.displayExperiments.map(exp => {
return {
error: exp.error,
expandState: exp.expandState,
id: exp.id!,
otherFields: [exp.name!, exp.description!],
};
});
return (
<div>
<CustomTable
columns={columns}
rows={rows}
ref={this._tableRef}
disableSelection={true}
initialSortColumn={ExperimentSortKeys.CREATED_AT}
reload={this._loadExperiments.bind(this)}
toggleExpansion={this._toggleRowExpand.bind(this)}
getExpandComponent={this._getExpandedExperimentComponent.bind(this)}
filterLabel='Filter experiments'
emptyMessage='No experiments found. Click "Create experiment" to start.'
/>
</div>
);
}
public async refresh(): Promise<void> {
if (this._tableRef.current) {
await this._tableRef.current.reload();
}
}
public _nameCustomRenderer: React.FC<CustomRendererProps<string>> = (
props: CustomRendererProps<string>,
) => {
return (
<Tooltip title={props.value} enterDelay={300} placement='top-start'>
<Link
className={commonCss.link}
onClick={e => e.stopPropagation()}
to={RoutePage.EXPERIMENT_DETAILS.replace(':' + RouteParams.experimentId, props.id)}
>
{props.value}
</Link>
</Tooltip>
);
};
protected async _loadExperiments(request: ListRequest): Promise<string> {
let nextPageToken = '';
let displayExperiments: DisplayExperiment[];
if (this.props.storageState) {
try {
// Augment the request filter with the storage state predicate
const filter = JSON.parse(
decodeURIComponent(request.filter || '{"predicates": []}'),
) as ApiFilter;
filter.predicates = (filter.predicates || []).concat([
{
key: 'storage_state',
// Use EQUALS ARCHIVED or NOT EQUALS ARCHIVED to account for cases where the field
// is missing, in which case it should be counted as available.
op:
this.props.storageState === ExperimentStorageState.ARCHIVED
? PredicateOp.EQUALS
: PredicateOp.NOTEQUALS,
string_value: ExperimentStorageState.ARCHIVED.toString(),
},
]);
request.filter = encodeURIComponent(JSON.stringify(filter));
} catch (err) {
const error = new Error(await errorToMessage(err));
this.props.onError('Error: failed to parse request filter: ', error);
return '';
}
}
try {
let response: ApiListExperimentsResponse;
response = await Apis.experimentServiceApi.listExperiment(
request.pageToken,
request.pageSize,
request.sortBy,
request.filter,
this.props.namespace ? 'NAMESPACE' : undefined,
this.props.namespace || undefined,
);
nextPageToken = response.next_page_token || '';
displayExperiments = response.experiments || [];
displayExperiments.forEach(exp => (exp.expandState = ExpandState.COLLAPSED));
this.setState({ displayExperiments });
} catch (err) {
const error = new Error(await errorToMessage(err));
this.props.onError('Error: failed to list experiments: ', error);
return '';
}
return nextPageToken;
}
private _toggleRowExpand(rowIndex: number): void {
const displayExperiments = produce(this.state.displayExperiments, draft => {
draft[rowIndex].expandState =
draft[rowIndex].expandState === ExpandState.COLLAPSED
? ExpandState.EXPANDED
: ExpandState.COLLAPSED;
});
this.setState({ displayExperiments });
}
private _getExpandedExperimentComponent(experimentIndex: number): JSX.Element {
const experiment = this.state.displayExperiments[experimentIndex];
return (
<RunList
hideExperimentColumn={true}
experimentIdMask={experiment.id}
onError={() => null}
{...this.props}
disablePaging={true}
noFilterBox={true}
storageState={
this.props.storageState === ExperimentStorageState.ARCHIVED
? RunStorageState.ARCHIVED
: RunStorageState.AVAILABLE
}
disableSorting={true}
disableSelection={true}
/>
);
}
}
export default ExperimentList;
| 7,938 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/ExperimentList.test.tsx | /*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import * as Utils from '../lib/Utils';
import { ExperimentList, ExperimentListProps } from './ExperimentList';
import TestUtils from '../TestUtils';
import { ApiFilter, PredicateOp } from '../apis/filter';
import { RunStorageState } from '../apis/run';
import { ExperimentStorageState } from '../apis/experiment';
import { ExpandState } from './CustomTable';
import { Apis, ExperimentSortKeys, ListRequest } from '../lib/Apis';
import { ReactWrapper, ShallowWrapper, shallow } from 'enzyme';
import { range } from 'lodash';
class ExperimentListTest extends ExperimentList {
public _loadExperiments(request: ListRequest): Promise<string> {
return super._loadExperiments(request);
}
}
describe('ExperimentList', () => {
let tree: ShallowWrapper | ReactWrapper;
const onErrorSpy = jest.fn();
const listExperimentsSpy = jest.spyOn(Apis.experimentServiceApi, 'listExperiment');
const getExperimentSpy = jest.spyOn(Apis.experimentServiceApi, 'getExperiment');
// We mock this because it uses toLocaleDateString, which causes mismatches between local and CI
// test enviroments
const formatDateStringSpy = jest.spyOn(Utils, 'formatDateString');
const listRunsSpy = jest.spyOn(Apis.runServiceApi, 'listRuns');
function generateProps(): ExperimentListProps {
return {
history: {} as any,
location: { search: '' } as any,
match: '' as any,
onError: onErrorSpy,
};
}
function mockNExperiments(n: number): void {
getExperimentSpy.mockImplementation(id =>
Promise.resolve({
id: 'testexperiment' + id,
name: 'experiment with id: testexperiment' + id,
}),
);
listExperimentsSpy.mockImplementation(() =>
Promise.resolve({
experiments: range(1, n + 1).map(i => {
return {
id: 'testexperiment' + i,
name: 'experiment with id: testexperiment' + i,
};
}),
}),
);
}
beforeEach(() => {
formatDateStringSpy.mockImplementation((date?: Date) => {
return date ? '1/2/2019, 12:34:56 PM' : '-';
});
onErrorSpy.mockClear();
listExperimentsSpy.mockClear();
getExperimentSpy.mockClear();
});
afterEach(async () => {
// unmount() should be called before resetAllMocks() in case any part of the unmount life cycle
// depends on mocks/spies
if (tree) {
await tree.unmount();
}
jest.resetAllMocks();
});
it('renders the empty experience', () => {
expect(shallow(<ExperimentList {...generateProps()} />)).toMatchSnapshot();
});
it('renders the empty experience in ARCHIVED state', () => {
const props = generateProps();
props.storageState = ExperimentStorageState.ARCHIVED;
expect(shallow(<ExperimentList {...props} />)).toMatchSnapshot();
});
it('loads experiments whose storage state is not ARCHIVED when storage state equals AVAILABLE', async () => {
mockNExperiments(1);
const props = generateProps();
props.storageState = ExperimentStorageState.AVAILABLE;
tree = shallow(<ExperimentList {...props} />);
await (tree.instance() as ExperimentListTest)._loadExperiments({});
expect(Apis.experimentServiceApi.listExperiment).toHaveBeenLastCalledWith(
undefined,
undefined,
undefined,
encodeURIComponent(
JSON.stringify({
predicates: [
{
key: 'storage_state',
op: PredicateOp.NOTEQUALS,
string_value: ExperimentStorageState.ARCHIVED.toString(),
},
],
} as ApiFilter),
),
undefined,
undefined,
);
});
it('loads experiments whose storage state is ARCHIVED when storage state equals ARCHIVED', async () => {
mockNExperiments(1);
const props = generateProps();
props.storageState = ExperimentStorageState.ARCHIVED;
tree = shallow(<ExperimentList {...props} />);
await (tree.instance() as ExperimentListTest)._loadExperiments({});
expect(Apis.experimentServiceApi.listExperiment).toHaveBeenLastCalledWith(
undefined,
undefined,
undefined,
encodeURIComponent(
JSON.stringify({
predicates: [
{
key: 'storage_state',
op: PredicateOp.EQUALS,
string_value: ExperimentStorageState.ARCHIVED.toString(),
},
],
} as ApiFilter),
),
undefined,
undefined,
);
});
it('augments request filter with storage state predicates', async () => {
mockNExperiments(1);
const props = generateProps();
props.storageState = ExperimentStorageState.ARCHIVED;
tree = shallow(<ExperimentList {...props} />);
await (tree.instance() as ExperimentListTest)._loadExperiments({
filter: encodeURIComponent(
JSON.stringify({
predicates: [{ key: 'k', op: 'op', string_value: 'val' }],
}),
),
});
expect(Apis.experimentServiceApi.listExperiment).toHaveBeenLastCalledWith(
undefined,
undefined,
undefined,
encodeURIComponent(
JSON.stringify({
predicates: [
{
key: 'k',
op: 'op',
string_value: 'val',
},
{
key: 'storage_state',
op: PredicateOp.EQUALS,
string_value: ExperimentStorageState.ARCHIVED.toString(),
},
],
} as ApiFilter),
),
undefined,
undefined,
);
});
it('loads one experiment', async () => {
mockNExperiments(1);
const props = generateProps();
tree = shallow(<ExperimentList {...props} />);
await (tree.instance() as ExperimentListTest)._loadExperiments({});
expect(Apis.experimentServiceApi.listExperiment).toHaveBeenLastCalledWith(
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
);
expect(props.onError).not.toHaveBeenCalled();
expect(tree).toMatchSnapshot();
});
it('reloads the experiment when refresh is called', async () => {
mockNExperiments(0);
const props = generateProps();
tree = TestUtils.mountWithRouter(<ExperimentList {...props} />);
await (tree.instance() as ExperimentList).refresh();
tree.update();
expect(Apis.experimentServiceApi.listExperiment).toHaveBeenCalledTimes(2);
expect(Apis.experimentServiceApi.listExperiment).toHaveBeenLastCalledWith(
'',
10,
ExperimentSortKeys.CREATED_AT + ' desc',
'',
undefined,
undefined,
);
expect(props.onError).not.toHaveBeenCalled();
expect(tree).toMatchSnapshot();
});
it('loads multiple experiments', async () => {
mockNExperiments(5);
const props = generateProps();
tree = shallow(<ExperimentList {...props} />);
await (tree.instance() as ExperimentListTest)._loadExperiments({});
expect(props.onError).not.toHaveBeenCalled();
expect(tree).toMatchSnapshot();
});
it('calls error callback when loading experiment fails', async () => {
TestUtils.makeErrorResponseOnce(
jest.spyOn(Apis.experimentServiceApi, 'listExperiment'),
'bad stuff happened',
);
const props = generateProps();
tree = shallow(<ExperimentList {...props} />);
await (tree.instance() as ExperimentListTest)._loadExperiments({});
expect(props.onError).toHaveBeenLastCalledWith(
'Error: failed to list experiments: ',
new Error('bad stuff happened'),
);
});
it('loads runs for a given experiment id when it is expanded', async () => {
listRunsSpy.mockImplementation(() => {});
mockNExperiments(1);
const props = generateProps();
tree = TestUtils.mountWithRouter(<ExperimentList {...props} />);
await (tree.instance() as ExperimentListTest)._loadExperiments({});
tree.update();
expect(props.onError).not.toHaveBeenCalled();
expect(tree.state()).toHaveProperty('displayExperiments', [
{
expandState: ExpandState.COLLAPSED,
id: 'testexperiment1',
name: 'experiment with id: testexperiment1',
},
]);
// Expand the first experiment
tree
.find('button[aria-label="Expand"]')
.at(0)
.simulate('click');
await listRunsSpy;
tree.update();
expect(tree.state()).toHaveProperty('displayExperiments', [
{
expandState: ExpandState.EXPANDED,
id: 'testexperiment1',
name: 'experiment with id: testexperiment1',
},
]);
expect(Apis.runServiceApi.listRuns).toHaveBeenCalledTimes(1);
expect(Apis.runServiceApi.listRuns).toHaveBeenLastCalledWith(
'',
10,
'created_at desc',
'EXPERIMENT',
'testexperiment1',
encodeURIComponent(
JSON.stringify({
predicates: [
{
key: 'storage_state',
op: PredicateOp.NOTEQUALS,
string_value: RunStorageState.ARCHIVED.toString(),
},
],
} as ApiFilter),
),
);
});
it('loads runs for a given experiment id with augumented storage state when it is expanded', async () => {
listRunsSpy.mockImplementation(() => {});
mockNExperiments(1);
const props = generateProps();
props.storageState = ExperimentStorageState.ARCHIVED;
tree = TestUtils.mountWithRouter(<ExperimentList {...props} />);
await (tree.instance() as ExperimentListTest)._loadExperiments({});
tree.update();
expect(props.onError).not.toHaveBeenCalled();
expect(tree.state()).toHaveProperty('displayExperiments', [
{
expandState: ExpandState.COLLAPSED,
id: 'testexperiment1',
name: 'experiment with id: testexperiment1',
},
]);
// Expand the first experiment
tree
.find('button[aria-label="Expand"]')
.at(0)
.simulate('click');
await listRunsSpy;
tree.update();
expect(tree.state()).toHaveProperty('displayExperiments', [
{
expandState: ExpandState.EXPANDED,
id: 'testexperiment1',
name: 'experiment with id: testexperiment1',
},
]);
expect(Apis.runServiceApi.listRuns).toHaveBeenCalledTimes(1);
expect(Apis.runServiceApi.listRuns).toHaveBeenLastCalledWith(
'',
10,
'created_at desc',
'EXPERIMENT',
'testexperiment1',
encodeURIComponent(
JSON.stringify({
predicates: [
{
key: 'storage_state',
op: PredicateOp.EQUALS,
string_value: RunStorageState.ARCHIVED.toString(),
},
],
} as ApiFilter),
),
);
});
});
| 7,939 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/CustomTableRow.tsx | /*
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import Tooltip from '@material-ui/core/Tooltip';
import WarningIcon from '@material-ui/icons/WarningRounded';
import { Row, Column } from './CustomTable';
import { color, fonts, fontsize } from '../Css';
import { stylesheet } from 'typestyle';
export const css = stylesheet({
cell: {
$nest: {
'&:not(:nth-child(2))': {
color: color.inactive,
},
},
alignSelf: 'center',
borderBottom: 'initial',
color: color.foreground,
fontFamily: fonts.secondary,
fontSize: fontsize.base,
letterSpacing: 0.25,
marginRight: 20,
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
},
icon: {
color: color.alert,
height: 18,
paddingRight: 4,
verticalAlign: 'sub',
width: 18,
},
row: {
$nest: {
'&:hover': {
backgroundColor: '#f3f3f3',
},
},
borderBottom: '1px solid #ddd',
display: 'flex',
flexShrink: 0,
height: 40,
outline: 'none',
},
});
interface CustomTableRowProps {
row: Row;
columns: Column[];
}
function calculateColumnWidths(columns: Column[]): number[] {
const totalFlex = columns.reduce((total, c) => (total += c.flex || 1), 0);
return columns.map(c => ((c.flex || 1) / totalFlex) * 100);
}
// tslint:disable-next-line:variable-name
export const CustomTableRow: React.FC<CustomTableRowProps> = (props: CustomTableRowProps) => {
const { row, columns } = props;
const widths = calculateColumnWidths(columns);
return (
<React.Fragment>
{row.otherFields.map((cell, i) => (
<div key={i} style={{ width: widths[i] + '%' }} className={css.cell}>
{i === 0 && row.error && (
<Tooltip title={row.error}>
<WarningIcon className={css.icon} />
</Tooltip>
)}
{columns[i].customRenderer
? columns[i].customRenderer!({ value: cell, id: row.id })
: cell}
</div>
))}
</React.Fragment>
);
};
| 7,940 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/Toolbar.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import IconButton from '@material-ui/core/IconButton';
import Tooltip from '@material-ui/core/Tooltip';
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
import ChevronRightIcon from '@material-ui/icons/ChevronRight';
import { History } from 'history';
import * as React from 'react';
import { CSSProperties } from 'react';
import { Link } from 'react-router-dom';
import { classes, stylesheet } from 'typestyle';
import BusyButton from '../atoms/BusyButton';
import { color, commonCss, dimension, fonts, fontsize, spacing } from '../Css';
export interface ToolbarActionMap {
[key: string]: ToolbarActionConfig;
}
export interface ToolbarActionConfig {
action: () => void;
busy?: boolean;
disabled?: boolean;
disabledTitle?: string;
icon?: any;
id?: string;
outlined?: boolean;
primary?: boolean;
style?: CSSProperties;
title: string;
tooltip: string;
}
export interface Breadcrumb {
displayName: string;
href: string;
}
const backIconHeight = 24;
const css = stylesheet({
actions: {
display: 'flex',
marginRight: spacing.units(-2),
},
backIcon: {
fontSize: backIconHeight,
verticalAlign: 'bottom',
},
backLink: {
cursor: 'pointer',
marginRight: 10,
padding: 3,
},
breadcrumbs: {
color: color.inactive,
fontFamily: fonts.secondary,
fontSize: fontsize.small,
letterSpacing: 0.25,
margin: '10px 37px',
},
chevron: {
height: 12,
},
disabled: {
color: '#aaa',
},
enabled: {
color: color.foreground,
},
link: {
$nest: {
'&:hover': {
background: color.lightGrey,
},
},
borderRadius: 3,
padding: 3,
},
pageName: {
color: color.strong,
fontSize: fontsize.pageTitle,
lineHeight: '28px',
},
root: {
alignItems: 'center',
display: 'flex',
flexShrink: 0,
height: dimension.jumbo,
justifyContent: 'space-between',
},
topLevelToolbar: {
borderBottom: `1px solid ${color.lightGrey}`,
paddingBottom: 15,
paddingLeft: 20,
},
});
export interface ToolbarProps {
actions: ToolbarActionMap;
breadcrumbs: Breadcrumb[];
history?: History;
pageTitle: string | JSX.Element;
pageTitleTooltip?: string;
topLevelToolbar?: boolean;
}
class Toolbar extends React.Component<ToolbarProps> {
public render(): JSX.Element | null {
const { actions, breadcrumbs, pageTitle, pageTitleTooltip } = { ...this.props };
if (!actions.length && !breadcrumbs.length && !pageTitle) {
return null;
}
return (
<div
className={classes(css.root, this.props.topLevelToolbar !== false && css.topLevelToolbar)}
>
<div style={{ minWidth: 100 }}>
{/* Breadcrumb */}
<div className={classes(css.breadcrumbs, commonCss.flex)}>
{breadcrumbs.map((crumb, i) => (
<span className={commonCss.flex} key={i} title={crumb.displayName}>
{i !== 0 && <ChevronRightIcon className={css.chevron} />}
<Link
className={classes(commonCss.unstyled, commonCss.ellipsis, css.link)}
to={crumb.href}
>
{crumb.displayName}
</Link>
</span>
))}
</div>
<div className={commonCss.flex}>
{/* Back Arrow */}
{breadcrumbs.length > 0 && (
<Tooltip title={'Back'} enterDelay={300}>
<div>
{' '}
{/* Div needed because we sometimes disable a button within a tooltip */}
<IconButton
className={css.backLink}
disabled={this.props.history!.length < 2}
onClick={this.props.history!.goBack}
>
<ArrowBackIcon
className={classes(
css.backIcon,
this.props.history!.length < 2 ? css.disabled : css.enabled,
)}
/>
</IconButton>
</div>
</Tooltip>
)}
{/* Resource Name */}
<span
className={classes(css.pageName, commonCss.ellipsis)}
title={pageTitleTooltip}
data-testid='page-title' // TODO: use a proper h1 tag for page titles and let tests query this by h1.
>
{pageTitle}
</span>
</div>
</div>
{/* Actions / Buttons */}
<div className={css.actions}>
{Object.keys(actions).map((buttonKey, i) => {
const button = actions[buttonKey];
return (
<Tooltip
title={
button.disabled && button.disabledTitle ? button.disabledTitle : button.tooltip
}
enterDelay={300}
key={i}
>
<div style={button.style}>
{/* Extra level needed by tooltip when child is disabled */}
<BusyButton
id={button.id}
color='secondary'
onClick={button.action}
disabled={button.disabled}
title={button.title}
icon={button.icon}
busy={button.busy || false}
outlined={(button.outlined && !button.primary) || false}
className={button.primary ? commonCss.buttonAction : ''}
/>
</div>
</Tooltip>
);
})}
</div>
</div>
);
}
}
export default Toolbar;
| 7,941 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/Editor.test.tsx | /*
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { mount } from 'enzyme';
import Editor from './Editor';
/*
These tests mimic https://github.com/securingsincity/react-ace/blob/master/tests/src/ace.spec.js
to ensure that editor properties (placeholder and value) can be properly
tested.
*/
describe('Editor', () => {
it('renders without a placeholder and value', () => {
const tree = mount(<Editor />);
expect(tree.html()).toMatchSnapshot();
});
it('renders with a placeholder', () => {
const placeholder = 'I am a placeholder.';
const tree = mount(<Editor placeholder={placeholder} />);
expect(tree.html()).toMatchSnapshot();
});
it('renders a placeholder that contains HTML', () => {
const placeholder = 'I am a placeholder with <strong>HTML</strong>.';
const tree = mount(<Editor placeholder={placeholder} />);
expect(tree.html()).toMatchSnapshot();
});
it('has its value set to the provided value', () => {
const value = 'I am a value.';
const tree = mount(<Editor value={value} />);
expect(tree).not.toBeNull();
const editor = (tree.instance() as any).editor;
expect(editor.getValue()).toBe(value);
});
});
| 7,942 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/Trigger.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Button from '@material-ui/core/Button';
import Checkbox from '@material-ui/core/Checkbox';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import MenuItem from '@material-ui/core/MenuItem';
import * as React from 'react';
import { stylesheet } from 'typestyle';
import { ApiTrigger } from '../apis/job';
import { HelpButton } from '../atoms/HelpButton';
import Input from '../atoms/Input';
import Separator from '../atoms/Separator';
import { commonCss } from '../Css';
import {
buildCron,
buildTrigger,
dateToPickerFormat,
PeriodicInterval,
pickersToDate,
triggers,
TriggerType,
} from '../lib/TriggerUtils';
interface TriggerProps {
onChange?: (config: {
trigger?: ApiTrigger;
maxConcurrentRuns?: string;
catchup: boolean;
}) => void;
}
interface TriggerState {
cron: string;
editCron: boolean;
endDate: string;
endTime: string;
hasEndDate: boolean;
hasStartDate: boolean;
intervalCategory: PeriodicInterval;
intervalValue: number;
maxConcurrentRuns: string;
selectedDays: boolean[];
startDate: string;
startTime: string;
type: TriggerType;
catchup: boolean;
}
const css = stylesheet({
noMargin: {
margin: 0,
},
});
export default class Trigger extends React.Component<TriggerProps, TriggerState> {
public state = (() => {
const now = new Date();
const inAWeek = new Date(
now.getFullYear(),
now.getMonth(),
now.getDate() + 7,
now.getHours(),
now.getMinutes(),
);
const [startDate, startTime] = dateToPickerFormat(now);
const [endDate, endTime] = dateToPickerFormat(inAWeek);
return {
catchup: true,
cron: '',
editCron: false,
endDate,
endTime,
hasEndDate: false,
hasStartDate: false,
intervalCategory: PeriodicInterval.MINUTE,
intervalValue: 1,
maxConcurrentRuns: '10',
selectedDays: new Array(7).fill(true),
startDate,
startTime,
type: TriggerType.INTERVALED,
};
})();
public componentDidMount(): void {
// TODO: This is called here because NewRun only updates its Trigger in state when onChange is
// called on the Trigger, which without this may never happen if a user doesn't interact with
// the Trigger. NewRun should probably keep the Trigger state and pass it down as a prop to this
this._updateTrigger();
}
public render(): JSX.Element {
const {
cron,
editCron,
endDate,
endTime,
hasEndDate,
hasStartDate,
intervalCategory,
intervalValue,
maxConcurrentRuns,
selectedDays,
startDate,
startTime,
type,
catchup,
} = this.state;
return (
<div>
<Input
select={true}
label='Trigger type'
required={true}
onChange={this.handleChange('type')}
value={type}
variant='outlined'
>
{Array.from(triggers.entries()).map((trigger, i) => (
<MenuItem key={i} value={trigger[0]}>
{trigger[1].displayName}
</MenuItem>
))}
</Input>
<div>
<Input
label='Maximum concurrent runs'
required={true}
onChange={this.handleChange('maxConcurrentRuns')}
value={maxConcurrentRuns}
variant='outlined'
/>
<div className={commonCss.flex}>
<FormControlLabel
control={
<Checkbox
checked={hasStartDate}
color='primary'
onClick={this.handleChange('hasStartDate')}
/>
}
label='Has start date'
/>
<Input
label='Start date'
type='date'
onChange={this.handleChange('startDate')}
value={startDate}
width={160}
variant='outlined'
InputLabelProps={{ classes: { outlined: css.noMargin }, shrink: true }}
style={{ visibility: hasStartDate ? 'visible' : 'hidden' }}
/>
<Separator />
<Input
label='Start time'
type='time'
onChange={this.handleChange('startTime')}
value={startTime}
width={120}
variant='outlined'
InputLabelProps={{ classes: { outlined: css.noMargin }, shrink: true }}
style={{ visibility: hasStartDate ? 'visible' : 'hidden' }}
/>
</div>
<div className={commonCss.flex}>
<FormControlLabel
control={
<Checkbox
checked={hasEndDate}
color='primary'
onClick={this.handleChange('hasEndDate')}
/>
}
label='Has end date'
/>
<Input
label='End date'
type='date'
onChange={this.handleChange('endDate')}
value={endDate}
width={160}
style={{ visibility: hasEndDate ? 'visible' : 'hidden' }}
InputLabelProps={{ classes: { outlined: css.noMargin }, shrink: true }}
variant='outlined'
/>
<Separator />
<Input
label='End time'
type='time'
onChange={this.handleChange('endTime')}
value={endTime}
width={120}
style={{ visibility: hasEndDate ? 'visible' : 'hidden' }}
InputLabelProps={{ classes: { outlined: css.noMargin }, shrink: true }}
variant='outlined'
/>
</div>
<span className={commonCss.flex}>
<FormControlLabel
control={
<Checkbox
checked={catchup}
color='primary'
onClick={this.handleChange('catchup')}
/>
}
label='Catchup'
/>
<HelpButton
helpText={
<div>
<p>
Whether the recurring run should catch up if behind schedule. Defaults to true.
</p>
<p>
For example, if the recurring run is paused for a while and re-enabled
afterwards. If catchup=true, the scheduler will catch up on (backfill) each
missed interval. Otherwise, it only schedules the latest interval if more than
one interval is ready to be scheduled.
</p>
<p>
Usually, if your pipeline handles backfill internally, you should turn catchup
off to avoid duplicate backfill.
</p>
</div>
}
/>
</span>
<span className={commonCss.flex}>
Run every
{type === TriggerType.INTERVALED && (
<div className={commonCss.flex}>
<Separator />
<Input
required={true}
type='number'
onChange={this.handleChange('intervalValue')}
value={intervalValue}
height={30}
width={65}
error={intervalValue < 1}
variant='outlined'
/>
</div>
)}
<Separator />
<Input
required={true}
select={true}
onChange={this.handleChange('intervalCategory')}
value={intervalCategory}
height={30}
width={95}
variant='outlined'
>
{Object.keys(PeriodicInterval).map((interval, i) => (
<MenuItem key={i} value={PeriodicInterval[interval]}>
{PeriodicInterval[interval] + (type === TriggerType.INTERVALED ? 's' : '')}
</MenuItem>
))}
</Input>
</span>
</div>
{type === TriggerType.CRON && (
<div>
{intervalCategory === PeriodicInterval.WEEK && (
<div>
<span>On:</span>
<FormControlLabel
control={
<Checkbox
checked={this._isAllDaysChecked()}
color='primary'
onClick={this._toggleCheckAllDays.bind(this)}
/>
}
label='All'
/>
<Separator />
{['S', 'M', 'T', 'W', 'T', 'F', 'S'].map((day, i) => (
<Button
variant='fab'
mini={true}
key={i}
onClick={() => this._toggleDay(i)}
color={selectedDays[i] ? 'primary' : 'secondary'}
>
{day}
</Button>
))}
</div>
)}
<div className={commonCss.flex}>
<FormControlLabel
control={
<Checkbox
checked={editCron}
color='primary'
onClick={this.handleChange('editCron')}
/>
}
label={
<span>
Allow editing cron expression. ( format is specified{' '}
<a href='https://godoc.org/github.com/robfig/cron#hdr-CRON_Expression_Format'>
here
</a>
)
</span>
}
/>
</div>
<Input
label='cron expression'
onChange={this.handleChange('cron')}
value={cron}
width={300}
disabled={!editCron}
variant='outlined'
/>
<div>Note: Start and end dates/times are handled outside of cron.</div>
</div>
)}
</div>
);
}
public handleChange = (name: string) => (event: any) => {
const target = event.target;
const value = target.type === 'checkbox' ? target.checked : target.value;
// Make sure the desired field is set on the state object first, then
// use the state values to compute the new trigger
this.setState(
{
[name]: value,
} as any,
this._updateTrigger,
);
};
private _updateTrigger = () => {
const {
hasStartDate,
hasEndDate,
startDate,
startTime,
endDate,
endTime,
editCron,
intervalCategory,
intervalValue,
type,
cron,
selectedDays,
catchup,
} = this.state;
const startDateTime = pickersToDate(hasStartDate, startDate, startTime);
const endDateTime = pickersToDate(hasEndDate, endDate, endTime);
// TODO: Why build the cron string unless the TriggerType is not CRON?
// Unless cron editing is enabled, calculate the new cron string, set it in state,
// then use it to build new trigger object and notify the parent
this.setState(
{
cron: editCron ? cron : buildCron(startDateTime, intervalCategory, selectedDays),
},
() => {
const trigger = buildTrigger(
intervalCategory,
intervalValue,
startDateTime,
endDateTime,
type,
this.state.cron,
);
if (this.props.onChange) {
this.props.onChange({
catchup,
maxConcurrentRuns: trigger ? this.state.maxConcurrentRuns : undefined,
trigger,
});
}
},
);
};
private _isAllDaysChecked(): boolean {
return this.state.selectedDays.every(d => !!d);
}
private _toggleCheckAllDays(): void {
const isAllChecked = this._isAllDaysChecked();
this.state.selectedDays.forEach((d, i) => {
if (d !== !isAllChecked) {
this._toggleDay(i);
}
});
}
private _toggleDay(index: number): void {
const newDays = this.state.selectedDays;
newDays[index] = !newDays[index];
const startDate = pickersToDate(
this.state.hasStartDate,
this.state.startDate,
this.state.startTime,
);
const cron = buildCron(startDate, this.state.intervalCategory, this.state.selectedDays);
this.setState(
{
cron,
selectedDays: newDays,
},
this._updateTrigger,
);
}
}
| 7,943 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/CustomTable.test.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import CustomTable, { Column, ExpandState, Row, css } from './CustomTable';
import TestUtils from '../TestUtils';
import { PredicateOp } from '../apis/filter';
import { shallow } from 'enzyme';
const props = {
columns: [],
orderAscending: true,
pageSize: 10,
reload: () => '' as any,
rows: [],
sortBy: 'asd',
};
const columns: Column[] = [
{
customRenderer: undefined,
label: 'col1',
},
{
customRenderer: undefined,
label: 'col2',
},
];
const rows: Row[] = [
{
id: 'row1',
otherFields: ['cell1', 'cell2'],
},
{
id: 'row2',
otherFields: ['cell1', 'cell2'],
},
];
// tslint:disable-next-line:no-console
const consoleErrorBackup = console.error;
let consoleSpy: jest.Mock;
class CustomTableTest extends CustomTable {
public _requestFilter(filterString?: string): Promise<void> {
return super._requestFilter(filterString);
}
}
describe('CustomTable', () => {
beforeAll(() => {
consoleSpy = jest.spyOn(console, 'error').mockImplementation(() => null);
});
afterAll(() => {
// tslint:disable-next-line:no-console
console.error = consoleErrorBackup;
});
it('renders with default filter label', async () => {
const tree = shallow(<CustomTable {...props} />);
await TestUtils.flushPromises();
expect(tree).toMatchSnapshot();
});
it('renders with provided filter label', async () => {
const tree = shallow(<CustomTable {...props} filterLabel='test filter label' />);
await TestUtils.flushPromises();
expect(tree).toMatchSnapshot();
});
it('renders without filter box', async () => {
const tree = shallow(<CustomTable {...props} noFilterBox={true} />);
await TestUtils.flushPromises();
expect(tree).toMatchSnapshot();
});
it('renders without rows or columns', async () => {
const tree = shallow(<CustomTable {...props} />);
await TestUtils.flushPromises();
expect(tree).toMatchSnapshot();
});
it('renders empty message on no rows', async () => {
const tree = shallow(<CustomTable {...props} emptyMessage='test empty message' />);
await TestUtils.flushPromises();
expect(tree).toMatchSnapshot();
});
it('renders some columns with equal widths without rows', async () => {
const tree = shallow(
<CustomTable {...props} columns={[{ label: 'col1' }, { label: 'col2' }]} />,
);
await TestUtils.flushPromises();
expect(tree).toMatchSnapshot();
});
it('renders without the checkboxes if disableSelection is true', async () => {
const tree = shallow(
<CustomTable {...props} rows={rows} columns={columns} disableSelection={true} />,
);
await TestUtils.flushPromises();
expect(tree).toMatchSnapshot();
});
it('renders some columns with descending sort order on first column', async () => {
const tree = shallow(
<CustomTable
{...props}
initialSortOrder='desc'
columns={[{ label: 'col1', sortKey: 'col1sortkey' }, { label: 'col2' }]}
/>,
);
await TestUtils.flushPromises();
expect(tree).toMatchSnapshot();
});
it('renders columns with specified widths', async () => {
const testcolumns = [
{
flex: 3,
label: 'col1',
},
{
flex: 1,
label: 'col2',
},
];
const tree = shallow(<CustomTable {...props} columns={testcolumns} />);
await TestUtils.flushPromises();
expect(tree).toMatchSnapshot();
});
it('calls reload function with an empty page token to get rows', () => {
const reload = jest.fn();
shallow(<CustomTable {...props} reload={reload} />);
expect(reload).toHaveBeenLastCalledWith({
filter: '',
orderAscending: false,
pageSize: 10,
pageToken: '',
sortBy: '',
});
});
it('calls reload function with sort key of clicked column, while keeping same page', () => {
const testcolumns = [
{
flex: 3,
label: 'col1',
sortKey: 'col1sortkey',
},
{
flex: 1,
label: 'col2',
sortKey: 'col2sortkey',
},
];
const reload = jest.fn();
const tree = shallow(<CustomTable {...props} reload={reload} columns={testcolumns} />);
expect(reload).toHaveBeenLastCalledWith({
filter: '',
orderAscending: false,
pageSize: 10,
pageToken: '',
sortBy: 'col1sortkey desc',
});
tree
.find('WithStyles(TableSortLabel)')
.at(1)
.simulate('click');
expect(reload).toHaveBeenLastCalledWith({
filter: '',
orderAscending: true,
pageSize: 10,
pageToken: '',
sortBy: 'col2sortkey',
});
});
it('calls reload function with same sort key in reverse order if same column is clicked twice', () => {
const testcolumns = [
{
flex: 3,
label: 'col1',
sortKey: 'col1sortkey',
},
{
flex: 1,
label: 'col2',
sortKey: 'col2sortkey',
},
];
const reload = jest.fn();
const tree = shallow(<CustomTable {...props} reload={reload} columns={testcolumns} />);
expect(reload).toHaveBeenLastCalledWith({
filter: '',
orderAscending: false,
pageSize: 10,
pageToken: '',
sortBy: 'col1sortkey desc',
});
tree
.find('WithStyles(TableSortLabel)')
.at(1)
.simulate('click');
expect(reload).toHaveBeenLastCalledWith({
filter: '',
orderAscending: true,
pageSize: 10,
pageToken: '',
sortBy: 'col2sortkey',
});
tree.setProps({ sortBy: 'col1sortkey' });
tree
.find('WithStyles(TableSortLabel)')
.at(1)
.simulate('click');
expect(reload).toHaveBeenLastCalledWith({
filter: '',
orderAscending: false,
pageSize: 10,
pageToken: '',
sortBy: 'col2sortkey desc',
});
});
it('does not call reload if clicked column has no sort key', () => {
const testcolumns = [
{
flex: 3,
label: 'col1',
},
{
flex: 1,
label: 'col2',
},
];
const reload = jest.fn();
const tree = shallow(<CustomTable {...props} reload={reload} columns={testcolumns} />);
expect(reload).toHaveBeenLastCalledWith({
filter: '',
orderAscending: false,
pageSize: 10,
pageToken: '',
sortBy: '',
});
tree
.find('WithStyles(TableSortLabel)')
.at(0)
.simulate('click');
expect(reload).toHaveBeenLastCalledWith({
filter: '',
orderAscending: false,
pageSize: 10,
pageToken: '',
sortBy: '',
});
});
it('logs error if row has more cells than columns', () => {
shallow(<CustomTable {...props} rows={rows} />);
expect(consoleSpy).toHaveBeenLastCalledWith(
'Rows must have the same number of cells defined in columns',
);
});
it('logs error if row has fewer cells than columns', () => {
const testcolumns = [{ label: 'col1' }, { label: 'col2' }, { label: 'col3' }];
shallow(<CustomTable {...props} rows={rows} columns={testcolumns} />);
expect(consoleSpy).toHaveBeenLastCalledWith(
'Rows must have the same number of cells defined in columns',
);
});
it('renders some rows', async () => {
const tree = shallow(<CustomTable {...props} rows={rows} columns={columns} />);
await TestUtils.flushPromises();
expect(tree).toMatchSnapshot();
});
it('starts out with no selected rows', () => {
const spy = jest.fn();
shallow(<CustomTable {...props} rows={rows} columns={columns} updateSelection={spy} />);
expect(spy).not.toHaveBeenCalled();
});
it('calls update selection callback when items are selected', () => {
const spy = jest.fn();
const tree = shallow(
<CustomTable {...props} rows={rows} columns={columns} updateSelection={spy} />,
);
tree
.find('.row')
.at(0)
.simulate('click', { stopPropagation: () => null });
expect(spy).toHaveBeenLastCalledWith(['row1']);
});
it('does not add items to selection when multiple rows are clicked', () => {
// Keeping track of selection is the parent's job.
const spy = jest.fn();
const tree = shallow(
<CustomTable {...props} rows={rows} columns={columns} updateSelection={spy} />,
);
tree
.find('.row')
.at(0)
.simulate('click', { stopPropagation: () => null });
tree
.find('.row')
.at(1)
.simulate('click', { stopPropagation: () => null });
expect(spy).toHaveBeenLastCalledWith(['row2']);
});
it('passes both selectedIds and the newly selected row to updateSelection when a row is clicked', () => {
// Keeping track of selection is the parent's job.
const selectedIds = ['previouslySelectedRow'];
const spy = jest.fn();
const tree = shallow(
<CustomTable
{...props}
selectedIds={selectedIds}
rows={rows}
columns={columns}
updateSelection={spy}
/>,
);
tree
.find('.row')
.at(0)
.simulate('click', { stopPropagation: () => null });
expect(spy).toHaveBeenLastCalledWith(['previouslySelectedRow', 'row1']);
});
it('does not call selectionCallback if disableSelection is true', () => {
const spy = jest.fn();
const tree = shallow(
<CustomTable
{...props}
rows={rows}
columns={columns}
updateSelection={spy}
disableSelection={true}
/>,
);
tree
.find('.row')
.at(0)
.simulate('click', { stopPropagation: () => null });
tree
.find('.row')
.at(1)
.simulate('click', { stopPropagation: () => null });
expect(spy).not.toHaveBeenCalled();
});
it('handles no updateSelection method being passed', () => {
const tree = shallow(<CustomTable {...props} rows={rows} columns={columns} />);
tree
.find('.row')
.at(0)
.simulate('click', { stopPropagation: () => null });
tree
.find('.columnName WithStyles(Checkbox)')
.at(0)
.simulate('change', {
target: { checked: true },
});
});
it('selects all items when head checkbox is clicked', () => {
const spy = jest.fn();
const tree = shallow(
<CustomTable {...props} rows={rows} columns={columns} updateSelection={spy} />,
);
tree
.find('.columnName WithStyles(Checkbox)')
.at(0)
.simulate('change', {
target: { checked: true },
});
expect(spy).toHaveBeenLastCalledWith(['row1', 'row2']);
});
it('unselects all items when head checkbox is clicked and all items are selected', () => {
const spy = jest.fn();
const tree = shallow(
<CustomTable {...props} rows={rows} columns={columns} updateSelection={spy} />,
);
tree
.find('.columnName WithStyles(Checkbox)')
.at(0)
.simulate('change', {
target: { checked: true },
});
expect(spy).toHaveBeenLastCalledWith(['row1', 'row2']);
tree
.find('.columnName WithStyles(Checkbox)')
.at(0)
.simulate('change', {
target: { checked: false },
});
expect(spy).toHaveBeenLastCalledWith([]);
});
it('selects all items if one item was checked then the head checkbox is clicked', () => {
const spy = jest.fn();
const tree = shallow(
<CustomTable {...props} rows={rows} columns={columns} updateSelection={spy} />,
);
tree
.find('.row')
.at(0)
.simulate('click', { stopPropagation: () => null });
tree
.find('.columnName WithStyles(Checkbox)')
.at(0)
.simulate('change', {
target: { checked: true },
});
expect(spy).toHaveBeenLastCalledWith(['row1', 'row2']);
});
it('deselects all other items if one item is selected in radio button mode', () => {
// Simulate that another row has already been selected. Just clicking another row first won't
// work here because the parent is where the selectedIds state is kept
const selectedIds = ['previouslySelectedRow'];
const spy = jest.fn();
const tree = shallow(
<CustomTable
{...props}
useRadioButtons={true}
selectedIds={selectedIds}
rows={rows}
columns={columns}
updateSelection={spy}
/>,
);
tree
.find('.row')
.at(0)
.simulate('click', { stopPropagation: () => null });
expect(spy).toHaveBeenLastCalledWith(['row1']);
});
it('disables previous and next page buttons if no next page token given', async () => {
const reloadResult = Promise.resolve('');
const spy = () => reloadResult;
const tree = shallow(<CustomTable {...props} rows={rows} columns={columns} reload={spy} />);
await TestUtils.flushPromises();
expect(tree.state()).toHaveProperty('maxPageIndex', 0);
expect(
tree
.find('WithStyles(IconButton)')
.at(0)
.prop('disabled'),
).toBeTruthy();
expect(
tree
.find('WithStyles(IconButton)')
.at(1)
.prop('disabled'),
).toBeTruthy();
});
it('enables next page button if next page token is given', async () => {
const reloadResult = Promise.resolve('some token');
const spy = () => reloadResult;
const tree = shallow(<CustomTable {...props} rows={rows} columns={columns} reload={spy} />);
await reloadResult;
expect(tree.state()).toHaveProperty('maxPageIndex', Number.MAX_SAFE_INTEGER);
expect(
tree
.find('WithStyles(IconButton)')
.at(0)
.prop('disabled'),
).toBeTruthy();
expect(
tree
.find('WithStyles(IconButton)')
.at(1)
.prop('disabled'),
).not.toBeTruthy();
});
it('calls reload with next page token when next page button is clicked', async () => {
const reloadResult = Promise.resolve('some token');
const spy = jest.fn(() => reloadResult);
const tree = shallow(<CustomTable {...props} rows={rows} columns={columns} reload={spy} />);
await TestUtils.flushPromises();
tree
.find('WithStyles(IconButton)')
.at(1)
.simulate('click');
expect(spy).toHaveBeenLastCalledWith({
filter: '',
orderAscending: false,
pageSize: 10,
pageToken: 'some token',
sortBy: '',
});
});
it('renders new rows after clicking next page, and enables previous page button', async () => {
const reloadResult = Promise.resolve('some token');
const spy = jest.fn(() => reloadResult);
const tree = shallow(<CustomTable {...props} rows={[]} columns={columns} reload={spy} />);
await TestUtils.flushPromises();
tree
.find('WithStyles(IconButton)')
.at(1)
.simulate('click');
await TestUtils.flushPromises();
expect(spy).toHaveBeenLastCalledWith({
filter: '',
orderAscending: false,
pageSize: 10,
pageToken: 'some token',
sortBy: '',
});
expect(tree.state()).toHaveProperty('currentPage', 1);
tree.setProps({ rows: [rows[1]] });
expect(tree).toMatchSnapshot();
expect(
tree
.find('WithStyles(IconButton)')
.at(0)
.prop('disabled'),
).not.toBeTruthy();
});
it('renders new rows after clicking previous page, and enables next page button', async () => {
const reloadResult = Promise.resolve('some token');
const spy = jest.fn(() => reloadResult);
const tree = shallow(<CustomTable {...props} rows={[]} columns={columns} reload={spy} />);
await reloadResult;
tree
.find('WithStyles(IconButton)')
.at(1)
.simulate('click');
await reloadResult;
tree
.find('WithStyles(IconButton)')
.at(0)
.simulate('click');
await TestUtils.flushPromises();
expect(spy).toHaveBeenLastCalledWith({
filter: '',
orderAscending: false,
pageSize: 10,
pageToken: '',
sortBy: '',
});
tree.setProps({ rows });
expect(
tree
.find('WithStyles(IconButton)')
.at(0)
.prop('disabled'),
).toBeTruthy();
await TestUtils.flushPromises();
expect(tree).toMatchSnapshot();
});
it('calls reload with a different page size, resets page token list when rows/page changes', async () => {
const reloadResult = Promise.resolve('some token');
const spy = jest.fn(() => reloadResult);
const tree = shallow(<CustomTable {...props} rows={[]} columns={columns} reload={spy} />);
tree.find('.' + css.rowsPerPage).simulate('change', { target: { value: 1234 } });
await TestUtils.flushPromises();
expect(spy).toHaveBeenLastCalledWith({
filter: '',
orderAscending: false,
pageSize: 1234,
pageToken: '',
sortBy: '',
});
expect(tree.state()).toHaveProperty('tokenList', ['', 'some token']);
});
it('calls reload with a different page size, resets page token list when rows/page changes', async () => {
const reloadResult = Promise.resolve('');
const spy = jest.fn(() => reloadResult);
const tree = shallow(<CustomTable {...props} rows={[]} columns={columns} reload={spy} />);
tree.find('.' + css.rowsPerPage).simulate('change', { target: { value: 1234 } });
await reloadResult;
expect(spy).toHaveBeenLastCalledWith({
filter: '',
orderAscending: false,
pageSize: 1234,
pageToken: '',
sortBy: '',
});
expect(tree.state()).toHaveProperty('tokenList', ['']);
});
it('renders a collapsed row', async () => {
const row = { ...rows[0] };
row.expandState = ExpandState.COLLAPSED;
const tree = shallow(
<CustomTable {...props} rows={[row]} columns={columns} getExpandComponent={() => null} />,
);
await TestUtils.flushPromises();
expect(tree).toMatchSnapshot();
});
it('renders a collapsed row when selection is disabled', async () => {
const row = { ...rows[0] };
row.expandState = ExpandState.COLLAPSED;
const tree = shallow(
<CustomTable
{...props}
rows={[row]}
columns={columns}
getExpandComponent={() => null}
disableSelection={true}
/>,
);
await TestUtils.flushPromises();
expect(tree).toMatchSnapshot();
});
it('renders an expanded row', async () => {
const row = { ...rows[0] };
row.expandState = ExpandState.EXPANDED;
const tree = shallow(<CustomTable {...props} rows={[row]} columns={columns} />);
await TestUtils.flushPromises();
expect(tree).toMatchSnapshot();
});
it('renders an expanded row with expanded component below it', async () => {
const row = { ...rows[0] };
row.expandState = ExpandState.EXPANDED;
const tree = shallow(
<CustomTable
{...props}
rows={[row]}
columns={columns}
getExpandComponent={() => <span>Hello World</span>}
/>,
);
await TestUtils.flushPromises();
expect(tree).toMatchSnapshot();
});
it('calls prop to toggle expansion', () => {
const row = { ...rows[0] };
const toggleSpy = jest.fn();
const stopPropagationSpy = jest.fn();
row.expandState = ExpandState.EXPANDED;
const tree = shallow(
<CustomTable
{...props}
rows={[row, row, row]}
columns={columns}
getExpandComponent={() => <span>Hello World</span>}
toggleExpansion={toggleSpy}
/>,
);
tree
.find('.' + css.expandButton)
.at(1)
.simulate('click', { stopPropagation: stopPropagationSpy });
expect(toggleSpy).toHaveBeenCalledWith(1);
expect(stopPropagationSpy).toHaveBeenCalledWith();
});
it('renders a table with sorting disabled', async () => {
const tree = shallow(
<CustomTable {...props} rows={rows} columns={columns} disableSorting={true} />,
);
await TestUtils.flushPromises();
expect(tree).toMatchSnapshot();
});
it('updates the filter string in state when the filter box input changes', async () => {
const tree = shallow(<CustomTable {...props} rows={rows} columns={columns} />);
(tree.instance() as CustomTable).handleFilterChange({ target: { value: 'test filter' } });
await TestUtils.flushPromises();
expect(tree.state('filterString')).toEqual('test filter');
expect(tree).toMatchSnapshot();
});
it('reloads the table with the encoded filter object', async () => {
const reload = jest.fn();
const tree = shallow(
<CustomTableTest {...props} reload={reload} rows={rows} columns={columns} />,
);
// lodash's debounce function doesn't play nice with Jest, so we skip the handleChange function
// and call _requestFilter directly.
(tree.instance() as CustomTableTest)._requestFilter('test filter');
const expectedEncodedFilter = encodeURIComponent(
JSON.stringify({
predicates: [
{
key: 'name',
op: PredicateOp.ISSUBSTRING,
string_value: 'test filter',
},
],
}),
);
expect(tree.state('filterStringEncoded')).toEqual(expectedEncodedFilter);
expect(reload).toHaveBeenLastCalledWith({
filter: expectedEncodedFilter,
orderAscending: false,
pageSize: 10,
pageToken: '',
sortBy: '',
});
});
it('uses an empty filter if requestFilter is called with no filter', async () => {
const tree = shallow(<CustomTableTest {...props} rows={rows} columns={columns} />);
(tree.instance() as CustomTableTest)._requestFilter();
expect(tree.state('filterStringEncoded')).toEqual('');
});
});
| 7,944 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/DetailsTable.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { stylesheet } from 'typestyle';
import { color, spacing, commonCss } from '../Css';
import { KeyValue } from '../lib/StaticGraphParser';
import Editor from './Editor';
import 'brace';
import 'brace/ext/language_tools';
import 'brace/mode/json';
import 'brace/theme/github';
export const css = stylesheet({
key: {
color: color.strong,
flex: '0 0 50%',
fontWeight: 'bold',
maxWidth: 300,
},
row: {
borderBottom: `1px solid ${color.divider}`,
display: 'flex',
padding: `${spacing.units(-5)}px ${spacing.units(-6)}px`,
},
valueJson: {
flexGrow: 1,
},
valueText: {
// flexGrow expands value text to full width.
flexGrow: 1,
// For current use-cases, value text shouldn't be very long. It will be not readable when it's long.
// Therefore, it's easier we just show it completely in the UX.
overflow: 'hidden',
// Sometimes, urls will be unbreakable for a long string. overflow-wrap: break-word
// allows breaking an url at middle of a word so it will not overflow and get hidden.
overflowWrap: 'break-word',
},
});
export interface ValueComponentProps<T> {
value?: string | T;
[key: string]: any;
}
interface DetailsTableProps<T> {
fields: Array<KeyValue<string | T>>;
title?: string;
valueComponent?: React.FC<ValueComponentProps<T>>;
valueComponentProps?: { [key: string]: any };
}
function isString(x: any): x is string {
return typeof x === 'string';
}
const DetailsTable = <T extends {}>(props: DetailsTableProps<T>) => {
const { fields, title, valueComponent: ValueComponent, valueComponentProps } = props;
return (
<React.Fragment>
{!!title && <div className={commonCss.header}>{title}</div>}
<div>
{fields.map((f, i) => {
const [key, value] = f;
// only try to parse json if value is a string
if (isString(value)) {
try {
const parsedJson = JSON.parse(value);
// Nulls, booleans, strings, and numbers can all be parsed as JSON, but we don't care
// about rendering. Note that `typeOf null` returns 'object'
if (parsedJson === null || typeof parsedJson !== 'object') {
throw new Error(
'Parsed JSON was neither an array nor an object. Using default renderer',
);
}
return (
<div key={i} className={css.row}>
<span className={css.key}>{key}</span>
<Editor
width='100%'
minLines={3}
maxLines={20}
mode='json'
theme='github'
highlightActiveLine={true}
showGutter={true}
readOnly={true}
value={JSON.stringify(parsedJson, null, 2) || ''}
/>
</div>
);
} catch (err) {
// do nothing
}
}
// If a ValueComponent and a value is provided, render the value with
// the ValueComponent. Otherwise render the value as a string (empty string if null or undefined).
return (
<div key={i} className={css.row}>
<span className={css.key}>{key}</span>
<span className={css.valueText}>
{ValueComponent && value ? (
<ValueComponent value={value} {...valueComponentProps} />
) : (
`${value || ''}`
)}
</span>
</div>
);
})}
</div>
</React.Fragment>
);
};
export default DetailsTable;
| 7,945 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/MinioArtifactPreview.tsx | import * as React from 'react';
import { stylesheet } from 'typestyle';
import { color } from '../Css';
import { StorageService, StoragePath } from '../lib/WorkflowParser';
import { S3Artifact } from '../../third_party/argo-ui/argo_template';
import { isS3Endpoint } from '../lib/AwsHelper';
import { Apis } from '../lib/Apis';
import { ExternalLink } from '../atoms/ExternalLink';
import { ValueComponentProps } from './DetailsTable';
const css = stylesheet({
root: {
width: '100%',
},
preview: {
maxHeight: 250,
overflowY: 'auto',
padding: 3,
backgroundColor: color.lightGrey,
},
});
/**
* Check if a javascript object is an argo S3Artifact object.
* @param value Any javascript object.
*/
export function isS3Artifact(value: any): value is S3Artifact {
return value && value.key && value.bucket;
}
export interface MinioArtifactPreviewProps extends ValueComponentProps<Partial<S3Artifact>> {
namespace?: string;
maxbytes?: number;
maxlines?: number;
}
function getStoragePath(value?: string | Partial<S3Artifact>) {
if (!value || typeof value === 'string') return;
const { key, bucket, endpoint } = value;
if (!bucket || !key) return;
const source = isS3Endpoint(endpoint) ? StorageService.S3 : StorageService.MINIO;
return { source, bucket, key };
}
async function getPreview(
storagePath: StoragePath,
namespace: string | undefined,
maxbytes: number,
maxlines?: number,
) {
// TODO how to handle binary data (can probably use magic number to id common mime types)
let data = await Apis.readFile(storagePath, namespace, maxbytes + 1);
// is preview === data and no maxlines
if (data.length <= maxbytes && !maxlines) {
return data;
}
// remove extra byte at the end (we requested maxbytes +1)
data = data.slice(0, maxbytes);
// check num lines
if (maxlines) {
data = data
.split('\n')
.slice(0, maxlines)
.join('\n')
.trim();
}
return `${data}\n...`;
}
/**
* A component that renders a preview to an artifact with a link to the full content.
*/
const MinioArtifactPreview: React.FC<MinioArtifactPreviewProps> = ({
value,
namespace,
maxbytes = 255,
maxlines,
}) => {
const [content, setContent] = React.useState<string | undefined>(undefined);
const storagePath = getStoragePath(value);
React.useEffect(() => {
let cancelled = false;
if (storagePath) {
getPreview(storagePath, namespace, maxbytes, maxlines).then(
data => !cancelled && setContent(data),
error => console.error(error), // TODO error badge on link?
);
}
return () => {
cancelled = true;
};
}, [storagePath, namespace, maxbytes, maxlines]);
if (!storagePath) {
// if value is undefined, null, or an invalid s3artifact object, don't render
if (value === null || value === undefined || typeof value === 'object') return null;
// otherwise render value as string (with default string method)
return <React.Fragment>{`${value}`}</React.Fragment>;
}
// TODO need to come to an agreement how to encode artifact info inside a url
// namespace is currently not supported
const linkText = Apis.buildArtifactUrl(storagePath);
const artifactUrl = Apis.buildReadFileUrl(storagePath, namespace);
// Opens in new window safely
// TODO use ArtifactLink instead (but it need to support namespace)
return (
<div className={css.root}>
<ExternalLink href={artifactUrl} title={linkText}>
{linkText}
</ExternalLink>
{content && (
<div className={css.preview}>
<small>
<pre>{content}</pre>
</small>
</div>
)}
</div>
);
};
export default MinioArtifactPreview;
| 7,946 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/CollapseButton.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { CompareState } from '../pages/Compare';
import Button from '@material-ui/core/Button';
import ExpandedIcon from '@material-ui/icons/ArrowDropUp';
import { stylesheet, classes } from 'typestyle';
import { color, fontsize } from '../Css';
const css = stylesheet({
collapseBtn: {
color: color.strong,
fontSize: fontsize.title,
fontWeight: 'bold',
padding: 5,
},
collapsed: {
transform: 'rotate(180deg)',
},
icon: {
marginRight: 5,
transition: 'transform 0.3s',
},
});
interface CollapseButtonProps {
collapseSections: { [key: string]: boolean };
compareSetState: (state: Partial<CompareState>) => void;
sectionName: string;
}
class CollapseButton extends React.Component<CollapseButtonProps> {
public render(): JSX.Element {
const { collapseSections, compareSetState } = this.props;
const sectionName = this.props.sectionName;
return (
<div>
<Button
onClick={() => {
collapseSections[sectionName] = !collapseSections[sectionName];
compareSetState({ collapseSections });
}}
title='Expand/Collapse this section'
className={css.collapseBtn}
>
<ExpandedIcon
className={classes(css.icon, collapseSections[sectionName] ? css.collapsed : '')}
/>
{sectionName}
</Button>
</div>
);
}
}
export default CollapseButton;
| 7,947 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/Description.test.tsx | /*
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { mount } from 'enzyme';
import { Description } from './Description';
describe('Description', () => {
describe('When in normal mode', () => {
it('renders empty string', () => {
const tree = mount(<Description description='' />).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('renders pure text', () => {
const tree = mount(<Description description='this is a line of pure text' />).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('renders raw link', () => {
const description = 'https://www.google.com';
const tree = mount(<Description description={description} />).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('renders markdown link', () => {
const description = '[google](https://www.google.com)';
const tree = mount(<Description description={description} />).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('renders paragraphs', () => {
const description = 'Paragraph 1\n' + '\n' + 'Paragraph 2';
const tree = mount(<Description description={description} />).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('renders markdown list as list', () => {
const description = `
* abc
* def`;
const tree = mount(<Description description={description} />).getDOMNode();
expect(tree).toMatchSnapshot();
});
});
describe('When in inline mode', () => {
it('renders paragraphs separated by space', () => {
const description = `
Paragraph 1
Paragraph 2
`;
const tree = mount(<Description description={description} forceInline={true} />).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('renders pure text', () => {
const tree = mount(
<Description description='this is a line of pure text' forceInline={true} />,
).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('renders raw link', () => {
const description = 'https://www.google.com';
const tree = mount(<Description description={description} forceInline={true} />).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('renders markdown link', () => {
const description = '[google](https://www.google.com)';
const tree = mount(<Description description={description} forceInline={true} />).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('renders markdown list as pure text', () => {
const description = `
* abc
* def`;
const tree = mount(<Description description={description} forceInline={true} />).getDOMNode();
expect(tree).toMatchSnapshot();
});
});
});
| 7,948 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/Metric.tsx | /*
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { ApiRunMetric, RunMetricFormat } from '../apis/run';
import { MetricMetadata } from '../lib/RunUtils';
import { stylesheet } from 'typestyle';
import { logger } from '../lib/Utils';
import MetricUtils from '../lib/MetricUtils';
const css = stylesheet({
metricContainer: {
background: '#f6f7f9',
marginLeft: 6,
marginRight: 10,
},
metricFill: {
background: '#cbf0f8',
boxSizing: 'border-box',
color: '#202124',
fontFamily: 'Roboto',
fontSize: 13,
textIndent: 6,
},
});
interface MetricProps {
metadata?: MetricMetadata;
metric?: ApiRunMetric;
}
class Metric extends React.PureComponent<MetricProps> {
public render(): JSX.Element {
const { metric, metadata } = this.props;
if (!metric || metric.number_value === undefined) {
return <div />;
}
const displayString = MetricUtils.getMetricDisplayString(metric);
let width = '';
if (metric.format === RunMetricFormat.PERCENTAGE) {
width = `calc(${displayString})`;
} else {
// Non-percentage metrics must contain metadata
if (!metadata) {
return <div />;
}
const leftSpace = 6;
if (metadata.maxValue === 0 && metadata.minValue === 0) {
return <div style={{ paddingLeft: leftSpace }}>{displayString}</div>;
}
if (metric.number_value - metadata.minValue < 0) {
logger.error(
`Metric ${metadata.name}'s value:` +
` (${metric.number_value}) was lower than the supposed minimum of` +
` (${metadata.minValue})`,
);
return <div style={{ paddingLeft: leftSpace }}>{displayString}</div>;
}
if (metadata.maxValue - metric.number_value < 0) {
logger.error(
`Metric ${metadata.name}'s value:` +
` (${metric.number_value}) was greater than the supposed maximum of` +
` (${metadata.maxValue})`,
);
return <div style={{ paddingLeft: leftSpace }}>{displayString}</div>;
}
const barWidth =
((metric.number_value - metadata.minValue) / (metadata.maxValue - metadata.minValue)) * 100;
width = `calc(${barWidth}%)`;
}
return (
<div className={css.metricContainer}>
<div className={css.metricFill} style={{ width }}>
{displayString}
</div>
</div>
);
}
}
export default Metric;
| 7,949 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/CustomTableRow.test.tsx | /*
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { Column, Row } from './CustomTable';
import TestUtils from '../TestUtils';
import { shallow } from 'enzyme';
import { CustomTableRow } from './CustomTableRow';
describe('CustomTable', () => {
const props = {
columns: [],
row: [],
};
const columns: Column[] = [
{
customRenderer: undefined,
label: 'col1',
},
{
customRenderer: undefined,
label: 'col2',
},
];
const row: Row = {
id: 'row',
otherFields: ['cell1', 'cell2'],
};
it('renders some rows using a custom renderer', async () => {
columns[0].customRenderer = () => (<span>this is custom output</span>) as any;
const tree = shallow(<CustomTableRow {...props} row={row} columns={columns} />);
await TestUtils.flushPromises();
expect(tree).toMatchSnapshot();
columns[0].customRenderer = undefined;
});
it('displays warning icon with tooltip if row has error', async () => {
row.error = 'dummy error';
const tree = shallow(<CustomTableRow {...props} row={row} columns={columns} />);
await TestUtils.flushPromises();
expect(tree).toMatchSnapshot();
row.error = undefined;
});
});
| 7,950 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/StaticNodeDetails.tsx | /*
* Copyright 2018-2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import DetailsTable from './DetailsTable';
import { classes, stylesheet } from 'typestyle';
import { commonCss, fontsize } from '../Css';
import { SelectedNodeInfo } from '../lib/StaticGraphParser';
export type nodeType = 'container' | 'resource' | 'dag' | 'unknown';
const css = stylesheet({
fontSizeTitle: {
fontSize: fontsize.title,
},
taskTitle: {
fontSize: fontsize.title,
fontWeight: 'bold',
paddingTop: 20,
},
});
interface StaticNodeDetailsProps {
nodeInfo: SelectedNodeInfo;
}
class StaticNodeDetails extends React.Component<StaticNodeDetailsProps> {
public render(): JSX.Element {
const nodeInfo = this.props.nodeInfo;
return (
<div>
{nodeInfo.nodeType === 'container' && (
<div>
<DetailsTable title='Input parameters' fields={nodeInfo.inputs} />
<DetailsTable title='Output parameters' fields={nodeInfo.outputs} />
<div className={classes(commonCss.header, css.fontSizeTitle)}>Arguments</div>
{nodeInfo.args.map((arg, i) => (
<div key={i} style={{ fontFamily: 'monospace' }}>
{arg}
</div>
))}
<div className={classes(commonCss.header, css.fontSizeTitle)}>Command</div>
{nodeInfo.command.map((c, i) => (
<div key={i} style={{ fontFamily: 'monospace' }}>
{c}
</div>
))}
<div className={classes(commonCss.header, css.fontSizeTitle)}>Image</div>
<div style={{ fontFamily: 'monospace' }}>{nodeInfo.image}</div>
<DetailsTable title='Volume Mounts' fields={nodeInfo.volumeMounts} />
</div>
)}
{nodeInfo.nodeType === 'resource' && (
<div>
<DetailsTable title='Input parameters' fields={nodeInfo.inputs} />
<DetailsTable title='Output parameters' fields={nodeInfo.outputs} />
<DetailsTable title='Manifest' fields={nodeInfo.resource} />
</div>
)}
{!!nodeInfo.condition && (
<div>
<div className={css.taskTitle}>Condition</div>
<div>Run when: {nodeInfo.condition}</div>
</div>
)}
</div>
);
}
}
export default StaticNodeDetails;
| 7,951 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/PlotCard.test.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { shallow } from 'enzyme';
import PlotCard from './PlotCard';
import { ViewerConfig, PlotType } from './viewers/Viewer';
describe('PlotCard', () => {
it('handles no configs', () => {
expect(shallow(<PlotCard title='' configs={[]} maxDimension={100} />)).toMatchSnapshot();
});
const config: ViewerConfig = { type: PlotType.CONFUSION_MATRIX };
it('renders on confusion matrix viewer card', () => {
const tree = shallow(<PlotCard title='test title' configs={[config]} maxDimension={100} />);
expect(tree).toMatchSnapshot();
});
it('pops out a full screen view of the viewer', () => {
const tree = shallow(<PlotCard title='' configs={[config]} maxDimension={100} />);
tree.find('.popOutButton').simulate('click');
expect(tree).toMatchSnapshot();
});
it('close button closes full screen dialog', () => {
const tree = shallow(<PlotCard title='' configs={[config]} maxDimension={100} />);
tree.find('.popOutButton').simulate('click');
tree.find('.fullscreenCloseButton').simulate('click');
expect(tree).toMatchSnapshot();
});
it('clicking outside full screen dialog closes it', () => {
const tree = shallow(<PlotCard title='' configs={[config]} maxDimension={100} />);
tree.find('.popOutButton').simulate('click');
tree.find('WithStyles(Dialog)').simulate('close');
expect(tree).toMatchSnapshot();
});
});
| 7,952 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/Graph.test.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as dagre from 'dagre';
import * as React from 'react';
import { shallow, mount } from 'enzyme';
import EnhancedGraph, { Graph } from './Graph';
import SuccessIcon from '@material-ui/icons/CheckCircle';
import Tooltip from '@material-ui/core/Tooltip';
function newGraph(): dagre.graphlib.Graph {
const graph = new dagre.graphlib.Graph();
graph.setGraph({});
graph.setDefaultEdgeLabel(() => ({}));
return graph;
}
const testIcon = (
<Tooltip title='Test icon tooltip'>
<SuccessIcon />
</Tooltip>
);
const newNode = (label: string, isPlaceHolder?: boolean, color?: string, icon?: JSX.Element) => ({
bgColor: color,
height: 10,
icon: icon || testIcon,
isPlaceholder: isPlaceHolder || false,
label,
width: 10,
});
beforeEach(() => {
jest.restoreAllMocks();
});
describe('Graph', () => {
it('handles an empty graph', () => {
expect(shallow(<Graph graph={newGraph()} />)).toMatchSnapshot();
});
it('renders a graph with one node', () => {
const graph = newGraph();
graph.setNode('node1', newNode('node1'));
expect(shallow(<Graph graph={graph} />)).toMatchSnapshot();
});
it('renders a graph with two disparate nodes', () => {
const graph = newGraph();
graph.setNode('node1', newNode('node1'));
graph.setNode('node2', newNode('node2'));
expect(shallow(<Graph graph={graph} />)).toMatchSnapshot();
});
it('renders a graph with two connectd nodes', () => {
const graph = newGraph();
graph.setNode('node1', newNode('node1'));
graph.setNode('node2', newNode('node2'));
graph.setEdge('node1', 'node2');
expect(shallow(<Graph graph={graph} />)).toMatchSnapshot();
});
it('renders a graph with two connectd nodes in reverse order', () => {
const graph = newGraph();
graph.setNode('node1', newNode('node1'));
graph.setNode('node2', newNode('node2'));
graph.setEdge('node2', 'node1');
expect(shallow(<Graph graph={graph} />)).toMatchSnapshot();
});
it('renders a complex graph with six nodes and seven edges', () => {
const graph = newGraph();
graph.setNode('flipcoin1', newNode('flipcoin1'));
graph.setNode('tails1', newNode('tails1'));
graph.setNode('heads1', newNode('heads1'));
graph.setNode('flipcoin2', newNode('flipcoin2'));
graph.setNode('heads2', newNode('heads2'));
graph.setNode('tails2', newNode('tails2'));
graph.setEdge('flipcoin1', 'tails1');
graph.setEdge('flipcoin1', 'heads1');
graph.setEdge('tails1', 'flipcoin2');
graph.setEdge('tails1', 'heads2');
graph.setEdge('tails1', 'tails2');
graph.setEdge('flipcoin2', 'heads2');
graph.setEdge('flipcoin2', 'tails2');
expect(shallow(<Graph graph={graph} />)).toMatchSnapshot();
});
it('renders a graph with colored nodes', () => {
const graph = newGraph();
graph.setNode('node1', newNode('node1', false, 'red'));
graph.setNode('node2', newNode('node2', false, 'green'));
expect(shallow(<Graph graph={graph} />)).toMatchSnapshot();
});
it('renders a graph with colored edges', () => {
const graph = newGraph();
graph.setNode('node1', newNode('node1'));
graph.setNode('node2', newNode('node2'));
graph.setEdge('node1', 'node2', { color: 'red' });
expect(shallow(<Graph graph={graph} />)).toMatchSnapshot();
});
it('renders a graph with a placeholder node and edge', () => {
const graph = newGraph();
graph.setNode('node1', newNode('node1', false));
graph.setNode('node2', newNode('node2', true));
graph.setEdge('node1', 'node2', { isPlaceholder: true });
expect(shallow(<Graph graph={graph} />)).toMatchSnapshot();
});
it('calls onClick callback when node is clicked', () => {
const graph = newGraph();
graph.setNode('node1', newNode('node1'));
graph.setNode('node2', newNode('node2'));
graph.setEdge('node2', 'node1');
const spy = jest.fn();
const tree = shallow(<Graph graph={graph} onClick={spy} />);
tree
.find('.node')
.at(0)
.simulate('click');
expect(spy).toHaveBeenCalledWith('node1');
});
it('renders a graph with a selected node', () => {
const graph = newGraph();
graph.setNode('node1', newNode('node1'));
graph.setNode('node2', newNode('node2'));
graph.setEdge('node1', 'node2');
expect(shallow(<Graph graph={graph} selectedNodeId='node1' />)).toMatchSnapshot();
});
it('gracefully renders a graph with a selected node id that does not exist', () => {
const graph = newGraph();
graph.setNode('node1', newNode('node1'));
graph.setNode('node2', newNode('node2'));
graph.setEdge('node1', 'node2');
expect(shallow(<Graph graph={graph} selectedNodeId='node3' />)).toMatchSnapshot();
});
it('shows an error message when the graph is invalid', () => {
const consoleErrorSpy = jest.spyOn(console, 'error');
consoleErrorSpy.mockImplementation(() => null);
const graph = newGraph();
graph.setEdge('node1', 'node2');
const onError = jest.fn();
expect(mount(<EnhancedGraph graph={graph} onError={onError} />).html()).toMatchSnapshot();
expect(onError).toHaveBeenCalledTimes(1);
const [message, additionalInfo] = onError.mock.calls[0];
expect(message).toEqual('There was an error rendering the graph.');
expect(additionalInfo).toEqual(
"There was an error rendering the graph. This is likely a bug in Kubeflow Pipelines. Error message: 'Graph definition is invalid. Cannot get node by 'node1'.'.",
);
});
});
| 7,953 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/UploadPipelineDialog.test.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { shallow, ReactWrapper, ShallowWrapper } from 'enzyme';
import UploadPipelineDialog, { ImportMethod } from './UploadPipelineDialog';
import TestUtils from '../TestUtils';
describe('UploadPipelineDialog', () => {
let tree: ReactWrapper | ShallowWrapper;
afterEach(async () => {
// unmount() should be called before resetAllMocks() in case any part of the unmount life cycle
// depends on mocks/spies
await tree.unmount();
});
it('renders closed', () => {
tree = shallow(<UploadPipelineDialog open={false} onClose={jest.fn()} />);
expect(tree).toMatchSnapshot();
});
it('renders open', () => {
tree = shallow(<UploadPipelineDialog open={false} onClose={jest.fn()} />);
expect(tree).toMatchSnapshot();
});
it('renders an active dropzone', () => {
tree = shallow(<UploadPipelineDialog open={false} onClose={jest.fn()} />);
tree.setState({ dropzoneActive: true });
expect(tree).toMatchSnapshot();
});
it('renders with a selected file to upload', () => {
tree = shallow(<UploadPipelineDialog open={false} onClose={jest.fn()} />);
tree.setState({ fileToUpload: true });
expect(tree).toMatchSnapshot();
});
it('renders alternate UI for uploading via URL', () => {
tree = shallow(<UploadPipelineDialog open={false} onClose={jest.fn()} />);
tree.setState({ importMethod: ImportMethod.URL });
expect(tree).toMatchSnapshot();
});
it('calls close callback with null and empty string when canceled', () => {
const spy = jest.fn();
tree = shallow(<UploadPipelineDialog open={false} onClose={spy} />);
tree.find('#cancelUploadBtn').simulate('click');
expect(spy).toHaveBeenCalledWith(false, '', null, '', ImportMethod.LOCAL, '');
});
it('calls close callback with null and empty string when dialog is closed', () => {
const spy = jest.fn();
tree = shallow(<UploadPipelineDialog open={false} onClose={spy} />);
tree.find('WithStyles(Dialog)').simulate('close');
expect(spy).toHaveBeenCalledWith(false, '', null, '', ImportMethod.LOCAL, '');
});
it('calls close callback with file name, file object, and description when confirmed', () => {
const spy = jest.fn();
tree = shallow(<UploadPipelineDialog open={false} onClose={spy} />);
(tree.instance() as any)._dropzoneRef = { current: { open: () => null } };
(tree.instance() as UploadPipelineDialog).handleChange('uploadPipelineName')({
target: { value: 'test name' },
});
tree.find('#confirmUploadBtn').simulate('click');
expect(spy).toHaveBeenLastCalledWith(true, 'test name', null, '', ImportMethod.LOCAL, '');
});
it('calls close callback with trimmed file url and pipeline name when confirmed', () => {
const spy = jest.fn();
tree = shallow(<UploadPipelineDialog open={false} onClose={spy} />);
// Click 'Import by URL'
tree.find('#uploadFromUrlBtn').simulate('change');
(tree.instance() as UploadPipelineDialog).handleChange('fileUrl')({
target: { value: '\n https://www.google.com/test-file.txt ' },
});
(tree.instance() as UploadPipelineDialog).handleChange('uploadPipelineName')({
target: { value: 'test name' },
});
tree.find('#confirmUploadBtn').simulate('click');
expect(spy).toHaveBeenLastCalledWith(
true,
'test name',
null,
'https://www.google.com/test-file.txt',
ImportMethod.URL,
'',
);
});
it('trims file extension for pipeline name suggestion', () => {
tree = shallow(<UploadPipelineDialog open={false} onClose={jest.fn()} />);
const file = { name: 'test_upload_file.tar.gz' };
tree.find('#dropZone').simulate('drop', [file]);
expect(tree.state()).toHaveProperty('dropzoneActive', false);
expect(tree.state()).toHaveProperty('uploadPipelineName', 'test_upload_file');
});
it('sets the import method based on which radio button is toggled', () => {
tree = shallow(<UploadPipelineDialog open={false} onClose={jest.fn()} />);
// Import method is LOCAL by default
expect(tree.state('importMethod')).toBe(ImportMethod.LOCAL);
// Click 'Import by URL'
tree.find('#uploadFromUrlBtn').simulate('change');
expect(tree.state('importMethod')).toBe(ImportMethod.URL);
// Click back to default, 'Upload a file'
tree.find('#uploadLocalFileBtn').simulate('change');
expect(tree.state('importMethod')).toBe(ImportMethod.LOCAL);
});
it('resets all state if the dialog is closed and the callback returns true', async () => {
const spy = jest.fn(() => true);
tree = shallow(<UploadPipelineDialog open={false} onClose={spy} />);
tree.setState({
busy: true,
dropzoneActive: true,
file: {},
fileName: 'test file name',
fileUrl: 'https://some.url.com',
importMethod: ImportMethod.URL,
uploadPipelineDescription: 'test description',
uploadPipelineName: 'test pipeline name',
});
tree.find('#confirmUploadBtn').simulate('click');
await TestUtils.flushPromises();
expect(tree.state('busy')).toBe(false);
expect(tree.state('dropzoneActive')).toBe(false);
expect(tree.state('file')).toBeNull();
expect(tree.state('fileName')).toBe('');
expect(tree.state('fileUrl')).toBe('');
expect(tree.state('importMethod')).toBe(ImportMethod.LOCAL);
expect(tree.state('uploadPipelineDescription')).toBe('');
expect(tree.state('uploadPipelineName')).toBe('');
});
it('does not reset the state if the dialog is closed and the callback returns false', async () => {
const spy = jest.fn(() => false);
tree = shallow(<UploadPipelineDialog open={false} onClose={spy} />);
tree.setState({
busy: true,
dropzoneActive: true,
file: {},
fileName: 'test file name',
fileUrl: 'https://some.url.com',
importMethod: ImportMethod.URL,
uploadPipelineDescription: 'test description',
uploadPipelineName: 'test pipeline name',
});
tree.find('#confirmUploadBtn').simulate('click');
await TestUtils.flushPromises();
expect(tree.state('dropzoneActive')).toBe(true);
expect(tree.state('file')).toEqual({});
expect(tree.state('fileName')).toBe('test file name');
expect(tree.state('fileUrl')).toBe('https://some.url.com');
expect(tree.state('importMethod')).toBe(ImportMethod.URL);
expect(tree.state('uploadPipelineDescription')).toBe('test description');
expect(tree.state('uploadPipelineName')).toBe('test pipeline name');
// 'busy' is set to false regardless upon the callback returning
expect(tree.state('busy')).toBe(false);
});
it('sets an active dropzone on drag', () => {
tree = shallow(<UploadPipelineDialog open={false} onClose={jest.fn()} />);
tree.find('#dropZone').simulate('dragEnter');
expect(tree.state()).toHaveProperty('dropzoneActive', true);
});
it('sets an inactive dropzone on drag leave', () => {
tree = shallow(<UploadPipelineDialog open={false} onClose={jest.fn()} />);
tree.find('#dropZone').simulate('dragLeave');
expect(tree.state()).toHaveProperty('dropzoneActive', false);
});
it('sets a file object on drop', () => {
tree = shallow(<UploadPipelineDialog open={false} onClose={jest.fn()} />);
const file = { name: 'test upload file' };
tree.find('#dropZone').simulate('drop', [file]);
expect(tree.state()).toHaveProperty('dropzoneActive', false);
expect(tree.state()).toHaveProperty('uploadPipelineName', file.name);
});
});
| 7,954 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/SideNav.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Button from '@material-ui/core/Button';
import IconButton from '@material-ui/core/IconButton';
import Tooltip from '@material-ui/core/Tooltip';
import ArchiveIcon from '@material-ui/icons/Archive';
import ArtifactsIcon from '@material-ui/icons/BubbleChart';
import ChevronLeftIcon from '@material-ui/icons/ChevronLeft';
import JupyterhubIcon from '@material-ui/icons/Code';
import DescriptionIcon from '@material-ui/icons/Description';
import OpenInNewIcon from '@material-ui/icons/OpenInNew';
import ExecutionsIcon from '@material-ui/icons/PlayArrow';
import * as React from 'react';
import { RouterProps } from 'react-router';
import { Link } from 'react-router-dom';
import { classes, stylesheet } from 'typestyle';
import { ExternalLinks, RoutePage, RoutePrefix } from '../components/Router';
import { commonCss, fontsize } from '../Css';
import ExperimentsIcon from '../icons/experiments';
import GitHubIcon from '../icons/GitHub-Mark-120px-plus.png';
import PipelinesIcon from '../icons/pipelines';
import { Apis } from '../lib/Apis';
import { Deployments, KFP_FLAGS } from '../lib/Flags';
import { LocalStorage, LocalStorageKey } from '../lib/LocalStorage';
import { logger } from '../lib/Utils';
import { GkeMetadataContext, GkeMetadata } from 'src/lib/GkeMetadata';
export const sideNavColors = {
bg: '#f8fafb',
fgActive: '#0d6de7',
fgActiveInvisible: 'rgb(227, 233, 237, 0)',
fgDefault: '#9aa0a6',
hover: '#f1f3f4',
separator: '#bdc1c6',
sideNavBorder: '#e8eaed',
};
const COLLAPSED_SIDE_NAV_SIZE = 72;
const EXPANDED_SIDE_NAV_SIZE = 220;
export const css = stylesheet({
active: {
color: sideNavColors.fgActive + ' !important',
},
button: {
$nest: {
'&::hover': {
backgroundColor: sideNavColors.hover,
},
},
borderRadius: 0,
color: sideNavColors.fgDefault,
display: 'block',
fontSize: fontsize.medium,
fontWeight: 'bold',
height: 44,
marginBottom: 16,
maxWidth: EXPANDED_SIDE_NAV_SIZE,
overflow: 'hidden',
padding: '12px 10px 10px 26px',
textAlign: 'left',
textTransform: 'none',
transition: 'max-width 0.3s',
whiteSpace: 'nowrap',
width: EXPANDED_SIDE_NAV_SIZE,
},
chevron: {
color: sideNavColors.fgDefault,
marginLeft: 16,
padding: 6,
transition: 'transform 0.3s',
},
collapsedButton: {
maxWidth: COLLAPSED_SIDE_NAV_SIZE,
minWidth: COLLAPSED_SIDE_NAV_SIZE,
padding: '12px 10px 10px 26px',
},
collapsedChevron: {
transform: 'rotate(180deg)',
},
collapsedExternalLabel: {
// Hide text when collapsing, but do it with a transition of both height and
// opacity
height: 0,
opacity: 0,
},
collapsedLabel: {
// Hide text when collapsing, but do it with a transition
opacity: 0,
},
collapsedRoot: {
width: `${COLLAPSED_SIDE_NAV_SIZE}px !important`,
},
collapsedSeparator: {
margin: '20px !important',
},
envMetadata: {
color: sideNavColors.fgDefault,
marginBottom: 16,
marginLeft: 30,
},
icon: {
height: 20,
width: 20,
},
iconImage: {
opacity: 0.6, // Images are too colorful there by default, reduce their color.
},
indicator: {
borderBottom: '3px solid transparent',
borderLeft: `3px solid ${sideNavColors.fgActive}`,
borderTop: '3px solid transparent',
height: 38,
left: 0,
position: 'absolute',
zIndex: 1,
},
indicatorHidden: {
opacity: 0,
},
infoHidden: {
opacity: 0,
transition: 'opacity 0s',
transitionDelay: '0s',
// guarantees info doesn't affect layout when hidden
overflow: 'hidden',
height: 0,
},
infoVisible: {
opacity: 'initial',
transition: 'opacity 0.2s',
transitionDelay: '0.3s',
overflow: 'hidden',
},
label: {
fontSize: fontsize.base,
letterSpacing: 0.25,
marginLeft: 20,
transition: 'opacity 0.3s',
verticalAlign: 'super',
},
link: {
color: '#77abda',
},
openInNewTabIcon: {
height: 12,
marginBottom: 8,
marginLeft: 5,
width: 12,
},
root: {
background: sideNavColors.bg,
borderRight: `1px ${sideNavColors.sideNavBorder} solid`,
paddingTop: 15,
transition: 'width 0.3s',
width: EXPANDED_SIDE_NAV_SIZE,
},
separator: {
border: '0px none transparent',
borderTop: `1px solid ${sideNavColors.separator}`,
margin: 20,
},
});
interface DisplayBuildInfo {
commitHash: string;
commitUrl: string;
date: string;
tagName: string;
}
interface SideNavProps extends RouterProps {
page: string;
}
interface SideNavInternalProps extends SideNavProps {
gkeMetadata: GkeMetadata;
}
interface SideNavState {
displayBuildInfo?: DisplayBuildInfo;
collapsed: boolean;
jupyterHubAvailable: boolean;
manualCollapseState: boolean;
}
export class SideNav extends React.Component<SideNavInternalProps, SideNavState> {
private _isMounted = true;
private readonly _AUTO_COLLAPSE_WIDTH = 800;
private readonly _HUB_ADDRESS = '/hub/';
constructor(props: any) {
super(props);
const collapsed = LocalStorage.isNavbarCollapsed();
this.state = {
collapsed,
// Set jupyterHubAvailable to false so UI don't show Jupyter Hub link
jupyterHubAvailable: false,
manualCollapseState: LocalStorage.hasKey(LocalStorageKey.navbarCollapsed),
};
}
public async componentDidMount(): Promise<void> {
window.addEventListener('resize', this._maybeResize.bind(this));
this._maybeResize();
async function fetchBuildInfo() {
const buildInfo = await Apis.getBuildInfo();
const commitHash = buildInfo.apiServerCommitHash || buildInfo.frontendCommitHash || '';
const tagName = buildInfo.apiServerTagName || buildInfo.frontendTagName || '';
return {
tagName: tagName || 'unknown',
commitHash: commitHash ? commitHash.substring(0, 7) : 'unknown',
commitUrl:
'https://www.github.com/kubeflow/pipelines' +
(commitHash && commitHash !== 'unknown' ? `/commit/${commitHash}` : ''),
date: buildInfo.buildDate
? new Date(buildInfo.buildDate).toLocaleDateString('en-US')
: 'unknown',
};
}
const displayBuildInfo = await fetchBuildInfo().catch(err => {
logger.error('Failed to retrieve build info', err);
return undefined;
});
this.setStateSafe({ displayBuildInfo });
}
public componentWillUnmount(): void {
this._isMounted = false;
}
public render(): JSX.Element {
const page = this.props.page;
const { collapsed, displayBuildInfo } = this.state;
const { gkeMetadata } = this.props;
const iconColor = {
active: sideNavColors.fgActive,
inactive: sideNavColors.fgDefault,
};
return (
<div
id='sideNav'
className={classes(
css.root,
commonCss.flexColumn,
commonCss.noShrink,
collapsed && css.collapsedRoot,
)}
>
<div style={{ flexGrow: 1 }}>
{KFP_FLAGS.DEPLOYMENT === Deployments.MARKETPLACE && (
<>
<div
className={classes(
css.indicator,
!page.startsWith(RoutePage.START) && css.indicatorHidden,
)}
/>
<Tooltip
title={'Getting Started'}
enterDelay={300}
placement={'right-start'}
disableFocusListener={!collapsed}
disableHoverListener={!collapsed}
disableTouchListener={!collapsed}
>
<Link id='gettingStartedBtn' to={RoutePage.START} className={commonCss.unstyled}>
<Button
className={classes(
css.button,
page.startsWith(RoutePage.START) && css.active,
collapsed && css.collapsedButton,
)}
>
<DescriptionIcon style={{ width: 20, height: 20 }} />
<span className={classes(collapsed && css.collapsedLabel, css.label)}>
Getting Started
</span>
</Button>
</Link>
</Tooltip>
</>
)}
<div
className={classes(
css.indicator,
!page.startsWith(RoutePage.PIPELINES) && css.indicatorHidden,
)}
/>
<Tooltip
title={'Pipeline List'}
enterDelay={300}
placement={'right-start'}
disableFocusListener={!collapsed}
disableHoverListener={!collapsed}
disableTouchListener={!collapsed}
>
<Link id='pipelinesBtn' to={RoutePage.PIPELINES} className={commonCss.unstyled}>
<Button
className={classes(
css.button,
page.startsWith(RoutePage.PIPELINES) && css.active,
collapsed && css.collapsedButton,
)}
>
<PipelinesIcon
color={
page.startsWith(RoutePage.PIPELINES) ? iconColor.active : iconColor.inactive
}
/>
<span className={classes(collapsed && css.collapsedLabel, css.label)}>
Pipelines
</span>
</Button>
</Link>
</Tooltip>
<div
className={classes(
css.indicator,
!this._highlightExperimentsButton(page) && css.indicatorHidden,
)}
/>
<Tooltip
title={'Experiment List'}
enterDelay={300}
placement={'right-start'}
disableFocusListener={!collapsed}
disableHoverListener={!collapsed}
disableTouchListener={!collapsed}
>
<Link id='experimentsBtn' to={RoutePage.EXPERIMENTS} className={commonCss.unstyled}>
<Button
className={classes(
css.button,
this._highlightExperimentsButton(page) && css.active,
collapsed && css.collapsedButton,
)}
>
<ExperimentsIcon
color={
this._highlightExperimentsButton(page) ? iconColor.active : iconColor.inactive
}
/>
<span className={classes(collapsed && css.collapsedLabel, css.label)}>
Experiments
</span>
</Button>
</Link>
</Tooltip>
<div
className={classes(
css.indicator,
!this._highlightArtifactsButton(page) && css.indicatorHidden,
)}
/>
<Tooltip
title={'Artifacts List'}
enterDelay={300}
placement={'right-start'}
disableFocusListener={!collapsed}
disableHoverListener={!collapsed}
disableTouchListener={!collapsed}
>
<Link id='artifactsBtn' to={RoutePage.ARTIFACTS} className={commonCss.unstyled}>
<Button
className={classes(
css.button,
this._highlightArtifactsButton(page) && css.active,
collapsed && css.collapsedButton,
)}
>
<ArtifactsIcon />
<span className={classes(collapsed && css.collapsedLabel, css.label)}>
Artifacts
</span>
</Button>
</Link>
</Tooltip>
<div
className={classes(
css.indicator,
!this._highlightExecutionsButton(page) && css.indicatorHidden,
)}
/>
<Tooltip
title={'Executions List'}
enterDelay={300}
placement={'right-start'}
disableFocusListener={!collapsed}
disableHoverListener={!collapsed}
disableTouchListener={!collapsed}
>
<Link id='executionsBtn' to={RoutePage.EXECUTIONS} className={commonCss.unstyled}>
<Button
className={classes(
css.button,
this._highlightExecutionsButton(page) && css.active,
collapsed && css.collapsedButton,
)}
>
<ExecutionsIcon />
<span className={classes(collapsed && css.collapsedLabel, css.label)}>
Executions
</span>
</Button>
</Link>
</Tooltip>
{this.state.jupyterHubAvailable && (
<Tooltip
title={'Open Jupyter Notebook'}
enterDelay={300}
placement={'right-start'}
disableFocusListener={!collapsed}
disableHoverListener={!collapsed}
disableTouchListener={!collapsed}
>
<a
id='jupyterhubBtn'
href={this._HUB_ADDRESS}
className={commonCss.unstyled}
target='_blank'
rel='noopener'
>
<Button className={classes(css.button, collapsed && css.collapsedButton)}>
<JupyterhubIcon style={{ height: 20, width: 20 }} />
<span className={classes(collapsed && css.collapsedLabel, css.label)}>
Notebooks
</span>
<OpenInNewIcon className={css.openInNewTabIcon} />
</Button>
</a>
</Tooltip>
)}
<hr className={classes(css.separator, collapsed && css.collapsedSeparator)} />
<div
className={classes(
css.indicator,
![RoutePage.ARCHIVED_RUNS, RoutePage.ARCHIVED_EXPERIMENTS].includes(page) &&
css.indicatorHidden,
)}
/>
<Tooltip
title={'Archive'}
enterDelay={300}
placement={'right-start'}
disableFocusListener={!collapsed}
disableHoverListener={!collapsed}
disableTouchListener={!collapsed}
>
<Link id='archiveBtn' to={RoutePage.ARCHIVED_RUNS} className={commonCss.unstyled}>
<Button
className={classes(
css.button,
(page === RoutePage.ARCHIVED_RUNS || page === RoutePage.ARCHIVED_EXPERIMENTS) &&
css.active,
collapsed && css.collapsedButton,
)}
>
<ArchiveIcon style={{ height: 20, width: 20 }} />
<span className={classes(collapsed && css.collapsedLabel, css.label)}>Archive</span>
</Button>
</Link>
</Tooltip>
<hr className={classes(css.separator, collapsed && css.collapsedSeparator)} />
<ExternalUri
title={'Documentation'}
to={ExternalLinks.DOCUMENTATION}
collapsed={collapsed}
icon={className => <DescriptionIcon className={className} />}
/>
<ExternalUri
title={'Github Repo'}
to={ExternalLinks.GITHUB}
collapsed={collapsed}
icon={className => (
<img src={GitHubIcon} className={classes(className, css.iconImage)} alt='Github' />
)}
/>
<ExternalUri
title={'AI Hub Samples'}
to={ExternalLinks.AI_HUB}
collapsed={collapsed}
icon={className => (
<img
src='https://www.gstatic.com/aihub/aihub_favicon.png'
className={classes(className, css.iconImage)}
alt='AI Hub'
/>
)}
/>
<hr className={classes(css.separator, collapsed && css.collapsedSeparator)} />
<IconButton
className={classes(css.chevron, collapsed && css.collapsedChevron)}
onClick={this._toggleNavClicked.bind(this)}
>
<ChevronLeftIcon />
</IconButton>
</div>
<div className={collapsed ? css.infoHidden : css.infoVisible}>
{gkeMetadata.clusterName && gkeMetadata.projectId && (
<Tooltip
title={`Cluster name: ${gkeMetadata.clusterName}, Project ID: ${gkeMetadata.projectId}`}
enterDelay={300}
placement='top-start'
>
<div className={css.envMetadata}>
<span>Cluster name: </span>
<a
href={`https://console.cloud.google.com/kubernetes/list?project=${gkeMetadata.projectId}&filter=name:${gkeMetadata.clusterName}`}
className={classes(css.link, commonCss.unstyled)}
rel='noopener'
target='_blank'
>
{gkeMetadata.clusterName}
</a>
</div>
</Tooltip>
)}
{displayBuildInfo && (
<Tooltip
title={`Build date: ${displayBuildInfo.date}, Commit hash: ${displayBuildInfo.commitHash}`}
enterDelay={300}
placement={'top-start'}
>
<div className={css.envMetadata}>
<span>Version: </span>
<a
href={displayBuildInfo.commitUrl}
className={classes(css.link, commonCss.unstyled)}
rel='noopener'
target='_blank'
>
{displayBuildInfo.tagName}
</a>
</div>
</Tooltip>
)}
<Tooltip title='Report an Issue' enterDelay={300} placement={'top-start'}>
<div className={css.envMetadata}>
<a
href='https://github.com/kubeflow/pipelines/issues/new?template=BUG_REPORT.md'
className={classes(css.link, commonCss.unstyled)}
rel='noopener'
target='_blank'
>
Report an Issue
</a>
</div>
</Tooltip>
</div>
</div>
);
}
private _highlightExperimentsButton(page: string): boolean {
return (
page.startsWith(RoutePage.EXPERIMENTS) ||
page.startsWith(RoutePage.RUNS) ||
page.startsWith(RoutePrefix.RECURRING_RUN) ||
page.startsWith(RoutePage.COMPARE)
);
}
private _highlightArtifactsButton(page: string): boolean {
return page.startsWith(RoutePrefix.ARTIFACT);
}
private _highlightExecutionsButton(page: string): boolean {
return page.startsWith(RoutePrefix.EXECUTION);
}
private _toggleNavClicked(): void {
this.setStateSafe(
{
collapsed: !this.state.collapsed,
manualCollapseState: true,
},
() => LocalStorage.saveNavbarCollapsed(this.state.collapsed),
);
this._toggleNavCollapsed();
}
private _toggleNavCollapsed(shouldCollapse?: boolean): void {
this.setStateSafe({
collapsed: shouldCollapse !== undefined ? shouldCollapse : !this.state.collapsed,
});
}
private _maybeResize(): void {
if (!this.state.manualCollapseState) {
this._toggleNavCollapsed(window.innerWidth < this._AUTO_COLLAPSE_WIDTH);
}
}
private setStateSafe(newState: Partial<SideNavState>, cb?: () => void): void {
if (this._isMounted) {
this.setState(newState as any, cb);
}
}
}
interface ExternalUriProps {
title: string;
to: string;
collapsed: boolean;
icon: (className: string) => React.ReactNode;
}
// tslint:disable-next-line:variable-name
const ExternalUri: React.FC<ExternalUriProps> = ({ title, to, collapsed, icon }) => (
<Tooltip
title={title}
enterDelay={300}
placement={'right-start'}
disableFocusListener={!collapsed}
disableHoverListener={!collapsed}
disableTouchListener={!collapsed}
>
<a href={to} className={commonCss.unstyled} target='_blank' rel='noopener noreferrer'>
<Button className={classes(css.button, collapsed && css.collapsedButton)}>
{icon(css.icon)}
<span className={classes(collapsed && css.collapsedLabel, css.label)}>{title}</span>
<OpenInNewIcon className={css.openInNewTabIcon} />
</Button>
</a>
</Tooltip>
);
const EnhancedSideNav: React.FC<SideNavProps> = props => {
const gkeMetadata = React.useContext(GkeMetadataContext);
return <SideNav {...props} gkeMetadata={gkeMetadata} />;
};
export default EnhancedSideNav;
| 7,955 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/Metric.test.tsx | /*
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import Metric from './Metric';
import { ReactWrapper, ShallowWrapper, shallow } from 'enzyme';
import { RunMetricFormat } from '../apis/run';
describe('Metric', () => {
let tree: ShallowWrapper | ReactWrapper;
const onErrorSpy = jest.fn();
beforeEach(() => {
onErrorSpy.mockClear();
});
afterEach(async () => {
// unmount() should be called before resetAllMocks() in case any part of the unmount life cycle
// depends on mocks/spies
if (tree) {
await tree.unmount();
}
jest.resetAllMocks();
});
it('renders an empty metric when there is no metric', () => {
tree = shallow(<Metric />);
expect(tree).toMatchSnapshot();
});
it('renders an empty metric when metric has no value', () => {
tree = shallow(<Metric metric={{}} />);
expect(tree).toMatchSnapshot();
});
it('renders a metric when metric has value and percentage format', () => {
tree = shallow(<Metric metric={{ format: RunMetricFormat.PERCENTAGE, number_value: 0.54 }} />);
expect(tree).toMatchSnapshot();
});
it('renders an empty metric when metric has no metadata and unspecified format', () => {
tree = shallow(<Metric metric={{ format: RunMetricFormat.UNSPECIFIED, number_value: 0.54 }} />);
expect(tree).toMatchSnapshot();
});
it('renders an empty metric when metric has no metadata and raw format', () => {
tree = shallow(<Metric metric={{ format: RunMetricFormat.RAW, number_value: 0.54 }} />);
expect(tree).toMatchSnapshot();
});
it('renders a metric when metric has max and min value of 0', () => {
tree = shallow(
<Metric
metadata={{ name: 'some metric', count: 1, maxValue: 0, minValue: 0 }}
metric={{ format: RunMetricFormat.RAW, number_value: 0.54 }}
/>,
);
expect(tree).toMatchSnapshot();
});
it('renders a metric and does not log an error when metric is between max and min value', () => {
const consoleSpy = jest.spyOn(console, 'error').mockImplementation();
tree = shallow(
<Metric
metadata={{ name: 'some metric', count: 1, maxValue: 1, minValue: 0 }}
metric={{ format: RunMetricFormat.RAW, number_value: 0.54 }}
/>,
);
expect(consoleSpy).toHaveBeenCalledTimes(0);
expect(tree).toMatchSnapshot();
});
it('renders a metric and logs an error when metric has value less than min value', () => {
const consoleSpy = jest.spyOn(console, 'error').mockImplementation();
tree = shallow(
<Metric
metadata={{ name: 'some metric', count: 1, maxValue: 1, minValue: 0 }}
metric={{ format: RunMetricFormat.RAW, number_value: -0.54 }}
/>,
);
expect(consoleSpy).toHaveBeenCalled();
expect(tree).toMatchSnapshot();
});
it('renders a metric and logs an error when metric has value greater than max value', () => {
const consoleSpy = jest.spyOn(console, 'error').mockImplementation();
tree = shallow(
<Metric
metadata={{ name: 'some metric', count: 1, maxValue: 1, minValue: 0 }}
metric={{ format: RunMetricFormat.RAW, number_value: 2 }}
/>,
);
expect(consoleSpy).toHaveBeenCalled();
expect(tree).toMatchSnapshot();
});
});
| 7,956 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/Editor.tsx | /*
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import AceEditor from 'react-ace';
// Modified AceEditor that supports HTML within provided placeholder. This is
// important because it allows for the usage of multi-line placeholders.
class Editor extends AceEditor {
public updatePlaceholder(): void {
const editor = this.editor;
const { placeholder } = this.props;
const showPlaceholder = !editor.session.getValue().length;
let node = editor.renderer.placeholderNode;
if (!showPlaceholder && node) {
editor.renderer.scroller.removeChild(editor.renderer.placeholderNode);
editor.renderer.placeholderNode = null;
} else if (showPlaceholder && !node) {
node = editor.renderer.placeholderNode = document.createElement('div');
node.innerHTML = placeholder || '';
node.className = 'ace_comment ace_placeholder';
node.style.padding = '0 9px';
node.style.position = 'absolute';
node.style.zIndex = '3';
editor.renderer.scroller.appendChild(node);
} else if (showPlaceholder && node) {
node.innerHTML = placeholder;
}
}
}
export default Editor;
| 7,957 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/CustomTable.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import ArrowRight from '@material-ui/icons/ArrowRight';
import Checkbox, { CheckboxProps } from '@material-ui/core/Checkbox';
import ChevronLeft from '@material-ui/icons/ChevronLeft';
import ChevronRight from '@material-ui/icons/ChevronRight';
import CircularProgress from '@material-ui/core/CircularProgress';
import FilterIcon from '@material-ui/icons/FilterList';
import IconButton from '@material-ui/core/IconButton';
import Input from '../atoms/Input';
import MenuItem from '@material-ui/core/MenuItem';
import Radio from '@material-ui/core/Radio';
import Separator from '../atoms/Separator';
import TableSortLabel from '@material-ui/core/TableSortLabel';
import TextField, { TextFieldProps } from '@material-ui/core/TextField';
import Tooltip from '@material-ui/core/Tooltip';
import { ListRequest } from '../lib/Apis';
import { classes, stylesheet } from 'typestyle';
import { fonts, fontsize, dimension, commonCss, color, padding, zIndex } from '../Css';
import { logger } from '../lib/Utils';
import { ApiFilter, PredicateOp } from '../apis/filter/api';
import { debounce } from 'lodash';
import { InputAdornment } from '@material-ui/core';
import { CustomTableRow } from './CustomTableRow';
export enum ExpandState {
COLLAPSED,
EXPANDED,
NONE,
}
export interface Column {
flex?: number;
label: string;
sortKey?: string;
customRenderer?: React.FC<CustomRendererProps<any | undefined>>;
}
export interface CustomRendererProps<T> {
value?: T;
id: string;
}
export interface Row {
expandState?: ExpandState;
error?: string;
id: string;
otherFields: any[];
}
const rowHeight = 40;
export const css = stylesheet({
cell: {
$nest: {
'&:not(:nth-child(2))': {
color: color.inactive,
},
},
alignSelf: 'center',
borderBottom: 'initial',
color: color.foreground,
fontFamily: fonts.secondary,
fontSize: fontsize.base,
letterSpacing: 0.25,
marginRight: 20,
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
},
columnName: {
color: '#1F1F1F',
fontSize: fontsize.small,
fontWeight: 'bold',
letterSpacing: 0.25,
marginRight: 20,
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
},
emptyMessage: {
padding: 20,
textAlign: 'center',
},
expandButton: {
marginRight: 10,
padding: 3,
transition: 'transform 0.3s',
},
expandButtonExpanded: {
transform: 'rotate(90deg)',
},
expandButtonPlaceholder: {
width: 54,
},
expandableContainer: {
transition: 'margin 0.2s',
},
expandedContainer: {
borderRadius: 10,
boxShadow: '0 1px 2px 0 rgba(60,64,67,0.30), 0 1px 3px 1px rgba(60,64,67,0.15)',
margin: '16px 2px',
},
expandedRow: {
borderBottom: '1px solid transparent !important',
boxSizing: 'border-box',
height: '40px !important',
},
filterBorderRadius: {
borderRadius: 8,
},
filterBox: {
margin: '16px 0',
},
footer: {
borderBottom: '1px solid ' + color.divider,
fontFamily: fonts.secondary,
height: 40,
textAlign: 'right',
},
header: {
borderBottom: 'solid 1px ' + color.divider,
color: color.strong,
display: 'flex',
flex: '0 0 40px',
lineHeight: '40px', // must declare px
},
noLeftPadding: {
paddingLeft: 0,
},
noMargin: {
margin: 0,
},
row: {
$nest: {
'&:hover': {
backgroundColor: '#f3f3f3',
},
},
borderBottom: '1px solid #ddd',
display: 'flex',
flexShrink: 0,
height: rowHeight,
outline: 'none',
},
rowsPerPage: {
color: color.strong,
height: dimension.xsmall,
minWidth: dimension.base,
},
selected: {
backgroundColor: color.activeBg,
},
selectionToggle: {
marginRight: 12,
overflow: 'initial', // Resets overflow from 'hidden'
},
verticalAlignInitial: {
verticalAlign: 'initial',
},
});
interface CustomTableProps {
columns: Column[];
disablePaging?: boolean;
disableSelection?: boolean;
disableSorting?: boolean;
emptyMessage?: string;
filterLabel?: string;
getExpandComponent?: (index: number) => React.ReactNode;
initialSortColumn?: string;
initialSortOrder?: 'asc' | 'desc';
noFilterBox?: boolean;
reload: (request: ListRequest) => Promise<string>;
rows: Row[];
selectedIds?: string[];
toggleExpansion?: (rowId: number) => void;
updateSelection?: (selectedIds: string[]) => void;
useRadioButtons?: boolean;
}
interface CustomTableState {
currentPage: number;
filterString: string;
filterStringEncoded: string;
isBusy: boolean;
maxPageIndex: number;
sortOrder: 'asc' | 'desc';
pageSize: number;
sortBy: string;
tokenList: string[];
}
export default class CustomTable extends React.Component<CustomTableProps, CustomTableState> {
private _isMounted = true;
private _debouncedFilterRequest = debounce(
(filterString: string) => this._requestFilter(filterString),
300,
);
constructor(props: CustomTableProps) {
super(props);
this.state = {
currentPage: 0,
filterString: '',
filterStringEncoded: '',
isBusy: false,
maxPageIndex: Number.MAX_SAFE_INTEGER,
pageSize: 10,
sortBy:
props.initialSortColumn || (props.columns.length ? props.columns[0].sortKey || '' : ''),
sortOrder: props.initialSortOrder || 'desc',
tokenList: [''],
};
}
public handleSelectAllClick(event: React.ChangeEvent): void {
if (this.props.disableSelection === true) {
// This should be impossible to reach
return;
}
const selectedIds = (event.target as CheckboxProps).checked
? this.props.rows.map(v => v.id)
: [];
if (this.props.updateSelection) {
this.props.updateSelection(selectedIds);
}
}
public handleClick(e: React.MouseEvent, id: string): void {
if (this.props.disableSelection === true) {
return;
}
let newSelected = [];
if (this.props.useRadioButtons) {
newSelected = [id];
} else {
const selectedIds = this.props.selectedIds || [];
const selectedIndex = selectedIds.indexOf(id);
newSelected =
selectedIndex === -1
? selectedIds.concat(id)
: selectedIds.slice(0, selectedIndex).concat(selectedIds.slice(selectedIndex + 1));
}
if (this.props.updateSelection) {
this.props.updateSelection(newSelected);
}
e.stopPropagation();
}
public isSelected(id: string): boolean {
return !!this.props.selectedIds && this.props.selectedIds.indexOf(id) !== -1;
}
public componentDidMount(): void {
this._pageChanged(0);
}
public componentWillUnmount(): void {
this._isMounted = false;
this._debouncedFilterRequest.cancel();
}
public render(): JSX.Element {
const { filterString, pageSize, sortBy, sortOrder } = this.state;
const numSelected = (this.props.selectedIds || []).length;
const totalFlex = this.props.columns.reduce((total, c) => (total += c.flex || 1), 0);
const widths = this.props.columns.map(c => ((c.flex || 1) / totalFlex) * 100);
return (
<div className={commonCss.pageOverflowHidden}>
{/* Filter/Search bar */}
{!this.props.noFilterBox && (
<div>
<Input
id='tableFilterBox'
label={this.props.filterLabel || 'Filter'}
height={48}
maxWidth={'100%'}
className={css.filterBox}
InputLabelProps={{ classes: { root: css.noMargin } }}
onChange={this.handleFilterChange}
value={filterString}
variant='outlined'
InputProps={{
classes: {
notchedOutline: css.filterBorderRadius,
root: css.noLeftPadding,
},
startAdornment: (
<InputAdornment position='end'>
<FilterIcon style={{ color: color.lowContrast, paddingRight: 16 }} />
</InputAdornment>
),
}}
/>
</div>
)}
{/* Header */}
<div className={classes(css.header, this.props.disableSelection && padding(20, 'l'))}>
{// Called as function to avoid breaking shallow rendering tests.
HeaderRowSelectionSection({
disableSelection: this.props.disableSelection,
indeterminate: !!numSelected && numSelected < this.props.rows.length,
isSelected: !!numSelected && numSelected === this.props.rows.length,
onSelectAll: this.handleSelectAllClick.bind(this),
showExpandButton: !!this.props.getExpandComponent,
useRadioButtons: this.props.useRadioButtons,
})}
{this.props.columns.map((col, i) => {
const isColumnSortable = !!this.props.columns[i].sortKey;
const isCurrentSortColumn = sortBy === this.props.columns[i].sortKey;
return (
<div
key={i}
style={{ width: widths[i] + '%' }}
className={css.columnName}
title={
// Browser shows an info popup on hover.
// It helps when there's not enough space for full text.
col.label
}
>
{this.props.disableSorting === true && col.label}
{!this.props.disableSorting && (
<Tooltip
title={isColumnSortable ? 'Sort' : 'Cannot sort by this column'}
enterDelay={300}
>
<TableSortLabel
active={isCurrentSortColumn}
className={commonCss.ellipsis}
direction={isColumnSortable ? sortOrder : undefined}
onClick={() => this._requestSort(this.props.columns[i].sortKey)}
>
{col.label}
</TableSortLabel>
</Tooltip>
)}
</div>
);
})}
</div>
{/* Body */}
<div className={commonCss.scrollContainer} style={{ minHeight: 60 }}>
{/* Busy experience */}
{this.state.isBusy && (
<React.Fragment>
<div className={commonCss.busyOverlay} />
<CircularProgress
size={25}
className={commonCss.absoluteCenter}
style={{ zIndex: zIndex.BUSY_OVERLAY }}
/>
</React.Fragment>
)}
{/* Empty experience */}
{this.props.rows.length === 0 && !!this.props.emptyMessage && !this.state.isBusy && (
<div className={css.emptyMessage}>{this.props.emptyMessage}</div>
)}
{this.props.rows.map((row, i) => {
if (row.otherFields.length !== this.props.columns.length) {
logger.error('Rows must have the same number of cells defined in columns');
return null;
}
const selected = this.isSelected(row.id);
return (
<div
className={classes(
css.expandableContainer,
row.expandState === ExpandState.EXPANDED && css.expandedContainer,
)}
key={i}
>
<div
role='checkbox'
aria-checked={selected}
tabIndex={-1}
className={classes(
'tableRow',
css.row,
this.props.disableSelection === true && padding(20, 'l'),
selected && css.selected,
row.expandState === ExpandState.EXPANDED && css.expandedRow,
)}
onClick={e => this.handleClick(e, row.id)}
>
{// Called as function to avoid breaking shallow rendering tests.
BodyRowSelectionSection({
disableSelection: this.props.disableSelection,
expandState: row.expandState,
isSelected: selected,
onExpand: e => this._expandButtonToggled(e, i),
showExpandButton: !!this.props.getExpandComponent,
useRadioButtons: this.props.useRadioButtons,
})}
<CustomTableRow row={row} columns={this.props.columns} />
</div>
{row.expandState === ExpandState.EXPANDED && this.props.getExpandComponent && (
<div>{this.props.getExpandComponent(i)}</div>
)}
</div>
);
})}
</div>
{/* Footer */}
{!this.props.disablePaging && (
<div className={css.footer}>
<span className={padding(10, 'r')}>Rows per page:</span>
<TextField
select={true}
variant='standard'
className={css.rowsPerPage}
classes={{ root: css.verticalAlignInitial }}
InputProps={{ disableUnderline: true }}
onChange={this._requestRowsPerPage.bind(this)}
value={pageSize}
>
{[10, 20, 50, 100].map((size, i) => (
<MenuItem key={i} value={size}>
{size}
</MenuItem>
))}
</TextField>
<IconButton onClick={() => this._pageChanged(-1)} disabled={!this.state.currentPage}>
<ChevronLeft />
</IconButton>
<IconButton
onClick={() => this._pageChanged(1)}
disabled={this.state.currentPage >= this.state.maxPageIndex}
>
<ChevronRight />
</IconButton>
</div>
)}
</div>
);
}
public async reload(loadRequest?: ListRequest): Promise<string> {
// Override the current state with incoming request
const request: ListRequest = Object.assign(
{
filter: this.state.filterStringEncoded,
orderAscending: this.state.sortOrder === 'asc',
pageSize: this.state.pageSize,
pageToken: this.state.tokenList[this.state.currentPage],
sortBy: this.state.sortBy,
},
loadRequest,
);
let result = '';
try {
this.setStateSafe({
filterStringEncoded: request.filter,
isBusy: true,
pageSize: request.pageSize,
sortBy: request.sortBy,
sortOrder: request.orderAscending ? 'asc' : 'desc',
});
if (request.sortBy && !request.orderAscending) {
request.sortBy += ' desc';
}
result = await this.props.reload(request);
} finally {
this.setStateSafe({ isBusy: false });
}
return result;
}
public handleFilterChange = (event: any) => {
const value = event.target.value;
// Set state here so that the UI will be updated even if the actual filter request is debounced
this.setStateSafe(
{ filterString: value } as any,
async () => await this._debouncedFilterRequest(value as string),
);
};
// Exposed for testing
protected async _requestFilter(filterString?: string): Promise<void> {
const filterStringEncoded = filterString ? this._createAndEncodeFilter(filterString) : '';
this.setStateSafe({ filterStringEncoded });
this._resetToFirstPage(await this.reload({ filter: filterStringEncoded }));
}
private _createAndEncodeFilter(filterString: string): string {
const filter: ApiFilter = {
predicates: [
{
// TODO: remove this hardcoding once more sophisticated filtering is supported
key: 'name',
op: PredicateOp.ISSUBSTRING,
string_value: filterString,
},
],
};
return encodeURIComponent(JSON.stringify(filter));
}
private setStateSafe(newState: Partial<CustomTableState>, cb?: () => void): void {
if (this._isMounted) {
this.setState(newState as any, cb);
}
}
private _requestSort(sortBy?: string): void {
if (sortBy) {
// Set the sort column to the provided column if it's different, and
// invert the sort order it if it's the same column
const sortOrder =
this.state.sortBy === sortBy ? (this.state.sortOrder === 'asc' ? 'desc' : 'asc') : 'asc';
this.setStateSafe({ sortOrder, sortBy }, async () => {
this._resetToFirstPage(
await this.reload({ pageToken: '', orderAscending: sortOrder === 'asc', sortBy }),
);
});
}
}
private async _pageChanged(offset: number): Promise<void> {
let newCurrentPage = this.state.currentPage + offset;
let maxPageIndex = this.state.maxPageIndex;
newCurrentPage = Math.max(0, newCurrentPage);
newCurrentPage = Math.min(this.state.maxPageIndex, newCurrentPage);
const newPageToken = await this.reload({
pageToken: this.state.tokenList[newCurrentPage],
});
if (newPageToken) {
// If we're using the greatest yet known page, then the pageToken will be new.
if (newCurrentPage + 1 === this.state.tokenList.length) {
this.state.tokenList.push(newPageToken);
}
} else {
maxPageIndex = newCurrentPage;
}
this.setStateSafe({ currentPage: newCurrentPage, maxPageIndex });
}
private async _requestRowsPerPage(event: React.ChangeEvent): Promise<void> {
const pageSize = (event.target as TextFieldProps).value as number;
this._resetToFirstPage(await this.reload({ pageSize, pageToken: '' }));
}
private _resetToFirstPage(newPageToken?: string): void {
let maxPageIndex = Number.MAX_SAFE_INTEGER;
const newTokenList = [''];
if (newPageToken) {
newTokenList.push(newPageToken);
} else {
maxPageIndex = 0;
}
// Reset state, since this invalidates the token list and page counter calculations
this.setStateSafe({
currentPage: 0,
maxPageIndex,
tokenList: newTokenList,
});
}
private _expandButtonToggled(e: React.MouseEvent, rowIndex: number): void {
e.stopPropagation();
if (this.props.toggleExpansion) {
this.props.toggleExpansion(rowIndex);
}
}
}
interface SelectionSectionCommonProps {
disableSelection?: boolean;
isSelected: boolean;
showExpandButton: boolean;
useRadioButtons?: boolean;
}
interface HeaderRowSelectionSectionProps extends SelectionSectionCommonProps {
indeterminate?: boolean;
onSelectAll: React.ChangeEventHandler;
}
const HeaderRowSelectionSection: React.FC<HeaderRowSelectionSectionProps> = ({
disableSelection,
indeterminate,
isSelected,
onSelectAll,
showExpandButton,
useRadioButtons,
}) => {
const nonEmpty = disableSelection !== true || showExpandButton;
if (!nonEmpty) {
return null;
}
return (
<div className={classes(css.columnName, css.cell, css.selectionToggle)}>
{/* If using checkboxes */}
{disableSelection !== true && useRadioButtons !== true && (
<Checkbox
indeterminate={indeterminate}
color='primary'
checked={isSelected}
onChange={onSelectAll}
/>
)}
{/* If using radio buttons */}
{disableSelection !== true && useRadioButtons && (
// Placeholder for radio button horizontal space.
<Separator orientation='horizontal' units={42} />
)}
{showExpandButton && <Separator orientation='horizontal' units={40} />}
</div>
);
};
interface BodyRowSelectionSectionProps extends SelectionSectionCommonProps {
expandState?: ExpandState;
onExpand: React.MouseEventHandler;
}
const BodyRowSelectionSection: React.FC<BodyRowSelectionSectionProps> = ({
disableSelection,
expandState,
isSelected,
onExpand,
showExpandButton,
useRadioButtons,
}) => (
<>
{/* Expansion toggle button */}
{(disableSelection !== true || showExpandButton) && expandState !== ExpandState.NONE && (
<div className={classes(css.cell, css.selectionToggle)}>
{/* If using checkboxes */}
{disableSelection !== true && useRadioButtons !== true && (
<Checkbox color='primary' checked={isSelected} />
)}
{/* If using radio buttons */}
{disableSelection !== true && useRadioButtons && (
<Radio color='primary' checked={isSelected} />
)}
{showExpandButton && (
<IconButton
className={classes(
css.expandButton,
expandState === ExpandState.EXPANDED && css.expandButtonExpanded,
)}
onClick={onExpand}
aria-label='Expand'
>
<ArrowRight />
</IconButton>
)}
</div>
)}
{/* Placeholder for non-expandable rows */}
{expandState === ExpandState.NONE && <div className={css.expandButtonPlaceholder} />}
</>
);
| 7,958 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/ViewerContainer.test.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { shallow } from 'enzyme';
import ViewerContainer from './ViewerContainer';
import { PlotType } from './Viewer';
describe('ViewerContainer', () => {
it('does not break on empty configs', () => {
const tree = shallow(<ViewerContainer configs={[]} />);
expect(tree).toMatchSnapshot();
});
Object.keys(PlotType).map(type =>
it('renders a viewer of type ' + type, () => {
const tree = shallow(<ViewerContainer configs={[{ type: PlotType[type] }]} />);
expect(tree).toMatchSnapshot();
}),
);
});
| 7,959 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/VisualizationCreator.tsx | /*
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import 'brace';
import BusyButton from '../../atoms/BusyButton';
import FormControl from '@material-ui/core/FormControl';
import Input from '../../atoms/Input';
import InputLabel from '@material-ui/core/InputLabel';
import MenuItem from '@material-ui/core/MenuItem';
import Select from '@material-ui/core/Select';
import Editor from '../Editor';
import Viewer, { ViewerConfig } from './Viewer';
import { ApiVisualizationType } from '../../apis/visualization';
import 'brace/ext/language_tools';
import 'brace/mode/json';
import 'brace/mode/python';
import 'brace/theme/github';
import Button from '@material-ui/core/Button';
export interface VisualizationCreatorConfig extends ViewerConfig {
allowCustomVisualizations?: boolean;
// Whether there is currently a visualization being generated or not.
isBusy?: boolean;
// Function called to generate a visualization.
onGenerate?: (visualizationArguments: string, source: string, type: ApiVisualizationType) => void;
// Facilitate testing by not collapsing by default.
collapsedInitially?: boolean;
}
interface VisualizationCreatorProps {
configs: VisualizationCreatorConfig[];
maxWidth?: number;
}
interface VisualizationCreatorState {
expanded: boolean;
// arguments is expected to be a JSON object in string form.
arguments: string;
code: string;
source: string;
selectedType?: ApiVisualizationType;
}
class VisualizationCreator extends Viewer<VisualizationCreatorProps, VisualizationCreatorState> {
public state: VisualizationCreatorState = {
expanded: !this.props.configs[0]?.collapsedInitially,
arguments: '',
code: '',
source: '',
};
public getDisplayName(): string {
return 'Visualization Creator';
}
public render(): JSX.Element | null {
const { configs } = this.props;
const config = configs[0];
const { arguments: _arguments, code, source, selectedType } = this.state;
if (!config) {
return null;
}
const { allowCustomVisualizations = false, isBusy = false, onGenerate } = config;
// Only allow a visualization to be generated if one is not already being
// generated (as indicated by the isBusy tag), and if there is an source
// provided, and a visualization type is selected, and a onGenerate function
// is provided.
const hasSourceAndSelectedType = source.length > 0 && !!selectedType;
const isCustomTypeAndHasCode = selectedType === ApiVisualizationType.CUSTOM && code.length > 0;
const canGenerate =
!isBusy && !!onGenerate && (hasSourceAndSelectedType || isCustomTypeAndHasCode);
const argumentsPlaceholder = this.getArgumentPlaceholderForType(selectedType);
if (!this.state.expanded) {
return (
<Button variant='text' onClick={this.handleExpansion}>
create visualizations manually
</Button>
);
}
return (
<div
style={{
width: this.props.maxWidth || 600,
}}
>
<FormControl style={{ width: '100%' }}>
<InputLabel htmlFor='visualization-type-selector'>Type</InputLabel>
<Select
value={selectedType}
inputProps={{
id: 'visualization-type-selector',
name: 'Visualization Type',
}}
style={{
minHeight: 60,
width: '100%',
}}
onChange={(e: React.ChangeEvent<{ name?: string; value: unknown }>) => {
this.setState({ selectedType: e.target.value as ApiVisualizationType });
}}
disabled={isBusy}
>
{this.getAvailableTypes(allowCustomVisualizations).map((key: string) => (
<MenuItem key={key} value={ApiVisualizationType[key]}>
{ApiVisualizationType[key]}
</MenuItem>
))}
</Select>
</FormControl>
<Input
label='Source'
variant={'outlined'}
value={source}
disabled={isBusy}
placeholder='File path or path pattern of data within GCS.'
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
this.setState({ source: e.target.value })
}
/>
{selectedType === ApiVisualizationType.CUSTOM && (
<div>
<InputLabel>Custom Visualization Code</InputLabel>
<Editor
placeholder='Python code that will be run to generate visualization.<br><br>To access the source value (if provided), reference the variable "source".<br>To access any provided arguments, reference the variable "variables" (it is a dict object).'
width='100%'
height='175px'
mode='python'
theme='github'
value={code}
onChange={(value: string) => this.setState({ code: value })}
editorProps={{ $blockScrolling: true }}
enableLiveAutocompletion={true}
enableBasicAutocompletion={true}
highlightActiveLine={true}
showGutter={true}
/>
</div>
)}
{!!selectedType && (
<div>
<InputLabel>Arguments (Optional)</InputLabel>
<Editor
placeholder={argumentsPlaceholder}
height={`${argumentsPlaceholder.split('<br>').length * 14}px`}
width='100%'
mode='json'
theme='github'
value={_arguments}
onChange={(value: string) => this.setState({ arguments: value })}
editorProps={{ $blockScrolling: true }}
highlightActiveLine={true}
showGutter={true}
/>
</div>
)}
<BusyButton
title='Generate Visualization'
busy={isBusy}
disabled={!canGenerate}
onClick={() => {
if (onGenerate && selectedType) {
const specifiedArguments: any = JSON.parse(_arguments || '{}');
if (selectedType === ApiVisualizationType.CUSTOM) {
specifiedArguments.code = code.split('\n');
}
onGenerate(JSON.stringify(specifiedArguments), source, selectedType);
}
}}
/>
</div>
);
}
/*
Due to the swagger API definition generation, enum value that include
an _ (underscore) remove all _ from the enum key. Additionally, due to the
manner in which TypeScript is compiled to Javascript, enums are duplicated
iff they included an _ in the proto file. This filters out those duplicate
keys that are generated by the complication from TypeScript to JavaScript.
For example:
export enum ApiVisualizationType {
ROCCURVE = <any> 'ROC_CURVE'
}
Object.keys(ApiVisualizationType) = ['ROCCURVE', 'ROC_CURVE'];
Additional details can be found here:
https://www.typescriptlang.org/play/#code/KYOwrgtgBAggDgSwGoIM5gIYBsEC8MAuCA9iACoCecwUA3gLABQUUASgPIDCnAqq0gFEoAXigAeDCAoA+AOQdOAfV78BsgDRMAvkyYBjUqmJZgAOizEA5gAp4yNJhz4ipStQCUAbiA
*/
private getAvailableTypes(allowCustomVisualizations: boolean): string[] {
return Object.keys(ApiVisualizationType)
.map((key: string) => key.replace('_', ''))
.filter((key: string, i: number, arr: string[]) => {
const isDuplicate = arr.indexOf(key) !== i;
const isCustom = key === 'CUSTOM';
const isTFMA = key === 'TFMA';
return !isDuplicate && (allowCustomVisualizations || !isCustom) && !isTFMA;
});
}
private getArgumentPlaceholderForType(type: ApiVisualizationType | undefined): string {
let placeholder = 'Arguments, provided as JSON, to be used during visualization generation.';
switch (type) {
case ApiVisualizationType.ROCCURVE:
// These arguments are not yet used as the ROC curve visualization is
// still based on the Kubeflow Pipelines component.
// placeholder = `{
// \t"y_true": array,
// \t"y_score": array,
// \t"pos_label": number | string | null,
// \t"sample_weight": array | null,
// \t"drop_intermediate": boolean | null,
// \t"is_generated": boolean | null,
// }`;
placeholder = `{
\t"is_generated": boolean | null,
\t"target_lambda": string | null,
\t"trueclass": string | null,
\t"true_score_column": string | null
}`;
break;
case ApiVisualizationType.TFDV:
placeholder = '{}';
break;
case ApiVisualizationType.TFMA:
placeholder = `{
\t"slicing_column: string | null
}`;
break;
case ApiVisualizationType.TABLE:
placeholder = '{\n\t"headers": array\n}';
break;
case ApiVisualizationType.CUSTOM:
placeholder = '{\n\t"key": any\n}';
break;
}
return (
placeholder
// Replaces newline escape character with HTML break so placeholder can
// support multiple lines.
// eslint-disable-next-line no-control-regex
.replace(new RegExp('\n', 'g'), '<br>')
// Replaces tab escape character with 4 blank spaces so placeholder can
// support indentation.
// eslint-disable-next-line no-control-regex
.replace(new RegExp('\t', 'g'), '    ')
);
}
private handleExpansion = () => {
this.setState({
expanded: true,
});
};
}
export default VisualizationCreator;
| 7,960 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/ConfusionMatrix.test.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { shallow } from 'enzyme';
import ConfusionMatrix, { ConfusionMatrixConfig } from './ConfusionMatrix';
import { PlotType } from './Viewer';
describe('ConfusionMatrix', () => {
it('does not break on empty data', () => {
const tree = shallow(<ConfusionMatrix configs={[]} />);
expect(tree).toMatchSnapshot();
});
const data = [
[0, 1, 2],
[3, 4, 5],
[6, 7, 8],
];
const config: ConfusionMatrixConfig = {
axes: ['test x axis', 'test y axis'],
data,
labels: ['label1', 'label2'],
type: PlotType.CONFUSION_MATRIX,
};
it('renders a basic confusion matrix', () => {
const tree = shallow(<ConfusionMatrix configs={[config]} />);
expect(tree).toMatchSnapshot();
});
it('does not break on asymetric data', () => {
const testConfig = { ...config };
testConfig.data = data.slice(1);
const tree = shallow(<ConfusionMatrix configs={[testConfig]} />);
expect(tree).toMatchSnapshot();
});
it('renders only one of the given list of configs', () => {
const tree = shallow(<ConfusionMatrix configs={[config, config, config]} />);
expect(tree).toMatchSnapshot();
});
it('renders a small confusion matrix snapshot, with no labels or footer', () => {
const tree = shallow(<ConfusionMatrix configs={[config]} maxDimension={100} />);
expect(tree).toMatchSnapshot();
});
it('activates row/column on cell hover', () => {
const tree = shallow(<ConfusionMatrix configs={[config]} />);
tree
.find('td')
.at(2)
.simulate('mouseOver');
expect(tree.state()).toHaveProperty('activeCell', [0, 0]);
});
it('returns a user friendly display name', () => {
expect(ConfusionMatrix.prototype.getDisplayName()).toBe('Confusion matrix');
});
});
| 7,961 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/HTMLViewer.test.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { mount } from 'enzyme';
import HTMLViewer, { HTMLViewerConfig } from './HTMLViewer';
import { PlotType } from './Viewer';
describe('HTMLViewer', () => {
it('does not break on empty data', () => {
const tree = mount(<HTMLViewer configs={[]} />);
expect(tree).toMatchSnapshot();
});
const html = '<html><body><div>Hello World!</div></body></html>';
const config: HTMLViewerConfig = {
htmlContent: html,
type: PlotType.WEB_APP,
};
it('renders some basic HTML', () => {
const tree = mount(<HTMLViewer configs={[config]} />);
expect(tree).toMatchSnapshot();
});
it('renders a smaller snapshot version', () => {
const tree = mount(<HTMLViewer configs={[config]} maxDimension={100} />);
expect(tree).toMatchSnapshot();
});
it('uses srcdoc to insert HTML into the iframe', () => {
const tree = mount(<HTMLViewer configs={[config]} />);
expect((tree.instance() as any)._iframeRef.current.srcdoc).toEqual(html);
expect((tree.instance() as any)._iframeRef.current.src).toEqual('about:blank');
});
it('cannot be accessed from main frame of the other way around (no allow-same-origin)', () => {
const tree = mount(<HTMLViewer configs={[config]} />);
expect((tree.instance() as any)._iframeRef.current.window).toBeUndefined();
expect((tree.instance() as any)._iframeRef.current.document).toBeUndefined();
});
it('returns a user friendly display name', () => {
expect(HTMLViewer.prototype.getDisplayName()).toBe('Static HTML');
});
});
| 7,962 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/Tensorboard.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import BusyButton from '../../atoms/BusyButton';
import Button from '@material-ui/core/Button';
import Viewer, { ViewerConfig } from './Viewer';
import { Apis } from '../../lib/Apis';
import { commonCss, padding, color } from '../../Css';
import InputLabel from '@material-ui/core/InputLabel';
import Input from '@material-ui/core/Input';
import MenuItem from '@material-ui/core/MenuItem';
import ListSubheader from '@material-ui/core/ListSubheader';
import FormControl from '@material-ui/core/FormControl';
import Select from '@material-ui/core/Select';
import Dialog from '@material-ui/core/Dialog';
import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogContentText from '@material-ui/core/DialogContentText';
import DialogTitle from '@material-ui/core/DialogTitle';
import { classes, stylesheet } from 'typestyle';
export const css = stylesheet({
button: {
marginBottom: 20,
width: 150,
},
formControl: {
minWidth: 120,
},
select: {
minHeight: 50,
},
shortButton: {
width: 50,
},
warningText: {
color: color.warningText,
},
errorText: {
color: color.errorText,
},
});
export interface TensorboardViewerConfig extends ViewerConfig {
url: string;
namespace: string;
}
interface TensorboardViewerProps {
configs: TensorboardViewerConfig[];
// Interval in ms. If not specified, default to 5000.
intervalOfCheckingTensorboardPodStatus?: number;
}
interface TensorboardViewerState {
busy: boolean;
deleteDialogOpen: boolean;
podAddress: string;
tensorflowVersion: string;
// When podAddress is not null, we need to further tell whether the TensorBoard pod is accessible or not
tensorboardReady: boolean;
errorMessage?: string;
}
// TODO(jingzhang36): we'll later parse Tensorboard version from mlpipeline-ui-metadata.json file.
const DEFAULT_TENSORBOARD_VERSION = '2.0.0';
class TensorboardViewer extends Viewer<TensorboardViewerProps, TensorboardViewerState> {
timerID: NodeJS.Timeout;
constructor(props: any) {
super(props);
this.state = {
busy: false,
deleteDialogOpen: false,
podAddress: '',
tensorflowVersion: DEFAULT_TENSORBOARD_VERSION,
tensorboardReady: false,
errorMessage: undefined,
};
}
public getDisplayName(): string {
return 'Tensorboard';
}
public isAggregatable(): boolean {
return true;
}
public componentDidMount(): void {
this._checkTensorboardApp();
this.timerID = setInterval(
() => this._checkTensorboardPodStatus(),
this.props.intervalOfCheckingTensorboardPodStatus || 5000,
);
}
public componentWillUnmount(): void {
clearInterval(this.timerID);
}
public handleVersionSelect = (e: React.ChangeEvent<{ name?: string; value: unknown }>): void => {
if (typeof e.target.value !== 'string') {
throw new Error('Invalid event value type, expected string');
}
this.setState({ tensorflowVersion: e.target.value });
};
public render(): JSX.Element {
return (
<div>
{this.state.errorMessage && <div className={css.errorText}>{this.state.errorMessage}</div>}
{this.state.podAddress && (
<div>
<div
className={padding(20, 'b')}
>{`Tensorboard ${this.state.tensorflowVersion} is running for this output.`}</div>
<a
href={makeProxyUrl(this.state.podAddress)}
target='_blank'
rel='noopener noreferrer'
className={commonCss.unstyled}
>
<Button
className={classes(commonCss.buttonAction, css.button)}
disabled={this.state.busy}
color={'primary'}
>
Open Tensorboard
</Button>
{this.state.tensorboardReady ? (
``
) : (
<div className={css.warningText}>
Tensorboard is starting, and you may need to wait for a few minutes.
</div>
)}
</a>
<div>
<Button
className={css.button}
disabled={this.state.busy}
id={'delete'}
title={`stop tensorboard and delete its instance`}
onClick={this._handleDeleteOpen}
color={'default'}
>
Delete Tensorboard
</Button>
<Dialog
open={this.state.deleteDialogOpen}
onClose={this._handleDeleteClose}
aria-labelledby='dialog-title'
>
<DialogTitle id='dialog-title'>
{`Stop Tensorboard ${this.state.tensorflowVersion}?`}
</DialogTitle>
<DialogContent>
<DialogContentText>
You can stop the current running tensorboard. The tensorboard viewer will also
be deleted from your workloads.
</DialogContentText>
</DialogContent>
<DialogActions>
<Button
className={css.shortButton}
id={'cancel'}
autoFocus={true}
onClick={this._handleDeleteClose}
color='primary'
>
Cancel
</Button>
<BusyButton
className={classes(commonCss.buttonAction, css.shortButton)}
onClick={this._deleteTensorboard}
busy={this.state.busy}
color='primary'
title={`Stop`}
/>
</DialogActions>
</Dialog>
</div>
</div>
)}
{!this.state.podAddress && (
<div>
<div className={padding(30, 'b')}>
<FormControl className={css.formControl}>
<InputLabel htmlFor='grouped-select'>TF Version</InputLabel>
<Select
className={css.select}
value={this.state.tensorflowVersion}
input={<Input id='grouped-select' />}
onChange={this.handleVersionSelect}
>
<ListSubheader>Tensoflow 1.x</ListSubheader>
<MenuItem value={'1.4.0'}>TensorFlow 1.4.0</MenuItem>
<MenuItem value={'1.5.0'}>TensorFlow 1.5.0</MenuItem>
<MenuItem value={'1.6.0'}>TensorFlow 1.6.0</MenuItem>
<MenuItem value={'1.7.0'}>TensorFlow 1.7.0</MenuItem>
<MenuItem value={'1.8.0'}>TensorFlow 1.8.0</MenuItem>
<MenuItem value={'1.9.0'}>TensorFlow 1.9.0</MenuItem>
<MenuItem value={'1.10.0'}>TensorFlow 1.10.0</MenuItem>
<MenuItem value={'1.11.0'}>TensorFlow 1.11.0</MenuItem>
<MenuItem value={'1.12.0'}>TensorFlow 1.12.0</MenuItem>
<MenuItem value={'1.13.2'}>TensorFlow 1.13.2</MenuItem>
<MenuItem value={'1.14.0'}>TensorFlow 1.14.0</MenuItem>
<MenuItem value={'1.15.0'}>TensorFlow 1.15.0</MenuItem>
<ListSubheader>TensorFlow 2.x</ListSubheader>
<MenuItem value={'2.0.0'}>TensorFlow 2.0.0</MenuItem>
</Select>
</FormControl>
</div>
<div>
<BusyButton
className={commonCss.buttonAction}
disabled={!this.state.tensorflowVersion}
onClick={this._startTensorboard}
busy={this.state.busy}
title={`Start ${this.props.configs.length > 1 ? 'Combined ' : ''}Tensorboard`}
/>
</div>
</div>
)}
</div>
);
}
private _handleDeleteOpen = () => {
this.setState({ deleteDialogOpen: true });
};
private _handleDeleteClose = () => {
this.setState({ deleteDialogOpen: false });
};
private _getNamespace(): string {
// TODO: We should probably check if all configs have the same namespace.
return this.props.configs[0]?.namespace || '';
}
private _buildUrl(): string {
const urls = this.props.configs.map(c => c.url).sort();
return urls.length === 1 ? urls[0] : urls.map((c, i) => `Series${i + 1}:` + c).join(',');
}
private async _checkTensorboardPodStatus(): Promise<void> {
// If pod address is not null and tensorboard pod doesn't seem to be read, pull status again
if (this.state.podAddress && !this.state.tensorboardReady) {
// Remove protocol prefix bofore ":" from pod address if any.
Apis.isTensorboardPodReady(makeProxyUrl(this.state.podAddress)).then(ready => {
this.setState(({ tensorboardReady }) => ({ tensorboardReady: tensorboardReady || ready }));
});
}
}
private async _checkTensorboardApp(): Promise<void> {
this.setState({ busy: true }, async () => {
try {
const { podAddress, tfVersion } = await Apis.getTensorboardApp(
this._buildUrl(),
this._getNamespace(),
);
if (podAddress) {
this.setState({ busy: false, podAddress, tensorflowVersion: tfVersion });
} else {
// No existing pod
this.setState({ busy: false });
}
} catch (err) {
this.setState({ busy: false, errorMessage: err?.message || 'Unknown error' });
}
});
}
private _startTensorboard = async () => {
this.setState({ busy: true, errorMessage: undefined }, async () => {
try {
await Apis.startTensorboardApp(
this._buildUrl(),
this.state.tensorflowVersion,
this._getNamespace(),
);
this.setState({ busy: false, tensorboardReady: false }, () => {
this._checkTensorboardApp();
});
} catch (err) {
this.setState({ busy: false, errorMessage: err?.message || 'Unknown error' });
}
});
};
private _deleteTensorboard = async () => {
// delete the already opened Tensorboard, clear the podAddress recorded in frontend,
// and return to the select & start tensorboard page
this.setState({ busy: true, errorMessage: undefined }, async () => {
try {
await Apis.deleteTensorboardApp(this._buildUrl(), this._getNamespace());
this.setState({
busy: false,
deleteDialogOpen: false,
podAddress: '',
tensorflowVersion: DEFAULT_TENSORBOARD_VERSION,
tensorboardReady: false,
});
} catch (err) {
this.setState({ busy: false, errorMessage: err?.message || 'Unknown error' });
}
});
};
}
function makeProxyUrl(podAddress: string) {
// Strip the protocol from the URL. This is a workaround for cloud shell
// incorrectly decoding the address and replacing the protocol's // with /.
// Pod address (after stripping protocol) is of the format
// <viewer_service_dns>.kubeflow.svc.cluster.local:6006/tensorboard/<viewer_name>/
// We use this pod address without encoding since encoded pod address failed to open the
// tensorboard instance on this pod.
// TODO: figure out why the encoded pod address failed to open the tensorboard.
return 'apis/v1beta1/_proxy/' + podAddress.replace(/(^\w+:|^)\/\//, '');
}
export default TensorboardViewer;
| 7,963 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/ViewerContainer.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React, { ComponentType } from 'react';
import ConfusionMatrix from './ConfusionMatrix';
import HTMLViewer from './HTMLViewer';
import MarkdownViewer from './MarkdownViewer';
import PagedTable from './PagedTable';
import ROCCurve from './ROCCurve';
import TensorboardViewer from './Tensorboard';
import { PlotType, ViewerConfig } from './Viewer';
import VisualizationCreator from './VisualizationCreator';
export const componentMap: Record<PlotType, ComponentType<any>> = {
[PlotType.CONFUSION_MATRIX]: ConfusionMatrix,
[PlotType.MARKDOWN]: MarkdownViewer,
[PlotType.ROC]: ROCCurve,
[PlotType.TABLE]: PagedTable,
[PlotType.TENSORBOARD]: TensorboardViewer,
[PlotType.VISUALIZATION_CREATOR]: VisualizationCreator,
[PlotType.WEB_APP]: HTMLViewer,
};
interface ViewerContainerProps {
configs: ViewerConfig[];
maxDimension?: number;
}
class ViewerContainer extends React.Component<ViewerContainerProps> {
public render(): JSX.Element | null {
const { configs, maxDimension } = this.props;
if (!configs.length) {
return null;
}
const Component = componentMap[configs[0].type];
return <Component configs={configs as any} maxDimension={maxDimension} />;
}
}
export default ViewerContainer;
| 7,964 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/ROCCurve.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import {
Crosshair,
DiscreteColorLegend,
Highlight,
HorizontalGridLines,
LineSeries,
VerticalGridLines,
XAxis,
XYPlot,
YAxis,
// @ts-ignore
} from 'react-vis';
import 'react-vis/dist/style.css';
import Viewer, { ViewerConfig } from './Viewer';
import { color, fontsize, commonCss } from '../../Css';
import { stylesheet } from 'typestyle';
const css = stylesheet({
axis: {
fontSize: fontsize.medium,
fontWeight: 'bolder',
},
crosshair: {
backgroundColor: '#1d2744',
borderRadius: 5,
boxShadow: '1px 1px 5px #aaa',
padding: 10,
},
crosshairLabel: {
fontWeight: 'bold',
whiteSpace: 'nowrap',
},
root: {
margin: 'auto',
},
});
const lineColors = [
'#4285f4',
'#efb4a3',
'#684e91',
'#d74419',
'#7fa6c4',
'#ffdc10',
'#d7194d',
'#6b2f49',
'#f9e27c',
'#633a70',
'#5ec4ec',
];
interface DisplayPoint {
label: string;
x: number;
y: number;
}
export interface ROCCurveConfig extends ViewerConfig {
data: DisplayPoint[];
}
interface ROCCurveProps {
configs: ROCCurveConfig[];
maxDimension?: number;
}
interface ROCCurveState {
hoveredValues: DisplayPoint[];
lastDrawLocation: { left: number; right: number } | null;
}
class ROCCurve extends Viewer<ROCCurveProps, ROCCurveState> {
constructor(props: any) {
super(props);
this.state = {
hoveredValues: new Array(this.props.configs.length).fill(''),
lastDrawLocation: null,
};
}
public getDisplayName(): string {
return 'ROC Curve';
}
public isAggregatable(): boolean {
return true;
}
public render(): JSX.Element {
const width = this.props.maxDimension || 800;
const height = width * 0.65;
const isSmall = width < 600;
const datasets = this.props.configs.map(d => d.data);
const numLines = datasets.length;
const labels = this.props.configs.map((_, i) => `threshold (Series #${i})`);
const baseLineData = Array.from(Array(100).keys()).map(x => ({ x: x / 100, y: x / 100 }));
const { hoveredValues, lastDrawLocation } = this.state;
return (
<div>
<XYPlot
width={width}
height={height}
animation={!isSmall}
classes={{ root: css.root }}
onMouseLeave={() => this.setState({ hoveredValues: new Array(numLines).fill('') })}
xDomain={lastDrawLocation && [lastDrawLocation.left, lastDrawLocation.right]}
>
<VerticalGridLines />
<HorizontalGridLines />
{/* Draw the axes from the first config in case there are several */}
<XAxis title={'fpr'} className={css.axis} />
<YAxis title={'tpr'} className={css.axis} />
{/* Reference line */}
<LineSeries
color={color.disabledBg}
strokeWidth={1}
data={baseLineData}
strokeStyle='dashed'
/>
{/* Lines */}
{datasets.map((data, i) => (
<LineSeries
key={i}
color={lineColors[i] || lineColors[lineColors.length - 1]}
strokeWidth={2}
data={data}
onNearestX={(d: any) => this._lineHovered(i, d)}
curve='curveBasis'
/>
))}
{!isSmall && (
<Highlight
onBrushEnd={(area: any) => this.setState({ lastDrawLocation: area })}
enableY={false}
onDrag={(area: any) =>
this.setState({
lastDrawLocation: {
left: (lastDrawLocation ? lastDrawLocation.left : 0) - (area.right - area.left),
right:
(lastDrawLocation ? lastDrawLocation.right : 0) - (area.right - area.left),
},
})
}
/>
)}
{/* Hover effect to show labels */}
{!isSmall && (
<Crosshair values={hoveredValues}>
<div className={css.crosshair}>
{hoveredValues.map((value, i) => (
<div key={i} className={css.crosshairLabel}>{`${labels[i]}: ${value.label}`}</div>
))}
</div>
</Crosshair>
)}
</XYPlot>
<div className={commonCss.flex}>
{/* Legend */}
{datasets.length > 1 && (
<div style={{ flexGrow: 1 }}>
<DiscreteColorLegend
items={datasets.map((_, i) => ({
color: lineColors[i],
title: 'Series #' + (i + 1),
}))}
orientation='horizontal'
/>
</div>
)}
{lastDrawLocation && <span>Click to reset zoom</span>}
</div>
</div>
);
}
private _lineHovered(lineIdx: number, data: any): void {
const hoveredValues = this.state.hoveredValues;
hoveredValues[lineIdx] = data;
this.setState({ hoveredValues });
}
}
export default ROCCurve;
| 7,965 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/ConfusionMatrix.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import Viewer, { ViewerConfig, PlotType } from './Viewer';
import { color, commonCss, fontsize } from '../../Css';
import { classes, stylesheet } from 'typestyle';
const legendNotches = 5;
export interface ConfusionMatrixConfig extends ViewerConfig {
data: number[][];
axes: string[];
labels: string[];
type: PlotType;
}
interface ConfusionMatrixProps {
configs: ConfusionMatrixConfig[];
maxDimension?: number;
}
interface ConfusionMatrixState {
activeCell: [number, number];
}
class ConfusionMatrix extends Viewer<ConfusionMatrixProps, ConfusionMatrixState> {
private _opacities: number[][] = [];
private _config = this.props.configs[0];
private _max =
this._config &&
Math.max(...this._config.data.map(d => d.map(n => +n)).map(d => Math.max(...d)));
private _minRegularCellDimension = 15;
private _maxRegularCellDimension = 80;
private _cellDimension = this._config
? Math.max(
Math.min(
(this.props.maxDimension || 700) / this._config.data.length,
this._maxRegularCellDimension,
),
this._minRegularCellDimension,
) - 1
: 0;
private _shrinkThreshold = 600;
private _css = stylesheet({
activeLabel: {
borderRadius: 5,
color: color.theme,
fontWeight: 'bold',
},
cell: {
border: 'solid 1px ' + color.background,
fontSize: this._isSmall() ? fontsize.small : fontsize.base,
height: this._cellDimension,
minHeight: this._cellDimension,
minWidth: this._cellDimension,
position: 'relative',
textAlign: 'center',
verticalAlign: 'middle',
width: this._cellDimension,
},
legend: {
background: `linear-gradient(${color.theme}, ${color.background})`,
borderRight: 'solid 1px #777',
marginLeft: 20,
minWidth: 10,
position: 'relative',
width: 10,
},
legendLabel: {
left: 15,
position: 'absolute',
top: -7,
},
legendNotch: {
borderTop: 'solid 1px #777',
left: '100%',
paddingLeft: 5,
position: 'absolute',
width: 5,
},
overlay: {
backgroundColor: '#000',
bottom: 0,
left: 0,
opacity: 0,
position: 'absolute',
right: 0,
top: 0,
},
root: {
flexGrow: 1,
justifyContent: 'center',
margin: 'auto',
pointerEvents: this._isSmall() ? 'none' : 'initial', // Disable interaction for snapshot view
position: 'relative',
width: 'fit-content',
},
xAxisLabel: {
color: color.foreground,
fontSize: 15,
fontWeight: 'bold',
paddingLeft: 20,
position: 'absolute',
},
xlabel: {
marginLeft: 15,
overflow: 'hidden',
position: 'absolute',
textAlign: 'left',
textOverflow: 'ellipsis',
transform: 'rotate(60deg)',
transformOrigin: 'left',
whiteSpace: 'nowrap',
width: 150,
},
yAxisLabel: {
color: color.foreground,
fontSize: 15,
height: 25,
paddingRight: 20,
textAlign: 'right',
},
ylabel: {
lineHeight: `${this._cellDimension}px`,
marginRight: 10,
minWidth: this._cellDimension,
textAlign: 'right',
whiteSpace: 'nowrap',
},
});
constructor(props: any) {
super(props);
if (!this._config) {
return;
}
this.state = {
activeCell: [-1, -1],
};
for (const i of this._config.data) {
const row = [];
for (const j of i) {
row.push(+j / this._max);
}
this._opacities.push(row);
}
}
public getDisplayName(): string {
return 'Confusion matrix';
}
public render(): JSX.Element | null {
if (!this._config) {
return null;
}
const [activeRow, activeCol] = this.state.activeCell;
const [xAxisLabel, yAxisLabel] = this._config.axes;
const small = this._isSmall();
return (
<div className={classes(commonCss.flex, this._css.root)}>
<table>
<tbody>
{!small && (
<tr>
<td className={this._css.yAxisLabel}>{yAxisLabel}</td>
</tr>
)}
{this._config.data.map((row, r) => (
<tr key={r}>
{!small && (
<td>
<div
className={classes(
this._css.ylabel,
r === activeRow ? this._css.activeLabel : '',
)}
>
{this._config.labels[r]}
</div>
</td>
)}
{row.map((cell, c) => (
<td
key={c}
className={this._css.cell}
style={{
backgroundColor: `rgba(41, 121, 255, ${this._opacities[r][c]})`,
color: this._opacities[r][c] < 0.6 ? color.foreground : color.background,
}}
onMouseOver={() => this.setState({ activeCell: [r, c] })}
>
<div
className={this._css.overlay}
style={{
opacity: r === activeRow || c === activeCol ? 0.05 : 0,
}}
/>
{cell}
</td>
))}
</tr>
))}
{/* Footer */}
{!small && (
<tr>
<th className={this._css.xlabel} />
{this._config.labels.map((label, i) => (
<th key={i}>
<div
className={classes(
i === activeCol ? this._css.activeLabel : '',
this._css.xlabel,
)}
>
{label}
</div>
</th>
))}
<td className={this._css.xAxisLabel}>{xAxisLabel}</td>
</tr>
)}
</tbody>
</table>
{!small && (
<div
className={this._css.legend}
style={{ height: 0.75 * this._config.data.length * this._cellDimension }}
>
<div className={this._css.legendNotch} style={{ top: 0 }}>
<span className={this._css.legendLabel}>{this._max}</span>
</div>
{new Array(legendNotches).fill(0).map((_, i) => (
<div
key={i}
className={this._css.legendNotch}
style={{ top: ((legendNotches - i) / legendNotches) * 100 + '%' }}
>
<span className={this._css.legendLabel}>
{Math.floor((i / legendNotches) * this._max)}
</span>
</div>
))}
</div>
)}
</div>
);
}
private _isSmall(): boolean {
return !!this.props.maxDimension && this.props.maxDimension < this._shrinkThreshold;
}
}
export default ConfusionMatrix;
| 7,966 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/PagedTable.test.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { shallow } from 'enzyme';
import PagedTable from './PagedTable';
import { PlotType } from './Viewer';
describe('PagedTable', () => {
it('does not break on no config', () => {
const tree = shallow(<PagedTable configs={[]} />);
expect(tree).toMatchSnapshot();
});
it('does not break on empty data', () => {
const tree = shallow(<PagedTable configs={[{ data: [], labels: [], type: PlotType.TABLE }]} />);
expect(tree).toMatchSnapshot();
});
const data = [
['col1', 'col2', 'col3'],
['col4', 'col5', 'col6'],
];
const labels = ['field1', 'field2', 'field3'];
it('renders simple data', () => {
const tree = shallow(<PagedTable configs={[{ data, labels, type: PlotType.TABLE }]} />);
expect(tree).toMatchSnapshot();
});
it('renders simple data without labels', () => {
const tree = shallow(<PagedTable configs={[{ data, labels: [], type: PlotType.TABLE }]} />);
expect(tree).toMatchSnapshot();
});
it('sorts on first column descending', () => {
const tree = shallow(<PagedTable configs={[{ data, labels, type: PlotType.TABLE }]} />);
tree
.find('WithStyles(TableSortLabel)')
.at(0)
.simulate('click');
expect(tree).toMatchSnapshot();
});
it('sorts on first column ascending', () => {
const tree = shallow(<PagedTable configs={[{ data, labels, type: PlotType.TABLE }]} />);
// Once for descending
tree
.find('WithStyles(TableSortLabel)')
.at(0)
.simulate('click');
// Once for ascending
tree
.find('WithStyles(TableSortLabel)')
.at(0)
.simulate('click');
expect(tree).toMatchSnapshot();
});
it('returns a user friendly display name', () => {
expect(PagedTable.prototype.getDisplayName()).toBe('Table');
});
});
| 7,967 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/Tensorboard.test.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import TensorboardViewer, { TensorboardViewerConfig } from './Tensorboard';
import TestUtils, { diff } from '../../TestUtils';
import { Apis } from '../../lib/Apis';
import { PlotType } from './Viewer';
import { ReactWrapper, ShallowWrapper, shallow, mount } from 'enzyme';
const DEFAULT_CONFIG: TensorboardViewerConfig = {
type: PlotType.TENSORBOARD,
url: 'http://test/url',
namespace: 'test-ns',
};
describe('Tensorboard', () => {
let tree: ReactWrapper | ShallowWrapper;
const flushPromisesAndTimers = async () => {
jest.runOnlyPendingTimers();
await TestUtils.flushPromises();
};
beforeEach(() => {
jest.clearAllMocks();
jest.useFakeTimers();
});
afterEach(async () => {
// unmount() should be called before resetAllMocks() in case any part of the unmount life cycle
// depends on mocks/spies
if (tree) {
await tree.unmount();
}
jest.resetAllMocks();
jest.restoreAllMocks();
});
it('base component snapshot', async () => {
const getAppMock = () => Promise.resolve({ podAddress: '', tfVersion: '' });
jest.spyOn(Apis, 'getTensorboardApp').mockImplementation(getAppMock);
tree = shallow(<TensorboardViewer configs={[]} />);
await TestUtils.flushPromises();
expect(tree).toMatchSnapshot();
});
it('does not break on no config', async () => {
const getAppMock = () => Promise.resolve({ podAddress: '', tfVersion: '' });
jest.spyOn(Apis, 'getTensorboardApp').mockImplementation(getAppMock);
tree = shallow(<TensorboardViewer configs={[]} />);
const base = tree.debug();
await TestUtils.flushPromises();
expect(diff({ base, update: tree.debug() })).toMatchInlineSnapshot(`
Snapshot Diff:
- Expected
+ Received
@@ --- --- @@
</WithStyles(MenuItem)>
</WithStyles(WithFormControlContext(Select))>
</WithStyles(FormControl)>
</div>
<div>
- <BusyButton className="buttonAction" disabled={false} onClick={[Function]} busy={true} title="Start Tensorboard" />
+ <BusyButton className="buttonAction" disabled={false} onClick={[Function]} busy={false} title="Start Tensorboard" />
</div>
</div>
</div>
`);
});
it('does not break on empty data', async () => {
const getAppMock = () => Promise.resolve({ podAddress: '', tfVersion: '' });
jest.spyOn(Apis, 'getTensorboardApp').mockImplementation(getAppMock);
const config = { ...DEFAULT_CONFIG, url: '' };
tree = shallow(<TensorboardViewer configs={[config]} />);
const base = tree.debug();
await TestUtils.flushPromises();
expect(diff({ base, update: tree.debug() })).toMatchInlineSnapshot(`
Snapshot Diff:
- Expected
+ Received
@@ --- --- @@
</WithStyles(MenuItem)>
</WithStyles(WithFormControlContext(Select))>
</WithStyles(FormControl)>
</div>
<div>
- <BusyButton className="buttonAction" disabled={false} onClick={[Function]} busy={true} title="Start Tensorboard" />
+ <BusyButton className="buttonAction" disabled={false} onClick={[Function]} busy={false} title="Start Tensorboard" />
</div>
</div>
</div>
`);
});
it('shows a link to the tensorboard instance if exists', async () => {
const config = { ...DEFAULT_CONFIG, url: 'http://test/url' };
const getAppMock = () => Promise.resolve({ podAddress: 'test/address', tfVersion: '1.14.0' });
jest.spyOn(Apis, 'getTensorboardApp').mockImplementation(getAppMock);
jest.spyOn(Apis, 'isTensorboardPodReady').mockImplementation(() => Promise.resolve(true));
tree = shallow(<TensorboardViewer configs={[config]} />);
await TestUtils.flushPromises();
await flushPromisesAndTimers();
expect(Apis.isTensorboardPodReady).toHaveBeenCalledTimes(1);
expect(Apis.isTensorboardPodReady).toHaveBeenCalledWith('apis/v1beta1/_proxy/test/address');
expect(tree).toMatchSnapshot();
});
it('shows start button if no instance exists', async () => {
const config = DEFAULT_CONFIG;
const getAppMock = () => Promise.resolve({ podAddress: '', tfVersion: '' });
const getTensorboardSpy = jest.spyOn(Apis, 'getTensorboardApp').mockImplementation(getAppMock);
tree = shallow(<TensorboardViewer configs={[DEFAULT_CONFIG]} />);
const base = tree.debug();
await TestUtils.flushPromises();
expect(
diff({
base,
update: tree.debug(),
baseAnnotation: 'initial',
updateAnnotation: 'no instance exists',
}),
).toMatchInlineSnapshot(`
Snapshot Diff:
- initial
+ no instance exists
@@ --- --- @@
</WithStyles(MenuItem)>
</WithStyles(WithFormControlContext(Select))>
</WithStyles(FormControl)>
</div>
<div>
- <BusyButton className="buttonAction" disabled={false} onClick={[Function]} busy={true} title="Start Tensorboard" />
+ <BusyButton className="buttonAction" disabled={false} onClick={[Function]} busy={false} title="Start Tensorboard" />
</div>
</div>
</div>
`);
expect(getTensorboardSpy).toHaveBeenCalledWith(config.url, config.namespace);
});
it('starts tensorboard instance when button is clicked', async () => {
const config = { ...DEFAULT_CONFIG };
const getAppMock = () => Promise.resolve({ podAddress: '', tfVersion: '' });
const startAppMock = jest.fn(() => Promise.resolve(''));
jest.spyOn(Apis, 'getTensorboardApp').mockImplementation(getAppMock);
jest.spyOn(Apis, 'startTensorboardApp').mockImplementationOnce(startAppMock);
tree = shallow(<TensorboardViewer configs={[config]} />);
await TestUtils.flushPromises();
tree.find('BusyButton').simulate('click');
expect(startAppMock).toHaveBeenCalledWith(config.url, '2.0.0', config.namespace);
});
it('starts tensorboard instance for two configs', async () => {
const config = { ...DEFAULT_CONFIG, url: 'http://test/url' };
const config2 = { ...DEFAULT_CONFIG, url: 'http://test/url2' };
const getAppMock = jest.fn(() => Promise.resolve({ podAddress: '', tfVersion: '' }));
const startAppMock = jest.fn(() => Promise.resolve(''));
jest.spyOn(Apis, 'getTensorboardApp').mockImplementation(getAppMock);
jest.spyOn(Apis, 'startTensorboardApp').mockImplementationOnce(startAppMock);
tree = shallow(<TensorboardViewer configs={[config, config2]} />);
await TestUtils.flushPromises();
expect(getAppMock).toHaveBeenCalledWith(
`Series1:${config.url},Series2:${config2.url}`,
config.namespace,
);
tree.find('BusyButton').simulate('click');
const expectedUrl = `Series1:${config.url},Series2:${config2.url}`;
expect(startAppMock).toHaveBeenCalledWith(expectedUrl, '2.0.0', config.namespace);
});
it('returns friendly display name', () => {
expect(TensorboardViewer.prototype.getDisplayName()).toBe('Tensorboard');
});
it('is aggregatable', () => {
expect(TensorboardViewer.prototype.isAggregatable()).toBeTruthy();
});
it('select a version, then start a tensorboard of the corresponding version', async () => {
const config = { ...DEFAULT_CONFIG };
const getAppMock = jest.fn(() => Promise.resolve({ podAddress: '', tfVersion: '' }));
const startAppMock = jest.fn(() => Promise.resolve(''));
jest.spyOn(Apis, 'getTensorboardApp').mockImplementation(getAppMock);
const startAppSpy = jest
.spyOn(Apis, 'startTensorboardApp')
.mockImplementationOnce(startAppMock);
tree = mount(<TensorboardViewer configs={[config]} />);
await TestUtils.flushPromises();
tree
.find('Select')
.find('[role="button"]')
.simulate('click');
tree
.findWhere(el => el.text() === 'TensorFlow 1.15.0')
.hostNodes()
.simulate('click');
tree.find('BusyButton').simulate('click');
expect(startAppSpy).toHaveBeenCalledWith(config.url, '1.15.0', config.namespace);
});
it('delete the tensorboard instance, confirm in the dialog,\
then return back to previous page', async () => {
const getAppMock = jest.fn(() =>
Promise.resolve({ podAddress: 'podaddress', tfVersion: '1.14.0' }),
);
jest.spyOn(Apis, 'getTensorboardApp').mockImplementation(getAppMock);
const deleteAppMock = jest.fn(() => Promise.resolve(''));
const deleteAppSpy = jest.spyOn(Apis, 'deleteTensorboardApp').mockImplementation(deleteAppMock);
const config = { ...DEFAULT_CONFIG };
tree = mount(<TensorboardViewer configs={[config]} />);
await TestUtils.flushPromises();
expect(!!tree.state('podAddress')).toBeTruthy();
// delete a tensorboard
tree.update();
tree
.find('#delete')
.find('Button')
.simulate('click');
tree.find('BusyButton').simulate('click');
expect(deleteAppSpy).toHaveBeenCalledWith(config.url, config.namespace);
await TestUtils.flushPromises();
tree.update();
// the tree has returned to 'start tensorboard' page
expect(tree.findWhere(el => el.text() === 'Start Tensorboard').exists()).toBeTruthy();
});
it('show version info in delete confirming dialog, \
if a tensorboard instance already exists', async () => {
const getAppMock = jest.fn(() =>
Promise.resolve({ podAddress: 'podaddress', tfVersion: '1.14.0' }),
);
jest.spyOn(Apis, 'getTensorboardApp').mockImplementation(getAppMock);
const config = DEFAULT_CONFIG;
tree = mount(<TensorboardViewer configs={[config]} />);
await TestUtils.flushPromises();
tree.update();
tree
.find('#delete')
.find('Button')
.simulate('click');
expect(tree.findWhere(el => el.text() === 'Stop Tensorboard 1.14.0?').exists()).toBeTruthy();
});
it('click on cancel on delete tensorboard dialog, then return back to previous page', async () => {
const getAppMock = jest.fn(() =>
Promise.resolve({ podAddress: 'podaddress', tfVersion: '1.14.0' }),
);
jest.spyOn(Apis, 'getTensorboardApp').mockImplementation(getAppMock);
const config = DEFAULT_CONFIG;
tree = mount(<TensorboardViewer configs={[config]} />);
await TestUtils.flushPromises();
tree.update();
tree
.find('#delete')
.find('Button')
.simulate('click');
tree
.find('#cancel')
.find('Button')
.simulate('click');
expect(tree.findWhere(el => el.text() === 'Open Tensorboard').exists()).toBeTruthy();
expect(tree.findWhere(el => el.text() === 'Delete Tensorboard').exists()).toBeTruthy();
});
it('asks user to wait when Tensorboard status is not ready', async () => {
const getAppMock = jest.fn(() =>
Promise.resolve({ podAddress: 'podaddress', tfVersion: '1.14.0' }),
);
jest.spyOn(Apis, 'getTensorboardApp').mockImplementation(getAppMock);
jest.spyOn(Apis, 'isTensorboardPodReady').mockImplementation(() => Promise.resolve(false));
jest.spyOn(Apis, 'deleteTensorboardApp').mockImplementation(jest.fn(() => Promise.resolve('')));
const config = DEFAULT_CONFIG;
tree = mount(<TensorboardViewer configs={[config]} />);
await TestUtils.flushPromises();
await flushPromisesAndTimers();
tree.update();
expect(Apis.isTensorboardPodReady).toHaveBeenCalledTimes(1);
expect(Apis.isTensorboardPodReady).toHaveBeenCalledWith('apis/v1beta1/_proxy/podaddress');
expect(tree.findWhere(el => el.text() === 'Open Tensorboard').exists()).toBeTruthy();
expect(
tree
.findWhere(
el =>
el.text() === 'Tensorboard is starting, and you may need to wait for a few minutes.',
)
.exists(),
).toBeTruthy();
expect(tree.findWhere(el => el.text() === 'Delete Tensorboard').exists()).toBeTruthy();
// After a while, it is ready and wait message is not shwon any more
jest.spyOn(Apis, 'isTensorboardPodReady').mockImplementation(() => Promise.resolve(true));
await flushPromisesAndTimers();
tree.update();
expect(
tree
.findWhere(
el =>
el.text() === `Tensorboard is starting, and you may need to wait for a few minutes.`,
)
.exists(),
).toEqual(false);
});
});
| 7,968 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/HTMLViewer.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import Viewer, { ViewerConfig } from './Viewer';
import { color } from '../../Css';
import { stylesheet } from 'typestyle';
export interface HTMLViewerConfig extends ViewerConfig {
htmlContent: string;
}
interface HTMLViewerProps {
configs: HTMLViewerConfig[];
maxDimension?: number;
}
class HTMLViewer extends Viewer<HTMLViewerProps, any> {
private _iframeRef = React.createRef<HTMLIFrameElement>();
private _config = this.props.configs[0];
private _css = stylesheet({
iframe: {
border: '1px solid ' + color.divider,
boxSizing: 'border-box',
flexGrow: 1,
height: this.props.maxDimension ? this.props.maxDimension : 'initial',
minHeight: this.props.maxDimension ? this.props.maxDimension : 600,
width: this.props.maxDimension ? this.props.maxDimension : '100%',
},
});
public getDisplayName(): string {
return 'Static HTML';
}
public componentDidMount(): void {
// TODO: iframe.srcdoc doesn't work on Edge yet. It's been added, but not
// yet rolled out as of the time of writing this (6/14/18):
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12375527/
// I'm using this since it seems like the safest way to insert HTML into an
// iframe, while allowing Javascript, but without needing to require
// "allow-same-origin" sandbox rule.
if (this._iframeRef.current) {
this._iframeRef.current!.srcdoc = this._config.htmlContent;
}
}
public render(): JSX.Element | null {
if (!this._config) {
return null;
}
return (
// TODO: fix this
// eslint-disable-next-line jsx-a11y/iframe-has-title
<iframe
ref={this._iframeRef}
src='about:blank'
className={this._css.iframe}
sandbox='allow-scripts'
/>
);
}
}
export default HTMLViewer;
| 7,969 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/ROCCurve.test.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { shallow } from 'enzyme';
import { PlotType } from './Viewer';
import ROCCurve from './ROCCurve';
describe('ROCCurve', () => {
it('does not break on no config', () => {
const tree = shallow(<ROCCurve configs={[]} />);
expect(tree).toMatchSnapshot();
});
it('does not break on empty data', () => {
const tree = shallow(<ROCCurve configs={[{ data: [], type: PlotType.ROC }]} />);
expect(tree).toMatchSnapshot();
});
const data = [
{ x: 0, y: 0, label: '1' },
{ x: 0.2, y: 0.3, label: '2' },
{ x: 0.5, y: 0.7, label: '3' },
{ x: 0.9, y: 0.9, label: '4' },
{ x: 1, y: 1, label: '5' },
];
it('renders a simple ROC curve given one config', () => {
const tree = shallow(<ROCCurve configs={[{ data, type: PlotType.ROC }]} />);
expect(tree).toMatchSnapshot();
});
it('renders a reference base line series', () => {
const tree = shallow(<ROCCurve configs={[{ data, type: PlotType.ROC }]} />);
expect(tree.find('LineSeries').length).toBe(2);
});
it('renders an ROC curve using three configs', () => {
const config = { data, type: PlotType.ROC };
const tree = shallow(<ROCCurve configs={[config, config, config]} />);
expect(tree).toMatchSnapshot();
});
it('renders three lines with three different colors', () => {
const config = { data, type: PlotType.ROC };
const tree = shallow(<ROCCurve configs={[config, config, config]} />);
expect(tree.find('LineSeries').length).toBe(4); // +1 for baseline
const [line1Color, line2Color, line3Color] = [
(tree
.find('LineSeries')
.at(1)
.props() as any).color,
(tree
.find('LineSeries')
.at(2)
.props() as any).color,
(tree
.find('LineSeries')
.at(3)
.props() as any).color,
];
expect(line1Color !== line2Color && line1Color !== line3Color && line2Color !== line3Color);
});
it('does not render a legend when there is only one config', () => {
const config = { data, type: PlotType.ROC };
const tree = shallow(<ROCCurve configs={[config]} />);
expect(tree.find('DiscreteColorLegendItem').length).toBe(0);
});
it('renders a legend when there is more than one series', () => {
const config = { data, type: PlotType.ROC };
const tree = shallow(<ROCCurve configs={[config, config, config]} />);
expect(tree.find('DiscreteColorLegendItem').length).toBe(1);
const legendItems = (tree
.find('DiscreteColorLegendItem')
.at(0)
.props() as any).items;
expect(legendItems.length).toBe(3);
legendItems.map((item: any, i: number) => expect(item.title).toBe('Series #' + (i + 1)));
});
it('returns friendly display name', () => {
expect(ROCCurve.prototype.getDisplayName()).toBe('ROC Curve');
});
it('is aggregatable', () => {
expect(ROCCurve.prototype.isAggregatable()).toBeTruthy();
});
});
| 7,970 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/Viewer.ts | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
export enum PlotType {
CONFUSION_MATRIX = 'confusion_matrix',
MARKDOWN = 'markdown',
ROC = 'roc',
TABLE = 'table',
TENSORBOARD = 'tensorboard',
VISUALIZATION_CREATOR = 'visualization-creator',
WEB_APP = 'web-app',
}
// Interface to be extended by each viewer implementation, so it's possible to
// build an array of viewer configurations that forces them to declare their type.
export interface ViewerConfig {
type: PlotType;
}
abstract class Viewer<P, S> extends React.Component<P, S> {
public isAggregatable(): boolean {
return false;
}
public abstract getDisplayName(): string;
}
export default Viewer;
| 7,971 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/MarkdownViewer.tsx | /*
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import Viewer, { ViewerConfig } from './Viewer';
import { cssRaw } from 'typestyle';
import Markdown from 'markdown-to-jsx';
cssRaw(`
.markdown-viewer h1,
.markdown-viewer h2,
.markdown-viewer h3,
.markdown-viewer h4,
.markdown-viewer h5,
.markdown-viewer h6 {
position: relative;
margin-top: 1em;
margin-bottom: 16px;
font-size: initial;
font-weight: 700;
line-height: 1.4;
}
.markdown-viewer h1,
.markdown-viewer h2 {
padding-bottom: .3em;
border-bottom: 1px solid #eee;
}
.markdown-viewer code,
.markdown-viewer pre {
background-color: #f8f8f8;
border-radius: 5px;
}
.markdown-viewer pre {
border: solid 1px #eee;
margin: 7px 0;
padding: 7px;
}
`);
export interface MarkdownViewerConfig extends ViewerConfig {
markdownContent: string;
}
interface MarkdownViewerProps {
configs: MarkdownViewerConfig[];
maxDimension?: number;
}
class MarkdownViewer extends Viewer<MarkdownViewerProps, any> {
private _config = this.props.configs[0];
public getDisplayName(): string {
return 'Markdown';
}
public render(): JSX.Element | null {
if (!this._config) {
return null;
}
return (
<div className='markdown-viewer'>
<Markdown>{this._config.markdownContent}</Markdown>
</div>
);
}
}
export default MarkdownViewer;
| 7,972 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/PagedTable.tsx | /*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody';
import TableCell from '@material-ui/core/TableCell';
import TableHead from '@material-ui/core/TableHead';
import TablePagination from '@material-ui/core/TablePagination';
import TableRow from '@material-ui/core/TableRow';
import TableSortLabel from '@material-ui/core/TableSortLabel';
import Tooltip from '@material-ui/core/Tooltip';
import Viewer, { ViewerConfig, PlotType } from './Viewer';
import { color, fontsize, commonCss } from '../../Css';
import { stylesheet } from 'typestyle';
enum SortOrder {
ASC = 'asc',
DESC = 'desc',
}
export interface PagedTableConfig extends ViewerConfig {
data: string[][];
labels: string[];
type: PlotType;
}
interface PagedTableProps {
configs: PagedTableConfig[];
maxDimension?: number;
}
interface PagedTableState {
order: SortOrder;
orderBy: number;
page: number;
rowsPerPage: number;
}
class PagedTable extends Viewer<PagedTableProps, PagedTableState> {
private _shrinkThreshold = 600;
private _config = this.props.configs[0];
private _rowHeight = 30;
private _css = stylesheet({
cell: {
borderRight: 'solid 1px ' + color.divider,
color: color.foreground,
fontSize: this._isSmall() ? fontsize.small : fontsize.base,
paddingLeft: this._isSmall() ? 5 : 'invalid',
paddingRight: 5,
pointerEvents: this._isSmall() ? 'none' : 'initial',
},
columnName: {
fontSize: this._isSmall() ? fontsize.base : fontsize.medium,
fontWeight: 'bold',
paddingLeft: this._isSmall() ? 5 : 'invalid',
},
row: {
borderBottom: '1px solid #ddd',
height: this._isSmall() ? 25 : this._rowHeight,
},
});
constructor(props: any) {
super(props);
this.state = {
order: SortOrder.ASC,
orderBy: 0,
page: 0,
rowsPerPage: 10,
};
}
public getDisplayName(): string {
return 'Table';
}
public render(): JSX.Element | null {
if (!this._config) {
return null;
}
const { data, labels } = this._config;
const { order, orderBy, rowsPerPage, page } = this.state;
const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage);
return (
<div style={{ width: '100%' }} className={commonCss.page}>
<Table style={{ display: 'block', overflow: 'auto' }}>
<TableHead>
<TableRow>
{labels.map((label, i) => {
return (
<TableCell
className={this._css.columnName}
key={i}
sortDirection={orderBy === i ? order : false}
>
<Tooltip title='Sort' enterDelay={300}>
<TableSortLabel
active={orderBy === i}
direction={order}
onClick={this._handleSort(i)}
>
{label}
</TableSortLabel>
</Tooltip>
</TableCell>
);
}, this)}
</TableRow>
</TableHead>
<TableBody>
{/* TODO: bug: sorting keeps appending items */}
{this._stableSort(data)
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
.map(row => {
return (
<TableRow hover={true} tabIndex={-1} key={row[0]} className={this._css.row}>
{row.map((cell, i) => (
<TableCell key={i} className={this._css.cell}>
{cell}
</TableCell>
))}
</TableRow>
);
})}
{emptyRows > 0 && (
<TableRow style={{ height: this._rowHeight * emptyRows }}>
<TableCell colSpan={6} />
</TableRow>
)}
</TableBody>
</Table>
<TablePagination
component='div'
count={data.length}
rowsPerPage={rowsPerPage}
page={page}
onChangePage={this._handleChangePage}
onChangeRowsPerPage={this._handleChangeRowsPerPage}
/>
</div>
);
}
private _handleSort = (index: number) => () => {
const orderBy = index;
let order = SortOrder.ASC;
if (this.state.orderBy === index && this.state.order === SortOrder.ASC) {
order = SortOrder.DESC;
}
this.setState({ order, orderBy });
};
private _handleChangePage = (event: any, page: number) => {
this.setState({ page });
};
private _handleChangeRowsPerPage = (event: any) => {
this.setState({ rowsPerPage: event.target.value });
};
private _isSmall(): boolean {
return !!this.props.maxDimension && this.props.maxDimension < this._shrinkThreshold;
}
private _stableSort(array: string[][]): string[][] {
const stabilizedThis = array.map((row: string[], index: number): [string[], number] => [
row,
index,
]);
const compareFn = this._getSorting(this.state.order, this.state.orderBy);
stabilizedThis.sort((a: [string[], number], b: [string[], number]) => {
const order = compareFn(a[0], b[0]);
if (order !== 0) {
return order;
}
return a[1] - b[1];
});
return stabilizedThis.map((el: [string[], number]) => el[0]);
}
private _desc(a: string[], b: string[], orderBy: number): number {
if (b[orderBy] < a[orderBy]) {
return -1;
}
if (b[orderBy] > a[orderBy]) {
return 1;
}
return 0;
}
private _getSorting(order: SortOrder, orderBy: number): (a: any, b: any) => number {
return order === SortOrder.DESC
? (a: any, b: any) => this._desc(a, b, orderBy)
: (a: any, b: any) => -this._desc(a, b, orderBy);
}
}
export default PagedTable;
| 7,973 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/VisualizationCreator.test.tsx | /*
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { shallow, mount } from 'enzyme';
import { render, screen, fireEvent } from '@testing-library/react';
import { PlotType } from './Viewer';
import VisualizationCreator, { VisualizationCreatorConfig } from './VisualizationCreator';
import { ApiVisualizationType } from '../../apis/visualization';
import { diffHTML } from 'src/TestUtils';
describe('VisualizationCreator', () => {
it('does not render component when no config is provided', () => {
const tree = shallow(<VisualizationCreator configs={[]} />);
expect(tree).toMatchSnapshot();
});
it('renders component when empty config is provided', () => {
const config: VisualizationCreatorConfig = {
type: PlotType.VISUALIZATION_CREATOR,
};
const tree = shallow(<VisualizationCreator configs={[config]} />);
expect(tree).toMatchSnapshot();
});
it('renders component when isBusy is not provided', () => {
const config: VisualizationCreatorConfig = {
onGenerate: jest.fn(),
type: PlotType.VISUALIZATION_CREATOR,
};
const tree = shallow(<VisualizationCreator configs={[config]} />);
expect(tree).toMatchSnapshot();
});
it('renders component when onGenerate is not provided', () => {
const config: VisualizationCreatorConfig = {
isBusy: false,
type: PlotType.VISUALIZATION_CREATOR,
};
const tree = shallow(<VisualizationCreator configs={[config]} />);
expect(tree).toMatchSnapshot();
});
it('renders component when all parameters in config are provided', () => {
const config: VisualizationCreatorConfig = {
isBusy: false,
onGenerate: jest.fn(),
type: PlotType.VISUALIZATION_CREATOR,
};
const tree = shallow(<VisualizationCreator configs={[config]} />);
expect(tree).toMatchSnapshot();
});
it('does not render an Editor component if a visualization type is not specified', () => {
const config: VisualizationCreatorConfig = {
isBusy: false,
onGenerate: jest.fn(),
type: PlotType.VISUALIZATION_CREATOR,
};
const tree = shallow(<VisualizationCreator configs={[config]} />);
expect(tree).toMatchSnapshot();
});
it('renders an Editor component if a visualization type is specified', () => {
const config: VisualizationCreatorConfig = {
isBusy: false,
onGenerate: jest.fn(),
type: PlotType.VISUALIZATION_CREATOR,
};
const tree = shallow(<VisualizationCreator configs={[config]} />);
tree.setState({
// source by default is set to ''
selectedType: ApiVisualizationType.ROCCURVE,
});
expect(tree).toMatchSnapshot();
});
it('renders two Editor components if the CUSTOM visualization type is specified', () => {
const config: VisualizationCreatorConfig = {
isBusy: false,
onGenerate: jest.fn(),
type: PlotType.VISUALIZATION_CREATOR,
};
const tree = shallow(<VisualizationCreator configs={[config]} />);
tree.setState({
// source by default is set to ''
selectedType: ApiVisualizationType.CUSTOM,
});
expect(tree).toMatchSnapshot();
});
it('has a disabled BusyButton if selectedType is an undefined', () => {
const config: VisualizationCreatorConfig = {
isBusy: false,
onGenerate: jest.fn(),
type: PlotType.VISUALIZATION_CREATOR,
};
const tree = shallow(<VisualizationCreator configs={[config]} />);
tree.setState({
source: 'gs://ml-pipeline/data.csv',
});
expect(
tree
.find('BusyButton')
.at(0)
.prop('disabled'),
).toBe(true);
});
it('has a disabled BusyButton if source is an empty string', () => {
const config: VisualizationCreatorConfig = {
isBusy: false,
onGenerate: jest.fn(),
type: PlotType.VISUALIZATION_CREATOR,
};
const tree = shallow(<VisualizationCreator configs={[config]} />);
tree.setState({
// source by default is set to ''
selectedType: ApiVisualizationType.ROCCURVE,
});
expect(
tree
.find('BusyButton')
.at(0)
.prop('disabled'),
).toBe(true);
});
it('has a disabled BusyButton if onGenerate is not provided as a prop', () => {
const config: VisualizationCreatorConfig = {
isBusy: false,
type: PlotType.VISUALIZATION_CREATOR,
};
const tree = shallow(<VisualizationCreator configs={[config]} />);
tree.setState({
selectedType: ApiVisualizationType.ROCCURVE,
source: 'gs://ml-pipeline/data.csv',
});
expect(
tree
.find('BusyButton')
.at(0)
.prop('disabled'),
).toBe(true);
});
it('has a disabled BusyButton if isBusy is true', () => {
const config: VisualizationCreatorConfig = {
isBusy: true,
onGenerate: jest.fn(),
type: PlotType.VISUALIZATION_CREATOR,
};
const tree = shallow(<VisualizationCreator configs={[config]} />);
tree.setState({
selectedType: ApiVisualizationType.ROCCURVE,
source: 'gs://ml-pipeline/data.csv',
});
expect(
tree
.find('BusyButton')
.at(0)
.prop('disabled'),
).toBe(true);
});
it('has an enabled BusyButton if onGenerate is provided and source and selectedType are set', () => {
const config: VisualizationCreatorConfig = {
isBusy: false,
onGenerate: jest.fn(),
type: PlotType.VISUALIZATION_CREATOR,
};
const tree = shallow(<VisualizationCreator configs={[config]} />);
tree.setState({
selectedType: ApiVisualizationType.ROCCURVE,
source: 'gs://ml-pipeline/data.csv',
});
expect(
tree
.find('BusyButton')
.at(0)
.prop('disabled'),
).toBe(false);
});
it('calls onGenerate when BusyButton is clicked', () => {
const onGenerate = jest.fn();
const config: VisualizationCreatorConfig = {
isBusy: false,
onGenerate,
type: PlotType.VISUALIZATION_CREATOR,
};
const tree = shallow(<VisualizationCreator configs={[config]} />);
tree.setState({
arguments: '{}',
selectedType: ApiVisualizationType.ROCCURVE,
source: 'gs://ml-pipeline/data.csv',
});
tree
.find('BusyButton')
.at(0)
.simulate('click');
expect(onGenerate).toBeCalled();
});
it('passes state as parameters to onGenerate when BusyButton is clicked', () => {
const onGenerate = jest.fn();
const config: VisualizationCreatorConfig = {
isBusy: false,
onGenerate,
type: PlotType.VISUALIZATION_CREATOR,
};
const tree = shallow(<VisualizationCreator configs={[config]} />);
tree.setState({
arguments: '{}',
selectedType: ApiVisualizationType.ROCCURVE,
source: 'gs://ml-pipeline/data.csv',
});
tree
.find('BusyButton')
.at(0)
.simulate('click');
expect(onGenerate).toBeCalledWith(
'{}',
'gs://ml-pipeline/data.csv',
ApiVisualizationType.ROCCURVE,
);
});
it('renders the provided arguments', () => {
const config: VisualizationCreatorConfig = {
type: PlotType.VISUALIZATION_CREATOR,
};
const tree = shallow(<VisualizationCreator configs={[config]} />);
tree.setState({
arguments: JSON.stringify({ is_generated: 'True' }),
// selectedType is required to be set so that the argument editor
// component is visible.
selectedType: ApiVisualizationType.ROCCURVE,
});
expect(tree).toMatchSnapshot();
});
it('renders a provided source', () => {
const source = 'gs://ml-pipeline/data.csv';
const config: VisualizationCreatorConfig = {
type: PlotType.VISUALIZATION_CREATOR,
};
const tree = mount(<VisualizationCreator configs={[config]} />);
tree.setState({
source,
});
expect(
tree
.find('input')
.at(1)
.prop('value'),
).toBe(source);
});
it('renders the selected visualization type', () => {
const config: VisualizationCreatorConfig = {
type: PlotType.VISUALIZATION_CREATOR,
};
const tree = shallow(<VisualizationCreator configs={[config]} />);
tree.setState({
selectedType: ApiVisualizationType.ROCCURVE,
});
expect(tree).toMatchSnapshot();
});
it('renders the custom type when it is allowed', () => {
const config: VisualizationCreatorConfig = {
allowCustomVisualizations: true,
type: PlotType.VISUALIZATION_CREATOR,
};
const tree = shallow(<VisualizationCreator configs={[config]} />);
expect(tree).toMatchSnapshot();
});
it('disables all select and input fields when busy', () => {
const config: VisualizationCreatorConfig = {
isBusy: true,
type: PlotType.VISUALIZATION_CREATOR,
};
const tree = shallow(<VisualizationCreator configs={[config]} />);
// toMatchSnapshot is used rather than three individual checks for the
// disabled prop due to an issue where the Input components are not
// selectable by tree.find().
expect(tree).toMatchSnapshot();
});
it('has an argument placeholder for every visualization type', () => {
// Taken from VisualizationCreator.tsx, update this if updated within
// VisualizationCreator.tsx.
const types = Object.keys(ApiVisualizationType)
.map((key: string) => key.replace('_', ''))
.filter((key: string, i: number, arr: string[]) => arr.indexOf(key) === i);
const config: VisualizationCreatorConfig = {
isBusy: false,
onGenerate: jest.fn(),
type: PlotType.VISUALIZATION_CREATOR,
};
const tree = shallow(<VisualizationCreator configs={[config]} />);
// Iterate through all selectable types to ensure a placeholder is set
// for the argument editor for each type.
for (const type of types) {
tree.setState({
// source by default is set to ''
selectedType: type,
});
expect(
tree
.find('Editor')
.at(0)
.prop('placeholder'),
).not.toBeNull();
}
});
it('returns friendly display name', () => {
expect(VisualizationCreator.prototype.getDisplayName()).toBe('Visualization Creator');
});
it('can be configured as collapsed initially and clicks to open', () => {
const baseConfig: VisualizationCreatorConfig = {
isBusy: false,
onGenerate: jest.fn(),
type: PlotType.VISUALIZATION_CREATOR,
collapsedInitially: false,
};
const { container: baseContainer } = render(<VisualizationCreator configs={[baseConfig]} />);
const { container } = render(
<VisualizationCreator
configs={[
{
...baseConfig,
collapsedInitially: true,
},
]}
/>,
);
expect(container).toMatchInlineSnapshot(`
<div>
<button
class="MuiButtonBase-root-114 MuiButton-root-88 MuiButton-text-90 MuiButton-flat-93"
tabindex="0"
type="button"
>
<span
class="MuiButton-label-89"
>
create visualizations manually
</span>
<span
class="MuiTouchRipple-root-117"
/>
</button>
</div>
`);
const button = screen.getByText('create visualizations manually');
fireEvent.click(button);
// expanding a visualization creator is equivalent to rendering a non-collapsed visualization creator
expect(diffHTML({ base: baseContainer.innerHTML, update: container.innerHTML }))
.toMatchInlineSnapshot(`
Snapshot Diff:
Compared values have no visual difference.
`);
});
});
| 7,974 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/MarkdownViewer.test.tsx | /*
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from 'react';
import { mount } from 'enzyme';
import MarkdownViewer, { MarkdownViewerConfig } from './MarkdownViewer';
import { PlotType } from './Viewer';
describe('MarkdownViewer', () => {
it('does not break on empty data', () => {
const tree = mount(<MarkdownViewer configs={[]} />).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('renders some basic markdown', () => {
const markdown = '# Title\n[some link here](http://example.com)';
const config: MarkdownViewerConfig = {
markdownContent: markdown,
type: PlotType.MARKDOWN,
};
const tree = mount(<MarkdownViewer configs={[config]} />).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('sanitizes the markdown to remove XSS', () => {
const markdown = `
lower[click me](javascript:...)lower
upper[click me](javascript:...)upper
`;
const config: MarkdownViewerConfig = {
markdownContent: markdown,
type: PlotType.MARKDOWN,
};
const tree = mount(<MarkdownViewer configs={[config]} />).getDOMNode();
expect(tree).toMatchSnapshot();
});
it('returns a user friendly display name', () => {
expect(MarkdownViewer.prototype.getDisplayName()).toBe('Markdown');
});
});
| 7,975 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/__snapshots__/ConfusionMatrix.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ConfusionMatrix does not break on asymetric data 1`] = `
<div
className="flex root"
>
<table>
<tbody>
<tr>
<td
className="yAxisLabel"
>
test y axis
</td>
</tr>
<tr
key="0"
>
<td>
<div
className="ylabel"
>
label1
</div>
</td>
<td
className="cell"
key="0"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.375)",
"color": "#000",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
3
</td>
<td
className="cell"
key="1"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.5)",
"color": "#000",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
4
</td>
<td
className="cell"
key="2"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.625)",
"color": "#fff",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
5
</td>
</tr>
<tr
key="1"
>
<td>
<div
className="ylabel"
>
label2
</div>
</td>
<td
className="cell"
key="0"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.75)",
"color": "#fff",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
6
</td>
<td
className="cell"
key="1"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.875)",
"color": "#fff",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
7
</td>
<td
className="cell"
key="2"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 1)",
"color": "#fff",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
8
</td>
</tr>
<tr>
<th
className="xlabel"
/>
<th
key="0"
>
<div
className="xlabel"
>
label1
</div>
</th>
<th
key="1"
>
<div
className="xlabel"
>
label2
</div>
</th>
<td
className="xAxisLabel"
>
test x axis
</td>
</tr>
</tbody>
</table>
<div
className="legend"
style={
Object {
"height": 118.5,
}
}
>
<div
className="legendNotch"
style={
Object {
"top": 0,
}
}
>
<span
className="legendLabel"
>
8
</span>
</div>
<div
className="legendNotch"
key="0"
style={
Object {
"top": "100%",
}
}
>
<span
className="legendLabel"
>
0
</span>
</div>
<div
className="legendNotch"
key="1"
style={
Object {
"top": "80%",
}
}
>
<span
className="legendLabel"
>
1
</span>
</div>
<div
className="legendNotch"
key="2"
style={
Object {
"top": "60%",
}
}
>
<span
className="legendLabel"
>
3
</span>
</div>
<div
className="legendNotch"
key="3"
style={
Object {
"top": "40%",
}
}
>
<span
className="legendLabel"
>
4
</span>
</div>
<div
className="legendNotch"
key="4"
style={
Object {
"top": "20%",
}
}
>
<span
className="legendLabel"
>
6
</span>
</div>
</div>
</div>
`;
exports[`ConfusionMatrix does not break on empty data 1`] = `""`;
exports[`ConfusionMatrix renders a basic confusion matrix 1`] = `
<div
className="flex root"
>
<table>
<tbody>
<tr>
<td
className="yAxisLabel"
>
test y axis
</td>
</tr>
<tr
key="0"
>
<td>
<div
className="ylabel"
>
label1
</div>
</td>
<td
className="cell"
key="0"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0)",
"color": "#000",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
0
</td>
<td
className="cell"
key="1"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.125)",
"color": "#000",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
1
</td>
<td
className="cell"
key="2"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.25)",
"color": "#000",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
2
</td>
</tr>
<tr
key="1"
>
<td>
<div
className="ylabel"
>
label2
</div>
</td>
<td
className="cell"
key="0"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.375)",
"color": "#000",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
3
</td>
<td
className="cell"
key="1"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.5)",
"color": "#000",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
4
</td>
<td
className="cell"
key="2"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.625)",
"color": "#fff",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
5
</td>
</tr>
<tr
key="2"
>
<td>
<div
className="ylabel"
/>
</td>
<td
className="cell"
key="0"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.75)",
"color": "#fff",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
6
</td>
<td
className="cell"
key="1"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.875)",
"color": "#fff",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
7
</td>
<td
className="cell"
key="2"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 1)",
"color": "#fff",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
8
</td>
</tr>
<tr>
<th
className="xlabel"
/>
<th
key="0"
>
<div
className="xlabel"
>
label1
</div>
</th>
<th
key="1"
>
<div
className="xlabel"
>
label2
</div>
</th>
<td
className="xAxisLabel"
>
test x axis
</td>
</tr>
</tbody>
</table>
<div
className="legend"
style={
Object {
"height": 177.75,
}
}
>
<div
className="legendNotch"
style={
Object {
"top": 0,
}
}
>
<span
className="legendLabel"
>
8
</span>
</div>
<div
className="legendNotch"
key="0"
style={
Object {
"top": "100%",
}
}
>
<span
className="legendLabel"
>
0
</span>
</div>
<div
className="legendNotch"
key="1"
style={
Object {
"top": "80%",
}
}
>
<span
className="legendLabel"
>
1
</span>
</div>
<div
className="legendNotch"
key="2"
style={
Object {
"top": "60%",
}
}
>
<span
className="legendLabel"
>
3
</span>
</div>
<div
className="legendNotch"
key="3"
style={
Object {
"top": "40%",
}
}
>
<span
className="legendLabel"
>
4
</span>
</div>
<div
className="legendNotch"
key="4"
style={
Object {
"top": "20%",
}
}
>
<span
className="legendLabel"
>
6
</span>
</div>
</div>
</div>
`;
exports[`ConfusionMatrix renders a small confusion matrix snapshot, with no labels or footer 1`] = `
<div
className="flex root"
>
<table>
<tbody>
<tr
key="0"
>
<td
className="cell"
key="0"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0)",
"color": "#000",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
0
</td>
<td
className="cell"
key="1"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.125)",
"color": "#000",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
1
</td>
<td
className="cell"
key="2"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.25)",
"color": "#000",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
2
</td>
</tr>
<tr
key="1"
>
<td
className="cell"
key="0"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.375)",
"color": "#000",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
3
</td>
<td
className="cell"
key="1"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.5)",
"color": "#000",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
4
</td>
<td
className="cell"
key="2"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.625)",
"color": "#fff",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
5
</td>
</tr>
<tr
key="2"
>
<td
className="cell"
key="0"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.75)",
"color": "#fff",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
6
</td>
<td
className="cell"
key="1"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.875)",
"color": "#fff",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
7
</td>
<td
className="cell"
key="2"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 1)",
"color": "#fff",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
8
</td>
</tr>
</tbody>
</table>
</div>
`;
exports[`ConfusionMatrix renders only one of the given list of configs 1`] = `
<div
className="flex root"
>
<table>
<tbody>
<tr>
<td
className="yAxisLabel"
>
test y axis
</td>
</tr>
<tr
key="0"
>
<td>
<div
className="ylabel"
>
label1
</div>
</td>
<td
className="cell"
key="0"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0)",
"color": "#000",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
0
</td>
<td
className="cell"
key="1"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.125)",
"color": "#000",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
1
</td>
<td
className="cell"
key="2"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.25)",
"color": "#000",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
2
</td>
</tr>
<tr
key="1"
>
<td>
<div
className="ylabel"
>
label2
</div>
</td>
<td
className="cell"
key="0"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.375)",
"color": "#000",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
3
</td>
<td
className="cell"
key="1"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.5)",
"color": "#000",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
4
</td>
<td
className="cell"
key="2"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.625)",
"color": "#fff",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
5
</td>
</tr>
<tr
key="2"
>
<td>
<div
className="ylabel"
/>
</td>
<td
className="cell"
key="0"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.75)",
"color": "#fff",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
6
</td>
<td
className="cell"
key="1"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 0.875)",
"color": "#fff",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
7
</td>
<td
className="cell"
key="2"
onMouseOver={[Function]}
style={
Object {
"backgroundColor": "rgba(41, 121, 255, 1)",
"color": "#fff",
}
}
>
<div
className="overlay"
style={
Object {
"opacity": 0,
}
}
/>
8
</td>
</tr>
<tr>
<th
className="xlabel"
/>
<th
key="0"
>
<div
className="xlabel"
>
label1
</div>
</th>
<th
key="1"
>
<div
className="xlabel"
>
label2
</div>
</th>
<td
className="xAxisLabel"
>
test x axis
</td>
</tr>
</tbody>
</table>
<div
className="legend"
style={
Object {
"height": 177.75,
}
}
>
<div
className="legendNotch"
style={
Object {
"top": 0,
}
}
>
<span
className="legendLabel"
>
8
</span>
</div>
<div
className="legendNotch"
key="0"
style={
Object {
"top": "100%",
}
}
>
<span
className="legendLabel"
>
0
</span>
</div>
<div
className="legendNotch"
key="1"
style={
Object {
"top": "80%",
}
}
>
<span
className="legendLabel"
>
1
</span>
</div>
<div
className="legendNotch"
key="2"
style={
Object {
"top": "60%",
}
}
>
<span
className="legendLabel"
>
3
</span>
</div>
<div
className="legendNotch"
key="3"
style={
Object {
"top": "40%",
}
}
>
<span
className="legendLabel"
>
4
</span>
</div>
<div
className="legendNotch"
key="4"
style={
Object {
"top": "20%",
}
}
>
<span
className="legendLabel"
>
6
</span>
</div>
</div>
</div>
`;
| 7,976 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/__snapshots__/PagedTable.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`PagedTable does not break on empty data 1`] = `
<div
className="page"
style={
Object {
"width": "100%",
}
}
>
<WithStyles(Table)
style={
Object {
"display": "block",
"overflow": "auto",
}
}
>
<WithStyles(TableHead)>
<WithStyles(TableRow) />
</WithStyles(TableHead)>
<WithStyles(TableBody)>
<WithStyles(TableRow)
style={
Object {
"height": 300,
}
}
>
<WithStyles(TableCell)
colSpan={6}
/>
</WithStyles(TableRow)>
</WithStyles(TableBody)>
</WithStyles(Table)>
<WithStyles(TablePagination)
component="div"
count={0}
onChangePage={[Function]}
onChangeRowsPerPage={[Function]}
page={0}
rowsPerPage={10}
/>
</div>
`;
exports[`PagedTable does not break on no config 1`] = `""`;
exports[`PagedTable renders simple data 1`] = `
<div
className="page"
style={
Object {
"width": "100%",
}
}
>
<WithStyles(Table)
style={
Object {
"display": "block",
"overflow": "auto",
}
}
>
<WithStyles(TableHead)>
<WithStyles(TableRow)>
<WithStyles(TableCell)
className="columnName"
key="0"
sortDirection="asc"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Sort"
>
<WithStyles(TableSortLabel)
active={true}
direction="asc"
onClick={[Function]}
>
field1
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="columnName"
key="1"
sortDirection={false}
>
<WithStyles(Tooltip)
enterDelay={300}
title="Sort"
>
<WithStyles(TableSortLabel)
active={false}
direction="asc"
onClick={[Function]}
>
field2
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="columnName"
key="2"
sortDirection={false}
>
<WithStyles(Tooltip)
enterDelay={300}
title="Sort"
>
<WithStyles(TableSortLabel)
active={false}
direction="asc"
onClick={[Function]}
>
field3
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</WithStyles(TableCell)>
</WithStyles(TableRow)>
</WithStyles(TableHead)>
<WithStyles(TableBody)>
<WithStyles(TableRow)
className="row"
hover={true}
key="col1"
tabIndex={-1}
>
<WithStyles(TableCell)
className="cell"
key="0"
>
col1
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="cell"
key="1"
>
col2
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="cell"
key="2"
>
col3
</WithStyles(TableCell)>
</WithStyles(TableRow)>
<WithStyles(TableRow)
className="row"
hover={true}
key="col4"
tabIndex={-1}
>
<WithStyles(TableCell)
className="cell"
key="0"
>
col4
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="cell"
key="1"
>
col5
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="cell"
key="2"
>
col6
</WithStyles(TableCell)>
</WithStyles(TableRow)>
<WithStyles(TableRow)
style={
Object {
"height": 240,
}
}
>
<WithStyles(TableCell)
colSpan={6}
/>
</WithStyles(TableRow)>
</WithStyles(TableBody)>
</WithStyles(Table)>
<WithStyles(TablePagination)
component="div"
count={2}
onChangePage={[Function]}
onChangeRowsPerPage={[Function]}
page={0}
rowsPerPage={10}
/>
</div>
`;
exports[`PagedTable renders simple data without labels 1`] = `
<div
className="page"
style={
Object {
"width": "100%",
}
}
>
<WithStyles(Table)
style={
Object {
"display": "block",
"overflow": "auto",
}
}
>
<WithStyles(TableHead)>
<WithStyles(TableRow) />
</WithStyles(TableHead)>
<WithStyles(TableBody)>
<WithStyles(TableRow)
className="row"
hover={true}
key="col1"
tabIndex={-1}
>
<WithStyles(TableCell)
className="cell"
key="0"
>
col1
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="cell"
key="1"
>
col2
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="cell"
key="2"
>
col3
</WithStyles(TableCell)>
</WithStyles(TableRow)>
<WithStyles(TableRow)
className="row"
hover={true}
key="col4"
tabIndex={-1}
>
<WithStyles(TableCell)
className="cell"
key="0"
>
col4
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="cell"
key="1"
>
col5
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="cell"
key="2"
>
col6
</WithStyles(TableCell)>
</WithStyles(TableRow)>
<WithStyles(TableRow)
style={
Object {
"height": 240,
}
}
>
<WithStyles(TableCell)
colSpan={6}
/>
</WithStyles(TableRow)>
</WithStyles(TableBody)>
</WithStyles(Table)>
<WithStyles(TablePagination)
component="div"
count={2}
onChangePage={[Function]}
onChangeRowsPerPage={[Function]}
page={0}
rowsPerPage={10}
/>
</div>
`;
exports[`PagedTable sorts on first column ascending 1`] = `
<div
className="page"
style={
Object {
"width": "100%",
}
}
>
<WithStyles(Table)
style={
Object {
"display": "block",
"overflow": "auto",
}
}
>
<WithStyles(TableHead)>
<WithStyles(TableRow)>
<WithStyles(TableCell)
className="columnName"
key="0"
sortDirection="asc"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Sort"
>
<WithStyles(TableSortLabel)
active={true}
direction="asc"
onClick={[Function]}
>
field1
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="columnName"
key="1"
sortDirection={false}
>
<WithStyles(Tooltip)
enterDelay={300}
title="Sort"
>
<WithStyles(TableSortLabel)
active={false}
direction="asc"
onClick={[Function]}
>
field2
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="columnName"
key="2"
sortDirection={false}
>
<WithStyles(Tooltip)
enterDelay={300}
title="Sort"
>
<WithStyles(TableSortLabel)
active={false}
direction="asc"
onClick={[Function]}
>
field3
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</WithStyles(TableCell)>
</WithStyles(TableRow)>
</WithStyles(TableHead)>
<WithStyles(TableBody)>
<WithStyles(TableRow)
className="row"
hover={true}
key="col1"
tabIndex={-1}
>
<WithStyles(TableCell)
className="cell"
key="0"
>
col1
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="cell"
key="1"
>
col2
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="cell"
key="2"
>
col3
</WithStyles(TableCell)>
</WithStyles(TableRow)>
<WithStyles(TableRow)
className="row"
hover={true}
key="col4"
tabIndex={-1}
>
<WithStyles(TableCell)
className="cell"
key="0"
>
col4
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="cell"
key="1"
>
col5
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="cell"
key="2"
>
col6
</WithStyles(TableCell)>
</WithStyles(TableRow)>
<WithStyles(TableRow)
style={
Object {
"height": 240,
}
}
>
<WithStyles(TableCell)
colSpan={6}
/>
</WithStyles(TableRow)>
</WithStyles(TableBody)>
</WithStyles(Table)>
<WithStyles(TablePagination)
component="div"
count={2}
onChangePage={[Function]}
onChangeRowsPerPage={[Function]}
page={0}
rowsPerPage={10}
/>
</div>
`;
exports[`PagedTable sorts on first column descending 1`] = `
<div
className="page"
style={
Object {
"width": "100%",
}
}
>
<WithStyles(Table)
style={
Object {
"display": "block",
"overflow": "auto",
}
}
>
<WithStyles(TableHead)>
<WithStyles(TableRow)>
<WithStyles(TableCell)
className="columnName"
key="0"
sortDirection="desc"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Sort"
>
<WithStyles(TableSortLabel)
active={true}
direction="desc"
onClick={[Function]}
>
field1
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="columnName"
key="1"
sortDirection={false}
>
<WithStyles(Tooltip)
enterDelay={300}
title="Sort"
>
<WithStyles(TableSortLabel)
active={false}
direction="desc"
onClick={[Function]}
>
field2
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="columnName"
key="2"
sortDirection={false}
>
<WithStyles(Tooltip)
enterDelay={300}
title="Sort"
>
<WithStyles(TableSortLabel)
active={false}
direction="desc"
onClick={[Function]}
>
field3
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</WithStyles(TableCell)>
</WithStyles(TableRow)>
</WithStyles(TableHead)>
<WithStyles(TableBody)>
<WithStyles(TableRow)
className="row"
hover={true}
key="col4"
tabIndex={-1}
>
<WithStyles(TableCell)
className="cell"
key="0"
>
col4
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="cell"
key="1"
>
col5
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="cell"
key="2"
>
col6
</WithStyles(TableCell)>
</WithStyles(TableRow)>
<WithStyles(TableRow)
className="row"
hover={true}
key="col1"
tabIndex={-1}
>
<WithStyles(TableCell)
className="cell"
key="0"
>
col1
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="cell"
key="1"
>
col2
</WithStyles(TableCell)>
<WithStyles(TableCell)
className="cell"
key="2"
>
col3
</WithStyles(TableCell)>
</WithStyles(TableRow)>
<WithStyles(TableRow)
style={
Object {
"height": 240,
}
}
>
<WithStyles(TableCell)
colSpan={6}
/>
</WithStyles(TableRow)>
</WithStyles(TableBody)>
</WithStyles(Table)>
<WithStyles(TablePagination)
component="div"
count={2}
onChangePage={[Function]}
onChangeRowsPerPage={[Function]}
page={0}
rowsPerPage={10}
/>
</div>
`;
| 7,977 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/__snapshots__/MarkdownViewer.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`MarkdownViewer does not break on empty data 1`] = `null`;
exports[`MarkdownViewer renders some basic markdown 1`] = `
<div
class="markdown-viewer"
>
<div>
<h1
id="title"
>
Title
</h1>
<p>
<a
href="http://example.com"
>
some link here
</a>
</p>
</div>
</div>
`;
exports[`MarkdownViewer sanitizes the markdown to remove XSS 1`] = `
<div
class="markdown-viewer"
>
<pre>
<code>
lower[click me](javascript:...)lower
upper[click me](javascript:...)upper
</code>
</pre>
</div>
`;
| 7,978 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/__snapshots__/VisualizationCreator.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`VisualizationCreator disables all select and input fields when busy 1`] = `
<div
style={
Object {
"width": 600,
}
}
>
<WithStyles(FormControl)
style={
Object {
"width": "100%",
}
}
>
<WithStyles(WithFormControlContext(InputLabel))
htmlFor="visualization-type-selector"
>
Type
</WithStyles(WithFormControlContext(InputLabel))>
<WithStyles(WithFormControlContext(Select))
disabled={true}
inputProps={
Object {
"id": "visualization-type-selector",
"name": "Visualization Type",
}
}
onChange={[Function]}
style={
Object {
"minHeight": 60,
"width": "100%",
}
}
>
<WithStyles(MenuItem)
key="ROCCURVE"
value="ROC_CURVE"
>
ROC_CURVE
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TFDV"
value="TFDV"
>
TFDV
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TABLE"
value="TABLE"
>
TABLE
</WithStyles(MenuItem)>
</WithStyles(WithFormControlContext(Select))>
</WithStyles(FormControl)>
<Input
disabled={true}
label="Source"
onChange={[Function]}
placeholder="File path or path pattern of data within GCS."
value=""
variant="outlined"
/>
<BusyButton
busy={true}
disabled={true}
onClick={[Function]}
title="Generate Visualization"
/>
</div>
`;
exports[`VisualizationCreator does not render an Editor component if a visualization type is not specified 1`] = `
<div
style={
Object {
"width": 600,
}
}
>
<WithStyles(FormControl)
style={
Object {
"width": "100%",
}
}
>
<WithStyles(WithFormControlContext(InputLabel))
htmlFor="visualization-type-selector"
>
Type
</WithStyles(WithFormControlContext(InputLabel))>
<WithStyles(WithFormControlContext(Select))
disabled={false}
inputProps={
Object {
"id": "visualization-type-selector",
"name": "Visualization Type",
}
}
onChange={[Function]}
style={
Object {
"minHeight": 60,
"width": "100%",
}
}
>
<WithStyles(MenuItem)
key="ROCCURVE"
value="ROC_CURVE"
>
ROC_CURVE
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TFDV"
value="TFDV"
>
TFDV
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TABLE"
value="TABLE"
>
TABLE
</WithStyles(MenuItem)>
</WithStyles(WithFormControlContext(Select))>
</WithStyles(FormControl)>
<Input
disabled={false}
label="Source"
onChange={[Function]}
placeholder="File path or path pattern of data within GCS."
value=""
variant="outlined"
/>
<BusyButton
busy={false}
disabled={true}
onClick={[Function]}
title="Generate Visualization"
/>
</div>
`;
exports[`VisualizationCreator does not render component when no config is provided 1`] = `""`;
exports[`VisualizationCreator renders an Editor component if a visualization type is specified 1`] = `
<div
style={
Object {
"width": 600,
}
}
>
<WithStyles(FormControl)
style={
Object {
"width": "100%",
}
}
>
<WithStyles(WithFormControlContext(InputLabel))
htmlFor="visualization-type-selector"
>
Type
</WithStyles(WithFormControlContext(InputLabel))>
<WithStyles(WithFormControlContext(Select))
disabled={false}
inputProps={
Object {
"id": "visualization-type-selector",
"name": "Visualization Type",
}
}
onChange={[Function]}
style={
Object {
"minHeight": 60,
"width": "100%",
}
}
value="ROC_CURVE"
>
<WithStyles(MenuItem)
key="ROCCURVE"
value="ROC_CURVE"
>
ROC_CURVE
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TFDV"
value="TFDV"
>
TFDV
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TABLE"
value="TABLE"
>
TABLE
</WithStyles(MenuItem)>
</WithStyles(WithFormControlContext(Select))>
</WithStyles(FormControl)>
<Input
disabled={false}
label="Source"
onChange={[Function]}
placeholder="File path or path pattern of data within GCS."
value=""
variant="outlined"
/>
<div>
<WithStyles(WithFormControlContext(InputLabel))>
Arguments (Optional)
</WithStyles(WithFormControlContext(InputLabel))>
<Editor
cursorStart={1}
editorProps={
Object {
"$blockScrolling": true,
}
}
enableBasicAutocompletion={false}
enableLiveAutocompletion={false}
enableSnippets={false}
focus={false}
fontSize={12}
height="84px"
highlightActiveLine={true}
maxLines={null}
minLines={null}
mode="json"
name="brace-editor"
navigateToFileEnd={true}
onChange={[Function]}
onLoad={null}
onPaste={null}
onScroll={null}
placeholder="{<br>     \\"is_generated\\": boolean | null,<br>     \\"target_lambda\\": string | null,<br>     \\"trueclass\\": string | null,<br>     \\"true_score_column\\": string | null<br> }"
readOnly={false}
scrollMargin={
Array [
0,
0,
0,
0,
]
}
setOptions={Object {}}
showGutter={true}
showPrintMargin={true}
style={Object {}}
tabSize={4}
theme="github"
value=""
width="100%"
wrapEnabled={false}
/>
</div>
<BusyButton
busy={false}
disabled={true}
onClick={[Function]}
title="Generate Visualization"
/>
</div>
`;
exports[`VisualizationCreator renders component when all parameters in config are provided 1`] = `
<div
style={
Object {
"width": 600,
}
}
>
<WithStyles(FormControl)
style={
Object {
"width": "100%",
}
}
>
<WithStyles(WithFormControlContext(InputLabel))
htmlFor="visualization-type-selector"
>
Type
</WithStyles(WithFormControlContext(InputLabel))>
<WithStyles(WithFormControlContext(Select))
disabled={false}
inputProps={
Object {
"id": "visualization-type-selector",
"name": "Visualization Type",
}
}
onChange={[Function]}
style={
Object {
"minHeight": 60,
"width": "100%",
}
}
>
<WithStyles(MenuItem)
key="ROCCURVE"
value="ROC_CURVE"
>
ROC_CURVE
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TFDV"
value="TFDV"
>
TFDV
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TABLE"
value="TABLE"
>
TABLE
</WithStyles(MenuItem)>
</WithStyles(WithFormControlContext(Select))>
</WithStyles(FormControl)>
<Input
disabled={false}
label="Source"
onChange={[Function]}
placeholder="File path or path pattern of data within GCS."
value=""
variant="outlined"
/>
<BusyButton
busy={false}
disabled={true}
onClick={[Function]}
title="Generate Visualization"
/>
</div>
`;
exports[`VisualizationCreator renders component when empty config is provided 1`] = `
<div
style={
Object {
"width": 600,
}
}
>
<WithStyles(FormControl)
style={
Object {
"width": "100%",
}
}
>
<WithStyles(WithFormControlContext(InputLabel))
htmlFor="visualization-type-selector"
>
Type
</WithStyles(WithFormControlContext(InputLabel))>
<WithStyles(WithFormControlContext(Select))
disabled={false}
inputProps={
Object {
"id": "visualization-type-selector",
"name": "Visualization Type",
}
}
onChange={[Function]}
style={
Object {
"minHeight": 60,
"width": "100%",
}
}
>
<WithStyles(MenuItem)
key="ROCCURVE"
value="ROC_CURVE"
>
ROC_CURVE
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TFDV"
value="TFDV"
>
TFDV
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TABLE"
value="TABLE"
>
TABLE
</WithStyles(MenuItem)>
</WithStyles(WithFormControlContext(Select))>
</WithStyles(FormControl)>
<Input
disabled={false}
label="Source"
onChange={[Function]}
placeholder="File path or path pattern of data within GCS."
value=""
variant="outlined"
/>
<BusyButton
busy={false}
disabled={true}
onClick={[Function]}
title="Generate Visualization"
/>
</div>
`;
exports[`VisualizationCreator renders component when isBusy is not provided 1`] = `
<div
style={
Object {
"width": 600,
}
}
>
<WithStyles(FormControl)
style={
Object {
"width": "100%",
}
}
>
<WithStyles(WithFormControlContext(InputLabel))
htmlFor="visualization-type-selector"
>
Type
</WithStyles(WithFormControlContext(InputLabel))>
<WithStyles(WithFormControlContext(Select))
disabled={false}
inputProps={
Object {
"id": "visualization-type-selector",
"name": "Visualization Type",
}
}
onChange={[Function]}
style={
Object {
"minHeight": 60,
"width": "100%",
}
}
>
<WithStyles(MenuItem)
key="ROCCURVE"
value="ROC_CURVE"
>
ROC_CURVE
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TFDV"
value="TFDV"
>
TFDV
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TABLE"
value="TABLE"
>
TABLE
</WithStyles(MenuItem)>
</WithStyles(WithFormControlContext(Select))>
</WithStyles(FormControl)>
<Input
disabled={false}
label="Source"
onChange={[Function]}
placeholder="File path or path pattern of data within GCS."
value=""
variant="outlined"
/>
<BusyButton
busy={false}
disabled={true}
onClick={[Function]}
title="Generate Visualization"
/>
</div>
`;
exports[`VisualizationCreator renders component when onGenerate is not provided 1`] = `
<div
style={
Object {
"width": 600,
}
}
>
<WithStyles(FormControl)
style={
Object {
"width": "100%",
}
}
>
<WithStyles(WithFormControlContext(InputLabel))
htmlFor="visualization-type-selector"
>
Type
</WithStyles(WithFormControlContext(InputLabel))>
<WithStyles(WithFormControlContext(Select))
disabled={false}
inputProps={
Object {
"id": "visualization-type-selector",
"name": "Visualization Type",
}
}
onChange={[Function]}
style={
Object {
"minHeight": 60,
"width": "100%",
}
}
>
<WithStyles(MenuItem)
key="ROCCURVE"
value="ROC_CURVE"
>
ROC_CURVE
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TFDV"
value="TFDV"
>
TFDV
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TABLE"
value="TABLE"
>
TABLE
</WithStyles(MenuItem)>
</WithStyles(WithFormControlContext(Select))>
</WithStyles(FormControl)>
<Input
disabled={false}
label="Source"
onChange={[Function]}
placeholder="File path or path pattern of data within GCS."
value=""
variant="outlined"
/>
<BusyButton
busy={false}
disabled={true}
onClick={[Function]}
title="Generate Visualization"
/>
</div>
`;
exports[`VisualizationCreator renders the custom type when it is allowed 1`] = `
<div
style={
Object {
"width": 600,
}
}
>
<WithStyles(FormControl)
style={
Object {
"width": "100%",
}
}
>
<WithStyles(WithFormControlContext(InputLabel))
htmlFor="visualization-type-selector"
>
Type
</WithStyles(WithFormControlContext(InputLabel))>
<WithStyles(WithFormControlContext(Select))
disabled={false}
inputProps={
Object {
"id": "visualization-type-selector",
"name": "Visualization Type",
}
}
onChange={[Function]}
style={
Object {
"minHeight": 60,
"width": "100%",
}
}
>
<WithStyles(MenuItem)
key="ROCCURVE"
value="ROC_CURVE"
>
ROC_CURVE
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TFDV"
value="TFDV"
>
TFDV
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TABLE"
value="TABLE"
>
TABLE
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="CUSTOM"
value="CUSTOM"
>
CUSTOM
</WithStyles(MenuItem)>
</WithStyles(WithFormControlContext(Select))>
</WithStyles(FormControl)>
<Input
disabled={false}
label="Source"
onChange={[Function]}
placeholder="File path or path pattern of data within GCS."
value=""
variant="outlined"
/>
<BusyButton
busy={false}
disabled={true}
onClick={[Function]}
title="Generate Visualization"
/>
</div>
`;
exports[`VisualizationCreator renders the provided arguments 1`] = `
<div
style={
Object {
"width": 600,
}
}
>
<WithStyles(FormControl)
style={
Object {
"width": "100%",
}
}
>
<WithStyles(WithFormControlContext(InputLabel))
htmlFor="visualization-type-selector"
>
Type
</WithStyles(WithFormControlContext(InputLabel))>
<WithStyles(WithFormControlContext(Select))
disabled={false}
inputProps={
Object {
"id": "visualization-type-selector",
"name": "Visualization Type",
}
}
onChange={[Function]}
style={
Object {
"minHeight": 60,
"width": "100%",
}
}
value="ROC_CURVE"
>
<WithStyles(MenuItem)
key="ROCCURVE"
value="ROC_CURVE"
>
ROC_CURVE
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TFDV"
value="TFDV"
>
TFDV
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TABLE"
value="TABLE"
>
TABLE
</WithStyles(MenuItem)>
</WithStyles(WithFormControlContext(Select))>
</WithStyles(FormControl)>
<Input
disabled={false}
label="Source"
onChange={[Function]}
placeholder="File path or path pattern of data within GCS."
value=""
variant="outlined"
/>
<div>
<WithStyles(WithFormControlContext(InputLabel))>
Arguments (Optional)
</WithStyles(WithFormControlContext(InputLabel))>
<Editor
cursorStart={1}
editorProps={
Object {
"$blockScrolling": true,
}
}
enableBasicAutocompletion={false}
enableLiveAutocompletion={false}
enableSnippets={false}
focus={false}
fontSize={12}
height="84px"
highlightActiveLine={true}
maxLines={null}
minLines={null}
mode="json"
name="brace-editor"
navigateToFileEnd={true}
onChange={[Function]}
onLoad={null}
onPaste={null}
onScroll={null}
placeholder="{<br>     \\"is_generated\\": boolean | null,<br>     \\"target_lambda\\": string | null,<br>     \\"trueclass\\": string | null,<br>     \\"true_score_column\\": string | null<br> }"
readOnly={false}
scrollMargin={
Array [
0,
0,
0,
0,
]
}
setOptions={Object {}}
showGutter={true}
showPrintMargin={true}
style={Object {}}
tabSize={4}
theme="github"
value="{\\"is_generated\\":\\"True\\"}"
width="100%"
wrapEnabled={false}
/>
</div>
<BusyButton
busy={false}
disabled={true}
onClick={[Function]}
title="Generate Visualization"
/>
</div>
`;
exports[`VisualizationCreator renders the selected visualization type 1`] = `
<div
style={
Object {
"width": 600,
}
}
>
<WithStyles(FormControl)
style={
Object {
"width": "100%",
}
}
>
<WithStyles(WithFormControlContext(InputLabel))
htmlFor="visualization-type-selector"
>
Type
</WithStyles(WithFormControlContext(InputLabel))>
<WithStyles(WithFormControlContext(Select))
disabled={false}
inputProps={
Object {
"id": "visualization-type-selector",
"name": "Visualization Type",
}
}
onChange={[Function]}
style={
Object {
"minHeight": 60,
"width": "100%",
}
}
value="ROC_CURVE"
>
<WithStyles(MenuItem)
key="ROCCURVE"
value="ROC_CURVE"
>
ROC_CURVE
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TFDV"
value="TFDV"
>
TFDV
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TABLE"
value="TABLE"
>
TABLE
</WithStyles(MenuItem)>
</WithStyles(WithFormControlContext(Select))>
</WithStyles(FormControl)>
<Input
disabled={false}
label="Source"
onChange={[Function]}
placeholder="File path or path pattern of data within GCS."
value=""
variant="outlined"
/>
<div>
<WithStyles(WithFormControlContext(InputLabel))>
Arguments (Optional)
</WithStyles(WithFormControlContext(InputLabel))>
<Editor
cursorStart={1}
editorProps={
Object {
"$blockScrolling": true,
}
}
enableBasicAutocompletion={false}
enableLiveAutocompletion={false}
enableSnippets={false}
focus={false}
fontSize={12}
height="84px"
highlightActiveLine={true}
maxLines={null}
minLines={null}
mode="json"
name="brace-editor"
navigateToFileEnd={true}
onChange={[Function]}
onLoad={null}
onPaste={null}
onScroll={null}
placeholder="{<br>     \\"is_generated\\": boolean | null,<br>     \\"target_lambda\\": string | null,<br>     \\"trueclass\\": string | null,<br>     \\"true_score_column\\": string | null<br> }"
readOnly={false}
scrollMargin={
Array [
0,
0,
0,
0,
]
}
setOptions={Object {}}
showGutter={true}
showPrintMargin={true}
style={Object {}}
tabSize={4}
theme="github"
value=""
width="100%"
wrapEnabled={false}
/>
</div>
<BusyButton
busy={false}
disabled={true}
onClick={[Function]}
title="Generate Visualization"
/>
</div>
`;
exports[`VisualizationCreator renders two Editor components if the CUSTOM visualization type is specified 1`] = `
<div
style={
Object {
"width": 600,
}
}
>
<WithStyles(FormControl)
style={
Object {
"width": "100%",
}
}
>
<WithStyles(WithFormControlContext(InputLabel))
htmlFor="visualization-type-selector"
>
Type
</WithStyles(WithFormControlContext(InputLabel))>
<WithStyles(WithFormControlContext(Select))
disabled={false}
inputProps={
Object {
"id": "visualization-type-selector",
"name": "Visualization Type",
}
}
onChange={[Function]}
style={
Object {
"minHeight": 60,
"width": "100%",
}
}
value="CUSTOM"
>
<WithStyles(MenuItem)
key="ROCCURVE"
value="ROC_CURVE"
>
ROC_CURVE
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TFDV"
value="TFDV"
>
TFDV
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="TABLE"
value="TABLE"
>
TABLE
</WithStyles(MenuItem)>
</WithStyles(WithFormControlContext(Select))>
</WithStyles(FormControl)>
<Input
disabled={false}
label="Source"
onChange={[Function]}
placeholder="File path or path pattern of data within GCS."
value=""
variant="outlined"
/>
<div>
<WithStyles(WithFormControlContext(InputLabel))>
Custom Visualization Code
</WithStyles(WithFormControlContext(InputLabel))>
<Editor
cursorStart={1}
editorProps={
Object {
"$blockScrolling": true,
}
}
enableBasicAutocompletion={true}
enableLiveAutocompletion={true}
enableSnippets={false}
focus={false}
fontSize={12}
height="175px"
highlightActiveLine={true}
maxLines={null}
minLines={null}
mode="python"
name="brace-editor"
navigateToFileEnd={true}
onChange={[Function]}
onLoad={null}
onPaste={null}
onScroll={null}
placeholder="Python code that will be run to generate visualization.<br><br>To access the source value (if provided), reference the variable \\"source\\".<br>To access any provided arguments, reference the variable \\"variables\\" (it is a dict object)."
readOnly={false}
scrollMargin={
Array [
0,
0,
0,
0,
]
}
setOptions={Object {}}
showGutter={true}
showPrintMargin={true}
style={Object {}}
tabSize={4}
theme="github"
value=""
width="100%"
wrapEnabled={false}
/>
</div>
<div>
<WithStyles(WithFormControlContext(InputLabel))>
Arguments (Optional)
</WithStyles(WithFormControlContext(InputLabel))>
<Editor
cursorStart={1}
editorProps={
Object {
"$blockScrolling": true,
}
}
enableBasicAutocompletion={false}
enableLiveAutocompletion={false}
enableSnippets={false}
focus={false}
fontSize={12}
height="42px"
highlightActiveLine={true}
maxLines={null}
minLines={null}
mode="json"
name="brace-editor"
navigateToFileEnd={true}
onChange={[Function]}
onLoad={null}
onPaste={null}
onScroll={null}
placeholder="{<br>    \\"key\\": any<br>}"
readOnly={false}
scrollMargin={
Array [
0,
0,
0,
0,
]
}
setOptions={Object {}}
showGutter={true}
showPrintMargin={true}
style={Object {}}
tabSize={4}
theme="github"
value=""
width="100%"
wrapEnabled={false}
/>
</div>
<BusyButton
busy={false}
disabled={true}
onClick={[Function]}
title="Generate Visualization"
/>
</div>
`;
| 7,979 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/__snapshots__/Tensorboard.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Tensorboard base component snapshot 1`] = `
<div>
<div>
<div
className=""
>
<WithStyles(FormControl)
className="formControl"
>
<WithStyles(WithFormControlContext(InputLabel))
htmlFor="grouped-select"
>
TF Version
</WithStyles(WithFormControlContext(InputLabel))>
<WithStyles(WithFormControlContext(Select))
className="select"
input={
<WithStyles(Input)
id="grouped-select"
/>
}
onChange={[Function]}
value="2.0.0"
>
<WithStyles(ListSubheader)>
Tensoflow 1.x
</WithStyles(ListSubheader)>
<WithStyles(MenuItem)
value="1.4.0"
>
TensorFlow 1.4.0
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
value="1.5.0"
>
TensorFlow 1.5.0
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
value="1.6.0"
>
TensorFlow 1.6.0
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
value="1.7.0"
>
TensorFlow 1.7.0
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
value="1.8.0"
>
TensorFlow 1.8.0
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
value="1.9.0"
>
TensorFlow 1.9.0
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
value="1.10.0"
>
TensorFlow 1.10.0
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
value="1.11.0"
>
TensorFlow 1.11.0
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
value="1.12.0"
>
TensorFlow 1.12.0
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
value="1.13.2"
>
TensorFlow 1.13.2
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
value="1.14.0"
>
TensorFlow 1.14.0
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
value="1.15.0"
>
TensorFlow 1.15.0
</WithStyles(MenuItem)>
<WithStyles(ListSubheader)>
TensorFlow 2.x
</WithStyles(ListSubheader)>
<WithStyles(MenuItem)
value="2.0.0"
>
TensorFlow 2.0.0
</WithStyles(MenuItem)>
</WithStyles(WithFormControlContext(Select))>
</WithStyles(FormControl)>
</div>
<div>
<BusyButton
busy={false}
className="buttonAction"
disabled={false}
onClick={[Function]}
title="Start Tensorboard"
/>
</div>
</div>
</div>
`;
exports[`Tensorboard shows a link to the tensorboard instance if exists 1`] = `
<div>
<div>
<div
className=""
>
Tensorboard 1.14.0 is running for this output.
</div>
<a
className="unstyled"
href="apis/v1beta1/_proxy/test/address"
rel="noopener noreferrer"
target="_blank"
>
<WithStyles(Button)
className="buttonAction button"
color="primary"
disabled={false}
>
Open Tensorboard
</WithStyles(Button)>
</a>
<div>
<WithStyles(Button)
className="button"
color="default"
disabled={false}
id="delete"
onClick={[Function]}
title="stop tensorboard and delete its instance"
>
Delete Tensorboard
</WithStyles(Button)>
<WithStyles(Dialog)
aria-labelledby="dialog-title"
onClose={[Function]}
open={false}
>
<WithStyles(DialogTitle)
id="dialog-title"
>
Stop Tensorboard 1.14.0?
</WithStyles(DialogTitle)>
<WithStyles(DialogContent)>
<WithStyles(DialogContentText)>
You can stop the current running tensorboard. The tensorboard viewer will also be deleted from your workloads.
</WithStyles(DialogContentText)>
</WithStyles(DialogContent)>
<WithStyles(DialogActions)>
<WithStyles(Button)
autoFocus={true}
className="shortButton"
color="primary"
id="cancel"
onClick={[Function]}
>
Cancel
</WithStyles(Button)>
<BusyButton
busy={false}
className="buttonAction shortButton"
color="primary"
onClick={[Function]}
title="Stop"
/>
</WithStyles(DialogActions)>
</WithStyles(Dialog)>
</div>
</div>
</div>
`;
| 7,980 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/__snapshots__/ROCCurve.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ROCCurve does not break on empty data 1`] = `
<div>
<XYPlot
animation={true}
className=""
classes={
Object {
"root": "root",
}
}
height={520}
onMouseLeave={[Function]}
width={800}
xDomain={null}
>
<VerticalGridLines
attr="x"
direction="vertical"
/>
<HorizontalGridLines
attr="y"
direction="horizontal"
/>
<XAxis
attr="x"
attrAxis="y"
className="axis"
orientation="bottom"
title="fpr"
/>
<YAxis
attr="y"
attrAxis="x"
className="axis"
orientation="left"
title="tpr"
/>
<LineSeries
className=""
color="#ddd"
curve={null}
data={
Array [
Object {
"x": 0,
"y": 0,
},
Object {
"x": 0.01,
"y": 0.01,
},
Object {
"x": 0.02,
"y": 0.02,
},
Object {
"x": 0.03,
"y": 0.03,
},
Object {
"x": 0.04,
"y": 0.04,
},
Object {
"x": 0.05,
"y": 0.05,
},
Object {
"x": 0.06,
"y": 0.06,
},
Object {
"x": 0.07,
"y": 0.07,
},
Object {
"x": 0.08,
"y": 0.08,
},
Object {
"x": 0.09,
"y": 0.09,
},
Object {
"x": 0.1,
"y": 0.1,
},
Object {
"x": 0.11,
"y": 0.11,
},
Object {
"x": 0.12,
"y": 0.12,
},
Object {
"x": 0.13,
"y": 0.13,
},
Object {
"x": 0.14,
"y": 0.14,
},
Object {
"x": 0.15,
"y": 0.15,
},
Object {
"x": 0.16,
"y": 0.16,
},
Object {
"x": 0.17,
"y": 0.17,
},
Object {
"x": 0.18,
"y": 0.18,
},
Object {
"x": 0.19,
"y": 0.19,
},
Object {
"x": 0.2,
"y": 0.2,
},
Object {
"x": 0.21,
"y": 0.21,
},
Object {
"x": 0.22,
"y": 0.22,
},
Object {
"x": 0.23,
"y": 0.23,
},
Object {
"x": 0.24,
"y": 0.24,
},
Object {
"x": 0.25,
"y": 0.25,
},
Object {
"x": 0.26,
"y": 0.26,
},
Object {
"x": 0.27,
"y": 0.27,
},
Object {
"x": 0.28,
"y": 0.28,
},
Object {
"x": 0.29,
"y": 0.29,
},
Object {
"x": 0.3,
"y": 0.3,
},
Object {
"x": 0.31,
"y": 0.31,
},
Object {
"x": 0.32,
"y": 0.32,
},
Object {
"x": 0.33,
"y": 0.33,
},
Object {
"x": 0.34,
"y": 0.34,
},
Object {
"x": 0.35,
"y": 0.35,
},
Object {
"x": 0.36,
"y": 0.36,
},
Object {
"x": 0.37,
"y": 0.37,
},
Object {
"x": 0.38,
"y": 0.38,
},
Object {
"x": 0.39,
"y": 0.39,
},
Object {
"x": 0.4,
"y": 0.4,
},
Object {
"x": 0.41,
"y": 0.41,
},
Object {
"x": 0.42,
"y": 0.42,
},
Object {
"x": 0.43,
"y": 0.43,
},
Object {
"x": 0.44,
"y": 0.44,
},
Object {
"x": 0.45,
"y": 0.45,
},
Object {
"x": 0.46,
"y": 0.46,
},
Object {
"x": 0.47,
"y": 0.47,
},
Object {
"x": 0.48,
"y": 0.48,
},
Object {
"x": 0.49,
"y": 0.49,
},
Object {
"x": 0.5,
"y": 0.5,
},
Object {
"x": 0.51,
"y": 0.51,
},
Object {
"x": 0.52,
"y": 0.52,
},
Object {
"x": 0.53,
"y": 0.53,
},
Object {
"x": 0.54,
"y": 0.54,
},
Object {
"x": 0.55,
"y": 0.55,
},
Object {
"x": 0.56,
"y": 0.56,
},
Object {
"x": 0.57,
"y": 0.57,
},
Object {
"x": 0.58,
"y": 0.58,
},
Object {
"x": 0.59,
"y": 0.59,
},
Object {
"x": 0.6,
"y": 0.6,
},
Object {
"x": 0.61,
"y": 0.61,
},
Object {
"x": 0.62,
"y": 0.62,
},
Object {
"x": 0.63,
"y": 0.63,
},
Object {
"x": 0.64,
"y": 0.64,
},
Object {
"x": 0.65,
"y": 0.65,
},
Object {
"x": 0.66,
"y": 0.66,
},
Object {
"x": 0.67,
"y": 0.67,
},
Object {
"x": 0.68,
"y": 0.68,
},
Object {
"x": 0.69,
"y": 0.69,
},
Object {
"x": 0.7,
"y": 0.7,
},
Object {
"x": 0.71,
"y": 0.71,
},
Object {
"x": 0.72,
"y": 0.72,
},
Object {
"x": 0.73,
"y": 0.73,
},
Object {
"x": 0.74,
"y": 0.74,
},
Object {
"x": 0.75,
"y": 0.75,
},
Object {
"x": 0.76,
"y": 0.76,
},
Object {
"x": 0.77,
"y": 0.77,
},
Object {
"x": 0.78,
"y": 0.78,
},
Object {
"x": 0.79,
"y": 0.79,
},
Object {
"x": 0.8,
"y": 0.8,
},
Object {
"x": 0.81,
"y": 0.81,
},
Object {
"x": 0.82,
"y": 0.82,
},
Object {
"x": 0.83,
"y": 0.83,
},
Object {
"x": 0.84,
"y": 0.84,
},
Object {
"x": 0.85,
"y": 0.85,
},
Object {
"x": 0.86,
"y": 0.86,
},
Object {
"x": 0.87,
"y": 0.87,
},
Object {
"x": 0.88,
"y": 0.88,
},
Object {
"x": 0.89,
"y": 0.89,
},
Object {
"x": 0.9,
"y": 0.9,
},
Object {
"x": 0.91,
"y": 0.91,
},
Object {
"x": 0.92,
"y": 0.92,
},
Object {
"x": 0.93,
"y": 0.93,
},
Object {
"x": 0.94,
"y": 0.94,
},
Object {
"x": 0.95,
"y": 0.95,
},
Object {
"x": 0.96,
"y": 0.96,
},
Object {
"x": 0.97,
"y": 0.97,
},
Object {
"x": 0.98,
"y": 0.98,
},
Object {
"x": 0.99,
"y": 0.99,
},
]
}
getNull={[Function]}
opacity={1}
stack={false}
strokeStyle="dashed"
strokeWidth={1}
style={Object {}}
/>
<LineSeries
className=""
color="#4285f4"
curve="curveBasis"
data={Array []}
getNull={[Function]}
key="0"
onNearestX={[Function]}
opacity={1}
stack={false}
strokeStyle="solid"
strokeWidth={2}
style={Object {}}
/>
<HighlightOverlay
className=""
color="rgb(77, 182, 172)"
enableX={true}
enableY={false}
onBrushEnd={[Function]}
onDrag={[Function]}
opacity={0.3}
/>
<Crosshair
itemsFormat={[Function]}
style={
Object {
"box": Object {},
"line": Object {},
"title": Object {},
}
}
titleFormat={[Function]}
values={
Array [
"",
]
}
>
<div
className="crosshair"
>
<div
className="crosshairLabel"
key="0"
>
threshold (Series #0): undefined
</div>
</div>
</Crosshair>
</XYPlot>
<div
className="flex"
/>
</div>
`;
exports[`ROCCurve does not break on no config 1`] = `
<div>
<XYPlot
animation={true}
className=""
classes={
Object {
"root": "root",
}
}
height={520}
onMouseLeave={[Function]}
width={800}
xDomain={null}
>
<VerticalGridLines
attr="x"
direction="vertical"
/>
<HorizontalGridLines
attr="y"
direction="horizontal"
/>
<XAxis
attr="x"
attrAxis="y"
className="axis"
orientation="bottom"
title="fpr"
/>
<YAxis
attr="y"
attrAxis="x"
className="axis"
orientation="left"
title="tpr"
/>
<LineSeries
className=""
color="#ddd"
curve={null}
data={
Array [
Object {
"x": 0,
"y": 0,
},
Object {
"x": 0.01,
"y": 0.01,
},
Object {
"x": 0.02,
"y": 0.02,
},
Object {
"x": 0.03,
"y": 0.03,
},
Object {
"x": 0.04,
"y": 0.04,
},
Object {
"x": 0.05,
"y": 0.05,
},
Object {
"x": 0.06,
"y": 0.06,
},
Object {
"x": 0.07,
"y": 0.07,
},
Object {
"x": 0.08,
"y": 0.08,
},
Object {
"x": 0.09,
"y": 0.09,
},
Object {
"x": 0.1,
"y": 0.1,
},
Object {
"x": 0.11,
"y": 0.11,
},
Object {
"x": 0.12,
"y": 0.12,
},
Object {
"x": 0.13,
"y": 0.13,
},
Object {
"x": 0.14,
"y": 0.14,
},
Object {
"x": 0.15,
"y": 0.15,
},
Object {
"x": 0.16,
"y": 0.16,
},
Object {
"x": 0.17,
"y": 0.17,
},
Object {
"x": 0.18,
"y": 0.18,
},
Object {
"x": 0.19,
"y": 0.19,
},
Object {
"x": 0.2,
"y": 0.2,
},
Object {
"x": 0.21,
"y": 0.21,
},
Object {
"x": 0.22,
"y": 0.22,
},
Object {
"x": 0.23,
"y": 0.23,
},
Object {
"x": 0.24,
"y": 0.24,
},
Object {
"x": 0.25,
"y": 0.25,
},
Object {
"x": 0.26,
"y": 0.26,
},
Object {
"x": 0.27,
"y": 0.27,
},
Object {
"x": 0.28,
"y": 0.28,
},
Object {
"x": 0.29,
"y": 0.29,
},
Object {
"x": 0.3,
"y": 0.3,
},
Object {
"x": 0.31,
"y": 0.31,
},
Object {
"x": 0.32,
"y": 0.32,
},
Object {
"x": 0.33,
"y": 0.33,
},
Object {
"x": 0.34,
"y": 0.34,
},
Object {
"x": 0.35,
"y": 0.35,
},
Object {
"x": 0.36,
"y": 0.36,
},
Object {
"x": 0.37,
"y": 0.37,
},
Object {
"x": 0.38,
"y": 0.38,
},
Object {
"x": 0.39,
"y": 0.39,
},
Object {
"x": 0.4,
"y": 0.4,
},
Object {
"x": 0.41,
"y": 0.41,
},
Object {
"x": 0.42,
"y": 0.42,
},
Object {
"x": 0.43,
"y": 0.43,
},
Object {
"x": 0.44,
"y": 0.44,
},
Object {
"x": 0.45,
"y": 0.45,
},
Object {
"x": 0.46,
"y": 0.46,
},
Object {
"x": 0.47,
"y": 0.47,
},
Object {
"x": 0.48,
"y": 0.48,
},
Object {
"x": 0.49,
"y": 0.49,
},
Object {
"x": 0.5,
"y": 0.5,
},
Object {
"x": 0.51,
"y": 0.51,
},
Object {
"x": 0.52,
"y": 0.52,
},
Object {
"x": 0.53,
"y": 0.53,
},
Object {
"x": 0.54,
"y": 0.54,
},
Object {
"x": 0.55,
"y": 0.55,
},
Object {
"x": 0.56,
"y": 0.56,
},
Object {
"x": 0.57,
"y": 0.57,
},
Object {
"x": 0.58,
"y": 0.58,
},
Object {
"x": 0.59,
"y": 0.59,
},
Object {
"x": 0.6,
"y": 0.6,
},
Object {
"x": 0.61,
"y": 0.61,
},
Object {
"x": 0.62,
"y": 0.62,
},
Object {
"x": 0.63,
"y": 0.63,
},
Object {
"x": 0.64,
"y": 0.64,
},
Object {
"x": 0.65,
"y": 0.65,
},
Object {
"x": 0.66,
"y": 0.66,
},
Object {
"x": 0.67,
"y": 0.67,
},
Object {
"x": 0.68,
"y": 0.68,
},
Object {
"x": 0.69,
"y": 0.69,
},
Object {
"x": 0.7,
"y": 0.7,
},
Object {
"x": 0.71,
"y": 0.71,
},
Object {
"x": 0.72,
"y": 0.72,
},
Object {
"x": 0.73,
"y": 0.73,
},
Object {
"x": 0.74,
"y": 0.74,
},
Object {
"x": 0.75,
"y": 0.75,
},
Object {
"x": 0.76,
"y": 0.76,
},
Object {
"x": 0.77,
"y": 0.77,
},
Object {
"x": 0.78,
"y": 0.78,
},
Object {
"x": 0.79,
"y": 0.79,
},
Object {
"x": 0.8,
"y": 0.8,
},
Object {
"x": 0.81,
"y": 0.81,
},
Object {
"x": 0.82,
"y": 0.82,
},
Object {
"x": 0.83,
"y": 0.83,
},
Object {
"x": 0.84,
"y": 0.84,
},
Object {
"x": 0.85,
"y": 0.85,
},
Object {
"x": 0.86,
"y": 0.86,
},
Object {
"x": 0.87,
"y": 0.87,
},
Object {
"x": 0.88,
"y": 0.88,
},
Object {
"x": 0.89,
"y": 0.89,
},
Object {
"x": 0.9,
"y": 0.9,
},
Object {
"x": 0.91,
"y": 0.91,
},
Object {
"x": 0.92,
"y": 0.92,
},
Object {
"x": 0.93,
"y": 0.93,
},
Object {
"x": 0.94,
"y": 0.94,
},
Object {
"x": 0.95,
"y": 0.95,
},
Object {
"x": 0.96,
"y": 0.96,
},
Object {
"x": 0.97,
"y": 0.97,
},
Object {
"x": 0.98,
"y": 0.98,
},
Object {
"x": 0.99,
"y": 0.99,
},
]
}
getNull={[Function]}
opacity={1}
stack={false}
strokeStyle="dashed"
strokeWidth={1}
style={Object {}}
/>
<HighlightOverlay
className=""
color="rgb(77, 182, 172)"
enableX={true}
enableY={false}
onBrushEnd={[Function]}
onDrag={[Function]}
opacity={0.3}
/>
<Crosshair
itemsFormat={[Function]}
style={
Object {
"box": Object {},
"line": Object {},
"title": Object {},
}
}
titleFormat={[Function]}
values={Array []}
>
<div
className="crosshair"
/>
</Crosshair>
</XYPlot>
<div
className="flex"
/>
</div>
`;
exports[`ROCCurve renders a simple ROC curve given one config 1`] = `
<div>
<XYPlot
animation={true}
className=""
classes={
Object {
"root": "root",
}
}
height={520}
onMouseLeave={[Function]}
width={800}
xDomain={null}
>
<VerticalGridLines
attr="x"
direction="vertical"
/>
<HorizontalGridLines
attr="y"
direction="horizontal"
/>
<XAxis
attr="x"
attrAxis="y"
className="axis"
orientation="bottom"
title="fpr"
/>
<YAxis
attr="y"
attrAxis="x"
className="axis"
orientation="left"
title="tpr"
/>
<LineSeries
className=""
color="#ddd"
curve={null}
data={
Array [
Object {
"x": 0,
"y": 0,
},
Object {
"x": 0.01,
"y": 0.01,
},
Object {
"x": 0.02,
"y": 0.02,
},
Object {
"x": 0.03,
"y": 0.03,
},
Object {
"x": 0.04,
"y": 0.04,
},
Object {
"x": 0.05,
"y": 0.05,
},
Object {
"x": 0.06,
"y": 0.06,
},
Object {
"x": 0.07,
"y": 0.07,
},
Object {
"x": 0.08,
"y": 0.08,
},
Object {
"x": 0.09,
"y": 0.09,
},
Object {
"x": 0.1,
"y": 0.1,
},
Object {
"x": 0.11,
"y": 0.11,
},
Object {
"x": 0.12,
"y": 0.12,
},
Object {
"x": 0.13,
"y": 0.13,
},
Object {
"x": 0.14,
"y": 0.14,
},
Object {
"x": 0.15,
"y": 0.15,
},
Object {
"x": 0.16,
"y": 0.16,
},
Object {
"x": 0.17,
"y": 0.17,
},
Object {
"x": 0.18,
"y": 0.18,
},
Object {
"x": 0.19,
"y": 0.19,
},
Object {
"x": 0.2,
"y": 0.2,
},
Object {
"x": 0.21,
"y": 0.21,
},
Object {
"x": 0.22,
"y": 0.22,
},
Object {
"x": 0.23,
"y": 0.23,
},
Object {
"x": 0.24,
"y": 0.24,
},
Object {
"x": 0.25,
"y": 0.25,
},
Object {
"x": 0.26,
"y": 0.26,
},
Object {
"x": 0.27,
"y": 0.27,
},
Object {
"x": 0.28,
"y": 0.28,
},
Object {
"x": 0.29,
"y": 0.29,
},
Object {
"x": 0.3,
"y": 0.3,
},
Object {
"x": 0.31,
"y": 0.31,
},
Object {
"x": 0.32,
"y": 0.32,
},
Object {
"x": 0.33,
"y": 0.33,
},
Object {
"x": 0.34,
"y": 0.34,
},
Object {
"x": 0.35,
"y": 0.35,
},
Object {
"x": 0.36,
"y": 0.36,
},
Object {
"x": 0.37,
"y": 0.37,
},
Object {
"x": 0.38,
"y": 0.38,
},
Object {
"x": 0.39,
"y": 0.39,
},
Object {
"x": 0.4,
"y": 0.4,
},
Object {
"x": 0.41,
"y": 0.41,
},
Object {
"x": 0.42,
"y": 0.42,
},
Object {
"x": 0.43,
"y": 0.43,
},
Object {
"x": 0.44,
"y": 0.44,
},
Object {
"x": 0.45,
"y": 0.45,
},
Object {
"x": 0.46,
"y": 0.46,
},
Object {
"x": 0.47,
"y": 0.47,
},
Object {
"x": 0.48,
"y": 0.48,
},
Object {
"x": 0.49,
"y": 0.49,
},
Object {
"x": 0.5,
"y": 0.5,
},
Object {
"x": 0.51,
"y": 0.51,
},
Object {
"x": 0.52,
"y": 0.52,
},
Object {
"x": 0.53,
"y": 0.53,
},
Object {
"x": 0.54,
"y": 0.54,
},
Object {
"x": 0.55,
"y": 0.55,
},
Object {
"x": 0.56,
"y": 0.56,
},
Object {
"x": 0.57,
"y": 0.57,
},
Object {
"x": 0.58,
"y": 0.58,
},
Object {
"x": 0.59,
"y": 0.59,
},
Object {
"x": 0.6,
"y": 0.6,
},
Object {
"x": 0.61,
"y": 0.61,
},
Object {
"x": 0.62,
"y": 0.62,
},
Object {
"x": 0.63,
"y": 0.63,
},
Object {
"x": 0.64,
"y": 0.64,
},
Object {
"x": 0.65,
"y": 0.65,
},
Object {
"x": 0.66,
"y": 0.66,
},
Object {
"x": 0.67,
"y": 0.67,
},
Object {
"x": 0.68,
"y": 0.68,
},
Object {
"x": 0.69,
"y": 0.69,
},
Object {
"x": 0.7,
"y": 0.7,
},
Object {
"x": 0.71,
"y": 0.71,
},
Object {
"x": 0.72,
"y": 0.72,
},
Object {
"x": 0.73,
"y": 0.73,
},
Object {
"x": 0.74,
"y": 0.74,
},
Object {
"x": 0.75,
"y": 0.75,
},
Object {
"x": 0.76,
"y": 0.76,
},
Object {
"x": 0.77,
"y": 0.77,
},
Object {
"x": 0.78,
"y": 0.78,
},
Object {
"x": 0.79,
"y": 0.79,
},
Object {
"x": 0.8,
"y": 0.8,
},
Object {
"x": 0.81,
"y": 0.81,
},
Object {
"x": 0.82,
"y": 0.82,
},
Object {
"x": 0.83,
"y": 0.83,
},
Object {
"x": 0.84,
"y": 0.84,
},
Object {
"x": 0.85,
"y": 0.85,
},
Object {
"x": 0.86,
"y": 0.86,
},
Object {
"x": 0.87,
"y": 0.87,
},
Object {
"x": 0.88,
"y": 0.88,
},
Object {
"x": 0.89,
"y": 0.89,
},
Object {
"x": 0.9,
"y": 0.9,
},
Object {
"x": 0.91,
"y": 0.91,
},
Object {
"x": 0.92,
"y": 0.92,
},
Object {
"x": 0.93,
"y": 0.93,
},
Object {
"x": 0.94,
"y": 0.94,
},
Object {
"x": 0.95,
"y": 0.95,
},
Object {
"x": 0.96,
"y": 0.96,
},
Object {
"x": 0.97,
"y": 0.97,
},
Object {
"x": 0.98,
"y": 0.98,
},
Object {
"x": 0.99,
"y": 0.99,
},
]
}
getNull={[Function]}
opacity={1}
stack={false}
strokeStyle="dashed"
strokeWidth={1}
style={Object {}}
/>
<LineSeries
className=""
color="#4285f4"
curve="curveBasis"
data={
Array [
Object {
"label": "1",
"x": 0,
"y": 0,
},
Object {
"label": "2",
"x": 0.2,
"y": 0.3,
},
Object {
"label": "3",
"x": 0.5,
"y": 0.7,
},
Object {
"label": "4",
"x": 0.9,
"y": 0.9,
},
Object {
"label": "5",
"x": 1,
"y": 1,
},
]
}
getNull={[Function]}
key="0"
onNearestX={[Function]}
opacity={1}
stack={false}
strokeStyle="solid"
strokeWidth={2}
style={Object {}}
/>
<HighlightOverlay
className=""
color="rgb(77, 182, 172)"
enableX={true}
enableY={false}
onBrushEnd={[Function]}
onDrag={[Function]}
opacity={0.3}
/>
<Crosshair
itemsFormat={[Function]}
style={
Object {
"box": Object {},
"line": Object {},
"title": Object {},
}
}
titleFormat={[Function]}
values={
Array [
"",
]
}
>
<div
className="crosshair"
>
<div
className="crosshairLabel"
key="0"
>
threshold (Series #0): undefined
</div>
</div>
</Crosshair>
</XYPlot>
<div
className="flex"
/>
</div>
`;
exports[`ROCCurve renders an ROC curve using three configs 1`] = `
<div>
<XYPlot
animation={true}
className=""
classes={
Object {
"root": "root",
}
}
height={520}
onMouseLeave={[Function]}
width={800}
xDomain={null}
>
<VerticalGridLines
attr="x"
direction="vertical"
/>
<HorizontalGridLines
attr="y"
direction="horizontal"
/>
<XAxis
attr="x"
attrAxis="y"
className="axis"
orientation="bottom"
title="fpr"
/>
<YAxis
attr="y"
attrAxis="x"
className="axis"
orientation="left"
title="tpr"
/>
<LineSeries
className=""
color="#ddd"
curve={null}
data={
Array [
Object {
"x": 0,
"y": 0,
},
Object {
"x": 0.01,
"y": 0.01,
},
Object {
"x": 0.02,
"y": 0.02,
},
Object {
"x": 0.03,
"y": 0.03,
},
Object {
"x": 0.04,
"y": 0.04,
},
Object {
"x": 0.05,
"y": 0.05,
},
Object {
"x": 0.06,
"y": 0.06,
},
Object {
"x": 0.07,
"y": 0.07,
},
Object {
"x": 0.08,
"y": 0.08,
},
Object {
"x": 0.09,
"y": 0.09,
},
Object {
"x": 0.1,
"y": 0.1,
},
Object {
"x": 0.11,
"y": 0.11,
},
Object {
"x": 0.12,
"y": 0.12,
},
Object {
"x": 0.13,
"y": 0.13,
},
Object {
"x": 0.14,
"y": 0.14,
},
Object {
"x": 0.15,
"y": 0.15,
},
Object {
"x": 0.16,
"y": 0.16,
},
Object {
"x": 0.17,
"y": 0.17,
},
Object {
"x": 0.18,
"y": 0.18,
},
Object {
"x": 0.19,
"y": 0.19,
},
Object {
"x": 0.2,
"y": 0.2,
},
Object {
"x": 0.21,
"y": 0.21,
},
Object {
"x": 0.22,
"y": 0.22,
},
Object {
"x": 0.23,
"y": 0.23,
},
Object {
"x": 0.24,
"y": 0.24,
},
Object {
"x": 0.25,
"y": 0.25,
},
Object {
"x": 0.26,
"y": 0.26,
},
Object {
"x": 0.27,
"y": 0.27,
},
Object {
"x": 0.28,
"y": 0.28,
},
Object {
"x": 0.29,
"y": 0.29,
},
Object {
"x": 0.3,
"y": 0.3,
},
Object {
"x": 0.31,
"y": 0.31,
},
Object {
"x": 0.32,
"y": 0.32,
},
Object {
"x": 0.33,
"y": 0.33,
},
Object {
"x": 0.34,
"y": 0.34,
},
Object {
"x": 0.35,
"y": 0.35,
},
Object {
"x": 0.36,
"y": 0.36,
},
Object {
"x": 0.37,
"y": 0.37,
},
Object {
"x": 0.38,
"y": 0.38,
},
Object {
"x": 0.39,
"y": 0.39,
},
Object {
"x": 0.4,
"y": 0.4,
},
Object {
"x": 0.41,
"y": 0.41,
},
Object {
"x": 0.42,
"y": 0.42,
},
Object {
"x": 0.43,
"y": 0.43,
},
Object {
"x": 0.44,
"y": 0.44,
},
Object {
"x": 0.45,
"y": 0.45,
},
Object {
"x": 0.46,
"y": 0.46,
},
Object {
"x": 0.47,
"y": 0.47,
},
Object {
"x": 0.48,
"y": 0.48,
},
Object {
"x": 0.49,
"y": 0.49,
},
Object {
"x": 0.5,
"y": 0.5,
},
Object {
"x": 0.51,
"y": 0.51,
},
Object {
"x": 0.52,
"y": 0.52,
},
Object {
"x": 0.53,
"y": 0.53,
},
Object {
"x": 0.54,
"y": 0.54,
},
Object {
"x": 0.55,
"y": 0.55,
},
Object {
"x": 0.56,
"y": 0.56,
},
Object {
"x": 0.57,
"y": 0.57,
},
Object {
"x": 0.58,
"y": 0.58,
},
Object {
"x": 0.59,
"y": 0.59,
},
Object {
"x": 0.6,
"y": 0.6,
},
Object {
"x": 0.61,
"y": 0.61,
},
Object {
"x": 0.62,
"y": 0.62,
},
Object {
"x": 0.63,
"y": 0.63,
},
Object {
"x": 0.64,
"y": 0.64,
},
Object {
"x": 0.65,
"y": 0.65,
},
Object {
"x": 0.66,
"y": 0.66,
},
Object {
"x": 0.67,
"y": 0.67,
},
Object {
"x": 0.68,
"y": 0.68,
},
Object {
"x": 0.69,
"y": 0.69,
},
Object {
"x": 0.7,
"y": 0.7,
},
Object {
"x": 0.71,
"y": 0.71,
},
Object {
"x": 0.72,
"y": 0.72,
},
Object {
"x": 0.73,
"y": 0.73,
},
Object {
"x": 0.74,
"y": 0.74,
},
Object {
"x": 0.75,
"y": 0.75,
},
Object {
"x": 0.76,
"y": 0.76,
},
Object {
"x": 0.77,
"y": 0.77,
},
Object {
"x": 0.78,
"y": 0.78,
},
Object {
"x": 0.79,
"y": 0.79,
},
Object {
"x": 0.8,
"y": 0.8,
},
Object {
"x": 0.81,
"y": 0.81,
},
Object {
"x": 0.82,
"y": 0.82,
},
Object {
"x": 0.83,
"y": 0.83,
},
Object {
"x": 0.84,
"y": 0.84,
},
Object {
"x": 0.85,
"y": 0.85,
},
Object {
"x": 0.86,
"y": 0.86,
},
Object {
"x": 0.87,
"y": 0.87,
},
Object {
"x": 0.88,
"y": 0.88,
},
Object {
"x": 0.89,
"y": 0.89,
},
Object {
"x": 0.9,
"y": 0.9,
},
Object {
"x": 0.91,
"y": 0.91,
},
Object {
"x": 0.92,
"y": 0.92,
},
Object {
"x": 0.93,
"y": 0.93,
},
Object {
"x": 0.94,
"y": 0.94,
},
Object {
"x": 0.95,
"y": 0.95,
},
Object {
"x": 0.96,
"y": 0.96,
},
Object {
"x": 0.97,
"y": 0.97,
},
Object {
"x": 0.98,
"y": 0.98,
},
Object {
"x": 0.99,
"y": 0.99,
},
]
}
getNull={[Function]}
opacity={1}
stack={false}
strokeStyle="dashed"
strokeWidth={1}
style={Object {}}
/>
<LineSeries
className=""
color="#4285f4"
curve="curveBasis"
data={
Array [
Object {
"label": "1",
"x": 0,
"y": 0,
},
Object {
"label": "2",
"x": 0.2,
"y": 0.3,
},
Object {
"label": "3",
"x": 0.5,
"y": 0.7,
},
Object {
"label": "4",
"x": 0.9,
"y": 0.9,
},
Object {
"label": "5",
"x": 1,
"y": 1,
},
]
}
getNull={[Function]}
key="0"
onNearestX={[Function]}
opacity={1}
stack={false}
strokeStyle="solid"
strokeWidth={2}
style={Object {}}
/>
<LineSeries
className=""
color="#efb4a3"
curve="curveBasis"
data={
Array [
Object {
"label": "1",
"x": 0,
"y": 0,
},
Object {
"label": "2",
"x": 0.2,
"y": 0.3,
},
Object {
"label": "3",
"x": 0.5,
"y": 0.7,
},
Object {
"label": "4",
"x": 0.9,
"y": 0.9,
},
Object {
"label": "5",
"x": 1,
"y": 1,
},
]
}
getNull={[Function]}
key="1"
onNearestX={[Function]}
opacity={1}
stack={false}
strokeStyle="solid"
strokeWidth={2}
style={Object {}}
/>
<LineSeries
className=""
color="#684e91"
curve="curveBasis"
data={
Array [
Object {
"label": "1",
"x": 0,
"y": 0,
},
Object {
"label": "2",
"x": 0.2,
"y": 0.3,
},
Object {
"label": "3",
"x": 0.5,
"y": 0.7,
},
Object {
"label": "4",
"x": 0.9,
"y": 0.9,
},
Object {
"label": "5",
"x": 1,
"y": 1,
},
]
}
getNull={[Function]}
key="2"
onNearestX={[Function]}
opacity={1}
stack={false}
strokeStyle="solid"
strokeWidth={2}
style={Object {}}
/>
<HighlightOverlay
className=""
color="rgb(77, 182, 172)"
enableX={true}
enableY={false}
onBrushEnd={[Function]}
onDrag={[Function]}
opacity={0.3}
/>
<Crosshair
itemsFormat={[Function]}
style={
Object {
"box": Object {},
"line": Object {},
"title": Object {},
}
}
titleFormat={[Function]}
values={
Array [
"",
"",
"",
]
}
>
<div
className="crosshair"
>
<div
className="crosshairLabel"
key="0"
>
threshold (Series #0): undefined
</div>
<div
className="crosshairLabel"
key="1"
>
threshold (Series #1): undefined
</div>
<div
className="crosshairLabel"
key="2"
>
threshold (Series #2): undefined
</div>
</div>
</Crosshair>
</XYPlot>
<div
className="flex"
>
<div
style={
Object {
"flexGrow": 1,
}
}
>
<DiscreteColorLegendItem
className=""
colors={
Array [
"#12939A",
"#79C7E3",
"#1A3177",
"#FF9833",
"#EF5D28",
]
}
items={
Array [
Object {
"color": "#4285f4",
"title": "Series #1",
},
Object {
"color": "#efb4a3",
"title": "Series #2",
},
Object {
"color": "#684e91",
"title": "Series #3",
},
]
}
orientation="horizontal"
/>
</div>
</div>
</div>
`;
| 7,981 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/__snapshots__/ViewerContainer.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ViewerContainer does not break on empty configs 1`] = `""`;
exports[`ViewerContainer renders a viewer of type CONFUSION_MATRIX 1`] = `
<ConfusionMatrix
configs={
Array [
Object {
"type": "confusion_matrix",
},
]
}
/>
`;
exports[`ViewerContainer renders a viewer of type MARKDOWN 1`] = `
<MarkdownViewer
configs={
Array [
Object {
"type": "markdown",
},
]
}
/>
`;
exports[`ViewerContainer renders a viewer of type ROC 1`] = `
<ROCCurve
configs={
Array [
Object {
"type": "roc",
},
]
}
/>
`;
exports[`ViewerContainer renders a viewer of type TABLE 1`] = `
<PagedTable
configs={
Array [
Object {
"type": "table",
},
]
}
/>
`;
exports[`ViewerContainer renders a viewer of type TENSORBOARD 1`] = `
<TensorboardViewer
configs={
Array [
Object {
"type": "tensorboard",
},
]
}
/>
`;
exports[`ViewerContainer renders a viewer of type VISUALIZATION_CREATOR 1`] = `
<VisualizationCreator
configs={
Array [
Object {
"type": "visualization-creator",
},
]
}
/>
`;
exports[`ViewerContainer renders a viewer of type WEB_APP 1`] = `
<HTMLViewer
configs={
Array [
Object {
"type": "web-app",
},
]
}
/>
`;
| 7,982 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/viewers/__snapshots__/HTMLViewer.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`HTMLViewer does not break on empty data 1`] = `
<HTMLViewer
configs={Array []}
/>
`;
exports[`HTMLViewer renders a smaller snapshot version 1`] = `
<HTMLViewer
configs={
Array [
Object {
"htmlContent": "<html><body><div>Hello World!</div></body></html>",
"type": "web-app",
},
]
}
maxDimension={100}
>
<iframe
className="iframe"
sandbox="allow-scripts"
src="about:blank"
/>
</HTMLViewer>
`;
exports[`HTMLViewer renders some basic HTML 1`] = `
<HTMLViewer
configs={
Array [
Object {
"htmlContent": "<html><body><div>Hello World!</div></body></html>",
"type": "web-app",
},
]
}
>
<iframe
className="iframe"
sandbox="allow-scripts"
src="about:blank"
/>
</HTMLViewer>
`;
| 7,983 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/__snapshots__/SideNav.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`SideNav populates the display build information using the response from the healthz endpoint 1`] = `
<div
className="root flexColumn noShrink"
id="sideNav"
>
<div
style={
Object {
"flexGrow": 1,
}
}
>
<div
className="indicator"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Pipeline List"
>
<Link
className="unstyled"
id="pipelinesBtn"
replace={false}
to="/pipelines"
>
<WithStyles(Button)
className="button active"
>
<PipelinesIcon
color="#0d6de7"
/>
<span
className="label"
>
Pipelines
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Experiment List"
>
<Link
className="unstyled"
id="experimentsBtn"
replace={false}
to="/experiments"
>
<WithStyles(Button)
className="button"
>
<ExperimentsIcon
color="#9aa0a6"
/>
<span
className="label"
>
Experiments
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Artifacts List"
>
<Link
className="unstyled"
id="artifactsBtn"
replace={false}
to="/artifacts"
>
<WithStyles(Button)
className="button"
>
<pure(BubbleChartIcon) />
<span
className="label"
>
Artifacts
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Executions List"
>
<Link
className="unstyled"
id="executionsBtn"
replace={false}
to="/executions"
>
<WithStyles(Button)
className="button"
>
<pure(PlayArrowIcon) />
<span
className="label"
>
Executions
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Archive"
>
<Link
className="unstyled"
id="archiveBtn"
replace={false}
to="/archive/runs"
>
<WithStyles(Button)
className="button"
>
<pure(ArchiveIcon)
style={
Object {
"height": 20,
"width": 20,
}
}
/>
<span
className="label"
>
Archive
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Documentation"
to="https://www.kubeflow.org/docs/pipelines/"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Github Repo"
to="https://github.com/kubeflow/pipelines"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="AI Hub Samples"
to="https://aihub.cloud.google.com/u/0/s?category=pipeline"
/>
<hr
className="separator"
/>
<WithStyles(IconButton)
className="chevron"
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
</div>
<div
className="infoVisible"
>
<WithStyles(Tooltip)
enterDelay={300}
placement="top-start"
title="Build date: 10/23/2018, Commit hash: 0a7b9e3"
>
<div
className="envMetadata"
>
<span>
Version:
</span>
<a
className="link unstyled"
href="https://www.github.com/kubeflow/pipelines/commit/0a7b9e38f2b9bcdef4bbf3234d971e1635b50cd5"
rel="noopener"
target="_blank"
>
1.0.0
</a>
</div>
</WithStyles(Tooltip)>
<WithStyles(Tooltip)
enterDelay={300}
placement="top-start"
title="Report an Issue"
>
<div
className="envMetadata"
>
<a
className="link unstyled"
href="https://github.com/kubeflow/pipelines/issues/new?template=BUG_REPORT.md"
rel="noopener"
target="_blank"
>
Report an Issue
</a>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
exports[`SideNav renders Pipelines as active page 1`] = `
<div
className="root flexColumn noShrink"
id="sideNav"
>
<div
style={
Object {
"flexGrow": 1,
}
}
>
<div
className="indicator"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Pipeline List"
>
<Link
className="unstyled"
id="pipelinesBtn"
replace={false}
to="/pipelines"
>
<WithStyles(Button)
className="button active"
>
<PipelinesIcon
color="#0d6de7"
/>
<span
className="label"
>
Pipelines
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Experiment List"
>
<Link
className="unstyled"
id="experimentsBtn"
replace={false}
to="/experiments"
>
<WithStyles(Button)
className="button"
>
<ExperimentsIcon
color="#9aa0a6"
/>
<span
className="label"
>
Experiments
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Artifacts List"
>
<Link
className="unstyled"
id="artifactsBtn"
replace={false}
to="/artifacts"
>
<WithStyles(Button)
className="button"
>
<pure(BubbleChartIcon) />
<span
className="label"
>
Artifacts
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Executions List"
>
<Link
className="unstyled"
id="executionsBtn"
replace={false}
to="/executions"
>
<WithStyles(Button)
className="button"
>
<pure(PlayArrowIcon) />
<span
className="label"
>
Executions
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Archive"
>
<Link
className="unstyled"
id="archiveBtn"
replace={false}
to="/archive/runs"
>
<WithStyles(Button)
className="button"
>
<pure(ArchiveIcon)
style={
Object {
"height": 20,
"width": 20,
}
}
/>
<span
className="label"
>
Archive
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Documentation"
to="https://www.kubeflow.org/docs/pipelines/"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Github Repo"
to="https://github.com/kubeflow/pipelines"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="AI Hub Samples"
to="https://aihub.cloud.google.com/u/0/s?category=pipeline"
/>
<hr
className="separator"
/>
<WithStyles(IconButton)
className="chevron"
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
</div>
<div
className="infoVisible"
>
<WithStyles(Tooltip)
enterDelay={300}
placement="top-start"
title="Report an Issue"
>
<div
className="envMetadata"
>
<a
className="link unstyled"
href="https://github.com/kubeflow/pipelines/issues/new?template=BUG_REPORT.md"
rel="noopener"
target="_blank"
>
Report an Issue
</a>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
exports[`SideNav renders Pipelines as active when on PipelineDetails page 1`] = `
<div
className="root flexColumn noShrink"
id="sideNav"
>
<div
style={
Object {
"flexGrow": 1,
}
}
>
<div
className="indicator"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Pipeline List"
>
<Link
className="unstyled"
id="pipelinesBtn"
replace={false}
to="/pipelines"
>
<WithStyles(Button)
className="button active"
>
<PipelinesIcon
color="#0d6de7"
/>
<span
className="label"
>
Pipelines
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Experiment List"
>
<Link
className="unstyled"
id="experimentsBtn"
replace={false}
to="/experiments"
>
<WithStyles(Button)
className="button"
>
<ExperimentsIcon
color="#9aa0a6"
/>
<span
className="label"
>
Experiments
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Artifacts List"
>
<Link
className="unstyled"
id="artifactsBtn"
replace={false}
to="/artifacts"
>
<WithStyles(Button)
className="button"
>
<pure(BubbleChartIcon) />
<span
className="label"
>
Artifacts
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Executions List"
>
<Link
className="unstyled"
id="executionsBtn"
replace={false}
to="/executions"
>
<WithStyles(Button)
className="button"
>
<pure(PlayArrowIcon) />
<span
className="label"
>
Executions
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Archive"
>
<Link
className="unstyled"
id="archiveBtn"
replace={false}
to="/archive/runs"
>
<WithStyles(Button)
className="button"
>
<pure(ArchiveIcon)
style={
Object {
"height": 20,
"width": 20,
}
}
/>
<span
className="label"
>
Archive
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Documentation"
to="https://www.kubeflow.org/docs/pipelines/"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Github Repo"
to="https://github.com/kubeflow/pipelines"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="AI Hub Samples"
to="https://aihub.cloud.google.com/u/0/s?category=pipeline"
/>
<hr
className="separator"
/>
<WithStyles(IconButton)
className="chevron"
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
</div>
<div
className="infoVisible"
>
<WithStyles(Tooltip)
enterDelay={300}
placement="top-start"
title="Report an Issue"
>
<div
className="envMetadata"
>
<a
className="link unstyled"
href="https://github.com/kubeflow/pipelines/issues/new?template=BUG_REPORT.md"
rel="noopener"
target="_blank"
>
Report an Issue
</a>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
exports[`SideNav renders collapsed state 1`] = `
<div
className="root flexColumn noShrink collapsedRoot"
id="sideNav"
>
<div
style={
Object {
"flexGrow": 1,
}
}
>
<div
className="indicator"
/>
<WithStyles(Tooltip)
disableFocusListener={false}
disableHoverListener={false}
disableTouchListener={false}
enterDelay={300}
placement="right-start"
title="Pipeline List"
>
<Link
className="unstyled"
id="pipelinesBtn"
replace={false}
to="/pipelines"
>
<WithStyles(Button)
className="button active collapsedButton"
>
<PipelinesIcon
color="#0d6de7"
/>
<span
className="collapsedLabel label"
>
Pipelines
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={false}
disableHoverListener={false}
disableTouchListener={false}
enterDelay={300}
placement="right-start"
title="Experiment List"
>
<Link
className="unstyled"
id="experimentsBtn"
replace={false}
to="/experiments"
>
<WithStyles(Button)
className="button collapsedButton"
>
<ExperimentsIcon
color="#9aa0a6"
/>
<span
className="collapsedLabel label"
>
Experiments
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={false}
disableHoverListener={false}
disableTouchListener={false}
enterDelay={300}
placement="right-start"
title="Artifacts List"
>
<Link
className="unstyled"
id="artifactsBtn"
replace={false}
to="/artifacts"
>
<WithStyles(Button)
className="button collapsedButton"
>
<pure(BubbleChartIcon) />
<span
className="collapsedLabel label"
>
Artifacts
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={false}
disableHoverListener={false}
disableTouchListener={false}
enterDelay={300}
placement="right-start"
title="Executions List"
>
<Link
className="unstyled"
id="executionsBtn"
replace={false}
to="/executions"
>
<WithStyles(Button)
className="button collapsedButton"
>
<pure(PlayArrowIcon) />
<span
className="collapsedLabel label"
>
Executions
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator collapsedSeparator"
/>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={false}
disableHoverListener={false}
disableTouchListener={false}
enterDelay={300}
placement="right-start"
title="Archive"
>
<Link
className="unstyled"
id="archiveBtn"
replace={false}
to="/archive/runs"
>
<WithStyles(Button)
className="button collapsedButton"
>
<pure(ArchiveIcon)
style={
Object {
"height": 20,
"width": 20,
}
}
/>
<span
className="collapsedLabel label"
>
Archive
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator collapsedSeparator"
/>
<ExternalUri
collapsed={true}
icon={[Function]}
title="Documentation"
to="https://www.kubeflow.org/docs/pipelines/"
/>
<ExternalUri
collapsed={true}
icon={[Function]}
title="Github Repo"
to="https://github.com/kubeflow/pipelines"
/>
<ExternalUri
collapsed={true}
icon={[Function]}
title="AI Hub Samples"
to="https://aihub.cloud.google.com/u/0/s?category=pipeline"
/>
<hr
className="separator collapsedSeparator"
/>
<WithStyles(IconButton)
className="chevron collapsedChevron"
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
</div>
<div
className="infoHidden"
>
<WithStyles(Tooltip)
enterDelay={300}
placement="top-start"
title="Report an Issue"
>
<div
className="envMetadata"
>
<a
className="link unstyled"
href="https://github.com/kubeflow/pipelines/issues/new?template=BUG_REPORT.md"
rel="noopener"
target="_blank"
>
Report an Issue
</a>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
exports[`SideNav renders expanded state 1`] = `
<div
className="root flexColumn noShrink"
id="sideNav"
>
<div
style={
Object {
"flexGrow": 1,
}
}
>
<div
className="indicator"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Pipeline List"
>
<Link
className="unstyled"
id="pipelinesBtn"
replace={false}
to="/pipelines"
>
<WithStyles(Button)
className="button active"
>
<PipelinesIcon
color="#0d6de7"
/>
<span
className="label"
>
Pipelines
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Experiment List"
>
<Link
className="unstyled"
id="experimentsBtn"
replace={false}
to="/experiments"
>
<WithStyles(Button)
className="button"
>
<ExperimentsIcon
color="#9aa0a6"
/>
<span
className="label"
>
Experiments
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Artifacts List"
>
<Link
className="unstyled"
id="artifactsBtn"
replace={false}
to="/artifacts"
>
<WithStyles(Button)
className="button"
>
<pure(BubbleChartIcon) />
<span
className="label"
>
Artifacts
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Executions List"
>
<Link
className="unstyled"
id="executionsBtn"
replace={false}
to="/executions"
>
<WithStyles(Button)
className="button"
>
<pure(PlayArrowIcon) />
<span
className="label"
>
Executions
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Archive"
>
<Link
className="unstyled"
id="archiveBtn"
replace={false}
to="/archive/runs"
>
<WithStyles(Button)
className="button"
>
<pure(ArchiveIcon)
style={
Object {
"height": 20,
"width": 20,
}
}
/>
<span
className="label"
>
Archive
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Documentation"
to="https://www.kubeflow.org/docs/pipelines/"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Github Repo"
to="https://github.com/kubeflow/pipelines"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="AI Hub Samples"
to="https://aihub.cloud.google.com/u/0/s?category=pipeline"
/>
<hr
className="separator"
/>
<WithStyles(IconButton)
className="chevron"
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
</div>
<div
className="infoVisible"
>
<WithStyles(Tooltip)
enterDelay={300}
placement="top-start"
title="Report an Issue"
>
<div
className="envMetadata"
>
<a
className="link unstyled"
href="https://github.com/kubeflow/pipelines/issues/new?template=BUG_REPORT.md"
rel="noopener"
target="_blank"
>
Report an Issue
</a>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
exports[`SideNav renders experiments as active page 1`] = `
<div
className="root flexColumn noShrink"
id="sideNav"
>
<div
style={
Object {
"flexGrow": 1,
}
}
>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Pipeline List"
>
<Link
className="unstyled"
id="pipelinesBtn"
replace={false}
to="/pipelines"
>
<WithStyles(Button)
className="button"
>
<PipelinesIcon
color="#9aa0a6"
/>
<span
className="label"
>
Pipelines
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Experiment List"
>
<Link
className="unstyled"
id="experimentsBtn"
replace={false}
to="/experiments"
>
<WithStyles(Button)
className="button active"
>
<ExperimentsIcon
color="#0d6de7"
/>
<span
className="label"
>
Experiments
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Artifacts List"
>
<Link
className="unstyled"
id="artifactsBtn"
replace={false}
to="/artifacts"
>
<WithStyles(Button)
className="button"
>
<pure(BubbleChartIcon) />
<span
className="label"
>
Artifacts
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Executions List"
>
<Link
className="unstyled"
id="executionsBtn"
replace={false}
to="/executions"
>
<WithStyles(Button)
className="button"
>
<pure(PlayArrowIcon) />
<span
className="label"
>
Executions
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Archive"
>
<Link
className="unstyled"
id="archiveBtn"
replace={false}
to="/archive/runs"
>
<WithStyles(Button)
className="button"
>
<pure(ArchiveIcon)
style={
Object {
"height": 20,
"width": 20,
}
}
/>
<span
className="label"
>
Archive
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Documentation"
to="https://www.kubeflow.org/docs/pipelines/"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Github Repo"
to="https://github.com/kubeflow/pipelines"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="AI Hub Samples"
to="https://aihub.cloud.google.com/u/0/s?category=pipeline"
/>
<hr
className="separator"
/>
<WithStyles(IconButton)
className="chevron"
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
</div>
<div
className="infoVisible"
>
<WithStyles(Tooltip)
enterDelay={300}
placement="top-start"
title="Report an Issue"
>
<div
className="envMetadata"
>
<a
className="link unstyled"
href="https://github.com/kubeflow/pipelines/issues/new?template=BUG_REPORT.md"
rel="noopener"
target="_blank"
>
Report an Issue
</a>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
exports[`SideNav renders experiments as active page when on AllRuns page 1`] = `
<div
className="root flexColumn noShrink"
id="sideNav"
>
<div
style={
Object {
"flexGrow": 1,
}
}
>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Pipeline List"
>
<Link
className="unstyled"
id="pipelinesBtn"
replace={false}
to="/pipelines"
>
<WithStyles(Button)
className="button"
>
<PipelinesIcon
color="#9aa0a6"
/>
<span
className="label"
>
Pipelines
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Experiment List"
>
<Link
className="unstyled"
id="experimentsBtn"
replace={false}
to="/experiments"
>
<WithStyles(Button)
className="button active"
>
<ExperimentsIcon
color="#0d6de7"
/>
<span
className="label"
>
Experiments
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Artifacts List"
>
<Link
className="unstyled"
id="artifactsBtn"
replace={false}
to="/artifacts"
>
<WithStyles(Button)
className="button"
>
<pure(BubbleChartIcon) />
<span
className="label"
>
Artifacts
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Executions List"
>
<Link
className="unstyled"
id="executionsBtn"
replace={false}
to="/executions"
>
<WithStyles(Button)
className="button"
>
<pure(PlayArrowIcon) />
<span
className="label"
>
Executions
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Archive"
>
<Link
className="unstyled"
id="archiveBtn"
replace={false}
to="/archive/runs"
>
<WithStyles(Button)
className="button"
>
<pure(ArchiveIcon)
style={
Object {
"height": 20,
"width": 20,
}
}
/>
<span
className="label"
>
Archive
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Documentation"
to="https://www.kubeflow.org/docs/pipelines/"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Github Repo"
to="https://github.com/kubeflow/pipelines"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="AI Hub Samples"
to="https://aihub.cloud.google.com/u/0/s?category=pipeline"
/>
<hr
className="separator"
/>
<WithStyles(IconButton)
className="chevron"
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
</div>
<div
className="infoVisible"
>
<WithStyles(Tooltip)
enterDelay={300}
placement="top-start"
title="Report an Issue"
>
<div
className="envMetadata"
>
<a
className="link unstyled"
href="https://github.com/kubeflow/pipelines/issues/new?template=BUG_REPORT.md"
rel="noopener"
target="_blank"
>
Report an Issue
</a>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
exports[`SideNav renders experiments as active page when on Compare page 1`] = `
<div
className="root flexColumn noShrink"
id="sideNav"
>
<div
style={
Object {
"flexGrow": 1,
}
}
>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Pipeline List"
>
<Link
className="unstyled"
id="pipelinesBtn"
replace={false}
to="/pipelines"
>
<WithStyles(Button)
className="button"
>
<PipelinesIcon
color="#9aa0a6"
/>
<span
className="label"
>
Pipelines
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Experiment List"
>
<Link
className="unstyled"
id="experimentsBtn"
replace={false}
to="/experiments"
>
<WithStyles(Button)
className="button active"
>
<ExperimentsIcon
color="#0d6de7"
/>
<span
className="label"
>
Experiments
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Artifacts List"
>
<Link
className="unstyled"
id="artifactsBtn"
replace={false}
to="/artifacts"
>
<WithStyles(Button)
className="button"
>
<pure(BubbleChartIcon) />
<span
className="label"
>
Artifacts
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Executions List"
>
<Link
className="unstyled"
id="executionsBtn"
replace={false}
to="/executions"
>
<WithStyles(Button)
className="button"
>
<pure(PlayArrowIcon) />
<span
className="label"
>
Executions
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Archive"
>
<Link
className="unstyled"
id="archiveBtn"
replace={false}
to="/archive/runs"
>
<WithStyles(Button)
className="button"
>
<pure(ArchiveIcon)
style={
Object {
"height": 20,
"width": 20,
}
}
/>
<span
className="label"
>
Archive
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Documentation"
to="https://www.kubeflow.org/docs/pipelines/"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Github Repo"
to="https://github.com/kubeflow/pipelines"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="AI Hub Samples"
to="https://aihub.cloud.google.com/u/0/s?category=pipeline"
/>
<hr
className="separator"
/>
<WithStyles(IconButton)
className="chevron"
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
</div>
<div
className="infoVisible"
>
<WithStyles(Tooltip)
enterDelay={300}
placement="top-start"
title="Report an Issue"
>
<div
className="envMetadata"
>
<a
className="link unstyled"
href="https://github.com/kubeflow/pipelines/issues/new?template=BUG_REPORT.md"
rel="noopener"
target="_blank"
>
Report an Issue
</a>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
exports[`SideNav renders experiments as active page when on NewExperiment page 1`] = `
<div
className="root flexColumn noShrink"
id="sideNav"
>
<div
style={
Object {
"flexGrow": 1,
}
}
>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Pipeline List"
>
<Link
className="unstyled"
id="pipelinesBtn"
replace={false}
to="/pipelines"
>
<WithStyles(Button)
className="button"
>
<PipelinesIcon
color="#9aa0a6"
/>
<span
className="label"
>
Pipelines
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Experiment List"
>
<Link
className="unstyled"
id="experimentsBtn"
replace={false}
to="/experiments"
>
<WithStyles(Button)
className="button active"
>
<ExperimentsIcon
color="#0d6de7"
/>
<span
className="label"
>
Experiments
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Artifacts List"
>
<Link
className="unstyled"
id="artifactsBtn"
replace={false}
to="/artifacts"
>
<WithStyles(Button)
className="button"
>
<pure(BubbleChartIcon) />
<span
className="label"
>
Artifacts
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Executions List"
>
<Link
className="unstyled"
id="executionsBtn"
replace={false}
to="/executions"
>
<WithStyles(Button)
className="button"
>
<pure(PlayArrowIcon) />
<span
className="label"
>
Executions
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Archive"
>
<Link
className="unstyled"
id="archiveBtn"
replace={false}
to="/archive/runs"
>
<WithStyles(Button)
className="button"
>
<pure(ArchiveIcon)
style={
Object {
"height": 20,
"width": 20,
}
}
/>
<span
className="label"
>
Archive
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Documentation"
to="https://www.kubeflow.org/docs/pipelines/"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Github Repo"
to="https://github.com/kubeflow/pipelines"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="AI Hub Samples"
to="https://aihub.cloud.google.com/u/0/s?category=pipeline"
/>
<hr
className="separator"
/>
<WithStyles(IconButton)
className="chevron"
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
</div>
<div
className="infoVisible"
>
<WithStyles(Tooltip)
enterDelay={300}
placement="top-start"
title="Report an Issue"
>
<div
className="envMetadata"
>
<a
className="link unstyled"
href="https://github.com/kubeflow/pipelines/issues/new?template=BUG_REPORT.md"
rel="noopener"
target="_blank"
>
Report an Issue
</a>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
exports[`SideNav renders experiments as active page when on NewRun page 1`] = `
<div
className="root flexColumn noShrink"
id="sideNav"
>
<div
style={
Object {
"flexGrow": 1,
}
}
>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Pipeline List"
>
<Link
className="unstyled"
id="pipelinesBtn"
replace={false}
to="/pipelines"
>
<WithStyles(Button)
className="button"
>
<PipelinesIcon
color="#9aa0a6"
/>
<span
className="label"
>
Pipelines
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Experiment List"
>
<Link
className="unstyled"
id="experimentsBtn"
replace={false}
to="/experiments"
>
<WithStyles(Button)
className="button active"
>
<ExperimentsIcon
color="#0d6de7"
/>
<span
className="label"
>
Experiments
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Artifacts List"
>
<Link
className="unstyled"
id="artifactsBtn"
replace={false}
to="/artifacts"
>
<WithStyles(Button)
className="button"
>
<pure(BubbleChartIcon) />
<span
className="label"
>
Artifacts
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Executions List"
>
<Link
className="unstyled"
id="executionsBtn"
replace={false}
to="/executions"
>
<WithStyles(Button)
className="button"
>
<pure(PlayArrowIcon) />
<span
className="label"
>
Executions
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Archive"
>
<Link
className="unstyled"
id="archiveBtn"
replace={false}
to="/archive/runs"
>
<WithStyles(Button)
className="button"
>
<pure(ArchiveIcon)
style={
Object {
"height": 20,
"width": 20,
}
}
/>
<span
className="label"
>
Archive
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Documentation"
to="https://www.kubeflow.org/docs/pipelines/"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Github Repo"
to="https://github.com/kubeflow/pipelines"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="AI Hub Samples"
to="https://aihub.cloud.google.com/u/0/s?category=pipeline"
/>
<hr
className="separator"
/>
<WithStyles(IconButton)
className="chevron"
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
</div>
<div
className="infoVisible"
>
<WithStyles(Tooltip)
enterDelay={300}
placement="top-start"
title="Report an Issue"
>
<div
className="envMetadata"
>
<a
className="link unstyled"
href="https://github.com/kubeflow/pipelines/issues/new?template=BUG_REPORT.md"
rel="noopener"
target="_blank"
>
Report an Issue
</a>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
exports[`SideNav renders experiments as active page when on RecurringRunDetails page 1`] = `
<div
className="root flexColumn noShrink"
id="sideNav"
>
<div
style={
Object {
"flexGrow": 1,
}
}
>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Pipeline List"
>
<Link
className="unstyled"
id="pipelinesBtn"
replace={false}
to="/pipelines"
>
<WithStyles(Button)
className="button"
>
<PipelinesIcon
color="#9aa0a6"
/>
<span
className="label"
>
Pipelines
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Experiment List"
>
<Link
className="unstyled"
id="experimentsBtn"
replace={false}
to="/experiments"
>
<WithStyles(Button)
className="button active"
>
<ExperimentsIcon
color="#0d6de7"
/>
<span
className="label"
>
Experiments
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Artifacts List"
>
<Link
className="unstyled"
id="artifactsBtn"
replace={false}
to="/artifacts"
>
<WithStyles(Button)
className="button"
>
<pure(BubbleChartIcon) />
<span
className="label"
>
Artifacts
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Executions List"
>
<Link
className="unstyled"
id="executionsBtn"
replace={false}
to="/executions"
>
<WithStyles(Button)
className="button"
>
<pure(PlayArrowIcon) />
<span
className="label"
>
Executions
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Archive"
>
<Link
className="unstyled"
id="archiveBtn"
replace={false}
to="/archive/runs"
>
<WithStyles(Button)
className="button"
>
<pure(ArchiveIcon)
style={
Object {
"height": 20,
"width": 20,
}
}
/>
<span
className="label"
>
Archive
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Documentation"
to="https://www.kubeflow.org/docs/pipelines/"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Github Repo"
to="https://github.com/kubeflow/pipelines"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="AI Hub Samples"
to="https://aihub.cloud.google.com/u/0/s?category=pipeline"
/>
<hr
className="separator"
/>
<WithStyles(IconButton)
className="chevron"
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
</div>
<div
className="infoVisible"
>
<WithStyles(Tooltip)
enterDelay={300}
placement="top-start"
title="Report an Issue"
>
<div
className="envMetadata"
>
<a
className="link unstyled"
href="https://github.com/kubeflow/pipelines/issues/new?template=BUG_REPORT.md"
rel="noopener"
target="_blank"
>
Report an Issue
</a>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
exports[`SideNav renders experiments as active page when on RunDetails page 1`] = `
<div
className="root flexColumn noShrink"
id="sideNav"
>
<div
style={
Object {
"flexGrow": 1,
}
}
>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Pipeline List"
>
<Link
className="unstyled"
id="pipelinesBtn"
replace={false}
to="/pipelines"
>
<WithStyles(Button)
className="button"
>
<PipelinesIcon
color="#9aa0a6"
/>
<span
className="label"
>
Pipelines
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Experiment List"
>
<Link
className="unstyled"
id="experimentsBtn"
replace={false}
to="/experiments"
>
<WithStyles(Button)
className="button active"
>
<ExperimentsIcon
color="#0d6de7"
/>
<span
className="label"
>
Experiments
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Artifacts List"
>
<Link
className="unstyled"
id="artifactsBtn"
replace={false}
to="/artifacts"
>
<WithStyles(Button)
className="button"
>
<pure(BubbleChartIcon) />
<span
className="label"
>
Artifacts
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Executions List"
>
<Link
className="unstyled"
id="executionsBtn"
replace={false}
to="/executions"
>
<WithStyles(Button)
className="button"
>
<pure(PlayArrowIcon) />
<span
className="label"
>
Executions
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Archive"
>
<Link
className="unstyled"
id="archiveBtn"
replace={false}
to="/archive/runs"
>
<WithStyles(Button)
className="button"
>
<pure(ArchiveIcon)
style={
Object {
"height": 20,
"width": 20,
}
}
/>
<span
className="label"
>
Archive
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Documentation"
to="https://www.kubeflow.org/docs/pipelines/"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Github Repo"
to="https://github.com/kubeflow/pipelines"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="AI Hub Samples"
to="https://aihub.cloud.google.com/u/0/s?category=pipeline"
/>
<hr
className="separator"
/>
<WithStyles(IconButton)
className="chevron"
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
</div>
<div
className="infoVisible"
>
<WithStyles(Tooltip)
enterDelay={300}
placement="top-start"
title="Report an Issue"
>
<div
className="envMetadata"
>
<a
className="link unstyled"
href="https://github.com/kubeflow/pipelines/issues/new?template=BUG_REPORT.md"
rel="noopener"
target="_blank"
>
Report an Issue
</a>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
exports[`SideNav renders experiments as active when on ExperimentDetails page 1`] = `
<div
className="root flexColumn noShrink"
id="sideNav"
>
<div
style={
Object {
"flexGrow": 1,
}
}
>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Pipeline List"
>
<Link
className="unstyled"
id="pipelinesBtn"
replace={false}
to="/pipelines"
>
<WithStyles(Button)
className="button"
>
<PipelinesIcon
color="#9aa0a6"
/>
<span
className="label"
>
Pipelines
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Experiment List"
>
<Link
className="unstyled"
id="experimentsBtn"
replace={false}
to="/experiments"
>
<WithStyles(Button)
className="button active"
>
<ExperimentsIcon
color="#0d6de7"
/>
<span
className="label"
>
Experiments
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Artifacts List"
>
<Link
className="unstyled"
id="artifactsBtn"
replace={false}
to="/artifacts"
>
<WithStyles(Button)
className="button"
>
<pure(BubbleChartIcon) />
<span
className="label"
>
Artifacts
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Executions List"
>
<Link
className="unstyled"
id="executionsBtn"
replace={false}
to="/executions"
>
<WithStyles(Button)
className="button"
>
<pure(PlayArrowIcon) />
<span
className="label"
>
Executions
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Archive"
>
<Link
className="unstyled"
id="archiveBtn"
replace={false}
to="/archive/runs"
>
<WithStyles(Button)
className="button"
>
<pure(ArchiveIcon)
style={
Object {
"height": 20,
"width": 20,
}
}
/>
<span
className="label"
>
Archive
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Documentation"
to="https://www.kubeflow.org/docs/pipelines/"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Github Repo"
to="https://github.com/kubeflow/pipelines"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="AI Hub Samples"
to="https://aihub.cloud.google.com/u/0/s?category=pipeline"
/>
<hr
className="separator"
/>
<WithStyles(IconButton)
className="chevron"
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
</div>
<div
className="infoVisible"
>
<WithStyles(Tooltip)
enterDelay={300}
placement="top-start"
title="Report an Issue"
>
<div
className="envMetadata"
>
<a
className="link unstyled"
href="https://github.com/kubeflow/pipelines/issues/new?template=BUG_REPORT.md"
rel="noopener"
target="_blank"
>
Report an Issue
</a>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
exports[`SideNav show jupyterhub link if accessible 1`] = `
<div
className="root flexColumn noShrink"
id="sideNav"
>
<div
style={
Object {
"flexGrow": 1,
}
}
>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Pipeline List"
>
<Link
className="unstyled"
id="pipelinesBtn"
replace={false}
to="/pipelines"
>
<WithStyles(Button)
className="button"
>
<PipelinesIcon
color="#9aa0a6"
/>
<span
className="label"
>
Pipelines
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Experiment List"
>
<Link
className="unstyled"
id="experimentsBtn"
replace={false}
to="/experiments"
>
<WithStyles(Button)
className="button active"
>
<ExperimentsIcon
color="#0d6de7"
/>
<span
className="label"
>
Experiments
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Artifacts List"
>
<Link
className="unstyled"
id="artifactsBtn"
replace={false}
to="/artifacts"
>
<WithStyles(Button)
className="button"
>
<pure(BubbleChartIcon) />
<span
className="label"
>
Artifacts
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Executions List"
>
<Link
className="unstyled"
id="executionsBtn"
replace={false}
to="/executions"
>
<WithStyles(Button)
className="button"
>
<pure(PlayArrowIcon) />
<span
className="label"
>
Executions
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Open Jupyter Notebook"
>
<a
className="unstyled"
href="/hub/"
id="jupyterhubBtn"
rel="noopener"
target="_blank"
>
<WithStyles(Button)
className="button"
>
<pure(CodeIcon)
style={
Object {
"height": 20,
"width": 20,
}
}
/>
<span
className="label"
>
Notebooks
</span>
<pure(OpenInNewIcon)
className="openInNewTabIcon"
/>
</WithStyles(Button)>
</a>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<div
className="indicator indicatorHidden"
/>
<WithStyles(Tooltip)
disableFocusListener={true}
disableHoverListener={true}
disableTouchListener={true}
enterDelay={300}
placement="right-start"
title="Archive"
>
<Link
className="unstyled"
id="archiveBtn"
replace={false}
to="/archive/runs"
>
<WithStyles(Button)
className="button"
>
<pure(ArchiveIcon)
style={
Object {
"height": 20,
"width": 20,
}
}
/>
<span
className="label"
>
Archive
</span>
</WithStyles(Button)>
</Link>
</WithStyles(Tooltip)>
<hr
className="separator"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Documentation"
to="https://www.kubeflow.org/docs/pipelines/"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="Github Repo"
to="https://github.com/kubeflow/pipelines"
/>
<ExternalUri
collapsed={false}
icon={[Function]}
title="AI Hub Samples"
to="https://aihub.cloud.google.com/u/0/s?category=pipeline"
/>
<hr
className="separator"
/>
<WithStyles(IconButton)
className="chevron"
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
</div>
<div
className="infoVisible"
>
<WithStyles(Tooltip)
enterDelay={300}
placement="top-start"
title="Report an Issue"
>
<div
className="envMetadata"
>
<a
className="link unstyled"
href="https://github.com/kubeflow/pipelines/issues/new?template=BUG_REPORT.md"
rel="noopener"
target="_blank"
>
Report an Issue
</a>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
| 7,984 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/__snapshots__/ExperimentList.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ExperimentList loads multiple experiments 1`] = `
<div>
<CustomTable
columns={
Array [
Object {
"customRenderer": [Function],
"flex": 1,
"label": "Experiment name",
"sortKey": "name",
},
Object {
"flex": 2,
"label": "Description",
},
]
}
disableSelection={true}
emptyMessage="No experiments found. Click \\"Create experiment\\" to start."
filterLabel="Filter experiments"
getExpandComponent={[Function]}
initialSortColumn="created_at"
reload={[Function]}
rows={
Array [
Object {
"error": undefined,
"expandState": 0,
"id": "testexperiment1",
"otherFields": Array [
"experiment with id: testexperiment1",
undefined,
],
},
Object {
"error": undefined,
"expandState": 0,
"id": "testexperiment2",
"otherFields": Array [
"experiment with id: testexperiment2",
undefined,
],
},
Object {
"error": undefined,
"expandState": 0,
"id": "testexperiment3",
"otherFields": Array [
"experiment with id: testexperiment3",
undefined,
],
},
Object {
"error": undefined,
"expandState": 0,
"id": "testexperiment4",
"otherFields": Array [
"experiment with id: testexperiment4",
undefined,
],
},
Object {
"error": undefined,
"expandState": 0,
"id": "testexperiment5",
"otherFields": Array [
"experiment with id: testexperiment5",
undefined,
],
},
]
}
toggleExpansion={[Function]}
/>
</div>
`;
exports[`ExperimentList loads one experiment 1`] = `
<div>
<CustomTable
columns={
Array [
Object {
"customRenderer": [Function],
"flex": 1,
"label": "Experiment name",
"sortKey": "name",
},
Object {
"flex": 2,
"label": "Description",
},
]
}
disableSelection={true}
emptyMessage="No experiments found. Click \\"Create experiment\\" to start."
filterLabel="Filter experiments"
getExpandComponent={[Function]}
initialSortColumn="created_at"
reload={[Function]}
rows={
Array [
Object {
"error": undefined,
"expandState": 0,
"id": "testexperiment1",
"otherFields": Array [
"experiment with id: testexperiment1",
undefined,
],
},
]
}
toggleExpansion={[Function]}
/>
</div>
`;
exports[`ExperimentList reloads the experiment when refresh is called 1`] = `
<ExperimentList
history={Object {}}
location={
Object {
"search": "",
}
}
match=""
onError={[MockFunction]}
>
<div>
<CustomTable
columns={
Array [
Object {
"customRenderer": [Function],
"flex": 1,
"label": "Experiment name",
"sortKey": "name",
},
Object {
"flex": 2,
"label": "Description",
},
]
}
disableSelection={true}
emptyMessage="No experiments found. Click \\"Create experiment\\" to start."
filterLabel="Filter experiments"
getExpandComponent={[Function]}
initialSortColumn="created_at"
reload={[Function]}
rows={Array []}
toggleExpansion={[Function]}
>
<div
className="pageOverflowHidden"
>
<div>
<Input
InputLabelProps={
Object {
"classes": Object {
"root": "noMargin",
},
}
}
InputProps={
Object {
"classes": Object {
"notchedOutline": "filterBorderRadius",
"root": "noLeftPadding",
},
"startAdornment": <WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>,
}
}
className="filterBox"
height={48}
id="tableFilterBox"
label="Filter experiments"
maxWidth="100%"
onChange={[Function]}
value=""
variant="outlined"
>
<TextField
InputLabelProps={
Object {
"classes": Object {
"root": "noMargin",
},
}
}
InputProps={
Object {
"classes": Object {
"notchedOutline": "filterBorderRadius",
"root": "noLeftPadding",
},
"startAdornment": <WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>,
}
}
className="filterBox"
id="tableFilterBox"
label="Filter experiments"
onChange={[Function]}
required={false}
select={false}
spellCheck={false}
style={
Object {
"height": 48,
"maxWidth": "100%",
"width": "100%",
}
}
value=""
variant="outlined"
>
<WithStyles(FormControl)
className="filterBox"
required={false}
spellCheck={false}
style={
Object {
"height": 48,
"maxWidth": "100%",
"width": "100%",
}
}
variant="outlined"
>
<FormControl
className="filterBox"
classes={
Object {
"fullWidth": "MuiFormControl-fullWidth-4",
"marginDense": "MuiFormControl-marginDense-3",
"marginNormal": "MuiFormControl-marginNormal-2",
"root": "MuiFormControl-root-1",
}
}
component="div"
disabled={false}
error={false}
fullWidth={false}
margin="none"
required={false}
spellCheck={false}
style={
Object {
"height": 48,
"maxWidth": "100%",
"width": "100%",
}
}
variant="outlined"
>
<div
className="MuiFormControl-root-1 filterBox"
spellCheck={false}
style={
Object {
"height": 48,
"maxWidth": "100%",
"width": "100%",
}
}
>
<WithStyles(WithFormControlContext(InputLabel))
classes={
Object {
"root": "noMargin",
}
}
htmlFor="tableFilterBox"
>
<WithFormControlContext(InputLabel)
classes={
Object {
"animated": "MuiInputLabel-animated-13",
"disabled": "MuiInputLabel-disabled-7",
"error": "MuiInputLabel-error-8",
"filled": "MuiInputLabel-filled-14",
"focused": "MuiInputLabel-focused-6",
"formControl": "MuiInputLabel-formControl-10",
"marginDense": "MuiInputLabel-marginDense-11",
"outlined": "MuiInputLabel-outlined-15",
"required": "MuiInputLabel-required-9",
"root": "MuiInputLabel-root-5 noMargin",
"shrink": "MuiInputLabel-shrink-12",
}
}
htmlFor="tableFilterBox"
>
<InputLabel
classes={
Object {
"animated": "MuiInputLabel-animated-13",
"disabled": "MuiInputLabel-disabled-7",
"error": "MuiInputLabel-error-8",
"filled": "MuiInputLabel-filled-14",
"focused": "MuiInputLabel-focused-6",
"formControl": "MuiInputLabel-formControl-10",
"marginDense": "MuiInputLabel-marginDense-11",
"outlined": "MuiInputLabel-outlined-15",
"required": "MuiInputLabel-required-9",
"root": "MuiInputLabel-root-5 noMargin",
"shrink": "MuiInputLabel-shrink-12",
}
}
disableAnimation={false}
htmlFor="tableFilterBox"
muiFormControl={
Object {
"adornedStart": true,
"disabled": false,
"error": false,
"filled": false,
"focused": false,
"margin": "none",
"onBlur": [Function],
"onEmpty": [Function],
"onFilled": [Function],
"onFocus": [Function],
"required": false,
"variant": "outlined",
}
}
>
<WithStyles(WithFormControlContext(FormLabel))
className="MuiInputLabel-root-5 noMargin MuiInputLabel-formControl-10 MuiInputLabel-animated-13 MuiInputLabel-shrink-12 MuiInputLabel-outlined-15"
classes={
Object {
"disabled": "MuiInputLabel-disabled-7",
"error": "MuiInputLabel-error-8",
"focused": "MuiInputLabel-focused-6",
"required": "MuiInputLabel-required-9",
}
}
data-shrink={true}
htmlFor="tableFilterBox"
>
<WithFormControlContext(FormLabel)
className="MuiInputLabel-root-5 noMargin MuiInputLabel-formControl-10 MuiInputLabel-animated-13 MuiInputLabel-shrink-12 MuiInputLabel-outlined-15"
classes={
Object {
"asterisk": "MuiFormLabel-asterisk-22",
"disabled": "MuiFormLabel-disabled-18 MuiInputLabel-disabled-7",
"error": "MuiFormLabel-error-19 MuiInputLabel-error-8",
"filled": "MuiFormLabel-filled-20",
"focused": "MuiFormLabel-focused-17 MuiInputLabel-focused-6",
"required": "MuiFormLabel-required-21 MuiInputLabel-required-9",
"root": "MuiFormLabel-root-16",
}
}
data-shrink={true}
htmlFor="tableFilterBox"
>
<FormLabel
className="MuiInputLabel-root-5 noMargin MuiInputLabel-formControl-10 MuiInputLabel-animated-13 MuiInputLabel-shrink-12 MuiInputLabel-outlined-15"
classes={
Object {
"asterisk": "MuiFormLabel-asterisk-22",
"disabled": "MuiFormLabel-disabled-18 MuiInputLabel-disabled-7",
"error": "MuiFormLabel-error-19 MuiInputLabel-error-8",
"filled": "MuiFormLabel-filled-20",
"focused": "MuiFormLabel-focused-17 MuiInputLabel-focused-6",
"required": "MuiFormLabel-required-21 MuiInputLabel-required-9",
"root": "MuiFormLabel-root-16",
}
}
component="label"
data-shrink={true}
htmlFor="tableFilterBox"
muiFormControl={
Object {
"adornedStart": true,
"disabled": false,
"error": false,
"filled": false,
"focused": false,
"margin": "none",
"onBlur": [Function],
"onEmpty": [Function],
"onFilled": [Function],
"onFocus": [Function],
"required": false,
"variant": "outlined",
}
}
>
<label
className="MuiFormLabel-root-16 MuiInputLabel-root-5 noMargin MuiInputLabel-formControl-10 MuiInputLabel-animated-13 MuiInputLabel-shrink-12 MuiInputLabel-outlined-15"
data-shrink={true}
htmlFor="tableFilterBox"
>
Filter experiments
</label>
</FormLabel>
</WithFormControlContext(FormLabel)>
</WithStyles(WithFormControlContext(FormLabel))>
</InputLabel>
</WithFormControlContext(InputLabel)>
</WithStyles(WithFormControlContext(InputLabel))>
<WithStyles(OutlinedInput)
classes={
Object {
"notchedOutline": "filterBorderRadius",
"root": "noLeftPadding",
}
}
id="tableFilterBox"
labelWidth={0}
onChange={[Function]}
startAdornment={
<WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>
}
value=""
>
<OutlinedInput
classes={
Object {
"adornedEnd": "MuiOutlinedInput-adornedEnd-27",
"adornedStart": "MuiOutlinedInput-adornedStart-26",
"disabled": "MuiOutlinedInput-disabled-25",
"error": "MuiOutlinedInput-error-28",
"focused": "MuiOutlinedInput-focused-24",
"input": "MuiOutlinedInput-input-31",
"inputAdornedEnd": "MuiOutlinedInput-inputAdornedEnd-35",
"inputAdornedStart": "MuiOutlinedInput-inputAdornedStart-34",
"inputMarginDense": "MuiOutlinedInput-inputMarginDense-32",
"inputMultiline": "MuiOutlinedInput-inputMultiline-33",
"multiline": "MuiOutlinedInput-multiline-29",
"notchedOutline": "MuiOutlinedInput-notchedOutline-30 filterBorderRadius",
"root": "MuiOutlinedInput-root-23 noLeftPadding",
}
}
id="tableFilterBox"
labelWidth={0}
onChange={[Function]}
startAdornment={
<WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>
}
value=""
>
<WithStyles(WithFormControlContext(InputBase))
classes={
Object {
"adornedEnd": "MuiOutlinedInput-adornedEnd-27",
"adornedStart": "MuiOutlinedInput-adornedStart-26",
"disabled": "MuiOutlinedInput-disabled-25",
"error": "MuiOutlinedInput-error-28",
"focused": "MuiOutlinedInput-focused-24",
"input": "MuiOutlinedInput-input-31",
"inputAdornedEnd": "MuiOutlinedInput-inputAdornedEnd-35",
"inputAdornedStart": "MuiOutlinedInput-inputAdornedStart-34",
"inputMarginDense": "MuiOutlinedInput-inputMarginDense-32",
"inputMultiline": "MuiOutlinedInput-inputMultiline-33",
"multiline": "MuiOutlinedInput-multiline-29",
"notchedOutline": null,
"root": "MuiOutlinedInput-root-23 noLeftPadding",
}
}
fullWidth={false}
id="tableFilterBox"
inputComponent="input"
multiline={false}
onChange={[Function]}
renderPrefix={[Function]}
startAdornment={
<WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>
}
type="text"
value=""
>
<WithFormControlContext(InputBase)
classes={
Object {
"adornedEnd": "MuiInputBase-adornedEnd-41 MuiOutlinedInput-adornedEnd-27",
"adornedStart": "MuiInputBase-adornedStart-40 MuiOutlinedInput-adornedStart-26",
"disabled": "MuiInputBase-disabled-39 MuiOutlinedInput-disabled-25",
"error": "MuiInputBase-error-42 MuiOutlinedInput-error-28",
"focused": "MuiInputBase-focused-38 MuiOutlinedInput-focused-24",
"formControl": "MuiInputBase-formControl-37",
"fullWidth": "MuiInputBase-fullWidth-45",
"input": "MuiInputBase-input-46 MuiOutlinedInput-input-31",
"inputAdornedEnd": "MuiInputBase-inputAdornedEnd-52 MuiOutlinedInput-inputAdornedEnd-35",
"inputAdornedStart": "MuiInputBase-inputAdornedStart-51 MuiOutlinedInput-inputAdornedStart-34",
"inputMarginDense": "MuiInputBase-inputMarginDense-47 MuiOutlinedInput-inputMarginDense-32",
"inputMultiline": "MuiInputBase-inputMultiline-48 MuiOutlinedInput-inputMultiline-33",
"inputType": "MuiInputBase-inputType-49",
"inputTypeSearch": "MuiInputBase-inputTypeSearch-50",
"marginDense": "MuiInputBase-marginDense-43",
"multiline": "MuiInputBase-multiline-44 MuiOutlinedInput-multiline-29",
"root": "MuiInputBase-root-36 MuiOutlinedInput-root-23 noLeftPadding",
}
}
fullWidth={false}
id="tableFilterBox"
inputComponent="input"
multiline={false}
onChange={[Function]}
renderPrefix={[Function]}
startAdornment={
<WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>
}
type="text"
value=""
>
<InputBase
classes={
Object {
"adornedEnd": "MuiInputBase-adornedEnd-41 MuiOutlinedInput-adornedEnd-27",
"adornedStart": "MuiInputBase-adornedStart-40 MuiOutlinedInput-adornedStart-26",
"disabled": "MuiInputBase-disabled-39 MuiOutlinedInput-disabled-25",
"error": "MuiInputBase-error-42 MuiOutlinedInput-error-28",
"focused": "MuiInputBase-focused-38 MuiOutlinedInput-focused-24",
"formControl": "MuiInputBase-formControl-37",
"fullWidth": "MuiInputBase-fullWidth-45",
"input": "MuiInputBase-input-46 MuiOutlinedInput-input-31",
"inputAdornedEnd": "MuiInputBase-inputAdornedEnd-52 MuiOutlinedInput-inputAdornedEnd-35",
"inputAdornedStart": "MuiInputBase-inputAdornedStart-51 MuiOutlinedInput-inputAdornedStart-34",
"inputMarginDense": "MuiInputBase-inputMarginDense-47 MuiOutlinedInput-inputMarginDense-32",
"inputMultiline": "MuiInputBase-inputMultiline-48 MuiOutlinedInput-inputMultiline-33",
"inputType": "MuiInputBase-inputType-49",
"inputTypeSearch": "MuiInputBase-inputTypeSearch-50",
"marginDense": "MuiInputBase-marginDense-43",
"multiline": "MuiInputBase-multiline-44 MuiOutlinedInput-multiline-29",
"root": "MuiInputBase-root-36 MuiOutlinedInput-root-23 noLeftPadding",
}
}
fullWidth={false}
id="tableFilterBox"
inputComponent="input"
muiFormControl={
Object {
"adornedStart": true,
"disabled": false,
"error": false,
"filled": false,
"focused": false,
"margin": "none",
"onBlur": [Function],
"onEmpty": [Function],
"onFilled": [Function],
"onFocus": [Function],
"required": false,
"variant": "outlined",
}
}
multiline={false}
onChange={[Function]}
renderPrefix={[Function]}
startAdornment={
<WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>
}
type="text"
value=""
>
<div
className="MuiInputBase-root-36 MuiOutlinedInput-root-23 noLeftPadding MuiInputBase-formControl-37 MuiInputBase-adornedStart-40 MuiOutlinedInput-adornedStart-26"
onClick={[Function]}
>
<WithStyles(NotchedOutline)
className="MuiOutlinedInput-notchedOutline-30 filterBorderRadius"
labelWidth={0}
notched={true}
>
<NotchedOutline
className="MuiOutlinedInput-notchedOutline-30 filterBorderRadius"
classes={
Object {
"legend": "MuiPrivateNotchedOutline-legend-54",
"root": "MuiPrivateNotchedOutline-root-53",
}
}
labelWidth={0}
notched={true}
theme={
Object {
"breakpoints": Object {
"between": [Function],
"down": [Function],
"keys": Array [
"xs",
"sm",
"md",
"lg",
"xl",
],
"only": [Function],
"up": [Function],
"values": Object {
"lg": 1280,
"md": 960,
"sm": 600,
"xl": 1920,
"xs": 0,
},
"width": [Function],
},
"direction": "ltr",
"mixins": Object {
"gutters": [Function],
"toolbar": Object {
"@media (min-width:0px) and (orientation: landscape)": Object {
"minHeight": 48,
},
"@media (min-width:600px)": Object {
"minHeight": 64,
},
"minHeight": 56,
},
},
"overrides": Object {},
"palette": Object {
"action": Object {
"active": "rgba(0, 0, 0, 0.54)",
"disabled": "rgba(0, 0, 0, 0.26)",
"disabledBackground": "rgba(0, 0, 0, 0.12)",
"hover": "rgba(0, 0, 0, 0.08)",
"hoverOpacity": 0.08,
"selected": "rgba(0, 0, 0, 0.14)",
},
"augmentColor": [Function],
"background": Object {
"default": "#fafafa",
"paper": "#fff",
},
"common": Object {
"black": "#000",
"white": "#fff",
},
"contrastThreshold": 3,
"divider": "rgba(0, 0, 0, 0.12)",
"error": Object {
"contrastText": "#fff",
"dark": "#d32f2f",
"light": "#e57373",
"main": "#f44336",
},
"getContrastText": [Function],
"grey": Object {
"100": "#f5f5f5",
"200": "#eeeeee",
"300": "#e0e0e0",
"400": "#bdbdbd",
"50": "#fafafa",
"500": "#9e9e9e",
"600": "#757575",
"700": "#616161",
"800": "#424242",
"900": "#212121",
"A100": "#d5d5d5",
"A200": "#aaaaaa",
"A400": "#303030",
"A700": "#616161",
},
"primary": Object {
"contrastText": "#fff",
"dark": "#303f9f",
"light": "#7986cb",
"main": "#3f51b5",
},
"secondary": Object {
"contrastText": "#fff",
"dark": "#c51162",
"light": "#ff4081",
"main": "#f50057",
},
"text": Object {
"disabled": "rgba(0, 0, 0, 0.38)",
"hint": "rgba(0, 0, 0, 0.38)",
"primary": "rgba(0, 0, 0, 0.87)",
"secondary": "rgba(0, 0, 0, 0.54)",
},
"tonalOffset": 0.2,
"type": "light",
},
"props": Object {},
"shadows": Array [
"none",
"0px 1px 3px 0px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 2px 1px -1px rgba(0,0,0,0.12)",
"0px 1px 5px 0px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 3px 1px -2px rgba(0,0,0,0.12)",
"0px 1px 8px 0px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 3px 3px -2px rgba(0,0,0,0.12)",
"0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)",
"0px 3px 5px -1px rgba(0,0,0,0.2),0px 5px 8px 0px rgba(0,0,0,0.14),0px 1px 14px 0px rgba(0,0,0,0.12)",
"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)",
"0px 4px 5px -2px rgba(0,0,0,0.2),0px 7px 10px 1px rgba(0,0,0,0.14),0px 2px 16px 1px rgba(0,0,0,0.12)",
"0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)",
"0px 5px 6px -3px rgba(0,0,0,0.2),0px 9px 12px 1px rgba(0,0,0,0.14),0px 3px 16px 2px rgba(0,0,0,0.12)",
"0px 6px 6px -3px rgba(0,0,0,0.2),0px 10px 14px 1px rgba(0,0,0,0.14),0px 4px 18px 3px rgba(0,0,0,0.12)",
"0px 6px 7px -4px rgba(0,0,0,0.2),0px 11px 15px 1px rgba(0,0,0,0.14),0px 4px 20px 3px rgba(0,0,0,0.12)",
"0px 7px 8px -4px rgba(0,0,0,0.2),0px 12px 17px 2px rgba(0,0,0,0.14),0px 5px 22px 4px rgba(0,0,0,0.12)",
"0px 7px 8px -4px rgba(0,0,0,0.2),0px 13px 19px 2px rgba(0,0,0,0.14),0px 5px 24px 4px rgba(0,0,0,0.12)",
"0px 7px 9px -4px rgba(0,0,0,0.2),0px 14px 21px 2px rgba(0,0,0,0.14),0px 5px 26px 4px rgba(0,0,0,0.12)",
"0px 8px 9px -5px rgba(0,0,0,0.2),0px 15px 22px 2px rgba(0,0,0,0.14),0px 6px 28px 5px rgba(0,0,0,0.12)",
"0px 8px 10px -5px rgba(0,0,0,0.2),0px 16px 24px 2px rgba(0,0,0,0.14),0px 6px 30px 5px rgba(0,0,0,0.12)",
"0px 8px 11px -5px rgba(0,0,0,0.2),0px 17px 26px 2px rgba(0,0,0,0.14),0px 6px 32px 5px rgba(0,0,0,0.12)",
"0px 9px 11px -5px rgba(0,0,0,0.2),0px 18px 28px 2px rgba(0,0,0,0.14),0px 7px 34px 6px rgba(0,0,0,0.12)",
"0px 9px 12px -6px rgba(0,0,0,0.2),0px 19px 29px 2px rgba(0,0,0,0.14),0px 7px 36px 6px rgba(0,0,0,0.12)",
"0px 10px 13px -6px rgba(0,0,0,0.2),0px 20px 31px 3px rgba(0,0,0,0.14),0px 8px 38px 7px rgba(0,0,0,0.12)",
"0px 10px 13px -6px rgba(0,0,0,0.2),0px 21px 33px 3px rgba(0,0,0,0.14),0px 8px 40px 7px rgba(0,0,0,0.12)",
"0px 10px 14px -6px rgba(0,0,0,0.2),0px 22px 35px 3px rgba(0,0,0,0.14),0px 8px 42px 7px rgba(0,0,0,0.12)",
"0px 11px 14px -7px rgba(0,0,0,0.2),0px 23px 36px 3px rgba(0,0,0,0.14),0px 9px 44px 8px rgba(0,0,0,0.12)",
"0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12)",
],
"shape": Object {
"borderRadius": 4,
},
"spacing": Object {
"unit": 8,
},
"transitions": Object {
"create": [Function],
"duration": Object {
"complex": 375,
"enteringScreen": 225,
"leavingScreen": 195,
"short": 250,
"shorter": 200,
"shortest": 150,
"standard": 300,
},
"easing": Object {
"easeIn": "cubic-bezier(0.4, 0, 1, 1)",
"easeInOut": "cubic-bezier(0.4, 0, 0.2, 1)",
"easeOut": "cubic-bezier(0.0, 0, 0.2, 1)",
"sharp": "cubic-bezier(0.4, 0, 0.6, 1)",
},
"getAutoHeightDuration": [Function],
},
"typography": Object {
"body1": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 400,
"lineHeight": "1.46429em",
},
"body1Next": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1rem",
"fontWeight": 400,
"letterSpacing": "0.00938em",
"lineHeight": 1.5,
},
"body2": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 500,
"lineHeight": "1.71429em",
},
"body2Next": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 400,
"letterSpacing": "0.01071em",
"lineHeight": 1.5,
},
"button": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 500,
"textTransform": "uppercase",
},
"buttonNext": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 500,
"letterSpacing": "0.02857em",
"lineHeight": 1.5,
"textTransform": "uppercase",
},
"caption": Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.75rem",
"fontWeight": 400,
"lineHeight": "1.375em",
},
"captionNext": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.75rem",
"fontWeight": 400,
"letterSpacing": "0.03333em",
"lineHeight": 1.66,
},
"display1": Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "2.125rem",
"fontWeight": 400,
"lineHeight": "1.20588em",
},
"display2": Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "2.8125rem",
"fontWeight": 400,
"lineHeight": "1.13333em",
"marginLeft": "-.02em",
},
"display3": Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "3.5rem",
"fontWeight": 400,
"letterSpacing": "-.02em",
"lineHeight": "1.30357em",
"marginLeft": "-.02em",
},
"display4": Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "7rem",
"fontWeight": 300,
"letterSpacing": "-.04em",
"lineHeight": "1.14286em",
"marginLeft": "-.04em",
},
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": 14,
"fontWeightLight": 300,
"fontWeightMedium": 500,
"fontWeightRegular": 400,
"h1": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "6rem",
"fontWeight": 300,
"letterSpacing": "-0.01562em",
"lineHeight": 1,
},
"h2": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "3.75rem",
"fontWeight": 300,
"letterSpacing": "-0.00833em",
"lineHeight": 1,
},
"h3": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "3rem",
"fontWeight": 400,
"letterSpacing": "0em",
"lineHeight": 1.04,
},
"h4": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "2.125rem",
"fontWeight": 400,
"letterSpacing": "0.00735em",
"lineHeight": 1.17,
},
"h5": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1.5rem",
"fontWeight": 400,
"letterSpacing": "0em",
"lineHeight": 1.33,
},
"h6": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1.25rem",
"fontWeight": 500,
"letterSpacing": "0.0075em",
"lineHeight": 1.6,
},
"headline": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1.5rem",
"fontWeight": 400,
"lineHeight": "1.35417em",
},
"overline": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.75rem",
"fontWeight": 400,
"letterSpacing": "0.08333em",
"lineHeight": 2.66,
"textTransform": "uppercase",
},
"pxToRem": [Function],
"round": [Function],
"subheading": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1rem",
"fontWeight": 400,
"lineHeight": "1.5em",
},
"subtitle1": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1rem",
"fontWeight": 400,
"letterSpacing": "0.00938em",
"lineHeight": 1.75,
},
"subtitle2": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 500,
"letterSpacing": "0.00714em",
"lineHeight": 1.57,
},
"title": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1.3125rem",
"fontWeight": 500,
"lineHeight": "1.16667em",
},
"useNextVariants": false,
},
"zIndex": Object {
"appBar": 1100,
"drawer": 1200,
"mobileStepper": 1000,
"modal": 1300,
"snackbar": 1400,
"tooltip": 1500,
},
}
}
>
<fieldset
aria-hidden={true}
className="MuiPrivateNotchedOutline-root-53 MuiOutlinedInput-notchedOutline-30 filterBorderRadius"
style={
Object {
"paddingLeft": 8,
}
}
>
<legend
className="MuiPrivateNotchedOutline-legend-54"
style={
Object {
"width": 0,
}
}
>
<span
dangerouslySetInnerHTML={
Object {
"__html": "​",
}
}
/>
</legend>
</fieldset>
</NotchedOutline>
</WithStyles(NotchedOutline)>
<WithStyles(InputAdornment)
position="end"
>
<InputAdornment
classes={
Object {
"filled": "MuiInputAdornment-filled-56",
"positionEnd": "MuiInputAdornment-positionEnd-58",
"positionStart": "MuiInputAdornment-positionStart-57",
"root": "MuiInputAdornment-root-55",
}
}
component="div"
disableTypography={false}
position="end"
>
<div
className="MuiInputAdornment-root-55 MuiInputAdornment-positionEnd-58"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
>
<FilterListIcon
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
>
<WithStyles(SvgIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
>
<SvgIcon
classes={
Object {
"colorAction": "MuiSvgIcon-colorAction-62",
"colorDisabled": "MuiSvgIcon-colorDisabled-64",
"colorError": "MuiSvgIcon-colorError-63",
"colorPrimary": "MuiSvgIcon-colorPrimary-60",
"colorSecondary": "MuiSvgIcon-colorSecondary-61",
"fontSizeInherit": "MuiSvgIcon-fontSizeInherit-65",
"fontSizeLarge": "MuiSvgIcon-fontSizeLarge-67",
"fontSizeSmall": "MuiSvgIcon-fontSizeSmall-66",
"root": "MuiSvgIcon-root-59",
}
}
color="inherit"
component="svg"
fontSize="default"
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
viewBox="0 0 24 24"
>
<svg
aria-hidden="true"
className="MuiSvgIcon-root-59"
focusable="false"
role="presentation"
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
viewBox="0 0 24 24"
>
<path
d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"
/>
<path
d="M0 0h24v24H0z"
fill="none"
/>
</svg>
</SvgIcon>
</WithStyles(SvgIcon)>
</FilterListIcon>
</pure(FilterListIcon)>
</div>
</InputAdornment>
</WithStyles(InputAdornment)>
<input
aria-invalid={false}
className="MuiInputBase-input-46 MuiOutlinedInput-input-31 MuiInputBase-inputAdornedStart-51 MuiOutlinedInput-inputAdornedStart-34"
disabled={false}
id="tableFilterBox"
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
required={false}
type="text"
value=""
/>
</div>
</InputBase>
</WithFormControlContext(InputBase)>
</WithStyles(WithFormControlContext(InputBase))>
</OutlinedInput>
</WithStyles(OutlinedInput)>
</div>
</FormControl>
</WithStyles(FormControl)>
</TextField>
</Input>
</div>
<div
className="header"
>
<div
className="columnName cell selectionToggle"
>
<Separator
orientation="horizontal"
units={40}
>
<span
style={
Object {
"display": "inline-block",
"minWidth": 40,
"width": 40,
}
}
/>
</Separator>
</div>
<div
className="columnName"
key="0"
style={
Object {
"width": "33.33333333333333%",
}
}
title="Experiment name"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Sort"
>
<Tooltip
TransitionComponent={[Function]}
classes={
Object {
"popper": "MuiTooltip-popper-68",
"popperInteractive": "MuiTooltip-popperInteractive-69",
"tooltip": "MuiTooltip-tooltip-70",
"tooltipPlacementBottom": "MuiTooltip-tooltipPlacementBottom-75",
"tooltipPlacementLeft": "MuiTooltip-tooltipPlacementLeft-72",
"tooltipPlacementRight": "MuiTooltip-tooltipPlacementRight-73",
"tooltipPlacementTop": "MuiTooltip-tooltipPlacementTop-74",
"touch": "MuiTooltip-touch-71",
}
}
disableFocusListener={false}
disableHoverListener={false}
disableTouchListener={false}
enterDelay={300}
enterTouchDelay={1000}
interactive={false}
leaveDelay={0}
leaveTouchDelay={1500}
placement="bottom"
theme={
Object {
"breakpoints": Object {
"between": [Function],
"down": [Function],
"keys": Array [
"xs",
"sm",
"md",
"lg",
"xl",
],
"only": [Function],
"up": [Function],
"values": Object {
"lg": 1280,
"md": 960,
"sm": 600,
"xl": 1920,
"xs": 0,
},
"width": [Function],
},
"direction": "ltr",
"mixins": Object {
"gutters": [Function],
"toolbar": Object {
"@media (min-width:0px) and (orientation: landscape)": Object {
"minHeight": 48,
},
"@media (min-width:600px)": Object {
"minHeight": 64,
},
"minHeight": 56,
},
},
"overrides": Object {},
"palette": Object {
"action": Object {
"active": "rgba(0, 0, 0, 0.54)",
"disabled": "rgba(0, 0, 0, 0.26)",
"disabledBackground": "rgba(0, 0, 0, 0.12)",
"hover": "rgba(0, 0, 0, 0.08)",
"hoverOpacity": 0.08,
"selected": "rgba(0, 0, 0, 0.14)",
},
"augmentColor": [Function],
"background": Object {
"default": "#fafafa",
"paper": "#fff",
},
"common": Object {
"black": "#000",
"white": "#fff",
},
"contrastThreshold": 3,
"divider": "rgba(0, 0, 0, 0.12)",
"error": Object {
"contrastText": "#fff",
"dark": "#d32f2f",
"light": "#e57373",
"main": "#f44336",
},
"getContrastText": [Function],
"grey": Object {
"100": "#f5f5f5",
"200": "#eeeeee",
"300": "#e0e0e0",
"400": "#bdbdbd",
"50": "#fafafa",
"500": "#9e9e9e",
"600": "#757575",
"700": "#616161",
"800": "#424242",
"900": "#212121",
"A100": "#d5d5d5",
"A200": "#aaaaaa",
"A400": "#303030",
"A700": "#616161",
},
"primary": Object {
"contrastText": "#fff",
"dark": "#303f9f",
"light": "#7986cb",
"main": "#3f51b5",
},
"secondary": Object {
"contrastText": "#fff",
"dark": "#c51162",
"light": "#ff4081",
"main": "#f50057",
},
"text": Object {
"disabled": "rgba(0, 0, 0, 0.38)",
"hint": "rgba(0, 0, 0, 0.38)",
"primary": "rgba(0, 0, 0, 0.87)",
"secondary": "rgba(0, 0, 0, 0.54)",
},
"tonalOffset": 0.2,
"type": "light",
},
"props": Object {},
"shadows": Array [
"none",
"0px 1px 3px 0px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 2px 1px -1px rgba(0,0,0,0.12)",
"0px 1px 5px 0px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 3px 1px -2px rgba(0,0,0,0.12)",
"0px 1px 8px 0px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 3px 3px -2px rgba(0,0,0,0.12)",
"0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)",
"0px 3px 5px -1px rgba(0,0,0,0.2),0px 5px 8px 0px rgba(0,0,0,0.14),0px 1px 14px 0px rgba(0,0,0,0.12)",
"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)",
"0px 4px 5px -2px rgba(0,0,0,0.2),0px 7px 10px 1px rgba(0,0,0,0.14),0px 2px 16px 1px rgba(0,0,0,0.12)",
"0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)",
"0px 5px 6px -3px rgba(0,0,0,0.2),0px 9px 12px 1px rgba(0,0,0,0.14),0px 3px 16px 2px rgba(0,0,0,0.12)",
"0px 6px 6px -3px rgba(0,0,0,0.2),0px 10px 14px 1px rgba(0,0,0,0.14),0px 4px 18px 3px rgba(0,0,0,0.12)",
"0px 6px 7px -4px rgba(0,0,0,0.2),0px 11px 15px 1px rgba(0,0,0,0.14),0px 4px 20px 3px rgba(0,0,0,0.12)",
"0px 7px 8px -4px rgba(0,0,0,0.2),0px 12px 17px 2px rgba(0,0,0,0.14),0px 5px 22px 4px rgba(0,0,0,0.12)",
"0px 7px 8px -4px rgba(0,0,0,0.2),0px 13px 19px 2px rgba(0,0,0,0.14),0px 5px 24px 4px rgba(0,0,0,0.12)",
"0px 7px 9px -4px rgba(0,0,0,0.2),0px 14px 21px 2px rgba(0,0,0,0.14),0px 5px 26px 4px rgba(0,0,0,0.12)",
"0px 8px 9px -5px rgba(0,0,0,0.2),0px 15px 22px 2px rgba(0,0,0,0.14),0px 6px 28px 5px rgba(0,0,0,0.12)",
"0px 8px 10px -5px rgba(0,0,0,0.2),0px 16px 24px 2px rgba(0,0,0,0.14),0px 6px 30px 5px rgba(0,0,0,0.12)",
"0px 8px 11px -5px rgba(0,0,0,0.2),0px 17px 26px 2px rgba(0,0,0,0.14),0px 6px 32px 5px rgba(0,0,0,0.12)",
"0px 9px 11px -5px rgba(0,0,0,0.2),0px 18px 28px 2px rgba(0,0,0,0.14),0px 7px 34px 6px rgba(0,0,0,0.12)",
"0px 9px 12px -6px rgba(0,0,0,0.2),0px 19px 29px 2px rgba(0,0,0,0.14),0px 7px 36px 6px rgba(0,0,0,0.12)",
"0px 10px 13px -6px rgba(0,0,0,0.2),0px 20px 31px 3px rgba(0,0,0,0.14),0px 8px 38px 7px rgba(0,0,0,0.12)",
"0px 10px 13px -6px rgba(0,0,0,0.2),0px 21px 33px 3px rgba(0,0,0,0.14),0px 8px 40px 7px rgba(0,0,0,0.12)",
"0px 10px 14px -6px rgba(0,0,0,0.2),0px 22px 35px 3px rgba(0,0,0,0.14),0px 8px 42px 7px rgba(0,0,0,0.12)",
"0px 11px 14px -7px rgba(0,0,0,0.2),0px 23px 36px 3px rgba(0,0,0,0.14),0px 9px 44px 8px rgba(0,0,0,0.12)",
"0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12)",
],
"shape": Object {
"borderRadius": 4,
},
"spacing": Object {
"unit": 8,
},
"transitions": Object {
"create": [Function],
"duration": Object {
"complex": 375,
"enteringScreen": 225,
"leavingScreen": 195,
"short": 250,
"shorter": 200,
"shortest": 150,
"standard": 300,
},
"easing": Object {
"easeIn": "cubic-bezier(0.4, 0, 1, 1)",
"easeInOut": "cubic-bezier(0.4, 0, 0.2, 1)",
"easeOut": "cubic-bezier(0.0, 0, 0.2, 1)",
"sharp": "cubic-bezier(0.4, 0, 0.6, 1)",
},
"getAutoHeightDuration": [Function],
},
"typography": Object {
"body1": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 400,
"lineHeight": "1.46429em",
},
"body1Next": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1rem",
"fontWeight": 400,
"letterSpacing": "0.00938em",
"lineHeight": 1.5,
},
"body2": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 500,
"lineHeight": "1.71429em",
},
"body2Next": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 400,
"letterSpacing": "0.01071em",
"lineHeight": 1.5,
},
"button": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 500,
"textTransform": "uppercase",
},
"buttonNext": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 500,
"letterSpacing": "0.02857em",
"lineHeight": 1.5,
"textTransform": "uppercase",
},
"caption": Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.75rem",
"fontWeight": 400,
"lineHeight": "1.375em",
},
"captionNext": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.75rem",
"fontWeight": 400,
"letterSpacing": "0.03333em",
"lineHeight": 1.66,
},
"display1": Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "2.125rem",
"fontWeight": 400,
"lineHeight": "1.20588em",
},
"display2": Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "2.8125rem",
"fontWeight": 400,
"lineHeight": "1.13333em",
"marginLeft": "-.02em",
},
"display3": Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "3.5rem",
"fontWeight": 400,
"letterSpacing": "-.02em",
"lineHeight": "1.30357em",
"marginLeft": "-.02em",
},
"display4": Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "7rem",
"fontWeight": 300,
"letterSpacing": "-.04em",
"lineHeight": "1.14286em",
"marginLeft": "-.04em",
},
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": 14,
"fontWeightLight": 300,
"fontWeightMedium": 500,
"fontWeightRegular": 400,
"h1": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "6rem",
"fontWeight": 300,
"letterSpacing": "-0.01562em",
"lineHeight": 1,
},
"h2": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "3.75rem",
"fontWeight": 300,
"letterSpacing": "-0.00833em",
"lineHeight": 1,
},
"h3": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "3rem",
"fontWeight": 400,
"letterSpacing": "0em",
"lineHeight": 1.04,
},
"h4": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "2.125rem",
"fontWeight": 400,
"letterSpacing": "0.00735em",
"lineHeight": 1.17,
},
"h5": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1.5rem",
"fontWeight": 400,
"letterSpacing": "0em",
"lineHeight": 1.33,
},
"h6": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1.25rem",
"fontWeight": 500,
"letterSpacing": "0.0075em",
"lineHeight": 1.6,
},
"headline": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1.5rem",
"fontWeight": 400,
"lineHeight": "1.35417em",
},
"overline": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.75rem",
"fontWeight": 400,
"letterSpacing": "0.08333em",
"lineHeight": 2.66,
"textTransform": "uppercase",
},
"pxToRem": [Function],
"round": [Function],
"subheading": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1rem",
"fontWeight": 400,
"lineHeight": "1.5em",
},
"subtitle1": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1rem",
"fontWeight": 400,
"letterSpacing": "0.00938em",
"lineHeight": 1.75,
},
"subtitle2": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 500,
"letterSpacing": "0.00714em",
"lineHeight": 1.57,
},
"title": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1.3125rem",
"fontWeight": 500,
"lineHeight": "1.16667em",
},
"useNextVariants": false,
},
"zIndex": Object {
"appBar": 1100,
"drawer": 1200,
"mobileStepper": 1000,
"modal": 1300,
"snackbar": 1400,
"tooltip": 1500,
},
}
}
title="Sort"
>
<RootRef
rootRef={[Function]}
>
<WithStyles(TableSortLabel)
active={false}
aria-describedby={null}
className="ellipsis"
direction="desc"
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="Sort"
>
<TableSortLabel
IconComponent={[Function]}
active={false}
aria-describedby={null}
className="ellipsis"
classes={
Object {
"active": "MuiTableSortLabel-active-77",
"icon": "MuiTableSortLabel-icon-78",
"iconDirectionAsc": "MuiTableSortLabel-iconDirectionAsc-80",
"iconDirectionDesc": "MuiTableSortLabel-iconDirectionDesc-79",
"root": "MuiTableSortLabel-root-76",
}
}
direction="desc"
hideSortIcon={false}
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="Sort"
>
<WithStyles(ButtonBase)
aria-describedby={null}
className="MuiTableSortLabel-root-76 ellipsis"
component="span"
disableRipple={true}
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="Sort"
>
<ButtonBase
aria-describedby={null}
centerRipple={false}
className="MuiTableSortLabel-root-76 ellipsis"
classes={
Object {
"disabled": "MuiButtonBase-disabled-82",
"focusVisible": "MuiButtonBase-focusVisible-83",
"root": "MuiButtonBase-root-81",
}
}
component="span"
disableRipple={true}
disableTouchRipple={false}
focusRipple={false}
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
tabIndex="0"
title="Sort"
type="button"
>
<span
aria-describedby={null}
className="MuiButtonBase-root-81 MuiTableSortLabel-root-76 ellipsis"
onBlur={[Function]}
onClick={[Function]}
onContextMenu={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
onMouseDown={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onMouseUp={[Function]}
onTouchEnd={[Function]}
onTouchMove={[Function]}
onTouchStart={[Function]}
role="button"
tabIndex="0"
title="Sort"
>
Experiment name
<pure(ArrowDownward)
className="MuiTableSortLabel-icon-78 MuiTableSortLabel-iconDirectionDesc-79"
>
<ArrowDownward
className="MuiTableSortLabel-icon-78 MuiTableSortLabel-iconDirectionDesc-79"
>
<WithStyles(SvgIcon)
className="MuiTableSortLabel-icon-78 MuiTableSortLabel-iconDirectionDesc-79"
>
<SvgIcon
className="MuiTableSortLabel-icon-78 MuiTableSortLabel-iconDirectionDesc-79"
classes={
Object {
"colorAction": "MuiSvgIcon-colorAction-62",
"colorDisabled": "MuiSvgIcon-colorDisabled-64",
"colorError": "MuiSvgIcon-colorError-63",
"colorPrimary": "MuiSvgIcon-colorPrimary-60",
"colorSecondary": "MuiSvgIcon-colorSecondary-61",
"fontSizeInherit": "MuiSvgIcon-fontSizeInherit-65",
"fontSizeLarge": "MuiSvgIcon-fontSizeLarge-67",
"fontSizeSmall": "MuiSvgIcon-fontSizeSmall-66",
"root": "MuiSvgIcon-root-59",
}
}
color="inherit"
component="svg"
fontSize="default"
viewBox="0 0 24 24"
>
<svg
aria-hidden="true"
className="MuiSvgIcon-root-59 MuiTableSortLabel-icon-78 MuiTableSortLabel-iconDirectionDesc-79"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
>
<path
d="M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
/>
</svg>
</SvgIcon>
</WithStyles(SvgIcon)>
</ArrowDownward>
</pure(ArrowDownward)>
</span>
</ButtonBase>
</WithStyles(ButtonBase)>
</TableSortLabel>
</WithStyles(TableSortLabel)>
</RootRef>
<Popper
anchorEl={
<span
class="MuiButtonBase-root-81 MuiTableSortLabel-root-76 ellipsis"
role="button"
tabindex="0"
title="Sort"
>
Experiment name
<svg
aria-hidden="true"
class="MuiSvgIcon-root-59 MuiTableSortLabel-icon-78 MuiTableSortLabel-iconDirectionDesc-79"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
>
<path
d="M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
/>
</svg>
</span>
}
className="MuiTooltip-popper-68"
disablePortal={false}
id={null}
open={false}
placement="bottom"
transition={true}
/>
</Tooltip>
</WithStyles(Tooltip)>
</div>
<div
className="columnName"
key="1"
style={
Object {
"width": "66.66666666666666%",
}
}
title="Description"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<Tooltip
TransitionComponent={[Function]}
classes={
Object {
"popper": "MuiTooltip-popper-68",
"popperInteractive": "MuiTooltip-popperInteractive-69",
"tooltip": "MuiTooltip-tooltip-70",
"tooltipPlacementBottom": "MuiTooltip-tooltipPlacementBottom-75",
"tooltipPlacementLeft": "MuiTooltip-tooltipPlacementLeft-72",
"tooltipPlacementRight": "MuiTooltip-tooltipPlacementRight-73",
"tooltipPlacementTop": "MuiTooltip-tooltipPlacementTop-74",
"touch": "MuiTooltip-touch-71",
}
}
disableFocusListener={false}
disableHoverListener={false}
disableTouchListener={false}
enterDelay={300}
enterTouchDelay={1000}
interactive={false}
leaveDelay={0}
leaveTouchDelay={1500}
placement="bottom"
theme={
Object {
"breakpoints": Object {
"between": [Function],
"down": [Function],
"keys": Array [
"xs",
"sm",
"md",
"lg",
"xl",
],
"only": [Function],
"up": [Function],
"values": Object {
"lg": 1280,
"md": 960,
"sm": 600,
"xl": 1920,
"xs": 0,
},
"width": [Function],
},
"direction": "ltr",
"mixins": Object {
"gutters": [Function],
"toolbar": Object {
"@media (min-width:0px) and (orientation: landscape)": Object {
"minHeight": 48,
},
"@media (min-width:600px)": Object {
"minHeight": 64,
},
"minHeight": 56,
},
},
"overrides": Object {},
"palette": Object {
"action": Object {
"active": "rgba(0, 0, 0, 0.54)",
"disabled": "rgba(0, 0, 0, 0.26)",
"disabledBackground": "rgba(0, 0, 0, 0.12)",
"hover": "rgba(0, 0, 0, 0.08)",
"hoverOpacity": 0.08,
"selected": "rgba(0, 0, 0, 0.14)",
},
"augmentColor": [Function],
"background": Object {
"default": "#fafafa",
"paper": "#fff",
},
"common": Object {
"black": "#000",
"white": "#fff",
},
"contrastThreshold": 3,
"divider": "rgba(0, 0, 0, 0.12)",
"error": Object {
"contrastText": "#fff",
"dark": "#d32f2f",
"light": "#e57373",
"main": "#f44336",
},
"getContrastText": [Function],
"grey": Object {
"100": "#f5f5f5",
"200": "#eeeeee",
"300": "#e0e0e0",
"400": "#bdbdbd",
"50": "#fafafa",
"500": "#9e9e9e",
"600": "#757575",
"700": "#616161",
"800": "#424242",
"900": "#212121",
"A100": "#d5d5d5",
"A200": "#aaaaaa",
"A400": "#303030",
"A700": "#616161",
},
"primary": Object {
"contrastText": "#fff",
"dark": "#303f9f",
"light": "#7986cb",
"main": "#3f51b5",
},
"secondary": Object {
"contrastText": "#fff",
"dark": "#c51162",
"light": "#ff4081",
"main": "#f50057",
},
"text": Object {
"disabled": "rgba(0, 0, 0, 0.38)",
"hint": "rgba(0, 0, 0, 0.38)",
"primary": "rgba(0, 0, 0, 0.87)",
"secondary": "rgba(0, 0, 0, 0.54)",
},
"tonalOffset": 0.2,
"type": "light",
},
"props": Object {},
"shadows": Array [
"none",
"0px 1px 3px 0px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 2px 1px -1px rgba(0,0,0,0.12)",
"0px 1px 5px 0px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 3px 1px -2px rgba(0,0,0,0.12)",
"0px 1px 8px 0px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 3px 3px -2px rgba(0,0,0,0.12)",
"0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)",
"0px 3px 5px -1px rgba(0,0,0,0.2),0px 5px 8px 0px rgba(0,0,0,0.14),0px 1px 14px 0px rgba(0,0,0,0.12)",
"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)",
"0px 4px 5px -2px rgba(0,0,0,0.2),0px 7px 10px 1px rgba(0,0,0,0.14),0px 2px 16px 1px rgba(0,0,0,0.12)",
"0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)",
"0px 5px 6px -3px rgba(0,0,0,0.2),0px 9px 12px 1px rgba(0,0,0,0.14),0px 3px 16px 2px rgba(0,0,0,0.12)",
"0px 6px 6px -3px rgba(0,0,0,0.2),0px 10px 14px 1px rgba(0,0,0,0.14),0px 4px 18px 3px rgba(0,0,0,0.12)",
"0px 6px 7px -4px rgba(0,0,0,0.2),0px 11px 15px 1px rgba(0,0,0,0.14),0px 4px 20px 3px rgba(0,0,0,0.12)",
"0px 7px 8px -4px rgba(0,0,0,0.2),0px 12px 17px 2px rgba(0,0,0,0.14),0px 5px 22px 4px rgba(0,0,0,0.12)",
"0px 7px 8px -4px rgba(0,0,0,0.2),0px 13px 19px 2px rgba(0,0,0,0.14),0px 5px 24px 4px rgba(0,0,0,0.12)",
"0px 7px 9px -4px rgba(0,0,0,0.2),0px 14px 21px 2px rgba(0,0,0,0.14),0px 5px 26px 4px rgba(0,0,0,0.12)",
"0px 8px 9px -5px rgba(0,0,0,0.2),0px 15px 22px 2px rgba(0,0,0,0.14),0px 6px 28px 5px rgba(0,0,0,0.12)",
"0px 8px 10px -5px rgba(0,0,0,0.2),0px 16px 24px 2px rgba(0,0,0,0.14),0px 6px 30px 5px rgba(0,0,0,0.12)",
"0px 8px 11px -5px rgba(0,0,0,0.2),0px 17px 26px 2px rgba(0,0,0,0.14),0px 6px 32px 5px rgba(0,0,0,0.12)",
"0px 9px 11px -5px rgba(0,0,0,0.2),0px 18px 28px 2px rgba(0,0,0,0.14),0px 7px 34px 6px rgba(0,0,0,0.12)",
"0px 9px 12px -6px rgba(0,0,0,0.2),0px 19px 29px 2px rgba(0,0,0,0.14),0px 7px 36px 6px rgba(0,0,0,0.12)",
"0px 10px 13px -6px rgba(0,0,0,0.2),0px 20px 31px 3px rgba(0,0,0,0.14),0px 8px 38px 7px rgba(0,0,0,0.12)",
"0px 10px 13px -6px rgba(0,0,0,0.2),0px 21px 33px 3px rgba(0,0,0,0.14),0px 8px 40px 7px rgba(0,0,0,0.12)",
"0px 10px 14px -6px rgba(0,0,0,0.2),0px 22px 35px 3px rgba(0,0,0,0.14),0px 8px 42px 7px rgba(0,0,0,0.12)",
"0px 11px 14px -7px rgba(0,0,0,0.2),0px 23px 36px 3px rgba(0,0,0,0.14),0px 9px 44px 8px rgba(0,0,0,0.12)",
"0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12)",
],
"shape": Object {
"borderRadius": 4,
},
"spacing": Object {
"unit": 8,
},
"transitions": Object {
"create": [Function],
"duration": Object {
"complex": 375,
"enteringScreen": 225,
"leavingScreen": 195,
"short": 250,
"shorter": 200,
"shortest": 150,
"standard": 300,
},
"easing": Object {
"easeIn": "cubic-bezier(0.4, 0, 1, 1)",
"easeInOut": "cubic-bezier(0.4, 0, 0.2, 1)",
"easeOut": "cubic-bezier(0.0, 0, 0.2, 1)",
"sharp": "cubic-bezier(0.4, 0, 0.6, 1)",
},
"getAutoHeightDuration": [Function],
},
"typography": Object {
"body1": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 400,
"lineHeight": "1.46429em",
},
"body1Next": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1rem",
"fontWeight": 400,
"letterSpacing": "0.00938em",
"lineHeight": 1.5,
},
"body2": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 500,
"lineHeight": "1.71429em",
},
"body2Next": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 400,
"letterSpacing": "0.01071em",
"lineHeight": 1.5,
},
"button": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 500,
"textTransform": "uppercase",
},
"buttonNext": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 500,
"letterSpacing": "0.02857em",
"lineHeight": 1.5,
"textTransform": "uppercase",
},
"caption": Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.75rem",
"fontWeight": 400,
"lineHeight": "1.375em",
},
"captionNext": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.75rem",
"fontWeight": 400,
"letterSpacing": "0.03333em",
"lineHeight": 1.66,
},
"display1": Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "2.125rem",
"fontWeight": 400,
"lineHeight": "1.20588em",
},
"display2": Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "2.8125rem",
"fontWeight": 400,
"lineHeight": "1.13333em",
"marginLeft": "-.02em",
},
"display3": Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "3.5rem",
"fontWeight": 400,
"letterSpacing": "-.02em",
"lineHeight": "1.30357em",
"marginLeft": "-.02em",
},
"display4": Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "7rem",
"fontWeight": 300,
"letterSpacing": "-.04em",
"lineHeight": "1.14286em",
"marginLeft": "-.04em",
},
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": 14,
"fontWeightLight": 300,
"fontWeightMedium": 500,
"fontWeightRegular": 400,
"h1": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "6rem",
"fontWeight": 300,
"letterSpacing": "-0.01562em",
"lineHeight": 1,
},
"h2": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "3.75rem",
"fontWeight": 300,
"letterSpacing": "-0.00833em",
"lineHeight": 1,
},
"h3": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "3rem",
"fontWeight": 400,
"letterSpacing": "0em",
"lineHeight": 1.04,
},
"h4": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "2.125rem",
"fontWeight": 400,
"letterSpacing": "0.00735em",
"lineHeight": 1.17,
},
"h5": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1.5rem",
"fontWeight": 400,
"letterSpacing": "0em",
"lineHeight": 1.33,
},
"h6": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1.25rem",
"fontWeight": 500,
"letterSpacing": "0.0075em",
"lineHeight": 1.6,
},
"headline": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1.5rem",
"fontWeight": 400,
"lineHeight": "1.35417em",
},
"overline": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.75rem",
"fontWeight": 400,
"letterSpacing": "0.08333em",
"lineHeight": 2.66,
"textTransform": "uppercase",
},
"pxToRem": [Function],
"round": [Function],
"subheading": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1rem",
"fontWeight": 400,
"lineHeight": "1.5em",
},
"subtitle1": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1rem",
"fontWeight": 400,
"letterSpacing": "0.00938em",
"lineHeight": 1.75,
},
"subtitle2": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 500,
"letterSpacing": "0.00714em",
"lineHeight": 1.57,
},
"title": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1.3125rem",
"fontWeight": 500,
"lineHeight": "1.16667em",
},
"useNextVariants": false,
},
"zIndex": Object {
"appBar": 1100,
"drawer": 1200,
"mobileStepper": 1000,
"modal": 1300,
"snackbar": 1400,
"tooltip": 1500,
},
}
}
title="Cannot sort by this column"
>
<RootRef
rootRef={[Function]}
>
<WithStyles(TableSortLabel)
active={false}
aria-describedby={null}
className="ellipsis"
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="Cannot sort by this column"
>
<TableSortLabel
IconComponent={[Function]}
active={false}
aria-describedby={null}
className="ellipsis"
classes={
Object {
"active": "MuiTableSortLabel-active-77",
"icon": "MuiTableSortLabel-icon-78",
"iconDirectionAsc": "MuiTableSortLabel-iconDirectionAsc-80",
"iconDirectionDesc": "MuiTableSortLabel-iconDirectionDesc-79",
"root": "MuiTableSortLabel-root-76",
}
}
direction="desc"
hideSortIcon={false}
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="Cannot sort by this column"
>
<WithStyles(ButtonBase)
aria-describedby={null}
className="MuiTableSortLabel-root-76 ellipsis"
component="span"
disableRipple={true}
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
title="Cannot sort by this column"
>
<ButtonBase
aria-describedby={null}
centerRipple={false}
className="MuiTableSortLabel-root-76 ellipsis"
classes={
Object {
"disabled": "MuiButtonBase-disabled-82",
"focusVisible": "MuiButtonBase-focusVisible-83",
"root": "MuiButtonBase-root-81",
}
}
component="span"
disableRipple={true}
disableTouchRipple={false}
focusRipple={false}
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onTouchEnd={[Function]}
onTouchStart={[Function]}
tabIndex="0"
title="Cannot sort by this column"
type="button"
>
<span
aria-describedby={null}
className="MuiButtonBase-root-81 MuiTableSortLabel-root-76 ellipsis"
onBlur={[Function]}
onClick={[Function]}
onContextMenu={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
onMouseDown={[Function]}
onMouseLeave={[Function]}
onMouseOver={[Function]}
onMouseUp={[Function]}
onTouchEnd={[Function]}
onTouchMove={[Function]}
onTouchStart={[Function]}
role="button"
tabIndex="0"
title="Cannot sort by this column"
>
Description
<pure(ArrowDownward)
className="MuiTableSortLabel-icon-78 MuiTableSortLabel-iconDirectionDesc-79"
>
<ArrowDownward
className="MuiTableSortLabel-icon-78 MuiTableSortLabel-iconDirectionDesc-79"
>
<WithStyles(SvgIcon)
className="MuiTableSortLabel-icon-78 MuiTableSortLabel-iconDirectionDesc-79"
>
<SvgIcon
className="MuiTableSortLabel-icon-78 MuiTableSortLabel-iconDirectionDesc-79"
classes={
Object {
"colorAction": "MuiSvgIcon-colorAction-62",
"colorDisabled": "MuiSvgIcon-colorDisabled-64",
"colorError": "MuiSvgIcon-colorError-63",
"colorPrimary": "MuiSvgIcon-colorPrimary-60",
"colorSecondary": "MuiSvgIcon-colorSecondary-61",
"fontSizeInherit": "MuiSvgIcon-fontSizeInherit-65",
"fontSizeLarge": "MuiSvgIcon-fontSizeLarge-67",
"fontSizeSmall": "MuiSvgIcon-fontSizeSmall-66",
"root": "MuiSvgIcon-root-59",
}
}
color="inherit"
component="svg"
fontSize="default"
viewBox="0 0 24 24"
>
<svg
aria-hidden="true"
className="MuiSvgIcon-root-59 MuiTableSortLabel-icon-78 MuiTableSortLabel-iconDirectionDesc-79"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
>
<path
d="M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
/>
</svg>
</SvgIcon>
</WithStyles(SvgIcon)>
</ArrowDownward>
</pure(ArrowDownward)>
</span>
</ButtonBase>
</WithStyles(ButtonBase)>
</TableSortLabel>
</WithStyles(TableSortLabel)>
</RootRef>
<Popper
anchorEl={
<span
class="MuiButtonBase-root-81 MuiTableSortLabel-root-76 ellipsis"
role="button"
tabindex="0"
title="Cannot sort by this column"
>
Description
<svg
aria-hidden="true"
class="MuiSvgIcon-root-59 MuiTableSortLabel-icon-78 MuiTableSortLabel-iconDirectionDesc-79"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
>
<path
d="M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
/>
</svg>
</span>
}
className="MuiTooltip-popper-68"
disablePortal={false}
id={null}
open={false}
placement="bottom"
transition={true}
/>
</Tooltip>
</WithStyles(Tooltip)>
</div>
</div>
<div
className="scrollContainer"
style={
Object {
"minHeight": 60,
}
}
>
<div
className="emptyMessage"
>
No experiments found. Click "Create experiment" to start.
</div>
</div>
<div
className="footer"
>
<span
className=""
>
Rows per page:
</span>
<TextField
InputProps={
Object {
"disableUnderline": true,
}
}
className="rowsPerPage"
classes={
Object {
"root": "verticalAlignInitial",
}
}
onChange={[Function]}
required={false}
select={true}
value={10}
variant="standard"
>
<WithStyles(FormControl)
className="rowsPerPage"
classes={
Object {
"root": "verticalAlignInitial",
}
}
required={false}
variant="standard"
>
<FormControl
className="rowsPerPage"
classes={
Object {
"fullWidth": "MuiFormControl-fullWidth-4",
"marginDense": "MuiFormControl-marginDense-3",
"marginNormal": "MuiFormControl-marginNormal-2",
"root": "MuiFormControl-root-1 verticalAlignInitial",
}
}
component="div"
disabled={false}
error={false}
fullWidth={false}
margin="none"
required={false}
variant="standard"
>
<div
className="MuiFormControl-root-1 verticalAlignInitial rowsPerPage"
>
<WithStyles(WithFormControlContext(Select))
input={
<WithStyles(Input)
disableUnderline={true}
onChange={[Function]}
value={10}
/>
}
value={10}
>
<WithFormControlContext(Select)
classes={
Object {
"disabled": "MuiSelect-disabled-89",
"filled": "MuiSelect-filled-86",
"icon": "MuiSelect-icon-90",
"outlined": "MuiSelect-outlined-87",
"root": "MuiSelect-root-84",
"select": "MuiSelect-select-85",
"selectMenu": "MuiSelect-selectMenu-88",
}
}
input={
<WithStyles(Input)
disableUnderline={true}
onChange={[Function]}
value={10}
/>
}
value={10}
>
<Select
IconComponent={[Function]}
autoWidth={false}
classes={
Object {
"disabled": "MuiSelect-disabled-89",
"filled": "MuiSelect-filled-86",
"icon": "MuiSelect-icon-90",
"outlined": "MuiSelect-outlined-87",
"root": "MuiSelect-root-84",
"select": "MuiSelect-select-85",
"selectMenu": "MuiSelect-selectMenu-88",
}
}
displayEmpty={false}
input={
<WithStyles(Input)
disableUnderline={true}
onChange={[Function]}
value={10}
/>
}
muiFormControl={
Object {
"adornedStart": false,
"disabled": false,
"error": false,
"filled": true,
"focused": false,
"margin": "none",
"onBlur": [Function],
"onEmpty": [Function],
"onFilled": [Function],
"onFocus": [Function],
"required": false,
"variant": "standard",
}
}
multiple={false}
native={false}
value={10}
>
<WithStyles(Input)
disableUnderline={true}
inputComponent={[Function]}
inputProps={
Object {
"IconComponent": [Function],
"MenuProps": undefined,
"SelectDisplayProps": undefined,
"autoWidth": false,
"children": Array [
<WithStyles(MenuItem)
value={10}
>
10
</WithStyles(MenuItem)>,
<WithStyles(MenuItem)
value={20}
>
20
</WithStyles(MenuItem)>,
<WithStyles(MenuItem)
value={50}
>
50
</WithStyles(MenuItem)>,
<WithStyles(MenuItem)
value={100}
>
100
</WithStyles(MenuItem)>,
],
"classes": Object {
"disabled": "MuiSelect-disabled-89",
"filled": "MuiSelect-filled-86",
"icon": "MuiSelect-icon-90",
"outlined": "MuiSelect-outlined-87",
"root": "MuiSelect-root-84",
"select": "MuiSelect-select-85",
"selectMenu": "MuiSelect-selectMenu-88",
},
"displayEmpty": false,
"multiple": false,
"onClose": undefined,
"onOpen": undefined,
"open": undefined,
"renderValue": undefined,
"type": undefined,
"variant": "standard",
}
}
onChange={[Function]}
value={10}
>
<Input
classes={
Object {
"disabled": "MuiInput-disabled-94",
"error": "MuiInput-error-96",
"focused": "MuiInput-focused-93",
"formControl": "MuiInput-formControl-92",
"fullWidth": "MuiInput-fullWidth-98",
"input": "MuiInput-input-99",
"inputMarginDense": "MuiInput-inputMarginDense-100",
"inputMultiline": "MuiInput-inputMultiline-101",
"inputType": "MuiInput-inputType-102",
"inputTypeSearch": "MuiInput-inputTypeSearch-103",
"multiline": "MuiInput-multiline-97",
"root": "MuiInput-root-91",
"underline": "MuiInput-underline-95",
}
}
disableUnderline={true}
inputComponent={[Function]}
inputProps={
Object {
"IconComponent": [Function],
"MenuProps": undefined,
"SelectDisplayProps": undefined,
"autoWidth": false,
"children": Array [
<WithStyles(MenuItem)
value={10}
>
10
</WithStyles(MenuItem)>,
<WithStyles(MenuItem)
value={20}
>
20
</WithStyles(MenuItem)>,
<WithStyles(MenuItem)
value={50}
>
50
</WithStyles(MenuItem)>,
<WithStyles(MenuItem)
value={100}
>
100
</WithStyles(MenuItem)>,
],
"classes": Object {
"disabled": "MuiSelect-disabled-89",
"filled": "MuiSelect-filled-86",
"icon": "MuiSelect-icon-90",
"outlined": "MuiSelect-outlined-87",
"root": "MuiSelect-root-84",
"select": "MuiSelect-select-85",
"selectMenu": "MuiSelect-selectMenu-88",
},
"displayEmpty": false,
"multiple": false,
"onClose": undefined,
"onOpen": undefined,
"open": undefined,
"renderValue": undefined,
"type": undefined,
"variant": "standard",
}
}
onChange={[Function]}
value={10}
>
<WithStyles(WithFormControlContext(InputBase))
classes={
Object {
"disabled": "MuiInput-disabled-94",
"error": "MuiInput-error-96",
"focused": "MuiInput-focused-93",
"formControl": "MuiInput-formControl-92",
"fullWidth": "MuiInput-fullWidth-98",
"input": "MuiInput-input-99",
"inputMarginDense": "MuiInput-inputMarginDense-100",
"inputMultiline": "MuiInput-inputMultiline-101",
"inputType": "MuiInput-inputType-102",
"inputTypeSearch": "MuiInput-inputTypeSearch-103",
"multiline": "MuiInput-multiline-97",
"root": "MuiInput-root-91",
"underline": null,
}
}
fullWidth={false}
inputComponent={[Function]}
inputProps={
Object {
"IconComponent": [Function],
"MenuProps": undefined,
"SelectDisplayProps": undefined,
"autoWidth": false,
"children": Array [
<WithStyles(MenuItem)
value={10}
>
10
</WithStyles(MenuItem)>,
<WithStyles(MenuItem)
value={20}
>
20
</WithStyles(MenuItem)>,
<WithStyles(MenuItem)
value={50}
>
50
</WithStyles(MenuItem)>,
<WithStyles(MenuItem)
value={100}
>
100
</WithStyles(MenuItem)>,
],
"classes": Object {
"disabled": "MuiSelect-disabled-89",
"filled": "MuiSelect-filled-86",
"icon": "MuiSelect-icon-90",
"outlined": "MuiSelect-outlined-87",
"root": "MuiSelect-root-84",
"select": "MuiSelect-select-85",
"selectMenu": "MuiSelect-selectMenu-88",
},
"displayEmpty": false,
"multiple": false,
"onClose": undefined,
"onOpen": undefined,
"open": undefined,
"renderValue": undefined,
"type": undefined,
"variant": "standard",
}
}
multiline={false}
onChange={[Function]}
type="text"
value={10}
>
<WithFormControlContext(InputBase)
classes={
Object {
"adornedEnd": "MuiInputBase-adornedEnd-41",
"adornedStart": "MuiInputBase-adornedStart-40",
"disabled": "MuiInputBase-disabled-39 MuiInput-disabled-94",
"error": "MuiInputBase-error-42 MuiInput-error-96",
"focused": "MuiInputBase-focused-38 MuiInput-focused-93",
"formControl": "MuiInputBase-formControl-37 MuiInput-formControl-92",
"fullWidth": "MuiInputBase-fullWidth-45 MuiInput-fullWidth-98",
"input": "MuiInputBase-input-46 MuiInput-input-99",
"inputAdornedEnd": "MuiInputBase-inputAdornedEnd-52",
"inputAdornedStart": "MuiInputBase-inputAdornedStart-51",
"inputMarginDense": "MuiInputBase-inputMarginDense-47 MuiInput-inputMarginDense-100",
"inputMultiline": "MuiInputBase-inputMultiline-48 MuiInput-inputMultiline-101",
"inputType": "MuiInputBase-inputType-49 MuiInput-inputType-102",
"inputTypeSearch": "MuiInputBase-inputTypeSearch-50 MuiInput-inputTypeSearch-103",
"marginDense": "MuiInputBase-marginDense-43",
"multiline": "MuiInputBase-multiline-44 MuiInput-multiline-97",
"root": "MuiInputBase-root-36 MuiInput-root-91",
}
}
fullWidth={false}
inputComponent={[Function]}
inputProps={
Object {
"IconComponent": [Function],
"MenuProps": undefined,
"SelectDisplayProps": undefined,
"autoWidth": false,
"children": Array [
<WithStyles(MenuItem)
value={10}
>
10
</WithStyles(MenuItem)>,
<WithStyles(MenuItem)
value={20}
>
20
</WithStyles(MenuItem)>,
<WithStyles(MenuItem)
value={50}
>
50
</WithStyles(MenuItem)>,
<WithStyles(MenuItem)
value={100}
>
100
</WithStyles(MenuItem)>,
],
"classes": Object {
"disabled": "MuiSelect-disabled-89",
"filled": "MuiSelect-filled-86",
"icon": "MuiSelect-icon-90",
"outlined": "MuiSelect-outlined-87",
"root": "MuiSelect-root-84",
"select": "MuiSelect-select-85",
"selectMenu": "MuiSelect-selectMenu-88",
},
"displayEmpty": false,
"multiple": false,
"onClose": undefined,
"onOpen": undefined,
"open": undefined,
"renderValue": undefined,
"type": undefined,
"variant": "standard",
}
}
multiline={false}
onChange={[Function]}
type="text"
value={10}
>
<InputBase
classes={
Object {
"adornedEnd": "MuiInputBase-adornedEnd-41",
"adornedStart": "MuiInputBase-adornedStart-40",
"disabled": "MuiInputBase-disabled-39 MuiInput-disabled-94",
"error": "MuiInputBase-error-42 MuiInput-error-96",
"focused": "MuiInputBase-focused-38 MuiInput-focused-93",
"formControl": "MuiInputBase-formControl-37 MuiInput-formControl-92",
"fullWidth": "MuiInputBase-fullWidth-45 MuiInput-fullWidth-98",
"input": "MuiInputBase-input-46 MuiInput-input-99",
"inputAdornedEnd": "MuiInputBase-inputAdornedEnd-52",
"inputAdornedStart": "MuiInputBase-inputAdornedStart-51",
"inputMarginDense": "MuiInputBase-inputMarginDense-47 MuiInput-inputMarginDense-100",
"inputMultiline": "MuiInputBase-inputMultiline-48 MuiInput-inputMultiline-101",
"inputType": "MuiInputBase-inputType-49 MuiInput-inputType-102",
"inputTypeSearch": "MuiInputBase-inputTypeSearch-50 MuiInput-inputTypeSearch-103",
"marginDense": "MuiInputBase-marginDense-43",
"multiline": "MuiInputBase-multiline-44 MuiInput-multiline-97",
"root": "MuiInputBase-root-36 MuiInput-root-91",
}
}
fullWidth={false}
inputComponent={[Function]}
inputProps={
Object {
"IconComponent": [Function],
"MenuProps": undefined,
"SelectDisplayProps": undefined,
"autoWidth": false,
"children": Array [
<WithStyles(MenuItem)
value={10}
>
10
</WithStyles(MenuItem)>,
<WithStyles(MenuItem)
value={20}
>
20
</WithStyles(MenuItem)>,
<WithStyles(MenuItem)
value={50}
>
50
</WithStyles(MenuItem)>,
<WithStyles(MenuItem)
value={100}
>
100
</WithStyles(MenuItem)>,
],
"classes": Object {
"disabled": "MuiSelect-disabled-89",
"filled": "MuiSelect-filled-86",
"icon": "MuiSelect-icon-90",
"outlined": "MuiSelect-outlined-87",
"root": "MuiSelect-root-84",
"select": "MuiSelect-select-85",
"selectMenu": "MuiSelect-selectMenu-88",
},
"displayEmpty": false,
"multiple": false,
"onClose": undefined,
"onOpen": undefined,
"open": undefined,
"renderValue": undefined,
"type": undefined,
"variant": "standard",
}
}
muiFormControl={
Object {
"adornedStart": false,
"disabled": false,
"error": false,
"filled": true,
"focused": false,
"margin": "none",
"onBlur": [Function],
"onEmpty": [Function],
"onFilled": [Function],
"onFocus": [Function],
"required": false,
"variant": "standard",
}
}
multiline={false}
onChange={[Function]}
type="text"
value={10}
>
<div
className="MuiInputBase-root-36 MuiInput-root-91 MuiInputBase-formControl-37 MuiInput-formControl-92"
onClick={[Function]}
>
<SelectInput
IconComponent={[Function]}
aria-invalid={false}
autoWidth={false}
className="MuiInputBase-input-46 MuiInput-input-99"
classes={
Object {
"disabled": "MuiSelect-disabled-89",
"filled": "MuiSelect-filled-86",
"icon": "MuiSelect-icon-90",
"outlined": "MuiSelect-outlined-87",
"root": "MuiSelect-root-84",
"select": "MuiSelect-select-85",
"selectMenu": "MuiSelect-selectMenu-88",
}
}
disabled={false}
displayEmpty={false}
inputRef={[Function]}
multiple={false}
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
required={false}
value={10}
variant="standard"
>
<div
className="MuiSelect-root-84"
>
<div
aria-haspopup="true"
aria-pressed="false"
className="MuiSelect-select-85 MuiSelect-selectMenu-88 MuiInputBase-input-46 MuiInput-input-99"
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
role="button"
tabIndex={0}
>
10
</div>
<input
type="hidden"
value={10}
/>
<pure(ArrowDropDown)
className="MuiSelect-icon-90"
>
<ArrowDropDown
className="MuiSelect-icon-90"
>
<WithStyles(SvgIcon)
className="MuiSelect-icon-90"
>
<SvgIcon
className="MuiSelect-icon-90"
classes={
Object {
"colorAction": "MuiSvgIcon-colorAction-62",
"colorDisabled": "MuiSvgIcon-colorDisabled-64",
"colorError": "MuiSvgIcon-colorError-63",
"colorPrimary": "MuiSvgIcon-colorPrimary-60",
"colorSecondary": "MuiSvgIcon-colorSecondary-61",
"fontSizeInherit": "MuiSvgIcon-fontSizeInherit-65",
"fontSizeLarge": "MuiSvgIcon-fontSizeLarge-67",
"fontSizeSmall": "MuiSvgIcon-fontSizeSmall-66",
"root": "MuiSvgIcon-root-59",
}
}
color="inherit"
component="svg"
fontSize="default"
viewBox="0 0 24 24"
>
<svg
aria-hidden="true"
className="MuiSvgIcon-root-59 MuiSelect-icon-90"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
>
<path
d="M7 10l5 5 5-5z"
/>
</svg>
</SvgIcon>
</WithStyles(SvgIcon)>
</ArrowDropDown>
</pure(ArrowDropDown)>
<WithStyles(Menu)
MenuListProps={
Object {
"role": "listbox",
}
}
PaperProps={
Object {
"style": Object {
"minWidth": null,
},
}
}
anchorEl={
<div
aria-haspopup="true"
aria-pressed="false"
class="MuiSelect-select-85 MuiSelect-selectMenu-88 MuiInputBase-input-46 MuiInput-input-99"
role="button"
tabindex="0"
>
10
</div>
}
id="menu-"
onClose={[Function]}
open={false}
>
<Menu
MenuListProps={
Object {
"role": "listbox",
}
}
PaperProps={
Object {
"style": Object {
"minWidth": null,
},
}
}
anchorEl={
<div
aria-haspopup="true"
aria-pressed="false"
class="MuiSelect-select-85 MuiSelect-selectMenu-88 MuiInputBase-input-46 MuiInput-input-99"
role="button"
tabindex="0"
>
10
</div>
}
classes={
Object {
"paper": "MuiMenu-paper-104",
}
}
disableAutoFocusItem={false}
id="menu-"
onClose={[Function]}
open={false}
theme={
Object {
"breakpoints": Object {
"between": [Function],
"down": [Function],
"keys": Array [
"xs",
"sm",
"md",
"lg",
"xl",
],
"only": [Function],
"up": [Function],
"values": Object {
"lg": 1280,
"md": 960,
"sm": 600,
"xl": 1920,
"xs": 0,
},
"width": [Function],
},
"direction": "ltr",
"mixins": Object {
"gutters": [Function],
"toolbar": Object {
"@media (min-width:0px) and (orientation: landscape)": Object {
"minHeight": 48,
},
"@media (min-width:600px)": Object {
"minHeight": 64,
},
"minHeight": 56,
},
},
"overrides": Object {},
"palette": Object {
"action": Object {
"active": "rgba(0, 0, 0, 0.54)",
"disabled": "rgba(0, 0, 0, 0.26)",
"disabledBackground": "rgba(0, 0, 0, 0.12)",
"hover": "rgba(0, 0, 0, 0.08)",
"hoverOpacity": 0.08,
"selected": "rgba(0, 0, 0, 0.14)",
},
"augmentColor": [Function],
"background": Object {
"default": "#fafafa",
"paper": "#fff",
},
"common": Object {
"black": "#000",
"white": "#fff",
},
"contrastThreshold": 3,
"divider": "rgba(0, 0, 0, 0.12)",
"error": Object {
"contrastText": "#fff",
"dark": "#d32f2f",
"light": "#e57373",
"main": "#f44336",
},
"getContrastText": [Function],
"grey": Object {
"100": "#f5f5f5",
"200": "#eeeeee",
"300": "#e0e0e0",
"400": "#bdbdbd",
"50": "#fafafa",
"500": "#9e9e9e",
"600": "#757575",
"700": "#616161",
"800": "#424242",
"900": "#212121",
"A100": "#d5d5d5",
"A200": "#aaaaaa",
"A400": "#303030",
"A700": "#616161",
},
"primary": Object {
"contrastText": "#fff",
"dark": "#303f9f",
"light": "#7986cb",
"main": "#3f51b5",
},
"secondary": Object {
"contrastText": "#fff",
"dark": "#c51162",
"light": "#ff4081",
"main": "#f50057",
},
"text": Object {
"disabled": "rgba(0, 0, 0, 0.38)",
"hint": "rgba(0, 0, 0, 0.38)",
"primary": "rgba(0, 0, 0, 0.87)",
"secondary": "rgba(0, 0, 0, 0.54)",
},
"tonalOffset": 0.2,
"type": "light",
},
"props": Object {},
"shadows": Array [
"none",
"0px 1px 3px 0px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 2px 1px -1px rgba(0,0,0,0.12)",
"0px 1px 5px 0px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 3px 1px -2px rgba(0,0,0,0.12)",
"0px 1px 8px 0px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 3px 3px -2px rgba(0,0,0,0.12)",
"0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)",
"0px 3px 5px -1px rgba(0,0,0,0.2),0px 5px 8px 0px rgba(0,0,0,0.14),0px 1px 14px 0px rgba(0,0,0,0.12)",
"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)",
"0px 4px 5px -2px rgba(0,0,0,0.2),0px 7px 10px 1px rgba(0,0,0,0.14),0px 2px 16px 1px rgba(0,0,0,0.12)",
"0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)",
"0px 5px 6px -3px rgba(0,0,0,0.2),0px 9px 12px 1px rgba(0,0,0,0.14),0px 3px 16px 2px rgba(0,0,0,0.12)",
"0px 6px 6px -3px rgba(0,0,0,0.2),0px 10px 14px 1px rgba(0,0,0,0.14),0px 4px 18px 3px rgba(0,0,0,0.12)",
"0px 6px 7px -4px rgba(0,0,0,0.2),0px 11px 15px 1px rgba(0,0,0,0.14),0px 4px 20px 3px rgba(0,0,0,0.12)",
"0px 7px 8px -4px rgba(0,0,0,0.2),0px 12px 17px 2px rgba(0,0,0,0.14),0px 5px 22px 4px rgba(0,0,0,0.12)",
"0px 7px 8px -4px rgba(0,0,0,0.2),0px 13px 19px 2px rgba(0,0,0,0.14),0px 5px 24px 4px rgba(0,0,0,0.12)",
"0px 7px 9px -4px rgba(0,0,0,0.2),0px 14px 21px 2px rgba(0,0,0,0.14),0px 5px 26px 4px rgba(0,0,0,0.12)",
"0px 8px 9px -5px rgba(0,0,0,0.2),0px 15px 22px 2px rgba(0,0,0,0.14),0px 6px 28px 5px rgba(0,0,0,0.12)",
"0px 8px 10px -5px rgba(0,0,0,0.2),0px 16px 24px 2px rgba(0,0,0,0.14),0px 6px 30px 5px rgba(0,0,0,0.12)",
"0px 8px 11px -5px rgba(0,0,0,0.2),0px 17px 26px 2px rgba(0,0,0,0.14),0px 6px 32px 5px rgba(0,0,0,0.12)",
"0px 9px 11px -5px rgba(0,0,0,0.2),0px 18px 28px 2px rgba(0,0,0,0.14),0px 7px 34px 6px rgba(0,0,0,0.12)",
"0px 9px 12px -6px rgba(0,0,0,0.2),0px 19px 29px 2px rgba(0,0,0,0.14),0px 7px 36px 6px rgba(0,0,0,0.12)",
"0px 10px 13px -6px rgba(0,0,0,0.2),0px 20px 31px 3px rgba(0,0,0,0.14),0px 8px 38px 7px rgba(0,0,0,0.12)",
"0px 10px 13px -6px rgba(0,0,0,0.2),0px 21px 33px 3px rgba(0,0,0,0.14),0px 8px 40px 7px rgba(0,0,0,0.12)",
"0px 10px 14px -6px rgba(0,0,0,0.2),0px 22px 35px 3px rgba(0,0,0,0.14),0px 8px 42px 7px rgba(0,0,0,0.12)",
"0px 11px 14px -7px rgba(0,0,0,0.2),0px 23px 36px 3px rgba(0,0,0,0.14),0px 9px 44px 8px rgba(0,0,0,0.12)",
"0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12)",
],
"shape": Object {
"borderRadius": 4,
},
"spacing": Object {
"unit": 8,
},
"transitions": Object {
"create": [Function],
"duration": Object {
"complex": 375,
"enteringScreen": 225,
"leavingScreen": 195,
"short": 250,
"shorter": 200,
"shortest": 150,
"standard": 300,
},
"easing": Object {
"easeIn": "cubic-bezier(0.4, 0, 1, 1)",
"easeInOut": "cubic-bezier(0.4, 0, 0.2, 1)",
"easeOut": "cubic-bezier(0.0, 0, 0.2, 1)",
"sharp": "cubic-bezier(0.4, 0, 0.6, 1)",
},
"getAutoHeightDuration": [Function],
},
"typography": Object {
"body1": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 400,
"lineHeight": "1.46429em",
},
"body1Next": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1rem",
"fontWeight": 400,
"letterSpacing": "0.00938em",
"lineHeight": 1.5,
},
"body2": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 500,
"lineHeight": "1.71429em",
},
"body2Next": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 400,
"letterSpacing": "0.01071em",
"lineHeight": 1.5,
},
"button": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 500,
"textTransform": "uppercase",
},
"buttonNext": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 500,
"letterSpacing": "0.02857em",
"lineHeight": 1.5,
"textTransform": "uppercase",
},
"caption": Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.75rem",
"fontWeight": 400,
"lineHeight": "1.375em",
},
"captionNext": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.75rem",
"fontWeight": 400,
"letterSpacing": "0.03333em",
"lineHeight": 1.66,
},
"display1": Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "2.125rem",
"fontWeight": 400,
"lineHeight": "1.20588em",
},
"display2": Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "2.8125rem",
"fontWeight": 400,
"lineHeight": "1.13333em",
"marginLeft": "-.02em",
},
"display3": Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "3.5rem",
"fontWeight": 400,
"letterSpacing": "-.02em",
"lineHeight": "1.30357em",
"marginLeft": "-.02em",
},
"display4": Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "7rem",
"fontWeight": 300,
"letterSpacing": "-.04em",
"lineHeight": "1.14286em",
"marginLeft": "-.04em",
},
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": 14,
"fontWeightLight": 300,
"fontWeightMedium": 500,
"fontWeightRegular": 400,
"h1": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "6rem",
"fontWeight": 300,
"letterSpacing": "-0.01562em",
"lineHeight": 1,
},
"h2": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "3.75rem",
"fontWeight": 300,
"letterSpacing": "-0.00833em",
"lineHeight": 1,
},
"h3": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "3rem",
"fontWeight": 400,
"letterSpacing": "0em",
"lineHeight": 1.04,
},
"h4": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "2.125rem",
"fontWeight": 400,
"letterSpacing": "0.00735em",
"lineHeight": 1.17,
},
"h5": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1.5rem",
"fontWeight": 400,
"letterSpacing": "0em",
"lineHeight": 1.33,
},
"h6": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1.25rem",
"fontWeight": 500,
"letterSpacing": "0.0075em",
"lineHeight": 1.6,
},
"headline": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1.5rem",
"fontWeight": 400,
"lineHeight": "1.35417em",
},
"overline": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.75rem",
"fontWeight": 400,
"letterSpacing": "0.08333em",
"lineHeight": 2.66,
"textTransform": "uppercase",
},
"pxToRem": [Function],
"round": [Function],
"subheading": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1rem",
"fontWeight": 400,
"lineHeight": "1.5em",
},
"subtitle1": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1rem",
"fontWeight": 400,
"letterSpacing": "0.00938em",
"lineHeight": 1.75,
},
"subtitle2": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "0.875rem",
"fontWeight": 500,
"letterSpacing": "0.00714em",
"lineHeight": 1.57,
},
"title": Object {
"color": "rgba(0, 0, 0, 0.87)",
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
"fontSize": "1.3125rem",
"fontWeight": 500,
"lineHeight": "1.16667em",
},
"useNextVariants": false,
},
"zIndex": Object {
"appBar": 1100,
"drawer": 1200,
"mobileStepper": 1000,
"modal": 1300,
"snackbar": 1400,
"tooltip": 1500,
},
}
}
transitionDuration="auto"
>
<WithStyles(Popover)
PaperProps={
Object {
"classes": Object {
"root": "MuiMenu-paper-104",
},
"style": Object {
"minWidth": null,
},
}
}
anchorEl={
<div
aria-haspopup="true"
aria-pressed="false"
class="MuiSelect-select-85 MuiSelect-selectMenu-88 MuiInputBase-input-46 MuiInput-input-99"
role="button"
tabindex="0"
>
10
</div>
}
anchorOrigin={
Object {
"horizontal": "left",
"vertical": "top",
}
}
getContentAnchorEl={[Function]}
id="menu-"
onClose={[Function]}
onEntering={[Function]}
open={false}
transformOrigin={
Object {
"horizontal": "left",
"vertical": "top",
}
}
transitionDuration="auto"
>
<Popover
PaperProps={
Object {
"classes": Object {
"root": "MuiMenu-paper-104",
},
"style": Object {
"minWidth": null,
},
}
}
TransitionComponent={[Function]}
anchorEl={
<div
aria-haspopup="true"
aria-pressed="false"
class="MuiSelect-select-85 MuiSelect-selectMenu-88 MuiInputBase-input-46 MuiInput-input-99"
role="button"
tabindex="0"
>
10
</div>
}
anchorOrigin={
Object {
"horizontal": "left",
"vertical": "top",
}
}
anchorReference="anchorEl"
classes={
Object {
"paper": "MuiPopover-paper-105",
}
}
elevation={8}
getContentAnchorEl={[Function]}
id="menu-"
marginThreshold={16}
onClose={[Function]}
onEntering={[Function]}
open={false}
transformOrigin={
Object {
"horizontal": "left",
"vertical": "top",
}
}
transitionDuration="auto"
>
<WithStyles(Modal)
BackdropProps={
Object {
"invisible": true,
}
}
container={<body />}
id="menu-"
onClose={[Function]}
open={false}
>
<Modal
BackdropComponent={[Function]}
BackdropProps={
Object {
"invisible": true,
}
}
classes={
Object {
"hidden": "MuiModal-hidden-107",
"root": "MuiModal-root-106",
}
}
container={<body />}
disableAutoFocus={false}
disableBackdropClick={false}
disableEnforceFocus={false}
disableEscapeKeyDown={false}
disablePortal={false}
disableRestoreFocus={false}
hideBackdrop={false}
id="menu-"
keepMounted={false}
manager={
ModalManager {
"data": Array [],
"handleContainerOverflow": true,
"hideSiblingNodes": true,
"modals": Array [],
}
}
onClose={[Function]}
open={false}
/>
</WithStyles(Modal)>
</Popover>
</WithStyles(Popover)>
</Menu>
</WithStyles(Menu)>
</div>
</SelectInput>
</div>
</InputBase>
</WithFormControlContext(InputBase)>
</WithStyles(WithFormControlContext(InputBase))>
</Input>
</WithStyles(Input)>
</Select>
</WithFormControlContext(Select)>
</WithStyles(WithFormControlContext(Select))>
</div>
</FormControl>
</WithStyles(FormControl)>
</TextField>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<IconButton
classes={
Object {
"colorInherit": "MuiIconButton-colorInherit-109",
"colorPrimary": "MuiIconButton-colorPrimary-110",
"colorSecondary": "MuiIconButton-colorSecondary-111",
"disabled": "MuiIconButton-disabled-112",
"label": "MuiIconButton-label-113",
"root": "MuiIconButton-root-108",
}
}
color="default"
disabled={true}
onClick={[Function]}
>
<WithStyles(ButtonBase)
centerRipple={true}
className="MuiIconButton-root-108 MuiIconButton-disabled-112"
disabled={true}
focusRipple={true}
onClick={[Function]}
>
<ButtonBase
centerRipple={true}
className="MuiIconButton-root-108 MuiIconButton-disabled-112"
classes={
Object {
"disabled": "MuiButtonBase-disabled-82",
"focusVisible": "MuiButtonBase-focusVisible-83",
"root": "MuiButtonBase-root-81",
}
}
component="button"
disableRipple={false}
disableTouchRipple={false}
disabled={true}
focusRipple={true}
onClick={[Function]}
tabIndex="0"
type="button"
>
<button
className="MuiButtonBase-root-81 MuiButtonBase-disabled-82 MuiIconButton-root-108 MuiIconButton-disabled-112"
disabled={true}
onBlur={[Function]}
onClick={[Function]}
onContextMenu={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
onMouseDown={[Function]}
onMouseLeave={[Function]}
onMouseUp={[Function]}
onTouchEnd={[Function]}
onTouchMove={[Function]}
onTouchStart={[Function]}
tabIndex="-1"
type="button"
>
<span
className="MuiIconButton-label-113"
>
<pure(ChevronLeftIcon)>
<ChevronLeftIcon>
<WithStyles(SvgIcon)>
<SvgIcon
classes={
Object {
"colorAction": "MuiSvgIcon-colorAction-62",
"colorDisabled": "MuiSvgIcon-colorDisabled-64",
"colorError": "MuiSvgIcon-colorError-63",
"colorPrimary": "MuiSvgIcon-colorPrimary-60",
"colorSecondary": "MuiSvgIcon-colorSecondary-61",
"fontSizeInherit": "MuiSvgIcon-fontSizeInherit-65",
"fontSizeLarge": "MuiSvgIcon-fontSizeLarge-67",
"fontSizeSmall": "MuiSvgIcon-fontSizeSmall-66",
"root": "MuiSvgIcon-root-59",
}
}
color="inherit"
component="svg"
fontSize="default"
viewBox="0 0 24 24"
>
<svg
aria-hidden="true"
className="MuiSvgIcon-root-59"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
>
<path
d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"
/>
<path
d="M0 0h24v24H0z"
fill="none"
/>
</svg>
</SvgIcon>
</WithStyles(SvgIcon)>
</ChevronLeftIcon>
</pure(ChevronLeftIcon)>
</span>
</button>
</ButtonBase>
</WithStyles(ButtonBase)>
</IconButton>
</WithStyles(IconButton)>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<IconButton
classes={
Object {
"colorInherit": "MuiIconButton-colorInherit-109",
"colorPrimary": "MuiIconButton-colorPrimary-110",
"colorSecondary": "MuiIconButton-colorSecondary-111",
"disabled": "MuiIconButton-disabled-112",
"label": "MuiIconButton-label-113",
"root": "MuiIconButton-root-108",
}
}
color="default"
disabled={true}
onClick={[Function]}
>
<WithStyles(ButtonBase)
centerRipple={true}
className="MuiIconButton-root-108 MuiIconButton-disabled-112"
disabled={true}
focusRipple={true}
onClick={[Function]}
>
<ButtonBase
centerRipple={true}
className="MuiIconButton-root-108 MuiIconButton-disabled-112"
classes={
Object {
"disabled": "MuiButtonBase-disabled-82",
"focusVisible": "MuiButtonBase-focusVisible-83",
"root": "MuiButtonBase-root-81",
}
}
component="button"
disableRipple={false}
disableTouchRipple={false}
disabled={true}
focusRipple={true}
onClick={[Function]}
tabIndex="0"
type="button"
>
<button
className="MuiButtonBase-root-81 MuiButtonBase-disabled-82 MuiIconButton-root-108 MuiIconButton-disabled-112"
disabled={true}
onBlur={[Function]}
onClick={[Function]}
onContextMenu={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
onMouseDown={[Function]}
onMouseLeave={[Function]}
onMouseUp={[Function]}
onTouchEnd={[Function]}
onTouchMove={[Function]}
onTouchStart={[Function]}
tabIndex="-1"
type="button"
>
<span
className="MuiIconButton-label-113"
>
<pure(ChevronRightIcon)>
<ChevronRightIcon>
<WithStyles(SvgIcon)>
<SvgIcon
classes={
Object {
"colorAction": "MuiSvgIcon-colorAction-62",
"colorDisabled": "MuiSvgIcon-colorDisabled-64",
"colorError": "MuiSvgIcon-colorError-63",
"colorPrimary": "MuiSvgIcon-colorPrimary-60",
"colorSecondary": "MuiSvgIcon-colorSecondary-61",
"fontSizeInherit": "MuiSvgIcon-fontSizeInherit-65",
"fontSizeLarge": "MuiSvgIcon-fontSizeLarge-67",
"fontSizeSmall": "MuiSvgIcon-fontSizeSmall-66",
"root": "MuiSvgIcon-root-59",
}
}
color="inherit"
component="svg"
fontSize="default"
viewBox="0 0 24 24"
>
<svg
aria-hidden="true"
className="MuiSvgIcon-root-59"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
>
<path
d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
/>
<path
d="M0 0h24v24H0z"
fill="none"
/>
</svg>
</SvgIcon>
</WithStyles(SvgIcon)>
</ChevronRightIcon>
</pure(ChevronRightIcon)>
</span>
</button>
</ButtonBase>
</WithStyles(ButtonBase)>
</IconButton>
</WithStyles(IconButton)>
</div>
</div>
</CustomTable>
</div>
</ExperimentList>
`;
exports[`ExperimentList renders the empty experience 1`] = `
<div>
<CustomTable
columns={
Array [
Object {
"customRenderer": [Function],
"flex": 1,
"label": "Experiment name",
"sortKey": "name",
},
Object {
"flex": 2,
"label": "Description",
},
]
}
disableSelection={true}
emptyMessage="No experiments found. Click \\"Create experiment\\" to start."
filterLabel="Filter experiments"
getExpandComponent={[Function]}
initialSortColumn="created_at"
reload={[Function]}
rows={Array []}
toggleExpansion={[Function]}
/>
</div>
`;
exports[`ExperimentList renders the empty experience in ARCHIVED state 1`] = `
<div>
<CustomTable
columns={
Array [
Object {
"customRenderer": [Function],
"flex": 1,
"label": "Experiment name",
"sortKey": "name",
},
Object {
"flex": 2,
"label": "Description",
},
]
}
disableSelection={true}
emptyMessage="No experiments found. Click \\"Create experiment\\" to start."
filterLabel="Filter experiments"
getExpandComponent={[Function]}
initialSortColumn="created_at"
reload={[Function]}
rows={Array []}
toggleExpansion={[Function]}
/>
</div>
`;
| 7,985 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/__snapshots__/Toolbar.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Toolbar disables the back button when there is no browser history 1`] = `
<div
className="root topLevelToolbar"
>
<div
style={
Object {
"minWidth": 100,
}
}
>
<div
className="breadcrumbs flex"
>
<span
className="flex"
key="0"
title="test display name"
>
<Link
className="unstyled ellipsis link"
replace={false}
to="/some/test/path"
>
test display name
</Link>
</span>
<span
className="flex"
key="1"
title="test display name2"
>
<pure(ChevronRightIcon)
className="chevron"
/>
<Link
className="unstyled ellipsis link"
replace={false}
to="/some/test/path2"
>
test display name2
</Link>
</span>
</div>
<div
className="flex"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Back"
>
<div>
<WithStyles(IconButton)
className="backLink"
disabled={true}
onClick={[Function]}
>
<pure(ArrowBackIcon)
className="backIcon disabled"
/>
</WithStyles(IconButton)>
</div>
</WithStyles(Tooltip)>
<span
className="pageName ellipsis"
data-testid="page-title"
/>
</div>
</div>
<div
className="actions"
>
<WithStyles(Tooltip)
enterDelay={300}
key="0"
title="test tooltip"
>
<div>
<BusyButton
busy={false}
className=""
color="secondary"
icon={[Function]}
id="test id"
onClick={[MockFunction]}
outlined={false}
title="test title"
/>
</div>
</WithStyles(Tooltip)>
<WithStyles(Tooltip)
enterDelay={300}
key="1"
title="test disabled title2"
>
<div>
<BusyButton
busy={false}
className=""
color="secondary"
disabled={true}
icon={[Function]}
id="test id2"
onClick={[MockFunction]}
outlined={false}
title="test title2"
/>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
exports[`Toolbar renders nothing when there are no breadcrumbs or actions 1`] = `""`;
exports[`Toolbar renders outlined action buttons 1`] = `
<div
className="root topLevelToolbar"
>
<div
style={
Object {
"minWidth": 100,
}
}
>
<div
className="breadcrumbs flex"
>
<span
className="flex"
key="0"
title="test display name"
>
<Link
className="unstyled ellipsis link"
replace={false}
to="/some/test/path"
>
test display name
</Link>
</span>
<span
className="flex"
key="1"
title="test display name2"
>
<pure(ChevronRightIcon)
className="chevron"
/>
<Link
className="unstyled ellipsis link"
replace={false}
to="/some/test/path2"
>
test display name2
</Link>
</span>
</div>
<div
className="flex"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Back"
>
<div>
<WithStyles(IconButton)
className="backLink"
disabled={false}
onClick={[Function]}
>
<pure(ArrowBackIcon)
className="backIcon enabled"
/>
</WithStyles(IconButton)>
</div>
</WithStyles(Tooltip)>
<span
className="pageName ellipsis"
data-testid="page-title"
/>
</div>
</div>
<div
className="actions"
>
<WithStyles(Tooltip)
enterDelay={300}
key="0"
title="test outlined tooltip"
>
<div>
<BusyButton
busy={false}
className=""
color="secondary"
id="test outlined id"
onClick={[MockFunction]}
outlined={true}
title="test outlined title"
/>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
exports[`Toolbar renders primary action buttons 1`] = `
<div
className="root topLevelToolbar"
>
<div
style={
Object {
"minWidth": 100,
}
}
>
<div
className="breadcrumbs flex"
>
<span
className="flex"
key="0"
title="test display name"
>
<Link
className="unstyled ellipsis link"
replace={false}
to="/some/test/path"
>
test display name
</Link>
</span>
<span
className="flex"
key="1"
title="test display name2"
>
<pure(ChevronRightIcon)
className="chevron"
/>
<Link
className="unstyled ellipsis link"
replace={false}
to="/some/test/path2"
>
test display name2
</Link>
</span>
</div>
<div
className="flex"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Back"
>
<div>
<WithStyles(IconButton)
className="backLink"
disabled={false}
onClick={[Function]}
>
<pure(ArrowBackIcon)
className="backIcon enabled"
/>
</WithStyles(IconButton)>
</div>
</WithStyles(Tooltip)>
<span
className="pageName ellipsis"
data-testid="page-title"
/>
</div>
</div>
<div
className="actions"
>
<WithStyles(Tooltip)
enterDelay={300}
key="0"
title="test primary tooltip"
>
<div>
<BusyButton
busy={false}
className="buttonAction"
color="secondary"
id="test primary id"
onClick={[MockFunction]}
outlined={false}
title="test primary title"
/>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
exports[`Toolbar renders primary action buttons without outline, even if outline is true 1`] = `
<div
className="root topLevelToolbar"
>
<div
style={
Object {
"minWidth": 100,
}
}
>
<div
className="breadcrumbs flex"
>
<span
className="flex"
key="0"
title="test display name"
>
<Link
className="unstyled ellipsis link"
replace={false}
to="/some/test/path"
>
test display name
</Link>
</span>
<span
className="flex"
key="1"
title="test display name2"
>
<pure(ChevronRightIcon)
className="chevron"
/>
<Link
className="unstyled ellipsis link"
replace={false}
to="/some/test/path2"
>
test display name2
</Link>
</span>
</div>
<div
className="flex"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Back"
>
<div>
<WithStyles(IconButton)
className="backLink"
disabled={false}
onClick={[Function]}
>
<pure(ArrowBackIcon)
className="backIcon enabled"
/>
</WithStyles(IconButton)>
</div>
</WithStyles(Tooltip)>
<span
className="pageName ellipsis"
data-testid="page-title"
/>
</div>
</div>
<div
className="actions"
>
<WithStyles(Tooltip)
enterDelay={300}
key="0"
title="test tooltip"
>
<div>
<BusyButton
busy={false}
className="buttonAction"
color="secondary"
id="test id"
onClick={[MockFunction]}
outlined={false}
title="test title"
/>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
exports[`Toolbar renders with two breadcrumbs and two actions 1`] = `
<div
className="root topLevelToolbar"
>
<div
style={
Object {
"minWidth": 100,
}
}
>
<div
className="breadcrumbs flex"
>
<span
className="flex"
key="0"
title="test display name"
>
<Link
className="unstyled ellipsis link"
replace={false}
to="/some/test/path"
>
test display name
</Link>
</span>
<span
className="flex"
key="1"
title="test display name2"
>
<pure(ChevronRightIcon)
className="chevron"
/>
<Link
className="unstyled ellipsis link"
replace={false}
to="/some/test/path2"
>
test display name2
</Link>
</span>
</div>
<div
className="flex"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Back"
>
<div>
<WithStyles(IconButton)
className="backLink"
disabled={false}
onClick={[Function]}
>
<pure(ArrowBackIcon)
className="backIcon enabled"
/>
</WithStyles(IconButton)>
</div>
</WithStyles(Tooltip)>
<span
className="pageName ellipsis"
data-testid="page-title"
/>
</div>
</div>
<div
className="actions"
>
<WithStyles(Tooltip)
enterDelay={300}
key="0"
title="test tooltip"
>
<div>
<BusyButton
busy={false}
className=""
color="secondary"
icon={[Function]}
id="test id"
onClick={[MockFunction]}
outlined={false}
title="test title"
/>
</div>
</WithStyles(Tooltip)>
<WithStyles(Tooltip)
enterDelay={300}
key="1"
title="test disabled title2"
>
<div>
<BusyButton
busy={false}
className=""
color="secondary"
disabled={true}
icon={[Function]}
id="test id2"
onClick={[MockFunction]}
outlined={false}
title="test title2"
/>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
exports[`Toolbar renders without actions and one breadcrumb 1`] = `
<div
className="root topLevelToolbar"
>
<div
style={
Object {
"minWidth": 100,
}
}
>
<div
className="breadcrumbs flex"
>
<span
className="flex"
key="0"
title="test display name"
>
<Link
className="unstyled ellipsis link"
replace={false}
to="/some/test/path"
>
test display name
</Link>
</span>
</div>
<div
className="flex"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Back"
>
<div>
<WithStyles(IconButton)
className="backLink"
disabled={false}
onClick={[Function]}
>
<pure(ArrowBackIcon)
className="backIcon enabled"
/>
</WithStyles(IconButton)>
</div>
</WithStyles(Tooltip)>
<span
className="pageName ellipsis"
data-testid="page-title"
>
test page title
</span>
</div>
</div>
<div
className="actions"
/>
</div>
`;
exports[`Toolbar renders without actions, one breadcrumb, and a page name 1`] = `
<div
className="root topLevelToolbar"
>
<div
style={
Object {
"minWidth": 100,
}
}
>
<div
className="breadcrumbs flex"
>
<span
className="flex"
key="0"
title="test display name"
>
<Link
className="unstyled ellipsis link"
replace={false}
to="/some/test/path"
>
test display name
</Link>
</span>
</div>
<div
className="flex"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Back"
>
<div>
<WithStyles(IconButton)
className="backLink"
disabled={false}
onClick={[Function]}
>
<pure(ArrowBackIcon)
className="backIcon enabled"
/>
</WithStyles(IconButton)>
</div>
</WithStyles(Tooltip)>
<span
className="pageName ellipsis"
data-testid="page-title"
>
test page title
</span>
</div>
</div>
<div
className="actions"
/>
</div>
`;
exports[`Toolbar renders without breadcrumbs and a component page title 1`] = `
<div
className="root topLevelToolbar"
>
<div
style={
Object {
"minWidth": 100,
}
}
>
<div
className="breadcrumbs flex"
/>
<div
className="flex"
>
<span
className="pageName ellipsis"
data-testid="page-title"
>
<div
id="myComponent"
>
test page title
</div>
</span>
</div>
</div>
<div
className="actions"
>
<WithStyles(Tooltip)
enterDelay={300}
key="0"
title="test tooltip"
>
<div>
<BusyButton
busy={false}
className=""
color="secondary"
icon={[Function]}
id="test id"
onClick={[MockFunction]}
outlined={false}
title="test title"
/>
</div>
</WithStyles(Tooltip)>
<WithStyles(Tooltip)
enterDelay={300}
key="1"
title="test disabled title2"
>
<div>
<BusyButton
busy={false}
className=""
color="secondary"
disabled={true}
icon={[Function]}
id="test id2"
onClick={[MockFunction]}
outlined={false}
title="test title2"
/>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
exports[`Toolbar renders without breadcrumbs and a string page title 1`] = `
<div
className="root topLevelToolbar"
>
<div
style={
Object {
"minWidth": 100,
}
}
>
<div
className="breadcrumbs flex"
/>
<div
className="flex"
>
<span
className="pageName ellipsis"
data-testid="page-title"
>
test page title
</span>
</div>
</div>
<div
className="actions"
>
<WithStyles(Tooltip)
enterDelay={300}
key="0"
title="test tooltip"
>
<div>
<BusyButton
busy={false}
className=""
color="secondary"
icon={[Function]}
id="test id"
onClick={[MockFunction]}
outlined={false}
title="test title"
/>
</div>
</WithStyles(Tooltip)>
<WithStyles(Tooltip)
enterDelay={300}
key="1"
title="test disabled title2"
>
<div>
<BusyButton
busy={false}
className=""
color="secondary"
disabled={true}
icon={[Function]}
id="test id2"
onClick={[MockFunction]}
outlined={false}
title="test title2"
/>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
exports[`Toolbar renders without breadcrumbs and one action 1`] = `
<div
className="root topLevelToolbar"
>
<div
style={
Object {
"minWidth": 100,
}
}
>
<div
className="breadcrumbs flex"
/>
<div
className="flex"
>
<span
className="pageName ellipsis"
data-testid="page-title"
>
test page title
</span>
</div>
</div>
<div
className="actions"
>
<WithStyles(Tooltip)
enterDelay={300}
key="0"
title="test tooltip"
>
<div>
<BusyButton
busy={false}
className=""
color="secondary"
icon={[Function]}
id="test id"
onClick={[MockFunction]}
outlined={false}
title="test title"
/>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
exports[`Toolbar renders without breadcrumbs and two actions 1`] = `
<div
className="root topLevelToolbar"
>
<div
style={
Object {
"minWidth": 100,
}
}
>
<div
className="breadcrumbs flex"
/>
<div
className="flex"
>
<span
className="pageName ellipsis"
data-testid="page-title"
>
test page title
</span>
</div>
</div>
<div
className="actions"
>
<WithStyles(Tooltip)
enterDelay={300}
key="0"
title="test tooltip"
>
<div>
<BusyButton
busy={false}
className=""
color="secondary"
icon={[Function]}
id="test id"
onClick={[MockFunction]}
outlined={false}
title="test title"
/>
</div>
</WithStyles(Tooltip)>
<WithStyles(Tooltip)
enterDelay={300}
key="1"
title="test disabled title2"
>
<div>
<BusyButton
busy={false}
className=""
color="secondary"
disabled={true}
icon={[Function]}
id="test id2"
onClick={[MockFunction]}
outlined={false}
title="test title2"
/>
</div>
</WithStyles(Tooltip)>
</div>
</div>
`;
| 7,986 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/__snapshots__/NewRunParameters.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`NewRunParameters clicking the open editor button for json parameters displays an editor 1`] = `
<Editor
cursorStart={1}
editorProps={Object {}}
enableBasicAutocompletion={false}
enableLiveAutocompletion={false}
enableSnippets={false}
focus={false}
fontSize={12}
height="500px"
highlightActiveLine={true}
maxLines={20}
minLines={3}
mode="json"
name="brace-editor"
navigateToFileEnd={true}
onChange={[Function]}
onLoad={null}
onPaste={null}
onScroll={null}
placeholder={null}
readOnly={false}
scrollMargin={
Array [
0,
0,
0,
0,
]
}
setOptions={Object {}}
showGutter={true}
showPrintMargin={true}
style={Object {}}
tabSize={4}
theme="github"
value="{\\"test\\":\\"value\\"}"
width="100%"
wrapEnabled={false}
>
<div
id="brace-editor"
style={
Object {
"height": "500px",
"width": "100%",
}
}
/>
</Editor>
`;
exports[`NewRunParameters does not display any text fields if there are no parameters 1`] = `
<div>
<div
className="header"
>
Run parameters
</div>
<div>
This pipeline has no parameters
</div>
</div>
`;
exports[`NewRunParameters shows parameters 1`] = `
<div>
<div
className="header"
>
Run parameters
</div>
<div>
Specify parameters required by the pipeline
</div>
<div>
<ParamEditor
id="newRunPipelineParam0"
key="0"
onChange={[Function]}
param={
Object {
"name": "testParam",
"value": "testVal",
}
}
/>
</div>
</div>
`;
| 7,987 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/__snapshots__/Banner.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Banner defaults to error mode 1`] = `
<div
className="flex banner mode"
>
<div
className="message"
>
<pure(ErrorIcon)
className="icon"
/>
Some message
</div>
<div
className="flex"
/>
</div>
`;
exports[`Banner shows "Details" button and has dialog when there is additional info 1`] = `
<div
className="flex banner mode"
>
<div
className="message"
>
<pure(ErrorIcon)
className="icon"
/>
Some message
</div>
<div
className="flex"
>
<WithStyles(Button)
className="button detailsButton"
onClick={[Function]}
>
Details
</WithStyles(Button)>
</div>
<WithStyles(Dialog)
onClose={[Function]}
open={false}
>
<WithStyles(DialogTitle)>
An error occurred
</WithStyles(DialogTitle)>
<WithStyles(DialogContent)
className="prewrap"
>
More info
</WithStyles(DialogContent)>
<WithStyles(DialogActions)>
<WithStyles(Button)
id="dismissDialogBtn"
onClick={[Function]}
>
Dismiss
</WithStyles(Button)>
</WithStyles(DialogActions)>
</WithStyles(Dialog)>
</div>
`;
exports[`Banner shows "Refresh" button when passed a refresh function 1`] = `
<div
className="flex banner mode"
>
<div
className="message"
>
<pure(ErrorIcon)
className="icon"
/>
Some message
</div>
<div
className="flex"
>
<WithStyles(Button)
className="button refreshButton"
onClick={[Function]}
>
Refresh
</WithStyles(Button)>
</div>
</div>
`;
exports[`Banner uses error mode when instructed 1`] = `
<div
className="flex banner mode"
>
<div
className="message"
>
<pure(ErrorIcon)
className="icon"
/>
Some message
</div>
<div
className="flex"
/>
</div>
`;
exports[`Banner uses warning mode when instructed 1`] = `
<div
className="flex banner mode"
>
<div
className="message"
>
<pure(WarningIcon)
className="icon"
/>
Some message
</div>
<div
className="flex"
/>
</div>
`;
| 7,988 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/__snapshots__/PlotCard.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`PlotCard clicking outside full screen dialog closes it 1`] = `
<div>
<WithStyles(Paper)
className="plotCard plotCard"
>
<div
className="plotHeader"
>
<div
className="plotTitle"
title=""
/>
<div>
<WithStyles(Button)
className="popOutButton"
onClick={[Function]}
style={
Object {
"minHeight": 0,
"minWidth": 0,
"padding": 4,
}
}
>
<WithStyles(Tooltip)
title="Pop out"
>
<pure(LaunchIcon)
classes={
Object {
"root": "popoutIcon",
}
}
/>
</WithStyles(Tooltip)>
</WithStyles(Button)>
</div>
</div>
<ViewerContainer
configs={
Array [
Object {
"type": "confusion_matrix",
},
]
}
maxDimension={100}
/>
</WithStyles(Paper)>
<WithStyles(Dialog)
classes={
Object {
"paper": "fullscreenDialog",
}
}
onClose={[Function]}
open={false}
>
<div
className="dialogTitle"
>
<WithStyles(Button)
className="fullscreenCloseBtn fullscreenCloseButton"
onClick={[Function]}
>
<pure(CloseIcon) />
</WithStyles(Button)>
Confusion matrix
<Separator />
<span
style={
Object {
"color": "#5f6368",
}
}
>
(
)
</span>
</div>
<div
className="fullscreenViewerContainer"
>
<ViewerContainer
configs={
Array [
Object {
"type": "confusion_matrix",
},
]
}
/>
</div>
</WithStyles(Dialog)>
</div>
`;
exports[`PlotCard close button closes full screen dialog 1`] = `
<div>
<WithStyles(Paper)
className="plotCard plotCard"
>
<div
className="plotHeader"
>
<div
className="plotTitle"
title=""
/>
<div>
<WithStyles(Button)
className="popOutButton"
onClick={[Function]}
style={
Object {
"minHeight": 0,
"minWidth": 0,
"padding": 4,
}
}
>
<WithStyles(Tooltip)
title="Pop out"
>
<pure(LaunchIcon)
classes={
Object {
"root": "popoutIcon",
}
}
/>
</WithStyles(Tooltip)>
</WithStyles(Button)>
</div>
</div>
<ViewerContainer
configs={
Array [
Object {
"type": "confusion_matrix",
},
]
}
maxDimension={100}
/>
</WithStyles(Paper)>
<WithStyles(Dialog)
classes={
Object {
"paper": "fullscreenDialog",
}
}
onClose={[Function]}
open={false}
>
<div
className="dialogTitle"
>
<WithStyles(Button)
className="fullscreenCloseBtn fullscreenCloseButton"
onClick={[Function]}
>
<pure(CloseIcon) />
</WithStyles(Button)>
Confusion matrix
<Separator />
<span
style={
Object {
"color": "#5f6368",
}
}
>
(
)
</span>
</div>
<div
className="fullscreenViewerContainer"
>
<ViewerContainer
configs={
Array [
Object {
"type": "confusion_matrix",
},
]
}
/>
</div>
</WithStyles(Dialog)>
</div>
`;
exports[`PlotCard handles no configs 1`] = `""`;
exports[`PlotCard pops out a full screen view of the viewer 1`] = `
<div>
<WithStyles(Paper)
className="plotCard plotCard"
>
<div
className="plotHeader"
>
<div
className="plotTitle"
title=""
/>
<div>
<WithStyles(Button)
className="popOutButton"
onClick={[Function]}
style={
Object {
"minHeight": 0,
"minWidth": 0,
"padding": 4,
}
}
>
<WithStyles(Tooltip)
title="Pop out"
>
<pure(LaunchIcon)
classes={
Object {
"root": "popoutIcon",
}
}
/>
</WithStyles(Tooltip)>
</WithStyles(Button)>
</div>
</div>
<ViewerContainer
configs={
Array [
Object {
"type": "confusion_matrix",
},
]
}
maxDimension={100}
/>
</WithStyles(Paper)>
<WithStyles(Dialog)
classes={
Object {
"paper": "fullscreenDialog",
}
}
onClose={[Function]}
open={true}
>
<div
className="dialogTitle"
>
<WithStyles(Button)
className="fullscreenCloseBtn fullscreenCloseButton"
onClick={[Function]}
>
<pure(CloseIcon) />
</WithStyles(Button)>
Confusion matrix
<Separator />
<span
style={
Object {
"color": "#5f6368",
}
}
>
(
)
</span>
</div>
<div
className="fullscreenViewerContainer"
>
<ViewerContainer
configs={
Array [
Object {
"type": "confusion_matrix",
},
]
}
/>
</div>
</WithStyles(Dialog)>
</div>
`;
exports[`PlotCard renders on confusion matrix viewer card 1`] = `
<div>
<WithStyles(Paper)
className="plotCard plotCard"
>
<div
className="plotHeader"
>
<div
className="plotTitle"
title="test title"
>
test title
</div>
<div>
<WithStyles(Button)
className="popOutButton"
onClick={[Function]}
style={
Object {
"minHeight": 0,
"minWidth": 0,
"padding": 4,
}
}
>
<WithStyles(Tooltip)
title="Pop out"
>
<pure(LaunchIcon)
classes={
Object {
"root": "popoutIcon",
}
}
/>
</WithStyles(Tooltip)>
</WithStyles(Button)>
</div>
</div>
<ViewerContainer
configs={
Array [
Object {
"type": "confusion_matrix",
},
]
}
maxDimension={100}
/>
</WithStyles(Paper)>
<WithStyles(Dialog)
classes={
Object {
"paper": "fullscreenDialog",
}
}
onClose={[Function]}
open={false}
>
<div
className="dialogTitle"
>
<WithStyles(Button)
className="fullscreenCloseBtn fullscreenCloseButton"
onClick={[Function]}
>
<pure(CloseIcon) />
</WithStyles(Button)>
Confusion matrix
<Separator />
<span
style={
Object {
"color": "#5f6368",
}
}
>
(
test title
)
</span>
</div>
<div
className="fullscreenViewerContainer"
>
<ViewerContainer
configs={
Array [
Object {
"type": "confusion_matrix",
},
]
}
/>
</div>
</WithStyles(Dialog)>
</div>
`;
| 7,989 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/__snapshots__/Graph.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Graph gracefully renders a graph with a selected node id that does not exist 1`] = `
<div
className="root"
>
<div
className="node graphNode"
key="0"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": undefined,
"left": 5,
"maxHeight": 10,
"minHeight": 10,
"top": 5,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="node1"
>
<div
className="label"
>
node1
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
<div
className="node graphNode"
key="1"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": undefined,
"left": 5,
"maxHeight": 10,
"minHeight": 10,
"top": 65,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="node2"
>
<div
className="label"
>
node2
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
<div
key="0"
>
<div
className="line"
key="0"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": -15.87487218800544,
"top": 65,
"transform": "rotate(-166.75948008481282deg)",
"transition": "left 0.5s, top 0.5s",
"width": 122.74974437601087,
}
}
/>
<div
className="line"
key="1"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": -14.292526819072776,
"top": 76.75,
"transform": "rotate(2.165615252902859deg)",
"transition": "left 0.5s, top 0.5s",
"width": 119.58505363814554,
}
}
/>
<div
className="line"
key="2"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": -19,
"top": 78.5,
"transform": "rotate(270deg)",
"transition": "left 0.5s, top 0.5s",
"width": -4.5,
}
}
/>
<div
className="arrowHead"
style={
Object {
"borderTopColor": "#5f6368",
"left": -20,
"top": 67,
"transform": "rotate(360deg)",
}
}
/>
</div>
</div>
`;
exports[`Graph handles an empty graph 1`] = `""`;
exports[`Graph renders a complex graph with six nodes and seven edges 1`] = `
<div
className="root"
>
<div
className="node graphNode"
key="0"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": undefined,
"left": 75,
"maxHeight": 10,
"minHeight": 10,
"top": 5,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="flipcoin1"
>
<div
className="label"
>
flipcoin1
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
<div
className="node graphNode"
key="1"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": undefined,
"left": 45,
"maxHeight": 10,
"minHeight": 10,
"top": 65,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="tails1"
>
<div
className="label"
>
tails1
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
<div
className="node graphNode"
key="2"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": undefined,
"left": 105,
"maxHeight": 10,
"minHeight": 10,
"top": 65,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="heads1"
>
<div
className="label"
>
heads1
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
<div
className="node graphNode"
key="3"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": undefined,
"left": 45,
"maxHeight": 10,
"minHeight": 10,
"top": 125,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="flipcoin2"
>
<div
className="label"
>
flipcoin2
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
<div
className="node graphNode"
key="4"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": undefined,
"left": 5,
"maxHeight": 10,
"minHeight": 10,
"top": 185,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="heads2"
>
<div
className="label"
>
heads2
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
<div
className="node graphNode"
key="5"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": undefined,
"left": 85,
"maxHeight": 10,
"minHeight": 10,
"top": 185,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="tails2"
>
<div
className="label"
>
tails2
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
<div
key="0"
>
<div
className="line"
key="0"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": 53.599705252806814,
"top": 65,
"transform": "rotate(-162.53607310815718deg)",
"transition": "left 0.5s, top 0.5s",
"width": 93.80058949438637,
}
}
/>
<div
className="line"
key="1"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": 25.707473180927224,
"top": 76.75,
"transform": "rotate(2.165615252902859deg)",
"transition": "left 0.5s, top 0.5s",
"width": 119.58505363814554,
}
}
/>
<div
className="line"
key="2"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": 21,
"top": 78.5,
"transform": "rotate(270deg)",
"transition": "left 0.5s, top 0.5s",
"width": -4.5,
}
}
/>
<div
className="arrowHead"
style={
Object {
"borderTopColor": "#5f6368",
"left": 20,
"top": 67,
"transform": "rotate(360deg)",
}
}
/>
</div>
<div
key="1"
>
<div
className="line"
key="0"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": 54.44597636009023,
"top": 65,
"transform": "rotate(-169.35712925529643deg)",
"transition": "left 0.5s, top 0.5s",
"width": 152.10804727981954,
}
}
/>
<div
className="line"
key="1"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": 85.70747318092722,
"top": 76.75,
"transform": "rotate(2.165615252902859deg)",
"transition": "left 0.5s, top 0.5s",
"width": 119.58505363814554,
}
}
/>
<div
className="line"
key="2"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": 81,
"top": 78.5,
"transform": "rotate(270deg)",
"transition": "left 0.5s, top 0.5s",
"width": -4.5,
}
}
/>
<div
className="arrowHead"
style={
Object {
"borderTopColor": "#5f6368",
"left": 80,
"top": 67,
"transform": "rotate(360deg)",
}
}
/>
</div>
<div
key="2"
>
<div
className="line"
key="0"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": 24.12512781199456,
"top": 125,
"transform": "rotate(-166.75948008481282deg)",
"transition": "left 0.5s, top 0.5s",
"width": 122.74974437601087,
}
}
/>
<div
className="line"
key="1"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": 25.707473180927224,
"top": 136.75,
"transform": "rotate(2.165615252902859deg)",
"transition": "left 0.5s, top 0.5s",
"width": 119.58505363814554,
}
}
/>
<div
className="line"
key="2"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": 21,
"top": 138.5,
"transform": "rotate(270deg)",
"transition": "left 0.5s, top 0.5s",
"width": -4.5,
}
}
/>
<div
className="arrowHead"
style={
Object {
"borderTopColor": "#5f6368",
"left": 20,
"top": 127,
"transform": "rotate(360deg)",
}
}
/>
</div>
<div
key="3"
>
<div
className="line"
key="0"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": 23.342363464399483,
"top": 125,
"transform": "rotate(-160.48412699041728deg)",
"transition": "left 0.5s, top 0.5s",
"width": 84.31527307120105,
}
}
/>
<div
className="line"
key="1"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": 89.75,
"top": 154,
"transform": "rotate(-90deg)",
"transition": "left 0.5s, top 0.5s",
"width": 30.5,
}
}
/>
<div
className="line"
key="2"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": 89.75,
"top": 184,
"transform": "rotate(-90deg)",
"transition": "left 0.5s, top 0.5s",
"width": 30.5,
}
}
/>
<div
className="line"
key="3"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": -14.292526819072776,
"top": 196.75,
"transform": "rotate(2.165615252902859deg)",
"transition": "left 0.5s, top 0.5s",
"width": 119.58505363814554,
}
}
/>
<div
className="line"
key="4"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": -19,
"top": 198.5,
"transform": "rotate(270deg)",
"transition": "left 0.5s, top 0.5s",
"width": -4.5,
}
}
/>
<div
className="arrowHead"
style={
Object {
"borderTopColor": "#5f6368",
"left": -20,
"top": 187,
"transform": "rotate(360deg)",
}
}
/>
</div>
<div
key="4"
>
<div
className="line"
key="0"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": 24.52670720293925,
"top": 125,
"transform": "rotate(-170.01257842498643deg)",
"transition": "left 0.5s, top 0.5s",
"width": 161.9465855941215,
}
}
/>
<div
className="line"
key="1"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": 169.75,
"top": 154,
"transform": "rotate(-90deg)",
"transition": "left 0.5s, top 0.5s",
"width": 30.5,
}
}
/>
<div
className="line"
key="2"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": 169.75,
"top": 184,
"transform": "rotate(-90deg)",
"transition": "left 0.5s, top 0.5s",
"width": 30.5,
}
}
/>
<div
className="line"
key="3"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": 65.70747318092722,
"top": 196.75,
"transform": "rotate(2.165615252902859deg)",
"transition": "left 0.5s, top 0.5s",
"width": 119.58505363814554,
}
}
/>
<div
className="line"
key="4"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": 61,
"top": 198.5,
"transform": "rotate(270deg)",
"transition": "left 0.5s, top 0.5s",
"width": -4.5,
}
}
/>
<div
className="arrowHead"
style={
Object {
"borderTopColor": "#5f6368",
"left": 60,
"top": 187,
"transform": "rotate(360deg)",
}
}
/>
</div>
<div
key="5"
>
<div
className="line"
key="0"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": 24.12512781199456,
"top": 185,
"transform": "rotate(-166.75948008481282deg)",
"transition": "left 0.5s, top 0.5s",
"width": 122.74974437601087,
}
}
/>
<div
className="line"
key="1"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": -14.281833249334824,
"top": 196.75,
"transform": "rotate(1.6211459136534117deg)",
"transition": "left 0.5s, top 0.5s",
"width": 159.56366649866965,
}
}
/>
<div
className="line"
key="2"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": -19,
"top": 198.5,
"transform": "rotate(270deg)",
"transition": "left 0.5s, top 0.5s",
"width": -4.5,
}
}
/>
<div
className="arrowHead"
style={
Object {
"borderTopColor": "#5f6368",
"left": -20,
"top": 187,
"transform": "rotate(360deg)",
}
}
/>
</div>
<div
key="6"
>
<div
className="line"
key="0"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": 24.661645340032806,
"top": 185,
"transform": "rotate(-171.10957674263614deg)",
"transition": "left 0.5s, top 0.5s",
"width": 181.6767093199344,
}
}
/>
<div
className="line"
key="1"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": 65.71358867470941,
"top": 196.75,
"transform": "rotate(1.8542517148477853deg)",
"transition": "left 0.5s, top 0.5s",
"width": 139.57282265058117,
}
}
/>
<div
className="line"
key="2"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": 61,
"top": 198.5,
"transform": "rotate(270deg)",
"transition": "left 0.5s, top 0.5s",
"width": -4.5,
}
}
/>
<div
className="arrowHead"
style={
Object {
"borderTopColor": "#5f6368",
"left": 60,
"top": 187,
"transform": "rotate(360deg)",
}
}
/>
</div>
</div>
`;
exports[`Graph renders a graph with a placeholder node and edge 1`] = `
<div
className="root"
>
<div
className="node graphNode"
key="0"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": undefined,
"left": 5,
"maxHeight": 10,
"minHeight": 10,
"top": 5,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="node1"
>
<div
className="label"
>
node1
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
<div
className="placeholderNode graphNode"
key="1"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": undefined,
"left": 5,
"maxHeight": 10,
"minHeight": 10,
"top": 65,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
<div
key="0"
>
<div
className="line"
key="0"
style={
Object {
"backgroundColor": "#9aa0a6",
"height": 2,
"left": -15.87487218800544,
"top": 65,
"transform": "rotate(-166.75948008481282deg)",
"transition": "left 0.5s, top 0.5s",
"width": 122.74974437601087,
}
}
/>
<div
className="line"
key="1"
style={
Object {
"backgroundColor": "#9aa0a6",
"height": 2,
"left": 92.25,
"top": 91.5,
"transform": "rotate(-90deg)",
"transition": "left 0.5s, top 0.5s",
"width": 25.5,
}
}
/>
</div>
</div>
`;
exports[`Graph renders a graph with a selected node 1`] = `
<div
className="root"
>
<div
className="node graphNode nodeSelected"
key="0"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": undefined,
"left": 5,
"maxHeight": 10,
"minHeight": 10,
"top": 5,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="node1"
>
<div
className="label"
>
node1
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
<div
className="node graphNode"
key="1"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": undefined,
"left": 5,
"maxHeight": 10,
"minHeight": 10,
"top": 65,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="node2"
>
<div
className="label"
>
node2
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
<div
key="0"
>
<div
className="line"
key="0"
style={
Object {
"backgroundColor": "#1a73e8",
"height": 2,
"left": -15.87487218800544,
"top": 65,
"transform": "rotate(-166.75948008481282deg)",
"transition": "left 0.5s, top 0.5s",
"width": 122.74974437601087,
}
}
/>
<div
className="line"
key="1"
style={
Object {
"backgroundColor": "#1a73e8",
"height": 2,
"left": -14.292526819072776,
"top": 76.75,
"transform": "rotate(2.165615252902859deg)",
"transition": "left 0.5s, top 0.5s",
"width": 119.58505363814554,
}
}
/>
<div
className="line"
key="2"
style={
Object {
"backgroundColor": "#1a73e8",
"height": 2,
"left": -19,
"top": 78.5,
"transform": "rotate(270deg)",
"transition": "left 0.5s, top 0.5s",
"width": -4.5,
}
}
/>
<div
className="arrowHead"
style={
Object {
"borderTopColor": "#1a73e8",
"left": -20,
"top": 67,
"transform": "rotate(360deg)",
}
}
/>
</div>
</div>
`;
exports[`Graph renders a graph with colored edges 1`] = `
<div
className="root"
>
<div
className="node graphNode"
key="0"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": undefined,
"left": 5,
"maxHeight": 10,
"minHeight": 10,
"top": 5,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="node1"
>
<div
className="label"
>
node1
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
<div
className="node graphNode"
key="1"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": undefined,
"left": 5,
"maxHeight": 10,
"minHeight": 10,
"top": 65,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="node2"
>
<div
className="label"
>
node2
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
<div
key="0"
>
<div
className="line"
key="0"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": -15.87487218800544,
"top": 65,
"transform": "rotate(-166.75948008481282deg)",
"transition": "left 0.5s, top 0.5s",
"width": 122.74974437601087,
}
}
/>
<div
className="line"
key="1"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": -14.292526819072776,
"top": 76.75,
"transform": "rotate(2.165615252902859deg)",
"transition": "left 0.5s, top 0.5s",
"width": 119.58505363814554,
}
}
/>
<div
className="line"
key="2"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": -19,
"top": 78.5,
"transform": "rotate(270deg)",
"transition": "left 0.5s, top 0.5s",
"width": -4.5,
}
}
/>
<div
className="arrowHead"
style={
Object {
"borderTopColor": "#5f6368",
"left": -20,
"top": 67,
"transform": "rotate(360deg)",
}
}
/>
</div>
</div>
`;
exports[`Graph renders a graph with colored nodes 1`] = `
<div
className="root"
>
<div
className="node graphNode"
key="0"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": "red",
"left": 5,
"maxHeight": 10,
"minHeight": 10,
"top": 5,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="node1"
>
<div
className="label"
>
node1
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
<div
className="node graphNode"
key="1"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": "green",
"left": 65,
"maxHeight": 10,
"minHeight": 10,
"top": 5,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="node2"
>
<div
className="label"
>
node2
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
</div>
`;
exports[`Graph renders a graph with one node 1`] = `
<div
className="root"
>
<div
className="node graphNode"
key="0"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": undefined,
"left": 5,
"maxHeight": 10,
"minHeight": 10,
"top": 5,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="node1"
>
<div
className="label"
>
node1
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
</div>
`;
exports[`Graph renders a graph with two connectd nodes 1`] = `
<div
className="root"
>
<div
className="node graphNode"
key="0"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": undefined,
"left": 5,
"maxHeight": 10,
"minHeight": 10,
"top": 5,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="node1"
>
<div
className="label"
>
node1
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
<div
className="node graphNode"
key="1"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": undefined,
"left": 5,
"maxHeight": 10,
"minHeight": 10,
"top": 65,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="node2"
>
<div
className="label"
>
node2
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
<div
key="0"
>
<div
className="line"
key="0"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": -15.87487218800544,
"top": 65,
"transform": "rotate(-166.75948008481282deg)",
"transition": "left 0.5s, top 0.5s",
"width": 122.74974437601087,
}
}
/>
<div
className="line"
key="1"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": -14.292526819072776,
"top": 76.75,
"transform": "rotate(2.165615252902859deg)",
"transition": "left 0.5s, top 0.5s",
"width": 119.58505363814554,
}
}
/>
<div
className="line"
key="2"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": -19,
"top": 78.5,
"transform": "rotate(270deg)",
"transition": "left 0.5s, top 0.5s",
"width": -4.5,
}
}
/>
<div
className="arrowHead"
style={
Object {
"borderTopColor": "#5f6368",
"left": -20,
"top": 67,
"transform": "rotate(360deg)",
}
}
/>
</div>
</div>
`;
exports[`Graph renders a graph with two connectd nodes in reverse order 1`] = `
<div
className="root"
>
<div
className="node graphNode"
key="0"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": undefined,
"left": 5,
"maxHeight": 10,
"minHeight": 10,
"top": 65,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="node1"
>
<div
className="label"
>
node1
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
<div
className="node graphNode"
key="1"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": undefined,
"left": 5,
"maxHeight": 10,
"minHeight": 10,
"top": 5,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="node2"
>
<div
className="label"
>
node2
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
<div
key="0"
>
<div
className="line"
key="0"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": -15.87487218800544,
"top": 65,
"transform": "rotate(-166.75948008481282deg)",
"transition": "left 0.5s, top 0.5s",
"width": 122.74974437601087,
}
}
/>
<div
className="line"
key="1"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": -14.292526819072776,
"top": 76.75,
"transform": "rotate(2.165615252902859deg)",
"transition": "left 0.5s, top 0.5s",
"width": 119.58505363814554,
}
}
/>
<div
className="line"
key="2"
style={
Object {
"backgroundColor": "#5f6368",
"height": 2,
"left": -19,
"top": 78.5,
"transform": "rotate(270deg)",
"transition": "left 0.5s, top 0.5s",
"width": -4.5,
}
}
/>
<div
className="arrowHead"
style={
Object {
"borderTopColor": "#5f6368",
"left": -20,
"top": 67,
"transform": "rotate(360deg)",
}
}
/>
</div>
</div>
`;
exports[`Graph renders a graph with two disparate nodes 1`] = `
<div
className="root"
>
<div
className="node graphNode"
key="0"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": undefined,
"left": 5,
"maxHeight": 10,
"minHeight": 10,
"top": 5,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="node1"
>
<div
className="label"
>
node1
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
<div
className="node graphNode"
key="1"
onClick={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": undefined,
"left": 65,
"maxHeight": 10,
"minHeight": 10,
"top": 5,
"transition": "left 0.5s, top 0.5s",
"width": 10,
}
}
>
<WithStyles(Tooltip)
enterDelay={300}
title="node2"
>
<div
className="label"
>
node2
</div>
</WithStyles(Tooltip)>
<div
className="icon"
style={
Object {
"background": undefined,
}
}
>
<WithStyles(Tooltip)
title="Test icon tooltip"
>
<pure(CheckCircleIcon) />
</WithStyles(Tooltip)>
</div>
</div>
</div>
`;
exports[`Graph shows an error message when the graph is invalid 1`] = `"<div class=\\"root\\"></div>"`;
| 7,990 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/__snapshots__/CollapseButton.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`CollapseButton initial render 1`] = `
<div>
<WithStyles(Button)
className="collapseBtn"
onClick={[Function]}
title="Expand/Collapse this section"
>
<pure(ArrowDropUpIcon)
className="icon"
/>
testSection
</WithStyles(Button)>
</div>
`;
exports[`CollapseButton renders the button collapsed if in collapsedSections 1`] = `
<div>
<WithStyles(Button)
className="collapseBtn"
onClick={[Function]}
title="Expand/Collapse this section"
>
<pure(ArrowDropUpIcon)
className="icon collapsed"
/>
testSection
</WithStyles(Button)>
</div>
`;
| 7,991 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/__snapshots__/CustomTable.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`CustomTable renders a collapsed row 1`] = `
<div
className="pageOverflowHidden"
>
<div>
<Input
InputLabelProps={
Object {
"classes": Object {
"root": "noMargin",
},
}
}
InputProps={
Object {
"classes": Object {
"notchedOutline": "filterBorderRadius",
"root": "noLeftPadding",
},
"startAdornment": <WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>,
}
}
className="filterBox"
height={48}
id="tableFilterBox"
label="Filter"
maxWidth="100%"
onChange={[Function]}
value=""
variant="outlined"
/>
</div>
<div
className="header"
>
<div
className="columnName cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
indeterminate={false}
onChange={[Function]}
/>
<Separator
orientation="horizontal"
units={40}
/>
</div>
<div
className="columnName"
key="0"
style={
Object {
"width": "50%",
}
}
title="col1"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col1
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
<div
className="columnName"
key="1"
style={
Object {
"width": "50%",
}
}
title="col2"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col2
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
</div>
<div
className="scrollContainer"
style={
Object {
"minHeight": 60,
}
}
>
<div
className="expandableContainer"
key="0"
>
<div
aria-checked={false}
className="tableRow row"
onClick={[Function]}
role="checkbox"
tabIndex={-1}
>
<div
className="cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
/>
<WithStyles(IconButton)
aria-label="Expand"
className="expandButton"
onClick={[Function]}
>
<pure(ArrowRightIcon) />
</WithStyles(IconButton)>
</div>
<CustomTableRow
columns={
Array [
Object {
"customRenderer": undefined,
"label": "col1",
},
Object {
"customRenderer": undefined,
"label": "col2",
},
]
}
row={
Object {
"expandState": 0,
"id": "row1",
"otherFields": Array [
"cell1",
"cell2",
],
}
}
/>
</div>
</div>
</div>
<div
className="footer"
>
<span
className=""
>
Rows per page:
</span>
<TextField
InputProps={
Object {
"disableUnderline": true,
}
}
className="rowsPerPage"
classes={
Object {
"root": "verticalAlignInitial",
}
}
onChange={[Function]}
required={false}
select={true}
value={10}
variant="standard"
>
<WithStyles(MenuItem)
key="0"
value={10}
>
10
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="1"
value={20}
>
20
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="2"
value={50}
>
50
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="3"
value={100}
>
100
</WithStyles(MenuItem)>
</TextField>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronRightIcon) />
</WithStyles(IconButton)>
</div>
</div>
`;
exports[`CustomTable renders a collapsed row when selection is disabled 1`] = `
<div
className="pageOverflowHidden"
>
<div>
<Input
InputLabelProps={
Object {
"classes": Object {
"root": "noMargin",
},
}
}
InputProps={
Object {
"classes": Object {
"notchedOutline": "filterBorderRadius",
"root": "noLeftPadding",
},
"startAdornment": <WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>,
}
}
className="filterBox"
height={48}
id="tableFilterBox"
label="Filter"
maxWidth="100%"
onChange={[Function]}
value=""
variant="outlined"
/>
</div>
<div
className="header"
>
<div
className="columnName cell selectionToggle"
>
<Separator
orientation="horizontal"
units={40}
/>
</div>
<div
className="columnName"
key="0"
style={
Object {
"width": "50%",
}
}
title="col1"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col1
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
<div
className="columnName"
key="1"
style={
Object {
"width": "50%",
}
}
title="col2"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col2
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
</div>
<div
className="scrollContainer"
style={
Object {
"minHeight": 60,
}
}
>
<div
className="expandableContainer"
key="0"
>
<div
aria-checked={false}
className="tableRow row"
onClick={[Function]}
role="checkbox"
tabIndex={-1}
>
<div
className="cell selectionToggle"
>
<WithStyles(IconButton)
aria-label="Expand"
className="expandButton"
onClick={[Function]}
>
<pure(ArrowRightIcon) />
</WithStyles(IconButton)>
</div>
<CustomTableRow
columns={
Array [
Object {
"customRenderer": undefined,
"label": "col1",
},
Object {
"customRenderer": undefined,
"label": "col2",
},
]
}
row={
Object {
"expandState": 0,
"id": "row1",
"otherFields": Array [
"cell1",
"cell2",
],
}
}
/>
</div>
</div>
</div>
<div
className="footer"
>
<span
className=""
>
Rows per page:
</span>
<TextField
InputProps={
Object {
"disableUnderline": true,
}
}
className="rowsPerPage"
classes={
Object {
"root": "verticalAlignInitial",
}
}
onChange={[Function]}
required={false}
select={true}
value={10}
variant="standard"
>
<WithStyles(MenuItem)
key="0"
value={10}
>
10
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="1"
value={20}
>
20
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="2"
value={50}
>
50
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="3"
value={100}
>
100
</WithStyles(MenuItem)>
</TextField>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronRightIcon) />
</WithStyles(IconButton)>
</div>
</div>
`;
exports[`CustomTable renders a table with sorting disabled 1`] = `
<div
className="pageOverflowHidden"
>
<div>
<Input
InputLabelProps={
Object {
"classes": Object {
"root": "noMargin",
},
}
}
InputProps={
Object {
"classes": Object {
"notchedOutline": "filterBorderRadius",
"root": "noLeftPadding",
},
"startAdornment": <WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>,
}
}
className="filterBox"
height={48}
id="tableFilterBox"
label="Filter"
maxWidth="100%"
onChange={[Function]}
value=""
variant="outlined"
/>
</div>
<div
className="header"
>
<div
className="columnName cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
indeterminate={false}
onChange={[Function]}
/>
</div>
<div
className="columnName"
key="0"
style={
Object {
"width": "50%",
}
}
title="col1"
>
col1
</div>
<div
className="columnName"
key="1"
style={
Object {
"width": "50%",
}
}
title="col2"
>
col2
</div>
</div>
<div
className="scrollContainer"
style={
Object {
"minHeight": 60,
}
}
>
<div
className="expandableContainer"
key="0"
>
<div
aria-checked={false}
className="tableRow row"
onClick={[Function]}
role="checkbox"
tabIndex={-1}
>
<div
className="cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
/>
</div>
<CustomTableRow
columns={
Array [
Object {
"customRenderer": undefined,
"label": "col1",
},
Object {
"customRenderer": undefined,
"label": "col2",
},
]
}
row={
Object {
"id": "row1",
"otherFields": Array [
"cell1",
"cell2",
],
}
}
/>
</div>
</div>
<div
className="expandableContainer"
key="1"
>
<div
aria-checked={false}
className="tableRow row"
onClick={[Function]}
role="checkbox"
tabIndex={-1}
>
<div
className="cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
/>
</div>
<CustomTableRow
columns={
Array [
Object {
"customRenderer": undefined,
"label": "col1",
},
Object {
"customRenderer": undefined,
"label": "col2",
},
]
}
row={
Object {
"id": "row2",
"otherFields": Array [
"cell1",
"cell2",
],
}
}
/>
</div>
</div>
</div>
<div
className="footer"
>
<span
className=""
>
Rows per page:
</span>
<TextField
InputProps={
Object {
"disableUnderline": true,
}
}
className="rowsPerPage"
classes={
Object {
"root": "verticalAlignInitial",
}
}
onChange={[Function]}
required={false}
select={true}
value={10}
variant="standard"
>
<WithStyles(MenuItem)
key="0"
value={10}
>
10
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="1"
value={20}
>
20
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="2"
value={50}
>
50
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="3"
value={100}
>
100
</WithStyles(MenuItem)>
</TextField>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronRightIcon) />
</WithStyles(IconButton)>
</div>
</div>
`;
exports[`CustomTable renders an expanded row 1`] = `
<div
className="pageOverflowHidden"
>
<div>
<Input
InputLabelProps={
Object {
"classes": Object {
"root": "noMargin",
},
}
}
InputProps={
Object {
"classes": Object {
"notchedOutline": "filterBorderRadius",
"root": "noLeftPadding",
},
"startAdornment": <WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>,
}
}
className="filterBox"
height={48}
id="tableFilterBox"
label="Filter"
maxWidth="100%"
onChange={[Function]}
value=""
variant="outlined"
/>
</div>
<div
className="header"
>
<div
className="columnName cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
indeterminate={false}
onChange={[Function]}
/>
</div>
<div
className="columnName"
key="0"
style={
Object {
"width": "50%",
}
}
title="col1"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col1
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
<div
className="columnName"
key="1"
style={
Object {
"width": "50%",
}
}
title="col2"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col2
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
</div>
<div
className="scrollContainer"
style={
Object {
"minHeight": 60,
}
}
>
<div
className="expandableContainer expandedContainer"
key="0"
>
<div
aria-checked={false}
className="tableRow row expandedRow"
onClick={[Function]}
role="checkbox"
tabIndex={-1}
>
<div
className="cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
/>
</div>
<CustomTableRow
columns={
Array [
Object {
"customRenderer": undefined,
"label": "col1",
},
Object {
"customRenderer": undefined,
"label": "col2",
},
]
}
row={
Object {
"expandState": 1,
"id": "row1",
"otherFields": Array [
"cell1",
"cell2",
],
}
}
/>
</div>
</div>
</div>
<div
className="footer"
>
<span
className=""
>
Rows per page:
</span>
<TextField
InputProps={
Object {
"disableUnderline": true,
}
}
className="rowsPerPage"
classes={
Object {
"root": "verticalAlignInitial",
}
}
onChange={[Function]}
required={false}
select={true}
value={10}
variant="standard"
>
<WithStyles(MenuItem)
key="0"
value={10}
>
10
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="1"
value={20}
>
20
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="2"
value={50}
>
50
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="3"
value={100}
>
100
</WithStyles(MenuItem)>
</TextField>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronRightIcon) />
</WithStyles(IconButton)>
</div>
</div>
`;
exports[`CustomTable renders an expanded row with expanded component below it 1`] = `
<div
className="pageOverflowHidden"
>
<div>
<Input
InputLabelProps={
Object {
"classes": Object {
"root": "noMargin",
},
}
}
InputProps={
Object {
"classes": Object {
"notchedOutline": "filterBorderRadius",
"root": "noLeftPadding",
},
"startAdornment": <WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>,
}
}
className="filterBox"
height={48}
id="tableFilterBox"
label="Filter"
maxWidth="100%"
onChange={[Function]}
value=""
variant="outlined"
/>
</div>
<div
className="header"
>
<div
className="columnName cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
indeterminate={false}
onChange={[Function]}
/>
<Separator
orientation="horizontal"
units={40}
/>
</div>
<div
className="columnName"
key="0"
style={
Object {
"width": "50%",
}
}
title="col1"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col1
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
<div
className="columnName"
key="1"
style={
Object {
"width": "50%",
}
}
title="col2"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col2
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
</div>
<div
className="scrollContainer"
style={
Object {
"minHeight": 60,
}
}
>
<div
className="expandableContainer expandedContainer"
key="0"
>
<div
aria-checked={false}
className="tableRow row expandedRow"
onClick={[Function]}
role="checkbox"
tabIndex={-1}
>
<div
className="cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
/>
<WithStyles(IconButton)
aria-label="Expand"
className="expandButton expandButtonExpanded"
onClick={[Function]}
>
<pure(ArrowRightIcon) />
</WithStyles(IconButton)>
</div>
<CustomTableRow
columns={
Array [
Object {
"customRenderer": undefined,
"label": "col1",
},
Object {
"customRenderer": undefined,
"label": "col2",
},
]
}
row={
Object {
"expandState": 1,
"id": "row1",
"otherFields": Array [
"cell1",
"cell2",
],
}
}
/>
</div>
<div>
<span>
Hello World
</span>
</div>
</div>
</div>
<div
className="footer"
>
<span
className=""
>
Rows per page:
</span>
<TextField
InputProps={
Object {
"disableUnderline": true,
}
}
className="rowsPerPage"
classes={
Object {
"root": "verticalAlignInitial",
}
}
onChange={[Function]}
required={false}
select={true}
value={10}
variant="standard"
>
<WithStyles(MenuItem)
key="0"
value={10}
>
10
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="1"
value={20}
>
20
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="2"
value={50}
>
50
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="3"
value={100}
>
100
</WithStyles(MenuItem)>
</TextField>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronRightIcon) />
</WithStyles(IconButton)>
</div>
</div>
`;
exports[`CustomTable renders columns with specified widths 1`] = `
<div
className="pageOverflowHidden"
>
<div>
<Input
InputLabelProps={
Object {
"classes": Object {
"root": "noMargin",
},
}
}
InputProps={
Object {
"classes": Object {
"notchedOutline": "filterBorderRadius",
"root": "noLeftPadding",
},
"startAdornment": <WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>,
}
}
className="filterBox"
height={48}
id="tableFilterBox"
label="Filter"
maxWidth="100%"
onChange={[Function]}
value=""
variant="outlined"
/>
</div>
<div
className="header"
>
<div
className="columnName cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
indeterminate={false}
onChange={[Function]}
/>
</div>
<div
className="columnName"
key="0"
style={
Object {
"width": "75%",
}
}
title="col1"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col1
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
<div
className="columnName"
key="1"
style={
Object {
"width": "25%",
}
}
title="col2"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col2
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
</div>
<div
className="scrollContainer"
style={
Object {
"minHeight": 60,
}
}
/>
<div
className="footer"
>
<span
className=""
>
Rows per page:
</span>
<TextField
InputProps={
Object {
"disableUnderline": true,
}
}
className="rowsPerPage"
classes={
Object {
"root": "verticalAlignInitial",
}
}
onChange={[Function]}
required={false}
select={true}
value={10}
variant="standard"
>
<WithStyles(MenuItem)
key="0"
value={10}
>
10
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="1"
value={20}
>
20
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="2"
value={50}
>
50
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="3"
value={100}
>
100
</WithStyles(MenuItem)>
</TextField>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronRightIcon) />
</WithStyles(IconButton)>
</div>
</div>
`;
exports[`CustomTable renders empty message on no rows 1`] = `
<div
className="pageOverflowHidden"
>
<div>
<Input
InputLabelProps={
Object {
"classes": Object {
"root": "noMargin",
},
}
}
InputProps={
Object {
"classes": Object {
"notchedOutline": "filterBorderRadius",
"root": "noLeftPadding",
},
"startAdornment": <WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>,
}
}
className="filterBox"
height={48}
id="tableFilterBox"
label="Filter"
maxWidth="100%"
onChange={[Function]}
value=""
variant="outlined"
/>
</div>
<div
className="header"
>
<div
className="columnName cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
indeterminate={false}
onChange={[Function]}
/>
</div>
</div>
<div
className="scrollContainer"
style={
Object {
"minHeight": 60,
}
}
>
<div
className="emptyMessage"
>
test empty message
</div>
</div>
<div
className="footer"
>
<span
className=""
>
Rows per page:
</span>
<TextField
InputProps={
Object {
"disableUnderline": true,
}
}
className="rowsPerPage"
classes={
Object {
"root": "verticalAlignInitial",
}
}
onChange={[Function]}
required={false}
select={true}
value={10}
variant="standard"
>
<WithStyles(MenuItem)
key="0"
value={10}
>
10
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="1"
value={20}
>
20
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="2"
value={50}
>
50
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="3"
value={100}
>
100
</WithStyles(MenuItem)>
</TextField>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronRightIcon) />
</WithStyles(IconButton)>
</div>
</div>
`;
exports[`CustomTable renders new rows after clicking next page, and enables previous page button 1`] = `
<div
className="pageOverflowHidden"
>
<div>
<Input
InputLabelProps={
Object {
"classes": Object {
"root": "noMargin",
},
}
}
InputProps={
Object {
"classes": Object {
"notchedOutline": "filterBorderRadius",
"root": "noLeftPadding",
},
"startAdornment": <WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>,
}
}
className="filterBox"
height={48}
id="tableFilterBox"
label="Filter"
maxWidth="100%"
onChange={[Function]}
value=""
variant="outlined"
/>
</div>
<div
className="header"
>
<div
className="columnName cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
indeterminate={false}
onChange={[Function]}
/>
</div>
<div
className="columnName"
key="0"
style={
Object {
"width": "50%",
}
}
title="col1"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col1
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
<div
className="columnName"
key="1"
style={
Object {
"width": "50%",
}
}
title="col2"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col2
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
</div>
<div
className="scrollContainer"
style={
Object {
"minHeight": 60,
}
}
>
<div
className="expandableContainer"
key="0"
>
<div
aria-checked={false}
className="tableRow row"
onClick={[Function]}
role="checkbox"
tabIndex={-1}
>
<div
className="cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
/>
</div>
<CustomTableRow
columns={
Array [
Object {
"customRenderer": undefined,
"label": "col1",
},
Object {
"customRenderer": undefined,
"label": "col2",
},
]
}
row={
Object {
"id": "row2",
"otherFields": Array [
"cell1",
"cell2",
],
}
}
/>
</div>
</div>
</div>
<div
className="footer"
>
<span
className=""
>
Rows per page:
</span>
<TextField
InputProps={
Object {
"disableUnderline": true,
}
}
className="rowsPerPage"
classes={
Object {
"root": "verticalAlignInitial",
}
}
onChange={[Function]}
required={false}
select={true}
value={10}
variant="standard"
>
<WithStyles(MenuItem)
key="0"
value={10}
>
10
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="1"
value={20}
>
20
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="2"
value={50}
>
50
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="3"
value={100}
>
100
</WithStyles(MenuItem)>
</TextField>
<WithStyles(IconButton)
disabled={false}
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
<WithStyles(IconButton)
disabled={false}
onClick={[Function]}
>
<pure(ChevronRightIcon) />
</WithStyles(IconButton)>
</div>
</div>
`;
exports[`CustomTable renders new rows after clicking previous page, and enables next page button 1`] = `
<div
className="pageOverflowHidden"
>
<div>
<Input
InputLabelProps={
Object {
"classes": Object {
"root": "noMargin",
},
}
}
InputProps={
Object {
"classes": Object {
"notchedOutline": "filterBorderRadius",
"root": "noLeftPadding",
},
"startAdornment": <WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>,
}
}
className="filterBox"
height={48}
id="tableFilterBox"
label="Filter"
maxWidth="100%"
onChange={[Function]}
value=""
variant="outlined"
/>
</div>
<div
className="header"
>
<div
className="columnName cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
indeterminate={false}
onChange={[Function]}
/>
</div>
<div
className="columnName"
key="0"
style={
Object {
"width": "50%",
}
}
title="col1"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col1
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
<div
className="columnName"
key="1"
style={
Object {
"width": "50%",
}
}
title="col2"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col2
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
</div>
<div
className="scrollContainer"
style={
Object {
"minHeight": 60,
}
}
>
<div
className="expandableContainer"
key="0"
>
<div
aria-checked={false}
className="tableRow row"
onClick={[Function]}
role="checkbox"
tabIndex={-1}
>
<div
className="cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
/>
</div>
<CustomTableRow
columns={
Array [
Object {
"customRenderer": undefined,
"label": "col1",
},
Object {
"customRenderer": undefined,
"label": "col2",
},
]
}
row={
Object {
"id": "row1",
"otherFields": Array [
"cell1",
"cell2",
],
}
}
/>
</div>
</div>
<div
className="expandableContainer"
key="1"
>
<div
aria-checked={false}
className="tableRow row"
onClick={[Function]}
role="checkbox"
tabIndex={-1}
>
<div
className="cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
/>
</div>
<CustomTableRow
columns={
Array [
Object {
"customRenderer": undefined,
"label": "col1",
},
Object {
"customRenderer": undefined,
"label": "col2",
},
]
}
row={
Object {
"id": "row2",
"otherFields": Array [
"cell1",
"cell2",
],
}
}
/>
</div>
</div>
</div>
<div
className="footer"
>
<span
className=""
>
Rows per page:
</span>
<TextField
InputProps={
Object {
"disableUnderline": true,
}
}
className="rowsPerPage"
classes={
Object {
"root": "verticalAlignInitial",
}
}
onChange={[Function]}
required={false}
select={true}
value={10}
variant="standard"
>
<WithStyles(MenuItem)
key="0"
value={10}
>
10
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="1"
value={20}
>
20
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="2"
value={50}
>
50
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="3"
value={100}
>
100
</WithStyles(MenuItem)>
</TextField>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
<WithStyles(IconButton)
disabled={false}
onClick={[Function]}
>
<pure(ChevronRightIcon) />
</WithStyles(IconButton)>
</div>
</div>
`;
exports[`CustomTable renders some columns with descending sort order on first column 1`] = `
<div
className="pageOverflowHidden"
>
<div>
<Input
InputLabelProps={
Object {
"classes": Object {
"root": "noMargin",
},
}
}
InputProps={
Object {
"classes": Object {
"notchedOutline": "filterBorderRadius",
"root": "noLeftPadding",
},
"startAdornment": <WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>,
}
}
className="filterBox"
height={48}
id="tableFilterBox"
label="Filter"
maxWidth="100%"
onChange={[Function]}
value=""
variant="outlined"
/>
</div>
<div
className="header"
>
<div
className="columnName cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
indeterminate={false}
onChange={[Function]}
/>
</div>
<div
className="columnName"
key="0"
style={
Object {
"width": "50%",
}
}
title="col1"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Sort"
>
<WithStyles(TableSortLabel)
active={true}
className="ellipsis"
direction="desc"
onClick={[Function]}
>
col1
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
<div
className="columnName"
key="1"
style={
Object {
"width": "50%",
}
}
title="col2"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col2
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
</div>
<div
className="scrollContainer"
style={
Object {
"minHeight": 60,
}
}
/>
<div
className="footer"
>
<span
className=""
>
Rows per page:
</span>
<TextField
InputProps={
Object {
"disableUnderline": true,
}
}
className="rowsPerPage"
classes={
Object {
"root": "verticalAlignInitial",
}
}
onChange={[Function]}
required={false}
select={true}
value={10}
variant="standard"
>
<WithStyles(MenuItem)
key="0"
value={10}
>
10
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="1"
value={20}
>
20
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="2"
value={50}
>
50
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="3"
value={100}
>
100
</WithStyles(MenuItem)>
</TextField>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronRightIcon) />
</WithStyles(IconButton)>
</div>
</div>
`;
exports[`CustomTable renders some columns with equal widths without rows 1`] = `
<div
className="pageOverflowHidden"
>
<div>
<Input
InputLabelProps={
Object {
"classes": Object {
"root": "noMargin",
},
}
}
InputProps={
Object {
"classes": Object {
"notchedOutline": "filterBorderRadius",
"root": "noLeftPadding",
},
"startAdornment": <WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>,
}
}
className="filterBox"
height={48}
id="tableFilterBox"
label="Filter"
maxWidth="100%"
onChange={[Function]}
value=""
variant="outlined"
/>
</div>
<div
className="header"
>
<div
className="columnName cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
indeterminate={false}
onChange={[Function]}
/>
</div>
<div
className="columnName"
key="0"
style={
Object {
"width": "50%",
}
}
title="col1"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col1
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
<div
className="columnName"
key="1"
style={
Object {
"width": "50%",
}
}
title="col2"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col2
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
</div>
<div
className="scrollContainer"
style={
Object {
"minHeight": 60,
}
}
/>
<div
className="footer"
>
<span
className=""
>
Rows per page:
</span>
<TextField
InputProps={
Object {
"disableUnderline": true,
}
}
className="rowsPerPage"
classes={
Object {
"root": "verticalAlignInitial",
}
}
onChange={[Function]}
required={false}
select={true}
value={10}
variant="standard"
>
<WithStyles(MenuItem)
key="0"
value={10}
>
10
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="1"
value={20}
>
20
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="2"
value={50}
>
50
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="3"
value={100}
>
100
</WithStyles(MenuItem)>
</TextField>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronRightIcon) />
</WithStyles(IconButton)>
</div>
</div>
`;
exports[`CustomTable renders some rows 1`] = `
<div
className="pageOverflowHidden"
>
<div>
<Input
InputLabelProps={
Object {
"classes": Object {
"root": "noMargin",
},
}
}
InputProps={
Object {
"classes": Object {
"notchedOutline": "filterBorderRadius",
"root": "noLeftPadding",
},
"startAdornment": <WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>,
}
}
className="filterBox"
height={48}
id="tableFilterBox"
label="Filter"
maxWidth="100%"
onChange={[Function]}
value=""
variant="outlined"
/>
</div>
<div
className="header"
>
<div
className="columnName cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
indeterminate={false}
onChange={[Function]}
/>
</div>
<div
className="columnName"
key="0"
style={
Object {
"width": "50%",
}
}
title="col1"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col1
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
<div
className="columnName"
key="1"
style={
Object {
"width": "50%",
}
}
title="col2"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col2
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
</div>
<div
className="scrollContainer"
style={
Object {
"minHeight": 60,
}
}
>
<div
className="expandableContainer"
key="0"
>
<div
aria-checked={false}
className="tableRow row"
onClick={[Function]}
role="checkbox"
tabIndex={-1}
>
<div
className="cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
/>
</div>
<CustomTableRow
columns={
Array [
Object {
"customRenderer": undefined,
"label": "col1",
},
Object {
"customRenderer": undefined,
"label": "col2",
},
]
}
row={
Object {
"id": "row1",
"otherFields": Array [
"cell1",
"cell2",
],
}
}
/>
</div>
</div>
<div
className="expandableContainer"
key="1"
>
<div
aria-checked={false}
className="tableRow row"
onClick={[Function]}
role="checkbox"
tabIndex={-1}
>
<div
className="cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
/>
</div>
<CustomTableRow
columns={
Array [
Object {
"customRenderer": undefined,
"label": "col1",
},
Object {
"customRenderer": undefined,
"label": "col2",
},
]
}
row={
Object {
"id": "row2",
"otherFields": Array [
"cell1",
"cell2",
],
}
}
/>
</div>
</div>
</div>
<div
className="footer"
>
<span
className=""
>
Rows per page:
</span>
<TextField
InputProps={
Object {
"disableUnderline": true,
}
}
className="rowsPerPage"
classes={
Object {
"root": "verticalAlignInitial",
}
}
onChange={[Function]}
required={false}
select={true}
value={10}
variant="standard"
>
<WithStyles(MenuItem)
key="0"
value={10}
>
10
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="1"
value={20}
>
20
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="2"
value={50}
>
50
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="3"
value={100}
>
100
</WithStyles(MenuItem)>
</TextField>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronRightIcon) />
</WithStyles(IconButton)>
</div>
</div>
`;
exports[`CustomTable renders with default filter label 1`] = `
<div
className="pageOverflowHidden"
>
<div>
<Input
InputLabelProps={
Object {
"classes": Object {
"root": "noMargin",
},
}
}
InputProps={
Object {
"classes": Object {
"notchedOutline": "filterBorderRadius",
"root": "noLeftPadding",
},
"startAdornment": <WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>,
}
}
className="filterBox"
height={48}
id="tableFilterBox"
label="Filter"
maxWidth="100%"
onChange={[Function]}
value=""
variant="outlined"
/>
</div>
<div
className="header"
>
<div
className="columnName cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
indeterminate={false}
onChange={[Function]}
/>
</div>
</div>
<div
className="scrollContainer"
style={
Object {
"minHeight": 60,
}
}
/>
<div
className="footer"
>
<span
className=""
>
Rows per page:
</span>
<TextField
InputProps={
Object {
"disableUnderline": true,
}
}
className="rowsPerPage"
classes={
Object {
"root": "verticalAlignInitial",
}
}
onChange={[Function]}
required={false}
select={true}
value={10}
variant="standard"
>
<WithStyles(MenuItem)
key="0"
value={10}
>
10
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="1"
value={20}
>
20
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="2"
value={50}
>
50
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="3"
value={100}
>
100
</WithStyles(MenuItem)>
</TextField>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronRightIcon) />
</WithStyles(IconButton)>
</div>
</div>
`;
exports[`CustomTable renders with provided filter label 1`] = `
<div
className="pageOverflowHidden"
>
<div>
<Input
InputLabelProps={
Object {
"classes": Object {
"root": "noMargin",
},
}
}
InputProps={
Object {
"classes": Object {
"notchedOutline": "filterBorderRadius",
"root": "noLeftPadding",
},
"startAdornment": <WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>,
}
}
className="filterBox"
height={48}
id="tableFilterBox"
label="test filter label"
maxWidth="100%"
onChange={[Function]}
value=""
variant="outlined"
/>
</div>
<div
className="header"
>
<div
className="columnName cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
indeterminate={false}
onChange={[Function]}
/>
</div>
</div>
<div
className="scrollContainer"
style={
Object {
"minHeight": 60,
}
}
/>
<div
className="footer"
>
<span
className=""
>
Rows per page:
</span>
<TextField
InputProps={
Object {
"disableUnderline": true,
}
}
className="rowsPerPage"
classes={
Object {
"root": "verticalAlignInitial",
}
}
onChange={[Function]}
required={false}
select={true}
value={10}
variant="standard"
>
<WithStyles(MenuItem)
key="0"
value={10}
>
10
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="1"
value={20}
>
20
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="2"
value={50}
>
50
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="3"
value={100}
>
100
</WithStyles(MenuItem)>
</TextField>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronRightIcon) />
</WithStyles(IconButton)>
</div>
</div>
`;
exports[`CustomTable renders without filter box 1`] = `
<div
className="pageOverflowHidden"
>
<div
className="header"
>
<div
className="columnName cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
indeterminate={false}
onChange={[Function]}
/>
</div>
</div>
<div
className="scrollContainer"
style={
Object {
"minHeight": 60,
}
}
/>
<div
className="footer"
>
<span
className=""
>
Rows per page:
</span>
<TextField
InputProps={
Object {
"disableUnderline": true,
}
}
className="rowsPerPage"
classes={
Object {
"root": "verticalAlignInitial",
}
}
onChange={[Function]}
required={false}
select={true}
value={10}
variant="standard"
>
<WithStyles(MenuItem)
key="0"
value={10}
>
10
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="1"
value={20}
>
20
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="2"
value={50}
>
50
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="3"
value={100}
>
100
</WithStyles(MenuItem)>
</TextField>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronRightIcon) />
</WithStyles(IconButton)>
</div>
</div>
`;
exports[`CustomTable renders without rows or columns 1`] = `
<div
className="pageOverflowHidden"
>
<div>
<Input
InputLabelProps={
Object {
"classes": Object {
"root": "noMargin",
},
}
}
InputProps={
Object {
"classes": Object {
"notchedOutline": "filterBorderRadius",
"root": "noLeftPadding",
},
"startAdornment": <WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>,
}
}
className="filterBox"
height={48}
id="tableFilterBox"
label="Filter"
maxWidth="100%"
onChange={[Function]}
value=""
variant="outlined"
/>
</div>
<div
className="header"
>
<div
className="columnName cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
indeterminate={false}
onChange={[Function]}
/>
</div>
</div>
<div
className="scrollContainer"
style={
Object {
"minHeight": 60,
}
}
/>
<div
className="footer"
>
<span
className=""
>
Rows per page:
</span>
<TextField
InputProps={
Object {
"disableUnderline": true,
}
}
className="rowsPerPage"
classes={
Object {
"root": "verticalAlignInitial",
}
}
onChange={[Function]}
required={false}
select={true}
value={10}
variant="standard"
>
<WithStyles(MenuItem)
key="0"
value={10}
>
10
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="1"
value={20}
>
20
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="2"
value={50}
>
50
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="3"
value={100}
>
100
</WithStyles(MenuItem)>
</TextField>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronRightIcon) />
</WithStyles(IconButton)>
</div>
</div>
`;
exports[`CustomTable renders without the checkboxes if disableSelection is true 1`] = `
<div
className="pageOverflowHidden"
>
<div>
<Input
InputLabelProps={
Object {
"classes": Object {
"root": "noMargin",
},
}
}
InputProps={
Object {
"classes": Object {
"notchedOutline": "filterBorderRadius",
"root": "noLeftPadding",
},
"startAdornment": <WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>,
}
}
className="filterBox"
height={48}
id="tableFilterBox"
label="Filter"
maxWidth="100%"
onChange={[Function]}
value=""
variant="outlined"
/>
</div>
<div
className="header"
>
<div
className="columnName"
key="0"
style={
Object {
"width": "50%",
}
}
title="col1"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col1
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
<div
className="columnName"
key="1"
style={
Object {
"width": "50%",
}
}
title="col2"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col2
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
</div>
<div
className="scrollContainer"
style={
Object {
"minHeight": 60,
}
}
>
<div
className="expandableContainer"
key="0"
>
<div
aria-checked={false}
className="tableRow row"
onClick={[Function]}
role="checkbox"
tabIndex={-1}
>
<CustomTableRow
columns={
Array [
Object {
"customRenderer": undefined,
"label": "col1",
},
Object {
"customRenderer": undefined,
"label": "col2",
},
]
}
row={
Object {
"id": "row1",
"otherFields": Array [
"cell1",
"cell2",
],
}
}
/>
</div>
</div>
<div
className="expandableContainer"
key="1"
>
<div
aria-checked={false}
className="tableRow row"
onClick={[Function]}
role="checkbox"
tabIndex={-1}
>
<CustomTableRow
columns={
Array [
Object {
"customRenderer": undefined,
"label": "col1",
},
Object {
"customRenderer": undefined,
"label": "col2",
},
]
}
row={
Object {
"id": "row2",
"otherFields": Array [
"cell1",
"cell2",
],
}
}
/>
</div>
</div>
</div>
<div
className="footer"
>
<span
className=""
>
Rows per page:
</span>
<TextField
InputProps={
Object {
"disableUnderline": true,
}
}
className="rowsPerPage"
classes={
Object {
"root": "verticalAlignInitial",
}
}
onChange={[Function]}
required={false}
select={true}
value={10}
variant="standard"
>
<WithStyles(MenuItem)
key="0"
value={10}
>
10
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="1"
value={20}
>
20
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="2"
value={50}
>
50
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="3"
value={100}
>
100
</WithStyles(MenuItem)>
</TextField>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronRightIcon) />
</WithStyles(IconButton)>
</div>
</div>
`;
exports[`CustomTable updates the filter string in state when the filter box input changes 1`] = `
<div
className="pageOverflowHidden"
>
<div>
<Input
InputLabelProps={
Object {
"classes": Object {
"root": "noMargin",
},
}
}
InputProps={
Object {
"classes": Object {
"notchedOutline": "filterBorderRadius",
"root": "noLeftPadding",
},
"startAdornment": <WithStyles(InputAdornment)
position="end"
>
<pure(FilterListIcon)
style={
Object {
"color": "#80868b",
"paddingRight": 16,
}
}
/>
</WithStyles(InputAdornment)>,
}
}
className="filterBox"
height={48}
id="tableFilterBox"
label="Filter"
maxWidth="100%"
onChange={[Function]}
value="test filter"
variant="outlined"
/>
</div>
<div
className="header"
>
<div
className="columnName cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
indeterminate={false}
onChange={[Function]}
/>
</div>
<div
className="columnName"
key="0"
style={
Object {
"width": "50%",
}
}
title="col1"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col1
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
<div
className="columnName"
key="1"
style={
Object {
"width": "50%",
}
}
title="col2"
>
<WithStyles(Tooltip)
enterDelay={300}
title="Cannot sort by this column"
>
<WithStyles(TableSortLabel)
active={false}
className="ellipsis"
onClick={[Function]}
>
col2
</WithStyles(TableSortLabel)>
</WithStyles(Tooltip)>
</div>
</div>
<div
className="scrollContainer"
style={
Object {
"minHeight": 60,
}
}
>
<div
className="expandableContainer"
key="0"
>
<div
aria-checked={false}
className="tableRow row"
onClick={[Function]}
role="checkbox"
tabIndex={-1}
>
<div
className="cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
/>
</div>
<CustomTableRow
columns={
Array [
Object {
"customRenderer": undefined,
"label": "col1",
},
Object {
"customRenderer": undefined,
"label": "col2",
},
]
}
row={
Object {
"id": "row1",
"otherFields": Array [
"cell1",
"cell2",
],
}
}
/>
</div>
</div>
<div
className="expandableContainer"
key="1"
>
<div
aria-checked={false}
className="tableRow row"
onClick={[Function]}
role="checkbox"
tabIndex={-1}
>
<div
className="cell selectionToggle"
>
<WithStyles(Checkbox)
checked={false}
color="primary"
/>
</div>
<CustomTableRow
columns={
Array [
Object {
"customRenderer": undefined,
"label": "col1",
},
Object {
"customRenderer": undefined,
"label": "col2",
},
]
}
row={
Object {
"id": "row2",
"otherFields": Array [
"cell1",
"cell2",
],
}
}
/>
</div>
</div>
</div>
<div
className="footer"
>
<span
className=""
>
Rows per page:
</span>
<TextField
InputProps={
Object {
"disableUnderline": true,
}
}
className="rowsPerPage"
classes={
Object {
"root": "verticalAlignInitial",
}
}
onChange={[Function]}
required={false}
select={true}
value={10}
variant="standard"
>
<WithStyles(MenuItem)
key="0"
value={10}
>
10
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="1"
value={20}
>
20
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="2"
value={50}
>
50
</WithStyles(MenuItem)>
<WithStyles(MenuItem)
key="3"
value={100}
>
100
</WithStyles(MenuItem)>
</TextField>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronLeftIcon) />
</WithStyles(IconButton)>
<WithStyles(IconButton)
disabled={true}
onClick={[Function]}
>
<pure(ChevronRightIcon) />
</WithStyles(IconButton)>
</div>
</div>
`;
| 7,992 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/__snapshots__/LogViewer.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`LogViewer does not linkify non http/https urls 1`] = `
<div
class="line"
>
<span
class="number"
>
1
</span>
<span
class="line"
>
<span>
<span>
this string: gs://path is a GCS path
</span>
</span>
</span>
</div>
`;
exports[`LogViewer linkifies standalone https urls 1`] = `
<div
class="line"
>
<span
class="number"
>
1
</span>
<span
class="line"
>
<span>
<span>
this string:
</span>
</span>
<span>
<a
class="a"
href="https://path.com"
rel="noopener noreferrer"
target="_blank"
>
https://path.com
</a>
</span>
<span>
<span>
is a url
</span>
</span>
</span>
</div>
`;
exports[`LogViewer linkifies standalone urls 1`] = `
<div
class="line"
>
<span
class="number"
>
1
</span>
<span
class="line"
>
<span>
<span>
this string:
</span>
</span>
<span>
<a
class="a"
href="http://path.com"
rel="noopener noreferrer"
target="_blank"
>
http://path.com
</a>
</span>
<span>
<span>
is a url
</span>
</span>
</span>
</div>
`;
exports[`LogViewer linkifies substring urls 1`] = `
<div
class="line"
>
<span
class="number"
>
1
</span>
<span
class="line"
>
<span>
<span>
this string:
</span>
</span>
<span>
<a
class="a"
href="http://path.com"
rel="noopener noreferrer"
target="_blank"
>
http://path.com
</a>
</span>
<span>
<span>
is a url
</span>
</span>
</span>
</div>
`;
exports[`LogViewer renders a multi-line log 1`] = `
<div
class="line"
>
<span
class="number"
>
1
</span>
<span
class="line"
>
<span>
<span>
Lorem Ipsum is simply dummy text of the printing and typesetting
</span>
</span>
</span>
</div>
`;
exports[`LogViewer renders a row with error 1`] = `
<div
class="line"
>
<span
class="number"
style="background-color: rgb(112, 0, 0); color: white;"
>
1
</span>
<span
class="line"
style="background-color: rgb(112, 0, 0); color: white;"
>
<span>
<span>
line1 with error
</span>
</span>
</span>
</div>
`;
exports[`LogViewer renders a row with error word as substring 1`] = `
<div
class="line"
>
<span
class="number"
style="background-color: rgb(112, 0, 0); color: white;"
>
1
</span>
<span
class="line"
style="background-color: rgb(112, 0, 0); color: white;"
>
<span>
<span>
line1 with errorWord
</span>
</span>
</span>
</div>
`;
exports[`LogViewer renders a row with given index as line number 1`] = `
<div
class="line"
>
<span
class="number"
>
1
</span>
<span
class="line"
>
<span>
<span>
line1
</span>
</span>
</span>
</div>
`;
exports[`LogViewer renders a row with upper case error 1`] = `
<div
class="line"
>
<span
class="number"
style="background-color: rgb(112, 0, 0); color: white;"
>
1
</span>
<span
class="line"
style="background-color: rgb(112, 0, 0); color: white;"
>
<span>
<span>
line1 with ERROR
</span>
</span>
</span>
</div>
`;
exports[`LogViewer renders a row with upper case warning 1`] = `
<div
class="line"
>
<span
class="number"
style="background-color: rgb(84, 84, 0); color: white;"
>
1
</span>
<span
class="line"
style="background-color: rgb(84, 84, 0); color: white;"
>
<span>
<span>
line1 with WARNING
</span>
</span>
</span>
</div>
`;
exports[`LogViewer renders a row with warn 1`] = `
<div
class="line"
>
<span
class="number"
style="background-color: rgb(84, 84, 0); color: white;"
>
1
</span>
<span
class="line"
style="background-color: rgb(84, 84, 0); color: white;"
>
<span>
<span>
line1 with warn
</span>
</span>
</span>
</div>
`;
exports[`LogViewer renders a row with warning 1`] = `
<div
class="line"
>
<span
class="number"
style="background-color: rgb(84, 84, 0); color: white;"
>
1
</span>
<span
class="line"
style="background-color: rgb(84, 84, 0); color: white;"
>
<span>
<span>
line1 with warning
</span>
</span>
</span>
</div>
`;
exports[`LogViewer renders a row with warning word as substring 1`] = `
<div
class="line"
>
<span
class="number"
style="background-color: rgb(84, 84, 0); color: white;"
>
1
</span>
<span
class="line"
style="background-color: rgb(84, 84, 0); color: white;"
>
<span>
<span>
line1 with warning:something
</span>
</span>
</span>
</div>
`;
exports[`LogViewer renders an empty container when no logs passed 1`] = `
<AutoSizer
disableHeight={false}
disableWidth={false}
onResize={[Function]}
style={Object {}}
>
<Component />
</AutoSizer>
`;
exports[`LogViewer renders one log line 1`] = `
<div
class="line"
>
<span
class="number"
>
1
</span>
<span
class="line"
>
<span>
<span>
first line
</span>
</span>
</span>
</div>
`;
exports[`LogViewer renders one long line without breaking 1`] = `
<div
class="line"
>
<span
class="number"
>
1
</span>
<span
class="line"
>
<span>
<span>
Lorem Ipsum is simply dummy text of the printing and typesettingindustry. Lorem Ipsum has been the industry's standard dummy text eversince the 1500s, when an unknown printer took a galley of type andscrambled it to make a type specimen book. It has survived not only fivecenturies, but also the leap into electronic typesetting, remainingessentially unchanged. It was popularised in the 1960s with the releaseof Letraset sheets containing Lorem Ipsum passages, and more recentlywith desktop publishing software like Aldus PageMaker including versionsof Lorem Ipsum.
</span>
</span>
</span>
</div>
`;
exports[`LogViewer renders two log lines 1`] = `
<div
class="line"
>
<span
class="number"
>
1
</span>
<span
class="line"
>
<span>
<span>
first line
</span>
</span>
</span>
</div>
`;
| 7,993 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/__snapshots__/UploadPipelineDialog.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`UploadPipelineDialog renders alternate UI for uploading via URL 1`] = `
<WithStyles(Dialog)
classes={
Object {
"paper": "root",
}
}
id="uploadDialog"
onClose={[Function]}
open={false}
>
<WithStyles(DialogTitle)>
Upload and name your pipeline
</WithStyles(DialogTitle)>
<div
className=""
>
<div
className="flex"
>
<WithStyles(WithFormControlContext(FormControlLabel))
checked={false}
control={
<WithStyles(Radio)
color="primary"
/>
}
id="uploadLocalFileBtn"
label="Upload a file"
onChange={[Function]}
/>
<WithStyles(WithFormControlContext(FormControlLabel))
checked={true}
control={
<WithStyles(Radio)
color="primary"
/>
}
id="uploadFromUrlBtn"
label="Import by URL"
onChange={[Function]}
/>
</div>
<div
className=""
>
URL must be publicly accessible.
</div>
<DocumentationCompilePipeline />
<Input
label="URL"
onChange={[Function]}
required={true}
value=""
variant="outlined"
/>
<Input
id="uploadFileName"
label="Pipeline name"
onChange={[Function]}
required={true}
value=""
variant="outlined"
/>
</div>
<WithStyles(DialogActions)>
<WithStyles(Button)
id="cancelUploadBtn"
onClick={[Function]}
>
Cancel
</WithStyles(Button)>
<BusyButton
busy={false}
disabled={true}
id="confirmUploadBtn"
onClick={[Function]}
title="Upload"
/>
</WithStyles(DialogActions)>
</WithStyles(Dialog)>
`;
exports[`UploadPipelineDialog renders an active dropzone 1`] = `
<WithStyles(Dialog)
classes={
Object {
"paper": "root",
}
}
id="uploadDialog"
onClose={[Function]}
open={false}
>
<WithStyles(DialogTitle)>
Upload and name your pipeline
</WithStyles(DialogTitle)>
<div
className=""
>
<div
className="flex"
>
<WithStyles(WithFormControlContext(FormControlLabel))
checked={true}
control={
<WithStyles(Radio)
color="primary"
/>
}
id="uploadLocalFileBtn"
label="Upload a file"
onChange={[Function]}
/>
<WithStyles(WithFormControlContext(FormControlLabel))
checked={false}
control={
<WithStyles(Radio)
color="primary"
/>
}
id="uploadFromUrlBtn"
label="Import by URL"
onChange={[Function]}
/>
</div>
<n
disableClick={true}
disablePreview={false}
disabled={false}
getDataTransferItems={[Function]}
id="dropZone"
inputProps={
Object {
"tabIndex": -1,
}
}
maxSize={Infinity}
minSize={0}
multiple={true}
onDragEnter={[Function]}
onDragLeave={[Function]}
onDrop={[Function]}
preventDropOnDocument={true}
style={
Object {
"position": "relative",
}
}
>
<div
className="dropOverlay"
>
Drop files..
</div>
<div
className=""
>
Choose a pipeline package file from your computer, and give the pipeline a unique name.
<br />
You can also drag and drop the file here.
</div>
<DocumentationCompilePipeline />
<Input
InputProps={
Object {
"endAdornment": <WithStyles(InputAdornment)
position="end"
>
<WithStyles(Button)
color="secondary"
onClick={[Function]}
style={
Object {
"margin": 0,
"padding": "3px 5px",
"whiteSpace": "nowrap",
}
}
>
Choose file
</WithStyles(Button)>
</WithStyles(InputAdornment)>,
"readOnly": true,
}
}
label="File"
onChange={[Function]}
required={true}
value=""
variant="outlined"
/>
</n>
<Input
id="uploadFileName"
label="Pipeline name"
onChange={[Function]}
required={true}
value=""
variant="outlined"
/>
</div>
<WithStyles(DialogActions)>
<WithStyles(Button)
id="cancelUploadBtn"
onClick={[Function]}
>
Cancel
</WithStyles(Button)>
<BusyButton
busy={false}
disabled={true}
id="confirmUploadBtn"
onClick={[Function]}
title="Upload"
/>
</WithStyles(DialogActions)>
</WithStyles(Dialog)>
`;
exports[`UploadPipelineDialog renders closed 1`] = `
<WithStyles(Dialog)
classes={
Object {
"paper": "root",
}
}
id="uploadDialog"
onClose={[Function]}
open={false}
>
<WithStyles(DialogTitle)>
Upload and name your pipeline
</WithStyles(DialogTitle)>
<div
className=""
>
<div
className="flex"
>
<WithStyles(WithFormControlContext(FormControlLabel))
checked={true}
control={
<WithStyles(Radio)
color="primary"
/>
}
id="uploadLocalFileBtn"
label="Upload a file"
onChange={[Function]}
/>
<WithStyles(WithFormControlContext(FormControlLabel))
checked={false}
control={
<WithStyles(Radio)
color="primary"
/>
}
id="uploadFromUrlBtn"
label="Import by URL"
onChange={[Function]}
/>
</div>
<n
disableClick={true}
disablePreview={false}
disabled={false}
getDataTransferItems={[Function]}
id="dropZone"
inputProps={
Object {
"tabIndex": -1,
}
}
maxSize={Infinity}
minSize={0}
multiple={true}
onDragEnter={[Function]}
onDragLeave={[Function]}
onDrop={[Function]}
preventDropOnDocument={true}
style={
Object {
"position": "relative",
}
}
>
<div
className=""
>
Choose a pipeline package file from your computer, and give the pipeline a unique name.
<br />
You can also drag and drop the file here.
</div>
<DocumentationCompilePipeline />
<Input
InputProps={
Object {
"endAdornment": <WithStyles(InputAdornment)
position="end"
>
<WithStyles(Button)
color="secondary"
onClick={[Function]}
style={
Object {
"margin": 0,
"padding": "3px 5px",
"whiteSpace": "nowrap",
}
}
>
Choose file
</WithStyles(Button)>
</WithStyles(InputAdornment)>,
"readOnly": true,
}
}
label="File"
onChange={[Function]}
required={true}
value=""
variant="outlined"
/>
</n>
<Input
id="uploadFileName"
label="Pipeline name"
onChange={[Function]}
required={true}
value=""
variant="outlined"
/>
</div>
<WithStyles(DialogActions)>
<WithStyles(Button)
id="cancelUploadBtn"
onClick={[Function]}
>
Cancel
</WithStyles(Button)>
<BusyButton
busy={false}
disabled={true}
id="confirmUploadBtn"
onClick={[Function]}
title="Upload"
/>
</WithStyles(DialogActions)>
</WithStyles(Dialog)>
`;
exports[`UploadPipelineDialog renders open 1`] = `
<WithStyles(Dialog)
classes={
Object {
"paper": "root",
}
}
id="uploadDialog"
onClose={[Function]}
open={false}
>
<WithStyles(DialogTitle)>
Upload and name your pipeline
</WithStyles(DialogTitle)>
<div
className=""
>
<div
className="flex"
>
<WithStyles(WithFormControlContext(FormControlLabel))
checked={true}
control={
<WithStyles(Radio)
color="primary"
/>
}
id="uploadLocalFileBtn"
label="Upload a file"
onChange={[Function]}
/>
<WithStyles(WithFormControlContext(FormControlLabel))
checked={false}
control={
<WithStyles(Radio)
color="primary"
/>
}
id="uploadFromUrlBtn"
label="Import by URL"
onChange={[Function]}
/>
</div>
<n
disableClick={true}
disablePreview={false}
disabled={false}
getDataTransferItems={[Function]}
id="dropZone"
inputProps={
Object {
"tabIndex": -1,
}
}
maxSize={Infinity}
minSize={0}
multiple={true}
onDragEnter={[Function]}
onDragLeave={[Function]}
onDrop={[Function]}
preventDropOnDocument={true}
style={
Object {
"position": "relative",
}
}
>
<div
className=""
>
Choose a pipeline package file from your computer, and give the pipeline a unique name.
<br />
You can also drag and drop the file here.
</div>
<DocumentationCompilePipeline />
<Input
InputProps={
Object {
"endAdornment": <WithStyles(InputAdornment)
position="end"
>
<WithStyles(Button)
color="secondary"
onClick={[Function]}
style={
Object {
"margin": 0,
"padding": "3px 5px",
"whiteSpace": "nowrap",
}
}
>
Choose file
</WithStyles(Button)>
</WithStyles(InputAdornment)>,
"readOnly": true,
}
}
label="File"
onChange={[Function]}
required={true}
value=""
variant="outlined"
/>
</n>
<Input
id="uploadFileName"
label="Pipeline name"
onChange={[Function]}
required={true}
value=""
variant="outlined"
/>
</div>
<WithStyles(DialogActions)>
<WithStyles(Button)
id="cancelUploadBtn"
onClick={[Function]}
>
Cancel
</WithStyles(Button)>
<BusyButton
busy={false}
disabled={true}
id="confirmUploadBtn"
onClick={[Function]}
title="Upload"
/>
</WithStyles(DialogActions)>
</WithStyles(Dialog)>
`;
exports[`UploadPipelineDialog renders with a selected file to upload 1`] = `
<WithStyles(Dialog)
classes={
Object {
"paper": "root",
}
}
id="uploadDialog"
onClose={[Function]}
open={false}
>
<WithStyles(DialogTitle)>
Upload and name your pipeline
</WithStyles(DialogTitle)>
<div
className=""
>
<div
className="flex"
>
<WithStyles(WithFormControlContext(FormControlLabel))
checked={true}
control={
<WithStyles(Radio)
color="primary"
/>
}
id="uploadLocalFileBtn"
label="Upload a file"
onChange={[Function]}
/>
<WithStyles(WithFormControlContext(FormControlLabel))
checked={false}
control={
<WithStyles(Radio)
color="primary"
/>
}
id="uploadFromUrlBtn"
label="Import by URL"
onChange={[Function]}
/>
</div>
<n
disableClick={true}
disablePreview={false}
disabled={false}
getDataTransferItems={[Function]}
id="dropZone"
inputProps={
Object {
"tabIndex": -1,
}
}
maxSize={Infinity}
minSize={0}
multiple={true}
onDragEnter={[Function]}
onDragLeave={[Function]}
onDrop={[Function]}
preventDropOnDocument={true}
style={
Object {
"position": "relative",
}
}
>
<div
className=""
>
Choose a pipeline package file from your computer, and give the pipeline a unique name.
<br />
You can also drag and drop the file here.
</div>
<DocumentationCompilePipeline />
<Input
InputProps={
Object {
"endAdornment": <WithStyles(InputAdornment)
position="end"
>
<WithStyles(Button)
color="secondary"
onClick={[Function]}
style={
Object {
"margin": 0,
"padding": "3px 5px",
"whiteSpace": "nowrap",
}
}
>
Choose file
</WithStyles(Button)>
</WithStyles(InputAdornment)>,
"readOnly": true,
}
}
label="File"
onChange={[Function]}
required={true}
value=""
variant="outlined"
/>
</n>
<Input
id="uploadFileName"
label="Pipeline name"
onChange={[Function]}
required={true}
value=""
variant="outlined"
/>
</div>
<WithStyles(DialogActions)>
<WithStyles(Button)
id="cancelUploadBtn"
onClick={[Function]}
>
Cancel
</WithStyles(Button)>
<BusyButton
busy={false}
disabled={true}
id="confirmUploadBtn"
onClick={[Function]}
title="Upload"
/>
</WithStyles(DialogActions)>
</WithStyles(Dialog)>
`;
| 7,994 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/__snapshots__/CompareTable.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`CompareTable renders no data 1`] = `""`;
exports[`CompareTable renders one row with three columns 1`] = `
<table
className="root"
>
<tbody>
<tr
className="row"
>
<td
className="labelCell"
/>
<td
className="cell labelCell"
key="0"
title="col1"
>
col1
</td>
<td
className="cell labelCell"
key="1"
title="col2"
>
col2
</td>
<td
className="cell labelCell"
key="2"
title="col3"
>
col3
</td>
</tr>
<tr
className="row"
key="0"
>
<td
className="cell labelCell"
title="row1"
>
row1
</td>
<td
className="cell"
key="0"
title="1"
>
1
</td>
<td
className="cell"
key="1"
title="2"
>
2
</td>
<td
className="cell"
key="2"
title="3"
>
3
</td>
</tr>
<tr
className="row"
key="1"
>
<td
className="cell labelCell"
title="row2"
>
row2
</td>
<td
className="cell"
key="0"
title="4"
>
4
</td>
<td
className="cell"
key="1"
title="5"
>
5
</td>
<td
className="cell"
key="2"
title="6"
>
6
</td>
</tr>
<tr
className="row"
key="2"
>
<td
className="cell labelCell"
title="row3"
>
row3
</td>
<td
className="cell"
key="0"
title="cell7"
>
cell7
</td>
<td
className="cell"
key="1"
title="cell8"
>
cell8
</td>
<td
className="cell"
key="2"
title="cell9"
>
cell9
</td>
</tr>
</tbody>
</table>
`;
| 7,995 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/__snapshots__/Editor.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Editor renders a placeholder that contains HTML 1`] = `"<div id=\\"brace-editor\\" style=\\"width: 500px; height: 500px;\\" class=\\" ace_editor ace-tm\\"><textarea class=\\"ace_text-input\\" wrap=\\"off\\" autocorrect=\\"off\\" autocapitalize=\\"off\\" spellcheck=\\"false\\" style=\\"opacity: 0;\\"></textarea><div class=\\"ace_gutter\\" aria-hidden=\\"true\\"><div class=\\"ace_layer ace_gutter-layer ace_folding-enabled\\"></div><div class=\\"ace_gutter-active-line\\"></div></div><div class=\\"ace_scroller\\"><div class=\\"ace_content\\"><div class=\\"ace_layer ace_print-margin-layer\\"><div class=\\"ace_print-margin\\" style=\\"left: 4px; visibility: visible;\\"></div></div><div class=\\"ace_layer ace_marker-layer\\"></div><div class=\\"ace_layer ace_text-layer\\" style=\\"padding: 0px 4px;\\"></div><div class=\\"ace_layer ace_marker-layer\\"></div><div class=\\"ace_layer ace_cursor-layer ace_hidden-cursors\\"><div class=\\"ace_cursor\\"></div></div></div><div class=\\"ace_comment ace_placeholder\\" style=\\"padding: 0px 9px; position: absolute; z-index: 3;\\">I am a placeholder with <strong>HTML</strong>.</div></div><div class=\\"ace_scrollbar ace_scrollbar-v\\" style=\\"display: none; width: 20px;\\"><div class=\\"ace_scrollbar-inner\\" style=\\"width: 20px;\\"></div></div><div class=\\"ace_scrollbar ace_scrollbar-h\\" style=\\"display: none; height: 20px;\\"><div class=\\"ace_scrollbar-inner\\" style=\\"height: 20px;\\"></div></div><div style=\\"height: auto; width: auto; top: 0px; left: 0px; visibility: hidden; position: absolute; white-space: pre; overflow: hidden;\\"><div style=\\"height: auto; width: auto; top: 0px; left: 0px; visibility: hidden; position: absolute; white-space: pre; overflow: visible;\\"></div><div style=\\"height: auto; width: auto; top: 0px; left: 0px; visibility: hidden; position: absolute; white-space: pre; overflow: visible;\\">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</div></div></div>"`;
exports[`Editor renders with a placeholder 1`] = `"<div id=\\"brace-editor\\" style=\\"width: 500px; height: 500px;\\" class=\\" ace_editor ace-tm\\"><textarea class=\\"ace_text-input\\" wrap=\\"off\\" autocorrect=\\"off\\" autocapitalize=\\"off\\" spellcheck=\\"false\\" style=\\"opacity: 0;\\"></textarea><div class=\\"ace_gutter\\" aria-hidden=\\"true\\"><div class=\\"ace_layer ace_gutter-layer ace_folding-enabled\\"></div><div class=\\"ace_gutter-active-line\\"></div></div><div class=\\"ace_scroller\\"><div class=\\"ace_content\\"><div class=\\"ace_layer ace_print-margin-layer\\"><div class=\\"ace_print-margin\\" style=\\"left: 4px; visibility: visible;\\"></div></div><div class=\\"ace_layer ace_marker-layer\\"></div><div class=\\"ace_layer ace_text-layer\\" style=\\"padding: 0px 4px;\\"></div><div class=\\"ace_layer ace_marker-layer\\"></div><div class=\\"ace_layer ace_cursor-layer ace_hidden-cursors\\"><div class=\\"ace_cursor\\"></div></div></div><div class=\\"ace_comment ace_placeholder\\" style=\\"padding: 0px 9px; position: absolute; z-index: 3;\\">I am a placeholder.</div></div><div class=\\"ace_scrollbar ace_scrollbar-v\\" style=\\"display: none; width: 20px;\\"><div class=\\"ace_scrollbar-inner\\" style=\\"width: 20px;\\"></div></div><div class=\\"ace_scrollbar ace_scrollbar-h\\" style=\\"display: none; height: 20px;\\"><div class=\\"ace_scrollbar-inner\\" style=\\"height: 20px;\\"></div></div><div style=\\"height: auto; width: auto; top: 0px; left: 0px; visibility: hidden; position: absolute; white-space: pre; overflow: hidden;\\"><div style=\\"height: auto; width: auto; top: 0px; left: 0px; visibility: hidden; position: absolute; white-space: pre; overflow: visible;\\"></div><div style=\\"height: auto; width: auto; top: 0px; left: 0px; visibility: hidden; position: absolute; white-space: pre; overflow: visible;\\">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</div></div></div>"`;
exports[`Editor renders without a placeholder and value 1`] = `"<div id=\\"brace-editor\\" style=\\"width: 500px; height: 500px;\\" class=\\" ace_editor ace-tm\\"><textarea class=\\"ace_text-input\\" wrap=\\"off\\" autocorrect=\\"off\\" autocapitalize=\\"off\\" spellcheck=\\"false\\" style=\\"opacity: 0;\\"></textarea><div class=\\"ace_gutter\\" aria-hidden=\\"true\\"><div class=\\"ace_layer ace_gutter-layer ace_folding-enabled\\"></div><div class=\\"ace_gutter-active-line\\"></div></div><div class=\\"ace_scroller\\"><div class=\\"ace_content\\"><div class=\\"ace_layer ace_print-margin-layer\\"><div class=\\"ace_print-margin\\" style=\\"left: 4px; visibility: visible;\\"></div></div><div class=\\"ace_layer ace_marker-layer\\"></div><div class=\\"ace_layer ace_text-layer\\" style=\\"padding: 0px 4px;\\"></div><div class=\\"ace_layer ace_marker-layer\\"></div><div class=\\"ace_layer ace_cursor-layer ace_hidden-cursors\\"><div class=\\"ace_cursor\\"></div></div></div></div><div class=\\"ace_scrollbar ace_scrollbar-v\\" style=\\"display: none; width: 20px;\\"><div class=\\"ace_scrollbar-inner\\" style=\\"width: 20px;\\"></div></div><div class=\\"ace_scrollbar ace_scrollbar-h\\" style=\\"display: none; height: 20px;\\"><div class=\\"ace_scrollbar-inner\\" style=\\"height: 20px;\\"></div></div><div style=\\"height: auto; width: auto; top: 0px; left: 0px; visibility: hidden; position: absolute; white-space: pre; overflow: hidden;\\"><div style=\\"height: auto; width: auto; top: 0px; left: 0px; visibility: hidden; position: absolute; white-space: pre; overflow: visible;\\"></div><div style=\\"height: auto; width: auto; top: 0px; left: 0px; visibility: hidden; position: absolute; white-space: pre; overflow: visible;\\">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</div></div></div>"`;
| 7,996 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/__snapshots__/Metric.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Metric renders a metric and does not log an error when metric is between max and min value 1`] = `
<div
className="metricContainer"
>
<div
className="metricFill"
style={
Object {
"width": "calc(54%)",
}
}
>
0.540
</div>
</div>
`;
exports[`Metric renders a metric and logs an error when metric has value greater than max value 1`] = `
<div
style={
Object {
"paddingLeft": 6,
}
}
>
2.000
</div>
`;
exports[`Metric renders a metric and logs an error when metric has value less than min value 1`] = `
<div
style={
Object {
"paddingLeft": 6,
}
}
>
-0.540
</div>
`;
exports[`Metric renders a metric when metric has max and min value of 0 1`] = `
<div
style={
Object {
"paddingLeft": 6,
}
}
>
0.540
</div>
`;
exports[`Metric renders a metric when metric has value and percentage format 1`] = `
<div
className="metricContainer"
>
<div
className="metricFill"
style={
Object {
"width": "calc(54.000%)",
}
}
>
54.000%
</div>
</div>
`;
exports[`Metric renders an empty metric when metric has no metadata and raw format 1`] = `<div />`;
exports[`Metric renders an empty metric when metric has no metadata and unspecified format 1`] = `<div />`;
exports[`Metric renders an empty metric when metric has no value 1`] = `<div />`;
exports[`Metric renders an empty metric when there is no metric 1`] = `<div />`;
| 7,997 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/__snapshots__/CustomTableRow.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`CustomTable displays warning icon with tooltip if row has error 1`] = `
<Fragment>
<div
className="cell"
key="0"
style={
Object {
"width": "50%",
}
}
>
<WithStyles(Tooltip)
title="dummy error"
>
<pure(WarningRoundedIcon)
className="icon"
/>
</WithStyles(Tooltip)>
cell1
</div>
<div
className="cell"
key="1"
style={
Object {
"width": "50%",
}
}
>
cell2
</div>
</Fragment>
`;
exports[`CustomTable renders some rows using a custom renderer 1`] = `
<Fragment>
<div
className="cell"
key="0"
style={
Object {
"width": "50%",
}
}
>
<span>
this is custom output
</span>
</div>
<div
className="cell"
key="1"
style={
Object {
"width": "50%",
}
}
>
cell2
</div>
</Fragment>
`;
| 7,998 |
0 | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components | kubeflow_public_repos/kfp-tekton-backend/frontend/src/components/__snapshots__/Description.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Description When in inline mode renders markdown link 1`] = `
<a
class="link"
href="https://www.google.com"
rel="noopener"
target="_blank"
>
google
</a>
`;
exports[`Description When in inline mode renders markdown list as pure text 1`] = `
<span>
* abc
* def
</span>
`;
exports[`Description When in inline mode renders paragraphs separated by space 1`] = `
<span>
Paragraph 1
Paragraph 2
</span>
`;
exports[`Description When in inline mode renders pure text 1`] = `
<span>
this is a line of pure text
</span>
`;
exports[`Description When in inline mode renders raw link 1`] = `
<a
class="link"
href="https://www.google.com"
rel="noopener"
target="_blank"
>
https://www.google.com
</a>
`;
exports[`Description When in normal mode renders empty string 1`] = `<span />`;
exports[`Description When in normal mode renders markdown link 1`] = `
<a
class="link"
href="https://www.google.com"
rel="noopener"
target="_blank"
>
google
</a>
`;
exports[`Description When in normal mode renders markdown list as list 1`] = `
<ul>
<li>
abc
</li>
<li>
def
</li>
</ul>
`;
exports[`Description When in normal mode renders paragraphs 1`] = `
<div>
<p>
Paragraph 1
</p>
<p>
Paragraph 2
</p>
</div>
`;
exports[`Description When in normal mode renders pure text 1`] = `
<span>
this is a line of pure text
</span>
`;
exports[`Description When in normal mode renders raw link 1`] = `
<a
class="link"
href="https://www.google.com"
rel="noopener"
target="_blank"
>
https://www.google.com
</a>
`;
| 7,999 |
Subsets and Splits