mirror of
https://github.com/ZwareBear/awx.git
synced 2026-03-31 05:03:35 -05:00
Adds steps for NodeType, RunType, Inventory, Credentials, updates Reducers, adds API calls, adds Add functionality to Visualizer; Adds other prompt step Adds SurveyStep refactors add node functionality
41 lines
876 B
JavaScript
41 lines
876 B
JavaScript
import React from 'react';
|
|
import { t } from '@lingui/macro';
|
|
import PreviewStep from './PreviewStep';
|
|
|
|
const STEP_ID = 'preview';
|
|
|
|
export default function usePreviewStep(
|
|
config,
|
|
i18n,
|
|
resource,
|
|
survey,
|
|
hasErrors,
|
|
needsPreviewStep
|
|
) {
|
|
const showStep = needsPreviewStep && resource && Object.keys(config).length > 0;
|
|
return {
|
|
step: showStep
|
|
? {
|
|
id: STEP_ID,
|
|
key: 7,
|
|
name: i18n._(t`Preview`),
|
|
component: (
|
|
<PreviewStep
|
|
config={config}
|
|
resource={resource}
|
|
survey={survey}
|
|
formErrors={hasErrors}
|
|
/>
|
|
),
|
|
enableNext: !hasErrors,
|
|
nextButtonText: i18n._(t`Launch`),
|
|
}
|
|
: null,
|
|
initialValues: {},
|
|
validate: () => ({}),
|
|
isReady: true,
|
|
error: null,
|
|
setTouched: () => {},
|
|
};
|
|
}
|