Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): v3 UI tweaks #4933

Merged
merged 1 commit into from
Jan 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ui/src/app/workflows/components/workflow-creator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ export const WorkflowCreator = ({namespace, onCreate}: {namespace: string; onCre
entrypoints={(workflowTemplate.spec.templates || []).map(t => t.name)}
parameters={workflowTemplate.spec.arguments.parameters || []}
/>
<Button outline={true} onClick={() => setStage('full-editor')}>
Edit using full workflow options
</Button>
<a onClick={() => setStage('full-editor')}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed for consistency

Edit using full workflow options <i className='fa fa-caret-right' />
</a>
</>
)}
{stage === 'full-editor' && workflow && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,13 @@ export const WorkflowDetails = ({history, location, match}: RouteComponentProps<
const retryWatch = new RetryWatch<Workflow>(
() => services.workflows.watch({name, namespace}),
() => setError(null),
e => setWorkflow(e.object),
e => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When the workflow is deleted, we get a message and we still show the workflow itself:

image

if (e.type === 'DELETED') {
setError(new Error('Workflow deleted'));
} else {
setWorkflow(e.object);
}
},
setError
);
retryWatch.start();
Expand Down Expand Up @@ -250,6 +256,7 @@ export const WorkflowDetails = ({history, location, match}: RouteComponentProps<
workflow={workflow}
links={links}
onShowContainerLogs={(_, container) => setSidePanel(`logs:${nodeId}:${container}`)}
onShowEvents={() => setSidePanel(`events:${nodeId}`)}
onShowYaml={() => setSidePanel(`yaml:${nodeId}`)}
archived={false}
/>
Expand All @@ -263,6 +270,7 @@ export const WorkflowDetails = ({history, location, match}: RouteComponentProps<
{parsedSidePanel.type === 'logs' && (
<WorkflowLogsViewer workflow={workflow} nodeId={parsedSidePanel.nodeId} container={parsedSidePanel.container} archived={false} />
)}
{parsedSidePanel.type === 'events' && <EventsPanel namespace={namespace} kind='Pod' name={parsedSidePanel.nodeId} />}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Node events now appear is a much more spacious side-panel:

image

{parsedSidePanel.type === 'share' && <WidgetGallery namespace={namespace} name={name} />}
{parsedSidePanel.type === 'yaml' && <WorkflowYamlViewer workflow={workflow} selectedNode={selectedNode} />}
{!parsedSidePanel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {Timestamp} from '../../../shared/components/timestamp';
import {ResourcesDuration} from '../../../shared/resources-duration';
import {services} from '../../../shared/services';
import {getResolvedTemplates} from '../../../shared/template-resolution';
import {EventsPanel} from '../events-panel';

require('./workflow-node-info.scss');

Expand All @@ -39,6 +38,7 @@ interface Props {
links: models.Link[];
archived: boolean;
onShowContainerLogs: (nodeId: string, container: string) => any;
onShowEvents?: () => void;
onShowYaml?: (nodeId: string) => any;
}

Expand Down Expand Up @@ -142,6 +142,11 @@ const WorkflowNodeSummary = (props: Props) => {
<i className='fa fa-bars' /> main logs
</DropDownButton>
)}{' '}
{props.node.type === 'Pod' && props.onShowEvents && (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved events next to logs:

image

<Button icon='bell' onClick={() => props.onShowEvents()}>
EVENTS
</Button>
)}{' '}
<Links
object={{
metadata: {
Expand Down Expand Up @@ -218,6 +223,7 @@ const WorkflowNodeContainer = (props: {
nodeId: string;
container: models.kubernetes.Container | models.Sidecar | models.Script;
onShowContainerLogs: (nodeId: string, container: string) => any;
onShowEvents: () => void;
}) => {
const container = {name: 'main', args: Array<string>(), source: '', ...props.container};
const maybeQuote = (v: string) => (v.includes(' ') ? `'${v}'` : v);
Expand Down Expand Up @@ -281,7 +287,12 @@ class WorkflowNodeContainers extends React.Component<Props, {selectedSidecar: st
return (
<div className='workflow-node-info__containers'>
{this.state.selectedSidecar && <i className='fa fa-angle-left workflow-node-info__sidecar-back' onClick={() => this.setState({selectedSidecar: null})} />}
<WorkflowNodeContainer nodeId={this.props.node.id} container={container} onShowContainerLogs={this.props.onShowContainerLogs} />
<WorkflowNodeContainer
nodeId={this.props.node.id}
container={container}
onShowContainerLogs={this.props.onShowContainerLogs}
onShowEvents={this.props.onShowEvents}
/>
{!this.state.selectedSidecar && template.sidecars && template.sidecars.length > 0 && (
<div>
<p>SIDECARS:</p>
Expand Down Expand Up @@ -366,11 +377,6 @@ export const WorkflowNodeInfo = (props: Props) => (
</div>
)
},
props.node.type === 'Pod' && {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed this tab

title: 'EVENTS',
key: 'events',
content: <EventsPanel namespace={props.workflow.metadata.namespace} kind='Pod' name={props.node.id} />
},
{
title: 'CONTAINERS',
key: 'containers',
Expand Down