"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const ClusterWizardFooter_1 = tslib_1.__importDefault(require("../ClusterWizardFooter"));
const ClusterWizardContext_1 = require("../ClusterWizardContext");
const common_1 = require("../../../../common");
const ClusterWizardNavigation_1 = tslib_1.__importDefault(require("../ClusterWizardNavigation"));
const WithErrorBoundary_1 = require("../../../../common/components/ErrorHandling/WithErrorBoundary");
const react_core_1 = require("@patternfly/react-core");
const formik_1 = require("formik");
const file_saver_1 = require("file-saver");
const react_router_dom_v5_compat_1 = require("react-router-dom-v5-compat");
const operatorSpecs_1 = require("../../../../common/components/operators/operatorSpecs");
const downloadUrl = 'https://mirror.openshift.com/pub/cgw/assisted-installer-disconnected/latest/agent-ove.x86_64.iso';
const ReviewStep = () => {
    const { moveBack } = (0, ClusterWizardContext_1.useClusterWizardContext)();
    const opSpecs = (0, operatorSpecs_1.getOperatorSpecs)(() => undefined);
    const navigate = (0, react_router_dom_v5_compat_1.useNavigate)();
    return (React.createElement(formik_1.Formik, { initialValues: {}, onSubmit: () => {
            // nothing to do
        } },
        React.createElement(common_1.ClusterWizardStep, { navigation: React.createElement(ClusterWizardNavigation_1.default, null), footer: React.createElement(ClusterWizardFooter_1.default, { onNext: () => {
                    downloadUrl && (0, file_saver_1.saveAs)(downloadUrl);
                    navigate('/cluster-list');
                }, onBack: moveBack, nextButtonText: "Download ISO" }) },
            React.createElement(WithErrorBoundary_1.WithErrorBoundary, { title: "Failed to load Review step" },
                React.createElement(react_core_1.Grid, { hasGutter: true },
                    React.createElement(react_core_1.Split, null,
                        React.createElement(react_core_1.SplitItem, null,
                            React.createElement(react_core_1.Content, { component: "h2" }, "Review and download ISO")),
                        React.createElement(react_core_1.SplitItem, null,
                            React.createElement(common_1.TechnologyPreview, null))),
                    React.createElement(react_core_1.Alert, { isInline: true, variant: "info", title: "Discovery ISO boot instructions" },
                        React.createElement(react_core_1.List, { component: react_core_1.ListComponent.ol, type: react_core_1.OrderType.number },
                            React.createElement(react_core_1.ListItem, null, "Download ISO"),
                            React.createElement(react_core_1.ListItem, null,
                                "Download or copy your pull secret from",
                                ' ',
                                React.createElement("a", { href: common_1.PULL_SECRET_INFO_LINK, target: "_blank", rel: "noopener noreferrer" }, "here")),
                            React.createElement(react_core_1.ListItem, null, "Boot your cluster's machines from this ISO and follow instructions"),
                            React.createElement(react_core_1.ListItem, null, "Provide your pull secret inside the installation wizard when requested"))),
                    React.createElement(react_core_1.Alert, { isInline: true, isExpandable: true, variant: "info", title: "List of available operators" },
                        React.createElement(react_core_1.List, null, common_1.singleClusterOperators.map((o) => {
                            const operator = Object.values(opSpecs)
                                .flatMap((op) => op)
                                .find((op) => op.operatorKey === o);
                            return React.createElement(react_core_1.ListItem, { key: o }, operator ? operator.title : o);
                        }))),
                    React.createElement(react_core_1.DescriptionList, { isHorizontal: true },
                        React.createElement(react_core_1.DescriptionListGroup, null,
                            React.createElement(react_core_1.DescriptionListTerm, null, "OpenShift version"),
                            React.createElement(react_core_1.DescriptionListDescription, null, "4.20")),
                        React.createElement(react_core_1.DescriptionListGroup, null,
                            React.createElement(react_core_1.DescriptionListTerm, null, "CPU architecture"),
                            React.createElement(react_core_1.DescriptionListDescription, null, "x86_64")),
                        React.createElement(react_core_1.DescriptionListGroup, null,
                            React.createElement(react_core_1.DescriptionListTerm, null, "ISO size"),
                            React.createElement(react_core_1.DescriptionListDescription, null, "approx. 43.5GB"))))))));
};
exports.default = ReviewStep;
//# sourceMappingURL=ReviewStep.js.map