certificate edit
@@ -4,11 +4,11 @@ import { push } from "connected-react-router";
import { BasePage } from "pages/BasePage";
import React from "react";
import { connect } from "react-redux";
-// import { CertificateForm } from "forms/Certificate";
import { RootState } from "reducers";
import { TDispatchProp } from "types";
import { CertificateFormTypeContent, selfManaged } from "types/certificate";
import { H6 } from "widgets/Label";
+import { CertificateForm } from "forms/Certificate";
const mapStateToProps = (state: RootState, ownProps: any) => {
const certificate = state
@@ -16,7 +16,9 @@ const mapStateToProps = (state: RootState, ownProps: any) => {
.get("certificates")
.find((certificate) => certificate.get("name") === ownProps.match.params.name);
return {
- initialValues: certificate ? certificate.merge({ managedType: selfManaged }) : undefined,
+ initialValues: (certificate
+ ? Object.assign(certificate.toJS(), { managedType: selfManaged, domains: certificate.get("domains") })
+ : undefined) as CertificateFormTypeContent | undefined,
};
};
@@ -52,12 +54,7 @@ class CertificateEditRaw extends React.PureComponent<Props> {
<div className={classes.root}>
<Grid container spacing={2}>
<Grid item xs={8} sm={8} md={8}>
- {/* <CertificateForm
- isEdit
- onSubmitSuccess={this.onSubmitSuccess}
- onSubmit={this.submit}
- initialValues={initialValues}
- /> */}
+ <CertificateForm isEdit onSubmit={this.submit} initialValues={initialValues} />
</Grid>
</Grid>
</div>
