updating generate command to generate deploy script

This commit is contained in:
Edmond Lee 2020-05-21 15:27:34 -07:00
parent d5089bfa13
commit c8b1ff0e9e
5 changed files with 9 additions and 9 deletions

View File

@ -7,7 +7,7 @@ import { DeployAction } from '../../redux/actions/deploy';
import { DryRunAction } from '../../redux/actions/dry-run'; import { DryRunAction } from '../../redux/actions/dry-run';
import { EvaluateFunctionAction } from '../../redux/actions/evaluate-function'; import { EvaluateFunctionAction } from '../../redux/actions/evaluate-function';
import { EvaluateValueAction } from '../../redux/actions/evaluate-value'; import { EvaluateValueAction } from '../../redux/actions/evaluate-value';
import { GenerateCommandAction } from '../../redux/actions/generate-command'; import { GenerateDeployScript } from '../../redux/actions/generate-deploy-script';
import { AppState } from '../../redux/app'; import { AppState } from '../../redux/app';
import { ChangeDispatchedAction, ChangeSelectedAction, CommandState } from '../../redux/command'; import { ChangeDispatchedAction, ChangeSelectedAction, CommandState } from '../../redux/command';
import { Command } from '../../redux/types'; import { Command } from '../../redux/types';
@ -17,7 +17,7 @@ import { DeployPaneComponent } from './deploy-pane';
import { DryRunPaneComponent } from './dry-run-pane'; import { DryRunPaneComponent } from './dry-run-pane';
import { EvaluateFunctionPaneComponent } from './evaluate-function-pane'; import { EvaluateFunctionPaneComponent } from './evaluate-function-pane';
import { EvaluateValuePaneComponent } from './evaluate-value-pane'; import { EvaluateValuePaneComponent } from './evaluate-value-pane';
import { GenerateCommandPaneComponent } from './generate-command-pane'; import { GenerateDeployScriptPane } from './generate-deploy-script-pane';
const Container = styled.div<{ visible?: boolean }>` const Container = styled.div<{ visible?: boolean }>`
position: absolute; position: absolute;
@ -77,7 +77,7 @@ function createAction(command: Command) {
case Command.EvaluateFunction: case Command.EvaluateFunction:
return new EvaluateFunctionAction(); return new EvaluateFunctionAction();
case Command.GenerateCommand: case Command.GenerateCommand:
return new GenerateCommandAction(); return new GenerateDeployScript();
default: default:
throw new Error('Unsupported command'); throw new Error('Unsupported command');
} }
@ -148,7 +148,7 @@ export const ConfigureTabComponent = (props: {
<EvaluateValuePaneComponent></EvaluateValuePaneComponent> <EvaluateValuePaneComponent></EvaluateValuePaneComponent>
)) || )) ||
(command === Command.GenerateCommand && ( (command === Command.GenerateCommand && (
<GenerateCommandPaneComponent></GenerateCommandPaneComponent> <GenerateDeployScriptPane></GenerateDeployScriptPane>
))} ))}
</Container> </Container>
); );

View File

@ -18,7 +18,7 @@ const Container = styled.div`
overflow: auto; overflow: auto;
`; `;
export const GenerateCommandPaneComponent = () => { export const GenerateDeployScriptPane = () => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const tool = useSelector<AppState, GenerateCommandState['tool']>( const tool = useSelector<AppState, GenerateCommandState['tool']>(

View File

@ -24,7 +24,7 @@ const Pre = styled.pre`
margin: 0; margin: 0;
`; `;
export const GenerateCommandOutputPane = () => { export const GenerateDeployScriptOutputPane = () => {
const output = useSelector<AppState, ResultState['output']>( const output = useSelector<AppState, ResultState['output']>(
state => state.result.output state => state.result.output
); );

View File

@ -8,7 +8,7 @@ import { ResultState } from '../../redux/result';
import { Command } from '../../redux/types'; import { Command } from '../../redux/types';
import { CompileOutputPane } from './compile-output-pane'; import { CompileOutputPane } from './compile-output-pane';
import { DeployOutputPane } from './deploy-output-pane'; import { DeployOutputPane } from './deploy-output-pane';
import { GenerateCommandOutputPane } from './generate-command-output-pane'; import { GenerateDeployScriptOutputPane } from './generate-deploy-script-output-pane';
import { Loading } from './loading'; import { Loading } from './loading';
import { OutputPane } from './output-pane'; import { OutputPane } from './output-pane';
@ -56,7 +56,7 @@ export const OutputTab = (props: {
} else if (command === Command.Deploy) { } else if (command === Command.Deploy) {
return <DeployOutputPane></DeployOutputPane>; return <DeployOutputPane></DeployOutputPane>;
} else if (command === Command.GenerateCommand) { } else if (command === Command.GenerateCommand) {
return <GenerateCommandOutputPane></GenerateCommandOutputPane>; return <GenerateDeployScriptOutputPane></GenerateDeployScriptOutputPane>;
} }
return <OutputPane></OutputPane>; return <OutputPane></OutputPane>;

View File

@ -22,7 +22,7 @@ export async function fetchRandomPrivateKey(): Promise<string> {
return response.text(); return response.text();
} }
export class GenerateCommandAction extends CancellableAction { export class GenerateDeployScript extends CancellableAction {
getAction() { getAction() {
return async (dispatch: Dispatch, getState: () => AppState) => { return async (dispatch: Dispatch, getState: () => AppState) => {
dispatch({ ...new UpdateLoadingAction('Compiling contract...') }); dispatch({ ...new UpdateLoadingAction('Compiling contract...') });