Skip to content

Commit

Permalink
feat: get full inputs/outputs from execution data
Browse files Browse the repository at this point in the history
  • Loading branch information
kanterov committed Aug 31, 2020
1 parent 2c4a879 commit b22923f
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ const RemoteExecutionOutputs: React.FC<{ execution: Execution }> = ({
}) => {
const executionData = useWorkflowExecutionData(execution.id);
return (
<WaitForData {...executionData}>
{() => (
<RemoteLiteralMapViewer blob={executionData.value.outputs} />
)}
<WaitForData {...executionData} spinnerVariant="none">
{() => {
executionData.value.fullOutputs !== undefined ? (
<LiteralMapViewer map={executionData.value.fullOutputs} />
) : (
<RemoteLiteralMapViewer
blob={executionData.value.outputs}
/>
);
}}
</WaitForData>
);
};
Expand Down
15 changes: 11 additions & 4 deletions src/components/Executions/ExecutionDetails/NodeExecutionData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Typography from '@material-ui/core/Typography';
import { WaitForData } from 'components/common';
import { useCommonStyles } from 'components/common/styles';
import { useNodeExecutionData } from 'components/hooks';
import { RemoteLiteralMapViewer } from 'components/Literals';
import { LiteralMapViewer, RemoteLiteralMapViewer } from 'components/Literals';
import { NodeExecution } from 'models';
import * as React from 'react';

Expand All @@ -26,9 +26,16 @@ export const NodeExecutionData: React.FC<{ execution: NodeExecution }> = ({
</Typography>
</header>
<section>
<RemoteLiteralMapViewer
blob={executionData.value.inputs}
/>
{executionData.value.fullInputs !==
undefined ? (
<LiteralMapViewer
map={executionData.value.fullInputs}
/>
) : (
<RemoteLiteralMapViewer
blob={executionData.value.inputs}
/>
)}
</section>
</div>
</div>
Expand Down
14 changes: 10 additions & 4 deletions src/components/Executions/ExecutionDetails/NodeExecutionInputs.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { WaitForData } from 'components/common';
import { useCommonStyles } from 'components/common/styles';
import { useNodeExecutionData } from 'components/hooks';
import { RemoteLiteralMapViewer } from 'components/Literals';
import { LiteralMapViewer, RemoteLiteralMapViewer } from 'components/Literals';
import { NodeExecution } from 'models';
import * as React from 'react';

Expand All @@ -17,9 +17,15 @@ export const NodeExecutionInputs: React.FC<{ execution: NodeExecution }> = ({
<>
<div className={commonStyles.detailsPanelCard}>
<div className={commonStyles.detailsPanelCardContent}>
<RemoteLiteralMapViewer
blob={executionData.value.inputs}
/>
{executionData.value.fullInputs !== undefined ? (
<LiteralMapViewer
map={executionData.value.fullInputs}
/>
) : (
<RemoteLiteralMapViewer
blob={executionData.value.inputs}
/>
)}
</div>
</div>
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { WaitForData } from 'components/common';
import { useCommonStyles } from 'components/common/styles';
import { useNodeExecutionData } from 'components/hooks';
import { RemoteLiteralMapViewer } from 'components/Literals';
import { LiteralMapViewer, RemoteLiteralMapViewer } from 'components/Literals';
import { NodeExecution } from 'models';
import * as React from 'react';

Expand All @@ -17,9 +17,15 @@ export const NodeExecutionOutputs: React.FC<{ execution: NodeExecution }> = ({
<>
<div className={commonStyles.detailsPanelCard}>
<div className={commonStyles.detailsPanelCardContent}>
<RemoteLiteralMapViewer
blob={executionData.value.outputs}
/>
{executionData.value.fullOutputs !== undefined ? (
<LiteralMapViewer
map={executionData.value.fullOutputs}
/>
) : (
<RemoteLiteralMapViewer
blob={executionData.value.outputs}
/>
)}
</div>
</div>
</>
Expand Down
20 changes: 16 additions & 4 deletions src/components/Executions/ExecutionInputsOutputsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ const RemoteExecutionInputs: React.FC<{ execution: Execution }> = ({
const executionData = useWorkflowExecutionData(execution.id);
return (
<WaitForData {...executionData} spinnerVariant="none">
{() => <RemoteLiteralMapViewer blob={executionData.value.inputs} />}
{() => {
executionData.value.fullInputs !== undefined ? (
<LiteralMapViewer map={executionData.value.fullInputs} />
) : (
<RemoteLiteralMapViewer blob={executionData.value.inputs} />
);
}}
</WaitForData>
);
};
Expand All @@ -53,9 +59,15 @@ const RemoteExecutionOutputs: React.FC<{ execution: Execution }> = ({
const executionData = useWorkflowExecutionData(execution.id);
return (
<WaitForData {...executionData} spinnerVariant="none">
{() => (
<RemoteLiteralMapViewer blob={executionData.value.outputs} />
)}
{() => {
executionData.value.fullOutputs !== undefined ? (
<LiteralMapViewer map={executionData.value.fullOutputs} />
) : (
<RemoteLiteralMapViewer
blob={executionData.value.outputs}
/>
);
}}
</WaitForData>
);
};
Expand Down
2 changes: 2 additions & 0 deletions src/models/Execution/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,6 @@ export interface TaskExecutionClosure extends Admin.ITaskExecutionClosure {
export interface ExecutionData {
inputs: UrlBlob;
outputs: UrlBlob;
fullInputs?: LiteralMap;
fullOutputs?: LiteralMap;
}

0 comments on commit b22923f

Please sign in to comment.